| Server IP : 85.158.181.41 / Your IP : 216.73.217.12 Web Server : Apache System : Linux cloud9-vm129 6.1.178+1-ph #ph SMP PREEMPT_DYNAMIC Wed Jul 29 09:00:54 UTC 2026 x86_64 User : moncbefd ( 1024) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/moncbefd/www.moneta.at/JSEngine/build/vendor/hyphenopoly/ |
Upload File : |
/**
* @license Hyphenopoly 2.6.1 - client side hyphenation for webbrowsers
* ©2019 Mathias Nater, Zürich (mathiasnater at gmail dot com)
* https://github.com/mnater/Hyphenopoly
*
* Released under the MIT license
* http://mnater.github.io/Hyphenopoly/LICENSE
*/
!function(e){"use strict";const n=Hyphenopoly,t=String.fromCharCode(173);function r(){return Object.create(null)}function o(e,n){return{configurable:(4&n)>0,enumerable:(2&n)>0,writable:(1&n)>0,value:e}}Math.imul=Math.imul||function(e,n){const t=65535&e,r=65535&n;return t*r+((e>>>16&65535)*r+t*(n>>>16&65535)<<16>>>0)|0},function(){const e=Object.create(null,{defaultLanguage:o("en-us",2),dontHyphenate:o(function(){const e=r();return"abbr,acronym,audio,br,button,code,img,input,kbd,label,math,option,pre,samp,script,style,sub,sup,svg,textarea,var,video".split(",").forEach(function(n){e[n]=!0}),e}(),2),dontHyphenateClass:o("donthyphenate",2),exceptions:o(r(),2),normalize:o(!1,2),safeCopy:o(!0,2),timeout:o(1e3,2)}),a=Object.create(e),i=Object.create(null,{compound:o("hyphen",2),hyphen:o(t,2),leftmin:o(0,2),leftminPerLang:o(0,2),minWordLength:o(6,2),orphanControl:o(1,2),rightmin:o(0,2),rightminPerLang:o(0,2)});Object.keys(n.setup).forEach(function(t){if("selectors"===t){const e=Object.keys(n.setup.selectors);Object.defineProperty(a,"selectors",o(e,2)),e.forEach(function(e){const t=r();Object.keys(n.setup.selectors[e]).forEach(function(r){t[r]=o(n.setup.selectors[e][r],2)}),Object.defineProperty(a,e,o(Object.create(i,t),2))})}else if("dontHyphenate"===t){const i=r();Object.keys(n.setup.dontHyphenate).forEach(function(e){i[e]=o(n.setup.dontHyphenate[e],2)}),Object.defineProperty(a,t,o(Object.create(e.dontHyphenate,i),3))}else Object.defineProperty(a,t,o(n.setup[t],3))}),n.c=a}(),function(){const a=n.c;let i=null,c=null;function s(e,n){try{return e.getAttribute("lang")?e.getAttribute("lang").toLowerCase():"html"===e.tagName.toLowerCase()?n?i:null:s(e.parentNode,n)}catch(e){return null}}function l(){c=function(){const e=r(),n=[0];return{add:function(t,r,o){const a={element:t,selector:o};return e[r]||(e[r]=[]),e[r].push(a),n[0]+=1,a},counter:n,each:function(n){Object.keys(e).forEach(function(t){n(t,e[t])})},list:e}}();const o=function(){let e="."+n.c.dontHyphenateClass,t=null;for(t in a.dontHyphenate)a.dontHyphenate[t]&&(e+=", "+t);return e}(),i=a.selectors.join(", ")+", "+o;function l(e,r,o,u){let f=null;u=u||!1,f=e.lang&&"string"==typeof e.lang?e.lang.toLowerCase():r&&""!==r?r.toLowerCase():s(e,!0),"H9Y"===n.clientFeat.langs[f]?(c.add(e,f,o),!u&&a.safeCopy&&function(e){e.addEventListener("copy",function(e){e.preventDefault();const n=window.getSelection().toString();e.clipboardData.setData("text/plain",n.replace(new RegExp(t,"g"),""))},!0)}(e)):n.clientFeat.langs[f]||n.events.dispatch("error",{msg:"Element with '"+f+"' found, but '"+f+".hpb' not loaded. Check language tags!"});const h=e.childNodes;Array.prototype.forEach.call(h,function(e){1!==e.nodeType||function(e,n){return e.matches||(e.matches=e.msMatchesSelector||e.webkitMatchesSelector),e.matches(n)}(e,i)||l(e,f,o,!0)})}a.selectors.forEach(function(n){const t=e.document.querySelectorAll(n);Array.prototype.forEach.call(t,function(e){l(e,s(e,!0),n,!1)})}),n.elementsReady=!0}const u=r();function f(e,n,t){const o=a[t],i=o.hyphen;function c(r){let a=e.cache[t][r];return a||(a=e.exceptions[r]?e.exceptions[r].replace(/-/g,o.hyphen):-1===r.indexOf("-")?e.hyphenateFunction(r,i,o.leftminPerLang[n],o.rightminPerLang[n]):function(r){const a=String.fromCharCode(8203);let i=null,c=0,s=null,l=r;if("auto"===o.compound||"all"===o.compound){for(i=r.split("-"),s=f(e,n,t);c<i.length;)i[c].length>=o.minWordLength&&(i[c]=s(i[c])),c+=1;l="auto"===o.compound?i.join("-"):i.join("-"+a)}else l=r.replace("-","-"+a);return l}(r),e.cache[t][r]=a),a}return e.cache[t]=r(),u[n+"-"+t]=c,c}const h=r();function p(e,t,r){const o=n.languages[e],i=a[t],s=i.minWordLength,l=a.normalize&&Boolean(String.prototype.normalize),p=e+"-"+t,g=u[p]?u[p]:f(o,e,t),d=h[t]?h[t]:function(e){function n(n,t,r,o){const i=a[e];let c=i.hyphen;return-1!==".\\+*?[^]$(){}=!<>|:-".indexOf(i.hyphen)&&(c="\\"+i.hyphen),3===i.orphanControl&&" "===t&&(t=String.fromCharCode(160)),t+r.replace(new RegExp(c,"g"),"")+o}return h[e]=n,n}(t),m=o.genRegExps[t];function y(e){let n=null;return n=l?e.normalize("NFC").replace(m,g):e.replace(m,g),1!==i.orphanControl&&(n=n.replace(/(\u0020*)(\S+)(\s*)$/,d)),n}let b=null;return"string"==typeof r?b=y(r):r instanceof HTMLElement&&function(t){n.events.dispatch("beforeElementHyphenation",{el:t,lang:e});const r=t.childNodes;Array.prototype.forEach.call(r,function(e){3===e.nodeType&&e.data.length>=s&&(e.data=y(e.data))}),c.counter[0]-=1,n.events.dispatch("afterElementHyphenation",{el:t,lang:e})}(r),b}function g(e,t){t?t.forEach(function(n){p(e,n.selector,n.element)}):n.events.dispatch("error",{msg:"engine for language '"+e+"' loaded, but no elements found."}),0===c.counter[0]&&n.events.dispatch("hyphenopolyEnd")}function d(e,t,i,c,s){i=i.replace(/-/g,""),n.languages||(n.languages=r()),n.languages[e]||(n.languages[e]=r());const l=n.languages[e];l.engineReady||(l.cache=r(),n.c.exceptions.global&&(n.c.exceptions[e]?n.c.exceptions[e]+=", "+n.c.exceptions.global:n.c.exceptions[e]=n.c.exceptions.global),n.c.exceptions[e]?(l.exceptions=function(e){const n=r();return e.split(", ").forEach(function(e){const t=e.replace(/-/g,"");n[t]=e}),n}(n.c.exceptions[e]),delete n.c.exceptions[e]):l.exceptions=r(),l.genRegExps=r(),l.leftmin=c,l.rightmin=s,l.hyphenateFunction=t,a.selectors.forEach(function(n){const t=a[n];0===t.leftminPerLang&&Object.defineProperty(t,"leftminPerLang",o(r(),2)),0===t.rightminPerLang&&Object.defineProperty(t,"rightminPerLang",o(r(),2)),t.leftminPerLang[e]?t.leftminPerLang[e]=Math.max(l.leftmin,t.leftmin,t.leftminPerLang[e]):t.leftminPerLang[e]=Math.max(l.leftmin,t.leftmin),t.rightminPerLang[e]?t.rightminPerLang[e]=Math.max(l.rightmin,t.rightmin,t.rightminPerLang[e]):t.rightminPerLang[e]=Math.max(l.rightmin,t.rightmin),l.genRegExps[n]=new RegExp("[\\w"+i+String.fromCharCode(8204)+"-]{"+t.minWordLength+",}","gi")}),l.engineReady=!0),Hyphenopoly.events.dispatch("engineReady",{msg:e})}function m(e){if(n.clientFeat.wasm)return 65536*Math.ceil(e/65536);const t=Math.ceil(Math.log2(e));return t<=12?4096:t<24?1<<t:Math.ceil(e/(1<<24))*(1<<24)}n.createHyphenator=function(e){return function(n,t){return p(e,t=t||".hyphenate",n)}};const y=function(){let e=null;if(window.TextDecoder){const n=new TextDecoder("utf-16le");e=function(e){return n.decode(e)}}else e=function(e){return String.fromCharCode.apply(null,e)};return e}();function b(e){const n=new Uint32Array(e).subarray(0,8),t=n[7],r=1280+t+(4-(1280+t)%4),o=r+4*n[6];return{heapSize:Math.max(m(o+576+n[2]+n[3]),2097152),hpbOffset:o+576,hpbPatternsOffset:o+576+n[2],hpbTranslateOffset:o+576+n[1],hyphenatedWordOffset:o+320,hyphenPointsOffset:o+256,leftmin:n[4],patternsLength:n[3],patternTrieOffset:r,rightmin:n[5],translatedWordOffset:o+128,valueStoreOffset:1280,wordOffset:o}}function w(e,t){const r=n.clientFeat.wasm?e.wasmMemory.buffer:e.heapBuffer,o=e.wordOffset,a=e.hyphenatedWordOffset,i=new Uint16Array(r).subarray(o>>1,64+(o>>1)),c=e.leftmin,s=e.rightmin,l=new Uint16Array(r).subarray(a>>1,128+(a>>1));return function(e,r,o,a){let u=0;const f=e.length;if(f>61)return n.events.dispatch("error",{msg:"found word longer than 61 characters"}),e;for(o=o||c,a=a||s,i[0]=f+2,i[1]=95;u<f;)i[u+2]=e.charCodeAt(u),u+=1;return i[u+2]=95,1===t(o,a)&&(e=y(l.subarray(1,l[0]+1)),""!==r&&(e=e.replace(/\u00AD/g,r))),e}}function L(e){Promise.all([n.binaries[e],n.binaries.hyphenEngine]).then(function(t){const r=t[0],o=b(r),a=t[1],i=n.specMems[e].buffer.byteLength>=o.heapSize?n.specMems[e]:new WebAssembly.Memory({initial:o.heapSize/65536,maximum:256});new Uint32Array(i.buffer).set(new Uint32Array(r),o.hpbOffset>>2),o.wasmMemory=i,WebAssembly.instantiate(a,{env:{memory:o.wasmMemory,memoryBase:0},ext:o}).then(function(n){const t=n.exports.convert();d(e,w(o,n.exports.hyphenate),y(new Uint16Array(i.buffer).subarray(385,384+t)),o.leftmin,o.rightmin)})})}function O(e){const t=n.binaries[e],r=b(t),o=n.specMems[e].byteLength>=r.heapSize?n.specMems[e]:new ArrayBuffer(r.heapSize),a=new Uint8Array(o),i=new Uint8Array(t);a.set(i,r.hpbOffset),r.heapBuffer=o;const c=asmHyphenEngine({Int32Array:window.Int32Array,Math:Math,Uint16Array:window.Uint16Array,Uint8Array:window.Uint8Array},r,r.heapBuffer),s=c.convert();d(e,w(r,c.hyphenate),y(new Uint16Array(o).subarray(385,384+s)),r.leftmin,r.rightmin)}let v=null;const x=[];function E(e,n){"*"===e?("wasm"===n?v=L:"asm"===n&&(v=O),x.forEach(function(e){v(e)})):v?v(e):x.push(e)}n.events.define("contentLoaded",function(){!function(){const n=e.document.getElementsByTagName("html")[0];(i=s(n,!1))||""===a.defaultLanguage||(i=a.defaultLanguage)}(),l(),n.events.dispatch("elementsReady")},!1),n.events.define("elementsReady",function(){c.each(function(e,t){n.languages&&n.languages[e]&&n.languages[e].engineReady&&g(e,t)})},!1),n.events.define("engineLoaded",function(e){E("*",e.msg)},!1),n.events.define("hpbLoaded",function(e){E(e.msg,"*")},!1),n.events.define("engineReady",function(e){n.elementsReady&&g(e.msg,c.list[e.msg])},!1),n.events.define("hyphenopolyStart",null,!0),n.events.define("hyphenopolyEnd",function(){e.clearTimeout(a.timeOutHandler),"none"!==n.c.hide&&n.toggle("on")},!1),n.events.define("beforeElementHyphenation",null,!0),n.events.define("afterElementHyphenation",null,!0),n.events.tempRegister.forEach(function(e){n.events.addListener(e.name,e.handler,!1)}),delete n.events.tempRegister,n.events.dispatch("hyphenopolyStart",{msg:"Hyphenopoly started"}),e.clearTimeout(n.c.timeOutHandler),Object.defineProperty(a,"timeOutHandler",o(e.setTimeout(function(){n.events.dispatch("timeout",{delay:a.timeout})},a.timeout),2)),n.events.deferred.forEach(function(e){n.events.dispatch(e.name,e.data)}),delete n.events.deferred}()}(window);