fe-drone-ci/static/tinymce1.3/plugins/powerpaste/plugin.min.js

24 lines
191 KiB
JavaScript
Raw Normal View History

2017-04-18 07:09:13 +00:00
;
/* Ephox Fluffy plugin
*
* Copyright 2010-2016 Ephox Corporation. All rights reserved.
*
* Version: 1.0.0-3
*/
!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i<g;++i)h[i]=d(e[i]);var j=f.apply(null,h);if(void 0===j)throw"module ["+b+"] returned undefined";c.instance=j},c=function(b,c,d){if("string"!=typeof b)throw"module id must be a string";if(void 0===c)throw"no dependencies for "+b;if(void 0===d)throw"no definition function for "+b;a[b]={deps:c,defn:d,instance:void 0}},d=function(c){var d=a[c];if(void 0===d)throw"module ["+c+"] was undefined";return void 0===d.instance&&b(c),d.instance},e=function(a,b){for(var c=a.length,e=new Array(c),f=0;f<c;++f)e.push(d(a[f]));b.apply(null,b)},f={};f.bolt={module:{api:{define:c,require:e,demand:d}}};var g=c,h=function(a,b){g(a,[],function(){return b})};g("1",[],function(){var a=function(a,b){return{isRequired:a,applyPatch:b}},b=function(a,b){return function(){var c=Array.prototype.slice.call(arguments),d=b.apply(this,c),e="undefined"==typeof d?c:d;return a.apply(this,e)}},c=function(a,b){return function(){var c=a.apply(this,arguments),d=b(c),e="undefined"==typeof d?c:d;return e}},d=function(a,b){if(a)for(var c=0;c<b.length;c++)b[c].isRequired(a)&&b[c].applyPatch(a);return a};return{nu:a,before:b,after:c,applyPatches:d}}),g("5",[],function(){var a=function(a,b){b=b.split(".");for(var c=0;c<b.length&&(a=a[b[c]],a);c++);return a};return{resolve:a}}),h("d",setInterval),h("e",clearInterval),g("b",["d","e"],function(a,b){var c=function(){return(new Date).getTime()},d=function(d,e,f,g,h){var i,j=c();i=a(function(){d()&&(b(i),e()),c()-j>h&&(b(i),f())},g)};return{waitFor:d}}),h("4",window),h("c",document),g("8",["b","4","c"],function(a,b,c){var d=function(a,c){var d=a.currentStyle?a.currentStyle[c]:b.getComputedStyle(a,null)[c];return d?d:""},e=function(a){return function(){var b=d(a,"position").toLowerCase();return"absolute"===b||"fixed"===b}},f=function(){var a=c.createElement("div");return a.style.display="none",a.className="mce-floatpanel",a},g=function(a){a.parentNode.removeChild(a)},h=function(b,d){var h=f();c.body.appendChild(h),a.waitFor(e(h),function(){g(h),b()},function(){g(h),d()},10,5e3)};return{waitForSkinLoaded:h}}),h("9",alert),g("6",["8","9"],function(a,b){var c=function(a,b){a.notificationManager?a.notificationManager.open({text:b,type:"warning",timeout:0,icon:""}):a.windowManager.alert(b)},d=function(d){d.EditorManager.on("AddEditor",function(d){var e=d.editor,f=e.settings.service_message;f&&a.waitForSkinLoaded(function(){c(e,e.settings.service_message)},function(){b(f)})})};return{error:c,register:d}}),g("2",["5","1","6","4"],function(a,b,c,d){var e=function(b){var c,e,f=a.resolve(d,"tinymce.util.URI");c=b.base_url,c&&(this.baseURL=new f(this.documentBaseURL).toAbsolute(c.replace(/\/+$/,"")),this.baseURI=new f(this.baseURL)),e=b.suffix,b.suffix&&(this.suffix=e),this.defaultSettings=b},f=function(b){var c=a.resolve(d,"tinymce.util.Tools");return[c.extend({},this.defaultSettings,b)]},g=function(a){return"function"!=typeof a.overrideDefaults},h=function(a){c.register(a),a.overrideDefaults=e,a.EditorManager.init=b.before(a.EditorManager.init,f)};return{patch:b.nu(g,h)}}),g("a",[],function(){var a=0,b=1,c=-1,d=function(a){return parseInt(a,10)},e=function(a){return function(){return a}},f=function(a,b,c){return{major:e(a),minor:e(b),patch:e(c)}},g=function(a){var b=/([0-9]+)\.([0-9]+)\.([0-9]+)(?:(\-.+)?)/.exec(a);return b?f(d(b[1]),d(b[2]),d(b[3])):f(0,0,0)},h=function(d,e){var f=d-e;return 0===f?a:f>0?b:c},i=function(b,c){var d=h(b.major(),c.major());if(d!==a)return d;var e=h(b.minor(),c.minor());if(e!==a)return e;var f=h(b.patch(),c.patch());return f!==a?f:a};return{nu:f,parse:g,compare:i}}),g("7",["a"],function(a){var b=function(a){var b=[a.majorVersion,a.minorVersion].join(".");return b.split(".").slice(0,3).join(".")},c=function(c){return c?a.parse(b(c)):null},d=function(b,d){return a.compare(c(b),a.parse(d))<0};return{getVersion:c,isLessThan:d}}),g("3",["7","1"],function(a,b){var c=function(a){return function(b){var c=b.plugin_base_urls;for(var d in c)a.PluginManager.urls[d]=c[d]}},d=function(b){return a.isLessThan(b,"4.5.0")},
/* Ephox PowerPaste plugin
*
* Copyright 2010-2016 Ephox Corporation. All rights reserved.
*
* Version: 2.1.10-115
*/
!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i<g;++i)h[i]=d(e[i]);var j=f.apply(null,h);if(void 0===j)throw"module ["+b+"] returned undefined";c.instance=j},c=function(b,c,d){if("string"!=typeof b)throw"module id must be a string";if(void 0===c)throw"no dependencies for "+b;if(void 0===d)throw"no definition function for "+b;a[b]={deps:c,defn:d,instance:void 0}},d=function(c){var d=a[c];if(void 0===d)throw"module ["+c+"] was undefined";return void 0===d.instance&&b(c),d.instance},e=function(a,b){for(var c=a.length,e=new Array(c),f=0;f<c;++f)e.push(d(a[f]));b.apply(null,b)},f={};f.bolt={module:{api:{define:c,require:e,demand:d}}};var g=c,h=function(a,b){g(a,[],function(){return b})};h("12",Array),h("13",String),g("g",["12","13"],function(a,b){var c=function(a){return function(b){return a===b}},d=function(){var b=a.prototype.indexOf,d=function(a,c){return b.call(a,c)},e=function(a,b){return r(a,c(b))};return void 0===b?e:d}(),e=function(a,b){return d(a,b)>-1},f=function(a,b){return r(a,b)>-1},g=function(a,b){for(var c=[],d=0;d<a.length;d+=b){var e=a.slice(d,d+b);c.push(e)}return c},h=function(b,c){for(var d=b.length,e=new a(d),f=0;f<d;f++){var g=b[f];e[f]=c(g,f,b)}return e},i=function(a,b){for(var c=0,d=a.length;c<d;c++){var e=a[c];b(e,c,a)}},j=function(a,b){for(var c=[],d=[],e=0,f=a.length;e<f;e++){var g=a[e],h=b(g,e,a)?c:d;h.push(g)}return{pass:c,fail:d}},k=function(a,b){for(var c=[],d=0,e=a.length;d<e;d++){var f=a[d];b(f,d,a)&&c.push(f)}return c},l=function(a,b){if(0===a.length)return[];for(var c=b(a[0]),d=[],e=[],f=0,g=a.length;f<g;f++){var h=a[f],i=b(h);i!==c&&(d.push(e),e=[]),c=i,e.push(h)}return 0!==e.length&&d.push(e),d},m=function(a,b,c){return n(z(a),b,c)},n=function(a,b,c){return i(a,function(a){c=b(c,a)}),c},o=function(a,b){for(var c=0,d=a.length;c<d;c++){var e=a[c];if(b(e,c,a))return e}},p=function(a,b,c){var d=o(a,b);return void 0!==d?d:c},q=function(a,c,d){var e=o(a,c);if(void 0===e)throw d||"Could not find element in array: "+b(a);return e},r=function(a,b){for(var c=b||v,d=0,e=a.length;d<e;++d)if(c(a[d])===!0)return d;return-1},s=a.prototype.push,t=function(a){for(var b=[],c=0,d=a.length;c<d;++c)s.apply(b,a[c]);return b},u=function(a,b){var c=h(a,b);return t(c)},v=c(!0),w=function(a,b){for(var c=b||v,d=0,e=a.length;d<e;++d)if(c(a[d],d)!==!0)return!1;return!0},x=function(a,b){return a.length===b.length&&w(a,function(a,c){return a===b[c]})},y=a.prototype.slice,z=function(a){var b=y.call(a,0);return b.reverse(),b},A=function(a,b){return k(a,function(a){return!e(b,a)})},B=function(a,c){for(var d={},e=0,f=a.length;e<f;e++){var g=a[e];d[b(g)]=c(g,e)}return d},C=function(a){return[a]};return{map:h,each:i,partition:j,filter:k,groupBy:l,indexOf:d,foldr:m,foldl:n,find:o,findIndex:r,findOr:p,findOrDie:q,flatten:t,bind:u,forall:w,exists:f,contains:e,equal:x,reverse:z,chunk:g,difference:A,mapToObject:B,pure:C}}),g("p",["12"],function(a){var b=function(){},c=function(a,b){return function(){return a(b.apply(null,arguments))}},d=function(a){return function(){return a}},e=function(a){return a},f=function(a,b){return a===b},g=function(b){for(var c=new a(arguments.length-1),d=1;d<arguments.length;d++)c[d-1]=arguments[d];return function(){for(var d=new a(arguments.length),e=0;e<d.length;e++)d[e]=arguments[e];var f=c.concat(d);return b.apply(null,f)}},h=function(a){return function(){return!a.apply(null,arguments)}},i=function(a){return function(){throw a}},j=function(a){return a()},k=function(a){a()};return{noop:b,compose:c,constant:d,identity:e,tripleEquals:f,curry:g,not:h,die:i,apply:j,call:k}}),h("14",Object),g("n",["p","14"],function(a,b){var c=a.constant(!1),d=a.constant(!0),e=function(){return f},f=function(){var f=function(a){return a.isNone()},g=function(a){return a()},h=function(a){return a},i={fold:function(a,b){return a()},is:c,isSome:c,isNone:d,getOr:h,getOrThunk:g,getOrDie:function(a){throw a||"error: getOrDie called on none."},or:h,orThunk:g,map:e,ap:e,each:e,bind:e,flatten:e,exists:c,forall:d,filter:e,equals:f,equals_:f,toArray:function(){return[]},toString:a.c
report:n,inProgress:p,isActive:q,events:g.registry}}}),g("1l",["1b","12"],function(a,b){var c=function(a,b){return b},d=function(b,c){var d=a.isObject(b)&&a.isObject(c);return d?f(b,c):c},e=function(a){return function(){for(var c=new b(arguments.length),d=0;d<c.length;d++)c[d]=arguments[d];if(0===c.length)throw"Can't merge zero objects";for(var e={},f=0;f<c.length;f++){var g=c[f];for(var h in g)g.hasOwnProperty(h)&&(e[h]=a(e[h],g[h]))}return e}},f=e(d),g=e(c);return{deepMerge:f,merge:g}}),g("1m",["1b","g","1c","12"],function(a,b,c,d){var e=function(e){if(!a.isArray(e))throw"cases must be an array";if(0===e.length)throw"there must be at least one case";var f={};return b.each(e,function(b,g){var h=c.keys(b);if(1!==h.length)throw"one and only one name per case";var i=h[0],j=b[i];if(void 0!==f[i])throw"duplicate key detected:"+i;if("cata"===i)throw"cannot have a case named cata (sorry)";if(!a.isArray(j))throw"case arguments must be an array";f[i]=function(){var a=arguments.length;if(a!==j.length)throw"Wrong number of arguments to case "+i+". Expected "+j.length+" ("+j+"), got "+a;for(var b=new d(a),c=0;c<b.length;c++)b[c]=arguments[c];return{fold:function(){if(arguments.length!==e.length)throw"Wrong number of arguments to fold. Expected "+e.length+", got "+arguments.length;var a=arguments[g];return a.apply(null,b)}}}}),f};return{generate:e}}),g("h",["1l","1m"],function(a,b){var c=b.generate([{blob:["id","blob","objurl","data"]},{url:["id","url","raw"]}]),d=function(a,b,c){return a.fold(b,c)};return a.merge(c,{cata:d})}),g("2f",["p","n"],function(a,b){var c=function(a){return e(function(b,c){return c(a)})},d=function(a){return e(function(b,c){return b(a)})},e=function(e){var f=function(b){return e(a.constant(!1),function(a){return a===b})},g=function(){return e(a.constant(!1),a.constant(!0))},h=a.not(g),i=function(b){return e(a.constant(b),a.identity)},j=function(b){return e(b,a.identity)},k=function(){return e(function(b){a.die(b)()},a.identity)},l=function(b){return e(a.constant(b),c)},m=function(a){return e(a,c)},n=function(a){return p(function(b){return c(a(b))})},o=n,p=function(a){return e(d,a)},q=function(b){return e(a.constant(!1),b)},r=function(b){return e(a.constant(!0),b)},s=function(){return e(b.none,b.some)};return{is:f,isValue:g,isError:h,getOr:i,getOrThunk:j,getOrDie:k,or:l,orThunk:m,fold:e,map:n,each:o,bind:p,exists:q,forall:r,toOption:s}};return{value:c,error:d}}),g("3q",["g","27","3i","12"],function(a,b,c,d){var e=function(c,d){a.each(d,function(a){b.add(c,a)})},f=function(c,d){a.each(d,function(a){b.remove(c,a)})},g=function(c,d){a.each(d,function(a){b.toggle(c,a)})},h=function(c,d){return a.forall(d,function(a){return b.has(c,a)})},i=function(c,d){return a.exists(d,function(a){return b.has(c,a)})},j=function(a){for(var b=a.dom().classList,c=new d(b.length),e=0;e<b.length;e++)c[e]=b.item(e);return c},k=function(a){return c.supports(a)?j(a):c.get(a)};return{add:e,remove:f,toggle:g,hasAll:h,hasAny:i,get:k}}),g("2g",["27","3q"],function(a,b){var c=function(b){return function(c){a.add(c,b)}},d=function(b){return function(c){a.remove(c,b)}},e=function(a){return function(c){b.remove(c,a)}},f=function(b){return function(c){return a.has(c,b)}};return{addClass:c,removeClass:d,removeClasses:e,hasClass:f}}),g("2i",["1b","n"],function(a,b){return function(c,d,e,f,g){return c(e,f)?b.some(e):a.isFunction(g)&&g(e)?b.none():d(e,f,g)}}),g("20",["n","2a","2h","2i"],function(a,b,c,d){var e=function(c){return a.from(b.all(c)[0])},f=function(c,d,e){return a.from(b.ancestors(c,d,e)[0])},g=function(c,d){return a.from(b.siblings(c,d)[0])},h=function(c,d){return a.from(b.children(c,d)[0])},i=function(c,d){return a.from(b.descendants(c,d)[0])},j=function(a,b,e){return d(c.is,f,a,b,e)};return{first:e,ancestor:f,sibling:g,child:h,descendant:i,closest:j}}),g("19",["g","h","p","n","2f","26","1m","2c","j","27","2g","20","1f"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){var n=h.immutable("image","blobInfo"),o=g.generate([{failure:["error"]},{success:["result","images","blob"]}]),p=function(a,b,c){var e=a.isActive(b);return a.register(c,b),j.add(c
var g=function(){e.emitter.closeAllLists(),d.emitDeferred(),e.openedTag=null,d.emit(f),e.nextFilter=j};if(f.type()===b.START_ELEMENT_TYPE&&a.hasMsoListStyle(f)&&"LI"!==f.tag()){var h=(f.getStyle("mso-list"),/ level([0-9]+)/.exec(f.getStyle("mso-list")));h&&h[1]?(e.itemLevel=parseInt(h[1],10)+e.styleLevelAdjust,e.nextFilter===j?d.emitDeferred():d.dropDeferred(),e.nextFilter=l,d.startTransaction(),e.originalToken=f,e.commentMode=!1):g()}else!a.supportsCustomStyles&&(f.type()===b.COMMENT_TYPE&&"[if !supportLists]"===f.text()||c.isListWithoutCommentsOrStyles(f,d))?(f.type()===b.START_ELEMENT_TYPE&&"SPAN"===f.tag()&&e.spanCount.push(f),e.nextFilter=l,d.startTransaction(),e.originalToken=e.openedTag,e.commentMode=!0,e.openedTag=null,d.dropDeferred()):f.type()===b.END_ELEMENT_TYPE&&a.spanOrA(f)?(d.defer(f),e.spanCount.pop()):f.type()===b.START_ELEMENT_TYPE?a.spanOrA(f)?(d.defer(f),e.spanCount.push(f)):(e.openedTag&&(e.emitter.closeAllLists(),d.emitDeferred()),e.openedTag=f,d.defer(f)):g()},k=function(a,c,d){d.type()===b.END_ELEMENT_TYPE&&c.originalToken.tag()===d.tag()&&(c.nextFilter=h,c.styleLevelAdjust=-1),a.emit(d)},l=function(a,c,d){if(d.type()==b.START_ELEMENT_TYPE&&"Ignore"===d.getStyle("mso-list")&&(c.nextFilter=m),d.type()===b.START_ELEMENT_TYPE&&"SPAN"===d.tag())c.spanCount.push(d),(c.commentMode&&""===d.getAttribute("style")||null===d.getAttribute("style"))&&(c.nextFilter=m);else if("A"===d.tag())d.type()===b.START_ELEMENT_TYPE?c.spanCount.push(d):c.spanCount.pop();else if(d.type()===b.TEXT_TYPE)if(c.commentMode)c.nextFilter=m,c.nextFilter(a,c,d);else{var g=c.originalToken,h=c.spanCount;c.emitter.closeAllLists(),a.emit(g),e.each(h,e.bind(a.emit,a)),a.emit(d),a.commit(),c.originalToken=g,c.nextFilter=k}else(c.commentMode||d.type()!==b.COMMENT_TYPE)&&f(a,d)},m=function(c,d,e){e.type()===b.TEXT_TYPE?e.isWhitespace()||(d.nextFilter=n,d.bulletInfo={text:e.text(),symbolFont:d.symbolFont}):a.spanOrA(e)?e.type()===b.START_ELEMENT_TYPE?d.spanCount.push(e):d.spanCount.pop():e.type()===b.START_ELEMENT_TYPE&&"IMG"===e.tag()?(d.nextFilter=n,d.bulletInfo={text:"\u2202",symbolFont:!0}):f(c,e)},n=function(c,d,e){e.type()===b.START_ELEMENT_TYPE&&a.spanOrA(e)?(d.spanCount.push(e),d.nextFilter=o):e.type()===b.END_ELEMENT_TYPE&&a.spanOrA(e)?(d.spanCount.pop(),d.nextFilter=p):e.type()===b.END_ELEMENT_TYPE&&"IMG"===e.tag()||f(c,e)},o=function(c,d,e){e.type()===b.END_ELEMENT_TYPE&&(a.spanOrA(e)&&d.spanCount.pop(),d.nextFilter=p)},p=function(c,h,i){var j=function(a){if(h.nextFilter=q,h.commentMode&&(h.itemLevel=h.indentGuesser.guessIndentLevel(i,h.originalToken,h.styles.styles,h.bulletInfo)),h.listType=d.guessListType(h.bulletInfo,g(h.emitter.getCurrentListType(),h.emitter.getCurrentLevel(),h.itemLevel),h.originalToken),h.listType){for(h.emitter.openItem(h.itemLevel,h.originalToken,h.listType,h.skippedPara),c.emitDeferred();h.spanCount.length>0;)c.emit(h.spanCount.shift());a&&c.emit(i)}else e.log("Unknown list type: "+h.bulletInfo.text+" Symbol font? "+h.bulletInfo.symbolFont),c.rollback()};i.type()===b.TEXT_TYPE||i.type()===b.START_ELEMENT_TYPE?j(!0):i.type()===b.COMMENT_TYPE?j("[endif]"!==i.text()):i.type()===b.END_ELEMENT_TYPE?a.spanOrA(i)&&h.spanCount.pop():f(c,i)},q=function(a,c,d){d.type()===b.END_ELEMENT_TYPE&&d.tag()===c.originalToken.tag()?(c.nextFilter=h,c.skippedPara=!1):a.emit(d)},r=j;return{initial:r}}),g("2p",["3x","3y","3w","3z","40","41","42","1h"],function(a,b,c,d,e,f,g,h){var i={},j=function(a){i.nextFilter=f.initial,i.itemLevel=0,i.originalToken=null,i.commentMode=!1,i.openedTag=null,i.symbolFont=!1,i.listType=null,i.indentGuesser=d.indentGuesser(),i.emitter=e(a,a.document),i.styles=d.styles(),i.spanCount=[],i.skippedPara=!1,i.styleLevelAdjust=0,i.bulletInfo=void 0};j({});var k=function(a){j(a)},l=function(a,b){i.styles.check(b)||(i.symbolFont=g.checkFont(b,i.symbolFont),i.nextFilter(a,i,b))};return a.createFilter(l,k)}),g("2q",["1h"],function(a){var b=function(a){var b=a,c=65279===b.charCodeAt(b.length-1);return c?b.substring(0,b.length-1):a},c=function(a){return/<(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|t
return d(a)?b.from(a.dom().nodeValue):b.none()},i=a.detect().browser,j=i.isIE()&&10===i.version.major?g:h,k=function(a,b){if(!d(a))throw new c("Can only set raw "+e+" value of a "+e+" node");a.dom().nodeValue=b};return{get:f,getOption:j,set:k}}}),g("7d",["1d","7s"],function(a,b){var c=b(a.isComment,"comment"),d=function(a){return c.get(a)},e=function(a){return c.getOption(a)},f=function(a,b){c.set(a,b)};return{get:d,getOption:e,set:f}}),g("7t",["1x"],function(a){var b=function(b,c,d){b.dom().styleSheet?b.dom().styleSheet.cssText=c:a.append(b,d)};return{setCss:b}}),g("8f",[],function(){var a=function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")};return{escape:a}}),g("7u",["1c","8f","4v"],function(a,b,c){var d=function(a,d,e){var f=new c("url\\(\\s*['\"]?"+b.escape(d)+"(.*?)['\"]?\\s*\\)","g");return a.replace(f,'url("'+e+'$1")')},e=function(b,c){var e=b;return a.each(c,function(a,b){e=d(e,b,a)}),e};return{replace:d,replaceMany:e}}),g("7e",["j","k","1x","20","7t","7u","12"],function(a,b,c,d,e,f,g){var h=function(c){var d=b.fromTag("style",c.dom());return a.set(d,"type","text/css"),d},i=function(a,c,d){e.setCss(a,c,b.fromText(c,d.dom()))},j=function(a,b,e){var g=h(e),j=void 0===b?a:f.replaceMany(a,b);i(g,j,e);var k=d.descendant(e,"head").getOrDie();c.append(k,g)},k=function(a){var b=a.dom().styleSheets;return g.prototype.slice.call(b)};return{stylesheets:k,inject:j}}),g("7v",["g","2c"],function(a,b){var c=b.immutable("selector","style","raw"),d=function(b){var d=b.cssRules;return a.map(d,function(a){var b=a.selectorText,d=a.style.cssText;if(void 0===d)throw"WARNING: Browser does not support cssText property";return c(b,d,a.style)})},e=function(b){return a.bind(b,d)};return{extract:d,extractAll:e}}),g("7f",["7v"],function(a){var b=function(b){return a.extract(b)},c=function(b){return a.extractAll(b)};return{extract:b,extractAll:c}}),function(a,b,c){a("7g",[],function(){var a=function(){var a,b,c;return a=function(a){var c,d,e,f,g=[];for(c=a.split(","),e=0,f=c.length;e<f;e+=1)d=c[e],d.length>0&&g.push(b(d));return g},b=function(a){var b,c=a,d={a:0,b:0,c:0},e=[],f=/(\[[^\]]+\])/g,g=/(#[^\s\+>~\.\[:]+)/g,h=/(\.[^\s\+>~\.\[:]+)/g,i=/(::[^\s\+>~\.\[:]+|:first-line|:first-letter|:before|:after)/gi,j=/(:[\w-]+\([^\)]*\))/gi,k=/(:[^\s\+>~\.\[:]+)/g,l=/([^\s\+>~\.\[:]+)/g;return b=function(b,f){var g,h,i,j,k,l;if(b.test(c))for(g=c.match(b),h=0,i=g.length;h<i;h+=1)d[f]+=1,j=g[h],k=c.indexOf(j),l=j.length,e.push({selector:a.substr(k,l),type:f,index:k,length:l}),c=c.replace(j,Array(l+1).join(" "))},function(){var a=function(a){var b,d,e,f;if(a.test(c))for(b=c.match(a),d=0,e=b.length;d<e;d+=1)f=b[d],c=c.replace(f,Array(f.length+1).join("A"))},b=/\\[0-9A-Fa-f]{6}\s?/g,d=/\\[0-9A-Fa-f]{1,5}\s/g,e=/\\./g;a(b),a(d),a(e)}(),function(){var a=/:not\(([^\)]*)\)/g;a.test(c)&&(c=c.replace(a," $1 "))}(),function(){var a,b,d,e,f=new RegExp("{[^]*","gm");if(f.test(c))for(a=c.match(f),b=0,d=a.length;b<d;b+=1)e=a[b],c=c.replace(e,Array(e.length+1).join(" "))}(),b(f,"b"),b(g,"a"),b(h,"b"),b(i,"c"),b(j,"b"),b(k,"b"),c=c.replace(/[\*\s\+>~]/g," "),c=c.replace(/[#\.]/g," "),b(l,"c"),e.sort(function(a,b){return a.index-b.index}),{selector:a,specificity:"0,"+d.a.toString()+","+d.b.toString()+","+d.c.toString(),specificityArray:[0,d.a,d.b,d.c],parts:e}},c=function(a,c){var d,e,f;if("string"==typeof a){if(a.indexOf(",")!==-1)throw"Invalid CSS selector";d=b(a).specificityArray}else{if(!Array.isArray(a))throw"Invalid CSS selector or specificity array";if(4!==a.filter(function(a){return"number"==typeof a}).length)throw"Invalid specificity array";d=a}if("string"==typeof c){if(c.indexOf(",")!==-1)throw"Invalid CSS selector";e=b(c).specificityArray}else{if(!Array.isArray(c))throw"Invalid CSS selector or specificity array";if(4!==c.filter(function(a){return"number"==typeof a}).length)throw"Invalid specificity array";e=c}for(f=0;f<4;f+=1){if(d[f]<e[f])return-1;if(d[f]>e[f])return 1}return 0},{calculate:a,compare:c}}();return"undefined"!=typeof exports&&(exports.calculate=a.calculate,exports.compare=a.compare),a})}(f.bolt.module.api.define,f.bolt.module.
return i.append(d,g),k.remove(c),d},o=function(a){0===g.get(a).length&&h.append(a,f.fromTag("br"))},p=function(a){return m.prevSibling(a).bind(function(a){return j.isText(a)&&0===l.get(a).trim().length?p(a):"li"===j.name(a)?c.some(a):c.none()})},q=function(b){m.parent(b).each(function(c){var d=j.name(c);a.contains(["ol","ul"],d)&&p(b).fold(function(){var a=f.fromTag("li");e.set(a,"list-style-type","none"),h.wrap(b,a)},function(a){h.append(a,b)})})},r=function(a){var c=n("span",a),f={face:"font-family",size:"font-size",color:"color"},g={"font-size":{1:"8pt",2:"10pt",3:"12pt",4:"14pt",5:"18pt",6:"24pt",7:"36pt"}};b.each(f,function(a,b){if(d.has(c,b)){var f=d.get(c,b),h=void 0!==g[a]&&void 0!==g[a][f]?g[a][f]:f;e.set(c,a,h),d.remove(c,b)}})};return{changeTag:n,addBrTag:o,properlyNest:q,fontToSpan:r}}),g("7h",["7w","6m","7k","84","85","p","27","5d","3f","1d","83"],function(a,b,c,d,e,f,g,h,i,j,k){var l=b.unwrapper({tags:[{name:k.pattern(/^([OVWXP]|U[0-9]+|ST[0-9]+):/i)}]}),m=[b.pipeline([c.filter])],n=b.removal({attributes:[{name:k.pattern(/^v:/)},{name:k.exact("href"),value:k.contains("#_toc")},{name:k.exact("href"),value:k.contains("#_mso")},{name:k.pattern(/^xmlns(:|$)/)},{name:k.exact("type"),condition:d.isList}]}),o=b.removal({attributes:[{name:k.exact("id")},{name:k.exact("name")}]}),p=b.removal({tags:[{name:k.exact("script")},{name:k.exact("meta")},{name:k.exact("link")},{name:k.exact("style"),condition:d.isEmpty}],attributes:[{name:k.starts("on")},{name:k.exact('"')},{name:k.exact("lang")},{name:k.exact("language")}],styles:[{name:k.all(),value:k.pattern(/OLE_LINK/i)}]}),q=function(a){return!g.has(a,"ephox-limbo-transform")},r=function(a){return function(b){return i.parent(b).exists(function(b){return j.name(b)===a&&1===i.children(b).length})}},s=b.removal({styles:[{name:k.not(k.pattern(/width|height|list-style-type/)),condition:q},{name:k.pattern(/width|height/),condition:d.isNotImage}]}),t=b.removal({classes:[{name:k.not(k.exact("rtf-data-image"))}]}),u=b.removal({styles:[{name:k.pattern(a.validStyles())}]}),v=b.removal({classes:[{name:k.pattern(/mso/i)}]}),w=b.unwrapper({tags:[{name:k.exact("img"),condition:d.isLocal},{name:k.exact("a"),condition:d.hasNoAttributes}]}),x=b.unwrapper({tags:[{name:k.exact("a"),condition:d.hasNoAttributes}]}),y=b.removal({attributes:[{name:k.exact("style"),value:k.exact(""),debug:!0}]}),z=b.removal({attributes:[{name:k.exact("class"),value:k.exact(""),debug:!0}]}),A=b.unwrapper({tags:[{name:k.pattern(a.specialInline()),condition:f.not(d.hasContent)}]}),B=b.unwrapper({tags:[{name:k.exact("p"),condition:r("li")}]}),C=b.transformer({tags:[{name:k.exact("p"),mutate:e.addBrTag}]}),D=function(a){var b=e.changeTag("span",a);g.add(b,"ephox-limbo-transform"),h.set(b,"text-decoration","underline")},E=b.transformer({tags:[{name:k.pattern(/ol|ul/),mutate:e.properlyNest}]}),F=b.transformer({tags:[{name:k.exact("b"),mutate:f.curry(e.changeTag,"strong")},{name:k.exact("i"),mutate:f.curry(e.changeTag,"em")},{name:k.exact("u"),mutate:D},{name:k.exact("s"),mutate:f.curry(e.changeTag,"strike")},{name:k.exact("font"),mutate:e.fontToSpan,debug:!0}]}),G=b.removal({classes:[{name:k.exact("ephox-limbo-transform")}]}),H=b.removal({attributes:[{name:k.exact("href"),value:k.starts("file:///"),debug:!0}]});return{unwrapWordTags:l,removeWordAttributes:n,parseLists:m,removeExcess:p,cleanStyles:s,cleanClasses:t,mergeStyles:u,mergeClasses:v,removeLocalImages:w,removeVacantLinks:x,removeEmptyStyle:y,removeEmptyClass:z,pruneInlineTags:A,unwrapSingleParagraphsInlists:B,addPlaceholders:C,nestedListFixes:E,inlineTagFixes:F,cleanupFlags:G,removeLocalLinks:H,removeAnchors:o,none:f.noop}}),g("6k",["g","5a","7h","6m","7k","7l","p","k"],function(a,b,c,d,e,f,g,h){var i=function(a){return a.browser.isIE()&&a.browser.version.major>=11},j=function(a){return f(function(b,c,d){var e=a(h.fromDom(c.getNode())).fold(function(){return c},function(a){return d(c,a.dom())});b.emit(e)},g.noop,"image filters")},k=function(a,e,f){var g=f.browser.isFirefox()||f.browser.isSpartan()?b.local:b.vshape,h=i(f)?c.none:d.pipeline([j(g)]),k=g===b.loca
})}return k.none()},z=function(a,b){var d=c.isValidData(b.clipboardData)?b.clipboardData.types:[];return c.getFlavor(d,a.clipboardType()).map(function(a){return o(b,k.none())})},A=function(a){return p.browser.isIE()?k.some(n.clipboardData):c.isValidData(a.clipboardData)?k.some(a.clipboardData):k.none()},B=function(a){if(p.browser.isSpartan())return k.none();var b=a.clipboardData,d=c.isValidData(b)?b.types:[];return 1===d.length&&"text/plain"===d[0]?k.some(b):k.none()},C=function(a){var b=a.clipboardData;return c.isValidData(b)?c.getFlavor(b.types,u).bind(function(a){var c=b.getData(a.type);return c.length>0?k.some(c):k.none()}):k.none()},D=function(a,b,c,d){return{label:j.constant(a),getAvailable:b,steps:j.constant(c),capture:j.constant(d)}},E=function(c,d,h,i){var k=j.curry(z,i);return D("Within Textbox.io (tables) pasting",k,[a.normal(g(d,c,h,i,b.ignore)),a.normal(e.fixed(!0,!0)),a.normal(f.internal(h,i))],!1)},F=function(c,i,j,k,l,m,n){return D("Outside of Textbox.io pasting (could be internal but another browser)",x,[a.normal(g(k,j,l,n,b.background)),a.normal(e.fromConfigIfExternal(c,i)),a.normal(f.external(l,n)),a.blocking(h(m,i)),a.normal(d(i))],!1)},G=function(b,c,d,g){return D("GWT pasting",w,[a.normal(f.setBundle({isWord:!0})),a.normal(e.fromConfig(c,d)),a.normal(f.gwt(b)),a.blocking(h(g,d))],!0)},H=function(b){return D("Image pasting",y,[a.normal(b.allowLocalImages===!1?f.noImages(j.noop):f.images())],!0)},I=function(){return D("Only plain text is available to paste",B,[a.normal(f.plain),a.normal(f.autolink)],!0)},J=function(){return D("Plain text pasting",A,[a.normal(f.plain),a.normal(f.autolink)],!0)},K=function(){return D("There is no valid way to paste",k.some,[a.normal(f.none)],!1)};return{internal:E,pastiche:F,gwt:G,image:H,text:J,onlyText:I,none:K}}),g("5b",["5c","2t","j","27","k","6h","29"],function(a,b,c,d,e,f,g){var h=function(){var a=b.detect(),c=a.os.isOSX();return c?["\u2318"]:["Ctrl"]},i=function(a){return e.fromHtml("<p>"+a("cement.dialog.flash.press-escape")+"</p>")},j=function(b){var c=e.fromTag("div");d.add(c,a.resolve("flashbin-helpcopy"));var f=h(),j=e.fromHtml("<p>"+b("cement.dialog.flash.trigger-paste")+"</p>"),k=e.fromHtml('<div><span class="ephox-polish-help-kbd">'+f+'</span> + <span class="ephox-polish-help-kbd">V</span></div>');return d.add(k,a.resolve("flashbin-helpcopy-kbd")),g.append(c,[j,k,i(b)]),c},k=function(b){var c=e.fromTag("div");d.add(c,a.resolve("flashbin-helpcopy"));var f=e.fromHtml("<p>"+b("cement.dialog.flash.missing")+"</p>");return g.append(c,[f,i(b)]),c},l=function(b){var h=e.fromTag("div");d.add(h,a.resolve("flashbin-loading"));var i=e.fromTag("div");d.add(i,a.resolve("flashbin-loading-spinner"));var j=e.fromTag("p"),k=b("loading.wait");return f.set(j,k),c.set(j,"aria-label",k),g.append(h,[i,j]),h};return{paste:j,noflash:k,indicator:l}}),h("5e",navigator),g("38",["5b","5c","2t","p","27","5d","k","1x","29","5e"],function(a,b,c,d,e,f,g,h,i,j){var k=c.detect(),l=function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash")},m=function(){try{var a=k.browser.isIE()?l():j.plugins["Shockwave Flash"];return void 0!==a}catch(b){return!1}},n=function(b,c,e,f){var g=a.noflash(f);return h.append(b,g),{reset:d.noop}},o=function(b,c,d,e){var g=a.paste(e),h=a.indicator(e);i.append(b,[h,g,c.element()]);var j=function(){f.setAll(h,{height:"0",padding:"0"})},k=function(){f.set(g,"display","block"),f.set(h,"display","none"),d()},l=function(){f.set(g,"display","none"),f.set(h,"display","block"),f.remove(h,"height"),f.remove(h,"padding"),d()};return c.events.spin.bind(l),c.events.reset.bind(k),c.events.hide.bind(j),{reset:k}};return function(a,c,f){var h=g.fromTag("div"),i="flashbin-wrapper-"+(k.os.isOSX()?"cmd":"ctrl");e.add(h,b.resolve(i));var j=m()?o:n,l=j(h,a,c,f.translations);return{element:d.constant(h),reset:l.reset}}}),h("5k",clearInterval),h("5m",setInterval),g("5f",["n","21","22","z","5k","5m"],function(a,b,c,d,e,f){var g=function(){var g=d(a.none()),h=c.create({crashed:b([]),timeout:b([])}),i=function(b,c,d,i){var j=c,k=f(function(){d()?e(k):j<=0?(h.trigger.timeout(),e