WordPress/wp-includes/js/dist/wordcount.min.js

2 lines
2.6 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! This file is auto-generated */
!function(){"use strict";var e={d:function(n,r){for(var t in r)e.o(r,t)&&!e.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:r[t]})},o:function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{count:function(){return g}});const r={HTMLRegExp:/<\/?[a-z][^>]*?>/gi,HTMLcommentRegExp:/<!--[\s\S]*?-->/g,spaceRegExp:/&nbsp;|&#160;/gi,HTMLEntityRegExp:/&\S+?;/g,connectorRegExp:/--|\u2014/g,removeRegExp:new RegExp(["[","!-/:-@[-`{-~","€-¿×÷"," -⯿","⸀-⹿","]"].join(""),"g"),astralRegExp:/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,wordsRegExp:/\S\s+/g,characters_excluding_spacesRegExp:/\S/g,characters_including_spacesRegExp:/[^\f\n\r\t\v\u00AD\u2028\u2029]/g,l10n:{type:"words"}};function t(e,n){return n.replace(e.HTMLRegExp,"\n")}function c(e,n){return n.replace(e.astralRegExp,"a")}function o(e,n){return n.replace(e.HTMLEntityRegExp,"")}function u(e,n){return n.replace(e.connectorRegExp," ")}function l(e,n){return n.replace(e.removeRegExp,"")}function i(e,n){return n.replace(e.HTMLcommentRegExp,"")}function s(e,n){return e.shortcodesRegExp?n.replace(e.shortcodesRegExp,"\n"):n}function a(e,n){return n.replace(e.spaceRegExp," ")}function p(e,n){return n.replace(e.HTMLEntityRegExp,"a")}function d(e,n,r){var o,u;return e=[t.bind(null,r),i.bind(null,r),s.bind(null,r),c.bind(null,r),a.bind(null,r),p.bind(null,r)].reduce(((e,n)=>n(e)),e),null!==(o=null===(u=(e+="\n").match(n))||void 0===u?void 0:u.length)&&void 0!==o?o:0}function g(e,n,c){const p=function(e,n){var t,c;const o=Object.assign({},r,n);return o.shortcodes=null!==(t=null===(c=o.l10n)||void 0===c?void 0:c.shortcodes)&&void 0!==t?t:[],o.shortcodes&&o.shortcodes.length&&(o.shortcodesRegExp=new RegExp("\\[\\/?(?:"+o.shortcodes.join("|")+")[^\\]]*?\\]","g")),o.type=e,"characters_excluding_spaces"!==o.type&&"characters_including_spaces"!==o.type&&(o.type="words"),o}(n,c);let g;switch(p.type){case"words":return g=p.wordsRegExp,function(e,n,r){var c,p;return e=[t.bind(null,r),i.bind(null,r),s.bind(null,r),a.bind(null,r),o.bind(null,r),u.bind(null,r),l.bind(null,r)].reduce(((e,n)=>n(e)),e),null!==(c=null===(p=(e+="\n").match(n))||void 0===p?void 0:p.length)&&void 0!==c?c:0}(e,g,p);case"characters_including_spaces":return g=p.characters_including_spacesRegExp,d(e,g,p);case"characters_excluding_spaces":return g=p.characters_excluding_spacesRegExp,d(e,g,p);default:return 0}}(window.wp=window.wp||{}).wordcount=n}();