PageSourceSearch

https://www.unionen.se/_nuxt/CFgGFOgi.js

js unionen.se collected 2026-09-24 17:18:39 UTC 2,679 bytes, 1 lines download raw bytes

1var e=class extends Error{constructor(){super(`Invalid swedish personal identity number`)}},t=(e,t)=>{let n=e.getTime()-t.getTime();return n<0?-1:n>0?1:n},n=(e,n)=>{let r=t(e,n),i=Math.abs(e.getFullYear()-n.getFullYear());e.setFullYear(e.getFullYear()-r*i);let a=r*(i-+(t(e,n)===-r));return a===0?0:a},r=e=>{let t=0;e+=``;for(let n=0,r=e.length;n<r;n++){let r=parseInt(e[n]);r*=2-n%2,r>9&&(r-=9),t+=r}return Math.ceil(t/10)*10-t},i=(e,t,n)=>{--t;let r=new Date(e,t,n);return r.getFullYear()===e&&r.getMonth()===t&&r.getDate()===n},a=class{constructor(e,t){this._century=``,this._fullYear=``,this._year=``,this._month=``,this._day=``,this._sep=``,this._num=``,this._check=``,this.parse(e,{allowCoordinationNumber:!0,allowInterimNumber:!1,...t})}get century(){return this._century}get fullYear(){return this._fullYear}get year(){return this._year}get month(){return this._month}get day(){return this._day}get sep(){return this._sep}get num(){return this._num}get check(){return this._check}static parse(e,t){return new a(e,t)}static valid(e,t){try{return a.parse(e,t),!0}catch{return!1}}parse(t,n){if(t.length<10||t.length>13)throw new e;let r=/^(\d{2}){0,1}(\d{2})(\d{2})(\d{2})([+-]?)((?!000)\d{3}|[TRSUWXJKLMN]\d{2})(\d)$/.exec(t);if(!r)throw new e;let i=r[1],a=r[2],o=r[3],s=r[4],c=r[5],l=r[6],u=r[7];if(i===void 0||!i.length){let e=new Date,t=0;c===`+`?(this._sep=`+`,t=e.getFullYear()-100):(this._sep=`-`,t=e.getFullYear()),this._century=(``+(t-(t-parseInt(a))%100)).substr(0,2)}else this._century=i,this._sep=new Date().getFullYear()-parseInt(i+a,10)<100?`-`:`+`;if(this._year=a,this._fullYear=this._century+a,this._month=o,this._day=s,this._num=l,this._check=u,!this.valid()||!n?.allowCoordinationNumber&&this.isCoordinationNumber()||!n?.allowInterimNumber&&this.isInterimNumber())throw new e}valid(){let e=r(this.year+this.month+this.day+this.num.replace(/[TRSUWXJKLMN]/,`1`))===+this.check&&!!this.check;return e&&i(parseInt(this.century+this.year),+this.month,+this.day)?e:e&&i(parseInt(this.century+this.year),+this.month,this.day-60)}format(e=!1){return e?`${this.century}${this.year}${this.month}${this.day}${this.num}${this.check}`:`${this.year}${this.month}${this.day}${this.sep}${this.num}${this.check}`}getAge(){let e=this.getDate();return n(new Date(Date.now()),e)}getDate(){let e=+this.day;this.isCoordinationNumber()&&(e-=60);let t=this.century+this.year+`-`+this.month+`-`+(e<10?`0`+e:e);return new Date(t)}isInterimNumber(){return/[TRSUWXJKLMN]/.test(this.num[0])}isCoordinationNumber(){return i(parseInt(this.century+this.year),+this.month,this.day-60)}isFemale(){return!this.isMale()}isMale(){return parseInt(this.num.substr(-1))%2==1}},o=a;export{o as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.