{"version":3,"file":"hoisted.BIs_hYxw.js","sources":["../../../src/lib/sfc-widgets.ts","../../../src/components/integrations/init.astro?astro&type=script&index=0&lang.ts"],"sourcesContent":["///\n/// Handling the legacy widgets tool\n///\n\nimport Cookies from 'js-cookie'\n\nconst NUMBER_OF_VISITS_COOKIE_NAME = \"sfc-widgets-number-of-visits\"\nconst WIDGETS_SHOWN_COOKIE_NAME = 'sfc-widget-widgets-shown'\n\nconst updateNumberOfVisits = () => {\n const cookieValue = Cookies.get(NUMBER_OF_VISITS_COOKIE_NAME)\n\n if (cookieValue === undefined) {\n const currentDate = new Date()\n const newDate = new Date(currentDate.getTime() + 3 * 60000)\n Cookies.set(NUMBER_OF_VISITS_COOKIE_NAME, '1', {\n expires: newDate\n })\n } else {\n const value = parseInt(cookieValue)\n const currentDate = new Date()\n const newDate = new Date(currentDate.getTime() + 2 * 60000)\n Cookies.set(NUMBER_OF_VISITS_COOKIE_NAME, (value + 1).toString(), {\n expires: newDate\n });\n }\n}\n\nconst getWidgetsShown = (): string => {\n return Cookies.get(WIDGETS_SHOWN_COOKIE_NAME) || ''\n}\n\nconst alreadyShown = (widgetId: number): boolean => {\n return (\n getWidgetsShown()\n .replace(/\\s/g, '')\n .split(',')\n .find((id) => id === widgetId.toString()) !== undefined\n )\n}\n\nconst updateWidgetShown = (widgetId: number) => {\n if (!alreadyShown(widgetId)) {\n Cookies.set(\n WIDGETS_SHOWN_COOKIE_NAME,\n getWidgetsShown() !== ''\n ? `${getWidgetsShown()}, ${widgetId}`\n : widgetId.toString()\n )\n }\n}\n\nconst initSfcWidgets = () => {\n updateNumberOfVisits()\n}\n\nexport { initSfcWidgets, alreadyShown, updateWidgetShown }\n"," import * as Sentry from '@sentry/astro'\n\n if (window.moduleLoadErrors?.length) {\n window.moduleLoadErrors.forEach((event) => {\n Sentry.captureMessage(`vite:preloadError: ${event}`, {\n level: 'error'\n })\n\n if (event.payload) {\n Sentry.captureException(event.payload)\n }\n })\n }\n\n import { initSfcWidgets } from '@lib/sfc-widgets'\n initSfcWidgets()\n\n\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyAidmVyc2lvbiI6IDMsICJzb3VyY2VzIjogWyIvY29kZWJ1aWxkL291dHB1dC9zcmMxMzYxODM0NTgwL3NyYy9zZmNfZnJvbnRlbmRfYXN0cm8vc3JjL2NvbXBvbmVudHMvaW50ZWdyYXRpb25zL2luaXQuYXN0cm8iXSwgInNvdXJjZXNDb250ZW50IjogWyItLS1cblxuLS0tXG5cblx1MDAzY3NjcmlwdCBpczppbmxpbmUgdHlwZT1cInRleHQvamF2YXNjcmlwdFwiXHUwMDNlXG4gIHdpbmRvdy5tb2R1bGVMb2FkRXJyb3JzID0gW11cblxuICAvLyBodHRwczovL3ZpdGUuZGV2L2d1aWRlL2J1aWxkI2xvYWQtZXJyb3ItaGFuZGxpbmdcbiAgd2luZG93LmFkZEV2ZW50TGlzdGVuZXIoJ3ZpdGU6cHJlbG9hZEVycm9yJywgKGV2ZW50KSA9XHUwMDNlIHtcbiAgICBjb25zb2xlLmxvZygndml0ZTpwcmVsb2FkRXJyb3InKVxuICAgIGNvbnNvbGUuZXJyb3IoJ3ZpdGU6cHJlbG9hZEVycm9yJywgZXZlbnQpXG4gICAgd2luZG93Lm1vZHVsZUxvYWRFcnJvcnMucHVzaChldmVudClcbiAgfSlcblx1MDAzYy9zY3JpcHRcdTAwM2Vcblx1MDAzY3NjcmlwdFx1MDAzZVxuICBpbXBvcnQgKiBhcyBTZW50cnkgZnJvbSAnQHNlbnRyeS9hc3RybydcblxuICBpZiAod2luZG93Lm1vZHVsZUxvYWRFcnJvcnM/Lmxlbmd0aCkge1xuICAgIHdpbmRvdy5tb2R1bGVMb2FkRXJyb3JzLmZvckVhY2goKGV2ZW50KSA9XHUwMDNlIHtcbiAgICAgIFNlbnRyeS5jYXB0dXJlTWVzc2FnZShgdml0ZTpwcmVsb2FkRXJyb3I6ICR7ZXZlbnR9YCwge1xuICAgICAgICBsZXZlbDogJ2Vycm9y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yxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNsRCxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQUE7IiwgIm5hbWVzIjogW10gfQ=="],"names":["NUMBER_OF_VISITS_COOKIE_NAME","WIDGETS_SHOWN_COOKIE_NAME","updateNumberOfVisits","cookieValue","Cookies","currentDate","newDate","value","getWidgetsShown","alreadyShown","widgetId","id","updateWidgetShown","initSfcWidgets","event","Sentry.captureMessage","Sentry.captureException"],"mappings":"wjBAMA,MAAMA,EAA+B,+BAC/BC,EAA4B,2BAE5BC,EAAuB,IAAM,CACzB,MAAAC,EAAcC,EAAQ,IAAIJ,CAA4B,EAE5D,GAAIG,IAAgB,OAAW,CACrB,MAAAE,MAAkB,KAClBC,EAAU,IAAI,KAAKD,EAAY,UAAY,EAAI,GAAK,EAClDD,EAAA,IAAIJ,EAA8B,IAAK,CAC3C,QAASM,CAAA,CACZ,CAAA,KACE,CACG,MAAAC,EAAQ,SAASJ,CAAW,EAC5BE,MAAkB,KAClBC,EAAU,IAAI,KAAKD,EAAY,UAAY,EAAI,GAAK,EAC1DD,EAAQ,IAAIJ,GAA+BO,EAAQ,GAAG,WAAY,CAChE,QAASD,CAAA,CACV,CACL,CACJ,EAEME,EAAkB,IACbJ,EAAQ,IAAIH,CAAyB,GAAK,GAG/CQ,EAAgBC,GAEdF,EACK,EAAA,QAAQ,MAAO,EAAE,EACjB,MAAM,GAAG,EACT,KAAMG,GAAOA,IAAOD,EAAS,SAAU,CAAA,IAAM,OAIpDE,EAAqBF,GAAqB,CACvCD,EAAaC,CAAQ,GACdN,EAAA,IACJH,EACAO,EAAsB,IAAA,GAChB,GAAGA,EAAA,CAAiB,KAAKE,CAAQ,GACjCA,EAAS,SAAS,CAAA,CAGpC,EAEMG,EAAiB,IAAM,CACJX,GACzB,ECrCM,OAAO,kBAAkB,QACpB,OAAA,iBAAiB,QAASY,GAAU,CAClCC,EAAe,sBAAsBD,CAAK,GAAI,CACnD,MAAO,QACR,EAEGA,EAAM,SACDE,EAAiBF,EAAM,OAAO,EAExC,EAIHD,EAAe"}