text: !function(){var n={},t=function(t){for(var e=n[t],o=e.deps,i=e.defn,u=o.length,a=new Array(u),c=0;c<u;++c)a[c]=r(o[c]);var l=i.apply(null,a);if(void 0===l)throw"module ["+t+"] returned undefined";e.instance=l},e=function(t,e,r){if("string"!=typeof t)throw"module id must be a string";if(void 0===e)throw"no dependencies for "+t;if(void 0===r)throw"no definition function for "+t;n[t]={deps:e,defn:r,instance:void 0}},r=function(e){var r=n[e];if(void 0===r)throw"module ["+e+"] was undefined";return void 0===r.instance&&t(e),r.instance},o=function(n,t){for(var e=n.length,o=new Array(e),i=0;i<e;++i)o[i]=r(n[i]);t.apply(null,o)};({}).bolt={module:{api:{define:e,require:o,demand:r}}};var i=e,u=function(n,t){i(n,[],function(){return t})};u("d",tinymce.util.Tools.resolve),i("1",["d"],function(n){return n("tinymce.PluginManager")}),u("1p",Array),u("1q",Error),i("f",["1p","1q"],function(n,t){var e=function(n){return function(){return n}};return{noop:function(){},noarg:function(n){return function(){return n()}},compose:function(n,t){return function(){return n(t.apply(null,arguments))}},constant:e,identity:function(n){return n},tripleEquals:function(n,t){return n===t},curry:function(t){for(var e=new n(arguments.length-1),r=1;r<arguments.length;r++)e[r-1]=arguments[r];return function(){for(var r=new n(arguments.length),o=0;o<r.length;o++)r[o]=arguments[o];var i=e.concat(r);return t.apply(null,i)}},not:function(n){return function(){return!n.apply(null,arguments)}},die:function(n){return function(){throw new t(n)}},apply:function(n){return n()},call:function(n){n()},never:e(!1),always:e(!0)}}),u("1r",Object),i("g",["f","1r"],function(n,t){var e=n.never,r=n.always,o=function(){return i},i=function(){var i=function(n){return n.isNone()},u=function(n){return n()},a=function(n){return n},c={fold:function(n){return n()},is:e,isSome:e,isNone:r,getOr:a,getOrThunk:u,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},or:a,orThunk:u,map:o,ap:o,each:function(){},bind:o,flatten:o,exists:e,forall:r,filter:o,equals:i,equals_:i,toArray:function(){return[]},toString:n.constant("none()")};return t.freeze&&t.freeze(c),c}(),u=function(n){var t=function(){return n},a=function(){return l},c=function(t){return t(n)},l={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:r,isNone:e,getOr:t,getOrThunk:t,getOrDie:t,or:a,orThunk:a,map:function(t){return u(t(n))},ap:function(t){return t.fold(o,function(t){return u(t(n))})},each:function(t){t(n)},bind:c,flatten:t,exists:c,forall:c,filter:function(t){return t(n)?l:i},equals:function(t){return t.is(n)},equals_:function(t,r){return t.fold(e,function(t){return r(n,t)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return l};return{some:u,none:o,from:function(n){return null===n||void 0===n?i:u(n)}}}),u("1s",String),i("e",["g","1p","1q","1s"],function(n,t,e,r){var o=function(){var n=t.prototype.indexOf;return void 0===n?function(n,t){return y(n,t)}:function(t,e){return n.call(t,e)}}(),i=function(t,e){var r=o(t,e);return-1===r?n.none():n.some(r)},u=function(n,t){return o(n,t)>-1},a=function(n,t){return w(n,t).isSome()},c=function(n,t){for(var e=[],r=0;r<n;r++)e.push(t(r));return e},l=function(n,t){for(var e=[],r=0;r<n.length;r+=t){var o=n.slice(r,r+t);e.push(o)}return e},f=function(n,e){for(var r=n.length,o=new t(r),i=0;i<r;i++){var u=n[i];o[i]=e(u,i,n)}return o},s=function(n,t){for(var e=0,r=n.length;e<r;e++){t(n[e],e,n)}},d=function(n,t){for(var e=n.length-1;e>=0;e--){t(n[e],e,n)}},m=function(n,t){for(var e=[],r=[],o=0,i=n.length;o<i;o++){var u=n[o];(t(u,o,n)?e:r).push(u)}return{pass:e,fail:r}},g=function(n,t){for(var e=[],r=0,o=n.length;r<o;r++){var i=n[r];t(i,r,n)&&e.push(i)}return e},p=function(n,t){if(0===n.length)return[];for(var e=t(n[0]),r=[],o=[],i=0,u=n.length;i<u;i++){var a=n[i],c=t(a);c!==e&&(r.push(o),o=[]),e=c,o.push(a)}return 0!==o.length&&r.push(o),r},v=function(n,t,e){return d(n,function(n){e=t(e,n)}),e},h=function(n,t,e){return s(n,function(n){e=t(e,n)}),e},b=function(t,e){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r,t))return n.some(i)}return n.none()},w=function(t,e){for(var r=0,o=t.length;r<o;r++){if(e(t[r],r,t))return n.some(r)}return n.none()},y=function(n,t){for(var e=0,r=n.length;e<r;++e)if(n[e]===t)return e;return-1},x=t.prototype.push,C=function(n){for(var r=[],o=0,i=n.length;o<i;++o){if(!t.prototype.isPrototypeOf(n[o]))throw new e("Arr.flatten item "+o+" was not an array, input: "+n);x.apply(r,n[o])}return r},S=function(n,t){var e=f(n,t);return C(e)},R=function(n,t){for(var e=0,r=n.length;e<r;++e){if(!0!==t(n[e],e,n))return!1}return!0},T=function(n,t){return n.length===t.length&&R(n,function(n,e){return n===t[e]})},k=t.prototype.slice;return{map:f,each:s,eachr:d,partition:m,filter:g,groupBy:p,indexOf:i,foldr:v,foldl:h,find:b,findIndex:w,flatten:C,bind:S,forall:R,exists:a,contains:u,equal:T,reverse:function(n){var t=k.call(n,0);return t.reverse(),t},chunk:l,difference:function(n,t){return g(n,function(n){return!u(t,n)})},mapToObject:function(n,t){for(var e={},o=0,i=n.length;o<i;o++){var u=n[o];e[r(u)]=t(u,o)}return e},pure:function(n){return[n]},sort:function(n,t){var e=k.call(n,0);return e.sort(t),e},range:c,head:function(t){return 0===t.length?n.none():n.some(t[0])},last:function(t){return 0===t.length?n.none():n.some(t[t.length-1])}}}),i("1t",["g","1r"],function(n,t){var e=function(){var n=t.keys;return void 0===n?function(n){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push(e);return t}:n}(),r=function(n,t){for(var r=e(n),o=0,i=r.length;o<i;o++){var u=r[o];t(n[u],u,n)}},o=function(n,t){return i(n,function(n,e,r){return{k:e,v:t(n,e,r)}})},i=function(n,t){var e={};return r(n,function(r,o){var i=t(r,o,n);e[i.k]=i.v}),e},u=function(n,t){var e=[];return r(n,function(n,r){e.push(t(n,r))}),e},a=function(n){return u(n,function(n){return n})};return{bifilter:function(n,t){var e={},o={};return r(n,function(n,r){(t(n,r)?e:o)[r]=n}),{t:e,f:o}},each:r,map:o,mapToArray:u,tupleMap:i,find:function(t,r){for(var o=e(t),i=0,u=o.length;i<u;i++){var a=o[i],c=t[a];if(r(c,a,t))return n.some(c)}return n.none()},keys:e,values:a,size:function(n){return a(n).length}}}),i("1u",["e","f","1p","1q"],function(n,t,e,r){return function(){var o=arguments;return function(){for(var i=new e(arguments.length),u=0;u<i.length;u++)i[u]=arguments[u];if(o.length!==i.length)throw new r('Wrong number of arguments to struct. Expected "['+o.length+']", got '+i.length+" arguments");var a={};return n.each(o,function(n,e){a[n]=t.constant(i[e])}),a}}}),i("1z",["1p","1s"],function(n,t){var e=function(e){if(null===e)return"null";var r=typeof e;return"object"===r&&n.prototype.isPrototypeOf(e)?"array":"object"===r&&t.prototype.isPrototypeOf(e)?"string":r},r=function(n){return function(t){return e(t)===n}};return{isString:r("string"),isObject:r("object"),isArray:r("array"),isNull:r("null"),isBoolean:r("boolean"),isUndefined:r("undefined"),isFunction:r("function"),isNumber:r("number")}}),i("3r",["e","1z","1q"],function(n,t,e){var r=function(n){return n.slice(0).sort()};return{sort:r,reqMessage:function(n,t){throw new e("All required keys ("+r(n).join(", ")+") were not specified. Specified keys were: "+r(t).join(", ")+".")},unsuppMessage:function(n){throw new e("Unsupported keys for object: "+r(n).join(", "))},validateStrArr:function(r,o){if(!t.isArray(o))throw new e("The "+r+" fields must be an array. Was: "+o+".");n.each(o,function(n){if(!t.isString(n))throw new e("The value "+n+" in the "+r+" fields was not a string.")})},invalidTypeMessage:function(n,t){throw new e("All values need to be of type: "+t+". Keys ("+r(n).join(", ")+") were not.")},checkDupes:function(t){var o=r(t);n.find(o,function(n,t){return t<o.length-1&&n===o[t+1]}).each(function(n){throw new e("The field: "+n+" occurs more than once in the combined fields: ["+o.join(", ")+"].")})}}}),i("1v",["e","f","1t","g","3r","1q","1r"],function(n,t,e,r,o,i,u){return function(a,c){var l=a.concat(c);if(0===l.length)throw new i("You must specify at least one required or optional field.");return o.validateStrArr("required",a),o.validateStrArr("optional",c),o.checkDupes(l),function(i){var f=e.keys(i);n.forall(a,function(t){return n.contains(f,t)})||o.reqMessage(a,f);var s=n.filter(f,function(t){return!n.contains(l,t)});s.length>0&&o.unsuppMessage(s);var d={};return n.each(a,function(n){d[n]=t.constant(i[n])}),n.each(c,function(n){d[n]=t.constant(u.prototype.hasOwnProperty.call(i,n)?r.some(i[n]):r.none())}),d}}}),i("1k",["1u","1v"],function(n,t){return{immutable:n,immutableBag:t}}),i("2c",["1k"],function(n){var t=n.immutable("width","height"),e=n.immutable("rows","columns"),r=n.immutable("row","column"),o=n.immutable("x","y"),i=n.immutable("element","rowspan","colspan"),u=n.immutable("element","rowspan","colspan","isNew");return{dimensions:t,grid:e,address:r,coords:o,extended:n.immutable("element","rowspan","colspan","row","column"),detail:i,detailnew:u,rowdata:n.immutable("element","cells","section"),elementnew:n.immutable("element","isNew"),rowdatanew:n.immutable("element","cells","section","isNew"),rowcells:n.immutable("cells","section"),rowdetails:n.immutable("details","section"),bounds:n.immutable("startRow","startCol","finishRow","finishCol")}}),i("21",[],function(){return"undefined"==typeof console&&(console={log:function(){}}),console}),u("23",document),i("l",["f","g","1q","21","23"],function(n,t,e,r,o){var i=function(n,t){var e=(t||o).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||e.childNodes.length>1)throw r.error("HTML does not have a single root node",n),"HTML must have a single root node";return c(e.childNodes[0])},u=function(n,t){var e=(t||o).createElement(n);return c(e)},a=function(n,t){var e=(t||o).createTextNode(n);return c(e)},c=function(t){if(null===t||void 0===t)throw new e("Node cannot be null or undefined");return{dom:n.constant(t)}};return{fromHtml:i,fromTag:u,fromText:a,fromDom:c,fromPoint:function(n,e,r){return t.from(n.dom().elementFromPoint(e,r)).map(c)}}}),i("20",[],function(){return{ATTRIBUTE:2,CDATA_SECTION:4,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,ELEMENT:1,TEXT:3,PROCESSING_INSTRUCTION:7,ENTITY_REFERENCE:5,ENTITY:6,NOTATION:12}}),i("27",["e","g","l","20","1q","23"],function(n,t,e,r,o,i){var u=r.ELEMENT,a=r.DOCUMENT,c=function(n){return n.nodeType!==u&&n.nodeType!==a||0===n.childElementCount};return{all:function(t,r){var o=void 0===r?i:r.dom();return c(o)?[]:n.map(o.querySelectorAll(t),e.fromDom)},is:function(n,t){var e=n.dom();if(e.nodeType!==u)return!1;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new o("Browser lacks native selectors")},one:function(n,r){var o=void 0===r?i:r.dom();return c(o)?t.none():t.from(o.querySelector(n)).map(e.fromDom)}}}),i("24",[],function(){return{toArray:function(n,t){var e=[],r=function(n){return e.push(n),t(n)},o=t(n);do{o=o.bind(r)}while(o.isSome());return e}}}),i("5t",[],function(){return"undefined"!=typeof window?window:Function("return this;")()}),i("4y",["5t"],function(n){var t=function(t,e){for(var r=void 0!==e?e:n,o=0;o<t.length&&void 0!==r&&null!==r;++o)r=r[t[o]];return r},e=function(n,t){return void 0!==n[t]&&null!==n[t]||(n[t]={}),n[t]},r=function(t,r){for(var o=void 0!==r?r:n,i=0;i<t.length;++i)o=e(o,t[i]);return o};return{path:t,resolve:function(n,e){var r=n.split(".");return t(r,e)},forge:r,namespace:function(n,t){var e=n.split(".");return r(e,t)}}}),i("3s",["4y"],function(n){var t=function(t,e){return n.resolve(t,e)};return{getOrDie:function(n,e){var r=t(n,e);if(void 0===r)throw n+" not available on this browser";return r}}}),i("25",["3s"],function(n){var t=function(){return n.getOrDie("Node")},e=function(n,t,e){return 0!=(n.compareDocumentPosition(t)&e)};return{documentPositionPreceding:function(n,r){return e(n,r,t().DOCUMENT_POSITION_PRECEDING)},documentPositionContainedBy:function(n,r){return e(n,r,t().DOCUMENT_POSITION_CONTAINED_BY)}}}),i("3b",[],function(){return{cached:function(n){var t,e=!1;return function(){return e||(e=!0,t=n.apply(null,arguments)),t}}}}),u("67",Number),i("5u",["e","67","1s"],function(n,t,e){var r=function(n,t){for(var e=0;e<n.length;e++){var r=n[e];if(r.test(t))return r}},o=function(n,e){var o=r(n,e);if(!o)return{major:0,minor:0};var i=function(n){return t(e.replace(o,"$"+n))};return a(i(1),i(2))},i=function(n,t){var r=e(t).toLowerCase();return 0===n.length?u():o(n,r)},u=function(){return a(0,0)},a=function(n,t){return{major:n,minor:t}};return{nu:a,detect:i,unknown:u}}),i("4z",["f","5u"],function(n,t){var e="Edge",r="Chrome",o="IE",i="Opera",u="Firefox",a="Safari",c=function(n,t){return function(){return t===n}},l=function(){return f({current:void 0,version:t.unknown()})},f=function(n){var t=n.current;return{current:t,version:n.version,isEdge:c(e,t),isChrome:c(r,t),isIE:c(o,t),isOpera:c(i,t),isFirefox:c(u,t),isSafari:c(a,t)}};return{unknown:l,nu:f,edge:n.constant(e),chrome:n.constant(r),ie:n.constant(o),opera:n.constant(i),firefox:n.constant(u),safari:n.constant(a)}}),i("50",["f","5u"],function(n,t){var e="Windows",r="iOS",o="Android",i="Linux",u="OSX",a="Solaris",c="FreeBSD",l=function(n,t){return function(){return t===n}},f=function(){return s({current:void 0,version:t.unknown()})},s=function(n){var t=n.current;return{current:t,version:n.version,isWindows:l(e,t),isiOS:l(r,t),isAndroid:l(o,t),isOSX:l(u,t),isLinux:l(i,t),isSolaris:l(a,t),isFreeBSD:l(c,t)}};return{unknown:f,nu:s,windows:n.constant(e),ios:n.constant(r),android:n.constant(o),linux:n.constant(i),osx:n.constant(u),solaris:n.constant(a),freebsd:n.constant(c)}}),i("51",["f"],function(n){return function(t,e,r){var o=t.isiOS()&&!0===/ipad/i.test(r),i=t.isiOS()&&!o,u=t.isAndroid()&&3===t.version.major,a=t.isAndroid()&&4===t.version.major,c=o||u||a&&!0===/mobile/i.test(r),l=t.isiOS()||t.isAndroid(),f=l&&!c,s=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(r);return{isiPad:n.constant(o),isiPhone:n.constant(i),isTablet:n.constant(c),isPhone:n.constant(f),isTouch:n.constant(l),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:n.constant(s)}}}),i("52",["e","5u","1s"],function(n,t,e){var r=function(t,r){var o=e(r).toLowerCase();return n.find(t,function(n){return n.search(o)})};return{detectBrowser:function(n,e){return r(n,e).map(function(n){var r=t.detect(n.versionRegexes,e);return{current:n.name,version:r}})},detectOs:function(n,e){return r(n,e).map(function(n){var r=t.detect(n.versionRegexes,e);return{current:n.name,version:r}})}}}),i("54",[],function(){return{addToStart:function(n,t){return t+n},addToEnd:function(n,t){return n+t},removeFromStart:function(n,t){return n.substring(t)},removeFromEnd:function(n,t){return n.substring(0,n.length-t)}}}),i("55",["g","1q"],function(n){return{first:function(n,t){return n.substr(0,t)},last:function(n,t){return n.substr(n.length-t,n.length)},head:function(t){return""===t?n.none():n.some(t.substr(0,1))},tail:function(t){return""===t?n.none():n.some(t.substring(1))}}}),i("3x",["54","55","1q"],function(n,t){var e=function(n,t,e){if(""===t)return!0;if(n.length<t.length)return!1;return n.substr(e,e+t.length)===t},r=function(t,e){return a(t,e)?n.removeFromStart(t,e.length):t},o=function(t,e){return c(t,e)?n.removeFromEnd(t,e.length):t},i=function(t,e){return a(t,e)?t:n.addToStart(t,e)},u=function(t,e){return c(t,e)?t:n.addToEnd(t,e)},a=function(n,t){return e(n,t,0)},c=function(n,t){return e(n,t,n.length-t.length)};return{supplant:function(n,t){var e=function(n){var t=typeof n;return"string"===t||"number"===t};return n.replace(/\${([^{}]*)}/g,function(n,r){var o=t[r];return e(o)?o:n})},startsWith:a,removeLeading:r,removeTrailing:o,ensureLeading:i,ensureTrailing:u,endsWith:c,contains:function(n,t){return-1!==n.indexOf(t)},trim:function(n){return n.replace(/^\s+|\s+$/g,"")},lTrim:function(n){return n.replace(/^\s+/g,"")},rTrim:function(n){return n.replace(/\s+$/g,"")},capitalize:function(n){return t.head(n).bind(function(e){return t.tail(n).map(function(n){return e.toUpperCase()+n})}).getOr(n)}}}),i("53",["f","3x"],function(n,t){var e=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,r=function(n){return function(e){return t.contains(e,n)}},o=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(n){return t.contains(n,"edge/")&&t.contains(n,"chrome")&&t.contains(n,"safari")&&t.contains(n,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,e],search:function(n){return t.contains(n,"chrome")&&!t.contains(n,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(n){return t.contains(n,"msie")||t.contains(n,"trident")}},{name:"Opera",versionRegexes:[e,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:r("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:r("firefox")},{name:"Safari",versionRegexes:[e,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(n){return(t.contains(n,"safari")||t.contains(n,"mobile/"))&&t.contains(n,"applewebkit")}}],i=[{name:"Windows",search:r("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(n){return t.contains(n,"iphone")||t.contains(n,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:r("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:r("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:r("linux"),versionRegexes:[]},{name:"Solaris",search:r("sunos"),versionRegexes:[]},{name:"FreeBSD",search:r("freebsd"),versionRegexes:[]}];return{browsers:n.constant(o),oses:n.constant(i)}}),i("3t",["4z","50","51","52","53"],function(n,t,e,r,o){return{detect:function(i){var u=o.browsers(),a=o.oses(),c=r.detectBrowser(u,i).fold(n.unknown,n.nu),l=r.detectOs(a,i).fold(t.unknown,t.nu);return{browser:c,os:l,deviceType:e(l,c,i)}}}}),u("3u",navigator),i("26",["3b","3t","3u"],function(n,t,e){return{detect:n.cached(function(){var n=e.userAgent;return t.detect(n)})}}),i("1c",["e","f","25","26","27"],function(n,t,e,r,o){var i=function(n,t){return n.dom()===t.dom()},u=function(n,t){return n.dom().isEqualNode(t.dom())},a=function(e,r){return n.exists(r,t.curry(i,e))},c=function(n,t){var e=n.dom(),r=t.dom();return e!==r&&e.contains(r)},l=function(n,t){return e.documentPositionContainedBy(n.dom(),t.dom())},f=r.detect().browser.isIE()?l:c;return{eq:i,isEqualNode:u,member:a,contains:f,is:o.is}}),i("1m",["1z","e","f","g","1k","24","1c","l"],function(n,t,e,r,o,i,u,a){var c=function(n){return a.fromDom(n.dom().ownerDocument)},l=function(n){var t=c(n);return a.fromDom(t.dom().documentElement)},f=function(n){var t=n.dom().ownerDocument.defaultView;return a.fromDom(t)},s=function(n){var t=n.dom();return r.from(t.parentNode).map(a.fromDom)},d=function(n){return s(n).bind(function(e){var r=y(e);return t.findIndex(r,function(t){return u.eq(n,t)})})},m=function(t,r){for(var o=n.isFunction(r)?r:e.constant(!1),i=t.dom(),u=[];null!==i.parentNode&&void 0!==i.parentNode;){var c=i.parentNode,l=a.fromDom(c);if(u.push(l),!0===o(l))break;i=c}return u},g=function(n){var e=function(e){return t.filter(e,function(t){return!u.eq(n,t)})};return s(n).map(y).map(e).getOr([])},p=function(n){var t=n.dom();return r.from(t.offsetParent).map(a.fromDom)},v=function(n){var t=n.dom();return r.from(t.previousSibling).map(a.fromDom)},h=function(n){var t=n.dom();return r.from(t.nextSibling).map(a.fromDom)},b=function(n){return t.reverse(i.toArray(n,v))},w=function(n){return i.toArray(n,h)},y=function(n){var e=n.dom();return t.map(e.childNodes,a.fromDom)},x=function(n,t){var e=n.dom().childNodes;return r.from(e[t]).map(a.fromDom)},C=function(n){return x(n,0)},S=function(n){return x(n,n.dom().childNodes.length-1)},R=function(n){return n.dom().childNodes.length},T=function(n){return n.dom().hasChildNodes()},k=o.immutable("element","offset");return{owner:c,defaultView:f,documentElement:l,parent:s,findIndex:d,parents:m,siblings:g,prevSibling:v,offsetParent:p,prevSiblings:b,nextSibling:h,nextSiblings:w,children:y,child:x,firstChild:C,lastChild:S,childNodesCount:R,hasChildNodes:T,leaf:function(n,t){var e=y(n);return e.length>0&&t<e.length?k(e[t],0):k(n,t)}}}),i("1y",["e","f","27","1m"],function(n,t,e,r){var o=function(n,e){return i(n,e,t.constant(!0))},i=function(t,o,u){return n.bind(r.children(t),function(n){return e.is(n,o)?u(n)?[n]:[]:i(n,o,u)})};return{firstLayer:o,filterFirstLayer:i}}),i("n",["20"],function(n){var t=function(n){return n.dom().nodeName.toLowerCase()},e=function(n){return n.dom().nodeType},r=function(n){return n.dom().nodeValue},o=function(n){return function(t){return e(t)===n}},i=function(r){return e(r)===n.COMMENT||"#comment"===t(r)},u=o(n.ELEMENT),a=o(n.TEXT),c=o(n.DOCUMENT);return{name:t,type:e,value:r,isElement:u,isText:a,isDocument:c,isComment:i}}),i("r",["1z","e","1t","n","1q","21"],function(n,t,e,r,o,i){var u=function(t,e,r){if(!(n.isString(r)||n.isBoolean(r)||n.isNumber(r)))throw i.error("Invalid call to Attr.set. Key ",e,":: Value ",r,":: Element ",t),new o("Attribute value was not simple");t.setAttribute(e,r+"")},a=function(n,t,e){u(n.dom(),t,e)},c=function(n,t){var e=n.dom().getAttribute(t);return null===e?void 0:e},l=function(n,t){var e=n.dom();return!(!e||!e.hasAttribute)&&e.hasAttribute(t)},f=function(n,t,e){l(n,e)&&!l(t,e)&&a(t,e,c(n,e))};return{clone:function(n){return t.foldl(n.dom().attributes,function(n,t){return n[t.name]=t.value,n},{})},set:a,setAll:function(n,t){var r=n.dom();e.each(t,function(n,t){u(r,t,n)})},get:c,has:l,remove:function(n,t){n.dom().removeAttribute(t)},hasNone:function(n){var t=n.dom().attributes;return void 0===t||null===t||0===t.length},transfer:function(n,e,o){r.isElement(n)&&r.isElement(e)&&t.each(o,function(t){f(n,e,t)})}}}),i("35",["3b","l","n","23"],function(n,t,e,r){var o=function(n){var t=e.isText(n)?n.dom().parentNode:n.dom();return void 0!==t&&null!==t&&t.ownerDocument.body.contains(t)},i=n.cached(function(){return u(t.fromDom(r))}),u=function(n){var e=n.dom().body;if(null===e||void 0===e)throw"Body is not available yet";return t.fromDom(e)};return{body:i,getBody:u,inBody:o}}),i("29",["e","35","1m"],function(n,t,e){var r=function(n){return o(t.body(),n)},o=function(t,r){var i=[];return n.each(e.children(t),function(n){r(n)&&(i=i.concat([n])),i=i.concat(o(n,r))}),i};return{all:r,ancestors:function(t,r,o){return n.filter(e.parents(t,o),r)},siblings:function(t,r){return n.filter(e.siblings(t),r)},children:function(t,r){return n.filter(e.children(t),r)},descendants:o}}),i("y",["29","27"],function(n,t){return{all:function(n){return t.all(n)},ancestors:function(e,r,o){return n.ancestors(e,function(n){return t.is(n,r)},o)},siblings:function(e,r){return n.siblings(e,function(n){return t.is(n,r)})},children:function(e,r){return n.children(e,function(n){return t.is(n,r)})},descendants:function(n,e){return t.all(e,n)}}}),i("2d",["1z","g"],function(n,t){return function(e,r,o,i,u){return e(o,i)?t.some(o):n.isFunction(u)&&u(o)?t.none():r(o,i,u)}}),i("2a",["1z","e","f","g","35","1c","l","2d"],function(n,t,e,r,o,i,u,a){var c=function(n){return d(o.body(),n)},l=function(t,o,i){for(var a=t.dom(),c=n.isFunction(i)?i:e.constant(!1);a.parentNode;){a=a.parentNode;var l=u.fromDom(a);if(o(l))return r.some(l);if(c(l))break}return r.none()},f=function(n,t){var e=n.dom();return e.parentNode?s(u.fromDom(e.parentNode),function(e){return!i.eq(n,e)&&t(e)}):r.none()},s=function(n,r){return t.find(n.dom().childNodes,e.compose(r,u.fromDom)).map(u.fromDom)},d=function(n,t){var e=function(n){for(var o=0;o<n.childNodes.length;o++){if(t(u.fromDom(n.childNodes[o])))return r.some(u.fromDom(n.childNodes[o]));var i=e(n.childNodes[o]);if(i.isSome())return i}return r.none()};return e(n.dom())};return{first:c,ancestor:l,closest:function(n,t,e){return a(function(n){return t(n)},l,n,t,e)},sibling:f,child:s,descendant:d}}),i("t",["2a","27","2d"],function(n,t,e){var r=function(e,r,o){return n.ancestor(e,function(n){return t.is(n,r)},o)};return{first:function(n){return t.one(n)},ancestor:r,sibling:function(e,r){return n.sibling(e,function(n){return t.is(n,r)})},child:function(e,r){return n.child(e,function(n){return t.is(n,r)})},descendant:function(n,e){return t.one(e,n)},closest:function(n,o,i){return e(t.is,r,n,o,i)}}}),u("2e",parseInt),i("j",["e","f","g","2c","1y","r","n","y","t","27","1m","2e"],function(n,t,e,r,o,i,u,a,c,l,f,s){var d=function(r,o,i){var a=void 0!==i?i:t.constant(!1);if(a(o))return e.none();if(n.contains(r,u.name(o)))return e.some(o);var f=function(n){return l.is(n,"table")||a(n)};return c.ancestor(o,r.join(","),f)},m=function(n,t){return d(["caption","tr","tbody","tfoot","thead"],n,t)},g=function(n,t){return f.parent(t).map(function(t){return a.children(t,n)})},p=function(n,t){return s(i.get(n,t),10)};return{cell:function(n,t){return d(["td","th"],n,t)},firstCell:function(n){return c.descendant(n,"th,td")},cells:function(n){return o.firstLayer(n,"th,td")},neighbourCells:t.curry(g,"th,td"),table:function(n,t){return c.closest(n,"table",t)},row:function(n,t){return d(["tr"],n,t)},rows:function(n){return o.firstLayer(n,"tr")},notCell:m,neighbourRows:t.curry(g,"tr"),attr:p,grid:function(n,t,e){var o=p(n,t),i=p(n,e);return r.grid(o,i)}}}),i("1w",["e","2c","j","r","n","1m"],function(n,t,e,r,o,i){return{fromTable:function(u){var a=e.rows(u);return n.map(a,function(u){var a=u,c=i.parent(a).bind(function(n){var t=o.name(n);return"tfoot"===t||"thead"===t||"tbody"===t?t:"tbody"}),l=n.map(e.cells(u),function(n){var e=r.has(n,"rowspan")?parseInt(r.get(n,"rowspan"),10):1,o=r.has(n,"colspan")?parseInt(r.get(n,"colspan"),10):1;return t.detail(n,e,o)});return t.rowdata(a,l,c)})},fromPastedRows:function(o,i){return n.map(o,function(o){var u=n.map(e.cells(o),function(n){var e=r.has(n,"rowspan")?parseInt(r.get(n,"rowspan"),10):1,o=r.has(n,"colspan")?parseInt(r.get(n,"colspan"),10):1;return t.detail(n,e,o)});return t.rowdata(o,u,i.section())})}}}),u("3v",Math),i("1x",["e","f","g","2c","3v"],function(n,t,e,r,o){var i=function(n,t){return n+","+t},u=function(n,t,r){var o=a(n,function(n){return r(t,n.element())});return o.length>0?e.some(o[0]):e.none()},a=function(t,e){var r=n.bind(t.all(),function(n){return n.cells()});return n.filter(r,e)};return{generate:function(e){var u={},a=[],c=e.length,l=0;n.each(e,function(t,e){var c=[];n.each(t.cells(),function(n){for(var t=0;void 0!==u[i(e,t)];)t++;for(var a=r.extended(n.element(),n.rowspan(),n.colspan(),e,t),f=0;f<n.colspan();f++)for(var s=0;s<n.rowspan();s++){var d=t+f,m=i(e+s,d);u[m]=a,l=o.max(l,d+1)}c.push(a)}),a.push(r.rowdata(t.element(),c,t.section()))});var f=r.grid(c,l);return{grid:t.constant(f),access:t.constant(u),all:t.constant(a)}},getAt:function(n,t,r){var o=n.access()[i(t,r)];return void 0!==o?e.some(o):e.none()},findItem:u,filterItems:a,justCells:function(t){var e=n.map(t.all(),function(n){return n.cells()});return n.flatten(e)}}}),i("3w",[],function(){return{isSupported:function(n){return void 0!==n.style}}}),u("3y",window),i("22",["1z","e","1t","g","r","35","l","n","3w","3x","1q","21","3y"],function(n,t,e,r,o,i,u,a,c,l,f,s,d){var m=function(t,e,r){if(!n.isString(r))throw s.error("Invalid call to CSS.set. Property ",e,":: Value ",r,":: Element ",t),new f("CSS value must be a string: "+r);c.isSupported(t)&&t.style.setProperty(e,r)},g=function(n,t){c.isSupported(n)&&n.style.removeProperty(t)},p=function(n,t,e){var r=n.dom();m(r,t,e)},v=function(n,t){var e=n.dom(),r=d.getComputedStyle(e).getPropertyValue(t),o=""!==r||i.inBody(n)?r:h(e,t);return null===o?void 0:o},h=function(n,t){return c.isSupported(n)?n.style.getPropertyValue(t):""},b=function(n,t){var e=n.dom(),o=h(e,t);return r.from(o).filter(function(n){return n.length>0})},w=function(n,t,e){b(n,e).each(function(n){b(t,e).isNone()&&p(t,e,n)})};return{copy:function(n,t){var e=n.dom(),r=t.dom();c.isSupported(e)&&c.isSupported(r)&&(r.style.cssText=e.style.cssText)},set:p,preserve:function(n,t){var e=o.get(n,"style"),r=t(n);return(void 0===e?o.remove:o.set)(n,"style",e),r},setAll:function(n,t){var r=n.dom();e.each(t,function(n,t){m(r,t,n)})},setOptions:function(n,t){var r=n.dom();e.each(t,function(n,t){n.fold(function(){g(r,t)},function(n){m(r,t,n)})})},remove:function(n,t){var e=n.dom();g(e,t),o.has(n,"style")&&""===l.trim(o.get(n,"style"))&&o.remove(n,"style")},get:v,getRaw:b,getAllRaw:function(n){var t={},e=n.dom();if(c.isSupported(e))for(var r=0;r<e.style.length;r++){var o=e.style.item(r);t[o]=e.style[o]}return t},isValidValue:function(n,t,e){var r=u.fromTag(n);p(r,t,e);return b(r,t).isSome()},reflow:function(n){return n.dom().offsetWidth},transfer:function(n,e,r){a.isElement(n)&&a.isElement(e)&&t.each(r,function(t){w(n,e,t)})}}}),i("12",["1m"],function(n){var t=function(t,e){n.parent(t).each(function(n){n.dom().insertBefore(e.dom(),t.dom())})},e=function(e,r){n.nextSibling(e).fold(function(){n.parent(e).each(function(n){o(n,r)})},function(n){t(n,r)})},r=function(t,e){n.firstChild(t).fold(function(){o(t,e)},function(n){t.dom().insertBefore(e.dom(),n.dom())})},o=function(n,t){n.dom().appendChild(t.dom())};return{before:t,after:e,prepend:r,append:o,appendAt:function(e,r,i){n.child(e,i).fold(function(){o(e,r)},function(n){t(n,r)})},wrap:function(n,e){t(n,e),o(e,n)}}}),i("28",["e","12"],function(n,t){return{before:function(e,r){n.each(r,function(n){t.before(e,n)})},after:function(e,r){n.each(r,function(n,o){var i=0===o?e:r[o-1];t.after(i,n)})},prepend:function(e,r){n.each(r.slice().reverse(),function(n){t.prepend(e,n)})},append:function(e,r){n.each(r,function(n){t.append(e,n)})}}}),i("13",["e","28","1m"],function(n,t,e){var r=function(t){t.dom().textContent="",n.each(e.children(t),function(n){o(n)})},o=function(n){var t=n.dom();null!==t.parentNode&&t.parentNode.removeChild(t)};return{empty:r,remove:o,unwrap:function(n){var r=e.children(n);r.length>0&&t.before(n,r),o(n)}}}),i("h",["e","1t","1k","1w","1x","1y","r","22","l","12","13","27"],function(n,t,e,r,o,i,u,a,c,l,f,s){var d=e.immutable("minRow","minCol","maxRow","maxCol"),m=function(n,e){var r=n.grid().columns(),o=n.grid().rows(),i=r,u=0,a=0;return t.each(n.access(),function(n){if(e(n)){var t=n.row(),r=t+n.rowspan()-1,c=n.column(),l=c+n.colspan()-1;t<o?o=t:r>u&&(u=r),c<i?i=c:l>a&&(a=l)}}),d(o,i,u,a)},g=function(n,t,e){var r=n[e].element(),o=c.fromTag("td");l.append(o,c.fromTag("br"));(t?l.append:l.prepend)(r,o)},p=function(n,t,e,r){for(var i=t.grid().columns(),u=t.grid().rows(),a=0;a<u;a++)for(var c=!1,l=0;l<i;l++)if(!(a<e.minRow()||a>e.maxRow()||l<e.minCol()||l>e.maxCol())){o.getAt(t,a,l).filter(r).isNone()?g(n,c,a):c=!0}},v=function(t,e){var r=n.filter(i.firstLayer(t,"tr"),function(n){return 0===n.dom().childElementCount});n.each(r,f.remove),e.minCol()!==e.maxCol()&&e.minRow()!==e.maxRow()||n.each(i.firstLayer(t,"th,td"),function(n){u.remove(n,"rowspan"),u.remove(n,"colspan")}),u.remove(t,"width"),u.remove(t,"height"),a.remove(t,"width"),a.remove(t,"height")};return{extract:function(t,e){var u=function(n){return s.is(n.element(),e)},a=r.fromTable(t),c=o.generate(a),l=m(c,u),d="th:not("+e+"),td:not("+e+")",g=i.filterFirstLayer(t,"th,td",function(n){return s.is(n,d)});return n.each(g,f.remove),p(a,c,l,u),v(t,l),t}}}),i("k",["r","l","12","28","13","1m"],function(n,t,e,r,o,i){var u=function(n,e){return t.fromDom(n.dom().cloneNode(e))},a=function(n){return u(n,!0)},c=function(e,r){var o=t.fromTag(r),i=n.clone(e);return n.setAll(o,i),o};return{shallow:function(n){return u(n,!1)},shallowAs:c,deep:a,copy:function(n,t){var e=c(n,t),o=i.children(a(n));return r.append(e,o),e},mutate:function(n,t){var u=c(n,t);e.before(n,u);var a=i.children(n);return r.append(u,a),o.remove(n),u}}}),i("3p",["26","g","1q"],function(n,t,e){return function(r,o){var i=function(n){if(!r(n))throw new e("Can only get "+o+" value of a "+o+" node");return l(n).getOr("")},u=function(n){try{return a(n)}catch(n){return t.none()}},a=function(n){return r(n)?t.from(n.dom().nodeValue):t.none()},c=n.detect().browser,l=c.isIE()&&10===c.version.major?u:a;return{get:i,getOption:l,set:function(n,t){if(!r(n))throw new e("Can only set raw "+o+" value of a "+o+" node");n.dom().nodeValue=t}}}}),i("1l",["n","3p"],function(n,t){var e=t(n.isText,"text");return{get:function(n){return e.get(n)},getOption:function(n){return e.getOption(n)},set:function(n,t){e.set(n,t)}}}),i("2b",["e","n","1l","1m"],function(n,t,e,r){var o=function(n){return"img"===t.name(n)?1:e.getOption(n).fold(function(){return r.children(n).length},function(n){return n.length})},i="\xa0",u=function(n){return e.getOption(n).filter(function(n){return 0!==n.trim().length||n.indexOf(i)>-1}).isSome()},a=["img","br"];return{getEnd:o,isEnd:function(n,t){
  return o(n)===t},isStart:function(n,t){return 0===t},isCursorPosition:function(e){return u(e)||n.contains(a,t.name(e))}}}),i("1d",["g","2a","1m","2b"],function(n,t,e,r){var o=function(n){return i(n,r.isCursorPosition)},i=function(t,r){var o=function(t){for(var i=e.children(t),u=i.length-1;u>=0;u--){var a=i[u];if(r(a))return n.some(a);var c=o(a);if(c.isSome())return c}return n.none()};return o(t)};return{first:function(n){return t.descendant(n,r.isCursorPosition)},last:o}}),i("i",["e","1t","1c","12","k","l","n","r","22","y","1m","1d"],function(n,t,e,r,o,i,u,a,c,l,f,s){var d=function(){var n=i.fromTag("td");return r.append(n,i.fromTag("br")),n},m=function(n,e,r){var i=o.copy(n,e);return t.each(r,function(n,t){null===n?a.remove(i,t):a.set(i,t,n)}),i},g=function(n){return n},p=function(n){return function(){return i.fromTag("tr",n.dom())}},v=function(t,i,u){return s.first(t).map(function(a){var c=u.join(","),f=l.ancestors(a,c,function(n){return e.eq(n,t)});return n.foldr(f,function(n,t){var e=o.shallow(t);return r.append(n,e),e},i)}).getOr(i)};return{cellOperations:function(n,t,e){var o=function(t){var o=f.owner(t.element()),a=i.fromTag(u.name(t.element()),o.dom()),l=e.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),s=l.length>0?v(t.element(),a,l):a;return r.append(s,i.fromTag("br")),c.copy(t.element(),a),c.remove(a,"height"),1!==t.colspan()&&c.remove(t.element(),"width"),n(t.element(),a),a};return{row:p(t),cell:o,replace:m,gap:d}},paste:function(n){return{row:p(n),cell:d,replace:g,gap:d}}}}),i("m",["e","l","1m","23"],function(n,t,e,r){return{fromHtml:function(n,o){var i=(o||r).createElement("div");return i.innerHTML=n,e.children(t.fromDom(i))},fromTags:function(e,r){return n.map(e,function(n){return t.fromTag(n,r)})},fromText:function(e,r){return n.map(e,function(n){return t.fromText(n,r)})},fromDom:function(e){return n.map(e,t.fromDom)}}}),i("5v",[],function(){return["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"]}),i("56",["5v","e","f","r","1c","22","l","12","28","n","29","2a","13","y","t","1l","1m"],function(n,t,e,r,o,i,u,a,c,l,f,s,d,m,g,p,v){return function(){var h=function(n){return u.fromDom(n.dom().cloneNode(!1))},b=function(e){return!!l.isElement(e)&&("body"===l.name(e)||t.contains(n,l.name(e)))},w=function(n){return!!l.isElement(n)&&t.contains(["br","img","hr","input"],l.name(n))},y=function(n,t){return n.dom().compareDocumentPosition(t.dom())},x=function(n,t){var e=r.clone(n);r.setAll(t,e)};return{up:e.constant({selector:g.ancestor,closest:g.closest,predicate:s.ancestor,all:v.parents}),down:e.constant({selector:m.descendants,predicate:f.descendants}),styles:e.constant({get:i.get,getRaw:i.getRaw,set:i.set,remove:i.remove}),attrs:e.constant({get:r.get,set:r.set,remove:r.remove,copyTo:x}),insert:e.constant({before:a.before,after:a.after,afterAll:c.after,append:a.append,appendAll:c.append,prepend:a.prepend,wrap:a.wrap}),remove:e.constant({unwrap:d.unwrap,remove:d.remove}),create:e.constant({nu:u.fromTag,clone:h,text:u.fromText}),query:e.constant({comparePosition:y,prevSibling:v.prevSibling,nextSibling:v.nextSibling}),property:e.constant({children:v.children,name:l.name,parent:v.parent,isText:l.isText,isComment:l.isComment,isElement:l.isElement,getText:p.get,setText:p.set,isBoundary:b,isEmptyTag:w}),eq:o.eq,is:o.is}}}),i("5w",["e","f","g","1k"],function(n,t,e,r){var o=r.immutable("left","right"),i=function(e,r,o){var i=e.property().children(r);return n.findIndex(i,t.curry(e.eq,o)).map(function(n){return{before:t.constant(i.slice(0,n)),after:t.constant(i.slice(n+1))}})};return{breakToLeft:function(n,t,e){return i(n,t,e).map(function(r){var i=n.create().clone(t);return n.insert().appendAll(i,r.before().concat([e])),n.insert().appendAll(t,r.after()),n.insert().before(t,i),o(i,t)})},breakToRight:function(n,t,e){return i(n,t,e).map(function(e){var r=n.create().clone(t);return n.insert().appendAll(r,e.after()),n.insert().after(t,r),o(t,r)})},breakPath:function(n,t,o,i){var u=r.immutable("first","second","splits"),a=function(t,r,c){var l=u(t,e.none(),c);return o(t)?u(t,r,c):n.property().parent(t).bind(function(r){return i(n,r,t).map(function(n){var t=[{first:n.left,second:n.right}],i=o(r)?r:n.left();return a(i,e.some(n.right()),c.concat(t))}).getOr(l)})};return a(t,e.none(),[])}}}),i("5x",["e","f","g"],function(n,t,e){var r=function(n,t,e,r){return r(n,t,e[0],e.slice(1))},o=function(n,t,o){return o.length>0?r(n,t,o,i):e.none()},i=function(t,e,r,o){var i=e(t,r);return n.foldr(o,function(n,r){var o=e(t,r);return u(t,n,o)},i)},u=function(n,e,r){return e.bind(function(e){return r.filter(t.curry(n.eq,e))})};return{oneAll:o}}),i("5y",["e","f","g","3v"],function(n,t,e,r){var o=function(n,e){return t.curry(n.eq,e)},i=function(t,i,u,a){var c=t.property().children(i);if(t.eq(i,u[0]))return e.some([u[0]]);if(t.eq(i,a[0]))return e.some([a[0]]);var l=function(e){var r=n.reverse(e),u=n.findIndex(r,o(t,i)).getOr(-1),a=u<r.length-1?r[u+1]:r[u];return n.findIndex(c,o(t,a))},f=l(u),s=l(a);return f.bind(function(n){return s.map(function(t){var e=r.min(n,t),o=r.max(n,t);return c.slice(e,o+1)})})},u=function(e,r,i,u){var a=void 0!==u?u:t.constant(!1),c=[r].concat(e.up().all(r)),l=[i].concat(e.up().all(i)),f=function(t){return n.findIndex(t,a).fold(function(){return t},function(n){return t.slice(0,n+1)})},s=f(c),d=f(l),m=n.find(s,function(t){return n.exists(d,o(e,t))});return{firstpath:t.constant(s),secondpath:t.constant(d),shared:t.constant(m)}};return{subset:function(n,t,e){var r=u(n,t,e);return r.shared().bind(function(t){return i(n,t,r.firstpath(),r.secondpath())})},ancestors:u}}),i("57",["5w","5x","5y"],function(n,t,e){return{sharedOne:function(n,e,r){return t.oneAll(n,e,r)},subset:function(n,t,r){return e.subset(n,t,r)},ancestors:function(n,t,r,o){return e.ancestors(n,t,r,o)},breakToLeft:function(t,e,r){return n.breakToLeft(t,e,r)},breakToRight:function(t,e,r){return n.breakToRight(t,e,r)},breakPath:function(t,e,r,o){return n.breakPath(t,e,r,o)}}}),i("3z",["56","57"],function(n,t){var e=n();return{sharedOne:function(n,r){return t.sharedOne(e,function(t,e){return n(e)},r)},subset:function(n,r){return t.subset(e,n,r)},ancestors:function(n,r,o){return t.ancestors(e,n,r,o)},breakToLeft:function(n,r){return t.breakToLeft(e,n,r)},breakToRight:function(n,r){return t.breakToRight(e,n,r)},breakPath:function(n,r,o){return t.breakPath(e,n,r,function(n,t,e){return o(t,e)})}}}),i("58",["f","g","1x"],function(n,t,e){var r=function(n,t){return t.column()>=n.startCol()&&t.column()+t.colspan()-1<=n.finishCol()&&t.row()>=n.startRow()&&t.row()+t.rowspan()-1<=n.finishRow()};return{inSelection:function(n,t){var e=t.column(),r=t.column()+t.colspan()-1,o=t.row(),i=t.row()+t.rowspan()-1;return e<=n.finishCol()&&r>=n.startCol()&&o<=n.finishRow()&&i>=n.startRow()},isWithin:r,isRectangular:function(o,i){for(var u=!0,a=n.curry(r,i),c=i.startRow();c<=i.finishRow();c++)for(var l=i.startCol();l<=i.finishCol();l++)u=u&&e.getAt(o,c,l).exists(a);return u?t.some(i):t.none()}}}),i("41",["2c","1x","58","1c","3v"],function(n,t,e,r,o){var i=function(t,e){return n.bounds(o.min(t.row(),e.row()),o.min(t.column(),e.column()),o.max(t.row()+t.rowspan()-1,e.row()+e.rowspan()-1),o.max(t.column()+t.colspan()-1,e.column()+e.colspan()-1))},u=function(n,e,o){var u=t.findItem(n,e,r.eq),a=t.findItem(n,o,r.eq);return u.bind(function(n){return a.map(function(t){return i(n,t)})})};return{getAnyBox:u,getBox:function(n,t,r){return u(n,t,r).bind(function(t){return e.isRectangular(n,t)})}}}),i("40",["e","f","1x","58","41","1c"],function(n,t,e,r,o,i){return{moveBy:function(n,t,r,o){return e.findItem(n,t,i.eq).bind(function(t){var i=r>0?t.row()+t.rowspan()-1:t.row(),u=o>0?t.column()+t.colspan()-1:t.column();return e.getAt(n,i+r,u+o).map(function(n){return n.element()})})},intercepts:function(i,u,a){return o.getAnyBox(i,u,a).map(function(o){var u=e.filterItems(i,t.curry(r.inSelection,o));return n.map(u,function(n){return n.element()})})},parentCell:function(n,t){var r=function(n,t){return i.contains(t,n)};return e.findItem(n,t,r).bind(function(n){return n.element()})}}}),i("3q",["j","1w","1x","40","41","1c"],function(n,t,e,r,o,i){var u=function(t,e,o){return n.table(t).bind(function(n){var i=f(n);return r.moveBy(i,t,e,o)})},a=function(n,t,e){var o=f(n);return r.intercepts(o,t,e)},c=function(n,t,e,o,u){var a=f(n),c=i.eq(n,e)?t:r.parentCell(a,t),l=i.eq(n,u)?o:r.parentCell(a,o);return r.intercepts(a,c,l)},l=function(n,t,e){var r=f(n);return o.getBox(r,t,e)},f=function(n){var r=t.fromTable(n);return e.generate(r)};return{moveBy:u,intercepts:a,nestedIntercepts:c,getBox:l}}),i("3l",["e","f","g","3z","3q","1c","y","t","27"],function(n,t,e,r,o,i,u,a,c){var l=function(n){return a.ancestor(n,"table")},f=function(n,t,u){return i.eq(n,t)?e.some([n]):l(n,u).bind(function(e){return l(t,u).bind(function(c){return i.eq(e,c)?o.intercepts(e,n,t):i.contains(e,c)?o.nestedIntercepts(e,n,e,t,c):i.contains(c,e)?o.nestedIntercepts(c,n,e,t,c):r.ancestors(n,t).shared().bind(function(r){return a.closest(r,"table",u).bind(function(r){return o.nestedIntercepts(r,n,e,t,c)})})})})},s=function(t,e){return n.find(t,function(n){return c.is(n,e)})},d=function(n,e){return a.ancestor(n,"table").bind(function(r){return a.descendant(r,e).bind(function(e){return f(e,n).map(function(r){return{boxes:t.constant(r),start:t.constant(e),finish:t.constant(n)}})})})};return{identify:f,retrieve:function(n,t){var r=u.descendants(n,t);return r.length>0?e.some(r):e.none()},shiftSelection:function(n,t,e,r,i){return s(n,i).bind(function(n){return o.moveBy(n,t,e).bind(function(n){return d(n,r)})})},getEdges:function(n,e,o){return a.descendant(n,e).bind(function(e){return a.descendant(n,o).bind(function(n){return r.sharedOne(l,[e,n]).map(function(r){return{first:t.constant(e),last:t.constant(n),table:t.constant(r)}})})})}}}),i("1o",["3l","g","3q","1c","t"],function(n,t,e,r,o){return{retrieve:function(t,e){return n.retrieve(t,e)},retrieveBox:function(i,u,a){return n.getEdges(i,u,a).bind(function(n){var u=function(n){return r.eq(i,n)},a=o.ancestor(n.first(),"thead,tfoot,tbody,table",u),c=o.ancestor(n.last(),"thead,tfoot,tbody,table",u);return a.bind(function(o){return c.bind(function(i){return r.eq(o,i)?e.getBox(n.table(),n.first(),n.last()):t.none()})})})}}}),i("9",["f"],function(n){var t="data-mce-selected",e="td["+t+"],th["+t+"]",r="["+t+"]",o="data-mce-first-selected",i="td["+o+"],th["+o+"]",u="data-mce-last-selected",a="td["+u+"],th["+u+"]";return{selected:n.constant(t),selectedSelector:n.constant(e),attributeSelector:n.constant(r),firstSelected:n.constant(o),firstSelectedSelector:n.constant(i),lastSelected:n.constant(u),lastSelectedSelector:n.constant(a)}}),i("2g",["e","1t","1z","1p","1q","21"],function(n,t,e,r,o,i){return{generate:function(u){if(!e.isArray(u))throw new o("cases must be an array");if(0===u.length)throw new o("there must be at least one case");var a=[],c={};return n.each(u,function(l,f){var s=t.keys(l);if(1!==s.length)throw new o("one and only one name per case");var d=s[0],m=l[d];if(void 0!==c[d])throw new o("duplicate key detected:"+d);if("cata"===d)throw new o("cannot have a case named cata (sorry)");if(!e.isArray(m))throw new o("case arguments must be an array");a.push(d),c[d]=function(){var e=arguments.length;if(e!==m.length)throw new o("Wrong number of arguments to case "+d+". Expected "+m.length+" ("+m+"), got "+e);for(var c=new r(e),l=0;l<c.length;l++)c[l]=arguments[l];return{fold:function(){if(arguments.length!==u.length)throw new o("Wrong number of arguments to fold. Expected "+u.length+", got "+arguments.length);return arguments[f].apply(null,c)},match:function(e){var r=t.keys(e);if(a.length!==r.length)throw new o("Wrong number of arguments to match. Expected: "+a.join(",")+"\nActual: "+r.join(","));if(!n.forall(a,function(t){return n.contains(r,t)}))throw new o("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+a.join(", "));return e[d].apply(null,c)},log:function(n){i.log(n,{constructors:a,constructor:d,params:c})}}}}),c}}}),i("p",["2g"],function(n){var t=n.generate([{none:[]},{multiple:["elements"]},{single:["selection"]}]);return{cata:function(n,t,e,r){return n.fold(t,e,r)},none:t.none,multiple:t.multiple,single:t.single}}),i("2f",["1o","e","f","g","r","9","p"],function(n,t,e,r,o,i,u){var a=function(n,t){return u.cata(t.get(),e.constant([]),e.identity,e.constant([n]))};return{mergable:function(t,o){return u.cata(o.get(),r.none,function(o){return 0===o.length?r.none():n.retrieveBox(t,i.firstSelectedSelector(),i.lastSelectedSelector()).bind(function(n){return o.length>1?r.some({bounds:e.constant(n),cells:e.constant(o)}):r.none()})},r.none)},unmergable:function(n,e){var i=function(n){return o.has(n,"rowspan")&&parseInt(o.get(n,"rowspan"),10)>1||o.has(n,"colspan")&&parseInt(o.get(n,"colspan"),10)>1},u=a(n,e);return u.length>0&&t.forall(u,i)?r.some(u):r.none()},selection:a}}),i("o",["f","g","1k","2f"],function(n,t,e,r){var o=function(e){return{element:n.constant(e),mergable:t.none,unmergable:t.none,selection:n.constant([e])}},i=function(t,e,o){return{element:n.constant(o),mergable:n.constant(r.mergable(e,t)),unmergable:n.constant(r.unmergable(o,t)),selection:n.constant(r.selection(o,t))}},u=function(n){return o(n)},a=e.immutable("element","clipboard","generators");return{noMenu:o,forMenu:i,notCell:u,paste:a,pasteRows:function(e,o,i,u,a){return{element:n.constant(i),mergable:t.none,unmergable:t.none,selection:n.constant(r.selection(i,e)),clipboard:n.constant(u),generators:n.constant(a)}}}}),i("2",["e","f","g","h","i","j","k","l","m","n","o","9","p"],function(n,t,e,r,o,i,u,a,c,l,f,s,d){var m=function(n){return i.table(n[0]).map(u.deep).map(function(n){return[r.extract(n,s.attributeSelector())]})},g=function(n,t){return n.selection.serializer.serialize(t.dom(),{})};return{registerEvents:function(r,u,s,p){r.on("BeforeGetContent",function(e){var o=function(t){e.preventDefault(),m(t).each(function(t){e.content=n.map(t,function(n){return g(r,n)}).join("")})};!0===e.selection&&d.cata(u.get(),t.noop,o,t.noop)}),r.on("BeforeSetContent",function(t){if(!0===t.selection&&!0===t.paste){e.from(r.dom.getParent(r.selection.getStart(),"th,td")).each(function(e){var u=a.fromDom(e);i.table(u).bind(function(e){var i=n.filter(c.fromHtml(t.content),function(n){return"meta"!==l.name(n)});if(1===i.length&&"table"===l.name(i[0])){t.preventDefault();var d=a.fromDom(r.getDoc()),m=o.paste(d),g=f.paste(u,i[0],m);s.pasteCells(e,g).each(function(n){r.selection.setRng(n),r.focus(),p.clear(e)})}})})}})}}}),i("2h",["r","22","l","12","28"],function(n,t,e,r,o){var i=function(){return e.fromTag("table")},u=function(){return e.fromTag("tbody")},a=function(){return e.fromTag("tr")},c=function(){return e.fromTag("th")},l=function(){return e.fromTag("td")};return{render:function(f,s,d,m){var g=i();t.setAll(g,{"border-collapse":"collapse",width:"100%"}),n.set(g,"border","1");var p=u();r.append(g,p);for(var v=[],h=0;h<f;h++){for(var b=a(),w=0;w<s;w++){var y=h<d||w<m?c():l();w<m&&n.set(y,"scope","row"),h<d&&n.set(y,"scope","col"),r.append(y,e.fromTag("br")),t.set(y,"width",100/s+"%"),r.append(b,y)}v.push(b)}return o.append(p,v),g}}}),i("q",["2h"],function(n){return{render:n.render}}),i("s",["l","m","12","28","13","1m"],function(n,t,e,r,o,i){var u=function(n){return n.dom().innerHTML};return{get:u,set:function(u,a){var c=i.owner(u).dom(),l=n.fromDom(c.createDocumentFragment()),f=t.fromHtml(a,c);r.append(l,f),o.empty(u),e.append(u,l)},getOuter:function(t){var r=n.fromTag("div"),o=n.fromDom(t.dom().cloneNode(!0));return e.append(r,o),u(r)}}}),i("3",["f","q","l","r","s","t"],function(n,t,e,r,o,i){var u=function(n,t){n.selection.select(t.dom(),!0),n.selection.collapse(!0)},a=function(t,e){i.descendant(e,"td,th").each(n.curry(u,t))};return{insert:function(n,i,u){var c,l=t.render(u,i,0,0);r.set(l,"id","__mce");var f=o.getOuter(l);return n.insertContent(f),c=n.dom.get("__mce"),n.dom.setAttrib(c,"id",null),n.$("tr",c).each(function(t,e){n.fire("newrow",{node:e}),n.$("th,td",e).each(function(t,e){n.fire("newcell",{node:e})})}),n.dom.setAttribs(c,n.settings.table_default_attributes||{}),n.dom.setStyles(c,n.settings.table_default_styles||{}),a(n,e.fromDom(c)),c}}}),i("59",["1z","e","22","3w"],function(n,t,e,r){return function(o,i){var u=function(n){var t=i(n);if(t<=0||null===t){var r=e.get(n,o);return parseFloat(r)||0}return t},a=function(n,r){return t.foldl(r,function(t,r){var o=e.get(n,r),i=void 0===o?0:parseInt(o,10);return isNaN(i)?t:t+i},0)};return{set:function(t,e){if(!n.isNumber(e)&&!e.match(/^[0-9]+$/))throw o+".set accepts only positive integer values. Value was "+e;var i=t.dom();r.isSupported(i)&&(i.style[o]=e+"px")},get:u,getOuter:u,aggregate:a,max:function(n,t,e){var r=a(n,e);return t>r?t-r:0}}}}),i("43",["35","22","59"],function(n,t,e){var r=e("height",function(t){return n.inBody(t)?t.dom().getBoundingClientRect().height:t.dom().offsetHeight});return{set:function(n,t){r.set(n,t)},get:function(n){return r.get(n)},getOuter:function(n){return r.getOuter(n)},setMax:function(n,e){var o=["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"],i=r.max(n,e,o);t.set(n,"max-height",i+"px")}}}),i("44",["22","59"],function(n,t){var e=t("width",function(n){return n.dom().offsetWidth});return{set:function(n,t){e.set(n,t)},get:function(n){return e.get(n)},getOuter:function(n){return e.getOuter(n)},setMax:function(t,r){var o=["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"],i=e.max(t,r,o);n.set(t,"max-width",i+"px")}}}),i("42",["26","22","43","44"],function(n,t,e,r){var o=n.detect(),i=function(){return o.browser.isIE()||o.browser.isEdge()},u=function(n,t){var e=parseFloat(n);return isNaN(e)?t:e},a=function(n,e,r){return u(t.get(n,e),r)},c=function(n){var e=a(n,"padding-top",0),r=a(n,"padding-bottom",0),o=a(n,"border-top-width",0),i=a(n,"border-bottom-width",0),u=n.dom().getBoundingClientRect().height;return"border-box"===t.get(n,"box-sizing")?u:u-e-r-(o+i)};return{getWidth:function(n){return a(n,"width",r.get(n))},getHeight:function(n){return i()?c(n):a(n,"height",e.get(n))}}}),i("2i",["f","g","3x","j","42","n","r","22","43","44","3v","2e"],function(n,t,e,r,o,i,u,a,c,l,f,s){var d=/(\d+(\.\d+)?)(\w|%)*/,m=/(\d+(\.\d+)?)%/,g=/(\d+(\.\d+)?)px|em/,p=function(n,t){a.set(n,"width",t+"px")},v=function(n,t){a.set(n,"width",t+"%")},h=function(n,t){a.set(n,"height",t+"px")},b=function(n){return a.getRaw(n,"height").getOrThunk(function(){return o.getHeight(n)+"px"})},w=function(n,t,e,o){var i=r.table(n).map(function(n){var r=e(n);return f.floor(t/100*r)}).getOr(t);return o(n,i),i},y=function(n,t,r,o){var u=s(n,10);return e.endsWith(n,"%")&&"table"!==i.name(t)?w(t,u,r,o):u},x=function(n){var t=b(n);return t?y(t,n,c.get,h):c.get(n)},C=function(n,t,e){return e(n)/S(n,t)},S=function(n,t){return u.has(n,t)?s(u.get(n,t),10):1},R=function(n){return a.getRaw(n,"width").fold(function(){return t.from(u.get(n,"width"))},function(n){return t.some(n)})},T=function(n,t){return n/t.pixelWidth()*100},k=function(n,t,e){if(m.test(t)){var r=m.exec(t);return parseFloat(r[1],10)}var o=l.get(n),i=s(o,10);return T(i,e)},A=function(n,t){return R(n).fold(function(){var e=l.get(n),r=s(e,10);return T(r,t)},function(e){return k(n,e,t)})},D=function(n,t){return n/100*t.pixelWidth()},O=function(n,t,e){if(g.test(t)){var r=g.exec(t);return s(r[1],10)}if(m.test(t)){var o=m.exec(t),i=parseFloat(o[1],10);return D(i,e)}var u=l.get(n);return s(u,10)},N=function(n,t){return R(n).fold(function(){var t=l.get(n);return s(t,10)},function(e){return O(n,e,t)})},E=function(n){return C(n,"rowspan",x)},B=function(e){return R(e).bind(function(e){if(d.test(e)){var r=d.exec(e);return t.some({width:n.constant(r[1]),unit:n.constant(r[3])})}return t.none()})},P=function(n,t,e){a.set(n,"width",t+e)};return{percentageBasedSizeRegex:n.constant(m),pixelBasedSizeRegex:n.constant(g),setPixelWidth:p,setPercentageWidth:v,setHeight:h,getPixelWidth:N,getPercentageWidth:A,getGenericWidth:B,setGenericWidth:P,getHeight:E,getRawWidth:R}}),i("u",["2i"],function(n){return{halve:function(t,e){n.getGenericWidth(t).each(function(r){var o=r.width()/2;n.setGenericWidth(t,o,r.unit()),n.setGenericWidth(e,o,r.unit())})}}}),i("30",["f"],function(n){var t=function(e,r){var o=function(n,o){return t(e+n,r+o)};return{left:n.constant(e),top:n.constant(r),translate:o}};return t}),i("45",["f","1c","l","n","2a","23"],function(n,t,e,r,o,i){return{attached:function(r,u){var a=u||e.fromDom(i.documentElement);return o.ancestor(r,n.curry(t.eq,a)).isSome()},windowOf:function(n){var t=n.dom();return t===t.window?n:r.isDocument(n)?t.defaultView||t.parentWindow:null}}}),i("2z",["30","45","l"],function(n,t,e){var r=function(t){var e=t.getBoundingClientRect();return n(e.left,e.top)},o=function(n,t){return void 0!==n?n:void 0!==t?t:0},i=function(n){var r=n.dom().ownerDocument,i=r.body,a=t.windowOf(e.fromDom(r)),c=r.documentElement,l=o(a.pageYOffset,c.scrollTop),f=o(a.pageXOffset,c.scrollLeft),s=o(c.clientTop,i.clientTop),d=o(c.clientLeft,i.clientLeft);return u(n).translate(f-d,l-s)},u=function(o){var i=o.dom(),u=i.ownerDocument,a=u.body,c=e.fromDom(u.documentElement);return a===i?n(a.offsetLeft,a.offsetTop):t.attached(o,c)?r(i):n(0,0)};return{absolute:i,relative:function(t){var e=t.dom();return n(e.offsetLeft,e.offsetTop)},viewport:u}}),i("34",["e","f","1k","43","2z","44"],function(n,t,e,r,o,i){var u=e.immutable("row","y"),a=e.immutable("col","x"),c=function(n){return o.absolute(n).left()+i.getOuter(n)},l=function(n){return o.absolute(n).left()},f=function(n,t){return a(n,l(t))},s=function(n,t){return a(n,c(t))},d=function(n){return o.absolute(n).top()},m=function(n,t){return u(n,d(t))},g=function(n,t){return u(n,d(t)+r.getOuter(t))},p=function(t,e,r){if(0===r.length)return[];var o=n.map(r.slice(1),function(n,e){return n.map(function(n){return t(e,n)})}),i=r[r.length-1].map(function(n){return e(r.length-1,n)});return o.concat([i])},v=function(n){return-n},h={delta:t.identity,positions:t.curry(p,m,g),edge:d},b={delta:t.identity,edge:l,positions:t.curry(p,f,s)};return{height:h,rtl:{delta:v,edge:c,positions:t.curry(p,s,f)},ltr:b}}),i("2j",["34"],function(n){return{ltr:n.ltr,rtl:n.rtl}}),i("v",["2j"],function(n){return function(t){var e=function(e){return t(e).isRtl()?n.rtl:n.ltr};return{delta:function(n,t){return e(t).delta(n,t)},edge:function(n){return e(n).edge(n)},positions:function(n,t){return e(t).positions(n,t)}}}}),i("w",["1w","1x"],function(n,t){return{getGridSize:function(e){var r=n.fromTable(e);return t.generate(r).grid()}}}),i("46",[],function(){var n=function(t){var e=t,r=function(){return e};return{get:r,set:function(n){e=n},clone:function(){return n(r())}}};return n}),i("47",["e","f","1t","1z","3r","1q"],function(n,t,e,r,o,i){var u=function(n,t){return a(n,t,{validate:r.isFunction,label:"function"})},a=function(t,r,u){if(0===r.length)throw new i("You must specify at least one required field.");return o.validateStrArr("required",r),o.checkDupes(r),function(i){var a=e.keys(i);n.forall(r,function(t){return n.contains(a,t)})||o.reqMessage(r,a),t(r,a);var c=n.filter(r,function(n){return!u.validate(i[n],n)});return c.length>0&&o.invalidTypeMessage(c,u.label),i}},c=function(t,e){var r=n.filter(e,function(e){return!n.contains(t,e)});r.length>0&&o.unsuppMessage(r)},l=t.noop;return{exactly:t.curry(u,c),ensure:t.curry(u,l),ensureWith:t.curry(a,l)}}),i("2k",["e","f","g","46","47","r","22","2e"],function(n,t,e,r,o,i,u,a){var c=function(n){var e=i.has(n,"colspan")?a(i.get(n,"colspan"),10):1,r=i.has(n,"rowspan")?a(i.get(n,"rowspan"),10):1;return{element:t.constant(n),colspan:t.constant(e),rowspan:t.constant(r)}},l=function(n,t){d(n);var o=r(e.none()),i=void 0!==t?t:c,u=function(t){return n.cell(t)},a=function(n){var t=i(n);return u(t)},l=function(n){var t=a(n);return o.get().isNone()&&o.set(e.some(t)),f=e.some({item:n,replacement:t}),t},f=e.none();return{getOrInit:function(n,t){return f.fold(function(){return l(n)},function(e){return t(n,e.item)?e.replacement:l(n)})},cursor:o.get}},f=function(t,o){return function(i){var u=r(e.none());d(i);var a=[],c=function(t,e){return n.find(a,function(n){return e(n.item,t)})},l=function(n){var r=i.replace(n,o,{scope:t});return a.push({item:n,sub:r}),u.get().isNone()&&u.set(e.some(r)),r};return{replaceOrInit:function(n,t){return c(n,t).fold(function(){return l(n)},function(e){return t(n,e.item)?e.sub:l(n)})},cursor:u.get}}},s=function(n){d(n);var o=r(e.none());return{combine:function(r){return o.get().isNone()&&o.set(e.some(r)),function(){var e=n.cell({element:t.constant(r),colspan:t.constant(1),rowspan:t.constant(1)});return u.remove(e,"width"),u.remove(r,"width"),e}},cursor:o.get}},d=o.exactly(["cell","row","replace","gap"]);return{modification:l,transform:f,merging:s}}),i("5a",["e"],function(n){var t=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],e=function(e,r){var o=e.property().name(r);return n.contains(t,o)},r=function(t,e){return n.contains(["br","img","hr","input"],t.property().name(e))};return{isBlock:e,isList:function(t,e){var r=t.property().name(e);return n.contains(["ol","ul"],r)},isFormatting:function(t,e){var r=t.property().name(e);return n.contains(["address","pre","p","h1","h2","h3","h4","h5","h6"],r)},isHeading:function(t,e){var r=t.property().name(e);return n.contains(["h1","h2","h3","h4","h5","h6"],r)},isContainer:function(t,e){return n.contains(["div","li","td","th","blockquote","body","caption"],t.property().name(e))},isEmptyTag:r,isFrame:function(n,t){return"iframe"===n.property().name(t)},isInline:function(n,t){return!(e(n,t)||r(n,t))&&"li"!==n.property().name(t)}}}),i("48",["56","5a"],function(n,t){var e=n();return{isBlock:function(n){return t.isBlock(e,n)},isList:function(n){return t.isList(e,n)},isFormatting:function(n){return t.isFormatting(e,n)},isHeading:function(n){return t.isHeading(e,n)},isContainer:function(n){return t.isContainer(e,n)},isEmptyTag:function(n){return t.isEmptyTag(e,n)},isFrame:function(n){return t.isFrame(e,n)},isInline:function(n){return t.isInline(e,n)}}}),i("2l",["e","48","1c","28","13","l","n","1l","2a","1m","1d"],function(n,t,e,r,o,i,u,a,c,l,f){return{merge:function(s){var d=function(n){return"br"===u.name(n)},m=function(t){return n.forall(t,function(n){return d(n)||u.isText(n)&&0===a.get(n).trim().length})},g=function(n){return"li"===u.name(n)||c.ancestor(n,t.isList).isSome()},p=function(n){return l.nextSibling(n).map(function(n){return!!t.isBlock(n)||(t.isEmptyTag(n)?"img"!==u.name(n):void 0)}).getOr(!1)},v=function(n){return f.last(n).bind(function(r){var o=p(r);return l.parent(r).map(function(u){return!0===o||g(u)||d(r)||t.isBlock(u)&&!e.eq(n,u)?[]:[i.fromTag("br")]})}).getOr([])},h=function(){var t=n.bind(s,function(n){var t=l.children(n);return m(t)?[]:t.concat(v(n))});return 0===t.length?[i.fromTag("br")]:t}();o.empty(s[0]),r.append(s[0],h)}}}),i("2m",["e","2c"],function(n,t){var e=function(n,t,e){var o=n.cells(),i=o.slice(0,t),u=o.slice(t),a=i.concat([e]).concat(u);return r(n,a)},r=function(n,e){return t.rowcells(e,n.section())},o=function(n,t){return n.cells()[t]};return{addCell:e,setCells:r,mutateCell:function(n,t,e){n.cells()[t]=e},getCell:o,getCellElement:function(n,t){return o(n,t).element()},mapCells:function(e,r){var o=e.cells(),i=n.map(o,r);return t.rowcells(i,e.section())},cellLength:function(n){return n.cells().length}}}),i("49",["1z","1p","1q"],function(n,t,e){var r=function(n,t){return t},o=function(n){return function(){for(var r=new t(arguments.length),o=0;o<r.length;o++)r[o]=arguments[o];if(0===r.length)throw new e("Can't merge zero objects");for(var i={},u=0;u<r.length;u++){var a=r[u];for(var c in a)a.hasOwnProperty(c)&&(i[c]=n(i[c],a[c]))}return i}},i=o(function(t,e){return n.isObject(t)&&n.isObject(e)?i(t,e):e}),u=o(r);return{deepMerge:i,merge:u}}),i("3m",["g"],function(n){return{cat:function(n){for(var t=[],e=function(n){t.push(n)},r=0;r<n.length;r++)n[r].each(e);return t},findMap:function(t,e){for(var r=0;r<t.length;r++){var o=e(t[r],r);if(o.isSome())return o}return n.none()},liftN:function(t,e){for(var r=[],o=0;o<t.length;o++){var i=t[o];if(!i.isSome())return n.none();r.push(i.getOrDie())}return n.some(e.apply(null,r))}}}),i("4a",["e","f","2m"],function(n,t,e){var r=function(t,r){return n.map(t,function(n){return e.getCell(n,r)})},o=function(n,t){return n[t]},i=function(t,e){if(0===t.length)return 0;var r=t[0];return n.findIndex(t,function(n){return!e(r.element(),n.element())}).fold(function(){return t.length},function(n){return n})};return{subgrid:function(n,e,u,a){var c=o(n,e).cells().slice(u),l=i(c,a),f=r(n,u).slice(e),s=i(f,a);return{colspan:t.constant(l),rowspan:t.constant(s)}}}}),i("2p",["e","2c","4a","1x"],function(n,t,e,r){return{toDetails:function(r,o){var i=n.map(r,function(t){return n.map(t.cells(),function(){return!1})}),u=function(n,t,e,r){for(var o=n;o<n+e;o++)for(var u=t;u<t+r;u++)i[o][u]=!0};return n.map(r,function(a,c){var l=n.bind(a.cells(),function(n,a){if(!1===i[c][a]){var l=e.subgrid(r,c,a,o);return u(c,a,l.rowspan(),l.colspan()),[t.detailnew(n.element(),l.rowspan(),l.colspan(),n.isNew())]}return[]});return t.rowdetails(l,a.section())})},toGrid:function(n,e,o){for(var i=[],u=0;u<n.grid().rows();u++){for(var a=[],c=0;c<n.grid().columns();c++){var l=r.getAt(n,u,c).map(function(n){return t.elementnew(n.element(),o)}).getOrThunk(function(){return t.elementnew(e.gap(),!0)});a.push(l)}var f=t.rowcells(a,n.all()[u].section());i.push(f)}return i}}}),i("2v",["e","f","r","l","12","28","13","k","t","1m"],function(n,t,e,r,o,i,u,a,c,l){var f=function(n,t,r,o){r===o?e.remove(n,t):e.set(n,t,r)};return{render:function(e,a){var s=[],d=[],m=function(t,a){var m=c.child(e,a).getOrThunk(function(){var n=r.fromTag(a,l.owner(e).dom());return o.append(e,n),n});u.empty(m);var g=n.map(t,function(t){t.isNew()&&s.push(t.element());var e=t.element();return u.empty(e),n.each(t.cells(),function(n){n.isNew()&&d.push(n.element()),f(n.element(),"colspan",n.colspan(),1),f(n.element(),"rowspan",n.rowspan(),1),o.append(e,n.element())}),e});i.append(m,g)},g=function(n){c.child(e,n).bind(u.remove)},p=function(n,t){n.length>0?m(n,t):g(t)},v=[],h=[],b=[];return n.each(a,function(n){switch(n.section()){case"thead":v.push(n);break;case"tbody":h.push(n);break;case"tfoot":b.push(n)}}),p(v,"thead"),p(h,"tbody"),p(b,"tfoot"),{newRows:t.constant(s),newCells:t.constant(d)}},copy:function(t){return n.map(t,function(t){var e=a.shallow(t.element());return n.each(t.cells(),function(n){var t=a.deep(n.element());f(t,"colspan",n.colspan(),1),f(t,"rowspan",n.rowspan(),1),o.append(e,t)}),e})}}}),i("5g",["e","g","3m","3v"],function(n,t,e,r){return{repeat:function(n,t){for(var e=[],r=0;r<n;r++)e.push(t(r));return e},range:function(n,t){for(var e=[],r=n;r<t;r++)e.push(r);return e},unique:function(t,e){var r=[];return n.each(t,function(n,o){o<t.length-1&&!e(n,t[o+1])?r.push(n):o===t.length-1&&r.push(n)}),r},deduce:function(o,i){if(i<0||i>=o.length-1)return t.none();var u=o[i].fold(function(){var t=n.reverse(o.slice(0,i));return e.findMap(t,function(n,t){return n.map(function(n){return{value:n,delta:t+1}})})},function(n){return t.some({value:n,delta:0})}),a=o[i+1].fold(function(){var n=o.slice(i+1);return e.findMap(n,function(n,t){return n.map(function(n){return{value:n,delta:t+1}})})},function(n){return t.some({value:n,delta:1})});return u.bind(function(n){return a.map(function(t){var e=t.delta+n.delta;return r.abs(t.value-n.value)/e})})}}}),i("5b",["e","f","g","1x","5g"],function(n,t,e,r,o){var i=function(e){var i=e.grid(),a=o.range(0,i.columns()),c=o.range(0,i.rows());return n.map(a,function(o){return u(function(){return n.bind(c,function(n){return r.getAt(e,n,o).filter(function(n){return n.column()===o}).fold(t.constant([]),function(n){return[n]})})},function(n){return 1===n.colspan()},function(){return r.getAt(e,0,o)})})},u=function(t,r,o){var i=t();return n.find(i,r).orThunk(function(){return e.from(i[0]).orThunk(o)}).map(function(n){return n.element()})};return{columns:i,rows:function(e){var i=e.grid(),a=o.range(0,i.rows()),c=o.range(0,i.columns());return n.map(a,function(o){return u(function(){return n.bind(c,function(n){return r.getAt(e,o,n).filter(function(n){return n.row()===o}).fold(t.constant([]),function(n){return[n]})})},function(n){return 1===n.rowspan()},function(){return r.getAt(e,o,0)})})}}}),i("5c",["r","22","l"],function(n,t,e){return{col:function(r,o,i,u,a){var c=e.fromTag("div")
  ;return t.setAll(c,{position:"absolute",left:o-u/2+"px",top:i+"px",height:a+"px",width:u+"px"}),n.set(c,"data-column",r),c},row:function(r,o,i,u,a){var c=e.fromTag("div");return t.setAll(c,{position:"absolute",left:o+"px",top:i-a/2+"px",height:a+"px",width:u+"px"}),n.set(c,"data-row",r),c}}}),i("5d",[],function(){return{css:function(n){var t=n.replace(/\./g,"-");return{resolve:function(n){return t+"-"+n}}}}}),i("4k",["5d"],function(n){return{resolve:n.css("ephox-snooker").resolve}}),i("4m",[],function(){return function(n,t,e){var r=e||!1,o=function(){t(),r=!0},i=function(){n(),r=!1};return{on:o,off:i,toggle:function(){(r?i:o)()},isOn:function(){return r}}}}),i("5e",["e","r"],function(n,t){var e=function(n,e){var r=t.get(n,e);return void 0===r||""===r?[]:r.split(" ")};return{read:e,add:function(n,r,o){var i=e(n,r).concat([o]);t.set(n,r,i.join(" "))},remove:function(r,o,i){var u=n.filter(e(r,o),function(n){return n!==i});u.length>0?t.set(r,o,u.join(" ")):t.remove(r,o)}}}),i("4n",["e","5e"],function(n,t){var e=function(n){return t.read(n,"class")},r=function(n,e){return t.add(n,"class",e)},o=function(n,e){return t.remove(n,"class",e)};return{get:e,add:r,remove:o,toggle:function(t,i){n.contains(e(t),i)?o(t,i):r(t,i)},supports:function(n){return void 0!==n.dom().classList}}}),i("3n",["4m","r","4n"],function(n,t,e){var r=function(n){0===(e.supports(n)?n.dom().classList:e.get(n)).length&&t.remove(n,"class")},o=function(t,r){var o=e.supports(t),u=t.dom().classList;return n(function(){o?u.remove(r):e.remove(t,r)},function(){o?u.add(r):e.add(t,r)},i(t,r))},i=function(n,t){return e.supports(n)&&n.dom().classList.contains(t)};return{add:function(n,t){e.supports(n)?n.dom().classList.add(t):e.add(n,t)},remove:function(n,t){if(e.supports(n)){n.dom().classList.remove(t)}else e.remove(n,t);r(n)},toggle:function(n,t){return e.supports(n)?n.dom().classList.toggle(t):e.toggle(n,t)},toggler:o,has:i}}),i("4b",["e","5b","1w","1x","5c","4k","12","13","3n","22","y","43","2z","44"],function(n,t,e,r,o,i,u,a,c,l,f,s,d,m){var g=i.resolve("resizer-bar"),p=i.resolve("resizer-rows"),v=i.resolve("resizer-cols"),h=7,b=function(t){var e=f.descendants(t.parent(),"."+g);n.each(e,a.remove)},w=function(t,e,r){var o=t.origin();n.each(e,function(n){n.each(function(n){var e=r(o,n);c.add(e,g),u.append(t.parent(),e)})})},y=function(n,t,e,r){w(n,t,function(n,t){var i=o.col(t.col(),t.x()-n.left(),e.top()-n.top(),h,r);return c.add(i,v),i})},x=function(n,t,e,r){w(n,t,function(n,t){var i=o.row(t.row(),e.left()-n.left(),t.y()-n.top(),r,h);return c.add(i,p),i})},C=function(n,t,e,r,o,i){var u=d.absolute(t),a=e.length>0?o.positions(e,t):[];x(n,a,u,m.getOuter(t));var c=r.length>0?i.positions(r,t):[];y(n,c,u,s.getOuter(t))},S=function(t,e){var r=f.descendants(t.parent(),"."+g);n.each(r,e)};return{refresh:function(n,o,i,u){b(n,o);var a=e.fromTable(o),c=r.generate(a),l=t.rows(c),f=t.columns(c);C(n,o,l,f,i,u)},hide:function(n){S(n,function(n){l.set(n,"display","none")})},show:function(n){S(n,function(n){l.set(n,"display","block")})},destroy:b,isRowBar:function(n){return c.has(n,p)},isColBar:function(n){return c.has(n,v)}}}),i("2n",["e","49","f","g","3m","2c","j","1w","2p","1x","2v","34","4b","1c","1m"],function(n,t,e,r,o,i,u,a,c,l,f,s,d,m,g){var p=function(n,t){return c.toGrid(n,t,!1)},v=function(t,e){var r=function(n){return o.findMap(n,function(n){return g.parent(n.element()).map(function(n){var t=g.parent(n).isNone();return i.elementnew(n,t)})}).getOrThunk(function(){return i.elementnew(e.row(),!0)})};return n.map(t,function(n){var t=r(n.details());return i.rowdatanew(t.element(),n.details(),n.section(),t.isNew())})},h=function(n,t){var e=c.toDetails(n,m.eq);return v(e,t)},b=function(t,e){var r=n.flatten(n.map(t.all(),function(n){return n.cells()}));return n.find(r,function(n){return m.eq(e,n.element())})};return{run:function(n,t,o,i,u){return function(c,g,v,b,w){var y=a.fromTable(g),x=l.generate(y);return t(x,v).map(function(t){var r=p(x,b),o=n(r,t,m.eq,u(b)),i=h(o.grid(),b);return{grid:e.constant(i),cursor:o.cursor}}).fold(function(){return r.none()},function(n){var t=f.render(g,n.grid());return o(g,n.grid(),w),i(g),d.refresh(c,g,s.height,w),r.some({cursor:n.cursor,newRows:t.newRows,newCells:t.newCells})})}},toDetailList:h,onCell:function(n,t){return u.cell(t.element()).bind(function(t){return b(n,t)})},onCells:function(t,e){var i=n.map(e.selection(),function(n){return u.cell(n).bind(function(n){return b(t,n)})}),a=o.cat(i);return a.length>0?r.some(a):r.none()},onPaste:function(n,e){return u.cell(e.element()).bind(function(r){return b(n,r).map(function(n){return t.merge(n,{generators:e.generators,clipboard:e.clipboard})})})},onPasteRows:function(e,i){var a=n.map(i.selection(),function(n){return u.cell(n).bind(function(n){return b(e,n)})}),c=o.cat(a);return c.length>0?r.some(t.merge({cells:c},{generators:i.generators,clipboard:i.clipboard})):r.none()},onMergable:function(n,t){return t.mergable()},onUnmergable:function(n,t){return t.unmergable()}}}),i("5f",["f","g"],function(n,t){var e=function(r){var o=function(){return e(r)},i=function(){return e(r)},u=function(n){return e(n(r))},a=function(n){n(r)},c=function(n){return n(r)},l=function(n,t){return t(r)},f=function(n){return n(r)},s=function(n){return n(r)},d=function(){return t.some(r)};return{is:function(n){return r===n},isValue:n.constant(!0),isError:n.constant(!1),getOr:n.constant(r),getOrThunk:n.constant(r),getOrDie:n.constant(r),or:o,orThunk:i,fold:l,map:u,each:a,bind:c,exists:f,forall:s,toOption:d}},r=function(e){var o=function(n){return n()},i=function(){return n.die(e)()},u=function(n){return n},a=function(n){return n()},c=function(){return r(e)},l=function(){return r(e)},f=function(n){return n(e)};return{is:n.constant(!1),isValue:n.constant(!1),isError:n.constant(!0),getOr:n.identity,getOrThunk:o,getOrDie:i,or:u,orThunk:a,fold:f,map:c,each:n.noop,bind:l,exists:n.constant(!1),forall:n.constant(!0),toOption:t.none}};return{value:e,error:r}}),i("4c",["e","f","5f","2c","2m","5g","1p","1q","3v"],function(n,t,e,r,o,i,u,a,c){var l=function(t,e){return n.map(t,function(){return r.elementnew(e.cell(),!0)})},f=function(n,t,e){return n.concat(i.repeat(t,function(){return o.setCells(n[n.length-1],l(n[n.length-1].cells(),e))}))},s=function(t,e,r){return n.map(t,function(n){return o.setCells(n,n.cells().concat(l(i.range(0,e),r)))})};return{measure:function(n,r,i){if(n.row()>=r.length||n.column()>o.cellLength(r[0]))return e.error("invalid start address out of table bounds, row: "+n.row()+", column: "+n.column());var u=r.slice(n.row()),a=u[0].cells().slice(n.column()),c=o.cellLength(i[0]),l=i.length;return e.value({rowDelta:t.constant(u.length-l),colDelta:t.constant(a.length-c)})},measureWidth:function(n,e){var r=o.cellLength(n[0]),i=o.cellLength(e[0]);return{rowDelta:t.constant(0),colDelta:t.constant(r-i)}},tailor:function(n,e,r){var o=e.colDelta()<0?s:t.identity;return(e.rowDelta()<0?f:t.identity)(o(n,c.abs(e.colDelta()),r),c.abs(e.rowDelta()),r)}}}),i("2q",["e","g","2c","2m"],function(n,t,e,r){var o=function(t,e){return n.foldl(t,function(t,r){return n.exists(t,function(n){return e(n.element(),r.element())})?t:t.concat([r])},[])};return{merge:function(n,t,o,i){if(0===n.length)return n;for(var u=t.startRow();u<=t.finishRow();u++)for(var a=t.startCol();a<=t.finishCol();a++)r.mutateCell(n[u],a,e.elementnew(i(),!1));return n},unmerge:function(n,t,o,i){for(var u=!0,a=0;a<n.length;a++)for(var c=0;c<r.cellLength(n[0]);c++){var l=o(r.getCellElement(n[a],c),t);!0===l&&!1===u?r.mutateCell(n[a],c,e.elementnew(i(),!0)):!0===l&&(u=!1)}return n},splitRows:function(i,u,a,c){if(u>0&&u<i.length){var l=i[u-1].cells(),f=o(l,a);n.each(f,function(n){for(var o=t.none(),l=u;l<i.length;l++)for(var f=0;f<r.cellLength(i[0]);f++){var s=i[l].cells()[f];a(s.element(),n.element())&&(o.isNone()&&(o=t.some(c())),o.each(function(n){r.mutateCell(i[l],f,e.elementnew(n,!0))}))}})}return i}}}),i("2o",["f","2c","4c","2m","2q"],function(n,t,e,r,o){var i=function(t,e,o,i){var u=r.getCell(t[e],o),a=n.curry(i,u.element()),c=t[e];return t.length>1&&r.cellLength(c)>1&&(o>0&&a(r.getCellElement(c,o-1))||o<c.length-1&&a(r.getCellElement(c,o+1))||e>0&&a(r.getCellElement(t[e-1],o))||e<t.length-1&&a(r.getCellElement(t[e+1],o)))},u=function(n,e,u,a,c){for(var l=n.row(),f=n.column(),s=l+u.length,d=f+r.cellLength(u[0]),m=l;m<s;m++)for(var g=f;g<d;g++){i(e,m,g,c)&&o.unmerge(e,r.getCellElement(e[m],g),c,a.cell);var p=r.getCellElement(u[m-l],g-f),v=a.replace(p);r.mutateCell(e[m],g,t.elementnew(v,!0))}return e};return{merge:function(n,t,r,o,i){return e.measure(n,t,r).map(function(a){var c=e.tailor(t,a,o);return u(n,c,r,o,i)})},insert:function(n,t,r,i,u){o.splitRows(t,n,u,i.cell);var a=e.measureWidth(r,t),c=e.tailor(r,a,i),l=e.measureWidth(t,c),f=e.tailor(t,l,i);return f.slice(0,n).concat(c).concat(f.slice(n,f.length))}}}),i("2r",["e","2c","2m"],function(n,t,e){return{insertRowAt:function(n,r,o,i,u){var a=n.slice(0,r),c=n.slice(r),l=e.mapCells(n[o],function(o,a){return r>0&&r<n.length&&i(e.getCellElement(n[r-1],a),e.getCellElement(n[r],a))?e.getCell(n[r],a):t.elementnew(u(o.element(),i),!0)});return a.concat([l]).concat(c)},insertColumnAt:function(r,o,i,u,a){return n.map(r,function(n){var r=o>0&&o<e.cellLength(n)&&u(e.getCellElement(n,o-1),e.getCellElement(n,o))?e.getCell(n,o):t.elementnew(a(e.getCellElement(n,i),u),!0);return e.addCell(n,o,r)})},splitCellIntoColumns:function(r,o,i,u,a){var c=i+1;return n.map(r,function(n,r){var l=r===o?t.elementnew(a(e.getCellElement(n,i),u),!0):e.getCell(n,i);return e.addCell(n,c,l)})},splitCellIntoRows:function(n,r,o,i,u){var a=r+1,c=n.slice(0,a),l=n.slice(a),f=e.mapCells(n[r],function(n,e){return e===o?t.elementnew(u(n.element(),i),!0):n});return c.concat([f]).concat(l)},deleteRowsAt:function(n,t,e){return n.slice(0,t).concat(n.slice(e+1))},deleteColumnsAt:function(e,r,o){var i=n.map(e,function(n){var e=n.cells().slice(0,r).concat(n.cells().slice(o+1));return t.rowcells(e,n.section())});return n.filter(i,function(n){return n.cells().length>0})}}}),i("2s",["e","2c","2m"],function(n,t,e){var r=function(r,o,i,u){var a=function(t){return n.exists(o,function(n){return i(t.element(),n.element())})};return n.map(r,function(n){return e.mapCells(n,function(n){return a(n)?t.elementnew(u(n.element(),i),!0):n})})},o=function(n,t,r,o){return void 0!==e.getCellElement(n[t],r)&&t>0&&o(e.getCellElement(n[t-1],r),e.getCellElement(n[t],r))},i=function(n,t,r){return t>0&&r(e.getCellElement(n,t-1),e.getCellElement(n,t))};return{replaceColumn:function(t,u,a,c){var l=n.bind(t,function(n,r){return o(t,r,u,a)||i(n,u,a)?[]:[e.getCell(n,u)]});return r(t,l,a,c)},replaceRow:function(t,e,u,a){var c=t[e],l=n.bind(c.cells(),function(n,r){return o(t,e,r,u)||i(c,r,u)?[]:[n]});return r(t,l,u,a)}}}),i("5h",[],function(){var n=function(){return i(function(n){return n()})},t=function(n){return i(function(t,e){return e(n)})},e=function(n,t){return i(function(e,r,o){return o(n,t)})},r=function(n,t,e){return i(function(r,o,i,u){return u(n,t,e)})},o=function(n,t){return i(function(e,r,o,i,u){return u(n,t)})},i=function(n){return{fold:n}};return{none:n,only:t,left:e,middle:r,right:o}}),i("4d",["e","f","5h","3v"],function(n,t,e,r){var o=function(n,t){return 0===n.length?e.none():1===n.length?e.only(0):0===t?e.left(0,1):t===n.length-1?e.right(t-1,t):t>0&&t<n.length-1?e.middle(t-1,t,t+1):e.none()};return{determine:function(e,i,u,a){var c=e.slice(0),l=o(e,i),f=function(e){return n.map(e,t.constant(0))},s=t.constant(f(c)),d=function(n){return a.singleColumnWidth(c[n],u)},m=function(n,t){if(u>=0){var e=r.max(a.minCellWidth(),c[t]-u);return f(c.slice(0,n)).concat([u,e-c[t]]).concat(f(c.slice(t+1)))}var o=r.max(a.minCellWidth(),c[n]+u),i=c[n]-o;return f(c.slice(0,n)).concat([o-c[n],i]).concat(f(c.slice(t+1)))},g=m,p=function(n,t,e){return m(t,e)},v=function(n,t){if(u>=0)return f(c.slice(0,t)).concat([u]);var e=r.max(a.minCellWidth(),c[t]+u);return f(c.slice(0,t)).concat([e-c[t]])};return l.fold(s,d,g,p,v)}}}),i("4h",["f","r","22","2e"],function(n,t,e,r){var o=function(n,e){return t.has(n,e)&&r(t.get(n,e),10)>1},i=function(n,t){return r(e.get(n,t),10)};return{hasColspan:function(n){return o(n,"colspan")},hasRowspan:function(n){return o(n,"rowspan")},minWidth:n.constant(10),minHeight:n.constant(10),getInt:i}}),i("4e",["e","f","5b","2i","4h","5g","22"],function(n,t,e,r,o,i,u){var a=function(n,t,e){return u.getRaw(n,t).fold(function(){return e(n)+"px"},function(n){return n})},c=function(n){return a(n,"width",r.getPixelWidth)},l=function(n){return a(n,"height",r.getHeight)},f=function(r,u,a,c,l){var f=e.columns(r),s=n.map(f,function(n){return n.map(u.edge)});return n.map(f,function(n,e){return n.filter(t.not(o.hasColspan)).fold(function(){var n=i.deduce(s,e);return c(n)},function(n){return a(n,l)})})},s=function(n){return n.map(function(n){return n+"px"}).getOr("")},d=function(r,u,a,c){var l=e.rows(r),f=n.map(l,function(n){return n.map(u.edge)});return n.map(l,function(n,e){return n.filter(t.not(o.hasRowspan)).fold(function(){var n=i.deduce(f,e);return c(n)},function(n){return a(n)})})};return{getRawWidths:function(n,t){return f(n,t,c,s)},getPixelWidths:function(n,t,e){return f(n,t,r.getPixelWidth,function(n){return n.getOrThunk(e.minCellWidth)},e)},getPercentageWidths:function(n,t,e){return f(n,t,r.getPercentageWidth,function(n){return n.fold(function(){return e.minCellWidth()},function(n){return n/e.pixelWidth()*100})},e)},getPixelHeights:function(n,t){return d(n,t,r.getHeight,function(n){return n.getOrThunk(o.minHeight)})},getRawHeights:function(n,t){return d(n,t,l,s)}}}),i("4f",["e","f","1x","2e"],function(n,t,e){var r=function(n,t,e){for(var r=0,o=n;o<t;o++)r+=void 0!==e[o]?e[o]:0;return r};return{recalculateWidth:function(o,i){var u=e.justCells(o);return n.map(u,function(n){var e=r(n.column(),n.column()+n.colspan(),i);return{element:n.element,width:t.constant(e),colspan:n.colspan}})},recalculateHeight:function(o,i){var u=e.justCells(o);return n.map(u,function(n){var e=r(n.row(),n.row()+n.rowspan(),i);return{element:n.element,height:t.constant(e),rowspan:n.rowspan}})},matchRowHeight:function(e,r){return n.map(e.all(),function(n,e){return{element:n.element,height:t.constant(r[e])}})}}}),i("4g",["e","f","4e","2i","4h","44","3v"],function(n,t,e,r,o,i,u){var a=function(n,u){var a=parseFloat(n,10),c=i.get(u),l=function(n){return n/c*100},f=function(n){return[100-n]},s=function(){return o.minWidth()/c*100},d=function(n,t,e){var o=a+e;r.setPercentageWidth(n,o)};return{width:t.constant(a),pixelWidth:t.constant(c),getWidths:e.getPercentageWidths,getCellDelta:l,singleColumnWidth:f,minCellWidth:s,setElementWidth:r.setPercentageWidth,setTableWidth:d}},c=function(i){var a=parseInt(i,10),c=t.identity,l=function(n,t){return[u.max(o.minWidth(),n+t)-n]},f=function(t,e){var o=n.foldr(e,function(n,t){return n+t},0);r.setPixelWidth(t,o)};return{width:t.constant(a),pixelWidth:t.constant(a),getWidths:e.getPixelWidths,getCellDelta:c,singleColumnWidth:l,minCellWidth:o.minWidth,setElementWidth:r.setPixelWidth,setTableWidth:f}},l=function(n,t){if(r.percentageBasedSizeRegex().test(t)){var e=r.percentageBasedSizeRegex().exec(t);return a(e[1],n)}if(r.pixelBasedSizeRegex().test(t)){var o=r.pixelBasedSizeRegex().exec(t);return c(o[1])}var u=i.get(n);return c(u)};return{getTableSize:function(n){return r.getRawWidth(n).fold(function(){var t=i.get(n);return c(t)},function(t){return l(n,t)})}}}),i("2t",["e","4d","1w","1x","4e","4f","2i","4g","4h","3v"],function(n,t,e,r,o,i,u,a,c,l){var f=function(n){return r.generate(n)},s=function(t){return n.foldr(t,function(n,t){return n+t},0)},d=function(n){var t=e.fromTable(n);return f(t)};return{adjustWidth:function(e,r,o,u){var c=a.getTableSize(e),l=c.getCellDelta(r),f=d(e),s=c.getWidths(f,u,c),m=t.determine(s,o,l,c),g=n.map(m,function(n,t){return n+s[t]}),p=i.recalculateWidth(f,g);n.each(p,function(n){c.setElementWidth(n.element(),n.width())}),o===f.grid().columns()-1&&c.setTableWidth(e,g,l)},adjustHeight:function(t,e,r,a){var f=d(t),m=o.getPixelHeights(f,a),g=n.map(m,function(n,t){return r===t?l.max(e+n,c.minHeight()):n}),p=i.recalculateHeight(f,g),v=i.matchRowHeight(f,g);n.each(v,function(n){u.setHeight(n.element(),n.height())}),n.each(p,function(n){u.setHeight(n.element(),n.height())});var h=s(g);u.setHeight(t,h)},adjustWidthTo:function(t,e,r){var o=a.getTableSize(t),u=f(e),c=o.getWidths(u,r,o),l=i.recalculateWidth(u,c);n.each(l,function(n){o.setElementWidth(n.element(),n.width())});var s=n.foldr(c,function(n,t){return t+n},0);l.length>0&&o.setElementWidth(t,s)}}}),i("x",["e","f","g","1k","2k","2c","2l","j","1w","2m","2n","2o","2p","1x","2q","2r","2s","2t","13"],function(n,t,e,r,o,i,u,a,c,l,f,s,d,m,g,p,v,h,b){var w=function(n){0===a.cells(n).length&&b.remove(n)},y=r.immutable("grid","cursor"),x=function(n,t,e){return C(n,t,e).orThunk(function(){return C(n,0,0)})},C=function(n,t,r){return e.from(n[t]).bind(function(n){return e.from(n.cells()[r]).bind(function(n){return e.from(n.element())})})},S=function(n,t,e){return y(n,C(n,t,e))},R=function(t){return n.foldl(t,function(t,e){return n.exists(t,function(n){return n.row()===e.row()})?t:t.concat([e])},[]).sort(function(n,t){return n.row()-t.row()})},T=function(t){return n.foldl(t,function(t,e){return n.exists(t,function(n){return n.column()===e.column()})?t:t.concat([e])},[]).sort(function(n,t){return n.column()-t.column()})},k=function(n,t,e,r){var o=t.row(),i=t.row(),u=p.insertRowAt(n,i,o,e,r.getOrInit);return S(u,i,t.column())},A=function(t,e,r,o){var i=e[0].row(),u=e[0].row(),a=R(e),c=n.foldl(a,function(n){return p.insertRowAt(n,u,i,r,o.getOrInit)},t);return S(c,u,e[0].column())},D=function(n,t,e,r){var o=t.row(),i=t.row()+t.rowspan(),u=p.insertRowAt(n,i,o,e,r.getOrInit);return S(u,i,t.column())},O=function(t,e,r,o){var i=R(e),u=i[i.length-1].row(),a=i[i.length-1].row()+i[i.length-1].rowspan(),c=n.foldl(i,function(n){return p.insertRowAt(n,a,u,r,o.getOrInit)},t);return S(c,a,e[0].column())},N=function(n,t,e,r){var o=t.column(),i=t.column(),u=p.insertColumnAt(n,i,o,e,r.getOrInit);return S(u,t.row(),i)},E=function(t,e,r,o){var i=T(e),u=i[0].column(),a=i[0].column(),c=n.foldl(i,function(n){return p.insertColumnAt(n,a,u,r,o.getOrInit)},t);return S(c,e[0].row(),a)},B=function(n,t,e,r){var o=t.column(),i=t.column()+t.colspan(),u=p.insertColumnAt(n,i,o,e,r.getOrInit);return S(u,t.row(),i)},P=function(t,e,r,o){var i=e[e.length-1].column(),u=e[e.length-1].column()+e[e.length-1].colspan(),a=T(e),c=n.foldl(a,function(n){return p.insertColumnAt(n,u,i,r,o.getOrInit)},t);return S(c,e[0].row(),u)},I=function(n,t,e,r){var o=v.replaceRow(n,t.row(),e,r.replaceOrInit);return S(o,t.row(),t.column())},W=function(n,t,e,r){var o=v.replaceColumn(n,t.column(),e,r.replaceOrInit);return S(o,t.row(),t.column())},q=function(n,t,e,r){var o=v.replaceRow(n,t.row(),e,r.replaceOrInit);return S(o,t.row(),t.column())},z=function(n,t,e,r){var o=v.replaceColumn(n,t.column(),e,r.replaceOrInit);return S(o,t.row(),t.column())},_=function(n,t,e,r){var o=p.splitCellIntoColumns(n,t.row(),t.column(),e,r.getOrInit);return S(o,t.row(),t.column())},L=function(n,t,e,r){var o=p.splitCellIntoRows(n,t.row(),t.column(),e,r.getOrInit);return S(o,t.row(),t.column())},M=function(n,t){var e=T(t),r=p.deleteColumnsAt(n,e[0].column(),e[e.length-1].column()),o=x(r,t[0].row(),t[0].column());return y(r,o)},j=function(n,t){var e=R(t),r=p.deleteRowsAt(n,e[0].row(),e[e.length-1].row()),o=x(r,t[0].row(),t[0].column());return y(r,o)},F=function(n,r,o){var i=r.cells();u.merge(i);var a=g.merge(n,r.bounds(),o,t.constant(i[0]));return y(a,e.from(i[0]))},H=function(t,r,o,i){var u=n.foldr(r,function(n,t){return g.unmerge(n,t,o,i.combine(t))},t);return y(u,e.from(r[0]))},U=function(n,t,r){var o=function(n,t){var e=c.fromTable(n),r=m.generate(e);return d.toGrid(r,t,!0)}(t.clipboard(),t.generators()),u=i.address(t.row(),t.column());return s.merge(u,n,o,t.generators(),r).fold(function(){return y(n,e.some(t.element()))},function(n){var e=x(n,t.row(),t.column());return y(n,e)})},G=function(n,t,e){var r=c.fromPastedRows(n,e),o=m.generate(r);return d.toGrid(o,t,!0)},V=function(n,t,e){var r=n[t.cells[0].row()],o=t.cells[0].row(),i=G(t.clipboard(),t.generators(),r),u=s.insert(o,n,i,t.generators(),e),a=x(u,t.cells[0].row(),t.cells[0].column());return y(u,a)},Y=function(n,t,e){var r=n[t.cells[0].row()],o=t.cells[t.cells.length-1].row()+t.cells[t.cells.length-1].rowspan(),i=G(t.clipboard(),t.generators(),r),u=s.insert(o,n,i,t.generators(),e),a=x(u,t.cells[0].row(),t.cells[0].column());return y(u,a)},X=h.adjustWidthTo;return{insertRowBefore:f.run(k,f.onCell,t.noop,t.noop,o.modification),insertRowsBefore:f.run(A,f.onCells,t.noop,t.noop,o.modification),insertRowAfter:f.run(D,f.onCell,t.noop,t.noop,o.modification),insertRowsAfter:f.run(O,f.onCells,t.noop,t.noop,o.modification),insertColumnBefore:f.run(N,f.onCell,X,t.noop,o.modification),insertColumnsBefore:f.run(E,f.onCells,X,t.noop,o.modification),insertColumnAfter:f.run(B,f.onCell,X,t.noop,o.modification),insertColumnsAfter:f.run(P,f.onCells,X,t.noop,o.modification),splitCellIntoColumns:f.run(_,f.onCell,X,t.noop,o.modification),splitCellIntoRows:f.run(L,f.onCell,t.noop,t.noop,o.modification),eraseColumns:f.run(M,f.onCells,X,w,o.modification),eraseRows:f.run(j,f.onCells,t.noop,w,o.modification),makeColumnHeader:f.run(W,f.onCell,t.noop,t.noop,o.transform("row","th")),unmakeColumnHeader:f.run(z,f.onCell,t.noop,t.noop,o.transform(null,"td")),makeRowHeader:f.run(I,f.onCell,t.noop,t.noop,o.transform("col","th")),unmakeRowHeader:f.run(q,f.onCell,t.noop,t.noop,o.transform(null,"td")),mergeCells:f.run(F,f.onMergable,t.noop,t.noop,o.merging),unmergeCells:f.run(H,f.onUnmergable,X,t.noop,o.merging),pasteCells:f.run(U,f.onPaste,X,t.noop,o.modification),pasteRowsBefore:f.run(V,f.onPasteRows,t.noop,t.noop,o.modification),pasteRowsAfter:f.run(Y,f.onPasteRows,t.noop,t.noop,o.modification)}}),i("z",["1c","l"],function(n,t){var e=function(n){return t.fromDom(n.getBody())};return{getBody:e,getIsRoot:function(t){return function(r){return n.eq(r,e(t))}},addSizeSuffix:function(n){return/^[0-9]+$/.test(n)&&(n+="px"),n},removePxSuffix:function(n){return n?n.replace(/px$/,""):""}}}),i("2u",["22"],function(n){var t=function(n,t){return function(r){return"rtl"===e(r)?t:n}},e=function(t){return"rtl"===n.get(t,"direction")?"rtl":"ltr"};return{onDirection:t,getDirection:e}}),i("10",["f","2u"],function(n,t){var e={isRtl:n.constant(!1)},r={isRtl:n.constant(!0)};return{directionAt:function(n){return"rtl"===t.getDirection(n)?r:e}}}),i("4",["e","f","g","u","v","i","w","x","l","n","r","y","z","10"],function(n,t,e,r,o,i,u,a,c,l,f,s,d,m){return function(g,p){var v,h=function(n){return"table"===l.name(d.getBody(n))},b=function(n){var t=u.getGridSize(n);return!1===h(g)||t.rows()>1},w=function(n){var t=u.getGridSize(n);return!1===h(g)||t.columns()>1},y=function(n){return g.fire("newrow",{node:n.dom()}),n.dom()},x=function(n){return g.fire("newcell",{node:n.dom()}),n.dom()};!1!==g.settings.table_clone_elements&&("string"==typeof g.settings.table_clone_elements?v=g.settings.table_clone_elements.split(/[ ,]/):Array.isArray(g.settings.table_clone_elements)&&(v=g.settings.table_clone_elements));var C=e.from(v),S=function(t,r,u,a){return function(l,d){var p=s.descendants(l,"td[data-mce-style],th[data-mce-style]");n.each(p,function(n){f.remove(n,"data-mce-style")});var v=a(),h=c.fromDom(g.getDoc()),b=o(m.directionAt),w=i.cellOperations(u,h,C);return r(l)?t(v,l,d,w,b).bind(function(t){return n.each(t.newRows(),function(n){y(n)}),n.each(t.newCells(),function(n){x(n)}),t.cursor().map(function(n){var t=g.dom.createRng();return t.setStart(n.dom(),0),t.setEnd(n.dom(),0),t})}):e.none()}};return{deleteRow:S(a.eraseRows,b,t.noop,p),deleteColumn:S(a.eraseColumns,w,t.noop,p),insertRowsBefore:S(a.insertRowsBefore,t.always,t.noop,p),insertRowsAfter:S(a.insertRowsAfter,t.always,t.noop,p),insertColumnsBefore:S(a.insertColumnsBefore,t.always,r.halve,p),insertColumnsAfter:S(a.insertColumnsAfter,t.always,r.halve,p),mergeCells:S(a.mergeCells,t.always,t.noop,p),unmergeCells:S(a.unmergeCells,t.always,t.noop,p),pasteRowsBefore:S(a.pasteRowsBefore,t.always,t.noop,p),pasteRowsAfter:S(a.pasteRowsAfter,t.always,t.noop,p),pasteCells:S(a.pasteCells,t.always,t.noop,p)}}}),i("11",["1w","2n","2p","1x","2v"],function(n,t,e,r,o){return{copyRows:function(i,u,a){var c=n.fromTable(i),l=r.generate(c);return t.onCells(l,u).map(function(n){var r=e.toGrid(l,a,!1).slice(n[0].row(),n[n.length-1].row()+n[n.length-1].rowspan()),i=t.toDetailList(r,a);return o.copy(i)})}}}),i("14",["d"],function(n){return n("tinymce.util.Tools")}),i("2w",["d"],function(n){return n("tinymce.Env")}),i("2x",["14"],function(n){return{applyAlign:function(n,t,e){e&&n.formatter.apply("align"+e,{},t)},applyVAlign:function(n,t,e){e&&n.formatter.apply("valign"+e,{},t)},unApplyAlign:function(t,e){n.each("left center right".split(" "),function(n){t.formatter.remove("align"+n,{},e)})},unApplyVAlign:function(t,e){n.each("top middle bottom".split(" "),function(n){t.formatter.remove("valign"+n,{},e)})},getTDTHOverallStyle:function(n,t,e){var r;return r=function(t,r){for(var o=0;o<r.length;o++){var i=n.getStyle(r[o],e);if(void 0===t&&(t=i),t!=i)return""}return t}(r,n.select("td,th",t))}}}),i("2y",["f","14","z"],function(n,t,e){var r=function(n,t){var r=n.dom,o=t.control.rootControl,i=o.toJSON(),u=r.parseStyle(i.style);"style"===t.control.name()?(o.find("#borderStyle").value(u["border-style"]||"")[0].fire("select"),o.find("#borderColor").value(u["border-color"]||"")[0].fire("change"),o.find("#backgroundColor").value(u["background-color"]||"")[0].fire("change"),o.find("#width").value(u.width||"").fire("change"),o.find("#height").value(u.height||"").fire("change")):(u["border-style"]=i.borderStyle,u["border-color"]=i.borderColor,u["background-color"]=i.backgroundColor,u.width=i.width?e.addSizeSuffix(i.width):"",u.height=i.height?e.addSizeSuffix(i.height):""),o.find("#style").value(r.serializeStyle(r.parseStyle(r.serializeStyle(u))))};return{createStyleForm:function(t){var e=function(){var n=t.settings.color_picker_callback;if(n)return function(e){return n.call(t,function(n){e.control.value(n).fire("change")},e.control.value())}};return{title:"Advanced",type:"form",defaults:{onchange:n.curry(r,t)},items:[{label:"Style",name:"style",type:"textbox"},{type:"form",padding:0,formItemDefaults:{layout:"grid",alignH:["start","right"]},defaults:{size:7},items:[{label:"Border style",type:"listbox",name:"borderStyle",width:90,onselect:n.curry(r,t),values:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]},{label:"Border color",type:"colorbox",name:"borderColor",onaction:e()},{label:"Background color",type:"colorbox",name:"backgroundColor",onaction:e()}]}]}},buildListItems:function(n,e,r){var o=function(n,r){return r=r||[],t.each(n,function(n){var t={text:n.text||n.title};n.menu?t.menu=o(n.menu):(t.value=n.value,e&&e(t)),r.push(t)}),r};return o(n,r||[])},updateStyleField:r,extractAdvancedStyles:function(n,t){var e=n.parseStyle(n.getAttrib(t,"style")),r={};return e["border-style"]&&(r.borderStyle=e["border-style"]),e["border-color"]&&(r.borderColor=e["border-color"]),e["background-color"]&&(r.backgroundColor=e["background-color"]),r.style=n.serializeStyle(e),r}}}),i("15",["f","2w","14","3","2x","z","2y"],function(n,t,e,r,o,i,u){function a(n,t,e,r){if("TD"===t.tagName||"TH"===t.tagName)n.setStyle(t,e,r);else if(t.children)for(var o=0;o<t.children.length;o++)a(n,t.children[o],e,r)}var c=function(n,t){var r=n.dom,i={width:r.getStyle(t,"width")||r.getAttrib(t,"width"),height:r.getStyle(t,"height")||r.getAttrib(t,"height"),cellspacing:r.getStyle(t,"border-spacing")||r.getAttrib(t,"cellspacing"),cellpadding:r.getAttrib(t,"data-mce-cell-padding")||r.getAttrib(t,"cellpadding")||o.getTDTHOverallStyle(n.dom,t,"padding"),border:r.getAttrib(t,"data-mce-border")||r.getAttrib(t,"border")||o.getTDTHOverallStyle(n.dom,t,"border"),borderColor:r.getAttrib(t,"data-mce-border-color"),caption:!!r.select("caption",t)[0],"class":r.getAttrib(t,"class")};return e.each("left center right".split(" "),function(e){n.formatter.matchNode(t,"align"+e)&&(i.align=e)}),!1!==n.settings.table_advtab&&e.extend(i,u.extractAdvancedStyles(r,t)),i},l=function(n,t,r){var o=n.dom,u={},c={};if(u["class"]=r["class"],c.height=i.addSizeSuffix(r.height),o.getAttrib(t,"width")&&!n.settings.table_style_by_css?u.width=i.removePxSuffix(r.width):c.width=i.addSizeSuffix(r.width),n.settings.table_style_by_css?(c["border-width"]=i.addSizeSuffix(r.border),c["border-spacing"]=i.addSizeSuffix(r.cellspacing),e.extend(u,{"data-mce-border-color":r.borderColor,"data-mce-cell-padding":r.cellpadding,"data-mce-border":r.border})):e.extend(u,{border:r.border,cellpadding:r.cellpadding,cellspacing:r.cellspacing}),n.settings.table_style_by_css&&t.children)for(var l=0;l<t.children.length;l++)a(o,t.children[l],{"border-width":i.addSizeSuffix(r.border),"border-color":r.borderColor,padding:i.addSizeSuffix(r.cellpadding)});r.style?e.extend(c,o.parseStyle(r.style)):c=e.extend({},o.parseStyle(o.getAttrib(t,"style")),c),u.style=o.serializeStyle(c),o.setAttribs(t,u)},f=function(n,e,i){var a,c,f=n.dom;u.updateStyleField(n,i),!1===(c=i.control.rootControl.toJSON())["class"]&&delete c["class"],n.undoManager.transact(function(){e||(e=r.insert(n,c.cols||1,c.rows||1)),l(n,e,c),(a=f.select("caption",e)[0])&&!c.caption&&f.remove(a),!a&&c.caption&&(a=f.create("caption"),a.innerHTML=t.ie?"\xa0":'<br data-mce-bogus="1"/>',e.insertBefore(a,e.firstChild)),o.unApplyAlign(n,e),c.align&&o.applyAlign(n,e,c.align),n.focus(),n.addVisual()})};return{open:function(t,e){var r,o,i,a,l,s=t.dom,d={};!0===e?(r=s.getParent(t.selection.getStart(),"table"))&&(d=c(t,r)):(o={label:"Cols",name:"cols"},i={label:"Rows",name:"rows"}),t.settings.table_class_list&&(d["class"]&&(d["class"]=d["class"].replace(/\s*mce\-item\-table\s*/g,"")),a={name:"class",type:"listbox",label:"Class",values:u.buildListItems(t.settings.table_class_list,function(n){n.value&&(n.textStyle=function(){return t.formatter.getCssText({block:"table",classes:[n.value]})})})}),l={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",labelGapCalc:!1,padding:0,layout:"grid",columns:2,defaults:{type:"textbox",maxWidth:50},items:!1!==t.settings.table_appearance_options?[o,i,{label:"Width",name:"width",onchange:n.curry(u.updateStyleField,t)},{label:"Height",name:"height",onchange:n.curry(u.updateStyleField,t)},{label:"Cell spacing",name:"cellspacing"},{label:"Cell padding",name:"cellpadding"},{label:"Border",name:"border"},{label:"Caption",name:"caption",type:"checkbox"}]:[o,i,{label:"Width",name:"width",onchange:n.curry(u.updateStyleField,t)},{label:"Height",name:"height",onchange:n.curry(u.updateStyleField,t)}]},{label:"Alignment",name:"align",type:"listbox",text:"None",values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},a]},!1!==t.settings.table_advtab?t.windowManager.open({title:"Table properties",data:d,bodyType:"tabpanel",body:[{title:"General",type:"form",items:l},u.createStyleForm(t)],onsubmit:n.curry(f,t,r)}):t.windowManager.open({title:"Table properties",data:d,body:l,onsubmit:n.curry(f,t,r)})}}}),i("16",["f","14","2x","z","2y"],function(n,t,e,r,o){function i(n,i,u){function c(n,t,e){e&&s.setAttrib(n,t,e)}function l(n,t,e){e&&s.setStyle(n,t,e)}var f,s=n.dom;o.updateStyleField(n,u),f=u.control.rootControl.toJSON(),n.undoManager.transact(function(){t.each(i,function(t){c(t,"scope",f.scope),c(t,"style",f.style),c(t,"class",f["class"]),l(t,"height",r.addSizeSuffix(f.height)),f.type!==t.parentNode.nodeName.toLowerCase()&&a(n.dom,t,f.type),1===i.length&&e.unApplyAlign(n,t),f.align&&e.applyAlign(n,t,f.align)}),n.focus()})}var u=function(n,e){var r=n.dom,i={height:r.getStyle(e,"height")||r.getAttrib(e,"height"),scope:r.getAttrib(e,"scope"),"class":r.getAttrib(e,"class")};return i.type=e.parentNode.nodeName.toLowerCase(),t.each("left center right".split(" "),function(t){n.formatter.matchNode(e,"align"+t)&&(i.align=t)}),!1!==n.settings.table_row_advtab&&t.extend(i,o.extractAdvancedStyles(r,e)),i},a=function(n,t,e){var r=n.getParent(t,"table"),o=t.parentNode,i=n.select(e,r)[0];i||(i=n.create(e),r.firstChild?"CAPTION"===r.firstChild.nodeName?n.insertAfter(i,r.firstChild):r.insertBefore(i,r.firstChild):r.appendChild(i)),i.appendChild(t),o.hasChildNodes()||n.remove(o)};return{open:function(e){var r,a,c,l,f,s,d=e.dom,m=[];r=e.dom.getParent(e.selection.getStart(),"table"),
  a=e.dom.getParent(e.selection.getStart(),"td,th"),t.each(r.rows,function(n){t.each(n.cells,function(t){if(d.getAttrib(t,"data-mce-selected")||t==a)return m.push(n),!1})}),(c=m[0])&&(f=m.length>1?{height:"",scope:"","class":"",align:"",type:c.parentNode.nodeName.toLowerCase()}:u(e,c),e.settings.table_row_class_list&&(l={name:"class",type:"listbox",label:"Class",values:o.buildListItems(e.settings.table_row_class_list,function(n){n.value&&(n.textStyle=function(){return e.formatter.getCssText({block:"tr",classes:[n.value]})})})}),s={type:"form",columns:2,padding:0,defaults:{type:"textbox"},items:[{type:"listbox",name:"type",label:"Row type",text:"Header",maxWidth:null,values:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"listbox",name:"align",label:"Alignment",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height"},l]},!1!==e.settings.table_row_advtab?e.windowManager.open({title:"Row properties",data:f,bodyType:"tabpanel",body:[{title:"General",type:"form",items:s},o.createStyleForm(d)],onsubmit:n.curry(i,e,m)}):e.windowManager.open({title:"Row properties",data:f,body:s,onsubmit:n.curry(i,e,m)}))}}}),i("17",["f","14","2x","z","2y"],function(n,t,e,r,o){var i=function(n,t){n.style.cssText+=";"+t},u=function(n,e){var r=n.dom,i={width:r.getStyle(e,"width")||r.getAttrib(e,"width"),height:r.getStyle(e,"height")||r.getAttrib(e,"height"),scope:r.getAttrib(e,"scope"),"class":r.getAttrib(e,"class")};return i.type=e.nodeName.toLowerCase(),t.each("left center right".split(" "),function(t){n.formatter.matchNode(e,"align"+t)&&(i.align=t)}),t.each("top middle bottom".split(" "),function(t){n.formatter.matchNode(e,"valign"+t)&&(i.valign=t)}),!1!==n.settings.table_cell_advtab&&t.extend(i,o.extractAdvancedStyles(r,e)),i},a=function(n,u,a){function c(n,t,e){e&&s.setAttrib(n,t,e)}function l(n,t,e){e&&s.setStyle(n,t,e)}var f,s=n.dom;o.updateStyleField(n,a),f=a.control.rootControl.toJSON(),n.undoManager.transact(function(){t.each(u,function(t){c(t,"scope",f.scope),1===u.length?c(t,"style",f.style):i(t,f.style),c(t,"class",f["class"]),l(t,"width",r.addSizeSuffix(f.width)),l(t,"height",r.addSizeSuffix(f.height)),f.type&&t.nodeName.toLowerCase()!==f.type&&(t=s.rename(t,f.type)),1===u.length&&(e.unApplyAlign(n,t),e.unApplyVAlign(n,t)),f.align&&e.applyAlign(n,t,f.align),f.valign&&e.applyVAlign(n,t,f.valign)}),n.focus()})};return{open:function(t){var e,r,i,c=[];if(c=t.dom.select("td[data-mce-selected],th[data-mce-selected]"),e=t.dom.getParent(t.selection.getStart(),"td,th"),!c.length&&e&&c.push(e),e=e||c[0]){r=c.length>1?{width:"",height:"",scope:"","class":"",align:"",style:"",type:e.nodeName.toLowerCase()}:u(t,e),t.settings.table_cell_class_list&&(i={name:"class",type:"listbox",label:"Class",values:o.buildListItems(t.settings.table_cell_class_list,function(n){n.value&&(n.textStyle=function(){return t.formatter.getCssText({block:"td",classes:[n.value]})})})});var l={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",layout:"grid",columns:2,labelGapCalc:!1,padding:0,defaults:{type:"textbox",maxWidth:50},items:[{label:"Width",name:"width",onchange:n.curry(o.updateStyleField,t)},{label:"Height",name:"height",onchange:n.curry(o.updateStyleField,t)},{label:"Cell type",name:"type",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{label:"Scope",name:"scope",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{label:"H Align",name:"align",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"V Align",name:"valign",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}]},i]};!1!==t.settings.table_cell_advtab?t.windowManager.open({title:"Cell properties",bodyType:"tabpanel",data:r,body:[{title:"General",type:"form",items:l},o.createStyleForm(t)],onsubmit:n.curry(a,t,c)}):t.windowManager.open({title:"Cell properties",data:r,body:l,onsubmit:n.curry(a,t,c)})}}}}),i("5",["e","f","g","11","i","j","12","13","k","l","14","z","o","15","16","17"],function(n,t,e,r,o,i,u,a,c,l,f,s,d,m,g,p){var v=f.each,h=e.none();return{registerCommands:function(f,b,w,y){var x=s.getIsRoot(f),C=function(){return l.fromDom(f.dom.getParent(f.selection.getStart(),"th,td"))},S=function(n){return i.table(n,x)},R=function(n){var t=C();S(t).each(function(e){var r=d.forMenu(y,e,t);n(e,r).each(function(n){f.selection.setRng(n),f.focus(),w.clear(e)})})},T=function(){var n=C();return S(n).bind(function(i){var u=l.fromDom(f.getDoc()),a=d.forMenu(y,i,n),c=o.cellOperations(t.noop,u,e.none());return r.copyRows(i,a,c)})},k=function(t){h.each(function(e){var r=n.map(e,function(n){return c.deep(n)}),i=C();S(i).bind(function(n){var e=l.fromDom(f.getDoc()),u=o.paste(e),a=d.pasteRows(y,n,i,r,u);t(n,a).each(function(t){f.selection.setRng(t),f.focus(),w.clear(n)})})})};v({mceTableSplitCells:function(){R(b.unmergeCells)},mceTableMergeCells:function(){R(b.mergeCells)},mceTableInsertRowBefore:function(){R(b.insertRowsBefore)},mceTableInsertRowAfter:function(){R(b.insertRowsAfter)},mceTableInsertColBefore:function(){R(b.insertColumnsBefore)},mceTableInsertColAfter:function(){R(b.insertColumnsAfter)},mceTableDeleteCol:function(){R(b.deleteColumn)},mceTableDeleteRow:function(){R(b.deleteRow)},mceTableCutRow:function(){h=T(),R(b.deleteRow)},mceTableCopyRow:function(){h=T()},mceTablePasteRowBefore:function(){k(b.pasteRowsBefore)},mceTablePasteRowAfter:function(){k(b.pasteRowsAfter)},mceTableDelete:function(){var n=l.fromDom(f.dom.getParent(f.selection.getStart(),"th,td"));i.table(n,x).filter(t.not(x)).each(function(n){var t=l.fromText("");u.after(n,t),a.remove(n);var e=f.dom.createRng();e.setStart(t.dom(),0),e.setEnd(t.dom(),0),f.selection.setRng(e)})}},function(n,t){f.addCommand(t,n)}),v({mceInsertTable:t.curry(m.open,f),mceTableProps:t.curry(m.open,f,!0),mceTableRowProps:t.curry(g.open,f),mceTableCellProps:t.curry(p.open,f)},function(n,t){f.addCommand(t,function(t,e){n(e)})})},getClipboardRows:function(){return h.fold(function(){},function(t){return n.map(t,function(n){return n.dom()})})},setClipboardRows:function(t){var r=n.map(t,l.fromDom);h=e.from(r)}}}),i("18",["f","g","l","2z","30"],function(n,t,e,r,o){return{only:function(r){var i=t.from(r.dom().documentElement).map(e.fromDom).getOr(r);return{parent:n.constant(i),view:n.constant(r),origin:n.constant(o(0,0))}},detached:function(t,e){var o=n.curry(r.absolute,e);return{parent:n.constant(e),view:n.constant(t),origin:o}},body:function(t,e){return{parent:n.constant(e),view:n.constant(t),origin:n.constant(o(0,0))}}}}),i("31",["e","1k"],function(n,t){return function(e){var r=t.immutable.apply(null,e),o=[];return{bind:function(n){if(void 0===n)throw"Event bind error: undefined handler";o.push(n)},unbind:function(t){o=n.filter(o,function(n){return n!==t})},trigger:function(){var t=r.apply(null,arguments);n.each(o,function(n){n(t)})}}}}),i("32",["1t"],function(n){return{create:function(t){return{registry:n.map(t,function(n){return{bind:n.bind,unbind:n.unbind}}),trigger:n.map(t,function(n){return n.trigger})}}}}),i("5z",["47"],function(n){return{mode:n.exactly(["compare","extract","mutate","sink"]),sink:n.exactly(["element","start","stop","destroy"]),api:n.exactly(["forceDrop","drop","move","delayDrop"])}}),i("68",["5d"],function(n){return{resolve:n.css("ephox-dragster").resolve}}),i("60",["68","49","3n","22","l","13"],function(n,t,e,r,o,i){return function(u){var a=t.merge({layerClass:n.resolve("blocker")},u),c=o.fromTag("div");r.setAll(c,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),e.add(c,n.resolve("blocker")),e.add(c,a.layerClass);return{element:function(){return c},destroy:function(){i.remove(c)}}}}),i("5l",["f","l"],function(n,t){var e=function(t,e,r,o,i,u,a){return{target:n.constant(t),x:n.constant(e),y:n.constant(r),stop:o,prevent:i,kill:u,raw:n.constant(a)}},r=function(r,o){return function(i){if(r(i)){var u=t.fromDom(i.target),a=function(){i.stopPropagation()},c=function(){i.preventDefault()},l=n.compose(c,a),f=e(u,i.clientX,i.clientY,a,c,l,i);o(f)}}},o=function(t,e,o,u,a){var c=r(o,u);return t.dom().addEventListener(e,c,a),{unbind:n.curry(i,t,e,c,a)}},i=function(n,t,e,r){n.dom().removeEventListener(t,e,r)};return{bind:function(n,t,e,r){return o(n,t,e,r,!1)},capture:function(n,t,e,r){return o(n,t,e,r,!0)}}}),i("4l",["f","5l"],function(n,t){var e=n.constant(!0);return{bind:function(n,r,o){return t.bind(n,r,e,o)},capture:function(n,r,o){return t.capture(n,r,e,o)}}}),i("5i",["5z","60","g","30","4l","12","13"],function(n,t,e,r,o,i,u){var a=function(n,t){return r(t.left()-n.left(),t.top()-n.top())},c=function(n){return e.some(r(n.x(),n.y()))},l=function(n,t){n.mutate(t.left(),t.top())},f=function(e,r){var a=t(r),c=o.bind(a.element(),"mousedown",e.forceDrop),l=o.bind(a.element(),"mouseup",e.drop),f=o.bind(a.element(),"mousemove",e.move),s=o.bind(a.element(),"mouseout",e.delayDrop),d=function(){a.destroy(),l.unbind(),f.unbind(),s.unbind(),c.unbind()},m=function(n){i.append(n,a.element())},g=function(){u.remove(a.element())};return n.sink({element:a.element,start:m,stop:g,destroy:d})};return n.mode({compare:a,extract:c,sink:f,mutate:l})}),i("69",["g","31","32"],function(n,t,e){return function(){var r=n.none(),o=function(){r=n.none()},i=function(t,e){var o=r.map(function(n){return t.compare(n,e)});return r=n.some(e),o},u=function(n,t){t.extract(n).each(function(n){i(t,n).each(function(n){a.trigger.move(n)})})},a=e.create({move:t(["info"])});return{onEvent:u,reset:o,events:a.registry}}}),i("6a",["f"],function(n){return function(){return{onEvent:function(){},reset:n.noop}}}),i("61",["69","6a"],function(n,t){return function(){var e=t(),r=n(),o=e;return{on:function(){o.reset(),o=r},off:function(){o.reset(),o=e},isOn:function(){return o===r},onEvent:function(n,t){o.onEvent(n,t)},events:r.events}}}),u("6b",clearTimeout),u("6c",setTimeout),i("62",["6b","6c"],function(n,t){return{adaptable:function(e,r){var o=null,i=null;return{cancel:function(){null!==o&&(n(o),o=null,i=null)},throttle:function(){i=arguments,null===o&&(o=t(function(){e.apply(null,i),o=null,i=null},r))}}},first:function(e,r){var o=null;return{cancel:function(){null!==o&&(n(o),o=null)},throttle:function(){var n=arguments;null===o&&(o=t(function(){e.apply(null,n),o=null,n=null},r))}}},last:function(e,r){var o=null;return{cancel:function(){null!==o&&(n(o),o=null)},throttle:function(){var i=arguments;null!==o&&n(o),o=t(function(){e.apply(null,i),o=null,i=null},r)}}}}}),i("5j",["5z","61","62","31","32","1p"],function(n,t,e,r,o,i){return{setup:function(u,a,c){var l=!1,f=o.create({start:r([]),stop:r([])}),s=t(),d=function(){w.stop(),s.isOn()&&(s.off(),f.trigger.stop())},m=e.last(d,200),g=function(n){w.start(n),s.on(),f.trigger.start()},p=function(n){m.cancel(),s.onEvent(n,a)};s.events.move.bind(function(n){a.mutate(u,n.info())});var v=function(){l=!0},h=function(){l=!1},b=function(n){return function(){var t=i.prototype.slice.call(arguments,0);if(l)return n.apply(null,t)}},w=a.sink(n.api({forceDrop:d,drop:b(d),move:b(p),delayDrop:b(m.throttle)}),c),y=function(){w.destroy()};return{element:w.element,go:g,on:v,off:h,destroy:y,events:f.registry}}}}),i("4i",["5i","5j","1p"],function(n,t){return{transform:function(e,r){var o=void 0!==r?r:{},i=void 0!==o.mode?o.mode:n;return t.setup(e,i,r)}}}),i("5k",["31","32"],function(n,t){return function(){var e=t.create({drag:n(["xDelta","yDelta"])});return{mutate:function(n,t){e.trigger.drag(n,t)},events:e.registry}}}),i("4j",["g","31","32","5k"],function(n,t,e,r){return function(){var o=e.create({drag:t(["xDelta","yDelta","target"])}),i=n.none(),u=r();u.events.drag.bind(function(n){i.each(function(t){o.trigger.drag(n.xDelta(),n.yDelta(),t)})});return{assign:function(t){i=n.some(t)},get:function(){return i},mutate:u.mutate,events:o.registry}}}),i("4o",["t"],function(n){return{any:function(t){return n.first(t).isSome()},ancestor:function(t,e,r){return n.ancestor(t,e,r).isSome()},sibling:function(t,e){return n.sibling(t,e).isSome()},child:function(t,e){return n.child(t,e).isSome()},descendant:function(t,e){return n.descendant(t,e).isSome()},closest:function(t,e,r){return n.closest(t,e,r).isSome()}}}),i("33",["4i","f","g","31","32","4j","4b","4k","4h","1c","4l","35","n","r","3n","22","4o","t","2e"],function(n,t,e,r,o,i,u,a,c,l,f,s,d,m,g,p,v,h,b){var w=a.resolve("resizer-bar-dragging");return function(a,y,x){var C=i(),S=n.transform(C,{}),R=e.none(),T=function(n,t){return e.from(m.get(n,t))};C.events.drag.bind(function(n){T(n.target(),"data-row").each(function(){var t=c.getInt(n.target(),"top");p.set(n.target(),"top",t+n.yDelta()+"px")}),T(n.target(),"data-column").each(function(){var t=c.getInt(n.target(),"left");p.set(n.target(),"left",t+n.xDelta()+"px")})});var k=function(n,t){return c.getInt(n,t)-b(m.get(n,"data-initial-"+t),10)};S.events.stop.bind(function(){C.get().each(function(n){R.each(function(t){T(n,"data-row").each(function(e){var r=k(n,"top");m.remove(n,"data-initial-top"),P.trigger.adjustHeight(t,r,b(e,10))}),T(n,"data-column").each(function(e){var r=k(n,"left");m.remove(n,"data-initial-left"),P.trigger.adjustWidth(t,r,b(e,10))}),u.refresh(a,t,x,y)})})});var A=function(n,t){P.trigger.startAdjust(),C.assign(n),m.set(n,"data-initial-"+t,b(p.get(n,t),10)),g.add(n,w),p.set(n,"opacity","0.2"),S.go(a.parent())},D=f.bind(a.parent(),"mousedown",function(n){u.isRowBar(n.target())&&A(n.target(),"top"),u.isColBar(n.target())&&A(n.target(),"left")}),O=function(n){return l.eq(n,a.view())},N=f.bind(a.view(),"mouseover",function(n){"table"===d.name(n.target())||v.ancestor(n.target(),"table",O)?(R="table"===d.name(n.target())?e.some(n.target()):h.ancestor(n.target(),"table",O)).each(function(n){u.refresh(a,n,x,y)}):s.inBody(n.target())&&u.destroy(a)}),E=function(){D.unbind(),N.unbind(),S.destroy(),u.destroy(a)},B=function(n){u.refresh(a,n,x,y)},P=o.create({adjustHeight:r(["table","delta","row"]),adjustWidth:r(["table","delta","column"]),startAdjust:r([])});return{destroy:E,refresh:B,on:S.on,off:S.off,hideBars:t.curry(u.hide,a),showBars:t.curry(u.show,a),events:P.registry}}}),i("19",["31","32","2t","33","34"],function(n,t,e,r,o){return function(i,u){var a=o.height,c=r(i,u,a),l=t.create({beforeResize:n(["table"]),afterResize:n(["table"]),startDrag:n([])});return c.events.adjustHeight.bind(function(n){l.trigger.beforeResize(n.table());var t=a.delta(n.delta(),n.table());e.adjustHeight(n.table(),t,n.row(),a),l.trigger.afterResize(n.table())}),c.events.startAdjust.bind(function(){l.trigger.startDrag()}),c.events.adjustWidth.bind(function(n){l.trigger.beforeResize(n.table());var t=u.delta(n.delta(),n.table());e.adjustWidth(n.table(),t,n.column(),u),l.trigger.afterResize(n.table())}),{on:c.on,off:c.off,hideBars:c.hideBars,showBars:c.showBars,destroy:c.destroy,events:l.registry}}}),i("1a",["18","12","13","35","l","22","z"],function(n,t,e,r,o,i,u){var a=function(){var n=o.fromTag("div");return i.setAll(n,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),t.append(r.body(),n),n};return{get:function(t){return t.inline?n.body(u.getBody(t),a()):n.only(o.fromDom(t.getDoc()))},remove:function(n,t){n.inline&&e.remove(t.parent())}}}),i("6",["e","g","18","v","19","l","r","y","1a","10","14"],function(n,t,e,r,o,i,u,a,c,l,f){return function(s){var d,m,g=t.none(),p=t.none(),v=t.none(),h=/(\d+(\.\d+)?)%/,b=function(n){return"TABLE"===n.nodeName},w=function(n){return s.dom.getStyle(n,"width")||s.dom.getAttrib(n,"width")},y=function(){return p},x=function(){return v.getOr(e.only(i.fromDom(s.getBody())))},C=function(){p.each(function(n){n.destroy()}),v.each(function(n){c.remove(s,n)})};return s.on("init",function(){var e=r(l.directionAt),i=c.get(s);if(v=t.some(i),s.settings.object_resizing&&!1!==s.settings.table_resize_bars&&(!0===s.settings.object_resizing||"table"===s.settings.object_resizing)){var f=o(i,e);f.on(),f.events.startDrag.bind(function(){g=t.some(s.selection.getRng())}),f.events.afterResize.bind(function(t){var e=t.table(),r=a.descendants(e,"td[data-mce-style],th[data-mce-style]");n.each(r,function(n){u.remove(n,"data-mce-style")}),g.each(function(n){s.selection.setRng(n),s.focus()}),s.undoManager.add()}),p=t.some(f)}}),s.on("ObjectResizeStart",function(n){b(n.target)&&(d=n.width,m=w(n.target))}),s.on("ObjectResized",function(n){if(b(n.target)){var t=n.target;if(h.test(m)){var e=parseFloat(h.exec(m)[1],10),r=n.width*e/d;s.dom.setStyle(t,"width",r+"%")}else{var o=[];f.each(t.rows,function(n){f.each(n.cells,function(n){var t=s.dom.getStyle(n,"width",!0);o.push({cell:n,width:t})})}),f.each(o,function(n){s.dom.setStyle(n.cell,"width",n.width),s.dom.setAttrib(n.cell,"width",null)})}}}),{lazyResize:y,lazyWire:x,destroy:C}}}),i("36",[],function(){var n=function(n){return o(function(t){return t(n)})},t=function(n){return o(function(t,e){return e(n)})},e=function(n,t){return o(function(e,r,o){return o(n,t)})},r=function(n){return o(function(t,e,r,o){return o(n)})},o=function(n){return{fold:n}};return{none:n,first:t,middle:e,last:r}}),i("1b",["e","f","36","j","1c"],function(n,t,e,r,o){var i=function(e,i){return r.table(e,i).bind(function(i){var u=r.cells(i);return n.findIndex(u,function(n){return o.eq(e,n)}).map(function(n){return{index:t.constant(n),all:t.constant(u)}})})};return{next:function(n,t){return i(n,t).fold(function(){return e.none(n)},function(t){return t.index()+1<t.all().length?e.middle(n,t.all()[t.index()+1]):e.last(n)})},prev:function(n,t){return i(n,t).fold(function(){return e.none()},function(t){return t.index()-1>=0?e.middle(n,t.all()[t.index()-1]):e.first(n)})}}}),i("37",["2g","f"],function(n,t){var e=n.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),r=function(n,t,e,r){return n.fold(t,e,r)},o=function(n){return n.fold(t.identity,t.identity,t.identity)};return{before:e.before,on:e.on,after:e.after,cata:r,getStart:o}}),i("1e",["2g","1k","l","1m","37"],function(n,t,e,r,o){var i=n.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),u=t.immutable("start","soffset","finish","foffset"),a=function(n){return i.exact(n.start(),n.soffset(),n.finish(),n.foffset())},c=function(n){return n.match({domRange:function(n){return e.fromDom(n.startContainer)},relative:function(n){return o.getStart(n)},exact:function(n){return n}})},l=function(n){var t=c(n);return r.defaultView(t)};return{domRange:i.domRange,relative:i.relative,exact:i.exact,exactFromRange:a,range:u,getWin:l}}),i("38",["1c","l","1m"],function(n,t,e){var r=function(n,t,r,o){var i=e.owner(n).dom().createRange();return i.setStart(n.dom(),t),i.setEnd(r.dom(),o),i};return{after:function(t,e,o,i){var u=r(t,e,o,i),a=n.eq(t,o)&&e===i;return u.collapsed&&!a},commonAncestorContainer:function(n,e,o,i){var u=r(n,e,o,i);return t.fromDom(u.commonAncestorContainer)}}}),i("39",["e","l","23"],function(n,t,e){return{fromElements:function(r,o){var i=(o||e).createDocumentFragment();return n.each(r,function(n){i.appendChild(n.dom())}),t.fromDom(i)}}}),i("3a",["f","g","1c","l"],function(n,t,e,r){var o=function(n,t){var e=n.document.createRange();return i(e,t),e},i=function(n,t){n.selectNodeContents(t.dom())},u=function(n,t){t.fold(function(t){n.setStartBefore(t.dom())},function(t,e){n.setStart(t.dom(),e)},function(t){n.setStartAfter(t.dom())})},a=function(n,t){t.fold(function(t){n.setEndBefore(t.dom())},function(t,e){n.setEnd(t.dom(),e)},function(t){n.setEndAfter(t.dom())})},c=function(n,t){l(n),n.insertNode(t.dom())},l=function(n){n.deleteContents()},f=function(t){return{left:n.constant(t.left),top:n.constant(t.top),right:n.constant(t.right),bottom:n.constant(t.bottom),width:n.constant(t.width),height:n.constant(t.height)}};return{create:function(n){return n.document.createRange()},replaceWith:c,selectNodeContents:o,selectNodeContentsUsing:i,isCollapsed:function(n,t,r,o){return e.eq(n,r)&&t===o},relativeToNative:function(n,t,e){var r=n.document.createRange();return u(r,t),a(r,e),r},exactToNative:function(n,t,e,r,o){var i=n.document.createRange();return i.setStart(t.dom(),e),i.setEnd(r.dom(),o),i},deleteContents:l,cloneFragment:function(n){var t=n.cloneContents();return r.fromDom(t)},getFirstRect:function(n){var e=n.getClientRects(),r=e.length>0?e[0]:n.getBoundingClientRect();return r.width>0||r.height>0?t.some(r).map(f):t.none()},getBounds:function(n){var e=n.getBoundingClientRect();return e.width>0||e.height>0?t.some(e).map(f):t.none()},isWithin:function(n,t){return t.compareBoundaryPoints(n.END_TO_START,n)<1&&t.compareBoundaryPoints(n.START_TO_END,n)>-1},toString:function(n){return n.toString()}}}),i("1n",["2g","f","g","3b","l","3a"],function(n,t,e,r,o,i){var u=n.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),a=function(n,t,e){return t(o.fromDom(e.startContainer),e.startOffset,o.fromDom(e.endContainer),e.endOffset)},c=function(n,o){return o.match({domRange:function(n){return{ltr:t.constant(n),rtl:e.none}},relative:function(t,o){return{ltr:r.cached(function(){return i.relativeToNative(n,t,o)}),rtl:r.cached(function(){return e.some(i.relativeToNative(n,o,t))})}},exact:function(t,o,u,a){return{ltr:r.cached(function(){return i.exactToNative(n,t,o,u,a)}),rtl:r.cached(function(){return e.some(i.exactToNative(n,u,a,t,o))})}}})},l=function(n,t){var e=t.ltr();if(e.collapsed){return t.rtl().filter(function(n){return!1===n.collapsed}).map(function(n){return u.rtl(o.fromDom(n.endContainer),n.endOffset,o.fromDom(n.startContainer),n.startOffset)}).getOrThunk(function(){return a(n,u.ltr,e)})}return a(n,u.ltr,e)},f=function(n,t){var e=c(n,t);return l(n,e)},s=function(n,t){return f(n,t).match({ltr:function(t,e,r,o){var i=n.document.createRange();return i.setStart(t.dom(),e),i.setEnd(r.dom(),o),i},rtl:function(t,e,r,o){var i=n.document.createRange();return i.setStart(r.dom(),o),i.setEnd(t.dom(),e),i}})};return{ltr:u.ltr,rtl:u.rtl,diagnose:f,asLtrRange:s}}),i("5m",["3v"],function(n){return{inRect:function(n,t,e){return t>=n.left&&t<=n.right&&e>=n.top&&e<=n.bottom},searchForPoint:function(t,e,r,o,i){if(0===i)return 0;if(e===o)return i-1;for(var u=o,a=1;a<i;a++){var c=t(a),l=n.abs(e-c.left);if(r>c.bottom);else{if(r<c.top||l>u)return a-1;u=l}}return 0}}}),i("5n",["g","3m","1l","5m","3v"],function(n,t,e,r){var o=function(n,t,o,i,u){var a=function(e){var r=n.dom().createRange();return r.setStart(t.dom(),e),r.collapse(!0),r},c=function(n){return a(n).getBoundingClientRect()},l=e.get(t).length,f=r.searchForPoint(c,o,i,u.right,l);return a(f)};return{locate:function(e,i,u,a){var c=e.dom().createRange();c.selectNode(i.dom());var l=c.getClientRects();return t.findMap(l,function(t){return r.inRect(t,u,a)?n.some(t):n.none()}).map(function(n){return o(e,i,u,a,n)})}}}),i("4p",["g","3m","n","1m","5m","5n","3v"],function(n,t,e,r,o,i,u){var a=function(e,i,u,a){var l=e.dom().createRange(),f=r.children(i);return t.findMap(f,function(t){return l.selectNode(t.dom()),o.inRect(l.getBoundingClientRect(),u,a)?c(e,t,u,a):n.none()})},c=function(n,t,r,o){return(e.isText(t)?i.locate:a)(n,t,r,o)};return{locate:function(n,t,e,r){var o=n.dom().createRange();o.selectNode(t.dom());var i=o.getBoundingClientRect(),a=u.max(i.left,u.min(i.right,e)),l=u.max(i.top,u.min(i.bottom,r));return c(n,t,a,l)}}}),i("4q",["g","1m","1d"],function(n,t,e){var r=!0,o=!1,i=function(n,t){return t-n.left<n.right-t?r:o},u=function(n,t,e){var r=n.dom().createRange();return r.selectNode(t.dom()),r.collapse(e),r},a=function(n,t,o){var a=n.dom().createRange();a.selectNode(t.dom());var c=a.getBoundingClientRect(),l=i(c,o);return(l===r?e.first:e.last)(t).map(function(t){return u(n,t,l)})},c=function(t,e,r){var o=e.dom().getBoundingClientRect(),a=i(o,r);return n.some(u(t,e,a))};return{search:function(n,e,r){return(0===t.children(e).length?c:a)(n,e,r)}}}),i("3c",["g","l","1m","1e","4p","4q","23","3v"],function(n,t,e,r,o,i,u,a){var c=function(t,e,r){return n.from(t.dom().caretPositionFromPoint(e,r)).bind(function(e){if(null===e.offsetNode)return n.none();var r=t.dom().createRange();return r.setStart(e.offsetNode,e.offset),r.collapse(),n.some(r)})},l=function(t,e,r){return n.from(t.dom().caretRangeFromPoint(e,r))},f=function(n,t,e,r){var i=n.dom().createRange();i.selectNode(t.dom());var u=i.getBoundingClientRect(),c=a.max(u.left,a.min(u.right,e)),l=a.max(u.top,a.min(u.bottom,r));return o.locate(n,t,c,l)},s=function(n,r,o){return t.fromPoint(n,r,o).bind(function(t){var u=function(){return i.search(n,t,r)};return 0===e.children(t).length?u():f(n,t,r,o).orThunk(u)})},d=u.caretPositionFromPoint?c:u.caretRangeFromPoint?l:s;return{fromPoint:function(n,e,o){var i=t.fromDom(n.document);return d(i,e,o).map(function(n){return r.range(t.fromDom(n.startContainer),n.startOffset,t.fromDom(n.endContainer),n.endOffset)})}}}),i("3d",["e","l","n","y","27","3a","1n"],function(n,t,e,r,o,i,u){var a=function(t,e,u,a){var c=i.create(t),l=(o.is(e,a)?[e]:[]).concat(r.descendants(e,a));return n.filter(l,function(n){return i.selectNodeContentsUsing(c,n),i.isWithin(u,c)})};return{find:function(n,r,o){var i=u.asLtrRange(n,r),c=t.fromDom(i.commonAncestorContainer);return e.isElement(c)?a(n,c,i,o):[]}}}),i("3e",["e","l","n","1e","37"],function(n,t,e,r,o){var i=function(t,r){var i=e.name(t);return"input"===i?o.after(t):n.contains(["br","img"],i)?0===r?o.before(t):o.after(t):o.on(t,r)},u=function(n,t){var e=n.fold(o.before,i,o.after),u=t.fold(o.before,i,o.after);return r.relative(e,u)},a=function(n,t,e,o){var u=i(n,t),a=i(e,o);return r.relative(u,a)};return{beforeSpecial:i,preprocess:function(n){return n.match({domRange:function(n){var e=t.fromDom(n.startContainer),r=t.fromDom(n.endContainer);return a(e,n.startOffset,r,n.endOffset)},relative:u,exact:a})},preprocessRelative:u,preprocessExact:a}}),i("1f",["g","38","l","39","1m","1e","3a","1n","3c","3d","3e"],function(n,t,e,r,o,i,u,a,c,l,f){var s=function(t,e){n.from(t.getSelection()).each(function(n){n.removeAllRanges(),n.addRange(e)})},d=function(n,t,e,r,o){var i=u.exactToNative(n,t,e,r,o);s(n,i)},m=function(n,t){return a.diagnose(n,t).match({ltr:function(t,e,r,o){d(n,t,e,r,o)},rtl:function(t,e,r,o){var i=n.getSelection();i.extend?(i.collapse(t.dom(),e),i.extend(r.dom(),o)):d(n,r,o,t,e)}})},g=function(t){if(t.rangeCount>0){var r=t.getRangeAt(0),o=t.getRangeAt(t.rangeCount-1);return n.some(i.range(e.fromDom(r.startContainer),r.startOffset,e.fromDom(o.endContainer),o.endOffset))}return n.none()},p=function(r){var o=e.fromDom(r.anchorNode),u=e.fromDom(r.focusNode);return t.after(o,r.anchorOffset,u,r.focusOffset)?n.some(i.range(e.fromDom(r.anchorNode),r.anchorOffset,e.fromDom(r.focusNode),r.focusOffset)):g(r)},v=function(t){var e=t.getSelection();return e.rangeCount>0?p(e):n.none()};return{setExact:function(n,t,e,r,o){var i=f.preprocessExact(t,e,r,o);m(n,i)},getExact:v,get:function(n){return v(n).map(function(n){return i.exact(n.start(),n.soffset(),n.finish(),n.foffset())})},setRelative:function(n,t,e){var r=f.preprocessRelative(t,e);m(n,r)},toNative:function(n){var t=i.getWin(n).dom(),e=function(n,e,r,o){return u.exactToNative(t,n,e,r,o)},r=f.preprocess(n);return a.diagnose(t,r).match({ltr:e,rtl:e})},setToElement:function(n,t){var e=u.selectNodeContents(n,t);s(n,e)},clear:function(n){n.getSelection().removeAllRanges()},clone:function(n,t){var e=a.asLtrRange(n,t);return u.cloneFragment(e)},replace:function(n,t,e){var o=a.asLtrRange(n,t),i=r.fromElements(e,n.document);u.replaceWith(o,i)},deleteAt:function(n,t){var e=a.asLtrRange(n,t);u.deleteContents(e)},forElement:function(n,t){var r=u.selectNodeContents(n,t);return i.range(e.fromDom(r.startContainer),r.startOffset,e.fromDom(r.endContainer),r.endOffset)},getFirstRect:function(n,t){var e=a.asLtrRange(n,t);return u.getFirstRect(e)},getBounds:function(n,t){var e=a.asLtrRange(n,t);return u.getBounds(e)},getAtPoint:function(n,t,e){return c.fromPoint(n,t,e)},findWithin:function(n,t,e){return l.find(n,t,e)},getAsString:function(n,t){var e=a.asLtrRange(n,t);return u.toString(e)}}}),i("1g",["d"],function(n){return n("tinymce.util.VK")}),i("7",["e","g","1b","j","1c","l","n","y","t","1d","1e","1f","1g","z","o"],function(n,t,e,r,o,i,u,a,c,l,f,s,d,m,g){var p=function(n,t,r,o){return w(n,t,e.next(r),o)},v=function(n,t,r,o){return w(n,t,e.prev(r),o)},h=function(n,t){var e=f.exact(t,0,t,0);return s.toNative(e)},b=function(t,e){var r=a.descendants(e,"tr");return n.last(r).bind(function(n){return c.descendant(n,"td,th").map(function(n){return h(t,n)})})},w=function(n,e,o,i){return o.fold(t.none,t.none,function(t,e){return l.first(e).map(function(t){return h(n,t)})},function(t){return r.table(t,e).bind(function(e){var r=g.noMenu(t);return n.undoManager.transact(function(){i.insertRowsAfter(e,r)}),b(n,e)})})},y=["table","li","dl"];return{handle:function(t,e,a,c){if(t.keyCode===d.TAB){var l=m.getBody(e),f=function(t){var e=u.name(t);return o.eq(t,l)||n.contains(y,e)},s=e.selection.getRng();if(s.collapsed){var g=i.fromDom(s.startContainer);r.cell(g,f).each(function(n){t.preventDefault();(t.shiftKey?v:p)(e,f,n,a,c).each(function(n){e.selection.setRng(n)})})}}}}}),i("3f",["1k"],function(n){return{response:n.immutable("selection","kill")}}),i("1j",[],function(){var n=function(n){return function(t){return t===n}},t=n(38),e=n(40),r=function(n){return n>=37&&n<=40};return{ltr:{isBackward:n(37),isForward:n(39)},rtl:{isBackward:n(39),isForward:n(37)},isUp:t,isDown:e,isNavigation:r}}),i("4r",["f","l","37","1n"],function(n,t,e,r){return{convertToRange:function(e,o){var i=r.asLtrRange(e,o);return{start:n.constant(t.fromDom(i.startContainer)),soffset:n.constant(i.startOffset),finish:n.constant(t.fromDom(i.endContainer)),foffset:n.constant(i.endOffset)}},makeSitus:function(t,r,o,i){return{start:n.constant(e.on(t,r)),finish:n.constant(e.on(o,i))}}}}),i("3g",["4r","f","1t","g","l","1e","37","1f"],function(n,t,e,r,o,i,u,a){return function(c){return{elementFromPoint:function(n,t){return r.from(c.document.elementFromPoint(n,t)).map(o.fromDom)},getRect:function(n){return n.dom().getBoundingClientRect()},getRangedRect:function(n,r,o,u){var l=i.exact(n,r,o,u);return a.getFirstRect(c,l).map(function(n){return e.map(n,t.apply)})},getSelection:function(){return a.get(c).map(function(t){return n.convertToRange(c,t)})},fromSitus:function(t){var e=i.relative(t.start(),t.finish());return n.convertToRange(c,e)},situsFromPoint:function(n,e){return a.getAtPoint(c,n,e).map(function(n){return{start:t.constant(u.on(n.start(),n.soffset())),finish:t.constant(u.on(n.finish(),n.foffset()))}})},clearSelection:function(){a.clear(c)},setSelection:function(n){a.setExact(c,n.start(),n.soffset(),n.finish(),n.foffset())},setRelativeSelection:function(n,t){a.setRelative(c,n,t)},selectContents:function(n){a.setToElement(c,n)},getInnerHeight:function(){return c.innerHeight},getScrollY:function(){return c.scrollY},scrollBy:function(n,t){c.scrollBy(n,t)}}}}),i("3h",["3f","3l","4r","f","g","1c","t","2b","1e","37"],function(n,t,e,r,o,i,u,a){var c=function(n,t,e,r,a,c,f){return i.eq(e,a)&&r===c?o.none():u.closest(e,"td,th",t).bind(function(e){return u.closest(a,"td,th",t).bind(function(r){return l(n,t,e,r,f)})})},l=function(r,u,c,l,f){if(!i.eq(c,l)){var s=t.identify(c,l,u).getOr([]);if(s.length>0)return f(r,s,c,l),o.some(n.response(o.some(e.makeSitus(c,0,c,a.getEnd(c))),!0))}return o.none()};return{sync:c,detect:l,update:function(n,e,r,o,i){var u=function(n){return i.clear(r),i.selectRange(r,n.boxes(),n.start(),n.finish()),n.boxes()};return t.shiftSelection(o,n,e,i.firstSelectedSelector(),i.lastSelectedSelector()).map(u)}}}),i("5o",["1k"],function(n){var t=n.immutableBag(["left","top","right","bottom"],[]);return{nu:t,moveUp:function(n,e){return t({left:n.left(),top:n.top()-e,right:n.right(),bottom:n.bottom()-e})},moveDown:function(n,e){return t({left:n.left(),top:n.top()+e,right:n.right(),bottom:n.bottom()+e})},moveBottomTo:function(n,e){var r=n.bottom()-n.top();return t({left:n.left(),top:e-r,right:n.right(),bottom:e})},moveTopTo:function(n,e){var r=n.bottom()-n.top();return t({left:n.left(),top:e,right:n.right(),bottom:e+r})},getTop:function(n){return n.top()},getBottom:function(n){return n.bottom()},translate:function(n,e,r){return t({left:n.left()+e,top:n.top()+r,right:n.right()+e,bottom:n.bottom()+r})},toString:function(n){return"("+n.left()+", "+n.top()+") -> ("+n.right()+", "+n.bottom()+")"}}}),
  i("5p",["5o","g","n","2b"],function(n,t,e,r){var o=function(n,e,o){return o>=0&&o<r.getEnd(e)?n.getRangedRect(e,o,e,o+1):o>0?n.getRangedRect(e,o-1,e,o):t.none()},i=function(t){return n.nu({left:t.left,top:t.top,right:t.right,bottom:t.bottom})},u=function(n,e){return t.some(n.getRect(e))};return{getBoxAt:function(n,r,a){return e.isElement(r)?u(n,r,a).map(i):e.isText(r)?o(n,r,a).map(i):t.none()},getEntireBox:function(n,o){return e.isElement(o)?u(n,o).map(i):e.isText(o)?n.getRangedRect(o,0,o,r.getEnd(o)).map(i):t.none()}}}),i("64",["e","g","1k"],function(n,t,e){var r=e.immutable("item","mode"),o=function(n,t,e,o){var u=void 0!==o?o:i;return n.property().parent(t).map(function(n){return r(n,u)})},i=function(n,t,e,o){var i=void 0!==o?o:u;return e.sibling(n,t).map(function(n){return r(n,i)})},u=function(n,t,e,o){var i=void 0!==o?o:u,a=n.property().children(t);return e.first(a).map(function(n){return r(n,i)})},a=[{current:o,next:i,fallback:t.none()},{current:i,next:u,fallback:t.some(o)},{current:u,next:u,fallback:t.some(i)}],c=function(t,e,r,o,i){var u=void 0!==i?i:a;return n.find(u,function(n){return n.current===r}).bind(function(n){return n.current(t,e,o,n.next).orThunk(function(){return n.fallback.bind(function(n){return c(t,e,n,o)})})})};return{backtrack:o,sidestep:i,advance:u,go:c}}),i("65",["g"],function(n){return{left:function(){return{sibling:function(n,t){return n.query().prevSibling(t)},first:function(t){return t.length>0?n.some(t[t.length-1]):n.none()}}},right:function(){return{sibling:function(n,t){return n.query().nextSibling(t)},first:function(t){return t.length>0?n.some(t[0]):n.none()}}}}}),i("63",["g","64","65"],function(n,t,e){var r=function(e,o,i,u,a,c){return t.go(e,o,u,a).bind(function(t){return c(t.item())?n.none():i(t.item())?n.some(t.item()):r(e,t.item(),i,t.mode(),a,c)})};return{left:function(n,o,i,u){return r(n,o,i,t.sidestep,e.left(),u)},right:function(n,o,i,u){return r(n,o,i,t.sidestep,e.right(),u)}}}),i("5q",["f","63","64","65"],function(n,t,e,r){var o=function(n,t){return 0===n.property().children(t).length},i=function(t,e,r){return a(t,e,n.curry(o,t),r)},u=function(t,e,r){return c(t,e,n.curry(o,t),r)},a=function(n,e,r,o){return t.left(n,e,r,o)},c=function(n,e,r,o){return t.right(n,e,r,o)};return{before:i,after:u,seekLeft:a,seekRight:c,walkers:function(){return{left:r.left,right:r.right}},walk:function(n,t,r,o,i){return e.go(n,t,r,o,i)},backtrack:e.backtrack,sidestep:e.sidestep,advance:e.advance}}),i("4w",["56","5q"],function(n,t){var e=n();return{gather:function(n,r,o){return t.gather(e,n,r,o)},before:function(n,r){return t.before(e,n,r)},after:function(n,r){return t.after(e,n,r)},seekLeft:function(n,r,o){return t.seekLeft(e,n,r,o)},seekRight:function(n,r,o){return t.seekRight(e,n,r,o)},walkers:function(){return t.walkers()},walk:function(n,r,o,i){return t.walk(e,n,r,o,i)}}}),i("4u",["5o","5p","2g","f","g","4w","48","n","2a","3v"],function(n,t,e,r,o,i,u,a,c,l){var f=5,s=100,d=e.generate([{none:[]},{retry:["caret"]}]),m=function(n,t){return n.left()<t.left()||l.abs(t.right()-n.left())<1||n.left()>t.right()},g=function(n,e,o){return c.closest(e,u.isBlock).fold(r.constant(!1),function(e){return t.getEntireBox(n,e).exists(function(n){return m(o,n)})})},p=function(t,e,r,o,i){var u=n.moveDown(i,f);return l.abs(r.bottom()-o.bottom())<1?d.retry(u):r.top()>i.bottom()?d.retry(u):r.top()===i.bottom()?d.retry(n.moveDown(i,1)):g(t,e,i)?d.retry(n.translate(u,f,0)):d.none()},v=function(t,e,r,o,i){var u=n.moveUp(i,f);return l.abs(r.top()-o.top())<1?d.retry(u):r.bottom()<i.top()?d.retry(u):r.bottom()===i.top()?d.retry(n.moveUp(i,1)):g(t,e,i)?d.retry(n.translate(u,f,0)):d.none()},h={point:n.getTop,adjuster:v,move:n.moveUp,gather:i.before},b={point:n.getBottom,adjuster:p,move:n.moveDown,gather:i.after},w=function(n,t,e){return n.elementFromPoint(t,e).filter(function(n){return"table"===a.name(n)}).isSome()},y=function(n,t,e,r,o){return x(n,t,e,t.move(r,f),o)},x=function(n,e,r,i,u){return 0===u?o.some(i):w(n,i.left(),e.point(i))?y(n,e,r,i,u-1):n.situsFromPoint(i.left(),e.point(i)).bind(function(a){return a.start().fold(o.none,function(a,c){return t.getEntireBox(n,a,c).bind(function(t){return e.adjuster(n,a,t,r,i).fold(o.none,function(t){return x(n,e,r,t,u-1)})}).orThunk(function(){return o.some(i)})},o.none)})},C=function(n,t){return n.situsFromPoint(t.left(),t.bottom()+f)},S=function(n,t){return n.situsFromPoint(t.left(),t.top()-f)},R=function(n,t,e){return n.point(t)>e.getInnerHeight()?o.some(n.point(t)-e.getInnerHeight()):n.point(t)<0?o.some(-n.point(t)):o.none()},T=function(n,t,e){var r=n.move(e,f),o=x(t,n,e,r,s).getOr(r);return R(n,o,t).fold(function(){return t.situsFromPoint(o.left(),n.point(o))},function(e){return t.scrollBy(0,e),t.situsFromPoint(o.left(),n.point(o)-e)})};return{tryUp:r.curry(T,h),tryDown:r.curry(T,b),ieTryUp:S,ieTryDown:C,getJumpSize:r.constant(f)}}),i("4v",["2g","3z","1c","t","2b"],function(n,t,e,r,o){var i=n.generate([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),u=function(n,t,e){var r=n.getRect(t),o=n.getRect(e);return o.right>r.left&&o.left<r.right},a=function(n,a,l,f,s,d,m){return r.closest(f,"td,th",m).bind(function(l){return r.closest(a,"td,th",m).map(function(r){return e.eq(l,r)?e.eq(f,l)&&o.getEnd(l)===s?d(r):i.none("in same cell"):t.sharedOne(c,[l,r]).fold(function(){return u(n,r,l)?i.success():d(r)},function(){return d(r)})})}).getOr(i.none("default"))},c=function(n){return r.closest(n,"tr")};return{verify:a,cata:function(n,t,e,r,o){return n.fold(t,e,r,o)},adt:i}}),i("5s",["1k"],function(n){return{point:n.immutable("element","offset"),delta:n.immutable("element","deltaOffset"),range:n.immutable("element","start","finish"),points:n.immutable("begin","end"),text:n.immutable("element","text")}}),i("66",["e","f","g","1k","1c","2a","y","t","1m"],function(n,t,e,r,o,i,u,a,c){var l=r.immutable("ancestor","descendants","element","index"),f=r.immutable("parent","children","element","index"),s=function(n){return c.parent(n).bind(function(t){var e=c.children(t);return d(e,n).map(function(r){return f(t,e,n,r)})})},d=function(e,r){return n.findIndex(e,t.curry(o.eq,r))};return{childOf:function(n,t){return i.closest(n,function(n){return c.parent(n).exists(function(n){return o.eq(n,t)})})},indexOf:d,indexInParent:s,selectorsInParent:function(n,t){return c.parent(n).bind(function(e){var r=u.children(e,t);return d(r,n).map(function(t){return f(e,r,n,t)})})},descendantsInAncestor:function(n,t,e){return a.closest(n,t).bind(function(t){var r=u.descendants(t,e);return d(r,n).map(function(e){return l(t,r,n,e)})})}}}),i("5r",["4v","f","g","5s","n","1l","66","1m","2b","37"],function(n,t,e,r,o,i,u,a,c,l){var f=function(n){return"br"===o.name(n)},s=function(n,t,r){return t(n,r).bind(function(n){return o.isText(n)&&0===i.get(n).trim().length?s(n,t,r):e.some(n)})},d=function(n,t,e){return e.traverse(t).orThunk(function(){return s(t,e.gather,n)}).map(e.relative)},m=function(n,t){return a.child(n,t).filter(f).orThunk(function(){return a.child(n,t-1).filter(f)})},g=function(n,t,e,r){return m(t,e).bind(function(t){return r.traverse(t).fold(function(){return s(t,r.gather,n).map(r.relative)},function(n){return u.indexInParent(n).map(function(n){return l.on(n.parent(),n.index())})})})};return{tryBr:function(n,e,r,o){return(f(e)?d(n,e,o):g(n,e,r,o)).map(function(n){return{start:t.constant(n),finish:t.constant(n)}})},process:function(t){return n.cata(t,function(){return e.none("BR ADT: none")},function(){return e.none()},function(n){return e.some(r.point(n,0))},function(n){return e.some(r.point(n,c.getEnd(n)))})}}}),i("4s",["5o","5p","4u","4v","5r","g","5s","26","1c","2b"],function(n,t,e,r,o,i,u,a,c,l){var f=20,s=a.detect(),d=function(n,t,e){return n.getSelection().bind(function(a){return o.tryBr(t,a.finish(),a.foffset(),e).fold(function(){return i.some(u.point(a.finish(),a.foffset()))},function(i){var u=n.fromSitus(i),c=r.verify(n,a.finish(),a.foffset(),u.finish(),u.foffset(),e.failure,t);return o.process(c)})})},m=function(t,e,o,u,a,f){return 0===f?i.none():v(t,e,o,u,a).bind(function(s){var d=t.fromSitus(s),p=r.verify(t,o,u,d.finish(),d.foffset(),a.failure,e);return r.cata(p,function(){return i.none()},function(){return i.some(s)},function(r){return c.eq(o,r)&&0===u?g(t,o,u,n.moveUp,a):m(t,e,r,0,a,f-1)},function(r){return c.eq(o,r)&&u===l.getEnd(r)?g(t,o,u,n.moveDown,a):m(t,e,r,l.getEnd(r),a,f-1)})})},g=function(n,r,o,i,u){return t.getBoxAt(n,r,o).bind(function(t){return p(n,u,i(t,e.getJumpSize()))})},p=function(n,t,e){return s.browser.isChrome()||s.browser.isSafari()||s.browser.isFirefox()||s.browser.isEdge()?t.otherRetry(n,e):s.browser.isIE()?t.ieRetry(n,e):i.none()},v=function(n,e,r,o,i){return t.getBoxAt(n,r,o).bind(function(t){return p(n,i,t)})};return{handle:function(n,t,e){return d(n,t,e).bind(function(r){return m(n,t,r.element(),r.offset(),e,f).map(n.fromSitus)})}}}),i("4t",["2a"],function(n){return{any:function(t){return n.first(t).isSome()},ancestor:function(t,e,r){return n.ancestor(t,e,r).isSome()},closest:function(t,e,r){return n.closest(t,e,r).isSome()},sibling:function(t,e){return n.sibling(t,e).isSome()},child:function(t,e){return n.child(t,e).isSome()},descendant:function(t,e){return n.descendant(t,e).isSome()}}}),i("3i",["3f","3h","4s","4r","e","f","g","26","1c","4t","y","t","1m","2b","1d"],function(n,t,e,r,o,i,u,a,c,l,f,s,d,m,g){var p=a.detect(),v=function(n,t){return l.ancestor(n,function(n){return d.parent(n).exists(function(n){return c.eq(n,t)})})},h=function(n,t,r,o,a){return s.closest(o,"td,th",t).bind(function(o){return s.closest(o,"table",t).bind(function(c){return v(a,c)?e.handle(n,t,r).bind(function(n){return s.closest(n.finish(),"td,th",t).map(function(t){return{start:i.constant(o),finish:i.constant(t),range:i.constant(n)}})}):u.none()})})};return{navigate:function(t,e,o,i,a,c){return p.browser.isIE()?u.none():c(i,e).orThunk(function(){return h(t,e,o,i,a).map(function(t){var e=t.range();return n.response(u.some(r.makeSitus(e.start(),e.soffset(),e.finish(),e.foffset())),!0)})})},select:function(n,e,r,o,i,u,a){return h(n,r,o,i,u).bind(function(n){return t.detect(e,r,n.start(),n.finish(),a)})},firstUpCheck:function(t,e){return s.closest(t,"tr",e).bind(function(t){return s.closest(t,"table",e).bind(function(e){var o=f.descendants(e,"tr");return c.eq(t,o[0])?d.prevSibling(e).bind(g.last).map(function(t){var e=m.getEnd(t);return n.response(u.some(r.makeSitus(t,e,t,e)),!0)}):u.none()})})},lastDownCheck:function(t,e){return s.closest(t,"tr",e).bind(function(t){return s.closest(t,"table",e).bind(function(e){var o=f.descendants(e,"tr");return c.eq(t,o[o.length-1])?d.nextSibling(e).bind(g.first).map(function(t){return n.response(u.some(r.makeSitus(t,0,t,0)),!0)}):u.none()})})}}}),i("3j",["3l","g","1c","t"],function(n,t,e,r){var o=function(n,t){return r.closest(n,"td,th",t)};return function(r,i,u,a){var c=t.none(),l=function(){c=t.none()};return{mousedown:function(n){a.clear(i),c=o(n.target(),u)},mouseover:function(t){c.each(function(c){a.clear(i),o(t.target(),u).each(function(t){var o=n.identify(c,t,u).getOr([]);(o.length>1||1===o.length&&!e.eq(c,t))&&(a.selectRange(i,o,c,t),r.selectContents(t))})})},mouseup:function(){c.each(l)}}}}),i("3k",["4u","4v","4w","1m","37"],function(n,t,e,r,o){return{down:{traverse:r.nextSibling,gather:e.after,relative:o.before,otherRetry:n.tryDown,ieRetry:n.ieTryDown,failure:t.adt.failedDown},up:{traverse:r.prevSibling,gather:e.before,relative:o.before,otherRetry:n.tryUp,ieRetry:n.ieTryUp,failure:t.adt.failedUp}}}),i("1h",["3f","1j","3g","3h","3i","3j","3k","3l","f","g","3m","1k","37"],function(n,t,e,r,o,i,u,a,c,l,f,s,d){var m=s.immutable("rows","cols");return{mouse:function(n,t,r,o){var u=e(n),a=i(u,t,r,o);return{mousedown:a.mousedown,mouseover:a.mouseover,mouseup:a.mouseup}},keyboard:function(i,s,g,p){var v=e(i),h=function(){return p.clear(s),l.none()};return{keydown:function(e,i,b,w,y,x){var C=e.raw().which,S=!0===e.raw().shiftKey;return a.retrieve(s,p.selectedSelector()).fold(function(){return t.isDown(C)&&S?c.curry(o.select,v,s,g,u.down,w,i,p.selectRange):t.isUp(C)&&S?c.curry(o.select,v,s,g,u.up,w,i,p.selectRange):t.isDown(C)?c.curry(o.navigate,v,g,u.down,w,i,o.lastDownCheck):t.isUp(C)?c.curry(o.navigate,v,g,u.up,w,i,o.firstUpCheck):l.none},function(e){var o=function(o){return function(){return f.findMap(o,function(n){return r.update(n.rows(),n.cols(),s,e,p)}).fold(function(){return a.getEdges(s,p.firstSelectedSelector(),p.lastSelectedSelector()).map(function(e){var r=t.isDown(C)||x.isForward(C)?d.after:d.before;return v.setRelativeSelection(d.on(e.first(),0),r(e.table())),p.clear(s),n.response(l.none(),!0)})},function(){return l.some(n.response(l.none(),!0))})}};return t.isDown(C)&&S?o([m(1,0)]):t.isUp(C)&&S?o([m(-1,0)]):x.isBackward(C)&&S?o([m(0,-1),m(-1,0)]):x.isForward(C)&&S?o([m(0,1),m(1,0)]):t.isNavigation(C)&&!1===S?h:l.none})()},keyup:function(n,e,o,i,u){return a.retrieve(s,p.selectedSelector()).fold(function(){var a=n.raw().which;return!1===(!0===n.raw().shiftKey)?l.none():t.isNavigation(a)?r.sync(s,g,e,o,i,u,p.selectRange):l.none()},l.none)}}}}}),i("4x",["e","3n","4n","1p"],function(n,t,e,r){var o=function(n){for(var t=n.dom().classList,e=new r(t.length),o=0;o<t.length;o++)e[o]=t.item(o);return e};return{add:function(e,r){n.each(r,function(n){t.add(e,n)})},remove:function(e,r){n.each(r,function(n){t.remove(e,n)})},toggle:function(e,r){n.each(r,function(n){t.toggle(e,n)})},hasAll:function(e,r){return n.forall(r,function(n){return t.has(e,n)})},hasAny:function(e,r){return n.exists(r,function(n){return t.has(e,n)})},get:function(n){return e.supports(n)?o(n):e.get(n)}}}),i("3o",["3n","4x"],function(n,t){return{addClass:function(t){return function(e){n.add(e,t)}},removeClass:function(t){return function(e){n.remove(e,t)}},removeClasses:function(n){return function(e){t.remove(e,n)}},hasClass:function(t){return function(e){return n.has(e,t)}}}}),i("1i",["e","r","3n","3o","y"],function(n,t,e,r,o){return{byClass:function(t){var i=r.addClass(t.selected()),u=r.removeClasses([t.selected(),t.lastSelected(),t.firstSelected()]),a=function(e){var r=o.descendants(e,t.selectedSelector());n.each(r,u)};return{clear:a,selectRange:function(r,o,u,c){a(r),n.each(o,i),e.add(u,t.firstSelected()),e.add(c,t.lastSelected())},selectedSelector:t.selectedSelector,firstSelectedSelector:t.firstSelectedSelector,lastSelectedSelector:t.lastSelectedSelector}},byAttr:function(e){var r=function(n){t.remove(n,e.selected()),t.remove(n,e.firstSelected()),t.remove(n,e.lastSelected())},i=function(n){t.set(n,e.selected(),"1")},u=function(t){var i=o.descendants(t,e.selectedSelector());n.each(i,r)};return{clear:u,selectRange:function(r,o,a,c){u(r),n.each(o,i),t.set(a,e.firstSelected(),"1"),t.set(c,e.lastSelected(),"1")},selectedSelector:e.selectedSelector,firstSelectedSelector:e.firstSelectedSelector,lastSelectedSelector:e.lastSelectedSelector}}}}),i("8",["1h","1i","1j","f","g","1k","j","1c","l","n","1l","r","1m","1e","1n","z","10","9"],function(n,t,e,r,o,i,u,a,c,l,f,s,d,m,g,p,v,h){return function(b,w){var y=i.immutableBag(["mousedown","mouseover","mouseup","keyup","keydown"],[]),x=o.none(),C=t.byAttr(h);b.on("init",function(){var t=b.getWin(),i=p.getBody(b),h=p.getIsRoot(b),S=function(){var n=b.selection,t=c.fromDom(n.getStart()),e=c.fromDom(n.getEnd()),l=u.table(t),f=u.table(e);l.bind(function(n){return f.bind(function(t){return a.eq(n,t)?o.some(!0):o.none()})}).fold(function(){C.clear(i)},r.noop)},R=n.mouse(t,i,h,C),T=n.keyboard(t,i,h,C),k=function(n,e){e.kill()&&n.kill(),e.selection().each(function(n){var e=m.relative(n.start(),n.finish()),r=g.asLtrRange(t,e);b.selection.setRng(r)})},A=function(n){var t=E(n);if(t.raw().shiftKey&&e.isNavigation(t.raw().which)){var r=b.selection.getRng(),o=c.fromDom(r.startContainer),i=c.fromDom(r.endContainer);T.keyup(t,o,r.startOffset,i,r.endOffset).each(function(n){k(t,n)})}},D=function(n){return!(s.has(n,"data-mce-bogus")||"br"===l.name(n)||l.isText(n)&&0===f.get(n).length)},O=function(){var n=c.fromDom(b.getBody()),t=function(n){return d.prevSibling(n).bind(function(n){return D(n)?o.some(n):t(n)})};return d.lastChild(n).bind(function(n){return D(n)?o.some(n):t(n)})},N=function(n){var t=E(n);w().each(function(n){n.hideBars()}),40===n.which&&O().each(function(n){"table"===l.name(n)&&(b.settings.forced_root_block?b.dom.add(b.getBody(),b.settings.forced_root_block,b.settings.forced_root_block_attrs,"<br/>"):b.dom.add(b.getBody(),"br"))});var r=b.selection.getRng(),o=c.fromDom(b.selection.getStart()),i=c.fromDom(r.startContainer),u=c.fromDom(r.endContainer),a=v.directionAt(o).isRtl()?e.rtl:e.ltr;T.keydown(t,i,r.startOffset,u,r.endOffset,a).each(function(n){k(t,n)}),w().each(function(n){n.showBars()})},E=function(n){var t=c.fromDom(n.target),e=function(){n.stopPropagation()},o=function(){n.preventDefault()},i=r.compose(o,e);return{target:r.constant(t),x:r.constant(n.x),y:r.constant(n.y),stop:e,prevent:o,kill:i,raw:r.constant(n)}},B=function(n){return 0===n.button},P=function(n){return void 0===n.buttons||0!=(1&n.buttons)},I=function(n){B(n)&&R.mousedown(E(n))},W=function(n){P(n)&&R.mouseover(E(n))},q=function(n){B&&R.mouseup(E(n))};b.on("mousedown",I),b.on("mouseover",W),b.on("mouseup",q),b.on("keyup",A),b.on("keydown",N),b.on("nodechange",S),x=o.some(y({mousedown:I,mouseover:W,mouseup:q,keyup:A,keydown:N}))});var S=function(){x.each(function(){})};return{clear:C.clear,destroy:S}}}),i("a",["1o","z","9","p"],function(n,t,e,r){return function(o){return{get:function(){var i=t.getBody(o);return n.retrieve(i,e.selectedSelector()).fold(function(){return void 0===o.selection.getStart()?r.none():r.single(o.selection)},function(n){return r.multiple(n)})}}}}),i("b",["f","14","15"],function(n,t,e){var r=t.each;return{addButtons:function(t){function o(n){return function(){t.execCommand(n)}}var i=[];r("inserttable tableprops deletetable | cell row column".split(" "),function(n){"|"==n?i.push({text:"-"}):i.push(t.menuItems[n])}),t.addButton("table",{type:"menubutton",title:"Table",menu:i}),t.addButton("tableprops",{title:"Table properties",onclick:n.curry(e.open,t,!0),icon:"table"}),t.addButton("tabledelete",{title:"Delete table",onclick:o("mceTableDelete")}),t.addButton("tablecellprops",{title:"Cell properties",onclick:o("mceTableCellProps")}),t.addButton("tablemergecells",{title:"Merge cells",onclick:o("mceTableMergeCells")}),t.addButton("tablesplitcells",{title:"Split cell",onclick:o("mceTableSplitCells")}),t.addButton("tableinsertrowbefore",{title:"Insert row before",onclick:o("mceTableInsertRowBefore")}),t.addButton("tableinsertrowafter",{title:"Insert row after",onclick:o("mceTableInsertRowAfter")}),t.addButton("tabledeleterow",{title:"Delete row",onclick:o("mceTableDeleteRow")}),t.addButton("tablerowprops",{title:"Row properties",onclick:o("mceTableRowProps")}),t.addButton("tablecutrow",{title:"Cut row",onclick:o("mceTableCutRow")}),t.addButton("tablecopyrow",{title:"Copy row",onclick:o("mceTableCopyRow")}),t.addButton("tablepasterowbefore",{title:"Paste row before",onclick:o("mceTablePasteRowBefore")}),t.addButton("tablepasterowafter",{title:"Paste row after",onclick:o("mceTablePasteRowAfter")}),t.addButton("tableinsertcolbefore",{title:"Insert column before",onclick:o("mceTableInsertColBefore")}),t.addButton("tableinsertcolafter",{title:"Insert column after",onclick:o("mceTableInsertColAfter")}),t.addButton("tabledeletecol",{title:"Delete column",onclick:o("mceTableDeleteCol")})},addToolbars:function(n){var t=function(t){return n.dom.is(t,"table")&&n.getBody().contains(t)},e=n.settings.table_toolbar;""!==e&&!1!==e&&(e||(e="tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol"),n.addContextToolbar(t,e))}}}),i("c",["f","e","g","j","l","3","o","15"],function(n,t,e,r,o,i,u,a){return{addMenuItems:function(c,l){function f(n){return function(){c.execCommand(n)}}var s=e.none(),d=[],m=[],g=[],p=[],v=function(n){n.disabled(!0)},h=function(n){n.disabled(!1)},b=function(){var n=this;d.push(n),s.fold(function(){v(n)},function(){h(n)})},w=function(){var n=this;m.push(n),s.fold(function(){v(n)},function(){h(n)})},y=function(){var n=this;g.push(n),s.fold(function(){v(n)},function(t){n.disabled(t.mergable().isNone())})},x=function(){var n=this;p.push(n),s.fold(function(){v(n)},function(t){n.disabled(t.unmergable().isNone())})},C=function(){s.fold(function(){t.each(d,v),t.each(m,v),t.each(g,v),t.each(p,v)},function(n){t.each(d,h),t.each(m,h),t.each(g,function(t){t.disabled(n.mergable().isNone())}),t.each(p,function(t){t.disabled(n.unmergable().isNone())})})};c.on("init",function(){c.on("nodechange",function(){var n=e.from(c.dom.getParent(c.selection.getStart(),"th,td"));s=n.bind(function(n){var t=o.fromDom(n);return r.table(t).map(function(n){return u.forMenu(l,n,t)})}),C()})});var S=function(){var n="";n='<table role="grid" class="mce-grid mce-grid-border" aria-readonly="true">';for(var t=0;t<10;t++){n+="<tr>";for(var e=0;e<10;e++)n+='<td role="gridcell" tabindex="-1"><a id="mcegrid'+(10*t+e)+'" href="#" data-mce-x="'+e+'" data-mce-y="'+t+'"></a></td>';n+="</tr>"}return n+="</table>",n+='<div class="mce-text-center" role="presentation">1 x 1</div>'},R=function(n,t,e,r){var o,i,u,a,c,l=r.getEl().getElementsByTagName("table")[0],f=r.isRtl()||"tl-tr"==r.parent().rel;for(l.nextSibling.innerHTML=t+1+" x "+(e+1),f&&(t=9-t),i=0;i<10;i++)for(o=0;o<10;o++)a=l.rows[i].childNodes[o].firstChild,c=(f?o>=t:o<=t)&&i<=e,n.dom.toggleClass(a,"mce-active",c),c&&(u=a);return u.parentNode},T=!1===c.settings.table_grid?{text:"Table",icon:"table",context:"table",onclick:n.curry(a.open,c)}:{text:"Table",icon:"table",context:"table",ariaHideMenu:!0,onclick:function(n){n.aria&&(this.parent().hideAll(),n.stopImmediatePropagation(),a.open(c))},onshow:function(){R(c,0,0,this.menu.items()[0])},onhide:function(){var n=this.menu.items()[0].getEl().getElementsByTagName("a");c.dom.removeClass(n,"mce-active"),c.dom.addClass(n[0],"mce-active")},menu:[{type:"container",html:S(),onPostRender:function(){this.lastX=this.lastY=0},onmousemove:function(n){var t,e,r=n.target;"A"==r.tagName.toUpperCase()&&(t=parseInt(r.getAttribute("data-mce-x"),10),e=parseInt(r.getAttribute("data-mce-y"),10),(this.isRtl()||"tl-tr"==this.parent().rel)&&(t=9-t),t===this.lastX&&e===this.lastY||(R(c,t,e,n.control),this.lastX=t,this.lastY=e))},onclick:function(n){var t=this;"A"==n.target.tagName.toUpperCase()&&(n.preventDefault(),n.stopPropagation(),t.parent().cancel(),c.undoManager.transact(function(){i.insert(c,t.lastX+1,t.lastY+1)}),c.addVisual())}}]},k={text:"Table properties",context:"table",onPostRender:b,onclick:n.curry(a.open,c,!0)},A={text:"Delete table",context:"table",onPostRender:b,cmd:"mceTableDelete"},D={text:"Row",context:"table",menu:[{text:"Insert row before",onclick:f("mceTableInsertRowBefore"),onPostRender:w},{text:"Insert row after",onclick:f("mceTableInsertRowAfter"),onPostRender:w},{text:"Delete row",onclick:f("mceTableDeleteRow"),onPostRender:w},{text:"Row properties",onclick:f("mceTableRowProps"),onPostRender:w},{text:"-"},{text:"Cut row",onclick:f("mceTableCutRow"),onPostRender:w},{text:"Copy row",onclick:f("mceTableCopyRow"),onPostRender:w},{text:"Paste row before",onclick:f("mceTablePasteRowBefore"),onPostRender:w},{text:"Paste row after",onclick:f("mceTablePasteRowAfter"),onPostRender:w}]},O={text:"Column",context:"table",menu:[{text:"Insert column before",onclick:f("mceTableInsertColBefore"),onPostRender:w},{text:"Insert column after",onclick:f("mceTableInsertColAfter"),onPostRender:w},{text:"Delete column",onclick:f("mceTableDeleteCol"),onPostRender:w}]},N={separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:f("mceTableCellProps"),onPostRender:w},{text:"Merge cells",onclick:f("mceTableMergeCells"),onPostRender:y},{text:"Split cell",onclick:f("mceTableSplitCells"),onPostRender:x}]};c.addMenuItem("inserttable",T),c.addMenuItem("tableprops",k),c.addMenuItem("deletetable",A),c.addMenuItem("row",D),c.addMenuItem("column",O),c.addMenuItem("cell",N)}}}),i("0",["1","2","3","4","5","6","7","8","9","a","b","c"],function(n,t,e,r,o,i,u,a,c,l,f,s){function d(n){var d=this,m=i(n),g=a(n,m.lazyResize),p=r(n,m.lazyWire),v=l(n);o.registerCommands(n,p,g,v),t.registerEvents(n,v,p,g),s.addMenuItems(n,v),f.addButtons(n),f.addToolbars(n),n.on("PreInit",function(){n.serializer.addTempAttr(c.firstSelected()),n.serializer.addTempAttr(c.lastSelected())}),!1!==n.settings.table_tab_navigation&&n.on("keydown",function(t){u.handle(t,n,p,m.lazyWire)}),n.on("remove",function(){m.destroy(),g.destroy()}),d.insertTable=function(t,r){return e.insert(n,t,r)},d.setClipboardRows=o.setClipboardRows,d.getClipboardRows=o.getClipboardRows}return n.add("table",d),function(){}}),r("0")()}();