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C,OAAO1M,GAEvB,OAAOyM,CACT,C,kBC5BApN,SAASC,iBAAiB,oBAAqBjC,IAC3CA,EAAE2D,gBAAgB,G","sources":["webpack://yearone/./app/javascript/channels/ sync _channel\\.js$","webpack://yearone/./app/javascript/channels/index.js","webpack://yearone/./app/javascript/channels/session_channel.js","webpack://yearone/./app/javascript/utilities/mixpanel.js","webpack://yearone/./app/javascript/packs/application.js","webpack://yearone/./app/javascript/utilities/cable_ready.js","webpack://yearone/./app/javascript/utilities/confirmation_success.js","webpack://yearone/./app/javascript/utilities/hiding.js","webpack://yearone/./app/javascript/utilities/set.js","webpack://yearone/./app/javascript/utilities/trix.js"],"sourcesContent":["var map = {\n\t\"./session_channel.js\": 650,\n\t\"channels/session_channel.js\": 650\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 3760;","// Load all the channels within this directory and all subdirectories.\n// Channel files must be named *_channel.js.\n\nconst channels = require.context('.', true, /_channel\\.js$/)\nchannels.keys().forEach(channels)\n","import CableReady from 'cable_ready'\nimport consumer from \"./consumer\"\n\nlet reconnecting = false\n\nconsumer.subscriptions.create('SessionChannel', {\n initialized () {\n this.reconnect = this.reconnect.bind(this)\n if(consumer.connection.disconnected) {\n this._disableReflexElements()\n }\n this._disabledReflexLinkClickHandler = this._disabledReflexLinkClickHandler.bind(this)\n },\n\n received (data) {\n if (data.cableReady)\n CableReady.perform(data.operations, {\n emitMissingElementWarnings: false\n })\n },\n\n connected () {\n this._enableReflexElements()\n reconnecting = false\n document.addEventListener('reconnect', this.reconnect)\n },\n\n disconnected () {\n this._disableReflexElements()\n document.removeEventListener('reconnect', this.reconnect)\n if (reconnecting) setTimeout(() => {\n consumer.connect()\n // Event for ReconnectionController\n setTimeout(() => document.dispatchEvent(new Event('reconnected')), 25)\n }, 25)\n },\n\n reconnect () {\n reconnecting = true\n consumer.disconnect()\n },\n\n _disableReflexElements () {\n Array.from(document.querySelectorAll(\"[data-reflex]\")).forEach((elem) => {\n // The hiddenSpan changes the text of the element, so capybara tests won't find it until the websocket reconnects\n let hiddenSpan = document.createElement(\"span\")\n hiddenSpan.classList.add(\"hidden\")\n hiddenSpan.textContent = \"stalled, waiting for websocket to connect\"\n elem.setAttribute(\"data-actioncable-reconnect-html\", elem.innerHTML)\n elem.appendChild(hiddenSpan)\n elem.classList.add(\"stalled\")\n elem.addEventListener('click', this._disabledReflexLinkClickHandler)\n })\n },\n\n _enableReflexElements () {\n Array.from(document.querySelectorAll(\"[data-reflex]\")).forEach((elem) => {\n // This function gets called on the initial connect, as well as on reconnects. In the initial connect, there is no saved data-actioncable-reconnect-html.\n const innerHtml = elem.getAttribute(\"data-actioncable-reconnect-html\")\n if(innerHtml) {\n elem.innerHTML = innerHtml\n elem.removeAttribute(\"data-actioncable-reconnect-html\")\n }\n elem.removeEventListener('click', this._disabledReflexLinkClickHandler)\n elem.classList.remove(\"stalled\")\n if(elem.getAttribute(\"data-actioncable-reconnect-clicked\") === \"true\") {\n elem.removeAttribute(\"data-actioncable-reconnect-clicked\")\n setTimeout(() => elem.click(), 25) // Tiny delay to let the callbacks finish, at which point the connection will be live\n }\n })\n },\n\n // Trap incoming clicks, and save them for when the websocket reconnects\n _disabledReflexLinkClickHandler (event) {\n event.stopPropagation()\n event.preventDefault()\n event.currentTarget.setAttribute(\"data-actioncable-reconnect-clicked\", \"true\")\n }\n})\n","/**\n * Mixpanel tracking utility\n * \n * This file handles Mixpanel initialization and provides helper methods for tracking events.\n * It sets up global click tracking and provides utilities for tracking specific interactions.\n */\n\n// Check if Mixpanel is already initialized\nlet mixpanelInitialized = false;\n\n/**\n * Initialize Mixpanel with the token from meta tag\n * @returns {boolean} Whether initialization was successful\n */\nconst initMixpanel = () => {\n // If already initialized, don't initialize again\n if (mixpanelInitialized || window.mixpanel?.__loaded) {\n // Register super properties for the user if they exist\n registerUserProperties();\n return true;\n }\n\n // Get the Mixpanel token from the meta tag (will be set server-side)\n const token = document.querySelector('meta[name=\"mixpanel-token\"]')?.content;\n \n if (!token) {\n console.warn(\"Mixpanel token not found. Tracking will be disabled.\");\n return false;\n }\n\n // Check if Mixpanel is already loaded by the Rails backend\n if (window.mixpanel) {\n mixpanelInitialized = true;\n return true;\n }\n\n // Load Mixpanel snippet (modified from Mixpanel docs)\n (function(f,b){if(!b.__SV){var e,g,i,h;window.mixpanel=b;b._i=[];b.init=function(e,f,c){function g(a,d){var b=d.split(\".\");2==b.length&&(a=a[b[0]],d=b[1]);a[d]=function(){a.push([d].concat(Array.prototype.slice.call(arguments,0)))}}var a=b;\"undefined\"!==typeof c?a=b[c]=[]:c=\"mixpanel\";a.people=a.people||[];a.toString=function(a){var d=\"mixpanel\";\"mixpanel\"!==c&&(d+=\".\"+c);a||(d+=\" (stub)\");return d};a.people.toString=function(){return a.toString(1)+\".people (stub)\"};i=\"disable time_event track track_pageview track_links track_forms track_with_groups add_group set_group remove_group register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking start_batch_senders people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user people.remove\".split(\" \");\n for(h=0;h {\n if (!window.mixpanel) return;\n \n try {\n // Get user ID and admin link from meta tags\n const userId = document.querySelector('meta[name=\"current-user-id\"]')?.content;\n const adminUserLink = document.querySelector('meta[name=\"admin-user-link\"]')?.content;\n \n // Get account info from meta tags\n const accountId = document.querySelector('meta[name=\"current-account-id\"]')?.content;\n const adminAccountLink = document.querySelector('meta[name=\"admin-account-link\"]')?.content;\n \n // Build properties object\n const properties = {};\n \n // Add user properties if available\n if (userId && adminUserLink) {\n properties.user_id = userId;\n properties.admin_user_link = adminUserLink;\n }\n \n // Add account properties if available\n if (accountId && adminAccountLink) {\n properties.account_id = accountId;\n properties.admin_account_link = adminAccountLink;\n }\n \n // Register all properties\n if (Object.keys(properties).length > 0) {\n mixpanel.register(properties);\n }\n } catch (e) {\n console.error(\"Error registering user properties:\", e);\n }\n};\n\n/**\n * Track a click event with standardized properties\n * @param {HTMLElement} element - The DOM element that was clicked\n * @param {Object} additionalProps - Additional properties to include in the event\n */\nconst trackClick = (element, additionalProps = {}) => {\n if (!window.mixpanel) return;\n\n // Track click event\n\n try {\n // Get element details\n const tagName = element.tagName.toLowerCase();\n const id = element.id || null;\n const classes = Array.from(element.classList).join(\" \") || null;\n const text = element.innerText?.trim() || null;\n const href = element.href || element.closest('a')?.href || null;\n \n // Get input-specific details\n let interactionType = \"click\";\n let elementValue = null;\n let interactionContext = null;\n \n // Handle form elements\n if (tagName === \"input\" || tagName === \"select\" || tagName === \"textarea\") {\n // Set interaction type based on element type\n if (tagName === \"input\" && element.type === \"checkbox\") {\n interactionType = \"checkbox_toggled\";\n elementValue = element.checked;\n } else if (tagName === \"input\" && element.type === \"radio\") {\n interactionType = \"radio_selected\";\n elementValue = element.value;\n } else if (tagName === \"select\") {\n interactionType = \"option_selected\";\n elementValue = element.value;\n } else {\n interactionType = `${tagName}_interaction`;\n elementValue = element.value;\n }\n \n // Get label text if available\n const labelText = element.labels?.[0]?.innerText?.trim() || null;\n \n // Add label text to context if available\n if (labelText) {\n interactionContext = interactionContext || {};\n interactionContext.label_text = labelText;\n }\n \n // Get parent row data for table checkboxes\n const tableRow = element.closest('tr');\n if (tableRow) {\n // Get table headers to use as column names\n const table = tableRow.closest('table');\n const headerCells = table ? Array.from(table.querySelectorAll('thead th')) : [];\n const headerTexts = headerCells.map(th => th.innerText?.trim() || null);\n \n const rowCells = Array.from(tableRow.cells || []);\n const rowData = {};\n \n // Add tool name as a specific property for AI tools table\n if (table && table.id === 'ai-tools-table') {\n rowData.table_id = table.id;\n // Tool name is typically in the second column (index 1)\n if (rowCells.length > 1) {\n rowData.tool_name = rowCells[1].innerText?.trim() || null;\n rowData.hours_used = rowCells[2].innerText?.trim() || null;\n }\n }\n \n // Add all cell data with header names when available\n rowCells.forEach((cell, index) => {\n if (index > 0 && cell.innerText?.trim()) { // Skip first cell (checkbox cell)\n const headerText = headerTexts[index];\n const key = headerText ? \n `${headerText.toLowerCase().replace(/[^a-z0-9]/g, '_')}_${index}` : \n `column_${index}`;\n rowData[key] = cell.innerText.trim();\n }\n });\n \n interactionContext = rowData;\n }\n }\n \n // Get data attributes from the clicked element and its parents with data-track\n const dataAttributes = {};\n \n // First check the element itself\n for (const key in element.dataset) {\n dataAttributes[`data_${key}`] = element.dataset[key];\n }\n \n // Then look for any parent elements with data-track and merge their attributes\n // This allows adding data-track to a parent container and having it apply to all children\n let parent = element.closest('[data-track]');\n while (parent && parent !== element) {\n for (const key in parent.dataset) {\n // Only add if not already present (child attributes take precedence)\n if (!dataAttributes[`data_${key}`]) {\n dataAttributes[`data_${key}`] = parent.dataset[key];\n }\n }\n // Look for next parent with data-track\n parent = parent.parentElement ? parent.parentElement.closest('[data-track]') : null;\n }\n \n\n\n // Get page information\n const pagePath = window.location.pathname;\n const pageTitle = document.title;\n const pageUrl = window.location.href;\n\n // Get user ID and admin link from meta tags\n const userId = document.querySelector('meta[name=\"current-user-id\"]')?.content;\n const adminUserLink = document.querySelector('meta[name=\"admin-user-link\"]')?.content;\n \n // Get account info from meta tags\n const accountId = document.querySelector('meta[name=\"current-account-id\"]')?.content;\n const adminAccountLink = document.querySelector('meta[name=\"admin-account-link\"]')?.content;\n \n // Combine all properties\n const eventProps = {\n element_type: tagName,\n element_id: id,\n element_classes: classes,\n element_text: text,\n element_href: href,\n interaction_type: interactionType,\n element_value: elementValue,\n interaction_context: interactionContext,\n page_path: pagePath,\n page_title: pageTitle,\n page_url: pageUrl,\n user_id: userId || null,\n admin_user_link: adminUserLink || null,\n account_id: accountId || null,\n admin_account_link: adminAccountLink || null,\n ...dataAttributes,\n ...additionalProps\n };\n\n // Track the event asynchronously to avoid blocking the UI\n Promise.resolve().then(() => {\n try {\n mixpanel.track(\"element_clicked\", eventProps);\n } catch (e) {\n console.error(\"Error tracking click event:\", e);\n }\n });\n } catch (e) {\n console.error(\"Error preparing click event data:\", e);\n }\n};\n\n/**\n * Setup global click tracking on the document\n * Intelligently filters clicks to track only meaningful interactions\n */\nconst setupClickTracking = () => {\n if (!window.mixpanel) return;\n \n // Use a flag to prevent infinite recursion\n let isProcessingClick = false;\n \n // Remove any existing click listeners to prevent duplicates\n document.removeEventListener('click', handleClick);\n \n // Add the click listener with a debounced handler to prevent excessive tracking\n document.addEventListener('click', debounce(handleClick, 300));\n \n function handleClick(event) {\n // Prevent infinite recursion\n if (isProcessingClick) return;\n isProcessingClick = true;\n \n try {\n // Get the clicked element\n const clickedElement = event.target;\n // Process clicked element\n \n // Skip tracking if element or its parent has data-no-track attribute\n if (clickedElement.closest('[data-no-track]')) {\n isProcessingClick = false;\n return;\n }\n \n // Skip tracking for certain elements that are likely not meaningful\n const tagName = clickedElement.tagName.toLowerCase();\n const skipTags = ['html', 'body', 'script', 'style', 'svg', 'path', 'rect', 'circle'];\n if (skipTags.includes(tagName)) {\n isProcessingClick = false;\n return;\n }\n \n // Skip tracking for elements without text, href, id, or meaningful classes\n // unless they have a data-track attribute\n const hasText = clickedElement.innerText?.trim();\n const hasHref = clickedElement.href;\n const hasId = clickedElement.id;\n const hasClasses = clickedElement.classList.length > 0;\n const hasDataTrack = clickedElement.hasAttribute('data-track');\n const hasDataAnalytics = clickedElement.hasAttribute('data-analytics');\n \n // Find the most meaningful element to track (the clicked element or its closest interactive parent)\n const interactiveSelectors = 'a, button, input[type=\"submit\"], input[type=\"button\"], [role=\"button\"], .js-track-click, li[role=\"tab\"], [data-track], [data-analytics]';\n const interactiveParent = clickedElement.closest(interactiveSelectors);\n \n // Track the most meaningful element\n const elementToTrack = interactiveParent || clickedElement;\n \n // Only track if the element has some meaningful properties or is explicitly marked for tracking\n if (hasText || hasHref || hasId || hasClasses || hasDataTrack || hasDataAnalytics || interactiveParent) {\n trackClick(elementToTrack);\n }\n } finally {\n // Always reset the flag\n isProcessingClick = false;\n }\n }\n};\n\n// Export the functions\n/**\n * Simple debounce function to prevent excessive event firing\n * @param {Function} func - The function to debounce\n * @param {number} wait - The debounce wait time in milliseconds\n * @returns {Function} - The debounced function\n */\nfunction debounce(func, wait) {\n let timeout;\n return function(...args) {\n const context = this;\n clearTimeout(timeout);\n timeout = setTimeout(() => func.apply(context, args), wait);\n };\n}\n\nexport { initMixpanel, trackClick, setupClickTracking };\n","// This file is automatically compiled by Webpack, along with any other files\n// present in this directory. You're encouraged to place your actual application logic in\n// a relevant structure within app/javascript and only use these pack files to reference\n// that code so it'll be compiled.\n\nimport Rails from \"@rails/ujs\"\nimport \"@hotwired/turbo-rails\"\nimport * as ActiveStorage from \"@rails/activestorage\"\nimport \"channels\"\nimport { initMixpanel, setupClickTracking } from '../utilities/mixpanel'\n\nRails.start()\nActiveStorage.start()\n\n// Global JS extensions\nrequire('utilities/cable_ready')\nrequire('utilities/confirmation_success')\nrequire('utilities/hiding')\nrequire('utilities/html_to_elements')\nrequire('utilities/set')\nrequire('utilities/trix')\n\n// ActionText support\nrequire(\"trix\")\nrequire(\"@rails/actiontext\")\n\n// Enable Datatables\nrequire('datatables.net-dt');\nrequire('datatables.net-buttons-dt');\nrequire('datatables.net-buttons/js/buttons.html5.js');\nrequire('datatables.net-buttons/js/buttons.colVis.js');\nrequire('datatables.net-colreorder-dt');\n\n// Load up Turbo & Stimulus controllers\nimport \"controllers\"\n\n// Enable fancy date & time pickers in forms\nimport '../components/date_time_picker'\n\n// Enable charts\nimport 'chartkick/chart.js'\nimport { Chart, LinearScale, PointElement } from 'chart.js'\nwindow.Chart = Chart\nimport 'chartjs-adapter-date-fns'\nimport annotationPlugin from 'chartjs-plugin-annotation'\nimport { TreeController, EdgeLine } from 'chartjs-chart-graph';\n\nChart.register(annotationPlugin, TreeController, EdgeLine, LinearScale, PointElement);\n\n// Track page titles for back button navigation\ndocument.addEventListener(\"turbo:load\", function() {\n const currentTitle = document.querySelector('meta[name=\"page-title\"]')?.content\n const storedCurrentTitle = localStorage.getItem(\"currentPageTitle\")\n \n // Only update if we're on a different page\n if (currentTitle !== storedCurrentTitle) {\n // Store the previous current title as previous\n if (storedCurrentTitle) {\n localStorage.setItem(\"previousPageTitle\", storedCurrentTitle)\n }\n \n // Update current page title\n localStorage.setItem(\"currentPageTitle\", currentTitle)\n }\n})\n\n// Initialize Mixpanel when the DOM is loaded\ndocument.addEventListener(\"turbo:load\", function() {\n // Initialize Mixpanel\n if (initMixpanel()) {\n // Set up click tracking\n setupClickTracking()\n }\n})\n\n// Handle anchor scrolling after Turbo Frame loads\ndocument.addEventListener(\"turbo:frame-load\", function(event) {\n if (window.location.hash) {\n const hash = window.location.hash.slice(1)\n const element = document.getElementById(hash)\n \n if (element) {\n // Check if the element is within the frame that just loaded\n if (event.target.contains(element)) {\n setTimeout(() => {\n element.scrollIntoView({ behavior: \"smooth\", block: \"start\" })\n // Drop the hash from the URL after scrolling to prevent future automatic scrolling\n const url = new URL(window.location)\n url.hash = \"\"\n history.replaceState({}, \"\", url)\n }, 100)\n }\n }\n }\n})\n\n// Welcome message!\nconsole.log('\\\\ \\\\ / /__ __ _ _ __ / _ \\\\ _ __ ___ ')\nconsole.log(' \\\\ V / _ \\\\/ _` | \\'__| | | | \\'_ \\\\ / _ \\\\')\nconsole.log(' | | __/ (_| | | | |_| | | | | __/')\nconsole.log(' |_|\\\\___|\\\\__,_|_| \\\\___/|_| |_|\\\\___|')\nconsole.log(\"Hello, code spelunker! Welcome to YearOne!\")\nconsole.log(\"\\n\\n\")\n","// Ensure that