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,EAAY,KAAO,EAAY,UACjC,CACF,GAQA,WAEE,MAAM,EAAY,IAAI,gBAAgB,OAAO,SAAS,QAClC,EAAU,IAAI,UAAuC,YAA3B,EAAU,IAAI,UAA0B,OAAO,SAAS,SAAS,SAAS,SASpH,QAAQ,IAAI,+CAHZ,QAAQ,IAAM,WAAY,CAS/B,CAlBD","file":"/gh/gorgias/gorgias-webflow@03a44fe/src/js/all.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.48.0.\n * Original file: /gh/gorgias/gorgias-webflow@03a44fe/src/js/all.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","// this script is loaded sync on every page of the website, in the head tag, before any other script\n\n// function to import a js file hosted on the CDN\nfunction newScript(filePath, position, syncStatus, type){\n  // filePath should start by https:// if it's a 3rd party script\n  // position should be 'head' OR 'body' (or a selector / DOM element)\n  // syncStatus should be set to 1 if defer\n  // type is optional, defaults to \"text/javascript\"\n\n  var script = document.createElement('script');\n  script.src = filePath;\n  script.type = type || 'text/javascript';\n  script.defer = (syncStatus == 1);\n\n  var parent;\n  if (position === 'head') {\n    parent = document.head;\n  } else if (position === 'body') {\n    parent = document.body;\n  } else if (typeof position === 'string') {\n    parent = document.querySelector(position) || document.head;\n  } else if (position instanceof Element) {\n    parent = position;\n  } else {\n    parent = document.head;\n  }\n\n  parent.appendChild(script);\n}\n\n// Function to append a styleSheet hosted on the CDN\nfunction newStyle(filePath, position){\n    //position should be always 'head' OR 'body'\n    \n    var link = document.createElement('link');\n    link.rel = 'stylesheet';\n    link.type = 'text/css';\n    link.href = filePath;\n\n    var parent;\n    if (position === 'head') {\n      parent = document.head;\n    } else if (position === 'body') {\n      parent = document.body;\n    } else if (typeof position === 'string') {\n      parent = document.querySelector(position) || document.head;\n    } else if (position instanceof Element) {\n      parent = position;\n    } else {\n      parent = document.head;\n    }\n\n    parent.appendChild(link);\n  }\n\n/* BEGINING OF cookies functions */\n// function to create a cookie\nfunction setCookie(cname, cvalue, exdays) {\n    var d = new Date();\n    d.setTime(d.getTime() + (exdays*24*60*60*1000));\n    var expires = \"expires=\"+ d.toUTCString();\n    var cookieDomain = location.origin.replace('https://','').replace('www','');\n    document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";domain=\" + cookieDomain + \";path=/\";\n}\n// function to get the value of a cookie\nfunction getCookie(cname) {\n    var name = cname + \"=\";\n    var decodedCookie = decodeURIComponent(document.cookie);\n    var ca = decodedCookie.split(';');\n    for(var i = 0; i <ca.length; i++) {\n        var c = ca[i];\n        while (c.charAt(0) == ' ') {\n            c = c.substring(1);\n        }\n        if (c.indexOf(name) == 0) {\n            return c.substring(name.length, c.length);\n        }\n    }\n    return \"\";\n}\n/* END OF cookies functions */\n\n// function to get value of an utm parameters\nfunction getParam(name) {\n    name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n    var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\");\n    results = regex.exec(location.search);\n    var output;\n\n    if(results === null) {\n        output = \"\";\n    }\n    else{\n        // utm parameter value is an email, don't replace + by space\n        if ( decodeURIComponent(results[1]).indexOf(\"@\") !== -1 ) {\n        output = decodeURIComponent(results[1]);\n        }\n        else{\n        output = decodeURIComponent(results[1].replace(/\\+/g, \" \"))\n        }\n    }\n    return output;\n}\n\n// format figures with comma separator\nfunction formatNumberWithCommas(number) {\nreturn number.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n}\n\n/****************************\n *\n * This script creates links when detected in FAQ section\n *\n ****************************/\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n    // Regular expression to match URLs with or without protocols\n    const urlPattern =\n      /(?:https?:\\/\\/)?(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,}(?:\\/[^\\s]*)?/g;\n  \n    // Get all elements with the class 'new-faq_content'\n    const faqElements = document.querySelectorAll(\".new-faq_content\");\n  \n    faqElements.forEach((element) => {\n      // Get the inner HTML of the element\n      let content = element.innerHTML;\n  \n      // Replace the URLs in the content with anchor tags\n      const updatedContent = content.replace(urlPattern, (url) => {\n        // Ensure the URL starts with http:// or https://\n        const href = url.startsWith(\"http\") ? url : `https://${url}`;\n        const link = `<a class=\"faq-link\" href=\"${href}\" target=\"_blank\">${url}</a>`;\n        return link;\n      });\n  \n      // Update the element's HTML content\n      element.innerHTML = updatedContent;\n    });\n  });\n\n /****************************\n * \n * Checks UTM source to display banner\n * \n ****************************/\n\ndocument.addEventListener('DOMContentLoaded', () => {\n    // Step 1: Find the element with data-target=\"banner\"\n    const banner = document.querySelector('[data-target=\"banner\"]');\n  \n    // Step 2: Function to get URL parameters\n    const getUrlParameter = (name) => {\n      name = name.replace(/[\\[]/, '\\\\[').replace(/[\\]]/, '\\\\]');\n      const regex = new RegExp('[\\\\?&]' + name + '=([^&#]*)');\n      const results = regex.exec(location.search);\n      return results === null ? '' : decodeURIComponent(results[1].replace(/\\+/g, ' '));\n    };\n  \n    // Step 3: Check if the utm_source is \"google\"\n    const utmSource = getUrlParameter('utm_source');\n    const utmMedium = getUrlParameter('utm_medium');\n    if (utmSource === 'google' && utmMedium === 'cpc') {\n      // Step 4: Remove the class .is-hidden if the traffic comes from Google search with CPC medium\n      banner.classList.remove('is-hidden');\n    }\n  });\n  \n  // Step 4: pass info to demo url\ndocument.addEventListener('DOMContentLoaded', () => {\n    // Function to get URL parameters (reused)\n    const getUrlParameter = (name) => {\n      name = name.replace(/[\\[]/, '\\\\[').replace(/[\\]]/, '\\\\]');\n      const regex = new RegExp('[\\\\?&]' + name + '=([^&#]*)');\n      const results = regex.exec(location.search);\n      return results === null ? '' : decodeURIComponent(results[1].replace(/\\+/g, ' '));\n    };\n  \n\n    const incentiveDemoBtn = document.getElementById(\"incentive-demo\");\n    if (incentiveDemoBtn) {\n      incentiveDemoBtn.addEventListener(\"click\", function() {\n        // Create the URL with the parameters\n        const demoUrl = `/stimulus/fr/100amazon?utm_source=google&utm_medium=cpc&utm_campaign=incentive_website_banner`;\n    \n        // Redirect to the demo URL\n        window.location.href = demoUrl;\n      });\n    }\n    \n  });\n\n\n/****************************\n * \n * Find and append query parameters to a button URL\n * \n ****************************/\n\ndocument.addEventListener(\"DOMContentLoaded\", function() {\n  // Get the current page URL search parameters\n  const queryParams = new URLSearchParams(window.location.search);\n\n  // Find the element with the specified data attribute\n  const paramButton = document.querySelector('[data-el=\"params\"]');\n\n  // Check if the element exists\n  if (paramButton) {\n    // Get the current href of the button\n    const originalUrl = new URL(paramButton.href);\n\n    // Append the query parameters from the current page to the original URL\n    queryParams.forEach((value, key) => {\n      originalUrl.searchParams.append(key, value);\n    });\n\n    // Set the new URL with the query parameters back to the button\n    paramButton.href = originalUrl.toString();\n  }\n});\n\n/****************************\n * \n * Function to deactivate console logs in production\n * \n ****************************/\n\n(function () {\n  // Parse the current URL and look for the ?debug=gorgias parameter\n  const urlParams = new URLSearchParams(window.location.search);\n  const isDebugMode = urlParams.has('debug') && urlParams.get('debug') === 'gorgias' || window.location.pathname.includes('/wip/');\n\n  // Function to disable console.log if not in debug mode (i.e., if on production)\n  function handleConsoleLogs() {\n    if (!isDebugMode) {\n      // Overwrite console.log to do nothing (production mode)\n      console.log = function() {};\n    } else {\n      // Debug mode, keep console.log as it is\n      console.log(\"Debug mode active - console.log is enabled.\");\n    }\n  }\n\n  // Call the function to apply the console.log handling\n  handleConsoleLogs();\n})();\n\n/****************************\n * \n * Find all buttons, set first letter to \n * uppercase and rest to lowercase\n * \n ****************************/\n\n// $(document).ready(function () {\n//   // Select all elements with \"button\" in their class name\n//   $('[class*=\"button\"]').each(function () {\n//     // Find the text inside the element (assuming it's in a child div or directly within the element)\n//     const textElement = $(this).find('div').length ? $(this).find('div') : $(this);\n\n//     // Get the text content and transform it\n//     const originalText = textElement.text().trim();\n//     const formattedText = originalText.charAt(0).toUpperCase() + originalText.slice(1).toLowerCase();\n\n//     // Update the text content\n//     textElement.text(formattedText);\n//   });\n// });"]}