PageSourceSearch

https://www.jacksonhewitt.com/Static/js/core/dist/base/Utilities.min.js?v=1.3.9761.22385

js jacksonhewitt.com collected 2026-10-02 05:08:29 UTC 9,311 bytes, 1 lines download raw bytes

1"use strict";function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_createClass=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}();window.JH=window.JH||{},window.JH.Utilities=function(){function a(b){_classCallCheck(this,a),this.options=b.Options,this.sourceFile="",this.prodUrls=["www.jacksonhewitt.com"],this.uaStr="",this.isBrowserIE=!1,this.ieRegEx=new RegExp(/(MSIE)|(Trident.*rv\:11\.)/),this.alphabetRegex=new RegExp(/^[a-z][a-z\s\-\'\,]+$/i),this.delArrKeyVal="ba2be497-8d5d-4255-9ea6-b42e4abed4b6",this.formInvalidTypes=["file","reset","submit","button","fieldset"],this.reqObjProps={propName:"moduleName",propType:"string",isArray:!1,isNullable:!1},this.dayOfWeekNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],this.dayOfWeekNamesLen=this.dayOfWeekNames.length-1,this.unitTesting=!1}return _createClass(a,[{key:"init",value:function(){void 0!==this.options&&"string"==typeof this.options.sourceFile&&(this.sourceFile=this.options.sourceFile)}},{key:"existsIn",value:function(a,b){return!(!Array.isArray(a)||"string"!=typeof b)&&!(a.indexOf(b)<0)}},{key:"chunkArr",value:function(a,b){var c=[];if("number"!=typeof b||b<=0||!Array.isArray(a)||0==a.length)return c;for(var d=0;d<a.length;d+=b)c.push(a.slice(d,d+b));return c}},{key:"deleteArrItemByKey",value:function(a,b){var c=this,d=new Array;return!Array.isArray(a)||"string"!=typeof b&&"number"!=typeof b?d:(a[b]=this.delArrKeyVal,Object.keys(a).forEach(function(b){a[b]!=c.delArrKeyVal&&(d[b]=a[b])},this),d)}},{key:"isProd",value:function(a){var b=!1;return this.prodUrls.forEach(function(c){a.indexOf(c)>-1&&(b=!0)}),b}},{key:"getElmObjsFromNodeList",value:function(a){return void 0===a||null===a||"object"!==(void 0===a?"undefined":_typeof(a))?[]:Array.prototype.slice.call(a)}},{key:"hasCSSClassname",value:function(a,b){return!(!Node.prototype.isPrototypeOf(a)||"string"!=typeof b||0==b.length)&&a.classList.contains(b.trim())}},{key:"addCSSClassname",value:function(a,b){Node.prototype.isPrototypeOf(a)&&"string"==typeof b&&0!=b.length&&(b=b.trim(),this.hasCSSClassname(a,b)||a.classList.add(b))}},{key:"addCSSClassnames",value:function(a,b){var c=this;Node.prototype.isPrototypeOf(a)&&Array.isArray(b)&&0!=b.length&&b.forEach(function(b){return c.addCSSClassname(a,b)},this)}},{key:"deleteCSSClassname",value:function(a,b){Node.prototype.isPrototypeOf(a)&&"string"==typeof b&&0!=b.length&&(b=b.trim(),this.hasCSSClassname(a,b)&&a.classList.remove(b))}},{key:"toggleClass",value:function(a,b){Node.prototype.isPrototypeOf(a)&&"string"==typeof b&&0!=b.length&&(b=b.trim(),this.hasCSSClassname(a,b)?this.deleteCSSClassname(a,b):this.addCSSClassname(a,b))}},{key:"toggleClasses",value:function(a,b){var c=this;Node.prototype.isPrototypeOf(a)&&Array.isArray(b)&&0!=b.length&&b.forEach(function(b){b=b.trim(),a.classList.contains(b)?c.deleteCSSClassname(a,b):c.addCSSClassname(a,b)},this)}},{key:"addDeleteClasses",value:function(a,b,c){Node.prototype.isPrototypeOf(a)&&"string"==typeof b&&0!=b.length&&"string"==typeof c&&0!=c.length&&(this.addCSSClassname(a,b),this.deleteCSSClassname(a,c))}},{key:"getElmWinTopOfset",value:function(a){if(!Node.prototype.isPrototypeOf(a))return 0;var b=this.unitTesting?new DOMRect(0,150,400,200):a.getBoundingClientRect(),c=this.unitTesting?parseInt(a.id):window.pageYOffset||document.documentElement.scrollTop;return b.top>0&&0==c?Math.floor(b.top):c>b.top?c+b.top:b.top+c}},{key:"getMaskValue",value:function(a){if(Node.prototype.isPrototypeOf(a)){var b=a.nextElementSibling;if(null!==b&&void 0!==b.value)return b.value}}},{key:"clearChildElms",value:function(a){if(Node.prototype.isPrototypeOf(a))for(;a.firstChild;)a.removeChild(a.lastChild)}},{key:"setChildSpanContent",value:function(a,b){if(Node.prototype.isPrototypeOf(a)&&"string"==typeof b){var c=a.querySelector("SPAN");null!=c&&(c.innerText=b)}}},{key:"openModal",value:function(a){var b=this;a instanceof HTMLElement&&(a.addEventListener("click",function(c){c.target===a&&b.closeModal(a)}),a.querySelector(".popup-block_close").addEventListener("click",function(c){b.closeModal(a)}),document.body.classList.add("popup-block-bodyStyle"),a.classList.add("show"))}},{key:"closeModal",value:function(a){a instanceof HTMLElement&&(document.body.classList.remove("popup-block-bodyStyle"),a.classList.remove("show"))}},{key:"isIE",value:function(a){return"string"==typeof a&&0!=a.length&&(this.uaStr.length>0?this.isBrowserIE:(this.uaStr=a,this.isBrowserIE=this.ieRegEx.test(a),this.isBrowserIE))}}
1,{key:"isNumeric",value:function(a){if("string"==typeof a){if(0==a.length||this.alphabetRegex.test(a))return!1;a=a.includes(",")?a.replace(",",""):a}return!isNaN(a)}},{key:"strFormat",value:function(a,b){if("string"!=typeof a||0==a.length||!Array.isArray(b)||0==b.length)return"";var c=a;return b.forEach(function(a,b){return c=c.replace("{"+b+"}",a)}),c}},{key:"isNullOrEmpty",value:function(a){if(void 0==a||null==a)return!0;if("string"==typeof a)return a.trim().length<=0}},{key:"toTitleCase",value:function(a){var b=this;return"string"!=typeof a||this.isNullOrEmpty(a)?"":a.split(" ").map(function(a){return b.toPascalCase(a)},this).join(" ")}},{key:"toPascalCase",value:function(a){var b=this;if("string"!=typeof a||this.isNullOrEmpty(a))return"";var c=a.match(/[a-z0-9.,']+/gi);return this.isNullOrEmpty(c)?a:c.map(function(a){return b.isNumeric(a)?a:a.charAt(0).toUpperCase()+a.substr(1).toLowerCase()}).join(" ")}},{key:"getDomainURL",value:function(){var a=this.unitTesting?[]:window.location.href.split("/");return a.length<3?"":this.strFormat("{0}//{1}",[a[0],a[2]])}},{key:"getURLQuerystringStr",value:function(){var a=this.unitTesting?["http://localhost","testQSParam=true"]:window.location.href.split("?");return a.length<2?"":a[1]}},{key:"getFilenameOnly",value:function(a){return"string"!=typeof a||this.isNullOrEmpty(a)?"":a.split(".")[0]}},{key:"dayOfWeekAsString",value:function(a){return"number"!=typeof a||this.dayOfWeekNamesLen<a?"":this.dayOfWeekNames[a]}},{key:"degreesToRadians",value:function(a){return"number"!=typeof a?0:a*Math.PI/180}},{key:"distanceInKmBetweenEarthCoordinates",value:function(a,b,c,d){if("number"!=typeof a||"number"!=typeof b||"number"!=typeof c||"number"!=typeof d)return 0;var e=this.degreesToRadians(c-a),f=this.degreesToRadians(d-b);a=this.degreesToRadians(a),c=this.degreesToRadians(c);var g=Math.sin(e/2)*Math.sin(e/2)+Math.sin(f/2)*Math.sin(f/2)*Math.cos(a)*Math.cos(c);return 2*Math.atan2(Math.sqrt(g),Math.sqrt(1-g))*6371}},{key:"initBoolProps",value:function(a){var b=this;if(void 0!==a&&null!==a){Object.getOwnPropertyNames(a).forEach(function(c){var d=Object.getOwnPropertyNames(a[c]);d=b.unitTesting?d.filter(function(a){return"length"!==a&&isNaN(parseInt(a))}):d,d.length>0?b.initBoolProps(a[c]):"boolean"==typeof a[c]&&(a[c]=!1)},this)}}},{key:"createFetchHeaders",value:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},b=document.getElementById("Jhafst").value,c={"Content-Type":"application/json",jhafst:b};for(var d in a)c[d]=a[d];return c}},{key:"serializeForm",value:function(a){if(void 0===a||null===a||"FORM"!=a.nodeName)return"";for(var b,c,d=[],e=a.elements.length,f=0;f<e;f++)if(b=a.elements[f],b.name&&!b.disabled&&!this.formInvalidTypes.includes(b.type))if("select-multiple"==b.type){c=a.elements[f].options.length;for(var g=0;g<c;g++)b.options[g].selected&&(d[d.length]=encodeURIComponent(b.name)+"="+encodeURIComponent(b.options[g].value))}else("checkbox"!=b.type&&"radio"!=b.type||b.checked)&&(d[d.length]=encodeURIComponent(b.name)+"="+encodeURIComponent(b.value));return d.join("&").replace(/%20/g,"+")}},{key:"createValPropObj",value:function(a,b,c){var d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("string"==typeof a&&0!=a.length&&"string"==typeof b&&0!=b.length&&"boolean"==typeof c&&"boolean"==typeof d)return Object.assign({},this.reqObjProps,{propName:a,propType:b,isArray:c,isNullable:d})}},{key:"primeObjPropsMatchComp",value:function(a,b){if(void 0===a||null===a||"object"!==(void 0===a?"undefined":_typeof(a))||void 0===b||null===b||"object"!==(void 0===b?"undefined":_typeof(b)))return!1;for(var c=Object.getOwnPropertyNames(a),d=0;d<c.length;d++)if(void 0===b[c[d]])return!1;return!0}},{key:"validateObjectProps",value:function(a,b){var c=this;if(void 0===a||null===a||"object"!==(void 0===a?"undefined":_typeof(a))||!Array.isArray(b)||0==b.length||b.filter(function(a){return!c.primeObjPropsMatchComp(a,c.reqObjProps)}).length>0)return!1;for(var d=!0,e=0;e<b.length;e++){if(!a.hasOwnProperty(b[e].propName)||_typeof(a[b[e].propName])!==b[e].propType&&!b[e].isNullable){d=!1;break}if(b[e].isArray&&!Array.isArray(a[b[e].propName])){d=!1;break}}return d}}]),a}(),window.JH.init=window.JH.init||[],window.JH.init.push({moduleName:"Utilities",moduleInitOptions:{sourceFile:document.currentScript.src},moduleJSCompileCallBack:"init"});

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.