a2b63df.js 17 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([[2],{988:function(e,r,t){var n=t(419);t(24),t(55),t(48),t(93),t(40),t(39),t(420),t(22),t(6),t(77),t(49),t(130),t(36),t(12),t(29),t(11),t(13),function(e){"use strict";var r=function e(r){var t=r,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return e(n())}}},t=function(e){return parseInt(e,10)},i=function(e,r){var t=e-r;return 0===t?0:0<t?1:-1},o=function(e,r,t){return{major:e,minor:r,patch:t}},c=function(e){var r=/([0-9]+)\.([0-9]+)\.([0-9]+)(?:(\-.+)?)/.exec(e);return r?o(t(r[1]),t(r[2]),t(r[3])):o(0,0,0)},f=function(e,r){return!!e&&-1===function(e,r){var t=i(e.major,r.major);if(0!==t)return t;var n=i(e.minor,r.minor);if(0!==n)return n;var o=i(e.patch,r.patch);return 0!==o?o:0}(c([(t=e).majorVersion,t.minorVersion].join(".").split(".").slice(0,3).join(".")),c(r));var t},l=function(){return(l=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e}).apply(this,arguments)};function m(){for(var e=0,r=0,t=arguments.length;r<t;r++)e+=arguments[r].length;var n=Array(e),o=0;for(r=0;r<t;r++)for(var i=arguments[r],a=0,u=i.length;a<u;a++,o++)n[o]=i[a];return n}var d,v,u,s,h,y,g,p,S,b,O,w,N,x=function(e){return function(){return e}},T=x(!1),E=x(!0),A=function(){return k(0,0)},k=function(e,r){return{major:e,minor:r}},_=function(e,r){var t=String(r).toLowerCase();return 0===e.length?A():function(e,r){var t=function(e,r){for(var t=0;t<e.length;t++){var n=e[t];if(n.test(r))return n}}(e,r);if(!t)return{major:0,minor:0};var n=function(e){return Number(r.replace(t,"$"+e))};return k(n(1),n(2))}(e,t)},C=A,R="Edge",L="Chrome",D="Opera",P="Firefox",F="Safari",I=function(e,r){return function(){return r===e}},B=function(e){var r=e.current;return{current:r,version:e.version,isEdge:I(R,r),isChrome:I(L,r),isIE:I("IE",r),isOpera:I(D,r),isFirefox:I(P,r),isSafari:I(F,r)}},j=function(){return B({current:void 0,version:C()})},M=B,U=(x(R),x(L),x("IE"),x(D),x(P),x(F),"Windows"),V="Android",z="Linux",X="Solaris",W="FreeBSD",q="ChromeOS",Y=function(e,r){return function(){return r===e}},G=function(e){var r=e.current;return{current:r,version:e.version,isWindows:Y(U,r),isiOS:Y("iOS",r),isAndroid:Y(V,r),isOSX:Y("OSX",r),isLinux:Y(z,r),isSolaris:Y(X,r),isFreeBSD:Y(W,r),isChromeOS:Y(q,r)}},J=function(){return G({current:void 0,version:C()})},$=G,K=(x(U),x("iOS"),x(V),x(z),x("OSX"),x(X),x(W),x(q),function(){return Z}),Z=(d=function(e){return e.isNone()},s={fold:function(e,r){return e()},is:T,isSome:T,isNone:E,getOr:u=function(e){return e},getOrThunk:v=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:x(null),getOrUndefined:x(void 0),or:u,orThunk:v,map:K,each:function(){},bind:K,exists:T,forall:E,filter:K,equals:d,equals_:d,toArray:function(){return[]},toString:x("none()")},Object.freeze&&Object.freeze(s),s),H=function e(r){var t=x(r),n=function(){return c},o=function(e){return e(r)},c={fold:function(e,t){return t(r)},is:function(e){return r===e},isSome:E,isNone:T,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return e(t(r))},each:function(e){e(r)},bind:o,exists:o,forall:o,filter:function(e){return e(r)?c:Z},toArray:function(){return[r]},toString:function(){return"some("+r+")"},equals:function(e){return e.is(r)},equals_:function(e,t){return e.fold(T,(function(e){return t(r,e)}))}};return c},Q=H,ee=K,re=function(e){return null==e?Z:H(e)},te=function(e){return function(r){return function(e){if(null===e)return"null";var r=n(e);return"object"===r&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":r}(r)===e}},ne=te("string"),oe=te("array"),ie=te("boolean"),ae=te("function"),ue=te("number"),ce=(Array.prototype.slice,Array.prototype.indexOf),se=Array.prototype.push,fe=function(e,r){return t=e,n=r,-1<ce.call(t,n);var t,n},le=function(e,r){for(var t=0,n=e.length;t<n;t++)if(r(e[t],t))return!0;return!1},me=function(e,r){for(var t=e.length,n=new Array(t),o=0;o<t;o++){var i=e[o];n[o]=r(i,o)}return n},de=function(e,r){for(var t=[],n=0,o=e.length;n<o;n++){var i=e[n];r(i,n)&&t.push(i)}return t},ve=function(e,r){for(var t=0,n=e.length;t<n;t++){var o=e[t];if(r(o,t))return Q(o)}return ee()},ge=function(e,r){return function(e){for(var r=[],t=0,n=e.length;t<n;++t){if(!oe(e[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+e);se.apply(r,e[t])}return r}(me(e,r))},pe=(ae(Array.from)&&Array.from,function(e,r){var t=String(r).toLowerCase();return ve(e,(function(e){return e.search(t)}))}),he=function(e,r){return-1!==e.indexOf(r)},be=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ye=function(e){return function(r){return he(r,e)}},Se=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return he(e,"edge/")&&he(e,"chrome")&&he(e,"safari")&&he(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,be],search:function(e){return he(e,"chrome")&&!he(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return he(e,"msie")||he(e,"trident")}},{name:"Opera",versionRegexes:[be,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:ye("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:ye("firefox")},{name:"Safari",versionRegexes:[be,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(he(e,"safari")||he(e,"mobile/"))&&he(e,"applewebkit")}}],Oe=[{name:"Windows",search:ye("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return he(e,"iphone")||he(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:ye("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:ye("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:ye("linux"),versionRegexes:[]},{name:"Solaris",search:ye("sunos"),versionRegexes:[]},{name:"FreeBSD",search:ye("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:ye("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],we={browsers:x(Se),oses:x(Oe)},Ne=r(function(e,r){var t,n,o,i,a,u,c,s,f,l,m,d,v=we.browsers(),g=we.oses(),p=function(e,r){return pe(e,r).map((function(e){var t=_(e.versionRegexes,r);return{current:e.name,version:t}}))}(v,e).fold(j,M),h=function(e,r){return pe(e,r).map((function(e){var t=_(e.versionRegexes,r);return{current:e.name,version:t}}))}(g,e).fold(J,$);return{browser:p,os:h,deviceType:(n=p,o=e,i=r,a=(t=h).isiOS()&&!0===/ipad/i.test(o),u=t.isiOS()&&!a,c=t.isiOS()||t.isAndroid(),s=c||i("(pointer:coarse)"),f=a||!u&&c&&i("(min-device-width:768px)"),l=u||c&&!f,m=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(o),d=!l&&!f&&!m,{isiPad:x(a),isiPhone:x(u),isTablet:x(f),isPhone:x(l),isTouch:x(s),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:x(m),isDesktop:x(d)})}}(e.navigator.userAgent,(function(r){return e.window.matchMedia(r).matches}))),xe=function(){return Ne.get()},Te=Object.keys,Ee=Object.hasOwnProperty,Ae=function(e,r){for(var t=Te(e),n=0,o=t.length;n<o;n++){var i=t[n];r(e[i],i)}},ke=function(e,r){var t={};return Ae(e,(function(e,n){var o=r(e,n);t[o.k]=o.v})),t},_e=function(e){return function(r,t){e[t]=r}},Ce=function(e){return function(e){return e},r=[],Ae(e,(function(e,t){r.push(e)})),r;var r},Re=function(e,r){return Le(e,r)?re(e[r]):ee()},Le=function(e,r){return Ee.call(e,r)},De=(e.Node.ATTRIBUTE_NODE,e.Node.CDATA_SECTION_NODE,e.Node.COMMENT_NODE,e.Node.DOCUMENT_NODE,e.Node.DOCUMENT_TYPE_NODE,e.Node.DOCUMENT_FRAGMENT_NODE,e.Node.ELEMENT_NODE),Pe=e.Node.TEXT_NODE,Fe=(e.Node.PROCESSING_INSTRUCTION_NODE,e.Node.ENTITY_REFERENCE_NODE,e.Node.ENTITY_NODE,e.Node.NOTATION_NODE,void 0!==e.window?e.window:Function("return this;")(),h=Pe,function(e){return e.dom().nodeType===h}),Ie=function(r,t,n){!function(r,t,n){if(!(ne(n)||ie(n)||ue(n)))throw e.console.error("Invalid call to Attr.set. Key ",t,":: Value ",n,":: Element ",r),new Error("Attribute value was not simple");r.setAttribute(t,n+"")}(r.dom(),t,n)},Be=function(e,r){var t=e.dom().getAttribute(r);return null===t?void 0:t},je=function(e,r){e.dom().removeAttribute(r)},Me=function(e,r){var t=Be(e,r);return void 0===t||""===t?[]:t.split(" ")},Ue=function(e){return void 0!==e.dom().classList},Ve=function(e){return Me(e,"class")},qe=function(e,r){var t;Ue(e)?e.dom().classList.remove(r):function(e,r){return o=r,0<(i=de(Me(t=e,n="class"),(function(e){return e!==o}))).length?Ie(t,n,i.join(" ")):je(t,n),!1;var t,n,o,i}(e,r),0===(Ue(t=e)?t.dom().classList:Ve(t)).length&&je(t,"class")},ze=function(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:x(e)}},Xe=ze,We=function(e,r){e.fire("FormatPainterToggle",{state:r})};(g=y||(y={})).Retrival="Retrieval",g.Application="Application",(S=p||(p={})).ListSchema="ListSchema",S.SubstitutionSchema="SubstitionSchema",(O=b||(b={})).InsertUnorderedList="InsertUnorderedList",O.InsertOrderedList="InsertOrderedList",O.InsertDefinitionList="InsertDefinitionList",(N=w||(w={})).Table="Table",N.Unspecified="Unspecified";var Ye=function(e){var r,t;r=Xe(e.getBody()),t="tox-cursor-format-painter",Ue(r)?r.dom().classList.add(t):function(e,r){return n=r,i=Me(t=e,"class").concat([n]),Ie(t,"class",i.join(" ")),!0;var t,n,i}(r,t)},Ge=function(e,r){qe(Xe(e.getBody()),"tox-cursor-format-painter"),r.set(y.Retrival),We(e,!1)},Je=De,$e=function(e,r){return e.dom()===r.dom()},Ke=(xe().browser.isIE(),function(e,r){var t=e.dom();if(t.nodeType!==Je)return!1;var n=t;if(void 0!==n.matches)return n.matches(r);if(void 0!==n.msMatchesSelector)return n.msMatchesSelector(r);if(void 0!==n.webkitMatchesSelector)return n.webkitMatchesSelector(r);if(void 0!==n.mozMatchesSelector)return n.mozMatchesSelector(r);throw new Error("Browser lacks native selectors")}),Ze=function(e,r,t){for(var n=e.dom(),o=ae(t)?t:x(!1);n.parentNode;){n=n.parentNode;var i=Xe(n);if(r(i))return Q(i);if(o(i))break}return ee()},He=function(e,r,t){var n,o,i,a;return n=Ze,a=t,function(e,r){return r(e)}(o=e,i=r)?Q(o):ae(a)&&a(o)?ee():n(o,i,a)},Qe={formatpainter_checklist:{selector:"ul",classes:"tox-checklist"},formatpainter_liststyletype:{selector:"ul,ol",styles:{listStyleType:"%value"}},formatpainter_borderstyle:{selector:"td,th",styles:{borderTopStyle:"%valueTop",borderRightStyle:"%valueRight",borderBottomStyle:"%valueBottom",borderLeftStyle:"%valueLeft"},remove_similar:!0},formatpainter_bordercolor:{selector:"td,th",styles:{borderTopColor:"%valueTop",borderRightColor:"%valueRight",borderBottomColor:"%valueBottom",borderLeftColor:"%valueLeft"},remove_similar:!0},formatpainter_backgroundcolor:{selector:"td,th",styles:{backgroundColor:"%value"},remove_similar:!0},formatpainter_removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*:not(tr,td,th,table)",attributes:["style","class"],split:!1,expand:!1,deep:!0}],formatpainter_legacy_font:{inline:"font",attributes:{size:"%value"}}},tr=function(i,e){return Re(e,"selector").exists((function(e){var r=i.getBody(),t=i.selection.getStart(),n=i.dom.getParents(t,x(!0),r),o=i.selection.getSelectedBlocks();return i.dom.is(m(n,o),e)}))},er=function(e){return 1<e.length&&"%"===e.charAt(0)},rr=function(e){return Ke(e,"OL,UL,DL")},nr=function(e){return Ke(e,"LI,DT,DD")},or=function(e,r,t){var n,o=e.formatter,i=function(e,r){return le(e.formatter.get(r),(function(r){return t=e,Le(n=r,"inline")&&!tr(t,n);var t,n}))}(e,t.formatName),a=function(e,r,t){return le(r.get(t),(function(r){return t=e,Le(n=r,"block")||tr(t,n);var t,n}))}(e,o,t.formatName),u=(n=t.formatName,fe(["formatpainter_borderstyle","formatpainter_bordercolor","formatpainter_backgroundcolor"],n));(r.table&&u||r.inline&&i||r.block&&a&&!u)&&o.apply(t.formatName,t.substitutedVariables)},ir=function(e){var r=e.selection,t=r.getRng(),n=Xe(e.getBody()),o=de(e.selection.getSelectedBlocks().map(Xe),nr),i=t.collapsed&&o.length,a=o.length&&!function(e,r){var t,n,o,i=function(e){return $e(e,r)};return(t=He(Xe(e.getStart()),rr,i),n=He(Xe(e.getEnd()),rr,i),o=function(e,r){return $e(e,r)},t.isSome()&&n.isSome()?Q(o(t.getOrDie(),n.getOrDie())):ee()).getOr(!1)}(r,n);return 1<o.length||i||a},ar=function(e){return Ue(e)?function(e){for(var r=e.dom().classList,t=new Array(r.length),n=0;n<r.length;n++)t[n]=r.item(n);return t}(e):Ve(e)},ur=function(r,t){var n,o,c=r.dom(),i=e.window.getComputedStyle(c).getPropertyValue(t),a=""!==i||null!=(o=Fe(n=r)?n.dom().parentNode:n.dom())&&o.ownerDocument.body.contains(o)?i:cr(c,t);return null===a?void 0:a},cr=function(e,r){return void 0!==(t=e).style&&ae(t.style.getPropertyValue)?e.style.getPropertyValue(r):"";var t},br=function(e){return function(e,r){var t,n,o,i,a={},u={};return t=e,n=r,o=_e(a),i=_e(u),Ae(t,(function(e,r){(n(e,r)?o:i)(e,r)})),{t:a,f:u}}(e,(function(e){return 1<(r=e).length&&"%"===r.charAt(0);var r})).t},sr=function(e,r){var t=Re(e,"styles").map((function(e){return t=r,n=br(e),ke(n,(function(e,r){return{k:e.slice(1,e.length),v:ur(t,(n=r,n.replace(/([A-Z])/g,(function(e){return"-"+e[0].toLowerCase()}))))};var n}));var t,n})),n=Re(e,"attributes").map((function(e){return function(e,r){return ke(r,(function(r,t){return{k:r.slice(1,r.length),v:(n=e,o=t,"class"===o?ar(n).filter((function(e){return!/^(mce-.*)/.test(e)})).join(" "):Be(n,o))};var n,o}))}(r,br(e))})),o=l(l({},t.getOr({})),n.getOr({}));return Ce(o).every((function(e){return""!==e}))?Q(o):ee()},fr=function(e,r){return(t=e,n=t.getParam("formatpainter_blacklisted_formats","link,address,removeformat,formatpainter_removeformat","string").split(/[ ,]/),Te(t.formatter.get()).filter((function(e){return!fe(n,e)}))).filter((function(t){var n=function(e,r){return le(e.formatter.get(r),(function(e){return t=Re(r=e,"styles").exists((function(e){return le(Ce(e),er)})),n=Re(r,"attributes").exists((function(e){return le(Ce(e),er)})),t||n;var r,t,n}))}(e,t);return e.formatter.matchNode(r.dom(),t,{},n)}));var t,n},lr=function(e){return(r=e,ve(Ce(b),(function(e){return r.queryCommandState(e)}))).map((function(e){return{kind:p.ListSchema,command:e}}));var r},mr=function(e){var r,t,n,o,i,a=e.dom,u=e.selection.getStart();return{schemas:m(lr(e).toArray(),(n=e,o=u,i=n.dom.getParents(o,x(!0)),ge(me(i,Xe),(function(e){return ge(fr(n,e),(function(r){return function(e,r,t){return(n=e.get(r),0===n.length?ee():Q(n[0])).bind((function(e){return sr(e,t)})).map((function(e){return{kind:p.SubstitutionSchema,formatName:r,substitutedVariables:e}}));var n}(n.formatter,r,e).toArray()}))})))),context:(r=a,t=u,r.getParent(t,"TABLE")?w.Table:w.Unspecified)}};tinymce.PluginManager.add("formatpainter",(function(t){if(f(tinymce,"4.9.0"))return e.window.console.error("The format painter plugin requires at least version 4.9.0 of TinyMCE."),{};var n,o,c,l,i,a,u,m,s=r(y.Retrival),d=r({schemas:[],context:w.Unspecified});return(n=t).on("PreInit",(function(){Ae(Qe,(function(e,r){n.formatter.get(r)||n.formatter.register(r,e)}))})),c=s,l=d,(o=t).addCommand("mceToggleFormatPainter",(function(){!function(e,t){t.get()===y.Application?Ge(e,t):function(e,t){var n=xe(),o=r(!1);Ye(e),t.set(y.Application),We(e,!0),e.execCommand("mceRetrieveFormats");var i=function(){e.execCommand("mcePaintFormats"),Ge(e,t)},c=function(){t.get()===y.Application&&i(),s()},a=function(r){t.get()===y.Application&&("touchcancel"===r.type&&n.os.isAndroid()?e.once("contextmenu",i):o.get()?i():e.once("selectionchange",i)),s()},u=function(r){27===r.keyCode&&(Ge(e,t),s())},f=function(e){o.set("touchmove"===e.type)};e.on("click",c),e.on("touchstart touchmove",f),e.on("touchend touchcancel",a),e.on("keydown",u);var s=function(){e.off("click",c),e.off("touchstart touchmove",f),e.off("touchend touchcancel",a),e.off("keydown",u)}}(e,t)}(o,c)})),o.addCommand("mcePaintFormats",(function(){o.undoManager.transact((function(){!function(e,r){var t,n;t=e,n=r.context,t.formatter.remove("formatpainter_removeformat"),n===w.Table&&function(e,r){for(var t=0,n=e.length;t<n;t++)r(e[t])}(["formatpainter_borderstyle","formatpainter_bordercolor","formatpainter_backgroundcolor"],(function(e){t.formatter.remove(e)})),ir(t)&&t.execCommand("RemoveList");var o,i,a,u,c,s,f=(a=(o=e).selection.getStart(),u=o.selection.getRng().collapsed,c=0<o.dom.select("td[data-mce-selected]").length,s=!!o.dom.getParent(a,"TABLE"),{inline:!0,table:u&&s||c,block:u||(i=o.selection,1<i.getSelectedBlocks().length)||c});r.schemas.forEach((function(r){switch(r.kind){case p.ListSchema:t=r,f.block&&e.execCommand(t.command);break;case p.SubstitutionSchema:or(e,f,r)}var t}))}(o,l.get())}))})),o.addCommand("mceRetrieveFormats",(function(){l.set(mr(o))})),(i=t).ui?(u=i).ui.registry.addToggleButton("formatpainter",{active:!1,icon:"format-painter",tooltip:"Format Painter",onAction:function(){return u.execCommand("mceToggleFormatPainter")},onSetup:function(e){var r=function(r){e.setActive(r.state)};return u.on("FormatPainterToggle",r),function(){return u.off("FormatPainterToggle",r)}}}):(a=i).addButton("formatpainter",{active:!1,icon:"format-painter",tooltip:"Format Painter",cmd:"mceToggleFormatPainter",onPostRender:function(e){a.on("FormatPainterToggle",(function(r){e.control.active(r.state)}))}}),(m=t).addShortcut("Meta+alt+C","",(function(){m.execCommand("mceRetrieveFormats")})),m.addShortcut("Meta+alt+V","",(function(){m.execCommand("mcePaintFormats")})),{}}))}(window)}}]);