{
  "version": 3,
  "sources": ["/cdn/shop/t/706/assets/rs-helpers.js"],
  "sourcesContent": ["(function () {\n  window.RS = window.RS || {};\n  window.RS.helpers = window.RS.helpers || {};\n\n  // js/helper/currency.js\n  window.RS.helpers.formatMoney = function formatMoney(cents, format = \"\") {\n    if (typeof cents === \"string\") {\n      cents = cents.replace(\".\", \"\");\n    }\n    const placeholderRegex = /\\{\\{\\s*(\\w+)\\s*\\}\\}/,\n      formatString = format || window.themeVariables.settings.moneyFormat;\n\n    function defaultTo(value2, defaultValue) {\n      return value2 == null || value2 !== value2 ? defaultValue : value2;\n    }\n\n    function formatWithDelimiters(number, precision, thousands, decimal) {\n      precision = defaultTo(precision, 2);\n      thousands = defaultTo(thousands, \",\");\n      decimal = defaultTo(decimal, \".\");\n      if (isNaN(number) || number == null) {\n        return 0;\n      }\n      number = (number / 100).toFixed(precision);\n      let parts = number.split(\".\"),\n        dollarsAmount = parts[0].replace(/(\\d)(?=(\\d\\d\\d)+(?!\\d))/g, \"$1\" + thousands),\n        centsAmount = parts[1] ? decimal + parts[1] : \"\";\n      return dollarsAmount + centsAmount;\n    }\n    let value = \"\";\n    switch (formatString.match(placeholderRegex)[1]) {\n      case \"amount\":\n        value = formatWithDelimiters(cents, 2);\n        break;\n      case \"amount_no_decimals\":\n        value = formatWithDelimiters(cents, 0);\n        break;\n      case \"amount_with_space_separator\":\n        value = formatWithDelimiters(cents, 2, \" \", \".\");\n        break;\n      case \"amount_with_comma_separator\":\n        value = formatWithDelimiters(cents, 2, \".\", \",\");\n        break;\n      case \"amount_with_apostrophe_separator\":\n        value = formatWithDelimiters(cents, 2, \"'\", \".\");\n        break;\n      case \"amount_no_decimals_with_comma_separator\":\n        value = formatWithDelimiters(cents, 0, \".\", \",\");\n        break;\n      case \"amount_no_decimals_with_space_separator\":\n        value = formatWithDelimiters(cents, 0, \" \");\n        break;\n      case \"amount_no_decimals_with_apostrophe_separator\":\n        value = formatWithDelimiters(cents, 0, \"'\");\n        break;\n    }\n    if (formatString.indexOf(\"with_comma_separator\") !== -1) {\n      return formatString.replace(placeholderRegex, value);\n    } else {\n      return formatString.replace(placeholderRegex, value);\n    }\n  }\n})();"],
  "mappings": "CAAC,UAAY,CACX,OAAO,GAAK,OAAO,IAAM,CAAC,EAC1B,OAAO,GAAG,QAAU,OAAO,GAAG,SAAW,CAAC,EAG1C,OAAO,GAAG,QAAQ,YAAc,SAAqB,MAAO,OAAS,GAAI,CACnE,OAAO,OAAU,WACnB,MAAQ,MAAM,QAAQ,IAAK,EAAE,GAE/B,MAAM,iBAAmB,sBACvB,aAAe,QAAU,OAAO,eAAe,SAAS,YAE1D,SAAS,UAAU,OAAQ,aAAc,CACvC,OAAO,QAAU,MAAQ,SAAW,OAAS,aAAe,MAC9D,CAEA,SAAS,qBAAqB,OAAQ,UAAW,UAAW,QAAS,CAInE,GAHA,UAAY,UAAU,UAAW,CAAC,EAClC,UAAY,UAAU,UAAW,GAAG,EACpC,QAAU,UAAU,QAAS,GAAG,EAC5B,MAAM,MAAM,GAAK,QAAU,KAC7B,MAAO,GAET,QAAU,OAAS,KAAK,QAAQ,SAAS,EACzC,IAAI,MAAQ,OAAO,MAAM,GAAG,EAC1B,cAAgB,MAAM,CAAC,EAAE,QAAQ,2BAA4B,KAAO,SAAS,EAC7E,YAAc,MAAM,CAAC,EAAI,QAAU,MAAM,CAAC,EAAI,GAChD,OAAO,cAAgB,WACzB,CACA,IAAI,MAAQ,GACZ,OAAQ,aAAa,MAAM,gBAAgB,EAAE,CAAC,EAAG,CAC/C,IAAK,SACH,MAAQ,qBAAqB,MAAO,CAAC,EACrC,MACF,IAAK,qBACH,MAAQ,qBAAqB,MAAO,CAAC,EACrC,MACF,IAAK,8BACH,MAAQ,qBAAqB,MAAO,EAAG,IAAK,GAAG,EAC/C,MACF,IAAK,8BACH,MAAQ,qBAAqB,MAAO,EAAG,IAAK,GAAG,EAC/C,MACF,IAAK,mCACH,MAAQ,qBAAqB,MAAO,EAAG,IAAK,GAAG,EAC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