Файл: wysiwyg/tinymce/files/plugins/wordcount/plugin.min.js
Строк: 284
<?php
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.0 (2020-05-21)
*/
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(t){return t},i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},e="[-'\.u2018u2019u2024ufe52uff07uff0e]",n="[:xb7xb7u05f4u2027ufe13ufe55uff1a]",o="[xb1+*/,;;u0589u060cu060du066cu07f8u2044ufe10ufe14ufe50ufe54uff0cuff1b]",u="[0-9u0660-u0669u066bu06f0-u06f9u07c0-u07c9u0966-u096fu09e6-u09efu0a66-u0a6fu0ae6-u0aefu0b66-u0b6fu0be6-u0befu0c66-u0c6fu0ce6-u0cefu0d66-u0d6fu0e50-u0e59u0ed0-u0ed9u0f20-u0f29u1040-u1049u1090-u1099u17e0-u17e9u1810-u1819u1946-u194fu19d0-u19d9u1a80-u1a89u1a90-u1a99u1b50-u1b59u1bb0-u1bb9u1c40-u1c49u1c50-u1c59ua620-ua629ua8d0-ua8d9ua900-ua909ua9d0-ua9d9uaa50-uaa59uabf0-uabf9]",c="\r",a="\n",s="[x0Bfx85u2028u2029]",g="[u0300-u036fu0483-u0489u0591-u05bdu05bfu05c1u05c2u05c4u05c5u05c7u0610-u061au064b-u065fu0670u06d6-u06dcu06df-u06e4u06e7u06e8u06ea-u06edu0711u0730-u074au07a6-u07b0u07eb-u07f3u0816-u0819u081b-u0823u0825-u0827u0829-u082du0859-u085bu0900-u0903u093a-u093cu093e-u094fu0951-u0957u0962u0963u0981-u0983u09bcu09be-u09c4u09c7u09c8u09cb-u09cdu09d7u09e2u09e3u0a01-u0a03u0a3cu0a3e-u0a42u0a47u0a48u0a4b-u0a4du0a51u0a70u0a71u0a75u0a81-u0a83u0abcu0abe-u0ac5u0ac7-u0ac9u0acb-u0acdu0ae2u0ae3u0b01-u0b03u0b3cu0b3e-u0b44u0b47u0b48u0b4b-u0b4du0b56u0b57u0b62u0b63u0b82u0bbe-u0bc2u0bc6-u0bc8u0bca-u0bcdu0bd7u0c01-u0c03u0c3e-u0c44u0c46-u0c48u0c4a-u0c4du0c55u0c56u0c62u0c63u0c82u0c83u0cbcu0cbe-u0cc4u0cc6-u0cc8u0cca-u0ccdu0cd5u0cd6u0ce2u0ce3u0d02u0d03u0d3e-u0d44u0d46-u0d48u0d4a-u0d4du0d57u0d62u0d63u0d82u0d83u0dcau0dcf-u0dd4u0dd6u0dd8-u0ddfu0df2u0df3u0e31u0e34-u0e3au0e47-u0e4eu0eb1u0eb4-u0eb9u0ebbu0ebcu0ec8-u0ecdu0f18u0f19u0f35u0f37u0f39u0f3eu0f3fu0f71-u0f84u0f86u0f87u0f8d-u0f97u0f99-u0fbcu0fc6u102b-u103eu1056-u1059u105e-u1060u1062-u1064u1067-u106du1071-u1074u1082-u108du108fu109a-u109du135d-u135fu1712-u1714u1732-u1734u1752u1753u1772u1773u17b6-u17d3u17ddu180b-u180du18a9u1920-u192bu1930-u193bu19b0-u19c0u19c8u19c9u1a17-u1a1bu1a55-u1a5eu1a60-u1a7cu1a7fu1b00-u1b04u1b34-u1b44u1b6b-u1b73u1b80-u1b82u1ba1-u1baau1be6-u1bf3u1c24-u1c37u1cd0-u1cd2u1cd4-u1ce8u1cedu1cf2u1dc0-u1de6u1dfc-u1dffu200cu200du20d0-u20f0u2cef-u2cf1u2d7fu2de0-u2dffu302a-u302fu3099u309aua66f-ua672ua67cua67dua6f0ua6f1ua802ua806ua80bua823-ua827ua880ua881ua8b4-ua8c4ua8e0-ua8f1ua926-ua92dua947-ua953ua980-ua983ua9b3-ua9c0uaa29-uaa36uaa43uaa4cuaa4duaa7buaab0uaab2-uaab4uaab7uaab8uaabeuaabfuaac1uabe3-uabeauabecuabedufb1eufe00-ufe0fufe20-ufe26uff9euff9f]",l="[xadu0600-u0603u06ddu070fu17b4u17b5u200eu200fu202a-u202eu2060-u2064u206a-u206fufeffufff9-ufffb]",p="[u3031-u3035u309bu309cu30a0-u30fau30fc-u30ffu31f0-u31ffu32d0-u32feu3300-u3357uff66-uff9d]",d="[=_u203fu2040u2054ufe33ufe34ufe4d-ufe4fuff3fu2200-u22ff<>]",f="[!-#%-*,-\/:;?@\[-\]_{}xa1xabxb7xbbxbf;xb7u055a-u055fu0589u058au05beu05c0u05c3u05c6u05f3u05f4u0609u060au060cu060du061bu061eu061fu066a-u066du06d4u0700-u070du07f7-u07f9u0830-u083eu085eu0964u0965u0970u0df4u0e4fu0e5au0e5bu0f04-u0f12u0f3a-u0f3du0f85u0fd0-u0fd4u0fd9u0fdau104a-u104fu10fbu1361-u1368u1400u166du166eu169bu169cu16eb-u16edu1735u1736u17d4-u17d6u17d8-u17dau1800-u180au1944u1945u1a1eu1a1fu1aa0-u1aa6u1aa8-u1aadu1b5a-u1b60u1bfc-u1bffu1c3b-u1c3fu1c7eu1c7fu1cd3u2010-u2027u2030-u2043u2045-u2051u2053-u205eu207du207eu208du208eu3008u3009u2768-u2775u27c5u27c6u27e6-u27efu2983-u2998u29d8-u29dbu29fcu29fdu2cf9-u2cfcu2cfeu2cffu2d70u2e00-u2e2eu2e30u2e31u3001-u3003u3008-u3011u3014-u301fu3030u303du30a0u30fbua4feua4ffua60d-ua60fua673ua67eua6f2-ua6f7ua874-ua877ua8ceua8cfua8f8-ua8faua92eua92fua95fua9c1-ua9cdua9deua9dfuaa5c-uaa5fuaadeuaadfuabebufd3eufd3fufe10-ufe19ufe30-ufe52ufe54-ufe61ufe63ufe68ufe6aufe6buff01-uff03uff05-uff0auff0c-uff0fuff1auff1buff1fuff20uff3b-uff3duff3fuff5buff5duff5f-uff65]",m=0,E=1,W=2,x=3,R=4,b=5,S=6,F=7,j=8,A=9,D=10,T=11,B=12,h=13,C=[new RegExp("[A-Za-zxaaxb5xbaxc0-xd6xd8-xf6xf8-u02c1u02c6-u02d1u02e0-u02e4u02ecu02eeu0370-u0374u0376u0377u037a-u037du0386u0388-u038au038cu038e-u03a1u03a3-u03f5u03f7-u0481u048a-u0527u0531-u0556u0559u0561-u0587u05d0-u05eau05f0-u05f3u0620-u064au066eu066fu0671-u06d3u06d5u06e5u06e6u06eeu06efu06fa-u06fcu06ffu0710u0712-u072fu074d-u07a5u07b1u07ca-u07eau07f4u07f5u07fau0800-u0815u081au0824u0828u0840-u0858u0904-u0939u093du0950u0958-u0961u0971-u0977u0979-u097fu0985-u098cu098fu0990u0993-u09a8u09aa-u09b0u09b2u09b6-u09b9u09bdu09ceu09dcu09ddu09df-u09e1u09f0u09f1u0a05-u0a0au0a0fu0a10u0a13-u0a28u0a2a-u0a30u0a32u0a33u0a35u0a36u0a38u0a39u0a59-u0a5cu0a5eu0a72-u0a74u0a85-u0a8du0a8f-u0a91u0a93-u0aa8u0aaa-u0ab0u0ab2u0ab3u0ab5-u0ab9u0abdu0ad0u0ae0u0ae1u0b05-u0b0cu0b0fu0b10u0b13-u0b28u0b2a-u0b30u0b32u0b33u0b35-u0b39u0b3du0b5cu0b5du0b5f-u0b61u0b71u0b83u0b85-u0b8au0b8e-u0b90u0b92-u0b95u0b99u0b9au0b9cu0b9eu0b9fu0ba3u0ba4u0ba8-u0baau0bae-u0bb9u0bd0u0c05-u0c0cu0c0e-u0c10u0c12-u0c28u0c2a-u0c33u0c35-u0c39u0c3du0c58u0c59u0c60u0c61u0c85-u0c8cu0c8e-u0c90u0c92-u0ca8u0caa-u0cb3u0cb5-u0cb9u0cbdu0cdeu0ce0u0ce1u0cf1u0cf2u0d05-u0d0cu0d0e-u0d10u0d12-u0d3au0d3du0d4eu0d60u0d61u0d7a-u0d7fu0d85-u0d96u0d9a-u0db1u0db3-u0dbbu0dbdu0dc0-u0dc6u0f00u0f40-u0f47u0f49-u0f6cu0f88-u0f8cu10a0-u10c5u10d0-u10fau10fcu1100-u1248u124a-u124du1250-u1256u1258u125a-u125du1260-u1288u128a-u128du1290-u12b0u12b2-u12b5u12b8-u12beu12c0u12c2-u12c5u12c8-u12d6u12d8-u1310u1312-u1315u1318-u135au1380-u138fu13a0-u13f4u1401-u166cu166f-u167fu1681-u169au16a0-u16eau16ee-u16f0u1700-u170cu170e-u1711u1720-u1731u1740-u1751u1760-u176cu176e-u1770u1820-u1877u1880-u18a8u18aau18b0-u18f5u1900-u191cu1a00-u1a16u1b05-u1b33u1b45-u1b4bu1b83-u1ba0u1baeu1bafu1bc0-u1be5u1c00-u1c23u1c4d-u1c4fu1c5a-u1c7du1ce9-u1cecu1cee-u1cf1u1d00-u1dbfu1e00-u1f15u1f18-u1f1du1f20-u1f45u1f48-u1f4du1f50-u1f57u1f59u1f5bu1f5du1f5f-u1f7du1f80-u1fb4u1fb6-u1fbcu1fbeu1fc2-u1fc4u1fc6-u1fccu1fd0-u1fd3u1fd6-u1fdbu1fe0-u1fecu1ff2-u1ff4u1ff6-u1ffcu2071u207fu2090-u209cu2102u2107u210a-u2113u2115u2119-u211du2124u2126u2128u212a-u212du212f-u2139u213c-u213fu2145-u2149u214eu2160-u2188u24b6-u24e9u2c00-u2c2eu2c30-u2c5eu2c60-u2ce4u2ceb-u2ceeu2d00-u2d25u2d30-u2d65u2d6fu2d80-u2d96u2da0-u2da6u2da8-u2daeu2db0-u2db6u2db8-u2dbeu2dc0-u2dc6u2dc8-u2dceu2dd0-u2dd6u2dd8-u2ddeu2e2fu3005u303bu303cu3105-u312du3131-u318eu31a0-u31baua000-ua48cua4d0-ua4fdua500-ua60cua610-ua61fua62aua62bua640-ua66eua67f-ua697ua6a0-ua6efua717-ua71fua722-ua788ua78b-ua78eua790ua791ua7a0-ua7a9ua7fa-ua801ua803-ua805ua807-ua80aua80c-ua822ua840-ua873ua882-ua8b3ua8f2-ua8f7ua8fbua90a-ua925ua930-ua946ua960-ua97cua984-ua9b2ua9cfuaa00-uaa28uaa40-uaa42uaa44-uaa4buab01-uab06uab09-uab0euab11-uab16uab20-uab26uab28-uab2euabc0-uabe2uac00-ud7a3ud7b0-ud7c6ud7cb-ud7fbufb00-ufb06ufb13-ufb17ufb1dufb1f-ufb28ufb2a-ufb36ufb38-ufb3cufb3eufb40ufb41ufb43ufb44ufb46-ufbb1ufbd3-ufd3dufd50-ufd8fufd92-ufdc7ufdf0-ufdfbufe70-ufe74ufe76-ufefcuff21-uff3auff41-uff5auffa0-uffbeuffc2-uffc7uffca-uffcfuffd2-uffd7uffda-uffdc]"),new RegExp(e),new RegExp(n),new RegExp(o),new RegExp(u),new RegExp(c),new RegExp(a),new RegExp(s),new RegExp(g),new RegExp(l),new RegExp(p),new RegExp(d),new RegExp("@")],y=new RegExp("^"+f+"$"),v=C,w=h,k=function(t){for(var e=w,n=v.length,r=0;r<n;++r){var o=v[r];if(o&&o.test(t)){e=r;break}}return e},P=function(t){var n,r;return function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var u=t[o];r[o]=e(u,o)}return r}(t,(n=k,r={},function(t){if(r[t])return r[t];var e=n(t);return r[t]=e}))},M=/^s+$/,O=y,U=function(t,e){var n=function(t,e){var n;for(n=e;n<t.length&&!M.test(t[n]);n++);return n}(t,e+1);return"://"===t.slice(e+1,n).join("").substr(0,3)?n:e},_=function(t,e,n){n=i(i({},{includeWhitespace:!1,includePunctuation:!1}),n);for(var r=[],o=[],u=0;u<t.length;u++){var c=e(t[u]);"ufeff"!==c&&(r.push(t[u]),o.push(c))}return function(t,e,n,r){for(var o,u,c,i,a,s,g,l=[],p=[],d=0;d<n.length;++d)if(p.push(t[d]),a=i=void 0,s=(u=n)[c=d],g=u[c+1],!(c<0||c>u.length-1&&0!==c||s===m&&g===m||(a=u[c+2],s===m&&(g===W||g===E||g===B)&&a===m||(i=u[c-1],(s===W||s===E||g===B)&&g===m&&i===m||!(s!==R&&s!==m||g!==R&&g!==m)||(s===x||s===E)&&g===R&&i===R||s===R&&(g===x||g===E)&&a===R||s===j||s===A||i===j||i===A||g===j||g===A||s===b&&g===S||s!==F&&s!==b&&s!==S&&g!==F&&g!==b&&g!==S&&(s===D&&g===D||g===T&&(s===m||s===R||s===D||s===T)||s===T&&(g===m||g===R||g===D)||s===B))))){var f=e[d];if((r.includeWhitespace||!M.test(f))&&(r.includePunctuation||!O.test(f))){var h=d-p.length+1,C=d+1,y=e.slice(h,C).join("");if("http"===(o=y)||"https"===o){var v=U(e,d),w=t.slice(C,v);Array.prototype.push.apply(p,w),d=v}l.push(p)}p=[]}return l}(r,o,P(o),n)},N=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),$=function(t,e){for(var n,r=e.getBlockElements(),o=e.getShortEndedElements(),u=[],c="",i=new N(t,t);t=i.next();)3===t.nodeType?c+=t.data.replace(/uFEFF/g,""):(r[(n=t).nodeName]||o[n.nodeName])&&c.length&&(u.push(c),c="");return c.length&&u.push(c),u},z=function(t){return t.replace(/[uD800-uDBFF][uDC00-uDFFF]/g,"_").length},I=function(t,e){var n=$(t,e).join("n");return _(n.split(""),r).length},Z=function(t,e){var n=$(t,e).join("");return z(n)},q=function(t,e){var n=$(t,e).join("").replace(/s/g,"");return z(n)},G=function(t,e){return function(){return e(t.getBody(),t.schema)}},H=function(t,e){return function(){return e(t.selection.getRng().cloneContents(),t.schema)}},J=function(t){return G(t,I)},K=tinymce.util.Tools.resolve("tinymce.util.Delay"),L=function(t,e){var n;n=e,t.fire("wordCountUpdate",{wordCount:{words:n.body.getWordCount(),characters:n.body.getCharacterCount(),charactersWithoutSpaces:n.body.getCharacterCountWithoutSpaces()}})},Q=function(t,e){t.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(e.body.getWordCount()),String(e.selection.getWordCount())],["Characters (no spaces)",String(e.body.getCharacterCountWithoutSpaces()),String(e.selection.getCharacterCountWithoutSpaces())],["Characters",String(e.body.getCharacterCount()),String(e.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})};!function V(s){void 0===s&&(s=300),t.add("wordcount",function(t){var e,n,r,o,u,c,i,a={body:{getWordCount:J(e=t),getCharacterCount:G(e,Z),getCharacterCountWithoutSpaces:G(e,q)},selection:{getWordCount:H(e,I),getCharacterCount:H(e,Z),getCharacterCountWithoutSpaces:H(e,q)},getCount:J(e)};return r=a,(n=t).ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:function(){return Q(n,r)}}),n.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:function(){return Q(n,r)}}),o=t,u=a,c=s,i=K.debounce(function(){return L(o,u)},c),o.on("init",function(){L(o,u),K.setEditorTimeout(o,function(){o.on("SetContent BeforeAddUndo Undo Redo keyup",i)},0)}),a})}()}();
?>