-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.min.js
More file actions
1 lines (1 loc) · 2.83 KB
/
Copy pathmain.min.js
File metadata and controls
1 lines (1 loc) · 2.83 KB
1
!function(){const t=new Function("try{return this===window;}catch(e){return false;}")();function n(t){const n=[];function e(){const e=parseInt(t.split("/",1)[0]);if(Number.isNaN(e))return;const r=t.substring(e.toString().length+1,e.toString().length+1+e),s=(t=t.substring(e.toString().length+1+e)).split(":")[0].indexOf(",")+1,o=s?t.split(",",1)[0].split("."):t.split(":",1)[0].split(".");return n.push([r,o]),t=t.substring(o.join(".").length+1),s}let r;for(;(r=e())&&r;);return[t,n]}async function e(t,n){return t.split(n).length-1}function r(t,n){return n.match(new RegExp(`.{${t}}`,"g"))}async function s(t,n,r){const s=await e(n,t),o=[];for(let e=0;e<s;e++)o.push(n.indexOf(t)),n=n.replace(t,"");const i=await async function(t){return await e(t,t[0])===t.length?t.length+"/"+t[0]:"/"+t}(t);if(r){let t="";return r.forEach(n=>{t+=`,${n[0].length}/${n[0]+n[1].join(".")}`}),`${i.length}/${i}${o.join(".")}${t}:${n}`}return`${i.length}/${i}${o.join(".")}:${n}`}async function o(t,e,o,i,l){const c=t.length;let a;e&&(a=n(t),t=a[0],a=a[1]);const g=function(){let n,e=2;const s=[];for(let c=0,a=function(t){return"full"===o.searchLength?Math.floor(t.length/2):Math.min(o.searchLength,Math.floor(t.length/2))}(t);c<a;c++){for(let n=0;n<e;n++){const o=r(e,t.substring(n));o&&s.push(o)}const g=Math.floor(c/a*100);g!==n&&(o.progressUpdate("searching",g,i,l),n=g),e++}return o.progressUpdate("searching",100,i,l),s}();let h,f,p,u;for(let n=0,e=g.length;n<e;n++){const r=g[n].length;let d,w=0;for(const h of g[n]){u||(f=(p=await s(h,t,a)).length,u=!0);const g=await s(h,t,a);g.length<f&&(f=g.length,p=g);const m=Math.floor(w++/r*100);m!==d&&(c>6e3&&o.progressUpdate(`formatting section ${n}/${e}`,m,i,l),d=m)}c>6e3&&o.progressUpdate(`formatting section ${e}/${e}`,100,i,l);const m=Math.floor(n/e*100);m!==h&&(o.progressUpdate("formatting",m,i,l),h=m)}return o.progressUpdate("formatting",100,i,l),p}Object.defineProperty(t?window:global,"CL",{value:{},writable:!1});const i={searchLength:"full",progressUpdate:()=>{}};CL.compress=async function(t,n){if("string"!=typeof t)throw new TypeError("Invalid arguments passed");if(t.length<3)throw new RangeError("String is too small");if(n)for(const t in i)n.hasOwnProperty(t)||(n[t]=i[t]);else n=i;const e=t;t.length;let r,s,l=!1,c=0;for(;(r=await o(r||t,l,n,c++,e.length-(r?r.length:e.length)))&&!(e.length<=r.length||s&&s.length<=r.length);)s=r,l=!0;const a=s||r;return{value:a,compressed:l,compressionPower:e.length-a.length}},CL.decompress=function(t){if("string"!=typeof t)throw new TypeError("Invalid arguments passed");const e=(t=n(t))[1];return t=t[0],e.forEach(n=>{const e=function(t){return t.indexOf("/")?t.split("/")[1].repeat(parseInt(t.split("/")[0])):t.substring(1)}(n[0]),r=n[1];r.reverse(),r.forEach(n=>{t=function(t,n,e){return t.slice(0,n)+e+t.slice(n)}(t,n,e)})}),t},t||(exports.compress=CL.compress,exports.decompress=CL.decompress)}();