{ "version": 3, "file": "scripts-bundle.js", "sources": [ "src/simply-app/js/general/global-variables.js", "src/simply-app/js/general/routes-and-redirects.js", "src/simply-app/js/general/utility-functions.js", "src/simply-app/js/features/main-navigation.js", "src/simply-app/js/features/matrix-calculator.js" ], "names": [], "mappings": "AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA", "sourcesContent": [ "/*====================================================================\n= Global variables, environment variables etc. =\n====================================================================*/\n\n//var API_HOST = 'https://api.example.com';\n//API_HOST = 'http://localhost:4000'; //comment before merge!!!!!!!!!!\n//PROD_ROOT_DOMAIN defined on top of index.html\n\n\n/*===== End of Global variables, environment variables etc. ======*/\n\n\n/////////////////////////////////", "var URLs = {\n\thomepage: 'https://awk-prototype.webflow.io/'\n};\n\nif ( window.location.pathname === \"/app-main\") {\n\tStateURL.setDefaultParam('subpage', 'dashboard', {doNotCreateHistoryState: true});\n}", "// Utility functions specific to the app not to framework\n$.On('click', '[js-action-clear-local-storage]', function() {\n State.clearStorage();\n console.log(\"Clearing local storage...\")\n});", "StateURL.onParamChange('subpage', function(value) {\n\tif (typeof value != 'undefined') {\n\t showOnlyElementsWithAttributeXMatchingY('js-subpage', value);\n showOnlyElementsWithAttributeXMatchingY('subpage-id', value);\n\t}\n\n\t$('[js-main-scroll-area]').scrollTo(0);\n});\n\n$.On('click', '[js-go-to-subpage]', function() {\n\tvar targetSubpage = $(this).attr('js-go-to-subpage');\n StateURL.set('subpage', targetSubpage);\n});\n\n$.On('click', '[js-action-go-back]', function() {\n window.history.back();\n});\n\nState.setDefault('user-logged-in', 'false');\nState.onChange('user-logged-in', function(value) {\n $('[js-show-when-logged-in]').isShownWhen(value === 'true');\n $('[js-show-when-not-logged-in]').isShownWhen(value === 'false');\n});\n\nStateURL.onChange('loggedIn', function(value) {\n if (value === \"true\") {\n State.set('user-logged-in', 'true');\n StateURL.remove('loggedIn', {doNotCreateHistoryState: true});\n }\n});\n\n$.On('click', '[js-action-log-out]', function() {\n State.set('user-logged-in', 'false');\n window.location.href = \"/homepage\"; //TODO create logout page\n});\n\nvar navMap = {\n 'dashboard': ['dashboard'],\n 'cars': ['cars'],\n 'settings': ['settings'],\n};\n\nvar subpagesWithoutSidebar = ['projects', 'account-settings', 'organization-settings'];\n\nStateURL.onChange('subpage', function(value) {\n $('[js-sidebar-nav] [js-go-to-subpage]').each(function() {\n var attr = $(this).attr('js-go-to-subpage');\n var isInNavMapArray = $.inArray(value, navMap[attr]);\n $(this).addClassWhen(isInNavMapArray >= 0, 'is-current');\n $(this).find('[js-nav-icon]').addClassWhen(isInNavMapArray >= 0, 'is-current');\n });\n\n $('[js-right-pane]').addClassWhen(subpagesWithoutSidebar.includes(value), 'is-full-width');\n $('[js-selector=\"sidebar\"]').isShownWhen(subpagesWithoutSidebar.includes(value) !== true);\n\n $('[js-nav]').each(function() {\n var attr = $(this).attr('js-nav');\n $(this).addClassWhen(value === attr, 'is-current');\n });\n});\n\nStateURL.onChange('subpage', function(value) {\n if (value === 'suites' || value === 'tests') {\n $('[js-subpage-main-preloader]').removeClass('is-hidden');\n delay(300, function() {\n $('[js-subpage-main-preloader]').addClass('is-hidden');\n });\n }\n});\n\n// //SPA navigation tabs -- currently unused, kept just in case\n// StateURL.onParamChange('mainTab', function(value) {\n// \tif (typeof value != 'undefined') {\n// \t\t$('[main-tab-id]').not('[main-tab-id=\"'+value+'\"]').removeClass('is-current');\n// \t\t$('[main-tab-id=\"'+value+'\"]').addClass('is-current');\n\n// \t $('[secondary-navbar-id]').not('[secondary-navbar-id=\"'+value+'\"]').addClass('is-hidden');\n// \t $('[secondary-navbar-id=\"'+value+'\"]').removeClass('is-hidden');\n// \t}\n// });\n\n// $.On('click', '[main-tab-id]', function(event) {\n// \tvar valueToSet = $(event.currentTarget).attr('main-tab-id');\n// \tStateURL.setParam('mainTab', valueToSet);\n\n// \t//clicking on tab should load the first subtab content\n// \tvar relatedSecondaryNavbarId = $(event.currentTarget).attr('main-tab-id');\n// \tvar firstSecondaryTab = $('[secondary-navbar-id=\"'+relatedSecondaryNavbarId+'\"]').find('[secondary-tab-id]').first();\n// \tvar subpageId = firstSecondaryTab.attr('secondary-tab-id');\n// \tStateURL.setParam('subpage', subpageId, {doNotCreateHistoryState: true});\n// \tStateURL.setParam('secondaryTab', subpageId, {doNotCreateHistoryState: true});\n// });\n\n// $.On('click', '[secondary-tab-id]', function(event) {\n// \tvar valueToSet = $(event.currentTarget).attr('secondary-tab-id');\n// \tsetTimeout(function() {\n// \t\tStateURL.setParam('secondaryTab', valueToSet, {doNotCreateHistoryState: true});\n// \t}, 1);\n// \tStateURL.setParam('subpage', valueToSet);\n// });\n\n// StateURL.onParamChange('secondaryTab', function(value) {\n// \t$('[secondary-tab-id]').not('[secondary-tab-id=\"'+value+'\"]').removeClass('is-current');\n// \t$('[secondary-tab-id=\"'+value+'\"]').addClass('is-current');\n// });\n\n$.On('preloadingComplete', function() {\n $('[js-scroll-shadow]').each(function() {\n var attr = $(this).attr('js-scroll-shadow');\n var header = $('[js-scroll-shadow-header=\"'+attr+'\"]');\n var area = $(this);\n header.addClassWhen(area.scrollTop() > 0, 'is-with-scroll-shadow');\n $(this).on('scroll', function() {\n header.addClassWhen(area.scrollTop() > 0, 'is-with-scroll-shadow');\n });\n });\n})\n", "function checkIfSubpageIsMatrixCalculator() {\n return window.location.pathname.includes('matrix-calculator') && !window.location.pathname.includes('matrix-calculator-list')\n}\n\nStateURL.onChange('modalContent', function(value) {\n if (value !== 'matrix-calculator-how-it-works') {\n var youtubeIframe = $('[js-matrixcalc-video-info-in-modal] iframe');\n var src = youtubeIframe.attr('src');\n youtubeIframe.attr('src', '');\n youtubeIframe.attr('src', src);\n }\n});\n\nif (checkIfSubpageIsMatrixCalculator()) {\n\n $.On.clickElementWithAttribute('js-matrixcalc-set-salary-type', function(attrValue) {\n StateURL.set('salary-type', attrValue, {doNotCreateHistoryState: true});\n });\n\n StateURL.setDefault('salary-type', 'b2b', {doNotCreateHistoryState: true});\n\n StateURL.onChange('salary-type', function(value) {\n showOnlyElementsWithAttributeXMatchingY('js-matrixcalc-result-row', value);\n addClassToElementsWithAttributeXMatchingY('js-matrixcalc-set-salary-type', value, 'is-current');\n });\n\n\n var MATRIXCALC_LEVELS = {\n 'junior-1': {\n name: \"Junior 1\",\n minPoints: 18,\n },\n 'junior-2': {\n name: \"Junior 2\",\n minPoints: 23,\n }, \n 'regular-1': {\n name: \"Regular 1\",\n minPoints: 28,\n },\n 'regular-2': {\n name: \"Regular 2\",\n minPoints: 32,\n },\n 'regular-3': {\n name: \"Regular 3\",\n minPoints: 36,\n },\n 'senior-1': {\n name: \"Senior 1\",\n minPoints: 39,\n },\n 'senior-2': {\n name: \"Senior 2\",\n minPoints: 42,\n },\n 'senior-3': {\n name: \"Senior 3\",\n minPoints: 45,\n },\n 'senior-4': {\n name: \"Senior 4\",\n minPoints: 48,\n },\n }\n\n var MATRIXCALC_QUESTIONS = [\n 'tech-1',\n 'tech-2',\n 'tech-3',\n 'tech-4',\n 'tech-5',\n 'soft-1',\n 'soft-2',\n 'soft-3-team-leader',\n 'soft-3-open-source',\n 'soft-4',\n 'soft-5',\n ];\n\n $.each(MATRIXCALC_QUESTIONS, function(index, itemValue) {\n State.onChange(itemValue, function(value) {\n var thisBlock = $('[js-matrixcalc-skill-block=\"'+itemValue+'\"]');\n thisBlock.find('[js-matrixcalc-skills-desc-level]').each(function() {\n var $this = $(this);\n var attrVal = $this.attr('js-matrixcalc-skills-desc-level');\n if (attrVal == value) {\n $this.isShown();\n } else {\n $this.isHidden();\n }\n });\n if (isNotEmpty(value) && isNumeric(value)) {\n calculateTotalPoints();\n StateURL.set(itemValue, value, {doNotCreateHistoryState: true});\n }\n });\n });\n\n var MATRIXCALC_PRESETS = {\n 'intern': {\n 'tech-1': 1,\n 'tech-2': 1,\n 'tech-3': 1,\n 'tech-4': 1,\n 'tech-5': 1,\n 'soft-1': 1,\n 'soft-2': 1,\n 'soft-3-team-leader': 1,\n 'soft-3-open-source': 1,\n 'soft-4': 1,\n 'soft-5': 1,\n },\n 'junior-1': {\n 'tech-1': 1,\n 'tech-2': 2,\n 'tech-3': 2,\n 'tech-4': 2,\n 'tech-5': 2,\n 'soft-1': 2,\n 'soft-2': 1,\n 'soft-3-team-leader': 1,\n 'soft-3-open-source': 1,\n 'soft-4': 2,\n 'soft-5': 3,\n },\n 'junior-2': {\n 'tech-1': 2,\n 'tech-2': 2,\n 'tech-3': 3,\n 'tech-4': 2,\n 'tech-5': 2,\n 'soft-1': 2,\n 'soft-2': 3,\n 'soft-3-team-leader': 1,\n 'soft-3-open-source': 1,\n 'soft-4': 3,\n 'soft-5': 3,\n },\n 'regular-1': {\n 'tech-1': 3,\n 'tech-2': 3,\n 'tech-3': 3,\n 'tech-4': 3,\n 'tech-5': 3,\n 'soft-1': 3,\n 'soft-2': 3,\n 'soft-3-team-leader': 1,\n 'soft-3-open-source': 1,\n 'soft-4': 3,\n 'soft-5': 3,\n },\n 'regular-2': {\n 'tech-1': 3,\n 'tech-2': 3,\n 'tech-3': 3,\n 'tech-4': 3,\n 'tech-5': 3,\n 'soft-1': 3,\n 'soft-2': 4,\n 'soft-3-team-leader': 3,\n 'soft-3-open-source': 3,\n 'soft-4': 3,\n 'soft-5': 4,\n },\n 'regular-3': {\n 'tech-1': 4,\n 'tech-2': 4,\n 'tech-3': 3,\n 'tech-4': 4,\n 'tech-5': 3,\n 'soft-1': 3,\n 'soft-2': 4,\n 'soft-3-team-leader': 3,\n 'soft-3-open-source': 3,\n 'soft-4': 4,\n 'soft-5': 4,\n },\n 'senior-1': {\n 'tech-1': 4,\n 'tech-2': 4,\n 'tech-3': 4,\n 'tech-4': 4,\n 'tech-5': 4,\n 'soft-1': 4,\n 'soft-2': 4,\n 'soft-3-team-leader': 3,\n 'soft-3-open-source': 3,\n 'soft-4': 4,\n 'soft-5': 4,\n },\n 'senior-2': {\n 'tech-1': 5,\n 'tech-2': 4,\n 'tech-3': 5,\n 'tech-4': 4,\n 'tech-5': 4,\n 'soft-1': 4,\n 'soft-2': 4,\n 'soft-3-team-leader': 3,\n 'soft-3-open-source': 3,\n 'soft-4': 4,\n 'soft-5': 5,\n },\n 'senior-3': {\n 'tech-1': 5,\n 'tech-2': 4,\n 'tech-3': 5,\n 'tech-4': 4,\n 'tech-5': 4,\n 'soft-1': 4,\n 'soft-2': 5,\n 'soft-3-team-leader': 4,\n 'soft-3-open-source': 4,\n 'soft-4': 5,\n 'soft-5': 5,\n },\n 'senior-4': {\n 'tech-1': 5,\n 'tech-2': 5,\n 'tech-3': 5,\n 'tech-4': 5,\n 'tech-5': 4,\n 'soft-1': 5,\n 'soft-2': 5,\n 'soft-3-team-leader': 4,\n 'soft-3-open-source': 4,\n 'soft-4': 5,\n 'soft-5': 5,\n },\n }\n\n function calculateTotalPoints() {\n var totalPoints = 0;\n totalPoints = totalPoints + State.get('tech-1');\n totalPoints = totalPoints + State.get('tech-2');\n totalPoints = totalPoints + State.get('tech-3');\n totalPoints = totalPoints + State.get('tech-4');\n totalPoints = totalPoints + State.get('tech-5'); \n totalPoints = totalPoints + State.get('soft-1');\n totalPoints = totalPoints + State.get('soft-2');\n var higherFromSoft3 = Math.max(State.get('soft-3-open-source'), State.get('soft-3-team-leader'))\n totalPoints = totalPoints + higherFromSoft3;\n totalPoints = totalPoints + State.get('soft-4');\n totalPoints = totalPoints + State.get('soft-5');\n if (!isNaN(totalPoints)) {\n State.set('totalPoints', totalPoints);\n } else {\n State.remove('totalPoints');\n }\n //console.log(\"Total points - \"+totalPoints);\n }\n\n State.onChange('totalPoints', function(value) {\n if (isNotEmpty(value)) {\n $('[js-matrixcalc-result-points]').text(value);\n calculateResultLevel();\n updateMatrixcalTableResult();\n }\n });\n\n function updateMatrixcalTableResult() {\n $('[js-matrixcalc-table-result-row]').each(function() {\n var thisAttr = $(this).attr('js-matrixcalc-table-result-row');\n var points = State.get(thisAttr);\n $(this).find('[js-matrixcalc-table-result-points]').text(points);\n });\n }\n\n function calculateResultLevel() {\n\n var totalPoints = State.get('totalPoints');\n //currently the lowest level we support in the calculator is junior-1\n //TODO handle what happens if your level is below the minimum treshhold for junior-1\n var result = 'junior-1';\n if (!isNaN(totalPoints)) {\n $.each(MATRIXCALC_LEVELS, function(key, value) {\n if (value.minPoints <= totalPoints) {\n result = key;\n }\n });\n State.set('result', result);\n }\n }\n\n function calculateSalaryPowerBar() {\n var minB2B = $('[js-matrixcalc-result-money-min-b2b]').first().text().replace(/\\s+/g, '');\n var maxB2B = $('[js-matrixcalc-result-money-max-b2b]').first().text().replace(/\\s+/g, '');\n var resultLevel = State.get('result');\n var currenSalaryB2B = $('[js-matrixcalc-result-row=\"b2b\"] [js-matrix-result-'+resultLevel+']').first().text().replace(/\\s+/g, '');\n var percentage = (currenSalaryB2B - minB2B)*100/(maxB2B - minB2B);\n //only calculating bar based on B2B for now\n $('[js-salary-powerbar=\"b2b\"]').css('width', percentage+\"%\");\n $('[js-salary-powerbar=\"uop\"]').css('width', percentage+\"%\");\n }\n\n State.onChange('result', function(value) {\n $('[js-matrix-result-intern]').isShownWhen(value === 'intern');\n $('[js-matrix-result-junior-1]').isShownWhen(value === 'junior-1');\n $('[js-matrix-result-junior-2]').isShownWhen(value === 'junior-2');\n $('[js-matrix-result-regular-1]').isShownWhen(value === 'regular-1');\n $('[js-matrix-result-regular-2]').isShownWhen(value === 'regular-2');\n $('[js-matrix-result-regular-3]').isShownWhen(value === 'regular-3');\n $('[js-matrix-result-senior-1]').isShownWhen(value === 'senior-1');\n $('[js-matrix-result-senior-2]').isShownWhen(value === 'senior-2');\n $('[js-matrix-result-senior-3]').isShownWhen(value === 'senior-3');\n $('[js-matrix-result-senior-4]').isShownWhen(value === 'senior-4');\n $('[js-matrixcalc-result-level]').text(MATRIXCALC_LEVELS[value].name);\n\n $('[js-matrixcalc-set-preset]').each(function() {\n var thisAttr = $(this).attr('js-matrixcalc-set-preset');\n $(this).addClassWhen(thisAttr === value, 'is-current');\n $(this).find('[js-preset-item-active]').isShownWhen(thisAttr === value);\n });\n\n calculateSalaryPowerBar();\n });\n\n function setMatrixCalcPreset(presetLevel) {\n $.each(MATRIXCALC_PRESETS[presetLevel], function(key, value) {\n State.set(key, value);\n });\n }\n\n $.On('preloadingComplete', function() {\n $.each(MATRIXCALC_QUESTIONS, function(index, value) {\n var fromURL = StateURL.get(value);\n if (isNotEmpty(fromURL)) {\n State.set(value, Number(fromURL));\n } else {\n State.set(value, 3);\n }\n });\n });\n\n $.On.clickElementWithAttribute('js-matrixcalc-set-preset', function(attrValue) {\n setMatrixCalcPreset(attrValue);\n });\n\n}\n\n\n\n\n" ] }