fuck-tiny-cloud/plugins/formatpainter/plugin.min.js

10 lines
16 KiB
JavaScript
Raw Normal View History

2023-11-01 22:54:59 -04:00
/*!
* Tiny FormatPainter plugin
*
* Copyright (c) 2023 Ephox Corporation DBA Tiny Technologies, Inc.
* Licensed under the Tiny commercial license. See https://www.tiny.cloud/legal/
*
* Version: 2.0.2-52
*/
!function(){"use strict";const e=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}},t=e=>parseInt(e,10),r=(e,t)=>{const r=e-t;return 0===r?0:r>0?1:-1},o=(e,t,r)=>({major:e,minor:t,patch:r}),n=e=>{const r=/([0-9]+)\.([0-9]+)\.([0-9]+)(?:(\-.+)?)/.exec(e);return r?o(t(r[1]),t(r[2]),t(r[3])):o(0,0,0)},s=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(r=o=e,(n=String).prototype.isPrototypeOf(r)||(null===(s=o.constructor)||void 0===s?void 0:s.name)===n.name)?"string":t;var r,o,n,s})(t)===e,i=e=>t=>typeof t===e,a=s("string"),c=s("array"),l=i("boolean"),m=(void 0,e=>undefined===e);const u=e=>!(e=>null==e)(e),d=i("function"),g=i("number"),h=e=>()=>e,f=e=>e,p=h(!1),v=h(!0);class b{constructor(e,t){this.tag=e,this.value=t}static some(e){return new b(!0,e)}static none(){return b.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?b.some(e(this.value)):b.none()}bind(e){return this.tag?e(this.value):b.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:b.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return u(e)?b.some(e):b.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}b.singletonNone=new b(!1);const y=Array.prototype.indexOf,S=Array.prototype.push,w=(e,t)=>((e,t)=>y.call(e,t))(e,t)>-1,x=(e,t)=>{for(let r=0,o=e.length;r<o;r++)if(t(e[r],r))return!0;return!1},k=(e,t)=>{const r=e.length,o=new Array(r);for(let n=0;n<r;n++){const r=e[n];o[n]=t(r,n)}return o},A=(e,t)=>{const r=[];for(let o=0,n=e.length;o<n;o++){const n=e[o];t(n,o)&&r.push(n)}return r},O=(e,t)=>((e,t,r)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];if(t(n,o))return b.some(n);if(r(n,o))break}return b.none()})(e,t,p),C=(e,t)=>(e=>{const t=[];for(let r=0,o=e.length;r<o;++r){if(!c(e[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+e);S.apply(t,e[r])}return t})(k(e,t)),L=()=>R(0,0),R=(e,t)=>({major:e,minor:t}),T={nu:R,detect:(e,t)=>{const r=String(t).toLowerCase();return 0===e.length?L():((e,t)=>{const r=((e,t)=>{for(let r=0;r<e.length;r++){const o=e[r];if(o.test(t))return o}})(e,t);if(!r)return{major:0,minor:0};const o=e=>Number(t.replace(r,"$"+e));return R(o(1),o(2))})(e,r)},unknown:L},_=(e,t)=>{const r=String(t).toLowerCase();return O(e,(e=>e.search(r)))},P=(e,t,r=0,o)=>{const n=e.indexOf(t,r);return-1!==n&&(!!m(o)||n+t.length<=o)},F=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,E=e=>t=>P(t,e),N=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>P(e,"edge/")&&P(e,"chrome")&&P(e,"safari")&&P(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,F],search:e=>P(e,"chrome")&&!P(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>P(e,"msie")||P(e,"trident")},{name:"Opera",versionRegexes:[F,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:E("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:E("firefox")},{name:"Safari",versionRegexes:[F,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(P(e,"safari")||P(e,"mobile/"))&&P(e,"applewebkit")}],B=[{name:"Windows",search:E("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>P(e,"iphone")||P(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:E("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:E("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:E("linux"),versionRe