{"version":3,"file":"BranchDetails.vue_vue_type_script_setup_true_lang-fbd2306b.js","sources":["../../src/components/ui/ThAccordion.vue","../../src/components/ui/ThTransitionHeight.vue","../../src/views/appointments/api/useBranchQuery.ts","../../src/views/appointments/api/useStaffsQuery.ts","../../src/composables/useQueryBatch.ts","../../src/views/appointments/components/BranchDetails.vue"],"sourcesContent":["\n\n\n","\n\n\n","import { useThFetch } from '@/composables/useThFetch'\nimport { useConfigurationStore } from '@/stores/useConfigurationStore'\nimport type { Branch } from '@/types'\nimport type { UseFetchOptions } from '@vueuse/core'\nimport { toValue, type MaybeRefOrGetter } from 'vue'\n\nexport function useBranchQuery(id: MaybeRefOrGetter, options: UseFetchOptions = {}) {\n const store = useConfigurationStore()\n\n const getURL = () => `/v0/branches/public/${store.organization}/${toValue(id)}`\n\n return useThFetch(getURL, {\n afterFetch(ctx) {\n ctx.data = ctx.data.results[0]\n\n return options.afterFetch?.(ctx) ?? ctx\n },\n ...options\n }).json()\n}\n","import { useThFetch } from '@/composables/useThFetch'\nimport { useConfigurationStore } from '@/stores/useConfigurationStore'\nimport type { Staff } from '@/types'\nimport type { UseFetchOptions } from '@vueuse/core'\n\nexport function useStaffsQuery(options?: UseFetchOptions) {\n const store = useConfigurationStore()\n\n return useThFetch(`/v0/staff/public/${store.organization}?deleted=false&active=true`, {\n afterFetch(ctx) {\n return {\n ...ctx,\n data: ctx.data.results\n }\n },\n ...options\n }).json()\n}\n","import type { UseFetchReturn } from '@vueuse/core'\nimport { computed } from 'vue'\n\n/**\n * Accepts an array of queries and allows you to monitor them in bulk\n * isError - at least one of the queries has failed\n * isFetching - at least one of the queries is fetching\n */\nexport function useQueryBatch(queries: UseFetchReturn[]) {\n const isFetching = computed(() => queries.some((query) => query.isFetching.value))\n const isError = computed(() => queries.some((query) => !!query.error.value))\n\n async function execute(throwOnFailed?: boolean) {\n await Promise.all(queries.map((query) => query.execute(throwOnFailed)))\n }\n\n return { isFetching, isError, execute }\n}\n","\n\n\n"],"names":["isExpanded","useModel","props","heightStyle","ref","onEnter","element","initialHeight","onLeave","onAfterTransition","useBranchQuery","id","options","store","useConfigurationStore","useThFetch","toValue","ctx","_a","useStaffsQuery","useQueryBatch","queries","isFetching","computed","query","isError","execute","throwOnFailed","dayjs","useLocalizedDayjs","useI18n","openStatus","getTodaysOpenStatus","hours","getOpeningHours","address","getBranchAddress"],"mappings":"k7BAiBMA,EAAaC,EAASC,EAAO,YAAY,4pBCF/C,MAAMC,EAAcC,IAEpB,eAAeC,EAAQC,EAAkB,CAIjC,MAAAC,EAAiBD,EAAwB,aAAe,KAE9DH,EAAY,MAAQ,MAEpB,sBAAsB,IAAM,CAC1BA,EAAY,MAAQI,CAAA,CACrB,CACH,CAEA,SAASC,EAAQF,EAAkB,CAG3B,MAAAC,EAAiBD,EAAwB,aAAe,KAE9DH,EAAY,MAAQI,EAEpB,sBAAsB,IAAM,CAC1BJ,EAAY,MAAQ,KAAA,CACrB,CACH,CAKA,SAASM,GAAoB,CAC3BN,EAAY,MAAQ,EACtB,4WCzCO,SAASO,GAAeC,EAA8BC,EAA2B,GAAI,CAC1F,MAAMC,EAAQC,IAId,OAAOC,EAFQ,IAAM,uBAAuBF,EAAM,YAAY,IAAIG,EAAQL,CAAE,CAAC,GAEnD,CACxB,WAAWM,EAAK,OACd,OAAAA,EAAI,KAAOA,EAAI,KAAK,QAAQ,CAAC,IAEtBC,EAAAN,EAAQ,aAAR,YAAAM,EAAA,KAAAN,EAAqBK,KAAQA,CACtC,EACA,GAAGL,CAAA,CACJ,EAAE,KAAa,CAClB,CCdO,SAASO,GAAeP,EAA2B,CACxD,MAAMC,EAAQC,IAEd,OAAOC,EAAW,oBAAoBF,EAAM,YAAY,6BAA8B,CACpF,WAAWI,EAAK,CACP,MAAA,CACL,GAAGA,EACH,KAAMA,EAAI,KAAK,OAAA,CAEnB,EACA,GAAGL,CAAA,CACJ,EAAE,KAAc,CACnB,CCTO,SAASQ,GAAcC,EAAgC,CACtD,MAAAC,EAAaC,EA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