{"version":3,"sources":["webpack:///./modules/JobDetails.ts"],"names":["__webpack_require__","r","__webpack_exports__","_helpers_helperFunctions__WEBPACK_IMPORTED_MODULE_0__","JobDetails","element","this","adjustBrandsSliderPosition","setup","selector","Array","from","document","querySelectorAll","filter","node","dataset","moduleInitialized","forEach","prototype","console","log","topBrandsElement","querySelector","jobDetailsElement","Object","clonedTopBrands","cloneNode","toolbarElement","insertBefore","style","display","appendChild"],"mappings":"2FAAAA,EAAAC,EAAAC,GAAA,IAAAC,EAAAH,EAAA,IAIAI,EAAA,WAUI,SAAAA,EAAmBC,GAAAC,KAAAD,UACfC,KAAKC,6BAmCb,OA7CWH,EAAAI,MAAP,SAAaC,QAAA,IAAAA,MAHM,8BAIfC,MAAMC,KAAKC,SAASC,iBAAiBJ,IAChCK,OAAO,SAACC,GAAsB,OAACA,EAAKC,QAAQC,oBAC5CC,QAAQ,SAACb,GACN,IAAID,EAAWC,GACfA,EAAQW,QAAQC,kBAAoB,UAQxCb,EAAAe,UAAAZ,2BAAR,WACIa,QAAQC,IAAI,uCAEZ,IAAMC,EAAmBV,SAASW,cAAc,kBAC1CC,EAAoBZ,SAASW,cAAc,4CAGjD,GAAID,GAAoBE,GAAqBC,OAAAtB,EAAA,EAAAsB,GAAY,CAErD,IAAMC,EAAkBJ,EAAiBK,WAAU,GAG7CC,EAAiBJ,EAAkBD,cAAc,eAEnDK,GAEAJ,EAAkBK,aAAaH,EAAiBE,GAGhDN,EAAiBQ,MAAMC,QAAU,SAEjCP,EAAkBQ,YAAYN,GAC9BJ,EAAiBQ,MAAMC,QAAU,OAEjCX,QAAQC,IAAI,wEAETC,IAAqBG,OAAAtB,EAAA,EAAAsB,KAE5BH,EAAiBQ,MAAMC,QAAU,GACjCX,QAAQC,IAAI,0DAGxBjB,EA9CA,eAgDAA,EAAWI","file":"./modules/JobDetails.551d816b.js","sourcesContent":["import { isMobile } from '../helpers/helperFunctions';\r\n\r\nconst moduleSelector = '[data-module=\"JobDetails\"]';\r\n\r\nexport default class JobDetails {\r\n static setup(selector: string = moduleSelector): void {\r\n Array.from(document.querySelectorAll(selector))\r\n .filter((node: HTMLElement) => !node.dataset.moduleInitialized)\r\n .forEach((element: HTMLElement) => {\r\n new JobDetails(element);\r\n element.dataset.moduleInitialized = 'true';\r\n });\r\n }\r\n\r\n constructor(public element: HTMLElement) {\r\n this.adjustBrandsSliderPosition();\r\n }\r\n\r\n private adjustBrandsSliderPosition() {\r\n console.log(\"Adjusting Brands Slider Position...\");\r\n\r\n const topBrandsElement = document.querySelector('.cw-top-brands') as HTMLElement;\r\n const jobDetailsElement = document.querySelector('[data-module=\"JobDetails\"] .cw-container') as HTMLElement;\r\n\r\n // Check if both elements exist\r\n if (topBrandsElement && jobDetailsElement && isMobile()) {\r\n // Clone the .cw-top-brands element\r\n const clonedTopBrands = topBrandsElement.cloneNode(true) as HTMLElement;\r\n\r\n // Find the element with the class \"cw-toolbar\" within jobDetailsElement\r\n const toolbarElement = jobDetailsElement.querySelector('.cw-toolbar');\r\n\r\n if (toolbarElement) {\r\n // Insert the cloned element before the .cw-toolbar element\r\n jobDetailsElement.insertBefore(clonedTopBrands, toolbarElement);\r\n\r\n // Hide the original topBrandsElement for mobile\r\n topBrandsElement.style.display = 'none';\r\n } else {\r\n jobDetailsElement.appendChild(clonedTopBrands);\r\n topBrandsElement.style.display = 'none';\r\n\r\n console.log('Cloned .cw-top-brands appended and original hidden for mobile.');\r\n }\r\n } else if (topBrandsElement && !isMobile()) {\r\n // Ensure the original element remains visible for desktop\r\n topBrandsElement.style.display = '';\r\n console.log('Original .cw-top-brands remains visible for desktop.');\r\n }\r\n }\r\n}\r\n\r\nJobDetails.setup();\r\n"],"sourceRoot":""}