ScopeSentry/static/assets/InputPassword-B6TqopqF.js

2 lines
26 KiB
JavaScript
Raw Normal View History

2024-06-16 15:27:55 +00:00
import{af as e,d as t,a5 as s,a3 as n,r,B as a,o,c as i,e as l,K as c,a as h,n as u,f as d,j as g,k as p,Z as f,_ as m}from"./index-RTeQX4Z1.js";const b=(e,t)=>e.push.apply(e,t),y=e=>e.sort(((e,t)=>e.i-t.i||e.j-t.j)),k=e=>{const t={};let s=1;return e.forEach((e=>{t[e]=s,s+=1})),t};const w={4:[[1,2],[2,3]],5:[[1,3],[2,3],[2,4]],6:[[1,2],[2,4],[4,5]],7:[[1,3],[2,3],[4,5],[4,6]],8:[[2,4],[4,6]]},x=/^[A-Z\xbf-\xdf][^A-Z\xbf-\xdf]+$/,M=/^[^A-Z\xbf-\xdf]+[A-Z\xbf-\xdf]$/,v=/^[A-Z\xbf-\xdf]+$/,S=/^[^a-z\xdf-\xff]+$/,j=/^[a-z\xdf-\xff]+$/,I=/^[^A-Z\xbf-\xdf]+$/,T=/[a-z\xdf-\xff]/,A=/[A-Z\xbf-\xdf]/,C=/[^A-Za-z\xbf-\xdf]/gi,D=/^\d+$/,E=(new Date).getFullYear(),L={recentYear:/19\d\d|200\d|201\d|202\d/g},P=[" ",",",";",":","|","/","\\","_",".","-"],R=P.length;class N{match({password:e}){const t=[...this.getMatchesWithoutSeparator(e),...this.getMatchesWithSeparator(e)],s=this.filterNoise(t);return y(s)}getMatchesWithSeparator(e){const t=[],s=/^(\d{1,4})([\s/\\_.-])(\d{1,2})\2(\d{1,4})$/;for(let n=0;n<=Math.abs(e.length-6);n+=1)for(let r=n+5;r<=n+9&&!(r>=e.length);r+=1){const a=e.slice(n,+r+1||9e9),o=s.exec(a);if(null!=o){const e=this.mapIntegersToDayMonthYear([parseInt(o[1],10),parseInt(o[3],10),parseInt(o[4],10)]);null!=e&&t.push({pattern:"date",token:a,i:n,j:r,separator:o[2],year:e.year,month:e.month,day:e.day})}}return t}getMatchesWithoutSeparator(e){const t=[],s=/^\d{4,8}$/,n=e=>Math.abs(e.year-E);for(let r=0;r<=Math.abs(e.length-4);r+=1)for(let a=r+3;a<=r+7&&!(a>=e.length);a+=1){const o=e.slice(r,+a+1||9e9);if(s.exec(o)){const e=[],s=o.length;if(w[s].forEach((([t,s])=>{const n=this.mapIntegersToDayMonthYear([parseInt(o.slice(0,t),10),parseInt(o.slice(t,s),10),parseInt(o.slice(s),10)]);null!=n&&e.push(n)})),e.length>0){let s=e[0],i=n(e[0]);e.slice(1).forEach((e=>{const t=n(e);t<i&&(s=e,i=t)})),t.push({pattern:"date",token:o,i:r,j:a,separator:"",year:s.year,month:s.month,day:s.day})}}}return t}filterNoise(e){return e.filter((t=>{let s=!1;const n=e.length;for(let r=0;r<n;r+=1){const n=e[r];if(t!==n&&n.i<=t.i&&n.j>=t.j){s=!0;break}}return!s}))}mapIntegersToDayMonthYear(e){if(e[1]>31||e[1]<=0)return null;let t=0,s=0,n=0;for(let r=0,a=e.length;r<a;r+=1){const a=e[r];if(a>99&&a<1e3||a>2050)return null;a>31&&(s+=1),a>12&&(t+=1),a<=0&&(n+=1)}return s>=2||3===t||n>=2?null:this.getDayMonth(e)}getDayMonth(e){const t=[[e[2],e.slice(0,2)],[e[0],e.slice(1,3)]],s=t.length;for(let n=0;n<s;n+=1){const[e,s]=t[n];if(1e3<=e&&e<=2050){const t=this.mapIntegersToDayMonth(s);return null!=t?{year:e,month:t.month,day:t.day}:null}}for(let n=0;n<s;n+=1){const[e,s]=t[n],r=this.mapIntegersToDayMonth(s);if(null!=r)return{year:this.twoToFourDigitYear(e),month:r.month,day:r.day}}return null}mapIntegersToDayMonth(e){const t=[e,e.slice().reverse()];for(let s=0;s<t.length;s+=1){const e=t[s],n=e[0],r=e[1];if(n>=1&&n<=31&&r>=1&&r<=12)return{day:n,month:r}}return null}twoToFourDigitYear(e){return e>99?e:e>50?e+1900:e+2e3}}const O=new Uint32Array(65536),F=(e,t)=>{if(e.length<t.length){const s=t;t=e,e=s}return 0===t.length?e.length:e.length<=32?((e,t)=>{const s=e.length,n=t.length,r=1<<s-1;let a=-1,o=0,i=s,l=s;for(;l--;)O[e.charCodeAt(l)]|=1<<l;for(l=0;l<n;l++){let e=O[t.charCodeAt(l)];const s=e|o;e|=(e&a)+a^a,o|=~(e|a),a&=e,o&r&&i++,a&r&&i--,o=o<<1|1,a=a<<1|~(s|o),o&=s}for(l=s;l--;)O[e.charCodeAt(l)]=0;return i})(e,t):((e,t)=>{const s=t.length,n=e.length,r=[],a=[],o=Math.ceil(s/32),i=Math.ceil(n/32);for(let p=0;p<o;p++)a[p]=-1,r[p]=0;let l=0;for(;l<i-1;l++){let o=0,i=-1;const c=32*l,h=Math.min(32,n)+c;for(let t=c;t<h;t++)O[e.charCodeAt(t)]|=1<<t;for(let e=0;e<s;e++){const s=O[t.charCodeAt(e)],n=a[e/32|0]>>>e&1,l=r[e/32|0]>>>e&1,c=s|o,h=((s|l)&i)+i^i|s|l;let u=o|~(h|i),d=i&h;u>>>31^n&&(a[e/32|0]^=1<<e),d>>>31^l&&(r[e/32|0]^=1<<e),u=u<<1|n,d=d<<1|l,i=d|~(c|u),o=u&c}for(let t=c;t<h;t++)O[e.charCodeAt(t)]=0}let c=0,h=-1;const u=32*l,d=Math.min(32,n-u)+u;for(let p=u;p<d;p++)O[e.charCodeAt(p)]|=1<<p;let g=n;for(let p=0;p<s;p++){const e=O[t.charCodeAt(p)],s=a[p/32|0]>>>p&1,o=r[p/32|0]>>>p&1,i=e|c,l=((e|o)&h)+h^h|e|o;let u=c|~(l|h),d=h&l;g+=u>>>n-1&1,g-=d>>>n-1&1,u>>>31^s&&(