18 lines
		
	
	
		
			49 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			49 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@wangeditor/core"),require("slate"),require("snabbdom"),require("dom7"),require("nanoid")):"function"==typeof define&&define.amd?define(["@wangeditor/core","slate","snabbdom","dom7","nanoid"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).WangEditorVideoModule=e(t.core,t.slate,t.snabbdom,t.$,t.nanoid)}(this,(function(t,e,n,r,o){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var u=i(r);t.i18nAddResources("en",{videoModule:{delete:"Delete",uploadVideo:"Upload video",insertVideo:"Insert video",videoSrc:"Video source",videoSrcPlaceHolder:"Video file url, or third-party <iframe>",videoPoster:"Video poster",videoPosterPlaceHolder:"Poster image url",ok:"Ok",editSize:"Edit size",width:"Width",height:"Height"}}),t.i18nAddResources("zh-CN",{videoModule:{delete:"删除视频",uploadVideo:"上传视频",insertVideo:"插入视频",videoSrc:"视频地址",videoSrcPlaceHolder:"视频文件 url 或第三方 <iframe>",videoPoster:"视频封面",videoPosterPlaceHolder:"封面图片 url",ok:"确定",editSize:"修改尺寸",width:"宽度",height:"高度"}});
 | 
						||
/*! *****************************************************************************
 | 
						||
  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 a=function(){return a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},a.apply(this,arguments)};function c(t,e,n,r){return new(n||(n=Promise))((function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,a)}c((r=r.apply(t,e||[])).next())}))}function f(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function s(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function l(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u}function d(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=s(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,o){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,o,(e=t[n](e)).done,e.value)}))}}}var p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function v(t){var e={exports:{}};return t(e,e.exports),e.exports}var h,y,g=function(t){return t&&t.Math==Math&&t},m=g("object"==typeof globalThis&&globalThis)||g("object"==typeof window&&window)||g("object"==typeof self&&self)||g("object"==typeof p&&p)||function(){return this}()||Function("return this")(),b=function(t){try{return!!t()}catch(t){return!0}},w=!b((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),S=Function.prototype.call,x=S.bind?S.bind(S):function(){return S.apply(S,arguments)},E={}.propertyIsEnumerable,O=Object.getOwnPropertyDescriptor,j={f:O&&!E.call({1:2},1)?function(t){var e=O(this,t);return!!e&&e.enumerable}:E},I=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},P=Function.prototype,T=P.bind,M=P.call,A=T&&T.bind(M),R=T?function(t){return t&&A(M,t)}:function(t){return t&&function(){return M.apply(t,arguments)}},k=R({}.toString),C=R("".slice),N=function(t){return C(k(t),8,-1)},L=m.Object,V=R("".split),D=b((function(){return!L("z").propertyIsEnumerable(0)}))?function(t){return"String"==N(t)?V(t,""):L(t)}:L,z=m.TypeError,F=function(t){if(null==t)throw z("Can't call method on "+t);return t},_=function(t){return D(F(t))},$=function(t){return"function"==typeof t},H=function(t){return"object"==typeof t?null!==t:$(t)},B=function(t){return $(t)?t:void 0},G=function(t,e){return arguments.length<2?B(m[t]):m[t]&&m[t][e]},W=R({}.isPrototypeOf),U=G("navigator","userAgent")||"",q=m.process,K=m.Deno,X=q&&q.versions||K&&K.version,Y=X&&X.v8;Y&&(y=(h=Y.split("."))[0]>0&&h[0]<4?1:+(h[0]+h[1])),!y&&U&&(!(h=U.match(/Edge\/(\d+)/))||h[1]>=74)&&(h=U.match(/Chrome\/(\d+)/))&&(y=+h[1]);var J=y,Q=!!Object.getOwnPropertySymbols&&!b((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&J&&J<41})),Z=Q&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,tt=m.Object,et=Z?function(t){return"symbol"==typeof t}:function(t){var e=G("Symbol");return $(e)&&W(e.prototype,tt(t))},nt=m.String,rt=function(t){try{return nt(t)}catch(t){return"Object"}},ot=m.TypeError,it=function(t){if($(t))return t;throw ot(rt(t)+" is not a function")},ut=function(t,e){var n=t[e];return null==n?void 0:it(n)},at=m.TypeError,ct=Object.defineProperty,ft=function(t,e){try{ct(m,t,{value:e,configurable:!0,writable:!0})}catch(n){m[t]=e}return e},st="__core-js_shared__",lt=m[st]||ft(st,{}),dt=v((function(t){(t.exports=function(t,e){return lt[t]||(lt[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.19.3",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),pt=m.Object,vt=function(t){return pt(F(t))},ht=R({}.hasOwnProperty),yt=Object.hasOwn||function(t,e){return ht(vt(t),e)},gt=0,mt=Math.random(),bt=R(1..toString),wt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+bt(++gt+mt,36)},St=dt("wks"),xt=m.Symbol,Et=xt&&xt.for,Ot=Z?xt:xt&&xt.withoutSetter||wt,jt=function(t){if(!yt(St,t)||!Q&&"string"!=typeof St[t]){var e="Symbol."+t;Q&&yt(xt,t)?St[t]=xt[t]:St[t]=Z&&Et?Et(e):Ot(e)}return St[t]},It=m.TypeError,Pt=jt("toPrimitive"),Tt=function(t,e){if(!H(t)||et(t))return t;var n,r=ut(t,Pt);if(r){if(void 0===e&&(e="default"),n=x(r,t,e),!H(n)||et(n))return n;throw It("Can't convert object to primitive value")}return void 0===e&&(e="number"),function(t,e){var n,r;if("string"===e&&$(n=t.toString)&&!H(r=x(n,t)))return r;if($(n=t.valueOf)&&!H(r=x(n,t)))return r;if("string"!==e&&$(n=t.toString)&&!H(r=x(n,t)))return r;throw at("Can't convert object to primitive value")}(t,e)},Mt=function(t){var e=Tt(t,"string");return et(e)?e:e+""},At=m.document,Rt=H(At)&&H(At.createElement),kt=function(t){return Rt?At.createElement(t):{}},Ct=!w&&!b((function(){return 7!=Object.defineProperty(kt("div"),"a",{get:function(){return 7}}).a})),Nt=Object.getOwnPropertyDescriptor,Lt={f:w?Nt:function(t,e){if(t=_(t),e=Mt(e),Ct)try{return Nt(t,e)}catch(t){}if(yt(t,e))return I(!x(j.f,t,e),t[e])}},Vt=m.String,Dt=m.TypeError,zt=function(t){if(H(t))return t;throw Dt(Vt(t)+" is not an object")},Ft=m.TypeError,_t=Object.defineProperty,$t={f:w?_t:function(t,e,n){if(zt(t),e=Mt(e),zt(n),Ct)try{return _t(t,e,n)}catch(t){}if("get"in n||"set"in n)throw Ft("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},Ht=w?function(t,e,n){return $t.f(t,e,I(1,n))}:function(t,e,n){return t[e]=n,t},Bt=R(Function.toString);$(lt.inspectSource)||(lt.inspectSource=function(t){return Bt(t)});var Gt,Wt,Ut,qt=lt.inspectSource,Kt=m.WeakMap,Xt=$(Kt)&&/native code/.test(qt(Kt)),Yt=dt("keys"),Jt=function(t){return Yt[t]||(Yt[t]=wt(t))},Qt={},Zt="Object already initialized",te=m.TypeError,ee=m.WeakMap;if(Xt||lt.state){var ne=lt.state||(lt.state=new ee),re=R(ne.get),oe=R(ne.has),ie=R(ne.set);Gt=function(t,e){if(oe(ne,t))throw new te(Zt);return e.facade=t,ie(ne,t,e),e},Wt=function(t){return re(ne,t)||{}},Ut=function(t){return oe(ne,t)}}else{var ue=Jt("state");Qt[ue]=!0,Gt=function(t,e){if(yt(t,ue))throw new te(Zt);return e.facade=t,Ht(t,ue,e),e},Wt=function(t){return yt(t,ue)?t[ue]:{}},Ut=function(t){return yt(t,ue)}}var ae={set:Gt,get:Wt,has:Ut,enforce:function(t){return Ut(t)?Wt(t):Gt(t,{})},getterFor:function(t){return function(e){var n;if(!H(e)||(n=Wt(e)).type!==t)throw te("Incompatible receiver, "+t+" required");return n}}},ce=Function.prototype,fe=w&&Object.getOwnPropertyDescriptor,se=yt(ce,"name"),le={EXISTS:se,PROPER:se&&"something"===function(){}.name,CONFIGURABLE:se&&(!w||w&&fe(ce,"name").configurable)},de=v((function(t){var e=le.CONFIGURABLE,n=ae.get,r=ae.enforce,o=String(String).split("String");(t.exports=function(t,n,i,u){var a,c=!!u&&!!u.unsafe,f=!!u&&!!u.enumerable,s=!!u&&!!u.noTargetGet,l=u&&void 0!==u.name?u.name:n;$(i)&&("Symbol("===String(l).slice(0,7)&&(l="["+String(l).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!yt(i,"name")||e&&i.name!==l)&&Ht(i,"name",l),(a=r(i)).source||(a.source=o.join("string"==typeof l?l:""))),t!==m?(c?!s&&t[n]&&(f=!0):delete t[n],f?t[n]=i:Ht(t,n,i)):f?t[n]=i:ft(n,i)})(Function.prototype,"toString",(function(){return $(this)&&n(this).source||qt(this)}))})),pe=Math.ceil,ve=Math.floor,he=function(t){var e=+t;return e!=e||0===e?0:(e>0?ve:pe)(e)},ye=Math.max,ge=Math.min,me=function(t,e){var n=he(t);return n<0?ye(n+e,0):ge(n,e)},be=Math.min,we=function(t){return t>0?be(he(t),9007199254740991):0},Se=function(t){return we(t.length)},xe=function(t){return function(e,n,r){var o,i=_(e),u=Se(i),a=me(r,u);if(t&&n!=n){for(;u>a;)if((o=i[a++])!=o)return!0}else for(;u>a;a++)if((t||a in i)&&i[a]===n)return t||a||0;return!t&&-1}},Ee={includes:xe(!0),indexOf:xe(!1)},Oe=Ee.indexOf,je=R([].push),Ie=function(t,e){var n,r=_(t),o=0,i=[];for(n in r)!yt(Qt,n)&&yt(r,n)&&je(i,n);for(;e.length>o;)yt(r,n=e[o++])&&(~Oe(i,n)||je(i,n));return i},Pe=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Te=Pe.concat("length","prototype"),Me={f:Object.getOwnPropertyNames||function(t){return Ie(t,Te)}},Ae={f:Object.getOwnPropertySymbols},Re=R([].concat),ke=G("Reflect","ownKeys")||function(t){var e=Me.f(zt(t)),n=Ae.f;return n?Re(e,n(t)):e},Ce=function(t,e){for(var n=ke(e),r=$t.f,o=Lt.f,i=0;i<n.length;i++){var u=n[i];yt(t,u)||r(t,u,o(e,u))}},Ne=/#|\.prototype\./,Le=function(t,e){var n=De[Ve(t)];return n==Fe||n!=ze&&($(e)?b(e):!!e)},Ve=Le.normalize=function(t){return String(t).replace(Ne,".").toLowerCase()},De=Le.data={},ze=Le.NATIVE="N",Fe=Le.POLYFILL="P",_e=Le,$e=Lt.f,He=function(t,e){var n,r,o,i,u,a=t.target,c=t.global,f=t.stat;if(n=c?m:f?m[a]||ft(a,{}):(m[a]||{}).prototype)for(r in e){if(i=e[r],o=t.noTargetGet?(u=$e(n,r))&&u.value:n[r],!_e(c?r:a+(f?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;Ce(i,o)}(t.sham||o&&o.sham)&&Ht(i,"sham",!0),de(n,r,i,t)}},Be={};Be[jt("toStringTag")]="z";var Ge,We="[object z]"===String(Be),Ue=jt("toStringTag"),qe=m.Object,Ke="Arguments"==N(function(){return arguments}()),Xe=We?N:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=qe(t),Ue))?n:Ke?N(e):"Object"==(r=N(e))&&$(e.callee)?"Arguments":r},Ye=m.String,Je=function(t){if("Symbol"===Xe(t))throw TypeError("Cannot convert a Symbol value to a string");return Ye(t)},Qe="\t\n\v\f\r                 \u2028\u2029\ufeff",Ze=R("".replace),tn="["+Qe+"]",en=RegExp("^"+tn+tn+"*"),nn=RegExp(tn+tn+"*$"),rn=function(t){return function(e){var n=Je(F(e));return 1&t&&(n=Ze(n,en,"")),2&t&&(n=Ze(n,nn,"")),n}},on={start:rn(1),end:rn(2),trim:rn(3)},un=le.PROPER,an=on.trim;function cn(t){return t.length?t[0].tagName.toLowerCase():""}function fn(t,e,n){void 0===e&&(e="auto"),void 0===n&&(n="auto");var r=u.default(t);return r.attr("width",e),r.attr("height",n),r[0].outerHTML}He({target:"String",proto:!0,forced:(Ge="trim",b((function(){return!!Qe[Ge]()||"
"!=="
"[Ge]()||un&&Qe[Ge].name!==Ge})))},{trim:function(){return an(this)}}),He({global:!0},{globalThis:m}),r.append&&(u.default.fn.append=r.append),r.on&&(u.default.fn.on=r.on),r.focus&&(u.default.fn.focus=r.focus),r.attr&&(u.default.fn.attr=r.attr),r.val&&(u.default.fn.val=r.val),r.html&&(u.default.fn.html=r.html),r.parent&&(u.default.fn.parent=r.parent),r.hasClass&&(u.default.fn.hasClass=r.hasClass),r.empty&&(u.default.fn.empty=r.empty);var sn={type:"video",renderElem:function(e,r,o){var i,u=e,a=u.src,c=void 0===a?"":a,f=u.poster,s=void 0===f?"":f,l=u.width,d=void 0===l?"auto":l,p=u.height,v=void 0===p?"auto":p,h=t.DomEditor.isNodeSelected(o,e);if(0===c.trim().indexOf("<iframe ")){var y=fn(c,d,v);i=n.jsx("div",{className:"w-e-textarea-video-container","data-selected":h?"true":"",innerHTML:y})}else{var g=n.jsx("video",{poster:s,controls:!0},n.jsx("source",{src:c,type:"video/mp4"}),"Sorry, your browser doesn't support embedded videos.\n 抱歉,浏览器不支持 video 视频");"auto"!==d&&(g.data.width=d),"auto"!==v&&(g.data.height=v),i=n.jsx("div",{className:"w-e-textarea-video-container","data-selected":h?"true":""},g)}return n.h("div",{props:{contentEditable:!1},on:{mousedown:function(t){return t.preventDefault()}}},i)}};var ln,dn={type:"video",elemToHtml:function(t,e){var n=t,r=n.src,o=void 0===r?"":r,i=n.poster,u=void 0===i?"":i,a=n.width,c=void 0===a?"auto":a,f=n.height,s=void 0===f?"auto":f,l='<div data-w-e-type="video" data-w-e-is-void>\n';return 0===o.trim().indexOf("<iframe ")?l+=fn(o,c,s):l+='<video poster="'+u+'" controls="true" width="'+c+'" height="'+s+'"><source src="'+o+'" type="video/mp4"/></video>',l+="\n</div>"}},pn=Object.keys||function(t){return Ie(t,Pe)},vn=w?Object.defineProperties:function(t,e){zt(t);for(var n,r=_(e),o=pn(e),i=o.length,u=0;i>u;)$t.f(t,n=o[u++],r[n]);return t},hn=G("document","documentElement"),yn=Jt("IE_PROTO"),gn=function(){},mn=function(t){return"<script>"+t+"</"+"script>"},bn=function(t){t.write(mn("")),t.close();var e=t.parentWindow.Object;return t=null,e},wn=function(){try{ln=new ActiveXObject("htmlfile")}catch(t){}var t,e;wn="undefined"!=typeof document?document.domain&&ln?bn(ln):((e=kt("iframe")).style.display="none",hn.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(mn("document.F=Object")),t.close(),t.F):bn(ln);for(var n=Pe.length;n--;)delete wn.prototype[Pe[n]];return wn()};Qt[yn]=!0;var Sn=Object.create||function(t,e){var n;return null!==t?(gn.prototype=zt(t),n=new gn,gn.prototype=null,n[yn]=t):n=wn(),void 0===e?n:vn(n,e)},xn=jt("unscopables"),En=Array.prototype;null==En[xn]&&$t.f(En,xn,{configurable:!0,value:Sn(null)});var On=function(t){En[xn][t]=!0},jn=Ee.includes;He({target:"Array",proto:!0},{includes:function(t){return jn(this,t,arguments.length>1?arguments[1]:void 0)}}),On("includes");var In={selector:"iframe,video,p",preParseHtml:function(t){var e=u.default(t),n=e;if("p"===cn(e)){var r=e.children();if(1===r.length){var o=r[0],i=o.tagName.toLowerCase();["iframe","video"].includes(i)&&(n=u.default(o))}}var a=cn(n);if("iframe"!==a&&"video"!==a)return n[0];if("video"===n.parent().attr("data-w-e-type"))return n[0];var c=u.default('<div data-w-e-type="video" data-w-e-is-void></div>');return c.append(n),c[0]}},Pn=R(R.bind),Tn=function(t,e){return it(t),void 0===e?t:Pn?Pn(t,e):function(){return t.apply(e,arguments)}},Mn=Array.isArray||function(t){return"Array"==N(t)},An=function(){},Rn=[],kn=G("Reflect","construct"),Cn=/^\s*(?:class|function)\b/,Nn=R(Cn.exec),Ln=!Cn.exec(An),Vn=function(t){if(!$(t))return!1;try{return kn(An,Rn,t),!0}catch(t){return!1}},Dn=!kn||b((function(){var t;return Vn(Vn.call)||!Vn(Object)||!Vn((function(){t=!0}))||t}))?function(t){if(!$(t))return!1;switch(Xe(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return Ln||!!Nn(Cn,qt(t))}:Vn,zn=jt("species"),Fn=m.Array,_n=function(t,e){return new(function(t){var e;return Mn(t)&&(e=t.constructor,(Dn(e)&&(e===Fn||Mn(e.prototype))||H(e)&&null===(e=e[zn]))&&(e=void 0)),void 0===e?Fn:e}(t))(0===e?0:e)},$n=R([].push),Hn=function(t){var e=1==t,n=2==t,r=3==t,o=4==t,i=6==t,u=7==t,a=5==t||i;return function(c,f,s,l){for(var d,p,v=vt(c),h=D(v),y=Tn(f,s),g=Se(h),m=0,b=l||_n,w=e?b(c,g):n||u?b(c,0):void 0;g>m;m++)if((a||m in h)&&(p=y(d=h[m],m,v),t))if(e)w[m]=p;else if(p)switch(t){case 3:return!0;case 5:return d;case 6:return m;case 2:$n(w,d)}else switch(t){case 4:return!1;case 7:$n(w,d)}return i?-1:r||o?o:w}},Bn={forEach:Hn(0),map:Hn(1),filter:Hn(2),some:Hn(3),every:Hn(4),find:Hn(5),findIndex:Hn(6),filterReject:Hn(7)},Gn=Bn.find,Wn="find",Un=!0;Wn in[]&&Array(1).find((function(){Un=!1})),He({target:"Array",proto:!0,forced:Un},{find:function(t){return Gn(this,t,arguments.length>1?arguments[1]:void 0)}}),On(Wn);var qn=We?{}.toString:function(){return"[object "+Xe(this)+"]"};function Kn(t,e,n,r){return void 0===e&&(e=""),void 0===n&&(n="auto"),void 0===r&&(r="auto"),{type:"video",src:t,poster:e,width:n,height:r,children:[{text:""}]}}We||de(Object.prototype,"toString",qn,{unsafe:!0});var Xn,Yn,Jn={selector:'div[data-w-e-type="video"]',parseElemHtml:function(t,e,n){var r=u.default(t),o="",i="",a="auto",c="auto",f=r.find("iframe");if(f.length>0)return a=f.attr("width")||"auto",c=f.attr("height")||"auto",Kn(o=f[0].outerHTML,i,a,c);var s=r.find("video");return(o=s.attr("src")||"")||s.length>0&&(o=s.find("source").attr("src")||""),a=s.attr("width")||"auto",c=s.attr("height")||"auto",Kn(o,i=s.attr("poster")||"",a,c)}},Qn=function(){var t=zt(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e},Zn=m.RegExp,tr=b((function(){var t=Zn("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),er=tr||b((function(){return!Zn("a","y").sticky})),nr={BROKEN_CARET:tr||b((function(){var t=Zn("^r","gy");return t.lastIndex=2,null!=t.exec("str")})),MISSED_STICKY:er,UNSUPPORTED_Y:tr},rr=m.RegExp,or=b((function(){var t=rr(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)})),ir=m.RegExp,ur=b((function(){var t=ir("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")})),ar=ae.get,cr=dt("native-string-replace",String.prototype.replace),fr=RegExp.prototype.exec,sr=fr,lr=R("".charAt),dr=R("".indexOf),pr=R("".replace),vr=R("".slice),hr=(Yn=/b*/g,x(fr,Xn=/a/,"a"),x(fr,Yn,"a"),0!==Xn.lastIndex||0!==Yn.lastIndex),yr=nr.BROKEN_CARET,gr=void 0!==/()??/.exec("")[1];(hr||gr||yr||or||ur)&&(sr=function(t){var e,n,r,o,i,u,a,c=this,f=ar(c),s=Je(t),l=f.raw;if(l)return l.lastIndex=c.lastIndex,e=x(sr,l,s),c.lastIndex=l.lastIndex,e;var d=f.groups,p=yr&&c.sticky,v=x(Qn,c),h=c.source,y=0,g=s;if(p&&(v=pr(v,"y",""),-1===dr(v,"g")&&(v+="g"),g=vr(s,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==lr(s,c.lastIndex-1))&&(h="(?: "+h+")",g=" "+g,y++),n=new RegExp("^(?:"+h+")",v)),gr&&(n=new RegExp("^"+h+"$(?!\\s)",v)),hr&&(r=c.lastIndex),o=x(fr,p?n:c,g),p?o?(o.input=vr(o.input,y),o[0]=vr(o[0],y),o.index=c.lastIndex,c.lastIndex+=o[0].length):c.lastIndex=0:hr&&o&&(c.lastIndex=c.global?o.index+o[0].length:r),gr&&o&&o.length>1&&x(cr,o[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(o[i]=void 0)})),o&&d)for(o.groups=u=Sn(null),i=0;i<d.length;i++)u[(a=d[i])[0]]=o[a[1]];return o});var mr=sr;He({target:"RegExp",proto:!0,forced:/./.exec!==mr},{exec:mr});var br=Function.prototype,wr=br.apply,Sr=br.bind,xr=br.call,Er="object"==typeof Reflect&&Reflect.apply||(Sr?xr.bind(wr):function(){return xr.apply(wr,arguments)}),Or=jt("species"),jr=RegExp.prototype,Ir=R("".charAt),Pr=R("".charCodeAt),Tr=R("".slice),Mr=function(t){return function(e,n){var r,o,i=Je(F(e)),u=he(n),a=i.length;return u<0||u>=a?t?"":void 0:(r=Pr(i,u))<55296||r>56319||u+1===a||(o=Pr(i,u+1))<56320||o>57343?t?Ir(i,u):r:t?Tr(i,u,u+2):o-56320+(r-55296<<10)+65536}},Ar={codeAt:Mr(!1),charAt:Mr(!0)},Rr=Ar.charAt,kr=function(t,e,n){return e+(n?Rr(t,e).length:1)},Cr=Math.floor,Nr=R("".charAt),Lr=R("".replace),Vr=R("".slice),Dr=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,zr=/\$([$&'`]|\d{1,2})/g,Fr=function(t,e,n,r,o,i){var u=n+t.length,a=r.length,c=zr;return void 0!==o&&(o=vt(o),c=Dr),Lr(i,c,(function(i,c){var f;switch(Nr(c,0)){case"$":return"$";case"&":return t;case"`":return Vr(e,0,n);case"'":return Vr(e,u);case"<":f=o[Vr(c,1,-1)];break;default:var s=+c;if(0===s)return i;if(s>a){var l=Cr(s/10);return 0===l?i:l<=a?void 0===r[l-1]?Nr(c,1):r[l-1]+Nr(c,1):i}f=r[s-1]}return void 0===f?"":f}))},_r=m.TypeError,$r=function(t,e){var n=t.exec;if($(n)){var r=x(n,t,e);return null!==r&&zt(r),r}if("RegExp"===N(t))return x(mr,t,e);throw _r("RegExp#exec called on incompatible receiver")},Hr=jt("replace"),Br=Math.max,Gr=Math.min,Wr=R([].concat),Ur=R([].push),qr=R("".indexOf),Kr=R("".slice),Xr="$0"==="a".replace(/./,"$0"),Yr=!!/./[Hr]&&""===/./[Hr]("a","$0");function Jr(t){return void 0===t&&(t="r"),t+"-"+o.nanoid()}!function(t,e,n,r){var o=jt(t),i=!b((function(){var e={};return e[o]=function(){return 7},7!=""[t](e)})),u=i&&!b((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[Or]=function(){return n},n.flags="",n[o]=/./[o]),n.exec=function(){return e=!0,null},n[o](""),!e}));if(!i||!u||n){var a=R(/./[o]),c=e(o,""[t],(function(t,e,n,r,o){var u=R(t),c=e.exec;return c===mr||c===jr.exec?i&&!o?{done:!0,value:a(e,n,r)}:{done:!0,value:u(n,e,r)}:{done:!1}}));de(String.prototype,t,c[0]),de(jr,o,c[1])}r&&Ht(jr[o],"sham",!0)}("replace",(function(t,e,n){var r=Yr?"$":"$0";return[function(t,n){var r=F(this),o=null==t?void 0:ut(t,Hr);return o?x(o,t,r,n):x(e,Je(r),t,n)},function(t,o){var i=zt(this),u=Je(t);if("string"==typeof o&&-1===qr(o,r)&&-1===qr(o,"$<")){var a=n(e,i,u,o);if(a.done)return a.value}var c=$(o);c||(o=Je(o));var f=i.global;if(f){var s=i.unicode;i.lastIndex=0}for(var l=[];;){var d=$r(i,u);if(null===d)break;if(Ur(l,d),!f)break;""===Je(d[0])&&(i.lastIndex=kr(u,we(i.lastIndex),s))}for(var p,v="",h=0,y=0;y<l.length;y++){for(var g=Je((d=l[y])[0]),m=Br(Gr(he(d.index),u.length),0),b=[],w=1;w<d.length;w++)Ur(b,void 0===(p=d[w])?p:String(p));var S=d.groups;if(c){var x=Wr([g],b,m,u);void 0!==S&&Ur(x,S);var E=Je(Er(o,void 0,x))}else E=Fr(g,u,m,b,S,o);m>=h&&(v+=Kr(u,h,m)+E,h=m+g.length)}return v+Kr(u,h)}]}),!!b((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}))||!Xr||Yr);var Qr=m.Promise,Zr=function(t,e,n){for(var r in e)de(t,r,e[r],n);return t},to=m.String,eo=m.TypeError,no=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=R(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return zt(n),function(t){if("object"==typeof t||$(t))return t;throw eo("Can't set "+to(t)+" as a prototype")}(r),e?t(n,r):n.__proto__=r,n}}():void 0),ro=$t.f,oo=jt("toStringTag"),io=function(t,e,n){t&&!yt(t=n?t:t.prototype,oo)&&ro(t,oo,{configurable:!0,value:e})},uo=jt("species"),ao=m.TypeError,co=function(t,e){if(W(e,t))return t;throw ao("Incorrect invocation")},fo={},so=jt("iterator"),lo=Array.prototype,po=jt("iterator"),vo=function(t){if(null!=t)return ut(t,po)||ut(t,"@@iterator")||fo[Xe(t)]},ho=m.TypeError,yo=function(t,e,n){var r,o;zt(t);try{if(!(r=ut(t,"return"))){if("throw"===e)throw n;return n}r=x(r,t)}catch(t){o=!0,r=t}if("throw"===e)throw n;if(o)throw r;return zt(r),n},go=m.TypeError,mo=function(t,e){this.stopped=t,this.result=e},bo=mo.prototype,wo=function(t,e,n){var r,o,i,u,a,c,f,s,l=n&&n.that,d=!(!n||!n.AS_ENTRIES),p=!(!n||!n.IS_ITERATOR),v=!(!n||!n.INTERRUPTED),h=Tn(e,l),y=function(t){return r&&yo(r,"normal",t),new mo(!0,t)},g=function(t){return d?(zt(t),v?h(t[0],t[1],y):h(t[0],t[1])):v?h(t,y):h(t)};if(p)r=t;else{if(!(o=vo(t)))throw go(rt(t)+" is not iterable");if(void 0!==(s=o)&&(fo.Array===s||lo[so]===s)){for(i=0,u=Se(t);u>i;i++)if((a=g(t[i]))&&W(bo,a))return a;return new mo(!1)}r=function(t,e){var n=arguments.length<2?vo(t):e;if(it(n))return zt(x(n,t));throw ho(rt(t)+" is not iterable")}(t,o)}for(c=r.next;!(f=x(c,r)).done;){try{a=g(f.value)}catch(t){yo(r,"throw",t)}if("object"==typeof a&&a&&W(bo,a))return a}return new mo(!1)},So=jt("iterator"),xo=!1;try{var Eo=0,Oo={next:function(){return{done:!!Eo++}},return:function(){xo=!0}};Oo[So]=function(){return this},Array.from(Oo,(function(){throw 2}))}catch(t){}var jo,Io,Po,To,Mo=function(t,e){if(!e&&!xo)return!1;var n=!1;try{var r={};r[So]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n},Ao=m.TypeError,Ro=jt("species"),ko=function(t,e){var n,r=zt(t).constructor;return void 0===r||null==(n=zt(r)[Ro])?e:function(t){if(Dn(t))return t;throw Ao(rt(t)+" is not a constructor")}(n)},Co=R([].slice),No=/(?:ipad|iphone|ipod).*applewebkit/i.test(U),Lo="process"==N(m.process),Vo=m.setImmediate,Do=m.clearImmediate,zo=m.process,Fo=m.Dispatch,_o=m.Function,$o=m.MessageChannel,Ho=m.String,Bo=0,Go={},Wo="onreadystatechange";try{jo=m.location}catch(t){}var Uo=function(t){if(yt(Go,t)){var e=Go[t];delete Go[t],e()}},qo=function(t){return function(){Uo(t)}},Ko=function(t){Uo(t.data)},Xo=function(t){m.postMessage(Ho(t),jo.protocol+"//"+jo.host)};Vo&&Do||(Vo=function(t){var e=Co(arguments,1);return Go[++Bo]=function(){Er($(t)?t:_o(t),void 0,e)},Io(Bo),Bo},Do=function(t){delete Go[t]},Lo?Io=function(t){zo.nextTick(qo(t))}:Fo&&Fo.now?Io=function(t){Fo.now(qo(t))}:$o&&!No?(To=(Po=new $o).port2,Po.port1.onmessage=Ko,Io=Tn(To.postMessage,To)):m.addEventListener&&$(m.postMessage)&&!m.importScripts&&jo&&"file:"!==jo.protocol&&!b(Xo)?(Io=Xo,m.addEventListener("message",Ko,!1)):Io=Wo in kt("script")?function(t){hn.appendChild(kt("script")).onreadystatechange=function(){hn.removeChild(this),Uo(t)}}:function(t){setTimeout(qo(t),0)});var Yo,Jo,Qo,Zo,ti,ei,ni,ri,oi={set:Vo,clear:Do},ii=/ipad|iphone|ipod/i.test(U)&&void 0!==m.Pebble,ui=/web0s(?!.*chrome)/i.test(U),ai=Lt.f,ci=oi.set,fi=m.MutationObserver||m.WebKitMutationObserver,si=m.document,li=m.process,di=m.Promise,pi=ai(m,"queueMicrotask"),vi=pi&&pi.value;vi||(Yo=function(){var t,e;for(Lo&&(t=li.domain)&&t.exit();Jo;){e=Jo.fn,Jo=Jo.next;try{e()}catch(t){throw Jo?Zo():Qo=void 0,t}}Qo=void 0,t&&t.enter()},No||Lo||ui||!fi||!si?!ii&&di&&di.resolve?((ni=di.resolve(void 0)).constructor=di,ri=Tn(ni.then,ni),Zo=function(){ri(Yo)}):Lo?Zo=function(){li.nextTick(Yo)}:(ci=Tn(ci,m),Zo=function(){ci(Yo)}):(ti=!0,ei=si.createTextNode(""),new fi(Yo).observe(ei,{characterData:!0}),Zo=function(){ei.data=ti=!ti}));var hi,yi,gi,mi,bi=vi||function(t){var e={fn:t,next:void 0};Qo&&(Qo.next=e),Jo||(Jo=e,Zo()),Qo=e},wi=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=it(e),this.reject=it(n)},Si={f:function(t){return new wi(t)}},xi=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Ei="object"==typeof window,Oi=oi.set,ji=jt("species"),Ii="Promise",Pi=ae.getterFor(Ii),Ti=ae.set,Mi=ae.getterFor(Ii),Ai=Qr&&Qr.prototype,Ri=Qr,ki=Ai,Ci=m.TypeError,Ni=m.document,Li=m.process,Vi=Si.f,Di=Vi,zi=!!(Ni&&Ni.createEvent&&m.dispatchEvent),Fi=$(m.PromiseRejectionEvent),_i="unhandledrejection",$i=!1,Hi=_e(Ii,(function(){var t=qt(Ri),e=t!==String(Ri);if(!e&&66===J)return!0;if(J>=51&&/native code/.test(t))return!1;var n=new Ri((function(t){t(1)})),r=function(t){t((function(){}),(function(){}))};return(n.constructor={})[ji]=r,!($i=n.then((function(){}))instanceof r)||!e&&Ei&&!Fi})),Bi=Hi||!Mo((function(t){Ri.all(t).catch((function(){}))})),Gi=function(t){var e;return!(!H(t)||!$(e=t.then))&&e},Wi=function(t,e){if(!t.notified){t.notified=!0;var n=t.reactions;bi((function(){for(var r=t.value,o=1==t.state,i=0;n.length>i;){var u,a,c,f=n[i++],s=o?f.ok:f.fail,l=f.resolve,d=f.reject,p=f.domain;try{s?(o||(2===t.rejection&&Xi(t),t.rejection=1),!0===s?u=r:(p&&p.enter(),u=s(r),p&&(p.exit(),c=!0)),u===f.promise?d(Ci("Promise-chain cycle")):(a=Gi(u))?x(a,u,l,d):l(u)):d(r)}catch(t){p&&!c&&p.exit(),d(t)}}t.reactions=[],t.notified=!1,e&&!t.rejection&&qi(t)}))}},Ui=function(t,e,n){var r,o;zi?((r=Ni.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),m.dispatchEvent(r)):r={promise:e,reason:n},!Fi&&(o=m["on"+t])?o(r):t===_i&&function(t,e){var n=m.console;n&&n.error&&(1==arguments.length?n.error(t):n.error(t,e))}("Unhandled promise rejection",n)},qi=function(t){x(Oi,m,(function(){var e,n=t.facade,r=t.value;if(Ki(t)&&(e=xi((function(){Lo?Li.emit("unhandledRejection",r,n):Ui(_i,n,r)})),t.rejection=Lo||Ki(t)?2:1,e.error))throw e.value}))},Ki=function(t){return 1!==t.rejection&&!t.parent},Xi=function(t){x(Oi,m,(function(){var e=t.facade;Lo?Li.emit("rejectionHandled",e):Ui("rejectionhandled",e,t.value)}))},Yi=function(t,e,n){return function(r){t(e,r,n)}},Ji=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,Wi(t,!0))},Qi=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw Ci("Promise can't be resolved itself");var r=Gi(e);r?bi((function(){var n={done:!1};try{x(r,e,Yi(Qi,n,t),Yi(Ji,n,t))}catch(e){Ji(n,e,t)}})):(t.value=e,t.state=1,Wi(t,!1))}catch(e){Ji({done:!1},e,t)}}};if(Hi&&(ki=(Ri=function(t){co(this,ki),it(t),x(hi,this);var e=Pi(this);try{t(Yi(Qi,e),Yi(Ji,e))}catch(t){Ji(e,t)}}).prototype,(hi=function(t){Ti(this,{type:Ii,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=Zr(ki,{then:function(t,e){var n=Mi(this),r=n.reactions,o=Vi(ko(this,Ri));return o.ok=!$(t)||t,o.fail=$(e)&&e,o.domain=Lo?Li.domain:void 0,n.parent=!0,r[r.length]=o,0!=n.state&&Wi(n,!1),o.promise},catch:function(t){return this.then(void 0,t)}}),yi=function(){var t=new hi,e=Pi(t);this.promise=t,this.resolve=Yi(Qi,e),this.reject=Yi(Ji,e)},Si.f=Vi=function(t){return t===Ri||t===gi?new yi(t):Di(t)},$(Qr)&&Ai!==Object.prototype)){mi=Ai.then,$i||(de(Ai,"then",(function(t,e){var n=this;return new Ri((function(t,e){x(mi,n,t,e)})).then(t,e)}),{unsafe:!0}),de(Ai,"catch",ki.catch,{unsafe:!0}));try{delete Ai.constructor}catch(t){}no&&no(Ai,ki)}function Zi(t,n,r){return void 0===r&&(r=""),c(this,void 0,void 0,(function(){var o,i,u,a,c,s,l;return f(this,(function(f){switch(f.label){case 0:return n?(t.restoreSelection(),o=t.getMenuConfig("insertVideo"),i=o.onInsertedVideo,u=o.checkVideo,a=o.parseVideoSrc,[4,u(n,r)]):[2];case 1:return"string"==typeof(c=f.sent())?(t.alert(c,"error"),[2]):null==c?[2]:[4,a(n)];case 2:return 0!==(s=f.sent()).trim().indexOf("<iframe ")&&(s=s.replace(/</g,"<").replace(/>/g,">")),l={type:"video",src:s,poster:r,children:[{text:""}]},Promise.resolve().then((function(){e.Transforms.insertNodes(t,l)})),i(l),[2]}}))}))}function tu(){return Jr("w-e-insert-video")}He({global:!0,wrap:!0,forced:Hi},{Promise:Ri}),io(Ri,Ii,!1),function(t){var e=G(t),n=$t.f;w&&e&&!e[uo]&&n(e,uo,{configurable:!0,get:function(){return this}})}(Ii),gi=G(Ii),He({target:Ii,stat:!0,forced:Hi},{reject:function(t){var e=Vi(this);return x(e.reject,void 0,t),e.promise}}),He({target:Ii,stat:!0,forced:Hi},{resolve:function(t){return function(t,e){if(zt(t),H(e)&&e.constructor===t)return e;var n=Si.f(t);return(0,n.resolve)(e),n.promise}(this,t)}}),He({target:Ii,stat:!0,forced:Bi},{all:function(t){var e=this,n=Vi(e),r=n.resolve,o=n.reject,i=xi((function(){var n=it(e.resolve),i=[],u=0,a=1;wo(t,(function(t){var c=u++,f=!1;a++,x(n,e,t).then((function(t){f||(f=!0,i[c]=t,--a||r(i))}),o)})),--a||r(i)}));return i.error&&o(i.value),n.promise},race:function(t){var e=this,n=Vi(e),r=n.reject,o=xi((function(){var o=it(e.resolve);wo(t,(function(t){x(o,e,t).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}});var eu=function(){function n(){this.title=t.t("videoModule.insertVideo"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M981.184 160.096C837.568 139.456 678.848 128 512 128S186.432 139.456 42.816 160.096C15.296 267.808 0 386.848 0 512s15.264 244.16 42.816 351.904C186.464 884.544 345.152 896 512 896s325.568-11.456 469.184-32.096C1008.704 756.192 1024 637.152 1024 512s-15.264-244.16-42.816-351.904zM384 704V320l320 192-320 192z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=320,this.$content=null,this.srcInputId=tu(),this.posterInputId=tu(),this.buttonId=tu()}return n.prototype.getValue=function(t){return""},n.prototype.isActive=function(t){return!1},n.prototype.exec=function(t,e){},n.prototype.isDisabled=function(n){var r=n.selection;return null==r||(!e.Range.isCollapsed(r)||!!t.DomEditor.getSelectedElems(n).some((function(e){var r=t.DomEditor.getNodeType(e);return"pre"===r||("list-item"===r||!!n.isVoid(e))})))},n.prototype.getModalPositionNode=function(t){return null},n.prototype.getModalContentElem=function(e){var n=this,r=this,o=r.srcInputId,i=r.posterInputId,a=r.buttonId,s=l(t.genModalInputElems(t.t("videoModule.videoSrc"),o,t.t("videoModule.videoSrcPlaceHolder")),2),d=s[0],p=s[1],v=l(t.genModalInputElems(t.t("videoModule.videoPoster"),i,t.t("videoModule.videoPosterPlaceHolder")),2),h=v[0],y=v[1],g=u.default(p),m=u.default(y),b=l(t.genModalButtonElems(a,t.t("videoModule.ok")),1)[0];if(null==this.$content){var w=u.default("<div></div>");w.on("click","#"+a,(function(t){return c(n,void 0,void 0,(function(){var n,r;return f(this,(function(u){switch(u.label){case 0:return t.preventDefault(),n=w.find("#"+o).val().trim(),r=w.find("#"+i).val().trim(),[4,Zi(e,n,r)];case 1:return u.sent(),e.hidePanelOrModal(),[2]}}))}))})),this.$content=w}var S=this.$content;return S.empty(),S.append(d),S.append(h),S.append(b),g.val(""),m.val(""),setTimeout((function(){g.focus()})),S[0]},n}(),nu=R([].join),ru=D!=Object,ou=function(t,e){var n=[][t];return!!n&&b((function(){n.call(null,e||function(){throw 1},1)}))}("join",",");He({target:"Array",proto:!0,forced:ru||!ou},{join:function(t){return nu(_(this),void 0===t?",":t)}});var iu,uu,au,cu=!b((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),fu=Jt("IE_PROTO"),su=m.Object,lu=su.prototype,du=cu?su.getPrototypeOf:function(t){var e=vt(t);if(yt(e,fu))return e[fu];var n=e.constructor;return $(n)&&e instanceof n?n.prototype:e instanceof su?lu:null},pu=jt("iterator"),vu=!1;[].keys&&("next"in(au=[].keys())?(uu=du(du(au)))!==Object.prototype&&(iu=uu):vu=!0);var hu=null==iu||b((function(){var t={};return iu[pu].call(t)!==t}));hu&&(iu={}),$(iu[pu])||de(iu,pu,(function(){return this}));var yu={IteratorPrototype:iu,BUGGY_SAFARI_ITERATORS:vu},gu=yu.IteratorPrototype,mu=function(){return this},bu=le.PROPER,wu=le.CONFIGURABLE,Su=yu.IteratorPrototype,xu=yu.BUGGY_SAFARI_ITERATORS,Eu=jt("iterator"),Ou="keys",ju="values",Iu="entries",Pu=function(){return this},Tu=function(t,e,n,r,o,i,u){!function(t,e,n,r){var o=e+" Iterator";t.prototype=Sn(gu,{next:I(+!r,n)}),io(t,o,!1),fo[o]=mu}(n,e,r);var a,c,f,s=function(t){if(t===o&&h)return h;if(!xu&&t in p)return p[t];switch(t){case Ou:case ju:case Iu:return function(){return new n(this,t)}}return function(){return new n(this)}},l=e+" Iterator",d=!1,p=t.prototype,v=p[Eu]||p["@@iterator"]||o&&p[o],h=!xu&&v||s(o),y="Array"==e&&p.entries||v;if(y&&(a=du(y.call(new t)))!==Object.prototype&&a.next&&(du(a)!==Su&&(no?no(a,Su):$(a[Eu])||de(a,Eu,Pu)),io(a,l,!0)),bu&&o==ju&&v&&v.name!==ju&&(wu?Ht(p,"name",ju):(d=!0,h=function(){return x(v,this)})),o)if(c={values:s(ju),keys:i?h:s(Ou),entries:s(Iu)},u)for(f in c)(xu||d||!(f in p))&&de(p,f,c[f]);else He({target:e,proto:!0,forced:xu||d},c);return p[Eu]!==h&&de(p,Eu,h,{name:o}),fo[e]=h,c},Mu="Array Iterator",Au=ae.set,Ru=ae.getterFor(Mu),ku=Tu(Array,"Array",(function(t,e){Au(this,{type:Mu,target:_(t),index:0,kind:e})}),(function(){var t=Ru(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}}),"values");fo.Arguments=fo.Array,On("keys"),On("values"),On("entries");var Cu=Ar.charAt,Nu="String Iterator",Lu=ae.set,Vu=ae.getterFor(Nu);Tu(String,"String",(function(t){Lu(this,{type:Nu,string:Je(t),index:0})}),(function(){var t,e=Vu(this),n=e.string,r=e.index;return r>=n.length?{value:void 0,done:!0}:(t=Cu(n,r),e.index+=t.length,{value:t,done:!1})}));var Du=function(t,e,n){var r=Mt(e);r in t?$t.f(t,r,I(0,n)):t[r]=n},zu=m.Array,Fu=Math.max,_u=Me.f,$u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Hu=function(t){try{return _u(t)}catch(t){return function(t,e,n){for(var r=Se(t),o=me(e,r),i=me(void 0===n?r:n,r),u=zu(Fu(i-o,0)),a=0;o<i;o++,a++)Du(u,a,t[o]);return u.length=a,u}($u)}},Bu={f:function(t){return $u&&"Window"==N(t)?Hu(t):_u(_(t))}},Gu=b((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})),Wu=Object.isExtensible,Uu=b((function(){Wu(1)}))||Gu?function(t){return!!H(t)&&((!Gu||"ArrayBuffer"!=N(t))&&(!Wu||Wu(t)))}:Wu,qu=!b((function(){return Object.isExtensible(Object.preventExtensions({}))})),Ku=v((function(t){var e=$t.f,n=!1,r=wt("meta"),o=0,i=function(t){e(t,r,{value:{objectID:"O"+o++,weakData:{}}})},u=t.exports={enable:function(){u.enable=function(){},n=!0;var t=Me.f,e=R([].splice),o={};o[r]=1,t(o).length&&(Me.f=function(n){for(var o=t(n),i=0,u=o.length;i<u;i++)if(o[i]===r){e(o,i,1);break}return o},He({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Bu.f}))},fastKey:function(t,e){if(!H(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!yt(t,r)){if(!Uu(t))return"F";if(!e)return"E";i(t)}return t[r].objectID},getWeakData:function(t,e){if(!yt(t,r)){if(!Uu(t))return!0;if(!e)return!1;i(t)}return t[r].weakData},onFreeze:function(t){return qu&&n&&Uu(t)&&!yt(t,r)&&i(t),t}};Qt[r]=!0})),Xu=Ku.getWeakData,Yu=ae.set,Ju=ae.getterFor,Qu=Bn.find,Zu=Bn.findIndex,ta=R([].splice),ea=0,na=function(t){return t.frozen||(t.frozen=new ra)},ra=function(){this.entries=[]},oa=function(t,e){return Qu(t.entries,(function(t){return t[0]===e}))};ra.prototype={get:function(t){var e=oa(this,t);if(e)return e[1]},has:function(t){return!!oa(this,t)},set:function(t,e){var n=oa(this,t);n?n[1]=e:this.entries.push([t,e])},delete:function(t){var e=Zu(this.entries,(function(e){return e[0]===t}));return~e&&ta(this.entries,e,1),!!~e}};var ia,ua={getConstructor:function(t,e,n,r){var o=t((function(t,o){co(t,i),Yu(t,{type:e,id:ea++,frozen:void 0}),null!=o&&wo(o,t[r],{that:t,AS_ENTRIES:n})})),i=o.prototype,u=Ju(e),a=function(t,e,n){var r=u(t),o=Xu(zt(e),!0);return!0===o?na(r).set(e,n):o[r.id]=n,t};return Zr(i,{delete:function(t){var e=u(this);if(!H(t))return!1;var n=Xu(t);return!0===n?na(e).delete(t):n&&yt(n,e.id)&&delete n[e.id]},has:function(t){var e=u(this);if(!H(t))return!1;var n=Xu(t);return!0===n?na(e).has(t):n&&yt(n,e.id)}}),Zr(i,n?{get:function(t){var e=u(this);if(H(t)){var n=Xu(t);return!0===n?na(e).get(t):n?n[e.id]:void 0}},set:function(t,e){return a(this,t,e)}}:{add:function(t){return a(this,t,!0)}}),o}},aa=ae.enforce,ca=!m.ActiveXObject&&"ActiveXObject"in m,fa=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},sa=function(t,e,n){var r=-1!==t.indexOf("Map"),o=-1!==t.indexOf("Weak"),i=r?"set":"add",u=m[t],a=u&&u.prototype,c=u,f={},s=function(t){var e=R(a[t]);de(a,t,"add"==t?function(t){return e(this,0===t?0:t),this}:"delete"==t?function(t){return!(o&&!H(t))&&e(this,0===t?0:t)}:"get"==t?function(t){return o&&!H(t)?void 0:e(this,0===t?0:t)}:"has"==t?function(t){return!(o&&!H(t))&&e(this,0===t?0:t)}:function(t,n){return e(this,0===t?0:t,n),this})};if(_e(t,!$(u)||!(o||a.forEach&&!b((function(){(new u).entries().next()})))))c=n.getConstructor(e,t,r,i),Ku.enable();else if(_e(t,!0)){var l=new c,d=l[i](o?{}:-0,1)!=l,p=b((function(){l.has(1)})),v=Mo((function(t){new u(t)})),h=!o&&b((function(){for(var t=new u,e=5;e--;)t[i](e,e);return!t.has(-0)}));v||((c=e((function(t,e){co(t,a);var n=function(t,e,n){var r,o;return no&&$(r=e.constructor)&&r!==n&&H(o=r.prototype)&&o!==n.prototype&&no(t,o),t}(new u,t,c);return null!=e&&wo(e,n[i],{that:n,AS_ENTRIES:r}),n}))).prototype=a,a.constructor=c),(p||h)&&(s("delete"),s("has"),r&&s("get")),(h||d)&&s(i),o&&a.clear&&delete a.clear}return f[t]=c,He({global:!0,forced:c!=u},f),io(c,t),o||n.setStrong(c,t,r),c}("WeakMap",fa,ua);if(Xt&&ca){ia=ua.getConstructor(fa,"WeakMap",!0),Ku.enable();var la=sa.prototype,da=R(la.delete),pa=R(la.has),va=R(la.get),ha=R(la.set);Zr(la,{delete:function(t){if(H(t)&&!Uu(t)){var e=aa(this);return e.frozen||(e.frozen=new ia),da(this,t)||e.frozen.delete(t)}return da(this,t)},has:function(t){if(H(t)&&!Uu(t)){var e=aa(this);return e.frozen||(e.frozen=new ia),pa(this,t)||e.frozen.has(t)}return pa(this,t)},get:function(t){if(H(t)&&!Uu(t)){var e=aa(this);return e.frozen||(e.frozen=new ia),pa(this,t)?va(this,t):e.frozen.get(t)}return va(this,t)},set:function(t,e){if(H(t)&&!Uu(t)){var n=aa(this);n.frozen||(n.frozen=new ia),pa(this,t)?ha(this,t,e):n.frozen.set(t,e)}else ha(this,t,e);return this}})}var ya={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},ga=kt("span").classList,ma=ga&&ga.constructor&&ga.constructor.prototype,ba=ma===Object.prototype?void 0:ma,wa=jt("iterator"),Sa=jt("toStringTag"),xa=ku.values,Ea=function(t,e){if(t){if(t[wa]!==xa)try{Ht(t,wa,xa)}catch(e){t[wa]=xa}if(t[Sa]||Ht(t,Sa,e),ya[e])for(var n in ku)if(t[n]!==ku[n])try{Ht(t,n,ku[n])}catch(e){t[n]=ku[n]}}};for(var Oa in ya)Ea(m[Oa]&&m[Oa].prototype,Oa);Ea(ba,"DOMTokenList");var ja=le.EXISTS,Ia=$t.f,Pa=Function.prototype,Ta=R(Pa.toString),Ma=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,Aa=R(Ma.exec);w&&!ja&&Ia(Pa,"name",{configurable:!0,get:function(){try{return Aa(Ma,Ta(this))[1]}catch(t){return""}}});var Ra=jt("species"),ka=function(t){return J>=51||!b((function(){var e=[];return(e.constructor={})[Ra]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}("slice"),Ca=jt("species"),Na=m.Array,La=Math.max;function Va(t){return t.getMenuConfig("uploadVideo")}He({target:"Array",proto:!0,forced:!ka},{slice:function(t,e){var n,r,o,i=_(this),u=Se(i),a=me(t,u),c=me(void 0===e?u:e,u);if(Mn(i)&&(n=i.constructor,(Dn(n)&&(n===Na||Mn(n.prototype))||H(n)&&null===(n=n[Ca]))&&(n=void 0),n===Na||void 0===n))return Co(i,a,c);for(r=new(void 0===n?Na:n)(La(c-a,0)),o=0;a<c;a++,o++)a in i&&Du(r,o,i[a]);return r.length=o,r}});var Da=new WeakMap;function za(e,n){return c(this,void 0,void 0,(function(){var r,o,i,u;return f(this,(function(c){switch(c.label){case 0:return r=function(e){var n=Da.get(e);if(null!=n)return n;var r=Va(e),o=r.onSuccess,i=r.onProgress,u=r.onFailed,c=r.customInsert,f=r.onError;return n=t.createUploader(a(a({},r),{onProgress:function(t){e.showProgressBar(t),i&&i(t)},onSuccess:function(t,n){if(c)return c(n,(function(t,n){return Zi(e,t,n)})),void o(t,n);var r=n.errno,i=void 0===r?1:r,a=n.data,f=void 0===a?{}:a;if(0===i){var s=f.url,l=void 0===s?"":s,d=f.poster;Zi(e,l,void 0===d?"":d),o(t,n)}else u(t,n)},onError:function(t,e,n){f(t,e,n)}})),Da.set(e,n),n}(e),o=n.name,i=n.type,u=n.size,r.addFile({name:o,type:i,size:u,data:n}),[4,r.upload()];case 1:return c.sent(),[2]}}))}))}var Fa=function(){function n(){this.title=t.t("videoModule.uploadVideo"),this.iconSvg='<svg viewBox="0 0 1056 1024"><path d="M805.902261 521.819882a251.441452 251.441452 0 0 0-251.011972 246.600033 251.051015 251.051015 0 1 0 502.023944 8.823877 253.237463 253.237463 0 0 0-251.011972-255.42391z m59.463561 240.001647v129.898403h-116.701631v-129.898403h-44.041298l101.279368-103.504859 101.279368 103.504859z" p-id="6802"></path><path d="M788.254507 0.000781H99.094092A98.663439 98.663439 0 0 0 0.001171 99.093701v590.067495a98.663439 98.663439 0 0 0 99.092921 99.092921h411.7549a266.434235 266.434235 0 0 1-2.186448-41.815807 275.843767 275.843767 0 0 1 275.180024-270.729042 270.650955 270.650955 0 0 1 103.504859 19.834201V99.093701A101.51363 101.51363 0 0 0 788.254507 0.000781zM295.054441 640.747004V147.507894l394.146189 246.600033z"></path></svg>',this.tag="button"}return n.prototype.getValue=function(t){return""},n.prototype.isActive=function(t){return!1},n.prototype.exec=function(t,e){var n=this.getMenuConfig(t),r=n.allowedFileTypes,o=void 0===r?[]:r,i=n.customBrowseAndUpload;if(i)i((function(e,n){return Zi(t,e,n)}));else{var a="";o.length>0&&(a='accept="'+o.join(", ")+'"');var s=u.default("body"),l=u.default('<input type="file" '+a+" multiple/>");l.hide(),s.append(l),l.click(),l.on("change",(function(){var e=l[0].files;!function(t,e){var n,r;c(this,void 0,void 0,(function(){var o,i,u,a,c,s;return f(this,(function(f){switch(f.label){case 0:if(null==e)return[2];o=Array.prototype.slice.call(e),i=Va(t).customUpload,f.label=1;case 1:f.trys.push([1,9,10,15]),u=d(o),f.label=2;case 2:return[4,u.next()];case 3:return(a=f.sent()).done?[3,8]:(c=a.value,i?[4,i(c,(function(e,n){return Zi(t,e,n)}))]:[3,5]);case 4:return f.sent(),[3,7];case 5:return[4,za(t,c)];case 6:f.sent(),f.label=7;case 7:return[3,2];case 8:return[3,15];case 9:return s=f.sent(),n={error:s},[3,15];case 10:return f.trys.push([10,,13,14]),a&&!a.done&&(r=u.return)?[4,r.call(u)]:[3,12];case 11:f.sent(),f.label=12;case 12:return[3,14];case 13:if(n)throw n.error;return[7];case 14:return[7];case 15:return[2]}}))}))}(t,e)}))}},n.prototype.isDisabled=function(n){var r=n.selection;return null==r||(!e.Range.isCollapsed(r)||!!t.DomEditor.getSelectedElems(n).some((function(e){var r=t.DomEditor.getNodeType(e);return"pre"===r||("list-item"===r||!!n.isVoid(e))})))},n.prototype.getMenuConfig=function(t){return t.getMenuConfig("uploadVideo")},n}(),_a=le.PROPER,$a="toString",Ha=RegExp.prototype,Ba=Ha.toString,Ga=R(Qn),Wa=b((function(){return"/a/b"!=Ba.call({source:"a",flags:"b"})})),Ua=_a&&Ba.name!=$a;function qa(){return Jr("w-e-insert-video")}(Wa||Ua)&&de(RegExp.prototype,$a,(function(){var t=zt(this),e=Je(t.source),n=t.flags;return"/"+e+"/"+Je(void 0===n&&W(Ha,t)&&!("flags"in Ha)?Ga(t):n)}),{unsafe:!0});var Ka=function(){function n(){this.title=t.t("videoModule.editSize"),this.tag="button",this.showModal=!0,this.modalWidth=320,this.$content=null,this.widthInputId=qa(),this.heightInputId=qa(),this.buttonId=qa()}return n.prototype.getSelectedVideoNode=function(e){return t.DomEditor.getSelectedNodeByType(e,"video")},n.prototype.getValue=function(t){return""},n.prototype.isActive=function(t){return!1},n.prototype.exec=function(t,e){},n.prototype.isDisabled=function(t){return null==t.selection||null==this.getSelectedVideoNode(t)},n.prototype.getModalPositionNode=function(t){return this.getSelectedVideoNode(t)},n.prototype.getModalContentElem=function(n){var r=this,o=r.widthInputId,i=r.heightInputId,a=r.buttonId,c=l(t.genModalInputElems(t.t("videoModule.width"),o,"auto"),2),f=c[0],s=c[1],d=u.default(s),p=l(t.genModalInputElems(t.t("videoModule.height"),i,"auto"),2),v=p[0],h=p[1],y=u.default(h),g=l(t.genModalButtonElems(a,t.t("videoModule.ok")),1)[0];if(null==this.$content){var m=u.default("<div></div>");m.on("click","#"+a,(function(r){r.preventDefault();var u=m.find("#"+o).val().trim(),a=m.find("#"+i).val().trim(),c=parseInt(u),f=parseInt(a),s=c?c.toString():"auto",l=f?f.toString():"auto";n.restoreSelection(),e.Transforms.setNodes(n,{width:s,height:l},{match:function(e){return t.DomEditor.checkNodeType(e,"video")}}),n.hidePanelOrModal()})),this.$content=m}var b=this.$content;b.empty(),b.append(f),b.append(v),b.append(g);var w=this.getSelectedVideoNode(n);if(null==w)return b[0];var S=w.width,x=void 0===S?"auto":S,E=w.height,O=void 0===E?"auto":E;return d.val(x),y.val(O),setTimeout((function(){d.focus()})),b[0]},n}();var Xa={renderElems:[sn],elemsToHtml:[dn],preParseHtml:[In],parseElemsHtml:[Jn],menus:[{key:"insertVideo",factory:function(){return new eu},config:{onInsertedVideo:function(t){},checkVideo:function(t,e){return!0},parseVideoSrc:function(t){return t}}},{key:"uploadVideo",factory:function(){return new Fa},config:{server:"",fieldName:"wangeditor-uploaded-video",maxFileSize:10485760,maxNumberOfFiles:5,allowedFileTypes:["video/*"],meta:{},metaWithUrl:!1,withCredentials:!1,timeout:3e4,onBeforeUpload:function(t){return t},onProgress:function(t){},onSuccess:function(t,e){},onFailed:function(t,e){console.error("'"+t.name+"' upload failed",e)},onError:function(t,e,n){console.error("'"+t.name+" upload error",e,n)}}},{key:"editVideoSize",factory:function(){return new Ka}}],editorPlugin:function(n){var r=n.isVoid,o=n.normalizeNode,i=n;return i.isVoid=function(t){return"video"===t.type||r(t)},i.normalizeNode=function(n){var r=l(n,2),u=r[0],a=r[1];"video"===t.DomEditor.getNodeType(u)&&(t.DomEditor.isLastNode(i,u)&&e.Transforms.insertNodes(i,t.DomEditor.genEmptyParagraph(),{at:[a[0]+1]}));return o([u,a])},i}};return Xa}));
 | 
						||
//# sourceMappingURL=index.js.map
 |