{"version":3,"file":"CompanyPropertiesCookie-986b69d5.js","sources":["../../src/utils/CompanyPropertiesCookie.ts"],"sourcesContent":["import {useCookies} from 'vue3-cookies'\nimport type {Company} from '../services/CompanyService'\nimport {decodeBase64, encodeBase64} from './utils'\n\nconst COMPANY_PROPERTIES_KEY = 'companyProperties'\n\ninterface CompanyProperties {\n id: number\n name: string\n currency?: string\n timeZone?: string\n}\n\nclass CompanyPropertiesCookie {\n get(): CompanyProperties | undefined {\n const cookies = useCookies().cookies\n const cookieString = cookies.get('companyProperties')\n return cookieString ? decodeBase64(cookieString) : undefined\n }\n\n isSet() {\n const cookies = useCookies().cookies\n return cookies.isKey('companyProperties')\n }\n\n remove() {\n const {cookies} = useCookies()\n cookies.remove(COMPANY_PROPERTIES_KEY)\n }\n\n set(company: Company) {\n const {cookies} = useCookies()\n const companyProperties: CompanyProperties = {\n id: company.id,\n name: company.name,\n currency: company.currency || undefined,\n timeZone: company.timeZone || undefined,\n }\n\n cookies.set(COMPANY_PROPERTIES_KEY, encodeBase64(companyProperties))\n }\n}\n\nexport default new CompanyPropertiesCookie()\n"],"names":["COMPANY_PROPERTIES_KEY","CompanyPropertiesCookie","cookieString","useCookies","decodeBase64","cookies","company","companyProperties","encodeBase64","CompanyPropertiesCookie$1"],"mappings":"qZAIA,MAAAA,EAAA,oBASA,MAAAC,CAAA,CAA8B,KAAA,CAG1B,MAAAC,EADAC,EAAA,EAAA,QACA,IAAA,mBAAA,EACA,OAAAD,EAAAE,EAAAF,CAAA,EAAA,MAAmD,CACrD,OAAA,CAIE,OADAC,EAAA,EAAA,QACA,MAAA,mBAAA,CAAwC,CAC1C,QAAA,CAGE,KAAA,CAAA,QAAAE,CAAA,EAAAF,EAAA,EACAE,EAAA,OAAAL,CAAA,CAAqC,CACvC,IAAAM,EAAA,CAGE,KAAA,CAAA,QAAAD,CAAA,EAAAF,EAAA,EACAI,EAAA,CAA6C,GAAAD,EAAA,GAC/B,KAAAA,EAAA,KACE,SAAAA,EAAA,UAAA,OACgB,SAAAA,EAAA,UAAA,MACA,EAGhCD,EAAA,IAAAL,EAAAQ,EAAAD,CAAA,CAAA,CAAmE,CAEvE,CAEA,MAAAE,EAAA,IAAAR"}