1(globalThis.webpackChunkblog||=[]).push([[231],{540(t,e,n){"use strict";const r=["c-tooltip","c-tooltip--br"],i={show:({target:t,tip:e})=>{t&&(t.classList.add(...r),t.setAttribute("aria-label",e),t.addEventListener("mouseleave",({currentTarget:e})=>{e.classList.remove(...r),t.removeAttribute("aria-label")},{once:!0}))}};n.d(e,["A",0,i])},497(t,e,n){"use strict";const r=(t,e,n)=>{if(!e)throw new Error("function handler is required");if(!n)throw new Error("instance of pristine is required");t&&t.length&&t.forEach(t=>e(t,n))};n.dn(r),n.d(e,["A",0,r])},150(t,e,n){"use strict";n.d(e,["i",0,(t,e)=>{if(!t)throw new Error("field is required");let n;const r=new RegExp("^data-validate-([a-z]+)-message$","g"),i=[...t.attributes].find(t=>r.test(t.name));return i&&(n=i.value),n||e}])},895(t,e,n){"use strict";var r=n(315),i=n.n(r);const s="[data-validate-money]",a=t=>{if(!t)throw new Error("instance of pristine is required to validate money");const e=t.form.querySelectorAll(s);i()(e).maskMoney({precision:2,separator:",",delimiter:".",unit:"R$",zeroCents:!1})};n.d(e,["A",0,a])},562(t,e,n){"use strict";n.d(e,{default:()=>b});var r=n(229),i=n(895),s=n(315),a=n.n(s),o=n(497);const l=(t,e=!1,n=!1)=>{if(n&&(""===t||!t))return!0;if(!t)return!1;if(!t.match(/([0-2][0-9]|(3)[0-1])(\/)(((0)[0-9])|((1)[0-2]))(\/)\d{4}$/g))return!1;const r=t.replace(/(\d{2})\/(\d{2})\/(\d{4})/g,"$2/$1/$3"),i=new Date(r),s=new Date(Date.now());if("Invalid Date"===i.toString())return!1;const[a,o,l]=r.split("/");return i.getFullYear()===parseInt(l,10)&&i.getMonth()===parseInt(a-1,10)&&i.getDate()===parseInt(o,10)&&!(!e&&i>s)};n.dn(l);var u=n(150);const c="[data-validate-date]",p="Data inválida.",d=5,h=!0,m="99/99/9999",f=(t,e=!1,n=!1)=>{if(!t)throw new Error("instance of pristine is required to validate date");const r=t.form.querySelectorAll(c);(0,o.A)(r,(t,r)=>{a()(t).maskPattern(m),r.addValidator(t,t=>l(t,e,n),(0,u.i)(t,p),d,h)},t)};var g=n(540),v=n(376),w=n(156);const y=t=>{const e=t.split("/");return new Date(`${e[1]}-${e[0]}-${e[2]}`).getTime()};class b extends r.IC{constructor(){super({formElement:"[data-validate-termination]"})}mount(){v.A.mount(),g.A.mount(),this.preloadNextStep()}onRequest(t){t.preventDefault(),this.isDateStartLessThanDateEnd()||((0,r.wG)({context:this.form,status:"pending"}),n.e(321).then(n.bind(n,950)).then(t=>{new(0,t.default)({apiPath:"clt-termination"}).mount(),(0,r.wG)({context:this.form,status:"loaded"})}))}onValidate(){(0,i.A)(this.validator),f(this.validator)}preloadNextStep(){const t=document.querySelector('[data-seeder-preload="form"]');t&&(this.preloaded=!0,w.A.preload(t))}isDateStartLessThanDateEnd(){const t=this.form.querySelector('[name="adimissionDateEnd"]'),e=this.form.querySelector('[name="adimissionDateStart"]'),n=y(t.value),r=y(e.value);return n<r&&this.validator.addError(t,"A Data de afastamento não pode ser menor que a Data de adimissão"),n<r}}},156(t,e,n){"use strict";const r=t=>{const e=window.innerWidth<768,{src:n,srcset:r}=t;return{src:e?n:n.replace(/xs/gi,"sm"),media:e?"(max-width: 767px)":"(min-width: 767px)",srcset:e?r:r.toString().replace(/xs/gi,"sm")}},i={preload:t=>{const{media:e,src:n,srcset:i}=r(t);document.head.insertAdjacentHTML("beforeend",`<link as="image" rel="preload" fetchpriority="low" media="${e}" href="${n}" imagesrcset="${i}">`)},preloadImageByDevice:r};n.d(e,["A",0,i])},315(t,e,n){var r,i;void 0===(i="function"==typeof(r=function(){var t="9",e="A",n="S",r=[9,16,17,18,36,37,38,39,40,91,92,93],i=function(t){for(var e=0,n=r.length;e<n;e++)if(t==r[e])return!1;return!0},s=function(t){return(t={delimiter:(t=t||{}).delimiter||".",lastOutput:t.lastOutput,precision:t.hasOwnProperty("precision")?t.precision:2,separator:t.separator||",",showSignal:t.showSignal,suffixUnit:t.suffixUnit&&" "+t.suffixUnit.replace(/[\s]/g,"")||"",unit:t.unit&&t.unit.replace(/[\s]/g,"")+" "||"",zeroCents:t.zeroCents}).moneyPrecision=t.zeroCents?0:t.precision,t},a=function(r,i,s){for(;i<r.length;i++)r[i]!==t&&r[i]!==e&&r[i]!==n||(r[i]=s);return r},o=function(t){this.elements=t};o.prototype.unbindElementToMask=function(){for(var t=0,e=this.elements.length;t<e;t++)this.elements[t].lastOutput="",this.elements[t].onkeyup=!1,this.elements[t].onkeydown=!1,this.elements[t].value.length&&(this.elements[t].value=this.elements[t].value.replace(/\D/g,""))},o.prototype.bindElementToMask=function(t){for(var e=this,n=function(n){var r=(n=n||window.event).target||n.srcElement;i(n.keyCode)&&setTimeout(function(){e.opts.lastOutput=r.lastOutput,r.value=l[t](r.value,e.opts),r.lastOutput=r.value,r.setSelectionRange&&e.opts.suffixUnit&&r.setSelectionRange(r.value.length,r.value.length-e.opts.suffixUnit.length)},0)},r=0,s=this.elements.length;r<s;r++)this.elements[r].lastOutput="",this.elements[r].onkeyup=n,this.elements[r].value.length&&(this.elements[r].value=l[t](this.elements[r].value,this.opts))},o.prototype.maskMoney=function(t){this.opts=s(t),this.bindElementToMask("toMoney")},o.prototype.maskNumber=function(){this.opts={},this.bindElementToMask("toNumber")},o.prototype.maskAlphaNum=function(){this.opts={},this.bindElementToMask("toAlphaNumeric")},o.prototype.maskPattern=function(t){this.opts={pattern:t},this.bindElementToMask("toPattern")},o.prototype.unMask=function(){this.unbindElementToMask()};var l=function(t){if(!t)throw new Error("VanillaMasker: There is no element to bind.");var e="length"in t?t.length?t:[]:[t];return new o(e)};return l.toMoney=function(t,e){if((e=s(e)).zeroCents){e.lastOutput=e.lastOutput||"";var n="("+e.separator+"[0]{0,"+e.precision+"})",r=new RegExp(n,"g"),i=t.toString().replace(/[\D]/g,"").length||0,a=e.lastOutput.toString().replace(/[\D]/g,"").length||0;t=t.toString().replace(r,""),i<a&&(t=t.slice(0,t.length-1))}for(var o=t.toString().replace(/[\D]/g,""),l=new RegExp("^(0|\\"+e.delimiter+")"),u=new RegExp("(\\"+e.separator+")$"),c=o.substr(0,o.length-e.moneyPrecision),p=c.substr(0,c.length%3),d=new Array(e.precision+1).join("0"),h=0,m=(c=c.substr(c.length%3,c.length)).length;h<m;h++)h%3==0&&(p+=e.delimiter),p+=c[h];p=(p=p.replace(l,"")).length?p:"0";var f="";if(!0===e.showSignal&&(f=t<0||t.startsWith&&t.startsWith("-")?"-":""),!e.zeroCents){var g=o.length-e.precision,v=o.substr(g,e.precision),w=v.length,y=e.precision>w?e.precision:w;d=(d+v).slice(-y)}var b="";return""!==t.toString().trim()&&(b=e.unit+f+p+e.separator+d),b.replace(u,"")+e.suffixUnit},l.toPattern=function(r,i){var s,o="object"==typeof i?i.pattern:i,l=o.replace(/\W/g,""),u=o.split(""),c=r.toString().replace(/\W/g,""),p=c.replace(/\W/g,""),d=0,h=u.length,m="object"==typeof i?i.placeholder:void 0;for(s=0;s<h;s++){if(d>=c.length){if(l.length==p.length)return u.join("");if(void 0!==m&&l.length>p.length)return a(u,s,m).join("");break}if(u[s]===t&&c[d].match(/[0-9]/)||u[s]===e&&c[d].match(/[a-zA-Z]/)||u[s]===n&&c[d].match(/[0-9a-zA-Z]/))u[s]=c[d++];else if(u[s]===t||u[s]===e||u[s]===n)return void 0!==m?a(u,s,m).join(""):u.slice(0,s).join("")}return u.join("").substr(0,s)},l.toNumber=function(t){return t.toString().replace(/(?!^-)[^0-9]/g,"")},l.toAlphaNumeric=function(t){return t.toString().replace(/[^a-z0-9 ]+/i,"")},l})?r.call(e,n,e,t):r)||(t.exports=i)}}]); 2//# sourceMappingURL=calculator~termination.bb8f093490a360c5a350.js.map
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.