{"version":3,"file":"artist-show-CuGXLAM1.js","sources":["../../../app/frontend/entrypoints/artist-show.js"],"sourcesContent":["document.addEventListener('turbo:load', function () {\n var calendar;\n\n var calendarEl = document.getElementById('calendar');\n const modal = document.getElementById('supportModal');\n var calendarPaneEl = document.querySelector('#calendarPane');\n const starButtons = document.querySelectorAll('.star-btn');\n const supportButton = document.getElementById('support-trigger');\n const starCountField = document.getElementById('star-count-field');\n const form = document.getElementById('payment-form');\n const customStarCountField = document.querySelector('.custom-star-count');\n const amountField = document.getElementById('amount-field'); //\n const publicKey = supportButton.getAttribute('data-stripe-public-key');\n\n // console.log('Public Key:', publicKey);\n const stripe = Stripe(publicKey, {\n // Specify betas to opt into Stripe Link\n betas: ['link_beta_1'],\n });\n console.log('Stripe:', stripe);\n const emailError = document.getElementById('emailError'); // Error message element\n const emailInput = document.getElementById('supporterEmail');\n const supporterMessage = document.getElementById('supporter-message').value;\n\n // Initialize Stripe Elements\n const elements = stripe.elements();\n\n var supportTrigger = document.getElementById('support-trigger');\n supportTrigger.addEventListener('click', function (event) {\n event.preventDefault();\n modal.style.display = 'flex';\n if (!card) {\n // Initialize Stripe elements if they haven't been already\n const elements = stripe.elements();\n const style = { base: { fontSize: '16px', color: '#32325d' } };\n card = elements.create('card', { style: style });\n card.mount('#card-element');\n }\n });\n\n // Then you can define your style and create the card element\n const style = {\n base: {\n fontSize: '16px',\n color: '#32325d',\n },\n // Add other styling as needed\n };\n\n var paymentEmailInput = document.getElementById('paymentEmail');\n const errorElement = document.getElementById('card-errors');\n var displayError = document.getElementById('card-errors');\n const confirmEmailButton = document.getElementById('confirmEmailButton');\n const paymentDetailsContainer = document.getElementById('paymentDetailsContainer');\n const emailInputContainer = document.getElementById('emailInputContainer');\n const submitButton = document.getElementById('submitPaymentButton');\n const paymentForm = document.getElementById('payment-form');\n const artistSlugContainer = document.getElementById('artistSlugContainer');\n const artistSlug2 = artistSlugContainer.getAttribute('data-artist-slug');\n var card = elements.create('card');\n card.mount('#card-element');\n\n // INFO MODAL\n\n // Get the modal\n var infoModal = document.getElementById('info-modal');\n\n // Get the button that opens the modal\n var infoBtn = document.getElementById('info-trigger');\n\n // Get the elements that close the modal\n\n var closeInfoBtn = document.getElementById('close-info-modal');\n\n // When the user clicks the button, open the modal\n infoBtn.onclick = function () {\n infoModal.style.display = 'block';\n };\n\n // When the user clicks on (x) or \"Got it\", close the modal\n function closeInfoModal() {\n infoModal.style.display = 'none';\n }\n\n closeInfoBtn.onclick = function () {\n infoModal.style.display = 'none';\n };\n\n // When the user clicks anywhere outside of the modal, close it\n window.onclick = function (event) {\n if (event.target == infoModal) {\n closeInfoModal();\n }\n };\n\n // END INFO MODAL\n\n // GUEST CHECKOUT\n\n var supportModal = document.getElementById('support-modal');\n var closeButton2 = document.getElementsByClassName('close-button')[0];\n var guestPurchase = document.getElementById('guest-purchase');\n var userSignedInElement = document.getElementById('user-signed-in');\n var userSignedIn = userSignedInElement.value === 'true';\n\n supportTrigger.addEventListener('click', function () {\n var supportModal = document.getElementById('support-modal');\n var loginModal = document.getElementById('login-modal');\n var closeButton = document.getElementsByClassName('close')[0];\n var closeButton2 = document.getElementsByClassName('close-button')[0];\n var guestPurchase = document.getElementById('guest-purchase');\n\n if (userSignedIn) {\n console.log('User is signed in');\n // User is signed in, show the normal support modal\n supportModal.style.display = 'block';\n\n // When the user clicks on (x), close the modal\n if (closeButton) {\n closeButton.onclick = function () {\n supportModal.style.display = 'none';\n };\n }\n } else {\n console.log('User is not signed in');\n // User is not signed in, show the login modal\n loginModal.style.display = 'block';\n\n guestPurchase.onclick = function () {\n // Handle guest purchase logic here\n console.log('Guest purchase clicked');\n loginModal.style.display = 'none';\n if (supportModal) {\n supportModal.style.display = 'block';\n }\n };\n }\n });\n\n // END GUEST CHECKOUT\n\n // function hideModal(modal) {\n // modal.style.display = 'none'; // Assuming you use inline styles to control visibility\n // modal.setAttribute('aria-hidden', 'true'); // Accessibility\n // }\n\n // // Function to show the modal\n // function showModal(modal) {\n // modal.style.display = 'block'; // Assuming you use inline styles to control visibility\n // modal.setAttribute('aria-hidden', 'false'); // Accessibility\n // }\n\n if (form) {\n form.addEventListener('submit', async function (event) {\n event.preventDefault();\n const submitButton = document.getElementById('submitPaymentButton'); // Correct the ID here\n submitButton.disabled = true;\n\n const cardElement = card; // Assuming 'card' is already defined as your Stripe card element\n const { paymentMethod, error } = await stripe.createPaymentMethod({\n type: 'card',\n card: cardElement,\n });\n\n const errorElement = document.getElementById('card-errors'); // Ensure this ID exists\n if (error) {\n errorElement.textContent = error.message;\n submitButton.disabled = false;\n } else {\n console.log(`Payment method created: ${paymentMethod.id}`);\n await submitPaymentMethod(paymentMethod.id);\n }\n });\n }\n\n async function submitPaymentMethod(paymentMethodId) {\n const chargeAmount = document.getElementById('hiddenChargeAmount').value;\n const paymentEmailInput = document.getElementById('paymentEmail');\n const artistSlug2 = document.getElementById('artistSlug').value;\n const supporterMessage = document.getElementById('supporter-message').value;\n const supporterName = document.getElementById('supporter-name').value;\n const starCountField = document.getElementById('star-count-field').value; // Assuming this is the correct way to retrieve stars\n const starPurchasesPath = submitButton.dataset.starPurchasesPath; // Retrieve the path from the button's data attribute\n\n console.log('Supporter Message:', supporterMessage);\n console.log('Supporter Name:', supporterName);\n\n const payload = {\n payment_method_id: paymentMethodId,\n charge_amount: chargeAmount,\n artist_slug: artistSlug2,\n receipt_email: paymentEmailInput.value,\n stars: starCountField,\n message: supporterMessage,\n supporter_name: supporterName,\n guest_email: paymentEmailInput.value,\n };\n\n const fetchUrl = `/artists/${artistSlug2}/create_payment`;\n console.log('Request Payload:', payload);\n\n try {\n const response = await fetch(fetchUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-CSRF-Token': document.querySelector(\"[name='csrf-token']\").content,\n },\n body: JSON.stringify(payload),\n });\n\n console.log('Response:', response);\n if (!response.ok) {\n throw new Error('Network response was not okay.');\n }\n\n const result = await response.json();\n console.log('Result:', result);\n\n if (result.error) {\n submitButton.disabled = false;\n } else {\n console.log('Payment successful:', result);\n alert(\n \"Thank you for your support! Your payment has been successfully processed. You can see your star purchases under 'Recent Supporters' on the artist's page. You will also have a receipt sent to your email.\",\n );\n\n // Check if the user is signed in\n const isUserSignedIn = result.user_signed_in || false;\n\n // Redirect to the appropriate page based on the user's sign-in status\n if (isUserSignedIn) {\n window.location.href = starPurchasesPath; // Redirect to the star purchases page for signed-in users\n } else {\n window.location.href = `/artists/${artistSlug2}`; // Redirect to the artist show view for guests\n }\n }\n } catch (error) {\n console.error('Error:', error);\n errorElement.textContent = error.message;\n submitButton.disabled = false;\n }\n }\n\n // Handle real-time validation errors from the card Element\n card.on('change', function (event) {\n if (event.error) {\n errorElement.textContent = event.error.message;\n } else {\n errorElement.textContent = '';\n }\n });\n\n document.body.addEventListener('submit', function (event) {\n // Check if the target matches your form\n if (event.target && event.target.id === 'payment-form') {\n event.preventDefault();\n // Handle the form submission\n }\n });\n\n if (displayError) {\n displayError.textContent = '';\n console.log('displayError exists');\n console.log(displayError.textContent);\n } else {\n console.log('displayError does not exist');\n }\n\n function updateChargeAmount(chargeAmount) {\n let chargeAmountElement = document.getElementById('total-charge-amount');\n let hiddenChargeElement = document.getElementById('hiddenChargeAmount');\n if (chargeAmountElement && hiddenChargeElement) {\n chargeAmountElement.textContent = `$${chargeAmount.toFixed(2)}`;\n hiddenChargeElement.value = chargeAmount.toFixed(2);\n } else {\n console.error('Charge elements not found!');\n }\n }\n\n function validateEmail(email) {\n const re = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,6}$/;\n return re.test(String(email).toLowerCase());\n }\n\n emailInput.addEventListener('input', function () {\n const isValidEmail = validateEmail(emailInput.value);\n confirmEmailButton.disabled = !isValidEmail; // Enable button if the email is valid\n emailError.style.display = isValidEmail ? 'none' : 'block'; // Show/hide error message\n });\n\n confirmEmailButton.addEventListener('click', function () {\n const emailInput = document.getElementById('supporterEmail');\n\n // Directly use the calculated final charge from the previous function\n var finalCharge = parseFloat(document.getElementById('total-charge-amount').textContent.replace(/^\\$/, ''));\n\n const artistSlug = artistSlugContainer.getAttribute('data-artist-slug');\n console.log('Artist Slug:', artistSlug);\n console.log('Email:', emailInput);\n console.log('Final Charge:', finalCharge);\n\n var paymentEmailInput = document.getElementById('paymentEmail');\n if (paymentEmailInput) {\n paymentEmailInput.value = emailInput.value;\n }\n\n // Update the charge amount in the payment form\n updateChargeAmount(finalCharge); // Update both display and hidden field for charge amount\n\n // Toggle visibility of form sections\n document.getElementById('emailInputContainer').style.display = 'none';\n document.getElementById('paymentDetailsContainer').style.display = 'block';\n\n // Ensure the Stripe card element is correctly mounted if it wasn't already\n if (document.getElementById('card-element')) {\n card.mount('#card-element');\n }\n // Additional re-initialization if needed\n });\n\n if (supportButton) {\n supportButton.addEventListener('click', function (event) {\n event.preventDefault();\n const starCount = parseInt(document.getElementById('star-count-field').value, 10);\n const supporterMessage = document.getElementById('supporter-message').value;\n const supporterName = document.getElementById('supporter-name').value;\n console.log('Supporter Message:', supporterMessage);\n console.log('Supporter Name:', supporterName);\n\n updateSupportAmount(starCount);\n\n // // Close the first modal (assuming `supportModal` is the modal element)\n // hideModal(supportModal);\n\n // // Assuming you have some way to detect when your custom modal is \"closed\"\n // // For simplicity, let's assume you can directly call `showModal` after `hideModal`\n // showModal(paymentModal);\n });\n }\n\n function closeModal() {\n const modal = document.getElementById('supportModal');\n modal.style.display = 'none';\n }\n\n // Event listener for the close button\n const closeButton = document.querySelector('.close-modal-button');\n closeButton.addEventListener('click', closeModal);\n\n starButtons.forEach((button) => {\n button.addEventListener('click', function () {\n // This dataset value should represent the number of stars, not the total cost\n const starValue = parseInt(this.dataset.value, 10);\n updateSupportAmount(starValue); // Pass the number of stars to update the amount\n });\n });\n\n if (customStarCountField) {\n customStarCountField.addEventListener('input', function () {\n // Here, the value represents the number of stars directly entered by the user\n const customStarValue = parseInt(this.value, 10) || 0;\n updateSupportAmount(customStarValue); // Update based on the custom number of stars\n });\n }\n\n function updateSupportAmount(numberOfStars) {\n const baseStarCost = 5; // Cost per star\n const platformFeePercent = 5; // Platform fee percentage\n const stripeFeePercent = 2.9; // Stripe fee percentage\n const stripeFixedFee = 0.3; // Stripe fixed fee in dollars\n\n // Calculate initial charge\n const initialCharge = numberOfStars * baseStarCost;\n\n // Calculate the platform fee\n const platformFee = initialCharge * (platformFeePercent / 100);\n\n // Calculate Stripe fees\n const stripeFee = initialCharge * (stripeFeePercent / 100) + stripeFixedFee;\n\n // Calculate total charge\n const finalCharge = initialCharge + platformFee + stripeFee;\n\n // Format the final charge to two decimal places\n const formattedCharge = finalCharge.toFixed(2);\n console.log('formattedCharge:', formattedCharge);\n\n document.getElementById('base-charge-amount').textContent = `$${initialCharge.toFixed(2)}`;\n document.getElementById('platform-fee-amount').textContent = `$${platformFee.toFixed(2)}`;\n document.getElementById('stripe-fee-amount').textContent = `$${stripeFee.toFixed(2)}`;\n document.getElementById('total-charge-amount').textContent = `$${finalCharge.toFixed(2)}`;\n\n // Update the support button and charge amount in the modal\n const supportButton = document.getElementById('support-button');\n if (supportButton) {\n supportButton.textContent = `Support $${initialCharge.toFixed(2)}`;\n }\n\n const chargeAmountElement = document.getElementById('charge-amount');\n if (chargeAmountElement) {\n chargeAmountElement.textContent = `$${formattedCharge}`;\n }\n\n const visibleChargeAmountElement = document.getElementById('visible-charge-amount');\n if (visibleChargeAmountElement) {\n visibleChargeAmountElement.textContent = `$${formattedCharge}`;\n }\n\n const starCountField = document.getElementById('star-count-field');\n if (starCountField) {\n starCountField.value = numberOfStars;\n console.log('starCountField:', starCountField.value);\n }\n }\n\n // Function to display a success message\n function displaySuccessMessage(container, message) {\n const messageDiv = document.createElement('div');\n messageDiv.textContent = message;\n messageDiv.className = 'alert alert-success'; // Bootstrap class for success messages\n container.prepend(messageDiv);\n }\n\n // Assume this is called when the payment succeeds\n\n //This is used for the calendar to pull the artistSlug to pull the events for the artist to display on the calendar rendered on the artist show page\n var artistSlug = document.querySelector('#calendarPane').dataset.artistSlug;\n console.log('Artist Slug:', artistSlug);\n\n calendar = new FullCalendar.Calendar(calendarEl, {\n headerToolbar: {\n right: 'prev,next today',\n center: 'title',\n left: 'dayGridMonth,timeGridWeek,timeGridDay',\n },\n initialView: 'dayGridMonth',\n events: '/artists/' + artistSlug + '/events', // Use the fetched artistSlug\n height: 'auto',\n eventContent: function (info) {\n // Create a custom element to hold the event title without time\n let titleElement = document.createElement('div');\n titleElement.innerHTML = info.event.title; // Use the event's title without time\n\n // Return the custom element to be rendered\n return { domNodes: [titleElement] };\n },\n eventDidMount: function (info) {\n // Log the colors to the console for debugging\n console.log('Event ID:', info.event);\n console.log('Background Color:', info.event._def.ui.backgroundColor);\n console.log('Text Color:', info.event._def.ui.textColor);\n\n // Apply the colors to the event element in FullCalendar\n if (info.event._def.ui.backgroundColor) {\n info.el.style.backgroundColor = info.event._def.ui.backgroundColor;\n }\n if (info.event._def.ui.textColor) {\n info.el.style.color = info.event._def.ui.textColor;\n }\n // Change the dot color if it exists\n const dotElement = info.el.querySelector('.fc-daygrid-event-dot');\n if (dotElement && info.event._def.ui.backgroundColor) {\n dotElement.style.borderColor = info.event._def.ui.textColor;\n }\n },\n eventClick: function (info) {\n info.jsEvent.preventDefault(); // don't let the browser navigate\n\n // fetch the event page HTML\n fetch(info.event.url)\n .then((response) => response.text())\n .then((data) => {\n var wrapper = document.createElement('div');\n wrapper.innerHTML = data;\n\n // Remove the navigation bar\n var navbar = wrapper.querySelector('.navbar');\n if (navbar) navbar.remove();\n\n // Remove the footer\n var footer = wrapper.querySelector('#footer');\n if (footer) footer.remove();\n\n // Add the modified content to the modal\n document.getElementById('eventModalBody').innerHTML = wrapper.innerHTML;\n\n // Update the event page link\n document.getElementById('artistShowModalLink').setAttribute('href', info.event.url);\n });\n\n // Open the Bootstrap modal\n var eventModal = new bootstrap.Modal(document.getElementById('eventModal'), {});\n eventModal.show();\n },\n });\n\n calendar.render();\n\n var eventItems = document.querySelectorAll('.event-item');\n eventItems.forEach(function (item) {\n item.addEventListener('click', function (e) {\n e.preventDefault();\n var eventUrl = item.getAttribute('data-event-url');\n\n // Use similar fetching and modal opening logic as in the calendar eventClick\n fetch(eventUrl)\n .then((response) => response.text())\n .then((data) => {\n var wrapper = document.createElement('div');\n wrapper.innerHTML = data;\n\n // Remove unnecessary elements\n var navbar = wrapper.querySelector('.navbar');\n if (navbar) navbar.remove();\n\n var footer = wrapper.querySelector('#footer');\n if (footer) footer.remove();\n\n // Update modal content and show modal\n document.getElementById('eventModalBody').innerHTML = wrapper.innerHTML;\n document.getElementById('artistShowModalLink').setAttribute('href', eventUrl);\n\n var eventModal = new bootstrap.Modal(document.getElementById('eventModal'), {});\n eventModal.show();\n });\n });\n });\n\n document.getElementById('calendar-tab').addEventListener('click', function () {\n // Small timeout to ensure tab pane is visible when updateSize is called\n setTimeout(function () {\n calendar.updateSize();\n }, 100);\n });\n});\n"],"names":["calendar","calendarEl","modal","starButtons","supportButton","form","customStarCountField","publicKey","stripe","emailError","emailInput","elements","supportTrigger","event","card","style","errorElement","displayError","confirmEmailButton","submitButton","artistSlugContainer","infoModal","infoBtn","closeInfoBtn","closeInfoModal","userSignedInElement","userSignedIn","supportModal","loginModal","closeButton","guestPurchase","cardElement","paymentMethod","error","submitPaymentMethod","paymentMethodId","chargeAmount","paymentEmailInput","artistSlug2","supporterMessage","supporterName","starCountField","starPurchasesPath","payload","fetchUrl","response","result","updateChargeAmount","chargeAmountElement","hiddenChargeElement","validateEmail","email","isValidEmail","finalCharge","artistSlug","starCount","updateSupportAmount","closeModal","button","starValue","customStarValue","numberOfStars","initialCharge","platformFee","stripeFee","formattedCharge","visibleChargeAmountElement","info","titleElement","dotElement","data","wrapper","navbar","footer","eventModal","eventItems","item","e","eventUrl"],"mappings":"AAAA,SAAS,iBAAiB,aAAc,UAAY,CAClD,IAAIA,EAEAC,EAAa,SAAS,eAAe,UAAU,EACnD,MAAMC,EAAQ,SAAS,eAAe,cAAc,EAC/B,SAAS,cAAc,eAAe,EAC3D,MAAMC,EAAc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