1(self.webpackChunkplone_staticresources=self.webpackChunkplone_staticresources||[]).push([[6541],{6541:function(e,t,n){!function(){"use strict";function e(e){var t=e;return{get:function(){return t},set:function(e){t=e}}}function t(e){return null!=e}function r(){}function o(e){return function(){return e}}function i(e){return e}function a(){return h}function u(e){return n=typeof(t=e),"array"==(null===t?"null":"object"==n&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":n);var t,n}var c,s=tinymce.util.Tools.resolve("tinymce.PluginManager"),f=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=function(e){return typeof e===c},d=o(!(c="function")),m=o(!0),h={fold:function(e,t){return e()},isSome:d,isNone:m,getOr:i,getOrThunk:g,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(void 0),or:i,orThunk:g,map:a,each:r,bind:a,exists:d,forall:m,filter:function(){return h},toArray:function(){return[]},toString:o("none()")};function g(e){return e()}var p=function(e){function t(){return i}function n(t){return t(e)}var r=o(e),i={fold:function(t,n){return n(e)},isSome:m,isNone:d,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:t,orThunk:t,map:function(t){return p(t(e))},each:function(t){t(e)},bind:n,exists:n,forall:n,filter:function(t){return t(e)?i:h},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return i},v={some:p,none:a,from:function(e){return null==e?h:p(e)}},y={},w={exports:y};function b(e,t){return A(document.createElement("canvas"),e,t)}function _(e){var t=b(e.width,e.height);return U(t).drawImage(e,0,0),t}function E(e){return new R((function(t,n){function r(){i.removeEventListener("load",a),i.removeEventListener("error",u)}var o=URL.createObjectURL(e),i=new Image,a=function(){r(),t(i)},u=function(){r(),n("Unable to load data of type "+e.type+": "+o)};i.addEventListener("load",a),i.addEventListener("error",u),i.src=o,i.complete&&setTimeout(a,0)}))}function T(e,t,n){return t=t||"image/png",l(HTMLCanvasElement.prototype.toBlob)?new R((function(r,o){e.toBlob((function(e){e?r(e):o()}),t,n)})):k(e.toDataURL(t,n))}function x(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}function I(e,t){return function(e,t,n){for(var r=0,o=e.length;r<o;r++){var i=e[r];if(t(i,r))return v.some(i);if(n(i,r))break}return v.none()}(e,t,d)}!function(){var e=this,t=function(){var e,t,r,o={exports:{}};function i(){}function a(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],d(e,this)}function u(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,a._immediateFn((function(){var n,r=1===e._state?t.onFulfilled:t.onRejected;if(null!==r){try{n=r(e._value)}catch(n){return void s(t.promise,n)}c(t.promise,n)}else(1===e._state?c:s)(t.promise,e._value)}))):e._deferreds.push(t)}function c(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof a)return e._state=3,e._value=t,void f(e);if("function"==typeof n)return void d((r=n,o=t,function(){r.apply(o,arguments)}),e)}e._state=1,e._value=t,f(e)}catch(t){s(e,t)}var r,o}function s(e,t){e._state=2,e._value=t,f(e)}function f(e){2===e._state&&0===e._deferreds.length&&a._immediateFn((function(){e._handled||a._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;t<n;t++)u(e,e._deferreds[t]);e._deferreds=null}function l(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function d(e,t){var n=!1;try{e((function(e){n||(n=!0,c(t,e))}),(function(e){n||(n=!0,s(t,e))}))}catch(e){if(n)return;n=!0,s(t,e)}}e=o,t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},r=setTimeout,a.prototype.catch=function(e){return this.then(null,e)},a.prototype.then=function(e,t){var n=new this.constructor(i);return u(this,new l(e,t,n)),n},a.all=function(e){var t=Array.prototype.slice.call(e);return new a((function(e,n){if(0===t.length)return e([]);for(var r=t.length,o=0;o<t.length;
1o++)!function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return u.call(a,(function(e){o(i,e)}),n),0}t[i]=a,0==--r&&e(t)}catch(a){n(a)}}(o,t[o])}))},a.resolve=function(e){return e&&"object"==typeof e&&e.constructor===a?e:new a((function(t){t(e)}))},a.reject=function(e){return new a((function(t,n){n(e)}))},a.race=function(e){return new a((function(t,n){for(var r=0,o=e.length;r<o;r++)e[r].then(t,n)}))},a._immediateFn="function"==typeof setImmediate?function(e){setImmediate(e)}:function(e){r(e,0)},a._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},a._setImmediateFn=function(e){a._immediateFn=e},a._setUnhandledRejectionFn=function(e){a._unhandledRejectionFn=e},e.exports?e.exports=a:t.Promise||(t.Promise=a);var m=o.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||m}};"object"==typeof y&&void 0!==w?w.exports=t():(e="undefined"!=typeof globalThis?globalThis:e||self).EphoxContactWrapper=t()}();var R=w.exports.boltExport,U=function(e){return e.getContext("2d")},A=function(e,t,n){return e.width=t,e.height=n,e},j=function(e){return new R((function(t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="blob",r.onload=function(){200===this.status&&t(this.response)},r.onerror=function(){var e;n(0===this.status?((e=new Error("No access to download image")).code=18,e.name="SecurityError",e):new Error("Error "+this.status+" downloading image"))},r.send()}))},k=function(e){return new R((function(t,n){(function(){var t=e.split(","),n=/data:([^;]+)/.exec(t[0]);if(!n)return v.none();for(var r=n[1],o=t[1],i=atob(o),a=i.length,u=Math.ceil(a/1024),c=new Array(u),s=0;s<u;++s){for(var f=1024*s,l=Math.min(1024+f,a),d=new Array(l-f),m=f,h=0;m<l;++h,++m)d[h]=i[m].charCodeAt(0);c[s]=new Uint8Array(d)}return v.some(new Blob(c,{type:r}))})().fold((function(){n("uri is not base64: "+e)}),t)}))},S=function(e){URL.revokeObjectURL(e.src)},M=E,P=Array.prototype.indexOf,O=Object.keys;function C(e,t,n){function r(t,n){return e.then((function(e){return e.toDataURL(t||"image/png",n)}))}return{getType:o(t.type),toBlob:function(){return R.resolve(t)},toDataURL:o(n),toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(t,n){return e.then((function(e){return T(e,t,n)}))},toAdjustedDataURL:r,toAdjustedBase64:function(e,t){return r(e,t).then((function(e){return e.split(",")[1]}))},toCanvas:function(){return e.then(_)}}}function L(e,t){return T(e,t).then((function(t){return C(R.resolve(e),t,e.toDataURL())}))}function F(e,t){void 0===t&&(t=2);var n=Math.pow(10,t),r=Math.round(e*n);return Math.ceil(r/n)}function B(e,t,n){return void 0===n&&(n=!1),new R((function(r){var o=new XMLHttpRequest;o.onreadystatechange=function(){4===o.readyState&&r({status:o.status,blob:o.response})},o.open("GET",e,!0),o.withCredentials=n,function(e){for(var t,n=O(e),r=0,i=n.length;r<i;r++){var a=n[r];t=e[a],o.setRequestHeader(a,t)}}(t),o.responseType="blob",o.send()}))}function N(e){var t,n=(t=e,"ImageProxy HTTP error: "+I(V,(function(e){return t===e.code})).fold(o("Unknown ImageProxy error"),(function(e){return e.message})));return R.reject(n)}function D(e){return I(G,(function(t){return t.type===e})).fold(o("Unknown service error"),(function(e){return e.message}))}function H(e){return e<200||300<=e}function z(e,n){var r,o,i,a={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":n};return B((o=n,i=-1===(r=e).indexOf("?")?"?":"&",/[?&]apiKey=/.test(r)?r:r+i+"apiKey="+encodeURIComponent(o)),a).then((function(e){return H(e.status)?(r=e.status,"application/json"!==(null==(o=e.blob)?void 0:o.type)||400!==r&&403!==r&&404!==r&&500!==r?N(r):(n=o,new R((function(e,t){var r=new FileReader;r.onload=function(){e(r.result)},r.onerror=function(e){t(e)},r.readAsText(n)})).then((function(e){var n=function(e){return"ImageProxy Service error: "+function(e){try{return v.some(JSON.parse(e))}catch(e){return v.none()}}(e).bind((function(e){return n=function(e,n){return t(e)?e[n]:void 0},r=e,x(["error","type"],(function(e,t){r=n(r,e)})),o=r,v.from(o).map(D);var n,r,o})).getOr("Invalid JSON in service error message")}(e);return R.reject(n)})))):R.resolve(e.blob);var n,r,o}))}function q(e,t,n){return void 0===n&&(n=!1),t?z(e,t):B(e,{},n).then((function(e){return H(e.status)?N(e.status):R.resolve(e.blob)}))}function W(e){return t=e,new R((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}
1)).then((function(t){return C(E(e).then((function(e){S(e);var t=b(e.naturalWidth||e.width,e.naturalHeight||e.height);return U(t).drawImage(e,0,0),t})),e,t)}));var t}function $(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}}!function(e){if(!u(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");var t=[],n={};x(e,(function(r,o){var i=O(r);if(1!==i.length)throw new Error("one and only one name per case");var a=i[0],c=r[a];if(void 0!==n[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!u(c))throw new Error("case arguments must be an array");t.push(a),n[a]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==c.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+c.length+" ("+c+"), got "+i);return{fold:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);return t[o].apply(null,n)},match:function(e){var r=O(e);if(t.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+r.join(","));if(!function(e){for(var t,n=0,o=e.length;n<o;++n)if(!0!==(t=e[n],function(e,t){return-1<P.call(e,t)}(r,t)))return;return 1}(t))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+t.join(", "));return e[a].apply(null,n)},log:function(e){console.log(e,{constructors:t,constructor:a,params:n})}}}}))}([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var V=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],G=[{type:"not_found",message:"Failed to load image."},{type:"key_missing",message:"The request did not include an api key."},{type:"key_not_found",message:"The provided api key could not be found."},{type:"domain_not_trusted",message:"The api key is not valid for the request origins."}],J={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return $(n.childNodes[0])},fromTag:function(e,t){return $((t||document).createElement(e))},fromText:function(e,t){return $((t||document).createTextNode(e))},fromDom:$,fromPoint:function(e,t,n){return v.from(e.dom.elementFromPoint(t,n)).map($)}};function K(e){return e.getParam("imagetools_proxy")}function X(e){function t(e){return/^[0-9\.]+px$/.test(e)}var n=e.style.width,r=e.style.height;return n||r?t(n)&&t(r)?{w:parseInt(n,10),h:parseInt(r,10)}:null:(n=e.width,r=e.height,n&&r?{w:parseInt(n,10),h:parseInt(r,10)}:null)}function Q(e){return{w:e.naturalWidth,h:e.naturalHeight}}function Y(e){return t=J.fromDom(e),"img",n=function(e){return function(t){var n=e.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(t);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(t);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(t);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}("img")},I(t.dom.childNodes,(function(e){return n(J.fromDom(e))})).map(J.fromDom);var t,n}function Z(e,t){return e.dom.is(t,"figure")}function ee(e,t){return e.dom.is(t,"img:not([data-mce-object],[data-mce-placeholder])")}function te(e,n){function r(n){return ee(e,n)&&(pe(e,n)||ve(e,n)||t(K(e)))}return Z(e,n)?Y(n).bind((function(e){return r(e.dom)?v.some(e.dom):v.none()})):r(n)?v.some(n):v.none()}function ne(e,t){e.notificationManager.open({text:t,type:"error"})}function re(e){var t=e.selection.getNode(),n=e.dom.getParent(t,"figure.image");return null!==n&&Z(e,n)?Y(n):ee(e,t)?v.some(J.fromDom(t)):v.none()}function oe(e,n,r){var o=n.match(/(?:\/|^)(([^\/\?]+)\.(?:[a-z0-9.]+))(?:\?|$)/i);return t(o)?e.dom.encode(o[r]):null}function ie(e,t){var n,r,o=e.editorUpload.blobCache.getByUri(t.src);return o?me.resolve(o.blob()):(n=e,r=t,v.from(n.getParam("imagetools_fetch_image",null,"function")).fold((function(){return function(e,t){if(ve(e,t))return q(t.src,null,(n=t,-1!==f.inArray(e.getParam("imagetools_credentials_hosts",[],"string[]"),new he(n.src).host)));var n,r;
1if(pe(e,t))return(0===(r=t.src).indexOf("data:")?k:j)(r);var o=K(e);return q(o+(-1===o.indexOf("?")?"?":"&")+"url="+encodeURIComponent(t.src),e.getParam("api_key",e.getParam("imagetools_api_key","","string"),"string"),!1)}(n,r)}),(function(e){return e(r)})))}function ae(e){de.clearTimeout(e.get())}function ue(e,n,r,o,i,a,u){return r.toBlob().then((function(c){var s,f,l,d=e.editorUpload.blobCache,m=a.src,h=n.type===c.type;return e.getParam("images_reuse_filename",!1,"boolean")&&(f=t(l=d.getByUri(m))?(m=l.uri(),s=l.name(),l.filename()):(s=oe(e,m,2),oe(e,m,1))),l=d.create({id:"imagetools"+ge++,blob:c,base64:r.toBase64(),uri:m,name:s,filename:h?f:void 0}),d.add(l),e.undoManager.transact((function(){var t=function(){var n,r,u;e.$(a).off("load",t),e.nodeChanged(),o?e.editorUpload.uploadImagesAuto():(ae(i),n=e,r=i,u=de.setEditorTimeout(n,(function(){n.editorUpload.uploadImagesAuto()}),n.getParam("images_upload_timeout",3e4,"number")),r.set(u))};e.$(a).on("load",t),u&&e.$(a).attr({width:u.w,height:u.h}),e.$(a).attr({src:l.blobUri()}).removeAttr("data-mce-src")})),l}))}function ce(e,t,n,r){return function(){return re(e).fold((function(){ne(e,"Could not find selected image")}),(function(o){return e._scanForImages().then((function(){return ie(e,o.dom)})).then((function(i){return W(i).then(n).then((function(n){return ue(e,i,n,!1,t,o.dom,r)}))})).catch((function(t){ne(e,t)}))}))}}function se(e,t,n){return function(){var r=re(e).map((function(e){var t=X(e.dom);return t?{w:t.h,h:t.w}:null})).getOrNull();return ce(e,t,(function(e){return r=n,(t=e).toCanvas().then((function(e){return function(e,t,n){var r=(n<0?360+n:n)*Math.PI/180,o=e.width,i=e.height,a=Math.sin(r),u=Math.cos(r),c=F(Math.abs(o*u)+Math.abs(i*a)),s=F(Math.abs(o*a)+Math.abs(i*u)),f=b(c,s),l=U(f);return l.translate(c/2,s/2),l.rotate(r),l.drawImage(e,-o/2,-i/2),L(f,t)}(e,t.getType(),r)}));var t,r}),r)()}}function fe(e,t,n){return function(){return ce(e,t,(function(e){return r=n,(t=e).toCanvas().then((function(e){return function(e,t,n){var r=b(e.width,e.height),o=U(r);return"v"===n?(o.scale(1,-1),o.drawImage(e,0,-r.height)):(o.scale(-1,1),o.drawImage(e,-r.width,0)),L(r,t)}(e,t.getType(),r)}));var t,r}))()}}function le(e,t){return function(){var n=re(e),o=n.map((function(e){return Q(e.dom)}));n.each((function(i){te(e,i.dom).each((function(a){ie(e,i.dom).then((function(i){var a={blob:i,url:URL.createObjectURL(i)};e.windowManager.open({title:"Edit Image",size:"large",body:{type:"panel",items:[{type:"imagetools",name:"imagetools",label:"Edit Image",currentState:a}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0,disabled:!0}],onSubmit:function(r){var i=r.getData().imagetools.blob;n.each((function(n){o.each((function(r){var o,a,u,c,s;o=e,a=t,u=n.dom,c=r,M(s=i).then((function(e){var t,n,r,o,i=Q(e);return c.w===i.w&&c.h===i.h||X(u)&&(t=u,(n=i)&&(r=t.style.width,o=t.style.height,(r||o)&&(t.style.width=n.w+"px",t.style.height=n.h+"px",t.removeAttribute("data-mce-style")),r=t.width,o=t.height,(r||o)&&(t.setAttribute("width",String(n.w)),t.setAttribute("height",String(n.h))))),URL.revokeObjectURL(e.src),s})).then(W).then((function(e){return ue(o,s,e,!0,a,u)}))}))})),r.close()},onCancel:r,onAction:function(e,t){switch(t.name){case"save-state":t.value?e.enable("save"):e.disable("save");break;case"disable":e.disable("save"),e.disable("cancel");break;case"enable":e.enable("cancel")}}})}))}))}))}}"undefined"!=typeof window||Function("return this;")();var de=tinymce.util.Tools.resolve("tinymce.util.Delay"),me=tinymce.util.Tools.resolve("tinymce.util.Promise"),he=tinymce.util.Tools.resolve("tinymce.util.URI"),ge=0,pe=function(e,t){var n=t.src;return 0===n.indexOf("data:")||0===n.indexOf("blob:")||new he(n).host===e.documentBaseURI.host},ve=function(e,t){return-1!==f.inArray(e.getParam("imagetools_cors_hosts",[],"string[]"),new he(t.src).host)};s.add("imagetools",(function(t){var n,r,o,i,a=e(0),u=e(null),c=t;f.each({mceImageRotateLeft:se(c,a,-90),mceImageRotateRight:se(c,a,90),mceImageFlipVertical:fe(c,a,"v"),mceImageFlipHorizontal:fe(c,a,"h"),mceEditImage:le(c,a)},(function(e,t){c.addCommand(t,e)})),function(e){function t(t){return function(){return e.execCommand(t)}}function n(){return re(e).exists((function(t){return te(e,t.dom).isSome()}))}function r(e){function t(t){return e.setDisabled(!t)}return t(n()),o=o.concat([t]),function(){o=function(e){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];i!==t&&n.push(i)}return n}(o)}}var o=[];e.on("NodeChange",(function(){var e=n();x(o,(function(t){return t(e)}))})),e.ui.registry.addButton("rotateleft",{tooltip:"Rotate counterclockwise",icon:"rotate-left",onAction:t("mceImageRotateLeft"),onSetup:r}),e.ui.registry.addButton("rotateright",{tooltip:"Rotate clockwise",icon:"rotate-right",onAction:t("mceImageRotateRight"),onSetup:r}),e.ui.registry.addButton("flipv",{tooltip:"Flip vertically",icon:"flip-vert
1ically",onAction:t("mceImageFlipVertical"),onSetup:r}),e.ui.registry.addButton("fliph",{tooltip:"Flip horizontally",icon:"flip-horizontally",onAction:t("mceImageFlipHorizontal"),onSetup:r}),e.ui.registry.addButton("editimage",{tooltip:"Edit image",icon:"edit-image",onAction:t("mceEditImage"),onSetup:r}),e.ui.registry.addButton("imageoptions",{tooltip:"Image options",icon:"image",onAction:t("mceImage")}),e.ui.registry.addContextMenu("imagetools",{update:function(n){return te(e,n).map((function(e){return{text:"Edit image",icon:"edit-image",onAction:t("mceEditImage")}})).toArray()}})}(t),(n=t).ui.registry.addContextToolbar("imagetools",{items:n.getParam("imagetools_toolbar","rotateleft rotateright flipv fliph editimage imageoptions"),predicate:function(e){return te(n,e).isSome()},position:"node",scope:"node"}),o=a,i=u,(r=t).on("NodeChange",(function(e){var t=i.get(),n=te(r,e.element);t&&!n.exists((function(e){return t.src===e.src}))&&(ae(o),r.editorUpload.uploadImagesAuto(),i.set(null)),n.each(i.set)}))}))}()}}]); 2//# sourceMappingURL=6541.6cd6ee07b9f09d3766bd.min.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.