@wangeditor-next/plugin-float-image 2.0.0 → 2.0.1

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.
@@ -7,7 +7,7 @@ import type { VideoElement } from 'packages/video-module/src/module/custom-types
7
7
  import type { Descendant, Node, NodeEntry, Range } from 'slate';
8
8
  import type { IDomEditor } from '../editor/interface';
9
9
  import type { IMenuGroup } from '../menus/interface';
10
- import type { IUploadConfig } from '../upload';
10
+ import type { IUploadConfig } from '../upload/interface';
11
11
  import type { DOMElement } from '../utils/dom';
12
12
  interface IHoverbarConf {
13
13
  [key: string]: {
@@ -54,6 +54,15 @@ export declare const DomEditor: {
54
54
  * Find the native DOM element from a Slate node or editor.
55
55
  */
56
56
  toDOMNode(editor: IDomEditor, node: Node): HTMLElement;
57
+ /**
58
+ * Check if a Slate node currently has a mapped DOM node.
59
+ * During IME/composition transitions the Slate tree can update before DOM patching finishes.
60
+ */
61
+ hasDOMNodeBySlateNode(editor: IDomEditor, node: Node): boolean;
62
+ /**
63
+ * Check if both range endpoints can be resolved to DOM nodes right now.
64
+ */
65
+ canResolveDOMRange(editor: IDomEditor, range: Range): boolean;
57
66
  /**
58
67
  * Check if a DOM node is within the editor.
59
68
  */
@@ -8,6 +8,8 @@ import type { IRegisterMenuConf } from './menus/index';
8
8
  import type { IParseElemHtmlConf, IPreParseHtmlConf, ParseStyleHtmlFnType } from './parse-html/index';
9
9
  import type { IRenderElemConf, RenderStyleFnType } from './render/index';
10
10
  import type { IElemToHtmlConf, styleToHtmlFnType } from './to-html/index';
11
+ import createUploaderRuntime from './upload/createUploader';
12
+ import type { IUploadConfig } from './upload/interface';
11
13
  export * from './create/index';
12
14
  export type { ClassStylePolicy, IClassStyleUnsupportedPayload, IEditorConfig, IToolbarConfig, IUploadImageConfig, IUploadVideoConfig, StyleClassTokenType, TextStyleMode, } from './config/interface';
13
15
  export * from './config/style-mode';
@@ -17,7 +19,15 @@ export * from './render/index';
17
19
  export * from './to-html/index';
18
20
  export * from './parse-html/index';
19
21
  export * from './menus/index';
20
- export * from './upload/index';
22
+ export type { IUploadAdapter, IUploadAdapterContext, IUploadConfig, IUploader, IUploadFile, IUploadResultFile, } from './upload/interface';
23
+ /**
24
+ * @deprecated Please import from `@wangeditor-next/core/upload`.
25
+ */
26
+ export declare const createUploader: typeof createUploaderRuntime;
27
+ /**
28
+ * @deprecated Please import from `@wangeditor-next/core/upload`.
29
+ */
30
+ export declare function createUppyUploader(config: IUploadConfig): import("./upload/interface").IUploader;
21
31
  export * from './i18n/index';
22
32
  export * from './utils/dom';
23
33
  export interface IModuleConf {
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @description upload entry
3
+ * @author cycleccc
4
+ */
5
+ export * from './upload/index';
@@ -10,8 +10,9 @@ import './register-builtin-modules/index';
10
10
  import './init-default-config';
11
11
  import Boot from './Boot';
12
12
  export { Boot };
13
- export type { ClassStylePolicy, IButtonMenu, IClassStyleUnsupportedPayload, IDomEditor, IDropPanelMenu, IEditorConfig, IModalMenu, IModuleConf, ISelectMenu, IToolbarConfig, IUploadConfig, StyleClassTokenType, TextStyleMode, } from '@wangeditor-next/core';
14
- export { createUploader, DomEditor, genModalButtonElems, genModalInputElems, genModalTextareaElems, getTextStyleMode, i18nAddResources, i18nChangeLanguage, i18nGetResources, t, Toolbar, } from '@wangeditor-next/core';
13
+ export type { ClassStylePolicy, IButtonMenu, IClassStyleUnsupportedPayload, IDomEditor, IDropPanelMenu, IEditorConfig, IModalMenu, IModuleConf, IOption, ISelectMenu, IToolbarConfig, IUploadConfig, StyleClassTokenType, TextStyleMode, } from '@wangeditor-next/core';
14
+ export { DomEditor, genModalButtonElems, genModalInputElems, genModalTextareaElems, getClassStylePolicy, getTextStyleMode, i18nAddResources, i18nChangeLanguage, i18nGetResources, reportUnsupportedClassStyle, t, Toolbar, } from '@wangeditor-next/core';
15
+ export { createUploader } from '@wangeditor-next/core/upload';
15
16
  export type { Descendant as SlateDescendant, Location as SlateLocation, } from 'slate';
16
17
  export { Editor as SlateEditor, Element as SlateElement, Node as SlateNode, Path as SlatePath, Point as SlatePoint, Range as SlateRange, Text as SlateText, Transforms as SlateTransforms, } from 'slate';
17
18
  export { createEditor, createToolbar } from './create';
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(t,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r(require("@wangeditor-next/editor"),require("dom7"),require("snabbdom")):"function"==typeof define&&define.amd?define(["@wangeditor-next/editor","dom7","snabbdom"],r):(t="undefined"!=typeof globalThis?globalThis:t||self).WangEditorFloatImagePlugin=r(t.editor,t.$,t.snabbdom)}(this,function(t,r,n){"use strict";t.i18nAddResources("en",{float:{none:"Default",left:"Float Left",right:"Float Right"}}),t.i18nAddResources("zh-CN",{float:{none:"默认",left:"左浮动",right:"右浮动"}});var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var o,u,a={};function f(){if(u)return o;u=1;var t=function(t){return t&&t.Math===Math&&t};return o=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof e&&e)||t("object"==typeof o&&o)||function(){return this}()||Function("return this")()}var c,l,s,v,d,p,h,g,y={};function m(){return l?c:(l=1,c=function(t){try{return!!t()}catch(t){return!0}})}function b(){if(v)return s;v=1;var t=m();return s=!t(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}function w(){if(p)return d;p=1;var t=m();return d=!t(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})}function x(){if(g)return h;g=1;var t=w(),r=Function.prototype.call;return h=t?r.bind(r):function(){return r.apply(r,arguments)},h}var S,O,j,E,T,q,A,C,P,I,R,N,M,F,D,_,k,z,L,$,B,W,Z,U,H,G,K,X,Y,V,J,Q,tt,rt,nt,et,it,ot,ut,at,ft,ct={};function lt(){return j?O:(j=1,O=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}})}function st(){if(T)return E;T=1;var t=w(),r=Function.prototype,n=r.call,e=t&&r.bind.bind(n,n);return E=t?e:function(t){return function(){return n.apply(t,arguments)}},E}function vt(){if(A)return q;A=1;var t=st(),r=t({}.toString),n=t("".slice);return q=function(t){return n(r(t),8,-1)}}function dt(){if(P)return C;P=1;var t=st(),r=m(),n=vt(),e=Object,i=t("".split);return C=r(function(){return!e("z").propertyIsEnumerable(0)})?function(t){return"String"===n(t)?i(t,""):e(t)}:e}function pt(){return R?I:(R=1,I=function(t){return null==t})}function ht(){if(M)return N;M=1;var t=pt(),r=TypeError;return N=function(n){if(t(n))throw new r("Can't call method on "+n);return n}}function gt(){if(D)return F;D=1;var t=dt(),r=ht();return F=function(n){return t(r(n))}}function yt(){if(k)return _;k=1;var t="object"==typeof document&&document.all;return _=void 0===t&&void 0!==t?function(r){return"function"==typeof r||r===t}:function(t){return"function"==typeof t}}function mt(){if(L)return z;L=1;var t=yt();return z=function(r){return"object"==typeof r?null!==r:t(r)}}function bt(){if(B)return $;B=1;var t=f(),r=yt();return $=function(n,e){return arguments.length<2?(i=t[n],r(i)?i:void 0):t[n]&&t[n][e];var i},$}function wt(){if(K)return G;K=1;var t,r,n=f(),e=function(){if(H)return U;H=1;var t=f().navigator,r=t&&t.userAgent;return U=r?String(r):""}(),i=n.process,o=n.Deno,u=i&&i.versions||o&&o.version,a=u&&u.v8;return a&&(r=(t=a.split("."))[0]>0&&t[0]<4?1:+(t[0]+t[1])),!r&&e&&(!(t=e.match(/Edge\/(\d+)/))||t[1]>=74)&&(t=e.match(/Chrome\/(\d+)/))&&(r=+t[1]),G=r}function xt(){if(Y)return X;Y=1;var t=wt(),r=m(),n=f().String;return X=!!Object.getOwnPropertySymbols&&!r(function(){var r=Symbol("symbol detection");return!n(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&t&&t<41})}function St(){if(J)return V;J=1;var t=xt();return V=t&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function Ot(){if(tt)return Q;tt=1;var t=bt(),r=yt(),n=function(){if(Z)return W;Z=1;var t=st();return W=t({}.isPrototypeOf)}(),e=St(),i=Object;return Q=e?function(t){return"symbol"==typeof t}:function(e){var o=t("Symbol");return r(o)&&n(o.prototype,i(e))}}function jt(){if(nt)return rt;nt=1;var t=String;return rt=function(r){try{return t(r)}catch(t){return"Object"}}}function Et(){if(it)return et;it=1;var t=yt(),r=jt(),n=TypeError;return et=function(e){if(t(e))return e;throw new n(r(e)+" is not a function")}}function Tt(){if(ut)return ot;ut=1;var t=Et(),r=pt();return ot=function(n,e){var i=n[e];return r(i)?void 0:t(i)}}function qt(){if(ft)return at;ft=1;var t=x(),r=yt(),n=mt(),e=TypeError;return at=function(i,o){var u,a;if("string"===o&&r(u=i.toString)&&!n(a=t(u,i)))return a;if(r(u=i.valueOf)&&!n(a=t(u,i)))return a;if("string"!==o&&r(u=i.toString)&&!n(a=t(u,i)))return a;throw new e("Can't convert object to primitive value")}}var At,Ct,Pt,It,Rt,Nt,Mt,Ft,Dt,_t,kt,zt,Lt,$t,Bt,Wt,Zt,Ut,Ht,Gt,Kt,Xt,Yt,Vt,Jt={exports:{}};function Qt(){if(It)return Pt;It=1;var t=f(),r=Object.defineProperty;return Pt=function(n,e){try{r(t,n,{value:e,configurable:!0,writable:!0})}catch(r){t[n]=e}return e}}function tr(){if(Rt)return Jt.exports;Rt=1;var t=Ct?At:(Ct=1,At=!1),r=f(),n=Qt(),e="__core-js_shared__",i=Jt.exports=r[e]||n(e,{});return(i.versions||(i.versions=[])).push({version:"3.47.0",mode:t?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.47.0/LICENSE",source:"https://github.com/zloirock/core-js"}),Jt.exports}function rr(){if(Mt)return Nt;Mt=1;var t=tr();return Nt=function(r,n){return t[r]||(t[r]=n||{})}}function nr(){if(Dt)return Ft;Dt=1;var t=ht(),r=Object;return Ft=function(n){return r(t(n))}}function er(){if(kt)return _t;kt=1;var t=st(),r=nr(),n=t({}.hasOwnProperty);return _t=Object.hasOwn||function(t,e){return n(r(t),e)}}function ir(){if(Lt)return zt;Lt=1;var t=st(),r=0,n=Math.random(),e=t(1.1.toString);return zt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+e(++r+n,36)}}function or(){if(Bt)return $t;Bt=1;var t=f(),r=rr(),n=er(),e=ir(),i=xt(),o=St(),u=t.Symbol,a=r("wks"),c=o?u.for||u:u&&u.withoutSetter||e;return $t=function(t){return n(a,t)||(a[t]=i&&n(u,t)?u[t]:c("Symbol."+t)),a[t]}}function ur(){if(Zt)return Wt;Zt=1;var t=x(),r=mt(),n=Ot(),e=Tt(),i=qt(),o=or(),u=TypeError,a=o("toPrimitive");return Wt=function(o,f){if(!r(o)||n(o))return o;var c,l=e(o,a);if(l){if(void 0===f&&(f="default"),c=t(l,o,f),!r(c)||n(c))return c;throw new u("Can't convert object to primitive value")}return void 0===f&&(f="number"),i(o,f)}}function ar(){if(Ht)return Ut;Ht=1;var t=ur(),r=Ot();return Ut=function(n){var e=t(n,"string");return r(e)?e:e+""}}function fr(){if(Kt)return Gt;Kt=1;var t=f(),r=mt(),n=t.document,e=r(n)&&r(n.createElement);return Gt=function(t){return e?n.createElement(t):{}}}function cr(){if(Yt)return Xt;Yt=1;var t=b(),r=m(),n=fr();return Xt=!t&&!r(function(){return 7!==Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a})}function lr(){if(Vt)return y;Vt=1;var t=b(),r=x(),n=function(){if(S)return ct;S=1;var t={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,n=r&&!t.call({1:2},1);return ct.f=n?function(t){var n=r(this,t);return!!n&&n.enumerable}:t,ct}(),e=lt(),i=gt(),o=ar(),u=er(),a=cr(),f=Object.getOwnPropertyDescriptor;return y.f=t?f:function(t,c){if(t=i(t),c=o(c),a)try{return f(t,c)}catch(t){}if(u(t,c))return e(!r(n.f,t,c),t[c])},y}var sr,vr,dr,pr,hr,gr,yr,mr={};function br(){if(vr)return sr;vr=1;var t=b(),r=m();return sr=t&&r(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}function wr(){if(pr)return dr;pr=1;var t=mt(),r=String,n=TypeError;return dr=function(e){if(t(e))return e;throw new n(r(e)+" is not an object")}}function xr(){if(hr)return mr;hr=1;var t=b(),r=cr(),n=br(),e=wr(),i=ar(),o=TypeError,u=Object.defineProperty,a=Object.getOwnPropertyDescriptor,f="enumerable",c="configurable",l="writable";return mr.f=t?n?function(t,r,n){if(e(t),r=i(r),e(n),"function"==typeof t&&"prototype"===r&&"value"in n&&l in n&&!n[l]){var o=a(t,r);o&&o[l]&&(t[r]=n.value,n={configurable:c in n?n[c]:o[c],enumerable:f in n?n[f]:o[f],writable:!1})}return u(t,r,n)}:u:function(t,n,a){if(e(t),n=i(n),e(a),r)try{return u(t,n,a)}catch(t){}if("get"in a||"set"in a)throw new o("Accessors not supported");return"value"in a&&(t[n]=a.value),t},mr}function Sr(){if(yr)return gr;yr=1;var t=b(),r=xr(),n=lt();return gr=t?function(t,e,i){return r.f(t,e,n(1,i))}:function(t,r,n){return t[r]=n,t}}var Or,jr,Er,Tr,qr,Ar,Cr,Pr,Ir,Rr,Nr,Mr,Fr,Dr,_r,kr={exports:{}};function zr(){if(jr)return Or;jr=1;var t=b(),r=er(),n=Function.prototype,e=t&&Object.getOwnPropertyDescriptor,i=r(n,"name"),o=i&&"something"===function(){}.name,u=i&&(!t||t&&e(n,"name").configurable);return Or={EXISTS:i,PROPER:o,CONFIGURABLE:u}}function Lr(){if(Tr)return Er;Tr=1;var t=st(),r=yt(),n=tr(),e=t(Function.toString);return r(n.inspectSource)||(n.inspectSource=function(t){return e(t)}),Er=n.inspectSource}function $r(){if(Pr)return Cr;Pr=1;var t=rr(),r=ir(),n=t("keys");return Cr=function(t){return n[t]||(n[t]=r(t))}}function Br(){return Rr?Ir:(Rr=1,Ir={})}function Wr(){if(Mr)return Nr;Mr=1;var t,r,n,e=function(){if(Ar)return qr;Ar=1;var t=f(),r=yt(),n=t.WeakMap;return qr=r(n)&&/native code/.test(String(n))}(),i=f(),o=mt(),u=Sr(),a=er(),c=tr(),l=$r(),s=Br(),v="Object already initialized",d=i.TypeError,p=i.WeakMap;if(e||c.state){var h=c.state||(c.state=new p);h.get=h.get,h.has=h.has,h.set=h.set,t=function(t,r){if(h.has(t))throw new d(v);return r.facade=t,h.set(t,r),r},r=function(t){return h.get(t)||{}},n=function(t){return h.has(t)}}else{var g=l("state");s[g]=!0,t=function(t,r){if(a(t,g))throw new d(v);return r.facade=t,u(t,g,r),r},r=function(t){return a(t,g)?t[g]:{}},n=function(t){return a(t,g)}}return Nr={set:t,get:r,has:n,enforce:function(e){return n(e)?r(e):t(e,{})},getterFor:function(t){return function(n){var e;if(!o(n)||(e=r(n)).type!==t)throw new d("Incompatible receiver, "+t+" required");return e}}}}function Zr(){if(Fr)return kr.exports;Fr=1;var t=st(),r=m(),n=yt(),e=er(),i=b(),o=zr().CONFIGURABLE,u=Lr(),a=Wr(),f=a.enforce,c=a.get,l=String,s=Object.defineProperty,v=t("".slice),d=t("".replace),p=t([].join),h=i&&!r(function(){return 8!==s(function(){},"length",{value:8}).length}),g=String(String).split("String"),y=kr.exports=function(t,r,n){"Symbol("===v(l(r),0,7)&&(r="["+d(l(r),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(r="get "+r),n&&n.setter&&(r="set "+r),(!e(t,"name")||o&&t.name!==r)&&(i?s(t,"name",{value:r,configurable:!0}):t.name=r),h&&n&&e(n,"arity")&&t.length!==n.arity&&s(t,"length",{value:n.arity});try{n&&e(n,"constructor")&&n.constructor?i&&s(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var u=f(t);return e(u,"source")||(u.source=p(g,"string"==typeof r?r:"")),t};return Function.prototype.toString=y(function(){return n(this)&&c(this).source||u(this)},"toString"),kr.exports}function Ur(){if(_r)return Dr;_r=1;var t=yt(),r=xr(),n=Zr(),e=Qt();return Dr=function(i,o,u,a){a||(a={});var f=a.enumerable,c=void 0!==a.name?a.name:o;if(t(u)&&n(u,c,a),a.global)f?i[o]=u:e(o,u);else{try{a.unsafe?i[o]&&(f=!0):delete i[o]}catch(t){}f?i[o]=u:r.f(i,o,{value:u,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return i}}var Hr,Gr,Kr,Xr,Yr,Vr,Jr,Qr,tn,rn,nn,en,on,un,an,fn,cn,ln={};function sn(){if(Xr)return Kr;Xr=1;var t=function(){if(Gr)return Hr;Gr=1;var t=Math.ceil,r=Math.floor;return Hr=Math.trunc||function(n){var e=+n;return(e>0?r:t)(e)}}();return Kr=function(r){var n=+r;return n!=n||0===n?0:t(n)}}function vn(){if(Vr)return Yr;Vr=1;var t=sn(),r=Math.max,n=Math.min;return Yr=function(e,i){var o=t(e);return o<0?r(o+i,0):n(o,i)}}function dn(){if(Qr)return Jr;Qr=1;var t=sn(),r=Math.min;return Jr=function(n){var e=t(n);return e>0?r(e,9007199254740991):0}}function pn(){if(rn)return tn;rn=1;var t=dn();return tn=function(r){return t(r.length)}}function hn(){if(en)return nn;en=1;var t=gt(),r=vn(),n=pn(),e=function(e){return function(i,o,u){var a=t(i),f=n(a);if(0===f)return!e&&-1;var c,l=r(u,f);if(e&&o!=o){for(;f>l;)if((c=a[l++])!=c)return!0}else for(;f>l;l++)if((e||l in a)&&a[l]===o)return e||l||0;return!e&&-1}};return nn={includes:e(!0),indexOf:e(!1)}}function gn(){if(un)return on;un=1;var t=st(),r=er(),n=gt(),e=hn().indexOf,i=Br(),o=t([].push);return on=function(t,u){var a,f=n(t),c=0,l=[];for(a in f)!r(i,a)&&r(f,a)&&o(l,a);for(;u.length>c;)r(f,a=u[c++])&&(~e(l,a)||o(l,a));return l}}function yn(){return fn?an:(fn=1,an=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var mn,bn,wn,xn,Sn,On,jn,En,Tn,qn,An,Cn,Pn,In,Rn,Nn,Mn,Fn,Dn,_n,kn,zn,Ln,$n,Bn,Wn,Zn,Un,Hn={};function Gn(){if(wn)return bn;wn=1;var t=bt(),r=st(),n=function(){if(cn)return ln;cn=1;var t=gn(),r=yn().concat("length","prototype");return ln.f=Object.getOwnPropertyNames||function(n){return t(n,r)},ln}(),e=(mn||(mn=1,Hn.f=Object.getOwnPropertySymbols),Hn),i=wr(),o=r([].concat);return bn=t("Reflect","ownKeys")||function(t){var r=n.f(i(t)),u=e.f;return u?o(r,u(t)):r}}function Kn(){if(Sn)return xn;Sn=1;var t=er(),r=Gn(),n=lr(),e=xr();return xn=function(i,o,u){for(var a=r(o),f=e.f,c=n.f,l=0;l<a.length;l++){var s=a[l];t(i,s)||u&&t(u,s)||f(i,s,c(o,s))}}}function Xn(){if(Tn)return En;Tn=1;var t=f(),r=lr().f,n=Sr(),e=Ur(),i=Qt(),o=Kn(),u=function(){if(jn)return On;jn=1;var t=m(),r=yt(),n=/#|\.prototype\./,e=function(n,e){var f=o[i(n)];return f===a||f!==u&&(r(e)?t(e):!!e)},i=e.normalize=function(t){return String(t).replace(n,".").toLowerCase()},o=e.data={},u=e.NATIVE="N",a=e.POLYFILL="P";return On=e}();return En=function(a,f){var c,l,s,v,d,p=a.target,h=a.global,g=a.stat;if(c=h?t:g?t[p]||i(p,{}):t[p]&&t[p].prototype)for(l in f){if(v=f[l],s=a.dontCallGetSet?(d=r(c,l))&&d.value:c[l],!u(h?l:p+(g?".":"#")+l,a.forced)&&void 0!==s){if(typeof v==typeof s)continue;o(v,s)}(a.sham||s&&s.sham)&&n(v,"sham",!0),e(c,l,v,a)}}}function Yn(){if(An)return qn;An=1;var t=vt();return qn=Array.isArray||function(r){return"Array"===t(r)}}function Vn(){if(Pn)return Cn;Pn=1;var t=TypeError;return Cn=function(r){if(r>9007199254740991)throw t("Maximum allowed index exceeded");return r}}function Jn(){if(Rn)return In;Rn=1;var t=b(),r=xr(),n=lt();return In=function(e,i,o){t?r.f(e,i,n(0,o)):e[i]=o}}function Qn(){if(Mn)return Nn;Mn=1;var t={};return t[or()("toStringTag")]="z",Nn="[object z]"===String(t)}function te(){if(Dn)return Fn;Dn=1;var t=Qn(),r=yt(),n=vt(),e=or()("toStringTag"),i=Object,o="Arguments"===n(function(){return arguments}());return Fn=t?n:function(t){var u,a,f;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(a=function(t,r){try{return t[r]}catch(t){}}(u=i(t),e))?a:o?n(u):"Object"===(f=n(u))&&r(u.callee)?"Arguments":f}}function re(){if(kn)return _n;kn=1;var t=st(),r=m(),n=yt(),e=te(),i=bt(),o=Lr(),u=function(){},a=i("Reflect","construct"),f=/^\s*(?:class|function)\b/,c=t(f.exec),l=!f.test(u),s=function(t){if(!n(t))return!1;try{return a(u,[],t),!0}catch(t){return!1}},v=function(t){if(!n(t))return!1;switch(e(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return l||!!c(f,o(t))}catch(t){return!0}};return v.sham=!0,_n=!a||r(function(){var t;return s(s.call)||!s(Object)||!s(function(){t=!0})||t})?v:s}function ne(){if(Ln)return zn;Ln=1;var t=Yn(),r=re(),n=mt(),e=or()("species"),i=Array;return zn=function(o){var u;return t(o)&&(u=o.constructor,(r(u)&&(u===i||t(u.prototype))||n(u)&&null===(u=u[e]))&&(u=void 0)),void 0===u?i:u}}function ee(){if(Bn)return $n;Bn=1;var t=ne();return $n=function(r,n){return new(t(r))(0===n?0:n)}}function ie(){if(Zn)return Wn;Zn=1;var t=m(),r=or(),n=wt(),e=r("species");return Wn=function(r){return n>=51||!t(function(){var t=[];return(t.constructor={})[e]=function(){return{foo:1}},1!==t[r](Boolean).foo})}}!function(){if(Un)return a;Un=1;var t=Xn(),r=m(),n=Yn(),e=mt(),i=nr(),o=pn(),u=Vn(),f=Jn(),c=ee(),l=ie(),s=or(),v=wt(),d=s("isConcatSpreadable"),p=v>=51||!r(function(){var t=[];return t[d]=!1,t.concat()[0]!==t}),h=function(t){if(!e(t))return!1;var r=t[d];return void 0!==r?!!r:n(t)};t({target:"Array",proto:!0,arity:1,forced:!p||!l("concat")},{concat:function(t){var r,n,e,a,l,s=i(this),v=c(s,0),d=0;for(r=-1,e=arguments.length;r<e;r++)if(h(l=-1===r?s:arguments[r]))for(a=o(l),u(d+a),n=0;n<a;n++,d++)n in l&&f(v,d,l[n]);else u(d+1),f(v,d++,l);return v.length=d,v}})}();var oe,ue,ae,fe,ce,le,se,ve,de,pe={};function he(){if(ue)return oe;ue=1;var t=te(),r=String;return oe=function(n){if("Symbol"===t(n))throw new TypeError("Cannot convert a Symbol value to a string");return r(n)}}function ge(){return fe?ae:(fe=1,ae="\t\n\v\f\r                 \u2028\u2029\ufeff")}!function(){if(de)return pe;de=1;var t=Xn(),r=function(){if(le)return ce;le=1;var t=st(),r=ht(),n=he(),e=ge(),i=t("".replace),o=RegExp("^["+e+"]+"),u=RegExp("(^|[^"+e+"])["+e+"]+$"),a=function(t){return function(e){var a=n(r(e));return 1&t&&(a=i(a,o,"")),2&t&&(a=i(a,u,"$1")),a}};return ce={start:a(1),end:a(2),trim:a(3)}}().trim,n=function(){if(ve)return se;ve=1;var t=zr().PROPER,r=m(),n=ge();return se=function(e){return r(function(){return!!n[e]()||"​…᠎"!=="​…᠎"[e]()||t&&n[e].name!==e})}}();t({target:"String",proto:!0,forced:n("trim")},{trim:function(){return r(this)}})}();var ye={type:"image",elemToHtml:function(r,n,e){var i=r,o=i.src,u=i.alt,a=void 0===u?"":u,f=i.href,c=void 0===f?"":f,l=i.style,s=void 0===l?{}:l,v=s.width,d=void 0===v?"":v,p=s.height,h=void 0===p?"":p,g=s.float,y=void 0===g?"":g;if("class"===t.getTextStyleMode(e)){var m=d?' data-w-e-style-width="'.concat(d,'"'):"",b=h?' data-w-e-style-height="'.concat(h,'"'):"",w=y?' data-w-e-style-float="'.concat(y,'"'):"",x=function(t){var r=(t||"").trim().toLowerCase();return"left"===r?"w-e-float-image-left":"right"===r?"w-e-float-image-right":"none"===r?"w-e-float-image-none":""}(y),S=x?' class="'.concat(x,'"'):"";return'<img src="'.concat(o,'" alt="').concat(a,'" data-href="').concat(c,'" width="').concat(d,'" height="').concat(h,'"').concat(S).concat(m).concat(b).concat(w,"/>")}var O="";return d&&(O+="width: ".concat(d,";")),h&&(O+="height: ".concat(h,";")),y&&(O+="float: ".concat(y,";")),'<img src="'.concat(o,'" alt="').concat(a,'" data-href="').concat(c,'" style="').concat(O,'"/>')}},me=function(t,r){return me=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])},me(t,r)};function be(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}me(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var we=function(){return we=Object.assign||function(t){for(var r,n=1,e=arguments.length;n<e;n++)for(var i in r=arguments[n])Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i]);return t},we.apply(this,arguments)};function xe(t,r){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var e,i,o=n.call(t),u=[];try{for(;(void 0===r||r-- >0)&&!(e=o.next()).done;)u.push(e.value)}catch(t){i={error:t}}finally{try{e&&!e.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return u}function Se(t,r,n){if(n||2===arguments.length)for(var e,i=0,o=r.length;i<o;i++)!e&&i in r||(e||(e=Array.prototype.slice.call(r,0,i)),e[i]=r[i]);return t.concat(e||Array.prototype.slice.call(r))}"function"==typeof SuppressedError&&SuppressedError;var Oe,je,Ee,Te,qe={};function Ae(){if(je)return Oe;je=1;var t=wr();return Oe=function(){var r=t(this),n="";return r.hasIndices&&(n+="d"),r.global&&(n+="g"),r.ignoreCase&&(n+="i"),r.multiline&&(n+="m"),r.dotAll&&(n+="s"),r.unicode&&(n+="u"),r.unicodeSets&&(n+="v"),r.sticky&&(n+="y"),n}}function Ce(){if(Te)return Ee;Te=1;var t=m(),r=f().RegExp,n=t(function(){var t=r("a","y");return t.lastIndex=2,null!==t.exec("abcd")}),e=n||t(function(){return!r("a","y").sticky}),i=n||t(function(){var t=r("^r","gy");return t.lastIndex=2,null!==t.exec("str")});return Ee={BROKEN_CARET:i,MISSED_STICKY:e,UNSUPPORTED_Y:n}}var Pe,Ie,Re,Ne,Me,Fe,De,_e,ke,ze,Le,$e,Be,We,Ze={};function Ue(){if(Ie)return Pe;Ie=1;var t=gn(),r=yn();return Pe=Object.keys||function(n){return t(n,r)}}function He(){if(Me)return Ne;Me=1;var t=bt();return Ne=t("document","documentElement")}function Ge(){if(De)return Fe;De=1;var t,r=wr(),n=function(){if(Re)return Ze;Re=1;var t=b(),r=br(),n=xr(),e=wr(),i=gt(),o=Ue();return Ze.f=t&&!r?Object.defineProperties:function(t,r){e(t);for(var u,a=i(r),f=o(r),c=f.length,l=0;c>l;)n.f(t,u=f[l++],a[u]);return t},Ze}(),e=yn(),i=Br(),o=He(),u=fr(),a=$r(),f="prototype",c="script",l=a("IE_PROTO"),s=function(){},v=function(t){return"<"+c+">"+t+"</"+c+">"},d=function(t){t.write(v("")),t.close();var r=t.parentWindow.Object;return t=null,r},p=function(){try{t=new ActiveXObject("htmlfile")}catch(t){}var r,n,i;p="undefined"!=typeof document?document.domain&&t?d(t):(n=u("iframe"),i="java"+c+":",n.style.display="none",o.appendChild(n),n.src=String(i),(r=n.contentWindow.document).open(),r.write(v("document.F=Object")),r.close(),r.F):d(t);for(var a=e.length;a--;)delete p[f][e[a]];return p()};return i[l]=!0,Fe=Object.create||function(t,e){var i;return null!==t?(s[f]=r(t),i=new s,s[f]=null,i[l]=t):i=p(),void 0===e?i:n.f(i,e)}}function Ke(){if(Be)return $e;Be=1;var t,r,n=x(),e=st(),i=he(),o=Ae(),u=Ce(),a=rr(),c=Ge(),l=Wr().get,s=function(){if(ke)return _e;ke=1;var t=m(),r=f().RegExp;return _e=t(function(){var t=r(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)})}(),v=function(){if(Le)return ze;Le=1;var t=m(),r=f().RegExp;return ze=t(function(){var t=r("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")})}(),d=a("native-string-replace",String.prototype.replace),p=RegExp.prototype.exec,h=p,g=e("".charAt),y=e("".indexOf),b=e("".replace),w=e("".slice),S=(r=/b*/g,n(p,t=/a/,"a"),n(p,r,"a"),0!==t.lastIndex||0!==r.lastIndex),O=u.BROKEN_CARET,j=void 0!==/()??/.exec("")[1];return(S||j||O||s||v)&&(h=function(t){var r,e,u,a,f,s,v,m=this,x=l(m),E=i(t),T=x.raw;if(T)return T.lastIndex=m.lastIndex,r=n(h,T,E),m.lastIndex=T.lastIndex,r;var q=x.groups,A=O&&m.sticky,C=n(o,m),P=m.source,I=0,R=E;if(A&&(C=b(C,"y",""),-1===y(C,"g")&&(C+="g"),R=w(E,m.lastIndex),m.lastIndex>0&&(!m.multiline||m.multiline&&"\n"!==g(E,m.lastIndex-1))&&(P="(?: "+P+")",R=" "+R,I++),e=new RegExp("^(?:"+P+")",C)),j&&(e=new RegExp("^"+P+"$(?!\\s)",C)),S&&(u=m.lastIndex),a=n(p,A?e:m,R),A?a?(a.input=w(a.input,I),a[0]=w(a[0],I),a.index=m.lastIndex,m.lastIndex+=a[0].length):m.lastIndex=0:S&&a&&(m.lastIndex=m.global?a.index+a[0].length:u),j&&a&&a.length>1&&n(d,a[0],e,function(){for(f=1;f<arguments.length-2;f++)void 0===arguments[f]&&(a[f]=void 0)}),a&&q)for(a.groups=s=c(null),f=0;f<q.length;f++)s[(v=q[f])[0]]=a[v[1]];return a}),$e=h}function Xe(){if(We)return qe;We=1;var t=Xn(),r=Ke();return t({target:"RegExp",proto:!0,forced:/./.exec!==r},{exec:r}),qe}Xe();var Ye,Ve,Je,Qe,ti,ri,ni,ei=function(){function r(){this.tag="button"}return r.prototype.getValue=function(t){return""},r.prototype.isActive=function(t){return!1},r.prototype.getSelectedNode=function(r){return t.DomEditor.getSelectedNodeByType(r,"image")},r.prototype.isDisabled=function(t){return null==t.selection||null==this.getSelectedNode(t)},r.prototype.exec=function(r,n){if(!this.isDisabled(r)){var e=this.getSelectedNode(r);if(null!=e){var i=t.DomEditor.getHoverbar(r);i&&i.hideAndClean();var o=e.style,u={style:we(we({},void 0===o?{}:o),{float:this.value})};t.SlateTransforms.setNodes(r,u,{match:function(r){return t.DomEditor.checkNodeType(r,"image")}})}}},r}(),ii=function(r){function n(){var n=r.apply(this,Se([],xe(arguments),!1))||this;return n.title=t.t("float.left"),n.value="left",n.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M77.03514075 117.83964445m12.4275674 0l845.0745837 0q12.42756741 0 12.4275674 12.4275674l0 68.35162074q0 12.42756741-12.4275674 12.42756741l-845.0745837 0q-12.42756741 0-12.4275674-12.42756741l0-68.35162074q0-12.42756741 12.4275674-12.4275674Z"></path><path d="M77.03514075 801.35585185m12.4275674 0l845.0745837 0q12.42756741 0 12.4275674 12.42756741l0 68.35162074q0 12.42756741-12.4275674 12.42756742l-845.0745837 0q-12.42756741 0-12.4275674-12.42756742l0-68.35162074q0-12.42756741 12.4275674-12.42756741Z"></path><path d="M89.46270815 304.25315556h347.9718874c6.83516208 0 12.42756741 5.59240533 12.42756742 12.42756741v410.10972445a12.42756741 12.42756741 0 0 1-12.42756742 12.4275674h-347.9718874a12.42756741 12.42756741 0 0 1-12.4275674-12.4275674v-410.10972445c0-6.83516208 5.59240533-12.42756741 12.4275674-12.42756741z"></path><path d="M512 552.8045037m12.42756741 0l410.10972444 0q12.42756741 0 12.4275674 12.42756742l0 68.35162073q0 12.42756741-12.4275674 12.42756741l-410.10972444 0q-12.42756741 0-12.42756741-12.42756741l0-68.35162073q0-12.42756741 12.42756741-12.42756742Z"></path><path d="M512 366.39099259m12.42756741 0l410.10972444 0q12.42756741 0 12.4275674 12.42756741l0 68.35162075q0 12.42756741-12.4275674 12.4275674l-410.10972444 0q-12.42756741 0-12.42756741-12.4275674l0-68.35162075q0-12.42756741 12.42756741-12.42756741Z"></path></svg>',n}return be(n,r),n}(ei),oi=function(r){function n(){var n=r.apply(this,Se([],xe(arguments),!1))||this;return n.title=t.t("float.none"),n.value="none",n.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M76.73805432 117.83964445m12.42756741 0l845.0745837 0q12.42756741 0 12.42756741 12.4275674l0 68.35162074q0 12.42756741-12.42756741 12.42756741l-845.0745837 0q-12.42756741 0-12.42756741-12.42756741l0-68.35162074q0-12.42756741 12.42756741-12.4275674Z"></path><path d="M76.73805432 801.35585185m12.42756741 0l845.0745837 0q12.42756741 0 12.42756741 12.42756741l0 68.35162074q0 12.42756741-12.42756741 12.42756742l-845.0745837 0q-12.42756741 0-12.42756741-12.42756742l0-68.35162074q0-12.42756741 12.42756741-12.42756741Z"></path><path d="M89.16562173 304.25315556h410.10972444c6.83516208 0 12.42756741 5.59240533 12.42756741 12.42756741v410.10972445a12.42756741 12.42756741 0 0 1-12.42756741 12.4275674h-410.10972444a12.42756741 12.42756741 0 0 1-12.42756741-12.4275674v-410.10972445c0-6.83516208 5.59240533-12.42756741 12.42756741-12.42756741z"></path></svg>',n}return be(n,r),n}(ei),ui=function(r){function n(){var n=r.apply(this,Se([],xe(arguments),!1))||this;return n.title=t.t("float.right"),n.value="right",n.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M77.03514075 117.83964445m12.4275674 0l845.0745837 0q12.42756741 0 12.4275674 12.4275674l0 68.35162074q0 12.42756741-12.4275674 12.42756741l-845.0745837 0q-12.42756741 0-12.4275674-12.42756741l0-68.35162074q0-12.42756741 12.4275674-12.4275674Z"></path><path d="M77.03514075 801.35585185m12.4275674 0l845.0745837 0q12.42756741 0 12.4275674 12.42756741l0 68.35162074q0 12.42756741-12.4275674 12.42756742l-845.0745837 0q-12.42756741 0-12.4275674-12.42756742l0-68.35162074q0-12.42756741 12.4275674-12.42756741Z"></path><path d="M586.56540445 304.25315556h347.9718874c6.83516208 0 12.42756741 5.59240533 12.4275674 12.42756741v410.10972445a12.42756741 12.42756741 0 0 1-12.4275674 12.4275674h-347.9718874a12.42756741 12.42756741 0 0 1-12.42756742-12.4275674v-410.10972445c0-6.83516208 5.59240533-12.42756741 12.42756742-12.42756741z"></path><path d="M77.03514075 552.8045037m12.4275674 0l410.10972444 0q12.42756741 0 12.42756741 12.42756742l0 68.35162073q0 12.42756741-12.42756741 12.42756741l-410.10972444 0q-12.42756741 0-12.4275674-12.42756741l0-68.35162073q0-12.42756741 12.4275674-12.42756742Z"></path><path d="M77.03514075 366.39099259m12.4275674 0l410.10972444 0q12.42756741 0 12.42756741 12.42756741l0 68.35162075q0 12.42756741-12.42756741 12.4275674l-410.10972444 0q-12.42756741 0-12.4275674-12.4275674l0-68.35162075q0-12.42756741 12.4275674-12.42756741Z"></path></svg>',n}return be(n,r),n}(ei),ai={key:"imageFloatNone",factory:function(){return new oi}},fi={key:"imageFloatLeft",factory:function(){return new ii}},ci={key:"imageFloatRight",factory:function(){return new ui}},li={};function si(){if(Qe)return Je;Qe=1;var t=function(){if(Ve)return Ye;Ve=1;var t=vt(),r=st();return Ye=function(n){if("Function"===t(n))return r(n)}}(),r=Et(),n=w(),e=t(t.bind);return Je=function(t,i){return r(t),void 0===i?t:n?e(t,i):function(){return t.apply(i,arguments)}},Je}function vi(){if(ri)return ti;ri=1;var t=si(),r=st(),n=dt(),e=nr(),i=pn(),o=ee(),u=r([].push),a=function(r){var a=1===r,f=2===r,c=3===r,l=4===r,s=6===r,v=7===r,d=5===r||s;return function(p,h,g,y){for(var m,b,w=e(p),x=n(w),S=i(x),O=t(h,g),j=0,E=y||o,T=a?E(p,S):f||v?E(p,0):void 0;S>j;j++)if((d||j in x)&&(b=O(m=x[j],j,w),r))if(a)T[j]=b;else if(b)switch(r){case 3:return!0;case 5:return m;case 6:return j;case 2:u(T,m)}else switch(r){case 4:return!1;case 7:u(T,m)}return s?-1:c||l?l:T}};return ti={forEach:a(0),map:a(1),filter:a(2),some:a(3),every:a(4),find:a(5),findIndex:a(6),filterReject:a(7)}}!function(){if(ni)return li;ni=1;var t=Xn(),r=vi().filter;t({target:"Array",proto:!0,forced:!ie()("filter")},{filter:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}})}();var di,pi,hi,gi={};function yi(){if(pi)return di;pi=1;var t=or(),r=Ge(),n=xr().f,e=t("unscopables"),i=Array.prototype;return void 0===i[e]&&n(i,e,{configurable:!0,value:r(null)}),di=function(t){i[e][t]=!0}}!function(){if(hi)return gi;hi=1;var t=Xn(),r=hn().includes,n=m(),e=yi();t({target:"Array",proto:!0,forced:n(function(){return!Array(1).includes()})},{includes:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),e("includes")}();var mi,bi,wi,xi={};!function(){if(wi)return xi;wi=1;var t=Qn(),r=Ur(),n=function(){if(bi)return mi;bi=1;var t=Qn(),r=te();return mi=t?{}.toString:function(){return"[object "+r(this)+"]"}}();t||r(Object.prototype,"toString",n,{unsafe:!0})}();var Si,Oi,ji,Ei,Ti,qi,Ai,Ci={};function Pi(){if(Ei)return ji;Ei=1;var t=function(){if(Oi)return Si;Oi=1;var t=mt(),r=vt(),n=or()("match");return Si=function(e){var i;return t(e)&&(void 0!==(i=e[n])?!!i:"RegExp"===r(e))}}(),r=TypeError;return ji=function(n){if(t(n))throw new r("The method doesn't accept regular expressions");return n}}!function(){if(Ai)return Ci;Ai=1;var t=Xn(),r=st(),n=Pi(),e=ht(),i=he(),o=function(){if(qi)return Ti;qi=1;var t=or()("match");return Ti=function(r){var n=/./;try{"/./"[r](n)}catch(e){try{return n[t]=!1,"/./"[r](n)}catch(t){}}return!1}}(),u=r("".indexOf);t({target:"String",proto:!0,forced:!o("includes")},{includes:function(t){return!!~u(i(e(this)),i(n(t)),arguments.length>1?arguments[1]:void 0)}})}();var Ii,Ri,Ni,Mi,Fi,Di,_i,ki,zi,Li,$i,Bi,Wi,Zi={};function Ui(){if(Mi)return Ni;Mi=1;var t=re(),r=jt(),n=TypeError;return Ni=function(e){if(t(e))return e;throw new n(r(e)+" is not a constructor")}}function Hi(){if(Di)return Fi;Di=1;var t=wr(),r=Ui(),n=pt(),e=or()("species");return Fi=function(i,o){var u,a=t(i).constructor;return void 0===a||n(u=t(a)[e])?o:r(u)}}function Gi(){if(Li)return zi;Li=1;var t=function(){if(ki)return _i;ki=1;var t=st(),r=sn(),n=he(),e=ht(),i=t("".charAt),o=t("".charCodeAt),u=t("".slice),a=function(t){return function(a,f){var c,l,s=n(e(a)),v=r(f),d=s.length;return v<0||v>=d?t?"":void 0:(c=o(s,v))<55296||c>56319||v+1===d||(l=o(s,v+1))<56320||l>57343?t?i(s,v):c:t?u(s,v,v+2):l-56320+(c-55296<<10)+65536}};return _i={codeAt:a(!1),charAt:a(!0)}}().charAt;return zi=function(r,n,e){return n+(e?t(r,n).length:1)}}!function(){if(Wi)return Zi;Wi=1;var t=x(),r=st(),n=function(){if(Ri)return Ii;Ri=1,Xe();var t=x(),r=Ur(),n=Ke(),e=m(),i=or(),o=Sr(),u=i("species"),a=RegExp.prototype;return Ii=function(f,c,l,s){var v=i(f),d=!e(function(){var t={};return t[v]=function(){return 7},7!==""[f](t)}),p=d&&!e(function(){var t=!1,r=/a/;if("split"===f){var n={};n[u]=function(){return r},(r={constructor:n,flags:""})[v]=/./[v]}return r.exec=function(){return t=!0,null},r[v](""),!t});if(!d||!p||l){var h=/./[v],g=c(v,""[f],function(r,e,i,o,u){var f=e.exec;return f===n||f===a.exec?d&&!u?{done:!0,value:t(h,e,i,o)}:{done:!0,value:t(r,i,e,o)}:{done:!1}});r(String.prototype,f,g[0]),r(a,v,g[1])}s&&o(a[v],"sham",!0)}}(),e=wr(),i=mt(),o=ht(),u=Hi(),a=Gi(),f=dn(),c=he(),l=Tt(),s=function(){if(Bi)return $i;Bi=1;var t=x(),r=wr(),n=yt(),e=vt(),i=Ke(),o=TypeError;return $i=function(u,a){var f=u.exec;if(n(f)){var c=t(f,u,a);return null!==c&&r(c),c}if("RegExp"===e(u))return t(i,u,a);throw new o("RegExp#exec called on incompatible receiver")}}(),v=Ce(),d=m(),p=v.UNSUPPORTED_Y,h=Math.min,g=r([].push),y=r("".slice),b=!d(function(){var t=/(?:)/,r=t.exec;t.exec=function(){return r.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}),w="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length;n("split",function(r,n,v){var d="0".split(void 0,0).length?function(r,e){return void 0===r&&0===e?[]:t(n,this,r,e)}:n;return[function(n,e){var u=o(this),a=i(n)?l(n,r):void 0;return a?t(a,n,u,e):t(d,c(u),n,e)},function(t,r){var i=e(this),o=c(t);if(!w){var l=v(d,i,o,r,d!==n);if(l.done)return l.value}var m=u(i,RegExp),b=i.unicode,x=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(p?"g":"y"),S=new m(p?"^(?:"+i.source+")":i,x),O=void 0===r?4294967295:r>>>0;if(0===O)return[];if(0===o.length)return null===s(S,o)?[o]:[];for(var j=0,E=0,T=[];E<o.length;){S.lastIndex=p?0:E;var q,A=s(S,p?y(o,E):o);if(null===A||(q=h(f(S.lastIndex+(p?E:0)),o.length))===j)E=a(o,E,b);else{if(g(T,y(o,j,E)),T.length===O)return T;for(var C=1;C<=A.length-1;C++)if(g(T,A[C]),T.length===O)return T;E=j=q}}return g(T,y(o,j)),T}]},w||!b,p)}();var Ki,Xi={};!function(){if(Ki)return Xi;Ki=1;var t=Xn(),r=vi().find,n=yi(),e="find",i=!0;e in[]&&Array(1)[e](function(){i=!1}),t({target:"Array",proto:!0,forced:i},{find:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),n(e)}();var Yi,Vi,Ji={};function Qi(t,r){for(var n="",e=(t.attr("style")||"").split(";"),i=e.length,o=0;o<i;o+=1){var u=e[o];if(u){var a=u.split(":");a[0].trim()===r&&(n=a[1].trim())}}return n}Vi||(Vi=1,function(){if(Yi)return Ji;Yi=1;var t=Xn(),r=f();t({global:!0,forced:r.globalThis!==r},{globalThis:r})}()),r.css&&(r.fn.css=r.css),r.append&&(r.fn.append=r.append),r.prepend&&(r.fn.prepend=r.prepend),r.addClass&&(r.fn.addClass=r.addClass),r.removeClass&&(r.fn.removeClass=r.removeClass),r.hasClass&&(r.fn.hasClass=r.hasClass),r.on&&(r.fn.on=r.on),r.off&&(r.fn.off=r.off),r.focus&&(r.fn.focus=r.focus),r.attr&&(r.fn.attr=r.attr),r.removeAttr&&(r.fn.removeAttr=r.removeAttr),r.hide&&(r.fn.hide=r.hide),r.show&&(r.fn.show=r.show),r.parents&&(r.fn.parents=r.parents),r.dataset&&(r.fn.dataset=r.dataset),r.val&&(r.fn.val=r.val),r.text&&(r.fn.text=r.text),r.html&&(r.fn.html=r.html),r.children&&(r.fn.children=r.children),r.remove&&(r.fn.remove=r.remove),r.find&&(r.fn.find=r.find),r.width&&(r.fn.width=r.width),r.height&&(r.fn.height=r.height),r.filter&&(r.fn.filter=r.filter),r.empty&&(r.fn.empty=r.empty);var to,ro,no,eo,io,oo,uo,ao={selector:"img:not([data-w-e-type])",parseElemHtml:function(t,n,e){var i=r(t),o=i.attr("data-href")||"",u=i.attr("width")||"",a=i.attr("height")||"",f=Qi(i,"width")||i.attr("data-w-e-style-width")||u,c=Qi(i,"height")||i.attr("data-w-e-style-height")||a,l=function(t){var r=Qi(t,"float");if(r)return r;var n=(t.attr("data-w-e-style-float")||"").trim();if(n)return n;var e=(t.attr("class")||"").trim().split(/\s+/).filter(Boolean);return e.includes("w-e-float-image-left")?"left":e.includes("w-e-float-image-right")?"right":e.includes("w-e-float-image-none")?"none":""}(i);return o=decodeURIComponent(o),{type:"image",src:i.attr("src")||"",alt:i.attr("alt")||"",href:o,style:{width:f,height:c,float:l},width:u,height:a,children:[{text:""}]}}},fo={};function co(){if(ro)return to;ro=1;var t=st();return to=t(1.1.valueOf)}!function(){if(io)return fo;io=1;var t=Xn(),r=st(),n=sn(),e=co(),i=function(){if(eo)return no;eo=1;var t=sn(),r=he(),n=ht(),e=RangeError;return no=function(i){var o=r(n(this)),u="",a=t(i);if(a<0||a===1/0)throw new e("Wrong number of repetitions");for(;a>0;(a>>>=1)&&(o+=o))1&a&&(u+=o);return u}}(),o=m(),u=RangeError,a=String,f=Math.floor,c=r(i),l=r("".slice),s=r(1.1.toFixed),v=function(t,r,n){return 0===r?n:r%2==1?v(t,r-1,n*t):v(t*t,r/2,n)},d=function(t,r,n){for(var e=-1,i=n;++e<6;)i+=r*t[e],t[e]=i%1e7,i=f(i/1e7)},p=function(t,r){for(var n=6,e=0;--n>=0;)e+=t[n],t[n]=f(e/r),e=e%r*1e7},h=function(t){for(var r=6,n="";--r>=0;)if(""!==n||0===r||0!==t[r]){var e=a(t[r]);n=""===n?e:n+c("0",7-e.length)+e}return n};t({target:"Number",proto:!0,forced:o(function(){return"0.000"!==s(8e-5,3)||"1"!==s(.9,0)||"1.25"!==s(1.255,2)||"1000000000000000128"!==s(0xde0b6b3a7640080,0)})||!o(function(){s({})})},{toFixed:function(t){var r,i,o,f,s=e(this),g=n(t),y=[0,0,0,0,0,0],m="",b="0";if(g<0||g>20)throw new u("Incorrect fraction digits");if(s!=s)return"NaN";if(s<=-1e21||s>=1e21)return a(s);if(s<0&&(m="-",s=-s),s>1e-21)if(i=(r=function(t){for(var r=0,n=t;n>=4096;)r+=12,n/=4096;for(;n>=2;)r+=1,n/=2;return r}(s*v(2,69,1))-69)<0?s*v(2,-r,1):s/v(2,r,1),i*=4503599627370496,(r=52-r)>0){for(d(y,0,i),o=g;o>=7;)d(y,1e7,0),o-=7;for(d(y,v(10,o,1),0),o=r-1;o>=23;)p(y,1<<23),o-=23;p(y,1<<o),d(y,1,1),p(y,2),b=h(y)}else d(y,0,i),d(y,1<<-r,0),b=h(y)+c("0",g);return b=g>0?m+((f=b.length)<=g?"0."+c("0",g-f)+b:l(b,0,f-g)+"."+l(b,f-g)):m+b}})}();var lo=function(){if(uo)return oo;uo=1;var t="Expected a function",r=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,u=parseInt,a="object"==typeof e&&e&&e.Object===Object&&e,f="object"==typeof self&&self&&self.Object===Object&&self,c=a||f||Function("return this")(),l=Object.prototype.toString,s=Math.max,v=Math.min,d=function(){return c.Date.now()};function p(r,n,e){var i,o,u,a,f,c,l=0,p=!1,y=!1,m=!0;if("function"!=typeof r)throw new TypeError(t);function b(t){var n=i,e=o;return i=o=void 0,l=t,a=r.apply(e,n)}function w(t){var r=t-c;return void 0===c||r>=n||r<0||y&&t-l>=u}function x(){var t=d();if(w(t))return S(t);f=setTimeout(x,function(t){var r=n-(t-c);return y?v(r,u-(t-l)):r}(t))}function S(t){return f=void 0,m&&i?b(t):(i=o=void 0,a)}function O(){var t=d(),r=w(t);if(i=arguments,o=this,c=t,r){if(void 0===f)return function(t){return l=t,f=setTimeout(x,n),p?b(t):a}(c);if(y)return f=setTimeout(x,n),b(c)}return void 0===f&&(f=setTimeout(x,n)),a}return n=g(n)||0,h(e)&&(p=!!e.leading,u=(y="maxWait"in e)?s(g(e.maxWait)||0,n):u,m="trailing"in e?!!e.trailing:m),O.cancel=function(){void 0!==f&&clearTimeout(f),l=0,i=c=o=f=void 0},O.flush=function(){return void 0===f?a:S(d())},O}function h(t){var r=typeof t;return!!t&&("object"==r||"function"==r)}function g(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==l.call(t)}(t))return NaN;if(h(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=h(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(r,"");var a=i.test(t);return a||o.test(t)?u(t.slice(2),a?2:8):n.test(t)?NaN:+t}return oo=function(r,n,e){var i=!0,o=!0;if("function"!=typeof r)throw new TypeError(t);return h(e)&&(i="leading"in e?!!e.leading:i,o="trailing"in e?!!e.trailing:o),p(r,n,{leading:i,maxWait:n,trailing:o})}}(),so=i(lo);function vo(r,n){var e=t.DomEditor.findKey(r,n).id;return"w-e-image-container-".concat(e)}function po(e,i,o,u){var a=r("body"),f=vo(e,i),c=u.width,l=u.height,s=u.float,v=0,d=0,p=0,h=!1,g=null;var y=so(function(t){t.preventDefault();var r=t.clientX,n=d+(h?v-r:r-v),e=p*(n/d);null!=g&&(n<=15||e<=15||(g.css("width","".concat(n,"px")),g.css("height","".concat(e,"px"))))},100);function m(r){if(a.off("mousemove",y),null!=g){var n=g.width().toFixed(2),o=g.height().toFixed(2),u={style:we(we({},i.style),{width:"".concat(n,"px"),height:"".concat(o,"px")})};t.SlateTransforms.setNodes(e,u,{at:t.DomEditor.findPath(e,i)}),a.off("mouseup",m)}}function b(n){g=function(){var t=r("#".concat(f));if(0===t.length)throw new Error("Cannot find image container elem");return t}(),v=n;var i=g.find("img");if(0===i.length)throw new Error("Cannot find image elem");d=i.width(),p=i.height(),a.on("mousemove",y),a.on("mouseup",m);var o=t.DomEditor.getHoverbar(e);o&&o.hideAndClean()}var w={};return c&&(w.width=c),l&&(w.height=l),s&&(w.float=s),n.jsx("div",{id:f,style:w,className:"w-e-image-container w-e-selected-image-container",on:{mousedown:function(t){var n=r(t.target);n.hasClass("w-e-image-dragger")&&(t.preventDefault(),(n.hasClass("left-top")||n.hasClass("left-bottom"))&&(h=!0),b(t.clientX))}}},o,n.jsx("div",{className:"w-e-image-dragger left-top"}),n.jsx("div",{className:"w-e-image-dragger right-top"}),n.jsx("div",{className:"w-e-image-dragger left-bottom"}),n.jsx("div",{className:"w-e-image-dragger right-bottom"}))}return{renderElems:[{type:"image",renderElem:function(r,e,i){var o=r,u=o.src,a=o.alt,f=void 0===a?"":a,c=o.href,l=void 0===c?"":c,s=o.style,v=void 0===s?{}:s,d=v.width,p=void 0===d?"":d,h=v.height,g=void 0===h?"":h,y=v.float,m=t.DomEditor.isNodeSelected(i,r),b={};p&&(b.width="100%"),g&&(b.height="100%"),y&&(b.float=y);var w=n.jsx("img",{style:b,src:u,alt:f,"data-href":l}),x=i.isDisabled();return m&&!x?po(i,r,w,{width:p,height:g,float:y}):function(t,r,e,i){var o=i.width,u=i.height,a=i.float,f={};o&&(f.width=o),u&&(f.height=u),a&&(f.float=a);var c=vo(t,r);return n.jsx("div",{id:c,style:f,className:"w-e-image-container"},e)}(i,r,w,{width:p,height:g,float:y})}}],elemsToHtml:[ye],parseElemsHtml:[ao],menus:[fi,ci,ai]}});
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@wangeditor-next/editor"),require("dom7"),require("snabbdom")):"function"==typeof define&&define.amd?define(["@wangeditor-next/editor","dom7","snabbdom"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).WangEditorFloatImagePlugin=e(t.editor,t.$,t.snabbdom)}(this,function(t,e,n){"use strict";t.i18nAddResources("en",{float:{none:"Default",left:"Float Left",right:"Float Right"}}),t.i18nAddResources("zh-CN",{float:{none:"默认",left:"左浮动",right:"右浮动"}});var o={type:"image",elemToHtml:function(e,n,o){var r=e,a=r.src,i=r.alt,l=void 0===i?"":i,f=r.href,c=void 0===f?"":f,s=r.style,d=void 0===s?{}:s,u=d.width,h=void 0===u?"":u,p=d.height,g=void 0===p?"":p,v=d.float,m=void 0===v?"":v;if("class"===t.getTextStyleMode(o)){var y=h?' data-w-e-style-width="'.concat(h,'"'):"",w=g?' data-w-e-style-height="'.concat(g,'"'):"",b=m?' data-w-e-style-float="'.concat(m,'"'):"",q=function(t){var e=(t||"").trim().toLowerCase();return"left"===e?"w-e-float-image-left":"right"===e?"w-e-float-image-right":"none"===e?"w-e-float-image-none":""}(m),x=q?' class="'.concat(q,'"'):"";return'<img src="'.concat(a,'" alt="').concat(l,'" data-href="').concat(c,'" width="').concat(h,'" height="').concat(g,'"').concat(x).concat(y).concat(w).concat(b,"/>")}var j="";return h&&(j+="width: ".concat(h,";")),g&&(j+="height: ".concat(g,";")),m&&(j+="float: ".concat(m,";")),'<img src="'.concat(a,'" alt="').concat(l,'" data-href="').concat(c,'" style="').concat(j,'"/>')}},r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)};function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var i=function(){return i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},i.apply(this,arguments)};function l(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,a=n.call(t),i=[];try{for(;(void 0===e||e-- >0)&&!(o=a.next()).done;)i.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i}function f(t,e,n){if(n||2===arguments.length)for(var o,r=0,a=e.length;r<a;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var c=function(){function e(){this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.getSelectedNode=function(e){return t.DomEditor.getSelectedNodeByType(e,"image")},e.prototype.isDisabled=function(t){return null==t.selection||null==this.getSelectedNode(t)},e.prototype.exec=function(e,n){if(!this.isDisabled(e)){var o=this.getSelectedNode(e);if(null!=o){var r=t.DomEditor.getHoverbar(e);r&&r.hideAndClean();var a=o.style,l={style:i(i({},void 0===a?{}:a),{float:this.value})};t.SlateTransforms.setNodes(e,l,{match:function(e){return t.DomEditor.checkNodeType(e,"image")}})}}},e}(),s=function(e){function n(){var n=e.apply(this,f([],l(arguments),!1))||this;return n.title=t.t("float.left"),n.value="left",n.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M77.03514075 117.83964445m12.4275674 0l845.0745837 0q12.42756741 0 12.4275674 12.4275674l0 68.35162074q0 12.42756741-12.4275674 12.42756741l-845.0745837 0q-12.42756741 0-12.4275674-12.42756741l0-68.35162074q0-12.42756741 12.4275674-12.4275674Z"></path><path d="M77.03514075 801.35585185m12.4275674 0l845.0745837 0q12.42756741 0 12.4275674 12.42756741l0 68.35162074q0 12.42756741-12.4275674 12.42756742l-845.0745837 0q-12.42756741 0-12.4275674-12.42756742l0-68.35162074q0-12.42756741 12.4275674-12.42756741Z"></path><path d="M89.46270815 304.25315556h347.9718874c6.83516208 0 12.42756741 5.59240533 12.42756742 12.42756741v410.10972445a12.42756741 12.42756741 0 0 1-12.42756742 12.4275674h-347.9718874a12.42756741 12.42756741 0 0 1-12.4275674-12.4275674v-410.10972445c0-6.83516208 5.59240533-12.42756741 12.4275674-12.42756741z"></path><path d="M512 552.8045037m12.42756741 0l410.10972444 0q12.42756741 0 12.4275674 12.42756742l0 68.35162073q0 12.42756741-12.4275674 12.42756741l-410.10972444 0q-12.42756741 0-12.42756741-12.42756741l0-68.35162073q0-12.42756741 12.42756741-12.42756742Z"></path><path d="M512 366.39099259m12.42756741 0l410.10972444 0q12.42756741 0 12.4275674 12.42756741l0 68.35162075q0 12.42756741-12.4275674 12.4275674l-410.10972444 0q-12.42756741 0-12.42756741-12.4275674l0-68.35162075q0-12.42756741 12.42756741-12.42756741Z"></path></svg>',n}return a(n,e),n}(c),d=function(e){function n(){var n=e.apply(this,f([],l(arguments),!1))||this;return n.title=t.t("float.none"),n.value="none",n.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M76.73805432 117.83964445m12.42756741 0l845.0745837 0q12.42756741 0 12.42756741 12.4275674l0 68.35162074q0 12.42756741-12.42756741 12.42756741l-845.0745837 0q-12.42756741 0-12.42756741-12.42756741l0-68.35162074q0-12.42756741 12.42756741-12.4275674Z"></path><path d="M76.73805432 801.35585185m12.42756741 0l845.0745837 0q12.42756741 0 12.42756741 12.42756741l0 68.35162074q0 12.42756741-12.42756741 12.42756742l-845.0745837 0q-12.42756741 0-12.42756741-12.42756742l0-68.35162074q0-12.42756741 12.42756741-12.42756741Z"></path><path d="M89.16562173 304.25315556h410.10972444c6.83516208 0 12.42756741 5.59240533 12.42756741 12.42756741v410.10972445a12.42756741 12.42756741 0 0 1-12.42756741 12.4275674h-410.10972444a12.42756741 12.42756741 0 0 1-12.42756741-12.4275674v-410.10972445c0-6.83516208 5.59240533-12.42756741 12.42756741-12.42756741z"></path></svg>',n}return a(n,e),n}(c),u=function(e){function n(){var n=e.apply(this,f([],l(arguments),!1))||this;return n.title=t.t("float.right"),n.value="right",n.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M77.03514075 117.83964445m12.4275674 0l845.0745837 0q12.42756741 0 12.4275674 12.4275674l0 68.35162074q0 12.42756741-12.4275674 12.42756741l-845.0745837 0q-12.42756741 0-12.4275674-12.42756741l0-68.35162074q0-12.42756741 12.4275674-12.4275674Z"></path><path d="M77.03514075 801.35585185m12.4275674 0l845.0745837 0q12.42756741 0 12.4275674 12.42756741l0 68.35162074q0 12.42756741-12.4275674 12.42756742l-845.0745837 0q-12.42756741 0-12.4275674-12.42756742l0-68.35162074q0-12.42756741 12.4275674-12.42756741Z"></path><path d="M586.56540445 304.25315556h347.9718874c6.83516208 0 12.42756741 5.59240533 12.4275674 12.42756741v410.10972445a12.42756741 12.42756741 0 0 1-12.4275674 12.4275674h-347.9718874a12.42756741 12.42756741 0 0 1-12.42756742-12.4275674v-410.10972445c0-6.83516208 5.59240533-12.42756741 12.42756742-12.42756741z"></path><path d="M77.03514075 552.8045037m12.4275674 0l410.10972444 0q12.42756741 0 12.42756741 12.42756742l0 68.35162073q0 12.42756741-12.42756741 12.42756741l-410.10972444 0q-12.42756741 0-12.4275674-12.42756741l0-68.35162073q0-12.42756741 12.4275674-12.42756742Z"></path><path d="M77.03514075 366.39099259m12.4275674 0l410.10972444 0q12.42756741 0 12.42756741 12.42756741l0 68.35162075q0 12.42756741-12.42756741 12.4275674l-410.10972444 0q-12.42756741 0-12.4275674-12.4275674l0-68.35162075q0-12.42756741 12.4275674-12.42756741Z"></path></svg>',n}return a(n,e),n}(c),h={key:"imageFloatNone",factory:function(){return new d}},p={key:"imageFloatLeft",factory:function(){return new s}},g={key:"imageFloatRight",factory:function(){return new u}};function v(t,e){for(var n="",o=(t.attr("style")||"").split(";"),r=o.length,a=0;a<r;a+=1){var i=o[a];if(i){var l=i.split(":");l[0].trim()===e&&(n=l[1].trim())}}return n}e.css&&(e.fn.css=e.css),e.append&&(e.fn.append=e.append),e.prepend&&(e.fn.prepend=e.prepend),e.addClass&&(e.fn.addClass=e.addClass),e.removeClass&&(e.fn.removeClass=e.removeClass),e.hasClass&&(e.fn.hasClass=e.hasClass),e.on&&(e.fn.on=e.on),e.off&&(e.fn.off=e.off),e.focus&&(e.fn.focus=e.focus),e.attr&&(e.fn.attr=e.attr),e.removeAttr&&(e.fn.removeAttr=e.removeAttr),e.hide&&(e.fn.hide=e.hide),e.show&&(e.fn.show=e.show),e.parents&&(e.fn.parents=e.parents),e.dataset&&(e.fn.dataset=e.dataset),e.val&&(e.fn.val=e.val),e.text&&(e.fn.text=e.text),e.html&&(e.fn.html=e.html),e.children&&(e.fn.children=e.children),e.remove&&(e.fn.remove=e.remove),e.find&&(e.fn.find=e.find),e.width&&(e.fn.width=e.width),e.height&&(e.fn.height=e.height),e.filter&&(e.fn.filter=e.filter),e.empty&&(e.fn.empty=e.empty);var m,y,w={selector:"img:not([data-w-e-type])",parseElemHtml:function(t,n,o){var r=e(t),a=r.attr("data-href")||"",i=r.attr("width")||"",l=r.attr("height")||"",f=v(r,"width")||r.attr("data-w-e-style-width")||i,c=v(r,"height")||r.attr("data-w-e-style-height")||l,s=function(t){var e=v(t,"float");if(e)return e;var n=(t.attr("data-w-e-style-float")||"").trim();if(n)return n;var o=(t.attr("class")||"").trim().split(/\s+/).filter(Boolean);return o.includes("w-e-float-image-left")?"left":o.includes("w-e-float-image-right")?"right":o.includes("w-e-float-image-none")?"none":""}(r);return a=decodeURIComponent(a),{type:"image",src:r.attr("src")||"",alt:r.attr("alt")||"",href:a,style:{width:f,height:c,float:s},width:i,height:l,children:[{text:""}]}}},b="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function q(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var x=function(){if(y)return m;y=1;var t="Expected a function",e=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,r=/^0o[0-7]+$/i,a=parseInt,i="object"==typeof b&&b&&b.Object===Object&&b,l="object"==typeof self&&self&&self.Object===Object&&self,f=i||l||Function("return this")(),c=Object.prototype.toString,s=Math.max,d=Math.min,u=function(){return f.Date.now()};function h(e,n,o){var r,a,i,l,f,c,h=0,v=!1,m=!1,y=!0;if("function"!=typeof e)throw new TypeError(t);function w(t){var n=r,o=a;return r=a=void 0,h=t,l=e.apply(o,n)}function b(t){var e=t-c;return void 0===c||e>=n||e<0||m&&t-h>=i}function q(){var t=u();if(b(t))return x(t);f=setTimeout(q,function(t){var e=n-(t-c);return m?d(e,i-(t-h)):e}(t))}function x(t){return f=void 0,y&&r?w(t):(r=a=void 0,l)}function j(){var t=u(),e=b(t);if(r=arguments,a=this,c=t,e){if(void 0===f)return function(t){return h=t,f=setTimeout(q,n),v?w(t):l}(c);if(m)return f=setTimeout(q,n),w(c)}return void 0===f&&(f=setTimeout(q,n)),l}return n=g(n)||0,p(o)&&(v=!!o.leading,i=(m="maxWait"in o)?s(g(o.maxWait)||0,n):i,y="trailing"in o?!!o.trailing:y),j.cancel=function(){void 0!==f&&clearTimeout(f),h=0,r=c=a=f=void 0},j.flush=function(){return void 0===f?l:x(u())},j}function p(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function g(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==c.call(t)}(t))return NaN;if(p(t)){var i="function"==typeof t.valueOf?t.valueOf():t;t=p(i)?i+"":i}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(e,"");var l=o.test(t);return l||r.test(t)?a(t.slice(2),l?2:8):n.test(t)?NaN:+t}return m=function(e,n,o){var r=!0,a=!0;if("function"!=typeof e)throw new TypeError(t);return p(o)&&(r="leading"in o?!!o.leading:r,a="trailing"in o?!!o.trailing:a),h(e,n,{leading:r,maxWait:n,trailing:a})}}(),j=q(x);function C(e,n){var o=t.DomEditor.findKey(e,n).id;return"w-e-image-container-".concat(o)}function E(o,r,a,l){var f=e("body"),c=C(o,r),s=l.width,d=l.height,u=l.float,h=0,p=0,g=0,v=!1,m=null;var y=j(function(t){t.preventDefault();var e=t.clientX,n=p+(v?h-e:e-h),o=g*(n/p);null!=m&&(n<=15||o<=15||(m.css("width","".concat(n,"px")),m.css("height","".concat(o,"px"))))},100);function w(e){if(f.off("mousemove",y),null!=m){var n=m.width().toFixed(2),a=m.height().toFixed(2),l={style:i(i({},r.style),{width:"".concat(n,"px"),height:"".concat(a,"px")})};t.SlateTransforms.setNodes(o,l,{at:t.DomEditor.findPath(o,r)}),f.off("mouseup",w)}}function b(n){m=function(){var t=e("#".concat(c));if(0===t.length)throw new Error("Cannot find image container elem");return t}(),h=n;var r=m.find("img");if(0===r.length)throw new Error("Cannot find image elem");p=r.width(),g=r.height(),f.on("mousemove",y),f.on("mouseup",w);var a=t.DomEditor.getHoverbar(o);a&&a.hideAndClean()}var q={};return s&&(q.width=s),d&&(q.height=d),u&&(q.float=u),n.jsx("div",{id:c,style:q,className:"w-e-image-container w-e-selected-image-container",on:{mousedown:function(t){var n=e(t.target);n.hasClass("w-e-image-dragger")&&(t.preventDefault(),(n.hasClass("left-top")||n.hasClass("left-bottom"))&&(v=!0),b(t.clientX))}}},a,n.jsx("div",{className:"w-e-image-dragger left-top"}),n.jsx("div",{className:"w-e-image-dragger right-top"}),n.jsx("div",{className:"w-e-image-dragger left-bottom"}),n.jsx("div",{className:"w-e-image-dragger right-bottom"}))}return{renderElems:[{type:"image",renderElem:function(e,o,r){var a=e,i=a.src,l=a.alt,f=void 0===l?"":l,c=a.href,s=void 0===c?"":c,d=a.style,u=void 0===d?{}:d,h=u.width,p=void 0===h?"":h,g=u.height,v=void 0===g?"":g,m=u.float,y=t.DomEditor.isNodeSelected(r,e),w={};p&&(w.width="100%"),v&&(w.height="100%"),m&&(w.float=m);var b=n.jsx("img",{style:w,src:i,alt:f,"data-href":s}),q=r.isDisabled();return y&&!q?E(r,e,b,{width:p,height:v,float:m}):function(t,e,o,r){var a=r.width,i=r.height,l=r.float,f={};a&&(f.width=a),i&&(f.height=i),l&&(f.float=l);var c=C(t,e);return n.jsx("div",{id:c,style:f,className:"w-e-image-container"},o)}(r,e,b,{width:p,height:v,float:m})}}],elemsToHtml:[o],parseElemsHtml:[w],menus:[p,g,h]}});
2
2
  //# sourceMappingURL=index.js.map