@oneclick.dev/cms-core-modules 0.0.108 → 0.0.110
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Acquisition-DNCy8nQz.mjs +400 -0
- package/dist/Acquisition-Dt2rREU8.js +1 -0
- package/dist/AgendaOpeningHoursCard-B7ROIPWw.js +1 -0
- package/dist/AgendaOpeningHoursCard-Cp4wxUeK.mjs +172 -0
- package/dist/AppointmentDetailsCard-33WpATpV.mjs +161 -0
- package/dist/AppointmentDetailsCard-DpLM5IrB.js +1 -0
- package/dist/AppointmentEditor-BeOtYV6u.mjs +196 -0
- package/dist/AppointmentEditor-CaTfbkIf.js +1 -0
- package/dist/AppointmentListTable-DZJNmTMb.mjs +177 -0
- package/dist/AppointmentListTable-Dieu9US_.js +1 -0
- package/dist/Audience-Bs7b0TNm.js +1 -0
- package/dist/Audience-CUeMVYRy.mjs +489 -0
- package/dist/Components-C83O-xlF.mjs +623 -0
- package/dist/Components-DXbx0RLV.js +1 -0
- package/dist/Content-BHr_rPVY.js +1 -0
- package/dist/Content-CYOZKvWK.mjs +358 -0
- package/dist/ContentEditor-BprPiHMJ.js +462 -0
- package/dist/ContentEditor-D9-1SJ5F.mjs +30700 -0
- package/dist/CountryBreakdownCard-D7BK3nRD.js +1 -0
- package/dist/CountryBreakdownCard-DVxNz2DJ.mjs +196 -0
- package/dist/Create-89z41K73.js +1 -0
- package/dist/Create-BCklc_T1.mjs +1251 -0
- package/dist/DateFormatter-CYAD4GBN.js +1 -0
- package/dist/DateFormatter-DUxlo8X8.mjs +734 -0
- package/dist/Detail-BCOcP2ql.mjs +585 -0
- package/dist/Detail-Btzwo0Y3.mjs +3477 -0
- package/dist/Detail-Byk781b4.mjs +26 -0
- package/dist/Detail-C857g62L.js +1 -0
- package/dist/Detail-C8wQiDcv.js +1 -0
- package/dist/Detail-CNlljBfH.mjs +379 -0
- package/dist/Detail-CPqug27l.js +1 -0
- package/dist/Detail-CjuhjPby.js +1 -0
- package/dist/Detail-DnX7tsqN.mjs +649 -0
- package/dist/Detail-mvSGbnFU.js +1 -0
- package/dist/DeviceBreakdownCard-DRhQ9ufG.js +1 -0
- package/dist/DeviceBreakdownCard-W1frLe0L.mjs +159 -0
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-DWMqQvHl.mjs +76 -0
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-kpjbVSXg.js +1 -0
- package/dist/Entries-BdhUyJR5.mjs +728 -0
- package/dist/Entries-CEXM_SkO.js +1 -0
- package/dist/Find-D4Qa45qC.js +1 -0
- package/dist/Find-DIISO5GO.mjs +229 -0
- package/dist/GlobalStyling-C9VthHWK.mjs +1588 -0
- package/dist/GlobalStyling-CnSlXkZc.js +25 -0
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Ceoje52V.js +1 -0
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Dh9jzvE0.mjs +1255 -0
- package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-COrK1j0S.js +1 -0
- package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-Vb3q8EVv.mjs +330 -0
- package/dist/Overview-BCpJNiEB.mjs +190 -0
- package/dist/Overview-BDlBCUI_.js +1 -0
- package/dist/Overview-BKAti8nc.mjs +567 -0
- package/dist/Overview-BbvfH1u-.js +1 -0
- package/dist/Overview-Bn1Xx3_j.js +1 -0
- package/dist/Overview-C-Jb_BxY.mjs +860 -0
- package/dist/Overview-CIa1E-HH.mjs +178 -0
- package/dist/Overview-DAxCu9XC.js +1 -0
- package/dist/Overview-DC9io1bk.js +1 -0
- package/dist/Overview-Di84CsR5.mjs +476 -0
- package/dist/Overview-Su8ZUbMs.mjs +26 -0
- package/dist/Overview-T-lsy3UZ.js +1 -0
- package/dist/Overview-UoZHUMUz.js +1 -0
- package/dist/Overview-lWAyyenp.mjs +632 -0
- package/dist/PeakHoursCard-9-EZFZLR.mjs +182 -0
- package/dist/PeakHoursCard-BR5zmta4.js +1 -0
- package/dist/ProductDetailsCard-6nHikw4V.mjs +121 -0
- package/dist/ProductDetailsCard-Bn7qrgmc.js +1 -0
- package/dist/RealtimeCard--APfRNc8.js +1 -0
- package/dist/RealtimeCard-fvQlJcM7.mjs +126 -0
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CuwREvXD.js +349 -0
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-GYNZ_yhD.mjs +3077 -0
- package/dist/SearchTermsCard-BsB-63aH.js +1 -0
- package/dist/SearchTermsCard-BzVrHKqQ.mjs +201 -0
- package/dist/SendPush-COns44j7.js +1 -0
- package/dist/SendPush-CPIOjVX4.mjs +184 -0
- package/dist/SeoHealth-MC3lSCOY.mjs +615 -0
- package/dist/SeoHealth-az1YuNF2.js +1 -0
- package/dist/TableView-DQW0A1oG.js +4 -0
- package/dist/TableView-DXHhJ-jm.mjs +6143 -0
- package/dist/TemplateList.vue_vue_type_script_setup_true_lang-B_AtWnHa.js +1 -0
- package/dist/TemplateList.vue_vue_type_script_setup_true_lang-Cmovy7kk.mjs +40 -0
- package/dist/TopPagesCard-BDeA997A.js +1 -0
- package/dist/TopPagesCard-CTozhOr_.mjs +159 -0
- package/dist/TrafficSourcesCard-BxtCKsqx.mjs +197 -0
- package/dist/TrafficSourcesCard-C3ziDTUL.js +1 -0
- package/dist/View-CsudjxCE.mjs +30 -0
- package/dist/View-Dw_wA6kK.js +1 -0
- package/dist/VisitorStatsCard-BmByE_Hi.js +1 -0
- package/dist/VisitorStatsCard-CXizEbVK.mjs +174 -0
- package/dist/_plugin-vue_export-helper-BHFhmbuH.js +1 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
- package/dist/agenda-DcatSSYQ.mjs +1165 -0
- package/dist/agenda-IOqtALWf.js +1 -0
- package/dist/array-CbATeQbk.js +1 -0
- package/dist/array-DT5pE8Gm.mjs +108 -0
- package/dist/availability-CMrRa5y2.mjs +269 -0
- package/dist/availability-Cf2YfMwM.js +1 -0
- package/dist/booking-data-DgJd0BcM.mjs +889 -0
- package/dist/booking-data-Di5GmH_8.js +1 -0
- package/dist/cms-core-modules.css +1 -2
- package/dist/countries-BTPvmrsb.mjs +4 -0
- package/dist/countries-CgZ081No.js +1 -0
- package/dist/exceptions-CI0B4xVj.js +1 -0
- package/dist/exceptions-YCQkHa6a.mjs +646 -0
- package/dist/google-CvtuJwgk.mjs +4 -0
- package/dist/google-D4N3gb01.js +1 -0
- package/dist/index-4tjmIans.js +1 -0
- package/dist/index-9HVlmvK3.js +1 -0
- package/dist/index-A2kp8Isi.js +75 -0
- package/dist/index-B5aBwdxY.js +54 -0
- package/dist/index-BFLV54kw.mjs +3843 -0
- package/dist/index-BWDwEd8D.mjs +24 -0
- package/dist/index-BfBBm9uY.mjs +24 -0
- package/dist/index-BhWvXMOp.mjs +176 -0
- package/dist/index-BiT55eU0.js +58 -0
- package/dist/index-Bkq58CeQ.mjs +22 -0
- package/dist/index-BzWmWCo5.mjs +1187 -0
- package/dist/index-CJQQBRLY.js +1 -0
- package/dist/index-CQkOH2_3.mjs +24 -0
- package/dist/index-CSxYBeVA.js +1 -0
- package/dist/index-CU-tbS5W.mjs +24 -0
- package/dist/index-CZn2nDLv.mjs +34 -0
- package/dist/index-CkiNvRzs.js +1 -0
- package/dist/index-Co4ON2Di.js +1 -0
- package/dist/index-Cpnn_Pxd.mjs +24 -0
- package/dist/index-CpzDEMeC.mjs +1443 -0
- package/dist/index-CsVeM3PA.mjs +24 -0
- package/dist/index-CwqrAU-H.js +1 -0
- package/dist/index-CxETuRsG.js +1 -0
- package/dist/index-Cz-baGax.js +1 -0
- package/dist/index-D30apIn-.mjs +110 -0
- package/dist/index-DFQGVHTs.js +1 -0
- package/dist/index-DPd3waTN.js +1 -0
- package/dist/index-DRqJOqUR.mjs +3484 -0
- package/dist/index-DjWuIBxh.js +1 -0
- package/dist/index-Dnn2SCSl.js +1 -0
- package/dist/index-Dpl9sU6a.mjs +12 -0
- package/dist/index-DrXxXB2F.mjs +138 -0
- package/dist/index-G7cIlnGN.js +158 -0
- package/dist/index-R2oUDsjx.js +1 -0
- package/dist/index-RLz1QPrf.mjs +203 -0
- package/dist/index-UtjLbLw-.js +1 -0
- package/dist/index-V78huaSJ.mjs +442 -0
- package/dist/index-cOnxXTbF.mjs +24 -0
- package/dist/index-hlylYYgy.mjs +24 -0
- package/dist/index-ijdf0d9-.js +1 -0
- package/dist/index-vHmvbEwa.js +35 -0
- package/dist/index-wjkEPsNx.mjs +2940 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +806 -1095
- package/dist/interpolation-CHn59tIC.js +1 -0
- package/dist/interpolation-w7IRDJwK.mjs +180 -0
- package/dist/orders-C65SlpJy.mjs +618 -0
- package/dist/orders-XVzWAgG1.js +1 -0
- package/dist/payment-C3ohkehF.mjs +1080 -0
- package/dist/payment-Dfr-Ro-a.js +1 -0
- package/dist/regular-1LXNPviB.js +1 -0
- package/dist/regular-_05oq5Tx.mjs +1101 -0
- package/dist/resources-CYOb5Bl6.mjs +811 -0
- package/dist/resources-CxeFd57z.js +1 -0
- package/dist/server-handlers.cjs.js +1 -1
- package/dist/server-handlers.mjs +996 -1049
- package/dist/src/appointments/chat-components/AgendaOpeningHoursCard.vue.d.ts +15 -0
- package/dist/src/appointments/chat-components/AppointmentDetailsCard.vue.d.ts +14 -0
- package/dist/src/appointments/chat-components/AppointmentEditor.vue.d.ts +14 -0
- package/dist/src/appointments/chat-components/AppointmentListTable.vue.d.ts +14 -0
- package/dist/src/appointments/components/create/StepNavigation.vue.d.ts +32 -0
- package/dist/src/appointments/components/create/regular/Step1.vue.d.ts +2 -0
- package/dist/src/appointments/components/create/regular/Step2.vue.d.ts +2 -0
- package/dist/src/appointments/components/create/regular/Step3.vue.d.ts +2 -0
- package/dist/src/appointments/components/create/regular/Step4.vue.d.ts +2 -0
- package/dist/src/appointments/components/edit/CustomerInformationFieldEditorDialog.vue.d.ts +24 -0
- package/dist/src/appointments/components/edit/EditLayout.vue.d.ts +17 -0
- package/dist/src/appointments/components/edit/Event24hSidebar.vue.d.ts +2 -0
- package/dist/src/appointments/components/edit/EventDialog/ApproveReservationDialog.vue.d.ts +8 -0
- package/dist/src/appointments/components/edit/EventDialog/BookingsList.vue.d.ts +136 -0
- package/dist/src/appointments/components/edit/EventDialog/CancelReservationDialog.vue.d.ts +8 -0
- package/dist/src/appointments/components/edit/EventDialog/EventDialog.vue.d.ts +11 -0
- package/dist/src/appointments/components/edit/EventDialog/OrderDetailDialog.vue.d.ts +55 -0
- package/dist/src/appointments/components/edit/EventDialog/RejectReservationDialog.vue.d.ts +8 -0
- package/dist/src/appointments/components/edit/EventDialog/ReservationDetailDialog.vue.d.ts +87 -0
- package/dist/src/appointments/components/edit/EventDialog/TimelineChart.vue.d.ts +24 -0
- package/dist/src/appointments/components/edit/EventDialog/TransferReservationDialog.vue.d.ts +4 -0
- package/dist/src/appointments/components/edit/EventTimeIndicator.vue.d.ts +12 -0
- package/dist/src/appointments/components/edit/EventTimeline.vue.d.ts +48 -0
- package/dist/src/appointments/components/edit/EventView.vue.d.ts +9 -0
- package/dist/src/appointments/components/edit/ExceptionDialog.vue.d.ts +29 -0
- package/dist/src/appointments/components/edit/MetadataSchemaEditorDialog.vue.d.ts +12 -0
- package/dist/src/appointments/components/edit/NewReservationDialog/CustomerInformation.vue.d.ts +10 -0
- package/dist/src/appointments/components/edit/NewReservationDialog/NewReservationDialog.vue.d.ts +26 -0
- package/dist/src/appointments/components/edit/NewReservationDialog/QuickReservationAdder.vue.d.ts +26 -0
- package/dist/src/appointments/components/edit/NewReservationDialog/ReservationLines.vue.d.ts +31 -0
- package/dist/src/appointments/components/edit/OrderMetadataDisplay.vue.d.ts +21 -0
- package/dist/src/appointments/components/edit/PaymentAddons/Addon.vue.d.ts +22 -0
- package/dist/src/appointments/components/edit/PaymentAddons/AddonList.vue.d.ts +5 -0
- package/dist/src/appointments/components/edit/PaymentAddons/index.vue.d.ts +15 -0
- package/dist/src/appointments/components/edit/ResourceEditorDialog.vue.d.ts +13 -0
- package/dist/src/appointments/components/edit/dashboard/Timeline.vue.d.ts +36 -0
- package/dist/src/appointments/components/edit/dashboard/timeline/ResourceSelector.vue.d.ts +50 -0
- package/dist/src/appointments/index.d.ts +12 -9
- package/dist/src/appointments/index.vue.d.ts +22 -0
- package/dist/src/appointments/metadata.d.ts +1 -1
- package/dist/src/appointments/pages/Overview.vue.d.ts +4 -0
- package/dist/src/appointments/pages/create/index.vue.d.ts +2 -0
- package/dist/src/appointments/pages/create/regular.vue.d.ts +6 -0
- package/dist/src/appointments/pages/edit/agenda.vue.d.ts +4 -0
- package/dist/src/appointments/pages/edit/availability.vue.d.ts +2 -0
- package/dist/src/appointments/pages/edit/booking-data.vue.d.ts +65 -0
- package/dist/src/appointments/pages/edit/index.vue.d.ts +2 -0
- package/dist/src/appointments/pages/edit/payment.vue.d.ts +2 -0
- package/dist/src/appointments/pages/edit/resources.vue.d.ts +28 -0
- package/dist/src/appointments/routes.d.ts +6 -3
- package/dist/src/contentManager/components/components/ComponentDialog.vue.d.ts +12 -0
- package/dist/src/contentManager/components/components/ComponentGridItem.vue.d.ts +16 -0
- package/dist/src/contentManager/components/content-editor/ApiDocs.vue.d.ts +2 -0
- package/dist/src/contentManager/components/content-editor/ContentLayout.vue.d.ts +49 -0
- package/dist/src/contentManager/components/content-editor/ContentSettings.vue.d.ts +24 -0
- package/dist/src/contentManager/components/content-editor/ContentStructuredContentSections.vue.d.ts +4 -0
- package/dist/src/contentManager/components/content-editor/Header.vue.d.ts +64 -0
- package/dist/src/contentManager/components/content-editor/LivePreviewWrapper.vue.d.ts +53 -0
- package/dist/src/contentManager/components/content-editor/Locales.vue.d.ts +44 -0
- package/dist/src/contentManager/components/content-editor/NewSectionDialog.vue.d.ts +21 -0
- package/dist/src/contentManager/components/content-editor/PageSettings.vue.d.ts +2 -0
- package/dist/src/contentManager/components/content-editor/SEO.vue.d.ts +14 -0
- package/dist/src/contentManager/components/content-editor/SidebarSectionWrapper.vue.d.ts +39 -0
- package/dist/src/contentManager/components/content-editor/Status.vue.d.ts +2 -0
- package/dist/src/contentManager/components/content-editor/Versions.vue.d.ts +63 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/Button.vue.d.ts +94 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/Card.vue.d.ts +92 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/Column.vue.d.ts +92 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/Container.vue.d.ts +92 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/Divider.vue.d.ts +92 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/EmptySpace.vue.d.ts +94 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/Heading.vue.d.ts +92 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/Image.vue.d.ts +92 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/LockBlocks.d.ts +0 -15
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/Map.vue.d.ts +92 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/Paragraph.vue.d.ts +92 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/Row.vue.d.ts +115 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/Stack.vue.d.ts +115 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/TrailingNodeInContainers.d.ts +1 -4
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/Video.vue.d.ts +92 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/extension-details/DetailsNodeView.vue.d.ts +92 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/helpers/NodeLabel.vue.d.ts +108 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/helpers/ResizeHandlers.vue.d.ts +20 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/helpers/TopMarginDragger.vue.d.ts +104 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/BubbleMenuClassBuilder.vue.d.ts +19 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/BubbleMenuLinkBuilder.vue.d.ts +19 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/BubbleMenuToggleButton.vue.d.ts +29 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/DefaultBubbleMenu.vue.d.ts +13 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/ElementEditorMenu.vue.d.ts +19 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/EmojiMenu.vue.d.ts +8 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/NewNodeView.vue.d.ts +47 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/SlashMenu.vue.d.ts +6 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/SlashMenuButton.vue.d.ts +17 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/ButtonMenu.vue.d.ts +13 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/CardMenu.vue.d.ts +13 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/ColumnMenu.vue.d.ts +13 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/DividerMenu.vue.d.ts +13 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/EmptySpaceMenu.vue.d.ts +13 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/HeadingMenu.vue.d.ts +13 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/ImageMenu.vue.d.ts +13 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/MapMenu.vue.d.ts +13 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/RowMenu.vue.d.ts +13 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/StackMenu.vue.d.ts +13 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/TextMenu.vue.d.ts +13 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/VideoMenu.vue.d.ts +13 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/index.d.ts +132 -12
- package/dist/src/contentManager/components/overview/CollectionDialog.vue.d.ts +30 -0
- package/dist/src/contentManager/components/overview/CollectionsGridView.vue.d.ts +18 -0
- package/dist/src/contentManager/components/overview/ContentEntryContextMenu.vue.d.ts +27 -0
- package/dist/src/contentManager/components/overview/FilterPopover.vue.d.ts +2 -0
- package/dist/src/contentManager/components/overview/ListView.vue.d.ts +12 -0
- package/dist/src/contentManager/components/styling/ButtonStyleDialog.vue.d.ts +24 -0
- package/dist/src/contentManager/components/styling/CardStyleDialog.vue.d.ts +24 -0
- package/dist/src/contentManager/components/styling/SectionStyleDialog.vue.d.ts +24 -0
- package/dist/src/contentManager/index.d.ts +14 -5
- package/dist/src/contentManager/index.vue.d.ts +22 -0
- package/dist/src/contentManager/metadata.d.ts +1 -1
- package/dist/src/contentManager/pages/Components.vue.d.ts +27 -0
- package/dist/src/contentManager/pages/ContentEditor.vue.d.ts +14 -0
- package/dist/src/contentManager/pages/Entries.vue.d.ts +16 -0
- package/dist/src/contentManager/pages/GlobalStyling.vue.d.ts +117 -0
- package/dist/src/contentManager/pages/Overview.vue.d.ts +57 -0
- package/dist/src/contentManager/routes.d.ts +12 -3
- package/dist/src/custom/index.d.ts +2 -2
- package/dist/src/custom/index.vue.d.ts +2 -0
- package/dist/src/custom/pages/View.vue.d.ts +2 -0
- package/dist/src/custom/routes.d.ts +1 -1
- package/dist/src/googleAnalytics/chat-components/CountryBreakdownCard.vue.d.ts +14 -0
- package/dist/src/googleAnalytics/chat-components/DeviceBreakdownCard.vue.d.ts +14 -0
- package/dist/src/googleAnalytics/chat-components/PeakHoursCard.vue.d.ts +14 -0
- package/dist/src/googleAnalytics/chat-components/RealtimeCard.vue.d.ts +14 -0
- package/dist/src/googleAnalytics/chat-components/SearchTermsCard.vue.d.ts +14 -0
- package/dist/src/googleAnalytics/chat-components/TopPagesCard.vue.d.ts +14 -0
- package/dist/src/googleAnalytics/chat-components/TrafficSourcesCard.vue.d.ts +14 -0
- package/dist/src/googleAnalytics/chat-components/VisitorStatsCard.vue.d.ts +14 -0
- package/dist/src/googleAnalytics/components/seo-health/SeoClicksChart.vue.d.ts +5 -0
- package/dist/src/googleAnalytics/components/seo-health/SeoImpressionsChart.vue.d.ts +5 -0
- package/dist/src/googleAnalytics/components/seo-health/SeoKeywordsTab.vue.d.ts +5 -0
- package/dist/src/googleAnalytics/components/seo-health/SeoKpiCards.vue.d.ts +10 -0
- package/dist/src/googleAnalytics/components/seo-health/SeoMappingTab.vue.d.ts +5 -0
- package/dist/src/googleAnalytics/components/seo-health/SeoPagesTab.vue.d.ts +5 -0
- package/dist/src/googleAnalytics/components/seo-health/SeoRankingDistribution.vue.d.ts +5 -0
- package/dist/src/googleAnalytics/index.d.ts +10 -10
- package/dist/src/googleAnalytics/index.vue.d.ts +2 -0
- package/dist/src/googleAnalytics/pages/Acquisition.vue.d.ts +2 -0
- package/dist/src/googleAnalytics/pages/Audience.vue.d.ts +2 -0
- package/dist/src/googleAnalytics/pages/Content.vue.d.ts +2 -0
- package/dist/src/googleAnalytics/pages/Overview.vue.d.ts +2 -0
- package/dist/src/googleAnalytics/pages/SeoHealth.vue.d.ts +2 -0
- package/dist/src/googleAnalytics/routes.d.ts +1 -1
- package/dist/src/mailTemplates/components/TemplateList.vue.d.ts +2 -0
- package/dist/src/mailTemplates/index.d.ts +3 -3
- package/dist/src/mailTemplates/index.vue.d.ts +22 -0
- package/dist/src/mailTemplates/metadata.d.ts +1 -1
- package/dist/src/mailTemplates/pages/Detail.vue.d.ts +14 -0
- package/dist/src/mailTemplates/pages/Overview.vue.d.ts +14 -0
- package/dist/src/mailTemplates/routes.d.ts +1 -1
- package/dist/src/productCollections/components/detail/Main.vue.d.ts +2 -0
- package/dist/src/productCollections/components/detail/SEO.vue.d.ts +2 -0
- package/dist/src/productCollections/components/detail/Status.vue.d.ts +2 -0
- package/dist/src/productCollections/components/overview/ListView.vue.d.ts +12 -0
- package/dist/src/productCollections/index.d.ts +3 -3
- package/dist/src/productCollections/index.vue.d.ts +22 -0
- package/dist/src/productCollections/metadata.d.ts +1 -1
- package/dist/src/productCollections/pages/Detail.vue.d.ts +14 -0
- package/dist/src/productCollections/pages/Overview.vue.d.ts +16 -0
- package/dist/src/productCollections/routes.d.ts +1 -1
- package/dist/src/products/chat-components/ProductDetailsCard.vue.d.ts +14 -0
- package/dist/src/products/components/detail/Collections.vue.d.ts +14 -0
- package/dist/src/products/components/detail/Inventory.vue.d.ts +2 -0
- package/dist/src/products/components/detail/Main.vue.d.ts +2 -0
- package/dist/src/products/components/detail/NewSection.vue.d.ts +2 -0
- package/dist/src/products/components/detail/Price.vue.d.ts +2 -0
- package/dist/src/products/components/detail/SEO.vue.d.ts +2 -0
- package/dist/src/products/components/detail/Shipping.vue.d.ts +2 -0
- package/dist/src/products/components/detail/Status.vue.d.ts +2 -0
- package/dist/src/products/components/detail/price/UnitPriceDialog.vue.d.ts +17 -0
- package/dist/src/products/components/detail/variants/Option.vue.d.ts +33 -0
- package/dist/src/products/components/detail/variants/VariantList.vue.d.ts +38 -0
- package/dist/src/products/components/overview/FilterPopover.vue.d.ts +2 -0
- package/dist/src/products/components/overview/GridView.vue.d.ts +12 -0
- package/dist/src/products/components/overview/ListView.vue.d.ts +12 -0
- package/dist/src/products/components/overview/ProductContextMenu.vue.d.ts +27 -0
- package/dist/src/products/index.d.ts +4 -4
- package/dist/src/products/index.vue.d.ts +22 -0
- package/dist/src/products/metadata.d.ts +1 -1
- package/dist/src/products/pages/Detail.vue.d.ts +14 -0
- package/dist/src/products/pages/Overview.vue.d.ts +16 -0
- package/dist/src/products/routes.d.ts +1 -1
- package/dist/src/promoCodes/components/create/DateRange.vue.d.ts +2 -0
- package/dist/src/promoCodes/components/create/MultiCodes.vue.d.ts +2 -0
- package/dist/src/promoCodes/components/create/Note.vue.d.ts +2 -0
- package/dist/src/promoCodes/components/create/SingleCode.vue.d.ts +2 -0
- package/dist/src/promoCodes/components/create/TypeAndValue/TypeDetailDialog.vue.d.ts +6 -0
- package/dist/src/promoCodes/components/create/TypeAndValue/TypeManageDialog.vue.d.ts +18 -0
- package/dist/src/promoCodes/components/create/TypeAndValue/index.vue.d.ts +2 -0
- package/dist/src/promoCodes/index.d.ts +3 -3
- package/dist/src/promoCodes/index.vue.d.ts +22 -0
- package/dist/src/promoCodes/metadata.d.ts +1 -1
- package/dist/src/promoCodes/pages/Create.vue.d.ts +16 -0
- package/dist/src/promoCodes/pages/Detail.vue.d.ts +14 -0
- package/dist/src/promoCodes/pages/Find.vue.d.ts +16 -0
- package/dist/src/promoCodes/routes.d.ts +1 -1
- package/dist/src/push-notifications/components/PreviewAndroid.vue.d.ts +28 -0
- package/dist/src/push-notifications/components/PreviewIPhone.vue.d.ts +28 -0
- package/dist/src/push-notifications/components/PushPreview.vue.d.ts +28 -0
- package/dist/src/push-notifications/index.d.ts +3 -3
- package/dist/src/push-notifications/index.vue.d.ts +22 -0
- package/dist/src/push-notifications/metadata.d.ts +1 -1
- package/dist/src/push-notifications/pages/SendPush.vue.d.ts +14 -0
- package/dist/src/push-notifications/routes.d.ts +1 -1
- package/dist/src/shared/BrandLogo.vue.d.ts +12 -0
- package/dist/src/shared/DrawerToggle.vue.d.ts +60 -0
- package/dist/src/shared/VerticalToggle.vue.d.ts +60 -0
- package/dist/src/shippingOptions/components/detail/Condition.vue.d.ts +2 -0
- package/dist/src/shippingOptions/components/detail/Countries.vue.d.ts +2 -0
- package/dist/src/shippingOptions/components/detail/Example.vue.d.ts +2 -0
- package/dist/src/shippingOptions/components/detail/Main.vue.d.ts +2 -0
- package/dist/src/shippingOptions/components/overview/ListView.vue.d.ts +12 -0
- package/dist/src/shippingOptions/index.d.ts +3 -3
- package/dist/src/shippingOptions/index.vue.d.ts +22 -0
- package/dist/src/shippingOptions/metadata.d.ts +1 -1
- package/dist/src/shippingOptions/pages/Detail.vue.d.ts +14 -0
- package/dist/src/shippingOptions/pages/Overview.vue.d.ts +16 -0
- package/dist/src/shippingOptions/routes.d.ts +1 -1
- package/dist/src/table/components/DataTable.vue.d.ts +18 -0
- package/dist/src/table/components/DataTableAction.vue.d.ts +14 -0
- package/dist/src/table/components/DataTableMobileRowActionDrawer.vue.d.ts +4 -0
- package/dist/src/table/components/DataTablePagination.vue.d.ts +6 -0
- package/dist/src/table/components/actions/ActionDialog.vue.d.ts +19 -0
- package/dist/src/table/components/actions/CtaActionDialog.vue.d.ts +4 -0
- package/dist/src/table/components/columns/ColumnDropdown.vue.d.ts +2 -0
- package/dist/src/table/components/columns/ColumnEditorDialog.vue.d.ts +34 -0
- package/dist/src/table/components/columns/DialogTableColumnItem.vue.d.ts +12 -0
- package/dist/src/table/components/date-range-filter/DateRangeFilter.vue.d.ts +2 -0
- package/dist/src/table/components/date-range-filter/DateRangeSettingsDialog.vue.d.ts +27 -0
- package/dist/src/table/components/filters/FilterDialog.vue.d.ts +12 -0
- package/dist/src/table/components/filters/Filters.vue.d.ts +27 -0
- package/dist/src/table/components/search/Search.vue.d.ts +2 -0
- package/dist/src/table/components/sort/SortMode.vue.d.ts +2 -0
- package/dist/src/table/components/sort/SortModeSettingsDialog.vue.d.ts +18 -0
- package/dist/src/table/components/stats/StatDialog.vue.d.ts +12 -0
- package/dist/src/table/components/stats/Stats.vue.d.ts +27 -0
- package/dist/src/table/flow-builder-extensions/TableRowEditor.vue.d.ts +16 -0
- package/dist/src/table/flow-builder-extensions/row-item.d.ts +17 -3
- package/dist/src/table/index.d.ts +2 -2
- package/dist/src/table/index.vue.d.ts +22 -0
- package/dist/src/table/pages/TableView.vue.d.ts +54 -0
- package/dist/src/table/routes.d.ts +1 -1
- package/dist/src/types/index.d.ts +0 -6
- package/dist/utils-CanmrIWO.mjs +47 -0
- package/dist/utils-Yd6F5mea.js +3 -0
- package/dist/vee-validate-zod-ByykgYKJ.js +1 -0
- package/dist/vee-validate-zod-DNjTLCgh.mjs +4402 -0
- package/package.json +56 -55
- package/dist/Acquisition-DypEyPSO.js +0 -1
- package/dist/Acquisition-TCNX-th6.mjs +0 -308
- package/dist/AgendaOpeningHoursCard-BIhm0vpV.js +0 -1
- package/dist/AgendaOpeningHoursCard-BKUdJxRI.mjs +0 -133
- package/dist/AppointmentDetailsCard-C5rQ5jsW.js +0 -1
- package/dist/AppointmentDetailsCard-NRHeNP2L.mjs +0 -111
- package/dist/AppointmentEditor-BcF8CiD-.mjs +0 -150
- package/dist/AppointmentEditor-BlhFtoCm.js +0 -1
- package/dist/AppointmentListTable-B-ReBVtV.js +0 -1
- package/dist/AppointmentListTable-DHmy-iid.mjs +0 -129
- package/dist/Audience-CfWHjjg8.mjs +0 -394
- package/dist/Audience-Cj4TyauW.js +0 -1
- package/dist/Components-BehelN4r.js +0 -1
- package/dist/Components-CR6zukUU.mjs +0 -468
- package/dist/Content-C5Iye3t0.mjs +0 -257
- package/dist/Content-eOfBx52Y.js +0 -1
- package/dist/ContentEditor-BgL4qEeg.mjs +0 -26835
- package/dist/ContentEditor-Tlu3w0Hu.js +0 -462
- package/dist/CountryBreakdownCard-CWVyB8be.mjs +0 -151
- package/dist/CountryBreakdownCard-Db-pMiNe.js +0 -1
- package/dist/Create-B1it8S4m.js +0 -1
- package/dist/Create-DbYi0FAI.mjs +0 -907
- package/dist/DateFormatter-DLrDYkby.mjs +0 -630
- package/dist/DateFormatter-Dni0Oq8r.js +0 -1
- package/dist/Detail-D-eahJGO.mjs +0 -21
- package/dist/Detail-D0kdPPIm.mjs +0 -2757
- package/dist/Detail-DAafePYi.mjs +0 -485
- package/dist/Detail-DYpv4fYg.js +0 -1
- package/dist/Detail-Dc_ui4LM.js +0 -1
- package/dist/Detail-DccUekl_.js +0 -1
- package/dist/Detail-Dhz0V0Vf.js +0 -1
- package/dist/Detail-DjnGY0F8.mjs +0 -282
- package/dist/Detail-DplAitHg.mjs +0 -447
- package/dist/Detail-SugyeSxb.js +0 -1
- package/dist/DeviceBreakdownCard-CzxZT6To.js +0 -1
- package/dist/DeviceBreakdownCard-eEwPjzKl.mjs +0 -115
- package/dist/EditLayout-Bnz9q_jd.js +0 -1
- package/dist/EditLayout-J_DGXb8v.mjs +0 -99
- package/dist/Entries-CgpWg6fE.js +0 -1
- package/dist/Entries-CkGTXcAq.mjs +0 -575
- package/dist/Find-Bz0TNJzk.mjs +0 -164
- package/dist/Find-D-ItTXaZ.js +0 -1
- package/dist/GlobalStyling-CSQPF7o_.mjs +0 -1162
- package/dist/GlobalStyling-DabldMZh.js +0 -15
- package/dist/NewReservationDialog-BhIiY2B9.js +0 -1
- package/dist/NewReservationDialog-CN49aGcM.mjs +0 -1002
- package/dist/OrderDetailDialog-BJ01DZFe.js +0 -1
- package/dist/OrderDetailDialog-CoVQ_rzs.mjs +0 -215
- package/dist/Overview-9FMgn5hT.mjs +0 -492
- package/dist/Overview-BOOwMQ-c.mjs +0 -636
- package/dist/Overview-Biz3h60w.js +0 -1
- package/dist/Overview-C2K2ofdS.js +0 -1
- package/dist/Overview-CFHOXP9N.mjs +0 -123
- package/dist/Overview-CTJe7J5_.js +0 -1
- package/dist/Overview-Cvj2i9eW.js +0 -1
- package/dist/Overview-D2I1F8Dm.mjs +0 -21
- package/dist/Overview-DFOc9emt.mjs +0 -345
- package/dist/Overview-Dmhfb94Y.js +0 -1
- package/dist/Overview-PPzv7weG.mjs +0 -450
- package/dist/Overview-qFKcXHVF.js +0 -1
- package/dist/Overview-xkmYYTae.mjs +0 -133
- package/dist/Overview-yPsLvR2c.js +0 -1
- package/dist/PeakHoursCard-CtgEP-ez.mjs +0 -157
- package/dist/PeakHoursCard-DPeoMyhu.js +0 -1
- package/dist/ProductDetailsCard-B0WhmzO-.mjs +0 -98
- package/dist/ProductDetailsCard-C1ROuH6l.js +0 -1
- package/dist/RealtimeCard-DQno-Okz.js +0 -1
- package/dist/RealtimeCard-dR-g1iDo.mjs +0 -92
- package/dist/ReservationDetailDialog-Cdo6h0RD.mjs +0 -2163
- package/dist/ReservationDetailDialog-DZTFD2xI.js +0 -349
- package/dist/SearchTermsCard-BXJSXz_k.js +0 -1
- package/dist/SearchTermsCard-DsaxLKwP.mjs +0 -146
- package/dist/SendPush-Bssi-OZD.mjs +0 -150
- package/dist/SendPush-BuaYboRH.js +0 -1
- package/dist/SeoHealth-CP-kL0us.js +0 -1
- package/dist/SeoHealth-Cxp_Gb3Y.mjs +0 -459
- package/dist/TableView-7iwBkQ_k.mjs +0 -4757
- package/dist/TableView-BB_oIYYZ.js +0 -4
- package/dist/TemplateList-CNcM_Kgq.mjs +0 -56
- package/dist/TemplateList-VuPcBUJO.js +0 -1
- package/dist/TopPagesCard-CvDECn3_.mjs +0 -117
- package/dist/TopPagesCard-DNdATXJE.js +0 -1
- package/dist/TrafficSourcesCard-BLpBr7u0.mjs +0 -151
- package/dist/TrafficSourcesCard-_3gRUCw3.js +0 -1
- package/dist/View-DSnUHI7h.mjs +0 -30
- package/dist/View-Dbcfpdqh.js +0 -1
- package/dist/VisitorStatsCard-CFEnXSjF.mjs +0 -185
- package/dist/VisitorStatsCard-C_jhQxDW.js +0 -1
- package/dist/_plugin-vue_export-helper-5u7tqpWC.js +0 -1
- package/dist/_plugin-vue_export-helper-BJQSo0im.mjs +0 -8
- package/dist/agenda-CzMRcQTA.mjs +0 -989
- package/dist/agenda-D4zWRYSQ.js +0 -1
- package/dist/appointments-9syR5TZE.js +0 -1
- package/dist/appointments-BBmOJMhM.mjs +0 -23
- package/dist/array-BH1uH7XT.js +0 -1
- package/dist/array-DnDL9cFz.mjs +0 -98
- package/dist/availability-CAXB7Yd6.js +0 -1
- package/dist/availability-Dp7eF-ZK.mjs +0 -215
- package/dist/booking-data-Bysf6e5x.mjs +0 -724
- package/dist/booking-data-C6SGjC2X.js +0 -1
- package/dist/chunk-DQi1bQcV.js +0 -1
- package/dist/contentManager-D7JxXCwE.js +0 -1
- package/dist/contentManager-tfy0x1LD.mjs +0 -22
- package/dist/context-AQKfnJ4t.mjs +0 -3809
- package/dist/context-ubyMq9Xe.js +0 -54
- package/dist/core-Dhgr4ctC.mjs +0 -202
- package/dist/core-_HKfBlaZ.js +0 -1
- package/dist/countries-MXLT3mVe.mjs +0 -4
- package/dist/countries-OCd5qPxG.js +0 -1
- package/dist/create-BfNc2C7N.js +0 -1
- package/dist/create-C7JlIlIh.mjs +0 -95
- package/dist/custom-BwN9-6Mb.js +0 -1
- package/dist/custom-INNwaWla.mjs +0 -13
- package/dist/dist-BCVg7FKM.js +0 -1
- package/dist/dist-DIhK9VWh.mjs +0 -3045
- package/dist/edit-BiI2VG60.js +0 -35
- package/dist/edit-DD3iFBEh.mjs +0 -1097
- package/dist/exceptions-DICMaDcH.mjs +0 -462
- package/dist/exceptions-DpWqMNuG.js +0 -1
- package/dist/google-Bcc4XZnV.mjs +0 -4
- package/dist/google-DTSRmJ51.js +0 -1
- package/dist/googleAnalytics-BSaqRR_L.js +0 -1
- package/dist/googleAnalytics-Cg-iWblZ.mjs +0 -47
- package/dist/interpolation-B8OzkMyi.mjs +0 -131
- package/dist/interpolation-DpAqtGOW.js +0 -1
- package/dist/lib-4wSi00Vr.js +0 -1
- package/dist/lib-BZgXUui5.mjs +0 -198
- package/dist/line-DJdnFNI7.js +0 -75
- package/dist/line-tYLnEDGV.mjs +0 -1500
- package/dist/mailTemplates-BNk8fhVS.mjs +0 -23
- package/dist/mailTemplates-DswHzyQe.js +0 -1
- package/dist/orders-CIc0JlKX.mjs +0 -512
- package/dist/orders-DwPSi_pD.js +0 -1
- package/dist/payment-BsNWFaDm.js +0 -1
- package/dist/payment-Ced5_dpa.mjs +0 -718
- package/dist/productCollections-Cuvw_8zC.js +0 -1
- package/dist/productCollections-D0AxRlzr.mjs +0 -23
- package/dist/products-DUD-ZMkR.mjs +0 -22
- package/dist/products-DvX9B-Ul.js +0 -1
- package/dist/promoCodes-BCWqN6w4.mjs +0 -23
- package/dist/promoCodes-CEZ4LYot.js +0 -1
- package/dist/push-notifications-BGp4XWo9.js +0 -1
- package/dist/push-notifications-C7W7KuzR.mjs +0 -23
- package/dist/regular-BCFrS6lK.mjs +0 -908
- package/dist/regular-DBqPgT8C.js +0 -1
- package/dist/resources-DwsMmWgm.mjs +0 -669
- package/dist/resources-Dz81GkHe.js +0 -1
- package/dist/shippingOptions-C3NEJff1.mjs +0 -23
- package/dist/shippingOptions-Cy040ZW1.js +0 -1
- package/dist/single-container-BJmmqq65.mjs +0 -468
- package/dist/single-container-Xoo0Xzxv.js +0 -58
- package/dist/src/vue-shim.d.ts +0 -7
- package/dist/table-DWw0fs3S.js +0 -1
- package/dist/table-LXt5DQOL.mjs +0 -23
- package/dist/utils-CVIHqQsU.js +0 -3
- package/dist/utils-h3owcMtS.mjs +0 -37
- package/dist/vee-validate-zod-BmXMJo8W.js +0 -1
- package/dist/vee-validate-zod-D9dZzbWZ.mjs +0 -4985
- package/dist/xy-container-CuQSwrtB.mjs +0 -3180
- package/dist/xy-container-_6YpscZh.js +0 -158
|
@@ -0,0 +1,3077 @@
|
|
|
1
|
+
import { defineComponent as le, ref as R, resolveComponent as x, openBlock as D, createBlock as G, withCtx as g, createVNode as d, createTextVNode as k, createElementVNode as h, unref as $, normalizeClass as Q, computed as Y, createElementBlock as A, Fragment as H, renderList as q, toDisplayString as M, normalizeStyle as re, resolveDynamicComponent as de, createCommentVNode as E, inject as ct, useTemplateRef as ve } from "vue";
|
|
2
|
+
import { icons as X, User as dt, Mail as ft, Phone as pt, Clock as mt, Users as ht, Tag as vt, CreditCard as gt, Receipt as _t, Ban as yt, ClockCheck as xt, MoreHorizontal as bt, Download as Dt, MailCheck as Ct, CalendarClock as kt, XCircle as At, Gift as wt } from "lucide-vue-next";
|
|
3
|
+
import { useModule as be, useMailer as Re, useModulePermissions as Mt, useFirebaseIntegration as It } from "@oneclick.dev/cms-kit";
|
|
4
|
+
import { t as ie } from "./index-RLz1QPrf.mjs";
|
|
5
|
+
function ee(s) {
|
|
6
|
+
return Array.isArray ? Array.isArray(s) : Qe(s) === "[object Array]";
|
|
7
|
+
}
|
|
8
|
+
function $t(s) {
|
|
9
|
+
if (typeof s == "string")
|
|
10
|
+
return s;
|
|
11
|
+
if (typeof s == "bigint")
|
|
12
|
+
return s.toString();
|
|
13
|
+
const e = s + "";
|
|
14
|
+
return e == "0" && 1 / s == -1 / 0 ? "-0" : e;
|
|
15
|
+
}
|
|
16
|
+
function we(s) {
|
|
17
|
+
return s == null ? "" : $t(s);
|
|
18
|
+
}
|
|
19
|
+
function V(s) {
|
|
20
|
+
return typeof s == "string";
|
|
21
|
+
}
|
|
22
|
+
function _e(s) {
|
|
23
|
+
return typeof s == "number";
|
|
24
|
+
}
|
|
25
|
+
function St(s) {
|
|
26
|
+
return s === !0 || s === !1 || Et(s) && Qe(s) == "[object Boolean]";
|
|
27
|
+
}
|
|
28
|
+
function Ye(s) {
|
|
29
|
+
return typeof s == "object";
|
|
30
|
+
}
|
|
31
|
+
function Et(s) {
|
|
32
|
+
return Ye(s) && s !== null;
|
|
33
|
+
}
|
|
34
|
+
function W(s) {
|
|
35
|
+
return s != null;
|
|
36
|
+
}
|
|
37
|
+
function ge(s) {
|
|
38
|
+
return !s.trim().length;
|
|
39
|
+
}
|
|
40
|
+
function Qe(s) {
|
|
41
|
+
return s == null ? s === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(s);
|
|
42
|
+
}
|
|
43
|
+
const Ft = "Incorrect 'index' type", Bt = (s) => `Invalid value for key ${s}`, Rt = (s) => `Pattern length exceeds max of ${s}.`, jt = (s) => `Missing ${s} property in key`, Ot = (s) => `Property 'weight' in key '${s}' must be a positive integer`, ze = Object.prototype.hasOwnProperty;
|
|
44
|
+
class Tt {
|
|
45
|
+
constructor(e) {
|
|
46
|
+
this._keys = [], this._keyMap = {};
|
|
47
|
+
let t = 0;
|
|
48
|
+
e.forEach((o) => {
|
|
49
|
+
const r = Xe(o);
|
|
50
|
+
this._keys.push(r), this._keyMap[r.id] = r, t += r.weight;
|
|
51
|
+
}), this._keys.forEach((o) => {
|
|
52
|
+
o.weight /= t;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
get(e) {
|
|
56
|
+
return this._keyMap[e];
|
|
57
|
+
}
|
|
58
|
+
keys() {
|
|
59
|
+
return this._keys;
|
|
60
|
+
}
|
|
61
|
+
toJSON() {
|
|
62
|
+
return JSON.stringify(this._keys);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function Xe(s) {
|
|
66
|
+
let e = null, t = null, o = null, r = 1, i = null;
|
|
67
|
+
if (V(s) || ee(s))
|
|
68
|
+
o = s, e = Pe(s), t = Me(s);
|
|
69
|
+
else {
|
|
70
|
+
if (!ze.call(s, "name"))
|
|
71
|
+
throw new Error(jt("name"));
|
|
72
|
+
const l = s.name;
|
|
73
|
+
if (o = l, ze.call(s, "weight") && (r = s.weight, r <= 0))
|
|
74
|
+
throw new Error(Ot(l));
|
|
75
|
+
e = Pe(l), t = Me(l), i = s.getFn;
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
path: e,
|
|
79
|
+
id: t,
|
|
80
|
+
weight: r,
|
|
81
|
+
src: o,
|
|
82
|
+
getFn: i
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function Pe(s) {
|
|
86
|
+
return ee(s) ? s : s.split(".");
|
|
87
|
+
}
|
|
88
|
+
function Me(s) {
|
|
89
|
+
return ee(s) ? s.join(".") : s;
|
|
90
|
+
}
|
|
91
|
+
function Lt(s, e) {
|
|
92
|
+
const t = [];
|
|
93
|
+
let o = !1;
|
|
94
|
+
const r = (i, l, c, u) => {
|
|
95
|
+
if (W(i))
|
|
96
|
+
if (!l[c])
|
|
97
|
+
t.push(u !== void 0 ? {
|
|
98
|
+
v: i,
|
|
99
|
+
i: u
|
|
100
|
+
} : i);
|
|
101
|
+
else {
|
|
102
|
+
const m = l[c], a = i[m];
|
|
103
|
+
if (!W(a))
|
|
104
|
+
return;
|
|
105
|
+
if (c === l.length - 1 && (V(a) || _e(a) || St(a) || typeof a == "bigint"))
|
|
106
|
+
t.push(u !== void 0 ? {
|
|
107
|
+
v: we(a),
|
|
108
|
+
i: u
|
|
109
|
+
} : we(a));
|
|
110
|
+
else if (ee(a)) {
|
|
111
|
+
o = !0;
|
|
112
|
+
for (let n = 0, v = a.length; n < v; n += 1)
|
|
113
|
+
r(a[n], l, c + 1, n);
|
|
114
|
+
} else l.length && r(a, l, c + 1, u);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
return r(s, V(e) ? e.split(".") : e, 0), o ? t : t[0];
|
|
118
|
+
}
|
|
119
|
+
const Nt = {
|
|
120
|
+
includeMatches: !1,
|
|
121
|
+
findAllMatches: !1,
|
|
122
|
+
minMatchCharLength: 1
|
|
123
|
+
}, zt = {
|
|
124
|
+
isCaseSensitive: !1,
|
|
125
|
+
ignoreDiacritics: !1,
|
|
126
|
+
includeScore: !1,
|
|
127
|
+
keys: [],
|
|
128
|
+
shouldSort: !0,
|
|
129
|
+
sortFn: (s, e) => s.score === e.score ? s.idx < e.idx ? -1 : 1 : s.score < e.score ? -1 : 1
|
|
130
|
+
}, Pt = {
|
|
131
|
+
location: 0,
|
|
132
|
+
threshold: 0.6,
|
|
133
|
+
distance: 100
|
|
134
|
+
}, Vt = {
|
|
135
|
+
useExtendedSearch: !1,
|
|
136
|
+
useTokenSearch: !1,
|
|
137
|
+
getFn: Lt,
|
|
138
|
+
ignoreLocation: !1,
|
|
139
|
+
ignoreFieldNorm: !1,
|
|
140
|
+
fieldNormWeight: 1
|
|
141
|
+
}, C = Object.freeze({
|
|
142
|
+
...zt,
|
|
143
|
+
...Nt,
|
|
144
|
+
...Pt,
|
|
145
|
+
...Vt
|
|
146
|
+
}), Ut = /[^ ]+/g;
|
|
147
|
+
function Ht(s = 1, e = 3) {
|
|
148
|
+
const t = /* @__PURE__ */ new Map(), o = Math.pow(10, e);
|
|
149
|
+
return {
|
|
150
|
+
get(r) {
|
|
151
|
+
const i = r.match(Ut).length;
|
|
152
|
+
if (t.has(i))
|
|
153
|
+
return t.get(i);
|
|
154
|
+
const l = 1 / Math.pow(i, 0.5 * s), c = parseFloat(Math.round(l * o) / o);
|
|
155
|
+
return t.set(i, c), c;
|
|
156
|
+
},
|
|
157
|
+
clear() {
|
|
158
|
+
t.clear();
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
class je {
|
|
163
|
+
constructor({
|
|
164
|
+
getFn: e = C.getFn,
|
|
165
|
+
fieldNormWeight: t = C.fieldNormWeight
|
|
166
|
+
} = {}) {
|
|
167
|
+
this.norm = Ht(t, 3), this.getFn = e, this.isCreated = !1, this.docs = [], this.keys = [], this._keysMap = {}, this.setIndexRecords();
|
|
168
|
+
}
|
|
169
|
+
setSources(e = []) {
|
|
170
|
+
this.docs = e;
|
|
171
|
+
}
|
|
172
|
+
setIndexRecords(e = []) {
|
|
173
|
+
this.records = e;
|
|
174
|
+
}
|
|
175
|
+
setKeys(e = []) {
|
|
176
|
+
this.keys = e, this._keysMap = {}, e.forEach((t, o) => {
|
|
177
|
+
this._keysMap[t.id] = o;
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
create() {
|
|
181
|
+
this.isCreated || !this.docs.length || (this.isCreated = !0, V(this.docs[0]) ? this.docs.forEach((e, t) => {
|
|
182
|
+
this._addString(e, t);
|
|
183
|
+
}) : this.docs.forEach((e, t) => {
|
|
184
|
+
this._addObject(e, t);
|
|
185
|
+
}), this.norm.clear());
|
|
186
|
+
}
|
|
187
|
+
// Adds a doc to the end of the index
|
|
188
|
+
add(e) {
|
|
189
|
+
const t = this.size();
|
|
190
|
+
V(e) ? this._addString(e, t) : this._addObject(e, t);
|
|
191
|
+
}
|
|
192
|
+
// Removes the doc at the specified index of the index
|
|
193
|
+
removeAt(e) {
|
|
194
|
+
this.records.splice(e, 1);
|
|
195
|
+
for (let t = e, o = this.size(); t < o; t += 1)
|
|
196
|
+
this.records[t].i -= 1;
|
|
197
|
+
}
|
|
198
|
+
// Removes docs at the specified indices (must be sorted ascending)
|
|
199
|
+
removeAll(e) {
|
|
200
|
+
for (let t = e.length - 1; t >= 0; t -= 1)
|
|
201
|
+
this.records.splice(e[t], 1);
|
|
202
|
+
for (let t = 0, o = this.records.length; t < o; t += 1)
|
|
203
|
+
this.records[t].i = t;
|
|
204
|
+
}
|
|
205
|
+
getValueForItemAtKeyId(e, t) {
|
|
206
|
+
return e[this._keysMap[t]];
|
|
207
|
+
}
|
|
208
|
+
size() {
|
|
209
|
+
return this.records.length;
|
|
210
|
+
}
|
|
211
|
+
_addString(e, t) {
|
|
212
|
+
if (!W(e) || ge(e))
|
|
213
|
+
return;
|
|
214
|
+
const o = {
|
|
215
|
+
v: e,
|
|
216
|
+
i: t,
|
|
217
|
+
n: this.norm.get(e)
|
|
218
|
+
};
|
|
219
|
+
this.records.push(o);
|
|
220
|
+
}
|
|
221
|
+
_addObject(e, t) {
|
|
222
|
+
const o = {
|
|
223
|
+
i: t,
|
|
224
|
+
$: {}
|
|
225
|
+
};
|
|
226
|
+
this.keys.forEach((r, i) => {
|
|
227
|
+
const l = r.getFn ? r.getFn(e) : this.getFn(e, r.path);
|
|
228
|
+
if (W(l)) {
|
|
229
|
+
if (ee(l)) {
|
|
230
|
+
const c = [];
|
|
231
|
+
for (let u = 0, m = l.length; u < m; u += 1) {
|
|
232
|
+
const a = l[u];
|
|
233
|
+
if (W(a)) {
|
|
234
|
+
if (V(a)) {
|
|
235
|
+
if (!ge(a)) {
|
|
236
|
+
const n = {
|
|
237
|
+
v: a,
|
|
238
|
+
i: u,
|
|
239
|
+
n: this.norm.get(a)
|
|
240
|
+
};
|
|
241
|
+
c.push(n);
|
|
242
|
+
}
|
|
243
|
+
} else if (W(a.v)) {
|
|
244
|
+
const n = V(a.v) ? a.v : we(a.v);
|
|
245
|
+
if (!ge(n)) {
|
|
246
|
+
const v = {
|
|
247
|
+
v: n,
|
|
248
|
+
i: a.i,
|
|
249
|
+
n: this.norm.get(n)
|
|
250
|
+
};
|
|
251
|
+
c.push(v);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
o.$[i] = c;
|
|
257
|
+
} else if (V(l) && !ge(l)) {
|
|
258
|
+
const c = {
|
|
259
|
+
v: l,
|
|
260
|
+
n: this.norm.get(l)
|
|
261
|
+
};
|
|
262
|
+
o.$[i] = c;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}), this.records.push(o);
|
|
266
|
+
}
|
|
267
|
+
toJSON() {
|
|
268
|
+
return {
|
|
269
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
270
|
+
keys: this.keys.map(({
|
|
271
|
+
getFn: e,
|
|
272
|
+
...t
|
|
273
|
+
}) => t),
|
|
274
|
+
records: this.records
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
function Je(s, e, {
|
|
279
|
+
getFn: t = C.getFn,
|
|
280
|
+
fieldNormWeight: o = C.fieldNormWeight
|
|
281
|
+
} = {}) {
|
|
282
|
+
const r = new je({
|
|
283
|
+
getFn: t,
|
|
284
|
+
fieldNormWeight: o
|
|
285
|
+
});
|
|
286
|
+
return r.setKeys(s.map(Xe)), r.setSources(e), r.create(), r;
|
|
287
|
+
}
|
|
288
|
+
function Wt(s, {
|
|
289
|
+
getFn: e = C.getFn,
|
|
290
|
+
fieldNormWeight: t = C.fieldNormWeight
|
|
291
|
+
} = {}) {
|
|
292
|
+
const {
|
|
293
|
+
keys: o,
|
|
294
|
+
records: r
|
|
295
|
+
} = s, i = new je({
|
|
296
|
+
getFn: e,
|
|
297
|
+
fieldNormWeight: t
|
|
298
|
+
});
|
|
299
|
+
return i.setKeys(o), i.setIndexRecords(r), i;
|
|
300
|
+
}
|
|
301
|
+
function Kt(s = [], e = C.minMatchCharLength) {
|
|
302
|
+
const t = [];
|
|
303
|
+
let o = -1, r = -1, i = 0;
|
|
304
|
+
for (let l = s.length; i < l; i += 1) {
|
|
305
|
+
const c = s[i];
|
|
306
|
+
c && o === -1 ? o = i : !c && o !== -1 && (r = i - 1, r - o + 1 >= e && t.push([o, r]), o = -1);
|
|
307
|
+
}
|
|
308
|
+
return s[i - 1] && i - o >= e && t.push([o, i - 1]), t;
|
|
309
|
+
}
|
|
310
|
+
const ne = 32;
|
|
311
|
+
function Gt(s, e, t, {
|
|
312
|
+
location: o = C.location,
|
|
313
|
+
distance: r = C.distance,
|
|
314
|
+
threshold: i = C.threshold,
|
|
315
|
+
findAllMatches: l = C.findAllMatches,
|
|
316
|
+
minMatchCharLength: c = C.minMatchCharLength,
|
|
317
|
+
includeMatches: u = C.includeMatches,
|
|
318
|
+
ignoreLocation: m = C.ignoreLocation
|
|
319
|
+
} = {}) {
|
|
320
|
+
if (e.length > ne)
|
|
321
|
+
throw new Error(Rt(ne));
|
|
322
|
+
const a = e.length, n = s.length, v = Math.max(0, Math.min(o, n));
|
|
323
|
+
let f = i, p = v;
|
|
324
|
+
const y = (B, L) => {
|
|
325
|
+
const b = B / a;
|
|
326
|
+
if (m) return b;
|
|
327
|
+
const z = Math.abs(v - L);
|
|
328
|
+
return r ? b + z / r : z ? 1 : b;
|
|
329
|
+
}, w = c > 1 || u, j = w ? Array(n) : [];
|
|
330
|
+
let T;
|
|
331
|
+
for (; (T = s.indexOf(e, p)) > -1; ) {
|
|
332
|
+
const B = y(0, T);
|
|
333
|
+
if (f = Math.min(B, f), p = T + a, w) {
|
|
334
|
+
let L = 0;
|
|
335
|
+
for (; L < a; )
|
|
336
|
+
j[T + L] = 1, L += 1;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
p = -1;
|
|
340
|
+
let S = [], F = 1, N = a + n;
|
|
341
|
+
const O = 1 << a - 1;
|
|
342
|
+
for (let B = 0; B < a; B += 1) {
|
|
343
|
+
let L = 0, b = N;
|
|
344
|
+
for (; L < b; )
|
|
345
|
+
y(B, v + b) <= f ? L = b : N = b, b = Math.floor((N - L) / 2 + L);
|
|
346
|
+
N = b;
|
|
347
|
+
let z = Math.max(1, v - b + 1);
|
|
348
|
+
const ue = l ? n : Math.min(v + b, n) + a, J = Array(ue + 2);
|
|
349
|
+
J[ue + 1] = (1 << B) - 1;
|
|
350
|
+
for (let K = ue; K >= z; K -= 1) {
|
|
351
|
+
const ae = K - 1, pe = t[s[ae]];
|
|
352
|
+
if (w && (j[ae] = +!!pe), J[K] = (J[K + 1] << 1 | 1) & pe, B && (J[K] |= (S[K + 1] | S[K]) << 1 | 1 | S[K + 1]), J[K] & O && (F = y(B, ae), F <= f)) {
|
|
353
|
+
if (f = F, p = ae, p <= v)
|
|
354
|
+
break;
|
|
355
|
+
z = Math.max(1, 2 * v - p);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
if (y(B + 1, v) > f)
|
|
359
|
+
break;
|
|
360
|
+
S = J;
|
|
361
|
+
}
|
|
362
|
+
const U = {
|
|
363
|
+
isMatch: p >= 0,
|
|
364
|
+
// Count exact matches (those with a score of 0) to be "almost" exact
|
|
365
|
+
score: Math.max(1e-3, F)
|
|
366
|
+
};
|
|
367
|
+
if (w) {
|
|
368
|
+
const B = Kt(j, c);
|
|
369
|
+
B.length ? u && (U.indices = B) : U.isMatch = !1;
|
|
370
|
+
}
|
|
371
|
+
return U;
|
|
372
|
+
}
|
|
373
|
+
function Yt(s) {
|
|
374
|
+
const e = {};
|
|
375
|
+
for (let t = 0, o = s.length; t < o; t += 1) {
|
|
376
|
+
const r = s.charAt(t);
|
|
377
|
+
e[r] = (e[r] || 0) | 1 << o - t - 1;
|
|
378
|
+
}
|
|
379
|
+
return e;
|
|
380
|
+
}
|
|
381
|
+
function Oe(s) {
|
|
382
|
+
if (s.length <= 1) return s;
|
|
383
|
+
s.sort((t, o) => t[0] - o[0] || t[1] - o[1]);
|
|
384
|
+
const e = [s[0]];
|
|
385
|
+
for (let t = 1, o = s.length; t < o; t += 1) {
|
|
386
|
+
const r = e[e.length - 1], i = s[t];
|
|
387
|
+
i[0] <= r[1] + 1 ? r[1] = Math.max(r[1], i[1]) : e.push(i);
|
|
388
|
+
}
|
|
389
|
+
return e;
|
|
390
|
+
}
|
|
391
|
+
const Ze = {
|
|
392
|
+
ł: "l",
|
|
393
|
+
// ł
|
|
394
|
+
Ł: "L",
|
|
395
|
+
// Ł
|
|
396
|
+
đ: "d",
|
|
397
|
+
// đ
|
|
398
|
+
Đ: "D",
|
|
399
|
+
// Đ
|
|
400
|
+
ø: "o",
|
|
401
|
+
// ø
|
|
402
|
+
Ø: "O",
|
|
403
|
+
// Ø
|
|
404
|
+
ħ: "h",
|
|
405
|
+
// ħ
|
|
406
|
+
Ħ: "H",
|
|
407
|
+
// Ħ
|
|
408
|
+
ŧ: "t",
|
|
409
|
+
// ŧ
|
|
410
|
+
Ŧ: "T",
|
|
411
|
+
// Ŧ
|
|
412
|
+
ı: "i",
|
|
413
|
+
// ı
|
|
414
|
+
ß: "ss"
|
|
415
|
+
// ß
|
|
416
|
+
}, Qt = new RegExp("[" + Object.keys(Ze).join("") + "]", "g"), fe = String.prototype.normalize ? (s) => s.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g, "").replace(Qt, (e) => Ze[e]) : (s) => s;
|
|
417
|
+
class Te {
|
|
418
|
+
constructor(e, {
|
|
419
|
+
location: t = C.location,
|
|
420
|
+
threshold: o = C.threshold,
|
|
421
|
+
distance: r = C.distance,
|
|
422
|
+
includeMatches: i = C.includeMatches,
|
|
423
|
+
findAllMatches: l = C.findAllMatches,
|
|
424
|
+
minMatchCharLength: c = C.minMatchCharLength,
|
|
425
|
+
isCaseSensitive: u = C.isCaseSensitive,
|
|
426
|
+
ignoreDiacritics: m = C.ignoreDiacritics,
|
|
427
|
+
ignoreLocation: a = C.ignoreLocation
|
|
428
|
+
} = {}) {
|
|
429
|
+
if (this.options = {
|
|
430
|
+
location: t,
|
|
431
|
+
threshold: o,
|
|
432
|
+
distance: r,
|
|
433
|
+
includeMatches: i,
|
|
434
|
+
findAllMatches: l,
|
|
435
|
+
minMatchCharLength: c,
|
|
436
|
+
isCaseSensitive: u,
|
|
437
|
+
ignoreDiacritics: m,
|
|
438
|
+
ignoreLocation: a
|
|
439
|
+
}, e = u ? e : e.toLowerCase(), e = m ? fe(e) : e, this.pattern = e, this.chunks = [], !this.pattern.length)
|
|
440
|
+
return;
|
|
441
|
+
const n = (f, p) => {
|
|
442
|
+
this.chunks.push({
|
|
443
|
+
pattern: f,
|
|
444
|
+
alphabet: Yt(f),
|
|
445
|
+
startIndex: p
|
|
446
|
+
});
|
|
447
|
+
}, v = this.pattern.length;
|
|
448
|
+
if (v > ne) {
|
|
449
|
+
let f = 0;
|
|
450
|
+
const p = v % ne, y = v - p;
|
|
451
|
+
for (; f < y; )
|
|
452
|
+
n(this.pattern.substr(f, ne), f), f += ne;
|
|
453
|
+
if (p) {
|
|
454
|
+
const w = v - ne;
|
|
455
|
+
n(this.pattern.substr(w), w);
|
|
456
|
+
}
|
|
457
|
+
} else
|
|
458
|
+
n(this.pattern, 0);
|
|
459
|
+
}
|
|
460
|
+
searchIn(e) {
|
|
461
|
+
const {
|
|
462
|
+
isCaseSensitive: t,
|
|
463
|
+
ignoreDiacritics: o,
|
|
464
|
+
includeMatches: r
|
|
465
|
+
} = this.options;
|
|
466
|
+
if (e = t ? e : e.toLowerCase(), e = o ? fe(e) : e, this.pattern === e) {
|
|
467
|
+
const y = {
|
|
468
|
+
isMatch: !0,
|
|
469
|
+
score: 0
|
|
470
|
+
};
|
|
471
|
+
return r && (y.indices = [[0, e.length - 1]]), y;
|
|
472
|
+
}
|
|
473
|
+
const {
|
|
474
|
+
location: i,
|
|
475
|
+
distance: l,
|
|
476
|
+
threshold: c,
|
|
477
|
+
findAllMatches: u,
|
|
478
|
+
minMatchCharLength: m,
|
|
479
|
+
ignoreLocation: a
|
|
480
|
+
} = this.options, n = [];
|
|
481
|
+
let v = 0, f = !1;
|
|
482
|
+
this.chunks.forEach(({
|
|
483
|
+
pattern: y,
|
|
484
|
+
alphabet: w,
|
|
485
|
+
startIndex: j
|
|
486
|
+
}) => {
|
|
487
|
+
const {
|
|
488
|
+
isMatch: T,
|
|
489
|
+
score: S,
|
|
490
|
+
indices: F
|
|
491
|
+
} = Gt(e, y, w, {
|
|
492
|
+
location: i + j,
|
|
493
|
+
distance: l,
|
|
494
|
+
threshold: c,
|
|
495
|
+
findAllMatches: u,
|
|
496
|
+
minMatchCharLength: m,
|
|
497
|
+
includeMatches: r,
|
|
498
|
+
ignoreLocation: a
|
|
499
|
+
});
|
|
500
|
+
T && (f = !0), v += S, T && F && n.push(...F);
|
|
501
|
+
});
|
|
502
|
+
const p = {
|
|
503
|
+
isMatch: f,
|
|
504
|
+
score: f ? v / this.chunks.length : 1
|
|
505
|
+
};
|
|
506
|
+
return f && r && (p.indices = Oe(n)), p;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
class te {
|
|
510
|
+
constructor(e) {
|
|
511
|
+
this.pattern = e;
|
|
512
|
+
}
|
|
513
|
+
static isMultiMatch(e) {
|
|
514
|
+
return Ve(e, this.multiRegex);
|
|
515
|
+
}
|
|
516
|
+
static isSingleMatch(e) {
|
|
517
|
+
return Ve(e, this.singleRegex);
|
|
518
|
+
}
|
|
519
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
520
|
+
search(e) {
|
|
521
|
+
return {
|
|
522
|
+
isMatch: !1,
|
|
523
|
+
score: 1
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
function Ve(s, e) {
|
|
528
|
+
const t = s.match(e);
|
|
529
|
+
return t ? t[1] : null;
|
|
530
|
+
}
|
|
531
|
+
class Xt extends te {
|
|
532
|
+
constructor(e) {
|
|
533
|
+
super(e);
|
|
534
|
+
}
|
|
535
|
+
static get type() {
|
|
536
|
+
return "exact";
|
|
537
|
+
}
|
|
538
|
+
static get multiRegex() {
|
|
539
|
+
return /^="(.*)"$/;
|
|
540
|
+
}
|
|
541
|
+
static get singleRegex() {
|
|
542
|
+
return /^=(.*)$/;
|
|
543
|
+
}
|
|
544
|
+
search(e) {
|
|
545
|
+
const t = e === this.pattern;
|
|
546
|
+
return {
|
|
547
|
+
isMatch: t,
|
|
548
|
+
score: t ? 0 : 1,
|
|
549
|
+
indices: [0, this.pattern.length - 1]
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
class Jt extends te {
|
|
554
|
+
constructor(e) {
|
|
555
|
+
super(e);
|
|
556
|
+
}
|
|
557
|
+
static get type() {
|
|
558
|
+
return "inverse-exact";
|
|
559
|
+
}
|
|
560
|
+
static get multiRegex() {
|
|
561
|
+
return /^!"(.*)"$/;
|
|
562
|
+
}
|
|
563
|
+
static get singleRegex() {
|
|
564
|
+
return /^!(.*)$/;
|
|
565
|
+
}
|
|
566
|
+
search(e) {
|
|
567
|
+
const o = e.indexOf(this.pattern) === -1;
|
|
568
|
+
return {
|
|
569
|
+
isMatch: o,
|
|
570
|
+
score: o ? 0 : 1,
|
|
571
|
+
indices: [0, e.length - 1]
|
|
572
|
+
};
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
class Zt extends te {
|
|
576
|
+
constructor(e) {
|
|
577
|
+
super(e);
|
|
578
|
+
}
|
|
579
|
+
static get type() {
|
|
580
|
+
return "prefix-exact";
|
|
581
|
+
}
|
|
582
|
+
static get multiRegex() {
|
|
583
|
+
return /^\^"(.*)"$/;
|
|
584
|
+
}
|
|
585
|
+
static get singleRegex() {
|
|
586
|
+
return /^\^(.*)$/;
|
|
587
|
+
}
|
|
588
|
+
search(e) {
|
|
589
|
+
const t = e.startsWith(this.pattern);
|
|
590
|
+
return {
|
|
591
|
+
isMatch: t,
|
|
592
|
+
score: t ? 0 : 1,
|
|
593
|
+
indices: [0, this.pattern.length - 1]
|
|
594
|
+
};
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
class qt extends te {
|
|
598
|
+
constructor(e) {
|
|
599
|
+
super(e);
|
|
600
|
+
}
|
|
601
|
+
static get type() {
|
|
602
|
+
return "inverse-prefix-exact";
|
|
603
|
+
}
|
|
604
|
+
static get multiRegex() {
|
|
605
|
+
return /^!\^"(.*)"$/;
|
|
606
|
+
}
|
|
607
|
+
static get singleRegex() {
|
|
608
|
+
return /^!\^(.*)$/;
|
|
609
|
+
}
|
|
610
|
+
search(e) {
|
|
611
|
+
const t = !e.startsWith(this.pattern);
|
|
612
|
+
return {
|
|
613
|
+
isMatch: t,
|
|
614
|
+
score: t ? 0 : 1,
|
|
615
|
+
indices: [0, e.length - 1]
|
|
616
|
+
};
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
class es extends te {
|
|
620
|
+
constructor(e) {
|
|
621
|
+
super(e);
|
|
622
|
+
}
|
|
623
|
+
static get type() {
|
|
624
|
+
return "suffix-exact";
|
|
625
|
+
}
|
|
626
|
+
static get multiRegex() {
|
|
627
|
+
return /^"(.*)"\$$/;
|
|
628
|
+
}
|
|
629
|
+
static get singleRegex() {
|
|
630
|
+
return /^(.*)\$$/;
|
|
631
|
+
}
|
|
632
|
+
search(e) {
|
|
633
|
+
const t = e.endsWith(this.pattern);
|
|
634
|
+
return {
|
|
635
|
+
isMatch: t,
|
|
636
|
+
score: t ? 0 : 1,
|
|
637
|
+
indices: [e.length - this.pattern.length, e.length - 1]
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
class ts extends te {
|
|
642
|
+
constructor(e) {
|
|
643
|
+
super(e);
|
|
644
|
+
}
|
|
645
|
+
static get type() {
|
|
646
|
+
return "inverse-suffix-exact";
|
|
647
|
+
}
|
|
648
|
+
static get multiRegex() {
|
|
649
|
+
return /^!"(.*)"\$$/;
|
|
650
|
+
}
|
|
651
|
+
static get singleRegex() {
|
|
652
|
+
return /^!(.*)\$$/;
|
|
653
|
+
}
|
|
654
|
+
search(e) {
|
|
655
|
+
const t = !e.endsWith(this.pattern);
|
|
656
|
+
return {
|
|
657
|
+
isMatch: t,
|
|
658
|
+
score: t ? 0 : 1,
|
|
659
|
+
indices: [0, e.length - 1]
|
|
660
|
+
};
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
class qe extends te {
|
|
664
|
+
constructor(e, {
|
|
665
|
+
location: t = C.location,
|
|
666
|
+
threshold: o = C.threshold,
|
|
667
|
+
distance: r = C.distance,
|
|
668
|
+
includeMatches: i = C.includeMatches,
|
|
669
|
+
findAllMatches: l = C.findAllMatches,
|
|
670
|
+
minMatchCharLength: c = C.minMatchCharLength,
|
|
671
|
+
isCaseSensitive: u = C.isCaseSensitive,
|
|
672
|
+
ignoreDiacritics: m = C.ignoreDiacritics,
|
|
673
|
+
ignoreLocation: a = C.ignoreLocation
|
|
674
|
+
} = {}) {
|
|
675
|
+
super(e), this._bitapSearch = new Te(e, {
|
|
676
|
+
location: t,
|
|
677
|
+
threshold: o,
|
|
678
|
+
distance: r,
|
|
679
|
+
includeMatches: i,
|
|
680
|
+
findAllMatches: l,
|
|
681
|
+
minMatchCharLength: c,
|
|
682
|
+
isCaseSensitive: u,
|
|
683
|
+
ignoreDiacritics: m,
|
|
684
|
+
ignoreLocation: a
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
static get type() {
|
|
688
|
+
return "fuzzy";
|
|
689
|
+
}
|
|
690
|
+
static get multiRegex() {
|
|
691
|
+
return /^"(.*)"$/;
|
|
692
|
+
}
|
|
693
|
+
static get singleRegex() {
|
|
694
|
+
return /^(.*)$/;
|
|
695
|
+
}
|
|
696
|
+
search(e) {
|
|
697
|
+
return this._bitapSearch.searchIn(e);
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
class et extends te {
|
|
701
|
+
constructor(e) {
|
|
702
|
+
super(e);
|
|
703
|
+
}
|
|
704
|
+
static get type() {
|
|
705
|
+
return "include";
|
|
706
|
+
}
|
|
707
|
+
static get multiRegex() {
|
|
708
|
+
return /^'"(.*)"$/;
|
|
709
|
+
}
|
|
710
|
+
static get singleRegex() {
|
|
711
|
+
return /^'(.*)$/;
|
|
712
|
+
}
|
|
713
|
+
search(e) {
|
|
714
|
+
let t = 0, o;
|
|
715
|
+
const r = [], i = this.pattern.length;
|
|
716
|
+
for (; (o = e.indexOf(this.pattern, t)) > -1; )
|
|
717
|
+
t = o + i, r.push([o, t - 1]);
|
|
718
|
+
const l = !!r.length;
|
|
719
|
+
return {
|
|
720
|
+
isMatch: l,
|
|
721
|
+
score: l ? 0 : 1,
|
|
722
|
+
indices: r
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
const Ie = [Xt, et, Zt, qt, ts, es, Jt, qe], Ue = Ie.length, ss = "\0", ns = "|";
|
|
727
|
+
function os(s) {
|
|
728
|
+
const e = [], t = s.length;
|
|
729
|
+
let o = 0;
|
|
730
|
+
for (; o < t; ) {
|
|
731
|
+
for (; o < t && s[o] === " "; ) o++;
|
|
732
|
+
if (o >= t) break;
|
|
733
|
+
let r = o;
|
|
734
|
+
for (; r < t && s[r] !== " " && s[r] !== '"'; ) r++;
|
|
735
|
+
if (r < t && s[r] === '"') {
|
|
736
|
+
for (r++; r < t; ) {
|
|
737
|
+
if (s[r] === '"') {
|
|
738
|
+
const i = r + 1;
|
|
739
|
+
if (i >= t || s[i] === " ") {
|
|
740
|
+
r++;
|
|
741
|
+
break;
|
|
742
|
+
}
|
|
743
|
+
if (s[i] === "$" && (i + 1 >= t || s[i + 1] === " ")) {
|
|
744
|
+
r += 2;
|
|
745
|
+
break;
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
r++;
|
|
749
|
+
}
|
|
750
|
+
e.push(s.substring(o, r)), o = r;
|
|
751
|
+
} else {
|
|
752
|
+
for (; r < t && s[r] !== " "; ) r++;
|
|
753
|
+
e.push(s.substring(o, r)), o = r;
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
return e;
|
|
757
|
+
}
|
|
758
|
+
function as(s, e = {}) {
|
|
759
|
+
return s.replace(/\\\|/g, ss).split(ns).map((o) => {
|
|
760
|
+
const r = o.replace(/\u0000/g, "|"), i = os(r.trim()).filter((c) => c && !!c.trim()), l = [];
|
|
761
|
+
for (let c = 0, u = i.length; c < u; c += 1) {
|
|
762
|
+
const m = i[c];
|
|
763
|
+
let a = !1, n = -1;
|
|
764
|
+
for (; !a && ++n < Ue; ) {
|
|
765
|
+
const v = Ie[n], f = v.isMultiMatch(m);
|
|
766
|
+
f && (l.push(new v(f, e)), a = !0);
|
|
767
|
+
}
|
|
768
|
+
if (!a)
|
|
769
|
+
for (n = -1; ++n < Ue; ) {
|
|
770
|
+
const v = Ie[n], f = v.isSingleMatch(m);
|
|
771
|
+
if (f) {
|
|
772
|
+
l.push(new v(f, e));
|
|
773
|
+
break;
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
return l;
|
|
778
|
+
});
|
|
779
|
+
}
|
|
780
|
+
const rs = /* @__PURE__ */ new Set([qe.type, et.type]);
|
|
781
|
+
class is {
|
|
782
|
+
constructor(e, {
|
|
783
|
+
isCaseSensitive: t = C.isCaseSensitive,
|
|
784
|
+
ignoreDiacritics: o = C.ignoreDiacritics,
|
|
785
|
+
includeMatches: r = C.includeMatches,
|
|
786
|
+
minMatchCharLength: i = C.minMatchCharLength,
|
|
787
|
+
ignoreLocation: l = C.ignoreLocation,
|
|
788
|
+
findAllMatches: c = C.findAllMatches,
|
|
789
|
+
location: u = C.location,
|
|
790
|
+
threshold: m = C.threshold,
|
|
791
|
+
distance: a = C.distance
|
|
792
|
+
} = {}) {
|
|
793
|
+
this.query = null, this.options = {
|
|
794
|
+
isCaseSensitive: t,
|
|
795
|
+
ignoreDiacritics: o,
|
|
796
|
+
includeMatches: r,
|
|
797
|
+
minMatchCharLength: i,
|
|
798
|
+
findAllMatches: c,
|
|
799
|
+
ignoreLocation: l,
|
|
800
|
+
location: u,
|
|
801
|
+
threshold: m,
|
|
802
|
+
distance: a
|
|
803
|
+
}, e = t ? e : e.toLowerCase(), e = o ? fe(e) : e, this.pattern = e, this.query = as(this.pattern, this.options);
|
|
804
|
+
}
|
|
805
|
+
static condition(e, t) {
|
|
806
|
+
return t.useExtendedSearch;
|
|
807
|
+
}
|
|
808
|
+
// Note: searchIn operates on a single text value and sets hasInverse on the
|
|
809
|
+
// result when inverse patterns are involved. _searchObjectList uses this to
|
|
810
|
+
// switch from "ANY key" to "ALL keys" aggregation. See #712.
|
|
811
|
+
searchIn(e) {
|
|
812
|
+
const t = this.query;
|
|
813
|
+
if (!t)
|
|
814
|
+
return {
|
|
815
|
+
isMatch: !1,
|
|
816
|
+
score: 1
|
|
817
|
+
};
|
|
818
|
+
const {
|
|
819
|
+
includeMatches: o,
|
|
820
|
+
isCaseSensitive: r,
|
|
821
|
+
ignoreDiacritics: i
|
|
822
|
+
} = this.options;
|
|
823
|
+
e = r ? e : e.toLowerCase(), e = i ? fe(e) : e;
|
|
824
|
+
let l = 0;
|
|
825
|
+
const c = [];
|
|
826
|
+
let u = 0, m = !1;
|
|
827
|
+
for (let a = 0, n = t.length; a < n; a += 1) {
|
|
828
|
+
const v = t[a];
|
|
829
|
+
c.length = 0, l = 0, m = !1;
|
|
830
|
+
for (let f = 0, p = v.length; f < p; f += 1) {
|
|
831
|
+
const y = v[f], {
|
|
832
|
+
isMatch: w,
|
|
833
|
+
indices: j,
|
|
834
|
+
score: T
|
|
835
|
+
} = y.search(e);
|
|
836
|
+
if (w) {
|
|
837
|
+
l += 1, u += T;
|
|
838
|
+
const S = y.constructor.type;
|
|
839
|
+
S.startsWith("inverse") && (m = !0), o && (rs.has(S) ? c.push(...j) : c.push(j));
|
|
840
|
+
} else {
|
|
841
|
+
u = 0, l = 0, c.length = 0, m = !1;
|
|
842
|
+
break;
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
if (l) {
|
|
846
|
+
const f = {
|
|
847
|
+
isMatch: !0,
|
|
848
|
+
score: u / l
|
|
849
|
+
};
|
|
850
|
+
return m && (f.hasInverse = !0), o && (f.indices = Oe(c)), f;
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
return {
|
|
854
|
+
isMatch: !1,
|
|
855
|
+
score: 1
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
const $e = [];
|
|
860
|
+
function Le(...s) {
|
|
861
|
+
$e.push(...s);
|
|
862
|
+
}
|
|
863
|
+
function ye(s, e) {
|
|
864
|
+
for (let t = 0, o = $e.length; t < o; t += 1) {
|
|
865
|
+
const r = $e[t];
|
|
866
|
+
if (r.condition(s, e))
|
|
867
|
+
return new r(s, e);
|
|
868
|
+
}
|
|
869
|
+
return new Te(s, e);
|
|
870
|
+
}
|
|
871
|
+
const xe = {
|
|
872
|
+
AND: "$and",
|
|
873
|
+
OR: "$or"
|
|
874
|
+
}, Se = {
|
|
875
|
+
PATH: "$path",
|
|
876
|
+
PATTERN: "$val"
|
|
877
|
+
}, Ee = (s) => !!(s[xe.AND] || s[xe.OR]), ls = (s) => !!s[Se.PATH], us = (s) => !ee(s) && Ye(s) && !Ee(s), He = (s) => ({
|
|
878
|
+
[xe.AND]: Object.keys(s).map((e) => ({
|
|
879
|
+
[e]: s[e]
|
|
880
|
+
}))
|
|
881
|
+
});
|
|
882
|
+
function tt(s, e, {
|
|
883
|
+
auto: t = !0
|
|
884
|
+
} = {}) {
|
|
885
|
+
const o = (r) => {
|
|
886
|
+
if (V(r)) {
|
|
887
|
+
const u = {
|
|
888
|
+
keyId: null,
|
|
889
|
+
pattern: r
|
|
890
|
+
};
|
|
891
|
+
return t && (u.searcher = ye(r, e)), u;
|
|
892
|
+
}
|
|
893
|
+
const i = Object.keys(r), l = ls(r);
|
|
894
|
+
if (!l && i.length > 1 && !Ee(r))
|
|
895
|
+
return o(He(r));
|
|
896
|
+
if (us(r)) {
|
|
897
|
+
const u = l ? r[Se.PATH] : i[0], m = l ? r[Se.PATTERN] : r[u];
|
|
898
|
+
if (!V(m))
|
|
899
|
+
throw new Error(Bt(u));
|
|
900
|
+
const a = {
|
|
901
|
+
keyId: Me(u),
|
|
902
|
+
pattern: m
|
|
903
|
+
};
|
|
904
|
+
return t && (a.searcher = ye(m, e)), a;
|
|
905
|
+
}
|
|
906
|
+
const c = {
|
|
907
|
+
children: [],
|
|
908
|
+
operator: i[0]
|
|
909
|
+
};
|
|
910
|
+
return i.forEach((u) => {
|
|
911
|
+
const m = r[u];
|
|
912
|
+
ee(m) && m.forEach((a) => {
|
|
913
|
+
c.children.push(o(a));
|
|
914
|
+
});
|
|
915
|
+
}), c;
|
|
916
|
+
};
|
|
917
|
+
return Ee(s) || (s = He(s)), o(s);
|
|
918
|
+
}
|
|
919
|
+
function Fe(s, {
|
|
920
|
+
ignoreFieldNorm: e = C.ignoreFieldNorm
|
|
921
|
+
}) {
|
|
922
|
+
let t = 1;
|
|
923
|
+
return s.forEach(({
|
|
924
|
+
key: o,
|
|
925
|
+
norm: r,
|
|
926
|
+
score: i
|
|
927
|
+
}) => {
|
|
928
|
+
const l = o ? o.weight : null;
|
|
929
|
+
t *= Math.pow(i === 0 && l ? Number.EPSILON : i, (l || 1) * (e ? 1 : r));
|
|
930
|
+
}), t;
|
|
931
|
+
}
|
|
932
|
+
function cs(s, {
|
|
933
|
+
ignoreFieldNorm: e = C.ignoreFieldNorm
|
|
934
|
+
}) {
|
|
935
|
+
s.forEach((t) => {
|
|
936
|
+
t.score = Fe(t.matches, {
|
|
937
|
+
ignoreFieldNorm: e
|
|
938
|
+
});
|
|
939
|
+
});
|
|
940
|
+
}
|
|
941
|
+
class ds {
|
|
942
|
+
constructor(e) {
|
|
943
|
+
this.limit = e, this.heap = [];
|
|
944
|
+
}
|
|
945
|
+
get size() {
|
|
946
|
+
return this.heap.length;
|
|
947
|
+
}
|
|
948
|
+
shouldInsert(e) {
|
|
949
|
+
return this.size < this.limit || e < this.heap[0].score;
|
|
950
|
+
}
|
|
951
|
+
insert(e) {
|
|
952
|
+
this.size < this.limit ? (this.heap.push(e), this._bubbleUp(this.size - 1)) : e.score < this.heap[0].score && (this.heap[0] = e, this._sinkDown(0));
|
|
953
|
+
}
|
|
954
|
+
extractSorted(e) {
|
|
955
|
+
return this.heap.sort(e);
|
|
956
|
+
}
|
|
957
|
+
_bubbleUp(e) {
|
|
958
|
+
const t = this.heap;
|
|
959
|
+
for (; e > 0; ) {
|
|
960
|
+
const o = e - 1 >> 1;
|
|
961
|
+
if (t[e].score <= t[o].score) break;
|
|
962
|
+
const r = t[e];
|
|
963
|
+
t[e] = t[o], t[o] = r, e = o;
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
_sinkDown(e) {
|
|
967
|
+
const t = this.heap, o = t.length;
|
|
968
|
+
let r = e;
|
|
969
|
+
do {
|
|
970
|
+
e = r;
|
|
971
|
+
const i = 2 * e + 1, l = 2 * e + 2;
|
|
972
|
+
if (i < o && t[i].score > t[r].score && (r = i), l < o && t[l].score > t[r].score && (r = l), r !== e) {
|
|
973
|
+
const c = t[e];
|
|
974
|
+
t[e] = t[r], t[r] = c;
|
|
975
|
+
}
|
|
976
|
+
} while (r !== e);
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
function fs(s, e) {
|
|
980
|
+
const t = s.matches;
|
|
981
|
+
e.matches = [], W(t) && t.forEach((o) => {
|
|
982
|
+
if (!W(o.indices) || !o.indices.length)
|
|
983
|
+
return;
|
|
984
|
+
const {
|
|
985
|
+
indices: r,
|
|
986
|
+
value: i
|
|
987
|
+
} = o, l = {
|
|
988
|
+
indices: r,
|
|
989
|
+
value: i
|
|
990
|
+
};
|
|
991
|
+
o.key && (l.key = o.key.src), o.idx > -1 && (l.refIndex = o.idx), e.matches.push(l);
|
|
992
|
+
});
|
|
993
|
+
}
|
|
994
|
+
function ps(s, e) {
|
|
995
|
+
e.score = s.score;
|
|
996
|
+
}
|
|
997
|
+
function ms(s, e, {
|
|
998
|
+
includeMatches: t = C.includeMatches,
|
|
999
|
+
includeScore: o = C.includeScore
|
|
1000
|
+
} = {}) {
|
|
1001
|
+
const r = [];
|
|
1002
|
+
return t && r.push(fs), o && r.push(ps), s.map((i) => {
|
|
1003
|
+
const {
|
|
1004
|
+
idx: l
|
|
1005
|
+
} = i, c = {
|
|
1006
|
+
item: e[l],
|
|
1007
|
+
refIndex: l
|
|
1008
|
+
};
|
|
1009
|
+
return r.length && r.forEach((u) => {
|
|
1010
|
+
u(i, c);
|
|
1011
|
+
}), c;
|
|
1012
|
+
});
|
|
1013
|
+
}
|
|
1014
|
+
const hs = /\b\w+\b/g;
|
|
1015
|
+
function Be({
|
|
1016
|
+
isCaseSensitive: s = !1,
|
|
1017
|
+
ignoreDiacritics: e = !1
|
|
1018
|
+
} = {}) {
|
|
1019
|
+
return {
|
|
1020
|
+
tokenize(t) {
|
|
1021
|
+
return s || (t = t.toLowerCase()), e && (t = fe(t)), t.match(hs) || [];
|
|
1022
|
+
}
|
|
1023
|
+
};
|
|
1024
|
+
}
|
|
1025
|
+
function vs(s, e, t) {
|
|
1026
|
+
const o = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
1027
|
+
let i = 0;
|
|
1028
|
+
function l(c, u, m, a) {
|
|
1029
|
+
const n = t.tokenize(c);
|
|
1030
|
+
if (!n.length) return;
|
|
1031
|
+
i++;
|
|
1032
|
+
const v = /* @__PURE__ */ new Map();
|
|
1033
|
+
for (const f of n)
|
|
1034
|
+
v.set(f, (v.get(f) || 0) + 1);
|
|
1035
|
+
for (const [f, p] of v) {
|
|
1036
|
+
const y = {
|
|
1037
|
+
docIdx: u,
|
|
1038
|
+
keyIdx: m,
|
|
1039
|
+
subIdx: a,
|
|
1040
|
+
tf: p
|
|
1041
|
+
};
|
|
1042
|
+
let w = o.get(f);
|
|
1043
|
+
w || (w = [], o.set(f, w)), w.push(y), r.set(f, (r.get(f) || 0) + 1);
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
for (const c of s) {
|
|
1047
|
+
const {
|
|
1048
|
+
i: u,
|
|
1049
|
+
v: m,
|
|
1050
|
+
$: a
|
|
1051
|
+
} = c;
|
|
1052
|
+
if (m !== void 0) {
|
|
1053
|
+
l(m, u, -1, -1);
|
|
1054
|
+
continue;
|
|
1055
|
+
}
|
|
1056
|
+
if (a)
|
|
1057
|
+
for (let n = 0; n < e; n++) {
|
|
1058
|
+
const v = a[n];
|
|
1059
|
+
if (v)
|
|
1060
|
+
if (Array.isArray(v))
|
|
1061
|
+
for (const f of v)
|
|
1062
|
+
l(f.v, u, n, f.i ?? -1);
|
|
1063
|
+
else
|
|
1064
|
+
l(v.v, u, n, -1);
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
return {
|
|
1068
|
+
terms: o,
|
|
1069
|
+
fieldCount: i,
|
|
1070
|
+
df: r
|
|
1071
|
+
};
|
|
1072
|
+
}
|
|
1073
|
+
function gs(s, e, t, o) {
|
|
1074
|
+
const {
|
|
1075
|
+
i: r,
|
|
1076
|
+
v: i,
|
|
1077
|
+
$: l
|
|
1078
|
+
} = e;
|
|
1079
|
+
function c(u, m, a) {
|
|
1080
|
+
const n = o.tokenize(u);
|
|
1081
|
+
if (!n.length) return;
|
|
1082
|
+
s.fieldCount++;
|
|
1083
|
+
const v = /* @__PURE__ */ new Map();
|
|
1084
|
+
for (const f of n)
|
|
1085
|
+
v.set(f, (v.get(f) || 0) + 1);
|
|
1086
|
+
for (const [f, p] of v) {
|
|
1087
|
+
const y = {
|
|
1088
|
+
docIdx: r,
|
|
1089
|
+
keyIdx: m,
|
|
1090
|
+
subIdx: a,
|
|
1091
|
+
tf: p
|
|
1092
|
+
};
|
|
1093
|
+
let w = s.terms.get(f);
|
|
1094
|
+
w || (w = [], s.terms.set(f, w)), w.push(y), s.df.set(f, (s.df.get(f) || 0) + 1);
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
if (i !== void 0) {
|
|
1098
|
+
c(i, -1, -1);
|
|
1099
|
+
return;
|
|
1100
|
+
}
|
|
1101
|
+
if (l)
|
|
1102
|
+
for (let u = 0; u < t; u++) {
|
|
1103
|
+
const m = l[u];
|
|
1104
|
+
if (m)
|
|
1105
|
+
if (Array.isArray(m))
|
|
1106
|
+
for (const a of m)
|
|
1107
|
+
c(a.v, u, a.i ?? -1);
|
|
1108
|
+
else
|
|
1109
|
+
c(m.v, u, -1);
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
function We(s, e) {
|
|
1113
|
+
for (const [t, o] of s.terms) {
|
|
1114
|
+
const r = o.filter((l) => l.docIdx !== e), i = o.length - r.length;
|
|
1115
|
+
i > 0 && (s.fieldCount -= i, s.df.set(t, (s.df.get(t) || 0) - i), r.length === 0 ? (s.terms.delete(t), s.df.delete(t)) : s.terms.set(t, r));
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
class oe {
|
|
1119
|
+
// Statics are assigned in entry.ts
|
|
1120
|
+
constructor(e, t, o) {
|
|
1121
|
+
this.options = {
|
|
1122
|
+
...C,
|
|
1123
|
+
...t
|
|
1124
|
+
}, this.options.useExtendedSearch, this.options.useTokenSearch, this._keyStore = new Tt(this.options.keys), this._docs = e, this._myIndex = null, this._invertedIndex = null, this.setCollection(e, o), this._lastQuery = null, this._lastSearcher = null;
|
|
1125
|
+
}
|
|
1126
|
+
_getSearcher(e) {
|
|
1127
|
+
if (this._lastQuery === e)
|
|
1128
|
+
return this._lastSearcher;
|
|
1129
|
+
const t = this._invertedIndex ? {
|
|
1130
|
+
...this.options,
|
|
1131
|
+
_invertedIndex: this._invertedIndex
|
|
1132
|
+
} : this.options, o = ye(e, t);
|
|
1133
|
+
return this._lastQuery = e, this._lastSearcher = o, o;
|
|
1134
|
+
}
|
|
1135
|
+
setCollection(e, t) {
|
|
1136
|
+
if (this._docs = e, t && !(t instanceof je))
|
|
1137
|
+
throw new Error(Ft);
|
|
1138
|
+
if (this._myIndex = t || Je(this.options.keys, this._docs, {
|
|
1139
|
+
getFn: this.options.getFn,
|
|
1140
|
+
fieldNormWeight: this.options.fieldNormWeight
|
|
1141
|
+
}), this.options.useTokenSearch) {
|
|
1142
|
+
const o = Be({
|
|
1143
|
+
isCaseSensitive: this.options.isCaseSensitive,
|
|
1144
|
+
ignoreDiacritics: this.options.ignoreDiacritics
|
|
1145
|
+
});
|
|
1146
|
+
this._invertedIndex = vs(this._myIndex.records, this._myIndex.keys.length, o);
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
add(e) {
|
|
1150
|
+
if (W(e) && (this._docs.push(e), this._myIndex.add(e), this._invertedIndex)) {
|
|
1151
|
+
const t = this._myIndex.records[this._myIndex.records.length - 1], o = Be({
|
|
1152
|
+
isCaseSensitive: this.options.isCaseSensitive,
|
|
1153
|
+
ignoreDiacritics: this.options.ignoreDiacritics
|
|
1154
|
+
});
|
|
1155
|
+
gs(this._invertedIndex, t, this._myIndex.keys.length, o);
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
remove(e = () => !1) {
|
|
1159
|
+
const t = [], o = [];
|
|
1160
|
+
for (let r = 0, i = this._docs.length; r < i; r += 1)
|
|
1161
|
+
e(this._docs[r], r) && (t.push(this._docs[r]), o.push(r));
|
|
1162
|
+
if (o.length) {
|
|
1163
|
+
if (this._invertedIndex)
|
|
1164
|
+
for (const r of o)
|
|
1165
|
+
We(this._invertedIndex, r);
|
|
1166
|
+
for (let r = o.length - 1; r >= 0; r -= 1)
|
|
1167
|
+
this._docs.splice(o[r], 1);
|
|
1168
|
+
this._myIndex.removeAll(o);
|
|
1169
|
+
}
|
|
1170
|
+
return t;
|
|
1171
|
+
}
|
|
1172
|
+
removeAt(e) {
|
|
1173
|
+
this._invertedIndex && We(this._invertedIndex, e);
|
|
1174
|
+
const t = this._docs.splice(e, 1)[0];
|
|
1175
|
+
return this._myIndex.removeAt(e), t;
|
|
1176
|
+
}
|
|
1177
|
+
getIndex() {
|
|
1178
|
+
return this._myIndex;
|
|
1179
|
+
}
|
|
1180
|
+
search(e, t) {
|
|
1181
|
+
const {
|
|
1182
|
+
limit: o = -1
|
|
1183
|
+
} = t || {}, {
|
|
1184
|
+
includeMatches: r,
|
|
1185
|
+
includeScore: i,
|
|
1186
|
+
shouldSort: l,
|
|
1187
|
+
sortFn: c,
|
|
1188
|
+
ignoreFieldNorm: u
|
|
1189
|
+
} = this.options;
|
|
1190
|
+
if (V(e) && !e.trim()) {
|
|
1191
|
+
let n = this._docs.map((v, f) => ({
|
|
1192
|
+
item: v,
|
|
1193
|
+
refIndex: f
|
|
1194
|
+
}));
|
|
1195
|
+
return _e(o) && o > -1 && (n = n.slice(0, o)), n;
|
|
1196
|
+
}
|
|
1197
|
+
const m = _e(o) && o > 0 && V(e);
|
|
1198
|
+
let a;
|
|
1199
|
+
if (m) {
|
|
1200
|
+
const n = new ds(o);
|
|
1201
|
+
V(this._docs[0]) ? this._searchStringList(e, {
|
|
1202
|
+
heap: n,
|
|
1203
|
+
ignoreFieldNorm: u
|
|
1204
|
+
}) : this._searchObjectList(e, {
|
|
1205
|
+
heap: n,
|
|
1206
|
+
ignoreFieldNorm: u
|
|
1207
|
+
}), a = n.extractSorted(c);
|
|
1208
|
+
} else
|
|
1209
|
+
a = V(e) ? V(this._docs[0]) ? this._searchStringList(e) : this._searchObjectList(e) : this._searchLogical(e), cs(a, {
|
|
1210
|
+
ignoreFieldNorm: u
|
|
1211
|
+
}), l && a.sort(c), _e(o) && o > -1 && (a = a.slice(0, o));
|
|
1212
|
+
return ms(a, this._docs, {
|
|
1213
|
+
includeMatches: r,
|
|
1214
|
+
includeScore: i
|
|
1215
|
+
});
|
|
1216
|
+
}
|
|
1217
|
+
_searchStringList(e, {
|
|
1218
|
+
heap: t,
|
|
1219
|
+
ignoreFieldNorm: o
|
|
1220
|
+
} = {}) {
|
|
1221
|
+
const r = this._getSearcher(e), {
|
|
1222
|
+
records: i
|
|
1223
|
+
} = this._myIndex, l = t ? null : [];
|
|
1224
|
+
return i.forEach(({
|
|
1225
|
+
v: c,
|
|
1226
|
+
i: u,
|
|
1227
|
+
n: m
|
|
1228
|
+
}) => {
|
|
1229
|
+
if (!W(c))
|
|
1230
|
+
return;
|
|
1231
|
+
const {
|
|
1232
|
+
isMatch: a,
|
|
1233
|
+
score: n,
|
|
1234
|
+
indices: v
|
|
1235
|
+
} = r.searchIn(c);
|
|
1236
|
+
if (a) {
|
|
1237
|
+
const f = {
|
|
1238
|
+
item: c,
|
|
1239
|
+
idx: u,
|
|
1240
|
+
matches: [{
|
|
1241
|
+
score: n,
|
|
1242
|
+
value: c,
|
|
1243
|
+
norm: m,
|
|
1244
|
+
indices: v
|
|
1245
|
+
}]
|
|
1246
|
+
};
|
|
1247
|
+
t ? (f.score = Fe(f.matches, {
|
|
1248
|
+
ignoreFieldNorm: o
|
|
1249
|
+
}), t.shouldInsert(f.score) && t.insert(f)) : l.push(f);
|
|
1250
|
+
}
|
|
1251
|
+
}), l;
|
|
1252
|
+
}
|
|
1253
|
+
_searchLogical(e) {
|
|
1254
|
+
const t = tt(e, this.options), o = (c, u, m) => {
|
|
1255
|
+
if (!("children" in c)) {
|
|
1256
|
+
const {
|
|
1257
|
+
keyId: f,
|
|
1258
|
+
searcher: p
|
|
1259
|
+
} = c;
|
|
1260
|
+
let y;
|
|
1261
|
+
return f === null ? (y = [], this._myIndex.keys.forEach((w, j) => {
|
|
1262
|
+
y.push(...this._findMatches({
|
|
1263
|
+
key: w,
|
|
1264
|
+
value: u[j],
|
|
1265
|
+
searcher: p
|
|
1266
|
+
}));
|
|
1267
|
+
})) : y = this._findMatches({
|
|
1268
|
+
key: this._keyStore.get(f),
|
|
1269
|
+
value: this._myIndex.getValueForItemAtKeyId(u, f),
|
|
1270
|
+
searcher: p
|
|
1271
|
+
}), y && y.length ? [{
|
|
1272
|
+
idx: m,
|
|
1273
|
+
item: u,
|
|
1274
|
+
matches: y
|
|
1275
|
+
}] : [];
|
|
1276
|
+
}
|
|
1277
|
+
const {
|
|
1278
|
+
children: a,
|
|
1279
|
+
operator: n
|
|
1280
|
+
} = c, v = [];
|
|
1281
|
+
for (let f = 0, p = a.length; f < p; f += 1) {
|
|
1282
|
+
const y = a[f], w = o(y, u, m);
|
|
1283
|
+
if (w.length)
|
|
1284
|
+
v.push(...w);
|
|
1285
|
+
else if (n === xe.AND)
|
|
1286
|
+
return [];
|
|
1287
|
+
}
|
|
1288
|
+
return v;
|
|
1289
|
+
}, r = this._myIndex.records, i = /* @__PURE__ */ new Map(), l = [];
|
|
1290
|
+
return r.forEach(({
|
|
1291
|
+
$: c,
|
|
1292
|
+
i: u
|
|
1293
|
+
}) => {
|
|
1294
|
+
if (W(c)) {
|
|
1295
|
+
const m = o(t, c, u);
|
|
1296
|
+
m.length && (i.has(u) || (i.set(u, {
|
|
1297
|
+
idx: u,
|
|
1298
|
+
item: c,
|
|
1299
|
+
matches: []
|
|
1300
|
+
}), l.push(i.get(u))), m.forEach(({
|
|
1301
|
+
matches: a
|
|
1302
|
+
}) => {
|
|
1303
|
+
i.get(u).matches.push(...a);
|
|
1304
|
+
}));
|
|
1305
|
+
}
|
|
1306
|
+
}), l;
|
|
1307
|
+
}
|
|
1308
|
+
// When a search involves inverse patterns (e.g. !Syrup), the aggregation
|
|
1309
|
+
// across keys switches from "ANY key matches" to "ALL keys must match."
|
|
1310
|
+
// This is signaled by hasInverse on the SearchResult from ExtendedSearch.
|
|
1311
|
+
//
|
|
1312
|
+
// For mixed patterns like "^hello !Syrup", a key failure is ambiguous —
|
|
1313
|
+
// it could be the positive or inverse term that failed. In that case we
|
|
1314
|
+
// conservatively exclude the item, which is strictly better than the old
|
|
1315
|
+
// behavior of including it. See: https://github.com/krisk/Fuse/issues/712
|
|
1316
|
+
_searchObjectList(e, {
|
|
1317
|
+
heap: t,
|
|
1318
|
+
ignoreFieldNorm: o
|
|
1319
|
+
} = {}) {
|
|
1320
|
+
const r = this._getSearcher(e), {
|
|
1321
|
+
keys: i,
|
|
1322
|
+
records: l
|
|
1323
|
+
} = this._myIndex, c = t ? null : [];
|
|
1324
|
+
return l.forEach(({
|
|
1325
|
+
$: u,
|
|
1326
|
+
i: m
|
|
1327
|
+
}) => {
|
|
1328
|
+
if (!W(u))
|
|
1329
|
+
return;
|
|
1330
|
+
const a = [];
|
|
1331
|
+
let n = !1, v = !1;
|
|
1332
|
+
if (i.forEach((f, p) => {
|
|
1333
|
+
const y = this._findMatches({
|
|
1334
|
+
key: f,
|
|
1335
|
+
value: u[p],
|
|
1336
|
+
searcher: r
|
|
1337
|
+
});
|
|
1338
|
+
y.length ? (a.push(...y), y[0].hasInverse && (v = !0)) : n = !0;
|
|
1339
|
+
}), !(v && n) && a.length) {
|
|
1340
|
+
const f = {
|
|
1341
|
+
idx: m,
|
|
1342
|
+
item: u,
|
|
1343
|
+
matches: a
|
|
1344
|
+
};
|
|
1345
|
+
t ? (f.score = Fe(f.matches, {
|
|
1346
|
+
ignoreFieldNorm: o
|
|
1347
|
+
}), t.shouldInsert(f.score) && t.insert(f)) : c.push(f);
|
|
1348
|
+
}
|
|
1349
|
+
}), c;
|
|
1350
|
+
}
|
|
1351
|
+
_findMatches({
|
|
1352
|
+
key: e,
|
|
1353
|
+
value: t,
|
|
1354
|
+
searcher: o
|
|
1355
|
+
}) {
|
|
1356
|
+
if (!W(t))
|
|
1357
|
+
return [];
|
|
1358
|
+
const r = [];
|
|
1359
|
+
if (ee(t))
|
|
1360
|
+
t.forEach(({
|
|
1361
|
+
v: i,
|
|
1362
|
+
i: l,
|
|
1363
|
+
n: c
|
|
1364
|
+
}) => {
|
|
1365
|
+
if (!W(i))
|
|
1366
|
+
return;
|
|
1367
|
+
const {
|
|
1368
|
+
isMatch: u,
|
|
1369
|
+
score: m,
|
|
1370
|
+
indices: a,
|
|
1371
|
+
hasInverse: n
|
|
1372
|
+
} = o.searchIn(i);
|
|
1373
|
+
u && r.push({
|
|
1374
|
+
score: m,
|
|
1375
|
+
key: e,
|
|
1376
|
+
value: i,
|
|
1377
|
+
idx: l,
|
|
1378
|
+
norm: c,
|
|
1379
|
+
indices: a,
|
|
1380
|
+
hasInverse: n
|
|
1381
|
+
});
|
|
1382
|
+
});
|
|
1383
|
+
else {
|
|
1384
|
+
const {
|
|
1385
|
+
v: i,
|
|
1386
|
+
n: l
|
|
1387
|
+
} = t, {
|
|
1388
|
+
isMatch: c,
|
|
1389
|
+
score: u,
|
|
1390
|
+
indices: m,
|
|
1391
|
+
hasInverse: a
|
|
1392
|
+
} = o.searchIn(i);
|
|
1393
|
+
c && r.push({
|
|
1394
|
+
score: u,
|
|
1395
|
+
key: e,
|
|
1396
|
+
value: i,
|
|
1397
|
+
norm: l,
|
|
1398
|
+
indices: m,
|
|
1399
|
+
hasInverse: a
|
|
1400
|
+
});
|
|
1401
|
+
}
|
|
1402
|
+
return r;
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
class _s {
|
|
1406
|
+
static condition(e, t) {
|
|
1407
|
+
return t.useTokenSearch;
|
|
1408
|
+
}
|
|
1409
|
+
constructor(e, t) {
|
|
1410
|
+
this.options = t, this.analyzer = Be({
|
|
1411
|
+
isCaseSensitive: t.isCaseSensitive,
|
|
1412
|
+
ignoreDiacritics: t.ignoreDiacritics
|
|
1413
|
+
});
|
|
1414
|
+
const o = this.analyzer.tokenize(e), r = t._invertedIndex, {
|
|
1415
|
+
df: i,
|
|
1416
|
+
fieldCount: l
|
|
1417
|
+
} = r;
|
|
1418
|
+
this.termSearchers = [], this.idfWeights = [];
|
|
1419
|
+
for (const c of o) {
|
|
1420
|
+
this.termSearchers.push(new Te(c, {
|
|
1421
|
+
location: t.location,
|
|
1422
|
+
threshold: t.threshold,
|
|
1423
|
+
distance: t.distance,
|
|
1424
|
+
includeMatches: t.includeMatches,
|
|
1425
|
+
findAllMatches: t.findAllMatches,
|
|
1426
|
+
minMatchCharLength: t.minMatchCharLength,
|
|
1427
|
+
isCaseSensitive: t.isCaseSensitive,
|
|
1428
|
+
ignoreDiacritics: t.ignoreDiacritics,
|
|
1429
|
+
ignoreLocation: !0
|
|
1430
|
+
}));
|
|
1431
|
+
const u = i.get(c) || 0, m = Math.log(1 + (l - u + 0.5) / (u + 0.5));
|
|
1432
|
+
this.idfWeights.push(m);
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
searchIn(e) {
|
|
1436
|
+
if (!this.termSearchers.length)
|
|
1437
|
+
return {
|
|
1438
|
+
isMatch: !1,
|
|
1439
|
+
score: 1
|
|
1440
|
+
};
|
|
1441
|
+
const t = [];
|
|
1442
|
+
let o = 0, r = 0, i = 0;
|
|
1443
|
+
for (let u = 0; u < this.termSearchers.length; u++) {
|
|
1444
|
+
const m = this.termSearchers[u].searchIn(e), a = this.idfWeights[u];
|
|
1445
|
+
r += a, m.isMatch && (i++, o += a * (1 - m.score), m.indices && t.push(...m.indices));
|
|
1446
|
+
}
|
|
1447
|
+
if (i === 0)
|
|
1448
|
+
return {
|
|
1449
|
+
isMatch: !1,
|
|
1450
|
+
score: 1
|
|
1451
|
+
};
|
|
1452
|
+
const l = r > 0 ? 1 - o / r : 0, c = {
|
|
1453
|
+
isMatch: !0,
|
|
1454
|
+
score: Math.max(1e-3, l)
|
|
1455
|
+
};
|
|
1456
|
+
return this.options.includeMatches && t.length && (c.indices = Oe(t)), c;
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
oe.version = "7.3.0";
|
|
1460
|
+
oe.createIndex = Je;
|
|
1461
|
+
oe.parseIndex = Wt;
|
|
1462
|
+
oe.config = C;
|
|
1463
|
+
oe.match = function(s, e, t) {
|
|
1464
|
+
return ye(s, {
|
|
1465
|
+
...C,
|
|
1466
|
+
...t
|
|
1467
|
+
}).searchIn(e);
|
|
1468
|
+
};
|
|
1469
|
+
oe.parseQuery = tt;
|
|
1470
|
+
Le(is);
|
|
1471
|
+
Le(_s);
|
|
1472
|
+
oe.use = function(...s) {
|
|
1473
|
+
s.forEach((e) => Le(e));
|
|
1474
|
+
};
|
|
1475
|
+
const se = (s) => s == null ? "—" : `€${s.toFixed(2)}`, ys = (s) => {
|
|
1476
|
+
if (!s) return "—";
|
|
1477
|
+
if (s < 60) return `${s} min`;
|
|
1478
|
+
const e = Math.floor(s / 60), t = s % 60;
|
|
1479
|
+
return t > 0 ? `${e}h ${t}min` : `${e}h`;
|
|
1480
|
+
}, xs = (s) => {
|
|
1481
|
+
switch (s) {
|
|
1482
|
+
case "confirmed":
|
|
1483
|
+
return "Confirmed";
|
|
1484
|
+
case "pending":
|
|
1485
|
+
return "Pending";
|
|
1486
|
+
case "cancelled":
|
|
1487
|
+
return "Cancelled";
|
|
1488
|
+
default:
|
|
1489
|
+
return s || "Unknown";
|
|
1490
|
+
}
|
|
1491
|
+
}, Ke = (s) => {
|
|
1492
|
+
switch (s) {
|
|
1493
|
+
case "confirmed":
|
|
1494
|
+
return "#16a34a";
|
|
1495
|
+
// green-600
|
|
1496
|
+
case "pending":
|
|
1497
|
+
return "#ca8a04";
|
|
1498
|
+
// yellow-600
|
|
1499
|
+
case "cancelled":
|
|
1500
|
+
return "#dc2626";
|
|
1501
|
+
// red-600
|
|
1502
|
+
default:
|
|
1503
|
+
return "#6b7280";
|
|
1504
|
+
}
|
|
1505
|
+
}, bs = (s, e = {}) => {
|
|
1506
|
+
const t = `${s.customerInfo?.firstName || ""} ${s.customerInfo?.lastName || ""}`.trim() || "Unknown Customer", o = s.id?.slice(0, 8) || "—", r = (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", {
|
|
1507
|
+
year: "numeric",
|
|
1508
|
+
month: "long",
|
|
1509
|
+
day: "numeric"
|
|
1510
|
+
}), i = `
|
|
1511
|
+
<!DOCTYPE html>
|
|
1512
|
+
<html lang="en">
|
|
1513
|
+
<head>
|
|
1514
|
+
<meta charset="UTF-8">
|
|
1515
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
1516
|
+
<title>Reservation ${o}</title>
|
|
1517
|
+
<style>
|
|
1518
|
+
* {
|
|
1519
|
+
margin: 0;
|
|
1520
|
+
padding: 0;
|
|
1521
|
+
box-sizing: border-box;
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
body {
|
|
1525
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
1526
|
+
line-height: 1.6;
|
|
1527
|
+
color: #1f2937;
|
|
1528
|
+
background: #fff;
|
|
1529
|
+
padding: 40px;
|
|
1530
|
+
max-width: 800px;
|
|
1531
|
+
margin: 0 auto;
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
.header {
|
|
1535
|
+
display: flex;
|
|
1536
|
+
justify-content: space-between;
|
|
1537
|
+
align-items: flex-start;
|
|
1538
|
+
margin-bottom: 40px;
|
|
1539
|
+
padding-bottom: 20px;
|
|
1540
|
+
border-bottom: 2px solid #e5e7eb;
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
.company-info {
|
|
1544
|
+
display: flex;
|
|
1545
|
+
align-items: center;
|
|
1546
|
+
gap: 16px;
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
.company-logo {
|
|
1550
|
+
max-height: 50px;
|
|
1551
|
+
max-width: 150px;
|
|
1552
|
+
object-fit: contain;
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
.company-name {
|
|
1556
|
+
font-size: 24px;
|
|
1557
|
+
font-weight: 700;
|
|
1558
|
+
color: #111827;
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1561
|
+
.document-info {
|
|
1562
|
+
text-align: right;
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
.document-title {
|
|
1566
|
+
font-size: 28px;
|
|
1567
|
+
font-weight: 700;
|
|
1568
|
+
color: #111827;
|
|
1569
|
+
margin-bottom: 8px;
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
.booking-id {
|
|
1573
|
+
font-size: 14px;
|
|
1574
|
+
color: #6b7280;
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
.status-badge {
|
|
1578
|
+
display: inline-block;
|
|
1579
|
+
padding: 4px 12px;
|
|
1580
|
+
border-radius: 9999px;
|
|
1581
|
+
font-size: 12px;
|
|
1582
|
+
font-weight: 600;
|
|
1583
|
+
text-transform: uppercase;
|
|
1584
|
+
margin-top: 8px;
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1587
|
+
.section {
|
|
1588
|
+
margin-bottom: 32px;
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
.section-title {
|
|
1592
|
+
font-size: 12px;
|
|
1593
|
+
font-weight: 600;
|
|
1594
|
+
text-transform: uppercase;
|
|
1595
|
+
letter-spacing: 0.05em;
|
|
1596
|
+
color: #6b7280;
|
|
1597
|
+
margin-bottom: 12px;
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
.section-content {
|
|
1601
|
+
background: #f9fafb;
|
|
1602
|
+
border-radius: 8px;
|
|
1603
|
+
padding: 20px;
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
.customer-name {
|
|
1607
|
+
font-size: 18px;
|
|
1608
|
+
font-weight: 600;
|
|
1609
|
+
margin-bottom: 8px;
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1612
|
+
.contact-info {
|
|
1613
|
+
font-size: 14px;
|
|
1614
|
+
color: #4b5563;
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
.contact-info a {
|
|
1618
|
+
color: #4b5563;
|
|
1619
|
+
text-decoration: none;
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
.grid {
|
|
1623
|
+
display: grid;
|
|
1624
|
+
grid-template-columns: 1fr 1fr;
|
|
1625
|
+
gap: 16px;
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1628
|
+
.info-card {
|
|
1629
|
+
background: #f9fafb;
|
|
1630
|
+
border-radius: 8px;
|
|
1631
|
+
padding: 16px;
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
.info-label {
|
|
1635
|
+
font-size: 12px;
|
|
1636
|
+
color: #6b7280;
|
|
1637
|
+
margin-bottom: 4px;
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
.info-value {
|
|
1641
|
+
font-size: 16px;
|
|
1642
|
+
font-weight: 600;
|
|
1643
|
+
}
|
|
1644
|
+
|
|
1645
|
+
.package-row {
|
|
1646
|
+
display: flex;
|
|
1647
|
+
justify-content: space-between;
|
|
1648
|
+
align-items: flex-start;
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
.package-name {
|
|
1652
|
+
font-size: 16px;
|
|
1653
|
+
font-weight: 600;
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
.package-duration {
|
|
1657
|
+
font-size: 14px;
|
|
1658
|
+
color: #6b7280;
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
.package-price {
|
|
1662
|
+
font-size: 16px;
|
|
1663
|
+
font-weight: 600;
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
.payment-row {
|
|
1667
|
+
display: flex;
|
|
1668
|
+
justify-content: space-between;
|
|
1669
|
+
padding: 8px 0;
|
|
1670
|
+
font-size: 14px;
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1673
|
+
.payment-label {
|
|
1674
|
+
color: #6b7280;
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
.payment-value {
|
|
1678
|
+
font-weight: 500;
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
.payment-value.green {
|
|
1682
|
+
color: #16a34a;
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
.payment-value.orange {
|
|
1686
|
+
color: #ea580c;
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
.payment-divider {
|
|
1690
|
+
border-top: 1px solid #e5e7eb;
|
|
1691
|
+
margin: 12px 0;
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
.payment-total {
|
|
1695
|
+
font-size: 16px;
|
|
1696
|
+
font-weight: 600;
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
.footer {
|
|
1700
|
+
margin-top: 60px;
|
|
1701
|
+
padding-top: 20px;
|
|
1702
|
+
border-top: 1px solid #e5e7eb;
|
|
1703
|
+
text-align: center;
|
|
1704
|
+
font-size: 12px;
|
|
1705
|
+
color: #9ca3af;
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1708
|
+
@media print {
|
|
1709
|
+
body {
|
|
1710
|
+
padding: 20px;
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
.no-print {
|
|
1714
|
+
display: none;
|
|
1715
|
+
}
|
|
1716
|
+
}
|
|
1717
|
+
</style>
|
|
1718
|
+
</head>
|
|
1719
|
+
<body>
|
|
1720
|
+
<div class="header">
|
|
1721
|
+
<div class="company-info">
|
|
1722
|
+
${e.companyLogo ? `<img src="${e.companyLogo}" alt="Logo" class="company-logo" />` : ""}
|
|
1723
|
+
${e.companyName ? `<span class="company-name">${e.companyName}</span>` : ""}
|
|
1724
|
+
</div>
|
|
1725
|
+
<div class="document-info">
|
|
1726
|
+
<div class="document-title">Reservation</div>
|
|
1727
|
+
<div class="booking-id">Booking #${o}</div>
|
|
1728
|
+
<div
|
|
1729
|
+
class="status-badge"
|
|
1730
|
+
style="background-color: ${Ke(s.status)}20; color: ${Ke(s.status)};"
|
|
1731
|
+
>
|
|
1732
|
+
${xs(s.status)}
|
|
1733
|
+
</div>
|
|
1734
|
+
</div>
|
|
1735
|
+
</div>
|
|
1736
|
+
|
|
1737
|
+
<div class="section">
|
|
1738
|
+
<div class="section-title">Customer</div>
|
|
1739
|
+
<div class="section-content">
|
|
1740
|
+
<div class="customer-name">${t}</div>
|
|
1741
|
+
<div class="contact-info">
|
|
1742
|
+
${s.customerInfo?.email ? `<div>Email: <a href="mailto:${s.customerInfo.email}">${s.customerInfo.email}</a></div>` : ""}
|
|
1743
|
+
${s.customerInfo?.phone ? `<div>Phone: <a href="tel:${s.customerInfo.phone}">${s.customerInfo.phone}</a></div>` : ""}
|
|
1744
|
+
</div>
|
|
1745
|
+
</div>
|
|
1746
|
+
</div>
|
|
1747
|
+
|
|
1748
|
+
<div class="section">
|
|
1749
|
+
<div class="section-title">Reservation Details</div>
|
|
1750
|
+
<div class="grid">
|
|
1751
|
+
<div class="info-card">
|
|
1752
|
+
<div class="info-label">Date</div>
|
|
1753
|
+
<div class="info-value">${e.date || "—"}</div>
|
|
1754
|
+
</div>
|
|
1755
|
+
<div class="info-card">
|
|
1756
|
+
<div class="info-label">Time</div>
|
|
1757
|
+
<div class="info-value">${s.startTime} - ${s.endTime}</div>
|
|
1758
|
+
</div>
|
|
1759
|
+
<div class="info-card">
|
|
1760
|
+
<div class="info-label">Spots</div>
|
|
1761
|
+
<div class="info-value">${s.spots || 1} ${(s.spots || 1) === 1 ? "person" : "people"}</div>
|
|
1762
|
+
</div>
|
|
1763
|
+
${e.resourceName ? `
|
|
1764
|
+
<div class="info-card">
|
|
1765
|
+
<div class="info-label">Resource</div>
|
|
1766
|
+
<div class="info-value">${e.resourceName}</div>
|
|
1767
|
+
</div>
|
|
1768
|
+
` : ""}
|
|
1769
|
+
${e.agendaName ? `
|
|
1770
|
+
<div class="info-card">
|
|
1771
|
+
<div class="info-label">Service</div>
|
|
1772
|
+
<div class="info-value">${e.agendaName}</div>
|
|
1773
|
+
</div>
|
|
1774
|
+
` : ""}
|
|
1775
|
+
</div>
|
|
1776
|
+
</div>
|
|
1777
|
+
|
|
1778
|
+
${s.pricingOption ? `
|
|
1779
|
+
<div class="section">
|
|
1780
|
+
<div class="section-title">Package</div>
|
|
1781
|
+
<div class="section-content">
|
|
1782
|
+
<div class="package-row">
|
|
1783
|
+
<div>
|
|
1784
|
+
<div class="package-name">${s.pricingOption.name}</div>
|
|
1785
|
+
<div class="package-duration">${ys(s.pricingOption.duration)}</div>
|
|
1786
|
+
</div>
|
|
1787
|
+
<div class="package-price">${se(s.pricingOption.price)}</div>
|
|
1788
|
+
</div>
|
|
1789
|
+
</div>
|
|
1790
|
+
</div>
|
|
1791
|
+
` : ""}
|
|
1792
|
+
|
|
1793
|
+
<div class="section">
|
|
1794
|
+
<div class="section-title">Payment Summary</div>
|
|
1795
|
+
<div class="section-content">
|
|
1796
|
+
<div class="payment-row">
|
|
1797
|
+
<span class="payment-label">Base price</span>
|
|
1798
|
+
<span class="payment-value">${se(s.reservationBasePrice)}</span>
|
|
1799
|
+
</div>
|
|
1800
|
+
${s.reservationAddOnsPrice ? `
|
|
1801
|
+
<div class="payment-row">
|
|
1802
|
+
<span class="payment-label">Add-ons</span>
|
|
1803
|
+
<span class="payment-value">${se(s.reservationAddOnsPrice)}</span>
|
|
1804
|
+
</div>
|
|
1805
|
+
` : ""}
|
|
1806
|
+
${s.discount ? `
|
|
1807
|
+
<div class="payment-row">
|
|
1808
|
+
<span class="payment-label">Discount</span>
|
|
1809
|
+
<span class="payment-value green">-${se(s.discount)}</span>
|
|
1810
|
+
</div>
|
|
1811
|
+
` : ""}
|
|
1812
|
+
|
|
1813
|
+
<div class="payment-divider"></div>
|
|
1814
|
+
|
|
1815
|
+
<div class="payment-row payment-total">
|
|
1816
|
+
<span>Reservation Total</span>
|
|
1817
|
+
<span>${se(s.reservationPrice)}</span>
|
|
1818
|
+
</div>
|
|
1819
|
+
|
|
1820
|
+
${s.amountPaid !== void 0 || s.amountDue !== void 0 ? `
|
|
1821
|
+
<div class="payment-divider"></div>
|
|
1822
|
+
|
|
1823
|
+
${s.amountPaid !== void 0 ? `
|
|
1824
|
+
<div class="payment-row">
|
|
1825
|
+
<span class="payment-label">Amount paid</span>
|
|
1826
|
+
<span class="payment-value green">${se(s.amountPaid)}</span>
|
|
1827
|
+
</div>
|
|
1828
|
+
` : ""}
|
|
1829
|
+
|
|
1830
|
+
${s.amountDue !== void 0 && s.amountDue > 0 ? `
|
|
1831
|
+
<div class="payment-row">
|
|
1832
|
+
<span class="payment-label">Amount due</span>
|
|
1833
|
+
<span class="payment-value orange">${se(s.amountDue)}</span>
|
|
1834
|
+
</div>
|
|
1835
|
+
` : ""}
|
|
1836
|
+
` : ""}
|
|
1837
|
+
</div>
|
|
1838
|
+
</div>
|
|
1839
|
+
|
|
1840
|
+
<div class="footer">
|
|
1841
|
+
<p>Generated on ${r}</p>
|
|
1842
|
+
${e.companyName ? `<p>${e.companyName}</p>` : ""}
|
|
1843
|
+
</div>
|
|
1844
|
+
</body>
|
|
1845
|
+
</html>
|
|
1846
|
+
`, l = window.open("", "_blank");
|
|
1847
|
+
l && (l.document.write(i), l.document.close(), l.onload = () => {
|
|
1848
|
+
l.print();
|
|
1849
|
+
});
|
|
1850
|
+
}, Ds = { class: "flex items-center bg-muted/70 dark:bg-muted/20 px-4 rounded-md" }, Cs = { class: "grid gap-2" }, ks = { class: "grid gap-2" }, As = { class: "grid gap-2" }, ws = /* @__PURE__ */ le({
|
|
1851
|
+
__name: "CancelReservationDialog",
|
|
1852
|
+
emits: ["confirm"],
|
|
1853
|
+
setup(s, { expose: e, emit: t }) {
|
|
1854
|
+
const { config: o } = be(), { sendMail: r } = Re(o.mailAccount), i = t, l = R(!1), c = R(!1), u = R(""), m = R(""), a = R(""), n = (f) => {
|
|
1855
|
+
c.value = !o.mailAccount, l.value = !0, f && (u.value = f.customerInfo?.email, m.value = "Cancellation of your reservation - " + new Date(f.date)?.toDateString(), a.value = `Dear ${f.customerInfo?.firstName ?? ""} ${f.customerInfo?.lastName ?? ""},
|
|
1856
|
+
|
|
1857
|
+
We are writing to inform you that your reservation scheduled for ${new Date(f.date)?.toDateString()} at ${f.startTime} has been cancelled.
|
|
1858
|
+
|
|
1859
|
+
Please accept our sincere apologies for any inconvenience this may cause. We would be happy to help you find an alternative time that works for you.`);
|
|
1860
|
+
}, v = () => {
|
|
1861
|
+
if (!c.value) {
|
|
1862
|
+
if (!u.value || !m.value || !a.value) return alert("Please fill in all the fields.");
|
|
1863
|
+
r({
|
|
1864
|
+
to: u.value,
|
|
1865
|
+
subject: m.value,
|
|
1866
|
+
body: a.value
|
|
1867
|
+
});
|
|
1868
|
+
}
|
|
1869
|
+
l.value = !1;
|
|
1870
|
+
const { $confetti: f } = useNuxtApp();
|
|
1871
|
+
f(), i("confirm");
|
|
1872
|
+
};
|
|
1873
|
+
return e({
|
|
1874
|
+
openDialog: n
|
|
1875
|
+
}), (f, p) => {
|
|
1876
|
+
const y = x("DialogTitle"), w = x("DialogDescription"), j = x("DialogHeader"), T = x("Checkbox"), S = x("Label"), F = x("Input"), N = x("Textarea"), O = x("Button"), U = x("DialogFooter"), B = x("DialogScrollContent"), L = x("Dialog");
|
|
1877
|
+
return D(), G(L, {
|
|
1878
|
+
open: l.value,
|
|
1879
|
+
"onUpdate:open": p[5] || (p[5] = (b) => l.value = b)
|
|
1880
|
+
}, {
|
|
1881
|
+
default: g(() => [
|
|
1882
|
+
d(B, { class: "sm:max-w-3xl" }, {
|
|
1883
|
+
default: g(() => [
|
|
1884
|
+
d(j, null, {
|
|
1885
|
+
default: g(() => [
|
|
1886
|
+
d(y, null, {
|
|
1887
|
+
default: g(() => [...p[6] || (p[6] = [
|
|
1888
|
+
k(" Cancel Reservation ", -1)
|
|
1889
|
+
])]),
|
|
1890
|
+
_: 1
|
|
1891
|
+
}),
|
|
1892
|
+
d(w)
|
|
1893
|
+
]),
|
|
1894
|
+
_: 1
|
|
1895
|
+
}),
|
|
1896
|
+
h("div", Ds, [
|
|
1897
|
+
d(T, {
|
|
1898
|
+
modelValue: c.value,
|
|
1899
|
+
"onUpdate:modelValue": p[0] || (p[0] = (b) => c.value = b),
|
|
1900
|
+
id: "cancel-dialog-skip-mail",
|
|
1901
|
+
class: "border-black/80 dark:border-gray-200",
|
|
1902
|
+
disabled: !$(o).mailAccount
|
|
1903
|
+
}, null, 8, ["modelValue", "disabled"]),
|
|
1904
|
+
d(S, {
|
|
1905
|
+
for: "cancel-dialog-skip-mail",
|
|
1906
|
+
class: "py-4 pl-2 pr-4"
|
|
1907
|
+
}, {
|
|
1908
|
+
default: g(() => [...p[7] || (p[7] = [
|
|
1909
|
+
k("Do not send email to customer", -1)
|
|
1910
|
+
])]),
|
|
1911
|
+
_: 1
|
|
1912
|
+
})
|
|
1913
|
+
]),
|
|
1914
|
+
h("div", {
|
|
1915
|
+
class: Q(["grid gap-4 py-4", { "opacity-50": c.value }])
|
|
1916
|
+
}, [
|
|
1917
|
+
h("div", Cs, [
|
|
1918
|
+
d(S, { for: "cancel-dialog-email" }, {
|
|
1919
|
+
default: g(() => [...p[8] || (p[8] = [
|
|
1920
|
+
k("To:", -1)
|
|
1921
|
+
])]),
|
|
1922
|
+
_: 1
|
|
1923
|
+
}),
|
|
1924
|
+
d(F, {
|
|
1925
|
+
modelValue: u.value,
|
|
1926
|
+
"onUpdate:modelValue": p[1] || (p[1] = (b) => u.value = b),
|
|
1927
|
+
disabled: c.value,
|
|
1928
|
+
id: "cancel-dialog-email"
|
|
1929
|
+
}, null, 8, ["modelValue", "disabled"])
|
|
1930
|
+
]),
|
|
1931
|
+
h("div", ks, [
|
|
1932
|
+
d(S, { for: "cancel-dialog-subject" }, {
|
|
1933
|
+
default: g(() => [...p[9] || (p[9] = [
|
|
1934
|
+
k("Subject:", -1)
|
|
1935
|
+
])]),
|
|
1936
|
+
_: 1
|
|
1937
|
+
}),
|
|
1938
|
+
d(F, {
|
|
1939
|
+
modelValue: m.value,
|
|
1940
|
+
"onUpdate:modelValue": p[2] || (p[2] = (b) => m.value = b),
|
|
1941
|
+
disabled: c.value,
|
|
1942
|
+
id: "cancel-dialog-subject"
|
|
1943
|
+
}, null, 8, ["modelValue", "disabled"])
|
|
1944
|
+
]),
|
|
1945
|
+
h("div", As, [
|
|
1946
|
+
d(S, { for: "cancel-dialog-body" }, {
|
|
1947
|
+
default: g(() => [...p[10] || (p[10] = [
|
|
1948
|
+
k("Body:", -1)
|
|
1949
|
+
])]),
|
|
1950
|
+
_: 1
|
|
1951
|
+
}),
|
|
1952
|
+
d(N, {
|
|
1953
|
+
modelValue: a.value,
|
|
1954
|
+
"onUpdate:modelValue": p[3] || (p[3] = (b) => a.value = b),
|
|
1955
|
+
disabled: c.value,
|
|
1956
|
+
id: "cancel-dialog-body"
|
|
1957
|
+
}, null, 8, ["modelValue", "disabled"])
|
|
1958
|
+
])
|
|
1959
|
+
], 2),
|
|
1960
|
+
d(U, null, {
|
|
1961
|
+
default: g(() => [
|
|
1962
|
+
d(O, {
|
|
1963
|
+
variant: "outline",
|
|
1964
|
+
onClick: p[4] || (p[4] = (b) => l.value = !1)
|
|
1965
|
+
}, {
|
|
1966
|
+
default: g(() => [...p[11] || (p[11] = [
|
|
1967
|
+
k("Close", -1)
|
|
1968
|
+
])]),
|
|
1969
|
+
_: 1
|
|
1970
|
+
}),
|
|
1971
|
+
d(O, {
|
|
1972
|
+
variant: "destructive",
|
|
1973
|
+
onClick: v
|
|
1974
|
+
}, {
|
|
1975
|
+
default: g(() => [...p[12] || (p[12] = [
|
|
1976
|
+
k("Cancel reservation", -1)
|
|
1977
|
+
])]),
|
|
1978
|
+
_: 1
|
|
1979
|
+
})
|
|
1980
|
+
]),
|
|
1981
|
+
_: 1
|
|
1982
|
+
})
|
|
1983
|
+
]),
|
|
1984
|
+
_: 1
|
|
1985
|
+
})
|
|
1986
|
+
]),
|
|
1987
|
+
_: 1
|
|
1988
|
+
}, 8, ["open"]);
|
|
1989
|
+
};
|
|
1990
|
+
}
|
|
1991
|
+
}), Ms = { class: "pb-4" }, Is = { class: "mt-6 grid gap-4 md:grid-cols-3" }, $s = { class: "space-y-2" }, Ss = { class: "space-y-2" }, Es = { class: "space-y-2" }, Fs = { class: "mt-4 rounded-lg border bg-muted/30 p-4" }, Bs = { class: "mt-2 text-sm text-foreground" }, Rs = /* @__PURE__ */ le({
|
|
1992
|
+
__name: "TransferReservationDialog",
|
|
1993
|
+
setup(s, { expose: e }) {
|
|
1994
|
+
const t = R(!1), o = R("2026-05-14"), r = R("09:30"), i = R("resource-2"), l = ["08:00", "09:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00", "18:00", "19:00", "20:00", "21:00", "22:00"], c = [
|
|
1995
|
+
{ value: "resource-1", label: "BOX 1" },
|
|
1996
|
+
{ value: "resource-2", label: "BOX 2" },
|
|
1997
|
+
{ value: "resource-3", label: "BOX 3" }
|
|
1998
|
+
], u = Y(
|
|
1999
|
+
() => c.find((a) => a.value === i.value)?.label ?? "No resource selected"
|
|
2000
|
+
);
|
|
2001
|
+
return e({
|
|
2002
|
+
openDialog: () => {
|
|
2003
|
+
t.value = !0;
|
|
2004
|
+
}
|
|
2005
|
+
}), (a, n) => {
|
|
2006
|
+
const v = x("DialogTitle"), f = x("DialogDescription"), p = x("DialogHeader"), y = x("Label"), w = x("Input"), j = x("SelectValue"), T = x("SelectTrigger"), S = x("SelectItem"), F = x("SelectContent"), N = x("Select"), O = x("Button"), U = x("DialogFooter"), B = x("DialogScrollContent"), L = x("Dialog");
|
|
2007
|
+
return D(), G(L, {
|
|
2008
|
+
open: t.value,
|
|
2009
|
+
"onUpdate:open": n[5] || (n[5] = (b) => t.value = b)
|
|
2010
|
+
}, {
|
|
2011
|
+
default: g(() => [
|
|
2012
|
+
d(B, { class: "sm:max-w-3xl" }, {
|
|
2013
|
+
default: g(() => [
|
|
2014
|
+
d(p, null, {
|
|
2015
|
+
default: g(() => [
|
|
2016
|
+
d(v, null, {
|
|
2017
|
+
default: g(() => [...n[6] || (n[6] = [
|
|
2018
|
+
k(" Transfer Reservation ", -1)
|
|
2019
|
+
])]),
|
|
2020
|
+
_: 1
|
|
2021
|
+
}),
|
|
2022
|
+
d(f)
|
|
2023
|
+
]),
|
|
2024
|
+
_: 1
|
|
2025
|
+
}),
|
|
2026
|
+
h("div", Ms, [
|
|
2027
|
+
n[11] || (n[11] = h("p", { class: "text-sm text-muted-foreground" }, " This will transfer the reservation to another date, time or resource. The customer will receive an email notification about the change. ", -1)),
|
|
2028
|
+
h("div", Is, [
|
|
2029
|
+
h("div", $s, [
|
|
2030
|
+
d(y, { for: "transfer-reservation-date" }, {
|
|
2031
|
+
default: g(() => [...n[7] || (n[7] = [
|
|
2032
|
+
k("Date", -1)
|
|
2033
|
+
])]),
|
|
2034
|
+
_: 1
|
|
2035
|
+
}),
|
|
2036
|
+
d(w, {
|
|
2037
|
+
id: "transfer-reservation-date",
|
|
2038
|
+
modelValue: o.value,
|
|
2039
|
+
"onUpdate:modelValue": n[0] || (n[0] = (b) => o.value = b),
|
|
2040
|
+
type: "date"
|
|
2041
|
+
}, null, 8, ["modelValue"])
|
|
2042
|
+
]),
|
|
2043
|
+
h("div", Ss, [
|
|
2044
|
+
d(y, { for: "transfer-reservation-hour" }, {
|
|
2045
|
+
default: g(() => [...n[8] || (n[8] = [
|
|
2046
|
+
k("Hour", -1)
|
|
2047
|
+
])]),
|
|
2048
|
+
_: 1
|
|
2049
|
+
}),
|
|
2050
|
+
d(N, {
|
|
2051
|
+
modelValue: r.value,
|
|
2052
|
+
"onUpdate:modelValue": n[1] || (n[1] = (b) => r.value = b)
|
|
2053
|
+
}, {
|
|
2054
|
+
default: g(() => [
|
|
2055
|
+
d(T, { id: "transfer-reservation-hour" }, {
|
|
2056
|
+
default: g(() => [
|
|
2057
|
+
d(j, { placeholder: "Select an hour" })
|
|
2058
|
+
]),
|
|
2059
|
+
_: 1
|
|
2060
|
+
}),
|
|
2061
|
+
d(F, null, {
|
|
2062
|
+
default: g(() => [
|
|
2063
|
+
(D(), A(H, null, q(l, (b) => d(S, {
|
|
2064
|
+
key: b,
|
|
2065
|
+
value: b
|
|
2066
|
+
}, {
|
|
2067
|
+
default: g(() => [
|
|
2068
|
+
k(M(b), 1)
|
|
2069
|
+
]),
|
|
2070
|
+
_: 2
|
|
2071
|
+
}, 1032, ["value"])), 64))
|
|
2072
|
+
]),
|
|
2073
|
+
_: 1
|
|
2074
|
+
})
|
|
2075
|
+
]),
|
|
2076
|
+
_: 1
|
|
2077
|
+
}, 8, ["modelValue"])
|
|
2078
|
+
]),
|
|
2079
|
+
h("div", Es, [
|
|
2080
|
+
d(y, { for: "transfer-reservation-resource" }, {
|
|
2081
|
+
default: g(() => [...n[9] || (n[9] = [
|
|
2082
|
+
k("Resource", -1)
|
|
2083
|
+
])]),
|
|
2084
|
+
_: 1
|
|
2085
|
+
}),
|
|
2086
|
+
d(N, {
|
|
2087
|
+
modelValue: i.value,
|
|
2088
|
+
"onUpdate:modelValue": n[2] || (n[2] = (b) => i.value = b)
|
|
2089
|
+
}, {
|
|
2090
|
+
default: g(() => [
|
|
2091
|
+
d(T, { id: "transfer-reservation-resource" }, {
|
|
2092
|
+
default: g(() => [
|
|
2093
|
+
d(j, { placeholder: "Select a resource" })
|
|
2094
|
+
]),
|
|
2095
|
+
_: 1
|
|
2096
|
+
}),
|
|
2097
|
+
d(F, null, {
|
|
2098
|
+
default: g(() => [
|
|
2099
|
+
(D(), A(H, null, q(c, (b) => d(S, {
|
|
2100
|
+
key: b.value,
|
|
2101
|
+
value: b.value
|
|
2102
|
+
}, {
|
|
2103
|
+
default: g(() => [
|
|
2104
|
+
k(M(b.label), 1)
|
|
2105
|
+
]),
|
|
2106
|
+
_: 2
|
|
2107
|
+
}, 1032, ["value"])), 64))
|
|
2108
|
+
]),
|
|
2109
|
+
_: 1
|
|
2110
|
+
})
|
|
2111
|
+
]),
|
|
2112
|
+
_: 1
|
|
2113
|
+
}, 8, ["modelValue"])
|
|
2114
|
+
])
|
|
2115
|
+
]),
|
|
2116
|
+
h("div", Fs, [
|
|
2117
|
+
n[10] || (n[10] = h("p", { class: "text-xs font-medium uppercase tracking-[0.2em] text-muted-foreground" }, " Preview ", -1)),
|
|
2118
|
+
h("p", Bs, " Reservation will be moved to " + M(o.value || "no date selected") + " at " + M(r.value || "no hour selected") + " with " + M(u.value) + ". ", 1)
|
|
2119
|
+
])
|
|
2120
|
+
]),
|
|
2121
|
+
d(U, null, {
|
|
2122
|
+
default: g(() => [
|
|
2123
|
+
d(O, {
|
|
2124
|
+
variant: "outline",
|
|
2125
|
+
onClick: n[3] || (n[3] = (b) => t.value = !1)
|
|
2126
|
+
}, {
|
|
2127
|
+
default: g(() => [...n[12] || (n[12] = [
|
|
2128
|
+
k("Close", -1)
|
|
2129
|
+
])]),
|
|
2130
|
+
_: 1
|
|
2131
|
+
}),
|
|
2132
|
+
d(O, {
|
|
2133
|
+
onClick: n[4] || (n[4] = (b) => t.value = !1)
|
|
2134
|
+
}, {
|
|
2135
|
+
default: g(() => [...n[13] || (n[13] = [
|
|
2136
|
+
k("Transfer reservation", -1)
|
|
2137
|
+
])]),
|
|
2138
|
+
_: 1
|
|
2139
|
+
})
|
|
2140
|
+
]),
|
|
2141
|
+
_: 1
|
|
2142
|
+
})
|
|
2143
|
+
]),
|
|
2144
|
+
_: 1
|
|
2145
|
+
})
|
|
2146
|
+
]),
|
|
2147
|
+
_: 1
|
|
2148
|
+
}, 8, ["open"]);
|
|
2149
|
+
};
|
|
2150
|
+
}
|
|
2151
|
+
}), js = { class: "flex items-center bg-muted/70 dark:bg-muted/20 px-4 rounded-md" }, Os = { class: "grid gap-2" }, Ts = { class: "grid gap-2" }, Ls = { class: "grid gap-2" }, Ns = /* @__PURE__ */ le({
|
|
2152
|
+
__name: "ApproveReservationDialog",
|
|
2153
|
+
emits: ["confirm"],
|
|
2154
|
+
setup(s, { expose: e, emit: t }) {
|
|
2155
|
+
const { config: o } = be(), { sendMail: r } = Re(o.mailAccount), i = t, l = R(!1), c = R("approve"), u = R(!1), m = R(""), a = R(""), n = R(""), v = (p, y) => {
|
|
2156
|
+
u.value = !o.mailAccount, l.value = !0, p && (y || (y = "approve"), c.value = y, m.value = p.customerInfo?.email, a.value = "Confirmation: Your reservation for " + new Date(p.date)?.toDateString(), n.value = `Dear ${p.customerInfo?.firstName ?? ""} ${p.customerInfo?.lastName ?? ""},
|
|
2157
|
+
|
|
2158
|
+
This email confirms your reservation for ${new Date(p.date)?.toDateString()} at ${p.startTime}.
|
|
2159
|
+
|
|
2160
|
+
We've got everything ready for you and look forward to your visit! If you need to make any changes or have special requests, please let us know.`);
|
|
2161
|
+
}, f = () => {
|
|
2162
|
+
if (!u.value) {
|
|
2163
|
+
if (!m.value || !a.value || !n.value) return alert("Please fill in all the fields.");
|
|
2164
|
+
r({
|
|
2165
|
+
to: m.value,
|
|
2166
|
+
subject: a.value,
|
|
2167
|
+
body: n.value
|
|
2168
|
+
});
|
|
2169
|
+
}
|
|
2170
|
+
l.value = !1;
|
|
2171
|
+
const { $confetti: p } = useNuxtApp();
|
|
2172
|
+
p(), i("confirm");
|
|
2173
|
+
};
|
|
2174
|
+
return e({
|
|
2175
|
+
openDialog: v
|
|
2176
|
+
}), (p, y) => {
|
|
2177
|
+
const w = x("DialogTitle"), j = x("DialogDescription"), T = x("DialogHeader"), S = x("Checkbox"), F = x("Label"), N = x("Input"), O = x("Textarea"), U = x("Button"), B = x("DialogFooter"), L = x("DialogScrollContent"), b = x("Dialog");
|
|
2178
|
+
return D(), G(b, {
|
|
2179
|
+
open: l.value,
|
|
2180
|
+
"onUpdate:open": y[5] || (y[5] = (z) => l.value = z)
|
|
2181
|
+
}, {
|
|
2182
|
+
default: g(() => [
|
|
2183
|
+
d(L, { class: "sm:max-w-3xl" }, {
|
|
2184
|
+
default: g(() => [
|
|
2185
|
+
d(T, null, {
|
|
2186
|
+
default: g(() => [
|
|
2187
|
+
d(w, null, {
|
|
2188
|
+
default: g(() => [
|
|
2189
|
+
k(M(c.value === "approve" ? "Approve Reservation" : "Resend Confirmation Email"), 1)
|
|
2190
|
+
]),
|
|
2191
|
+
_: 1
|
|
2192
|
+
}),
|
|
2193
|
+
d(j)
|
|
2194
|
+
]),
|
|
2195
|
+
_: 1
|
|
2196
|
+
}),
|
|
2197
|
+
h("div", js, [
|
|
2198
|
+
d(S, {
|
|
2199
|
+
modelValue: u.value,
|
|
2200
|
+
"onUpdate:modelValue": y[0] || (y[0] = (z) => u.value = z),
|
|
2201
|
+
id: "reject-dialog-skip-mail",
|
|
2202
|
+
class: "border-black/80 dark:border-gray-200",
|
|
2203
|
+
disabled: !$(o).mailAccount
|
|
2204
|
+
}, null, 8, ["modelValue", "disabled"]),
|
|
2205
|
+
d(F, {
|
|
2206
|
+
for: "reject-dialog-skip-mail",
|
|
2207
|
+
class: "py-4 pl-2 pr-4"
|
|
2208
|
+
}, {
|
|
2209
|
+
default: g(() => [...y[6] || (y[6] = [
|
|
2210
|
+
k("Do not send email to customer", -1)
|
|
2211
|
+
])]),
|
|
2212
|
+
_: 1
|
|
2213
|
+
})
|
|
2214
|
+
]),
|
|
2215
|
+
h("div", {
|
|
2216
|
+
class: Q(["grid gap-4 py-4", { "opacity-50": u.value }])
|
|
2217
|
+
}, [
|
|
2218
|
+
h("div", Os, [
|
|
2219
|
+
d(F, { for: "approve-dialog-email" }, {
|
|
2220
|
+
default: g(() => [...y[7] || (y[7] = [
|
|
2221
|
+
k("To:", -1)
|
|
2222
|
+
])]),
|
|
2223
|
+
_: 1
|
|
2224
|
+
}),
|
|
2225
|
+
d(N, {
|
|
2226
|
+
modelValue: m.value,
|
|
2227
|
+
"onUpdate:modelValue": y[1] || (y[1] = (z) => m.value = z),
|
|
2228
|
+
disabled: u.value,
|
|
2229
|
+
id: "approve-dialog-email"
|
|
2230
|
+
}, null, 8, ["modelValue", "disabled"])
|
|
2231
|
+
]),
|
|
2232
|
+
h("div", Ts, [
|
|
2233
|
+
d(F, { for: "approve-dialog-subject" }, {
|
|
2234
|
+
default: g(() => [...y[8] || (y[8] = [
|
|
2235
|
+
k("Subject:", -1)
|
|
2236
|
+
])]),
|
|
2237
|
+
_: 1
|
|
2238
|
+
}),
|
|
2239
|
+
d(N, {
|
|
2240
|
+
modelValue: a.value,
|
|
2241
|
+
"onUpdate:modelValue": y[2] || (y[2] = (z) => a.value = z),
|
|
2242
|
+
disabled: u.value,
|
|
2243
|
+
id: "approve-dialog-subject"
|
|
2244
|
+
}, null, 8, ["modelValue", "disabled"])
|
|
2245
|
+
]),
|
|
2246
|
+
h("div", Ls, [
|
|
2247
|
+
d(F, { for: "approve-dialog-body" }, {
|
|
2248
|
+
default: g(() => [...y[9] || (y[9] = [
|
|
2249
|
+
k("Body:", -1)
|
|
2250
|
+
])]),
|
|
2251
|
+
_: 1
|
|
2252
|
+
}),
|
|
2253
|
+
d(O, {
|
|
2254
|
+
modelValue: n.value,
|
|
2255
|
+
"onUpdate:modelValue": y[3] || (y[3] = (z) => n.value = z),
|
|
2256
|
+
disabled: u.value,
|
|
2257
|
+
id: "approve-dialog-body"
|
|
2258
|
+
}, null, 8, ["modelValue", "disabled"])
|
|
2259
|
+
])
|
|
2260
|
+
], 2),
|
|
2261
|
+
d(B, null, {
|
|
2262
|
+
default: g(() => [
|
|
2263
|
+
d(U, {
|
|
2264
|
+
variant: "outline",
|
|
2265
|
+
onClick: y[4] || (y[4] = (z) => l.value = !1)
|
|
2266
|
+
}, {
|
|
2267
|
+
default: g(() => [...y[10] || (y[10] = [
|
|
2268
|
+
k("Close", -1)
|
|
2269
|
+
])]),
|
|
2270
|
+
_: 1
|
|
2271
|
+
}),
|
|
2272
|
+
d(U, { onClick: f }, {
|
|
2273
|
+
default: g(() => [...y[11] || (y[11] = [
|
|
2274
|
+
k("Approve reservation", -1)
|
|
2275
|
+
])]),
|
|
2276
|
+
_: 1
|
|
2277
|
+
})
|
|
2278
|
+
]),
|
|
2279
|
+
_: 1
|
|
2280
|
+
})
|
|
2281
|
+
]),
|
|
2282
|
+
_: 1
|
|
2283
|
+
})
|
|
2284
|
+
]),
|
|
2285
|
+
_: 1
|
|
2286
|
+
}, 8, ["open"]);
|
|
2287
|
+
};
|
|
2288
|
+
}
|
|
2289
|
+
}), zs = { class: "flex items-center bg-muted/70 dark:bg-muted/20 px-4 rounded-md" }, Ps = { class: "grid gap-2" }, Vs = { class: "grid gap-2" }, Us = { class: "grid gap-2" }, Hs = /* @__PURE__ */ le({
|
|
2290
|
+
__name: "RejectReservationDialog",
|
|
2291
|
+
emits: ["confirm"],
|
|
2292
|
+
setup(s, { expose: e, emit: t }) {
|
|
2293
|
+
const { config: o } = be(), { sendMail: r } = Re(o.mailAccount), i = t, l = R(!1), c = R(!1), u = R(""), m = R(""), a = R(""), n = (f) => {
|
|
2294
|
+
c.value = !o.mailAccount, l.value = !0, f && (u.value = f.customerInfo?.email, m.value = "Regarding your reservation request for " + new Date(f.date)?.toDateString(), a.value = `Dear ${f.customerInfo?.firstName ?? ""} ${f.customerInfo?.lastName ?? ""},
|
|
2295
|
+
|
|
2296
|
+
Thank you for your interest in booking with us. Unfortunately, we are unable to confirm your request for ${new Date(f.date)?.toDateString()} at ${f.startTime}.
|
|
2297
|
+
|
|
2298
|
+
We would love to see you another time!`);
|
|
2299
|
+
}, v = () => {
|
|
2300
|
+
if (!c.value) {
|
|
2301
|
+
if (!u.value || !m.value || !a.value) return alert("Please fill in all the fields.");
|
|
2302
|
+
r({
|
|
2303
|
+
to: u.value,
|
|
2304
|
+
subject: m.value,
|
|
2305
|
+
body: a.value
|
|
2306
|
+
});
|
|
2307
|
+
}
|
|
2308
|
+
l.value = !1;
|
|
2309
|
+
const { $confetti: f } = useNuxtApp();
|
|
2310
|
+
f(), i("confirm");
|
|
2311
|
+
};
|
|
2312
|
+
return e({
|
|
2313
|
+
openDialog: n
|
|
2314
|
+
}), (f, p) => {
|
|
2315
|
+
const y = x("DialogTitle"), w = x("DialogDescription"), j = x("DialogHeader"), T = x("Checkbox"), S = x("Label"), F = x("Input"), N = x("Textarea"), O = x("Button"), U = x("DialogFooter"), B = x("DialogScrollContent"), L = x("Dialog");
|
|
2316
|
+
return D(), G(L, {
|
|
2317
|
+
open: l.value,
|
|
2318
|
+
"onUpdate:open": p[5] || (p[5] = (b) => l.value = b)
|
|
2319
|
+
}, {
|
|
2320
|
+
default: g(() => [
|
|
2321
|
+
d(B, { class: "sm:max-w-3xl" }, {
|
|
2322
|
+
default: g(() => [
|
|
2323
|
+
d(j, null, {
|
|
2324
|
+
default: g(() => [
|
|
2325
|
+
d(y, null, {
|
|
2326
|
+
default: g(() => [...p[6] || (p[6] = [
|
|
2327
|
+
k(" Reject Reservation Request ", -1)
|
|
2328
|
+
])]),
|
|
2329
|
+
_: 1
|
|
2330
|
+
}),
|
|
2331
|
+
d(w)
|
|
2332
|
+
]),
|
|
2333
|
+
_: 1
|
|
2334
|
+
}),
|
|
2335
|
+
h("div", zs, [
|
|
2336
|
+
d(T, {
|
|
2337
|
+
modelValue: c.value,
|
|
2338
|
+
"onUpdate:modelValue": p[0] || (p[0] = (b) => c.value = b),
|
|
2339
|
+
id: "reject-dialog-skip-mail",
|
|
2340
|
+
class: "border-black/80 dark:border-gray-200",
|
|
2341
|
+
disabled: !$(o).mailAccount
|
|
2342
|
+
}, null, 8, ["modelValue", "disabled"]),
|
|
2343
|
+
d(S, {
|
|
2344
|
+
for: "reject-dialog-skip-mail",
|
|
2345
|
+
class: "py-4 pl-2 pr-4"
|
|
2346
|
+
}, {
|
|
2347
|
+
default: g(() => [...p[7] || (p[7] = [
|
|
2348
|
+
k("Do not send email to customer", -1)
|
|
2349
|
+
])]),
|
|
2350
|
+
_: 1
|
|
2351
|
+
})
|
|
2352
|
+
]),
|
|
2353
|
+
h("div", {
|
|
2354
|
+
class: Q(["grid gap-4 py-4", { "opacity-50": c.value }])
|
|
2355
|
+
}, [
|
|
2356
|
+
h("div", Ps, [
|
|
2357
|
+
d(S, { for: "reject-dialog-email" }, {
|
|
2358
|
+
default: g(() => [...p[8] || (p[8] = [
|
|
2359
|
+
k("To:", -1)
|
|
2360
|
+
])]),
|
|
2361
|
+
_: 1
|
|
2362
|
+
}),
|
|
2363
|
+
d(F, {
|
|
2364
|
+
modelValue: u.value,
|
|
2365
|
+
"onUpdate:modelValue": p[1] || (p[1] = (b) => u.value = b),
|
|
2366
|
+
disabled: c.value,
|
|
2367
|
+
id: "reject-dialog-email"
|
|
2368
|
+
}, null, 8, ["modelValue", "disabled"])
|
|
2369
|
+
]),
|
|
2370
|
+
h("div", Vs, [
|
|
2371
|
+
d(S, { for: "reject-dialog-subject" }, {
|
|
2372
|
+
default: g(() => [...p[9] || (p[9] = [
|
|
2373
|
+
k("Subject:", -1)
|
|
2374
|
+
])]),
|
|
2375
|
+
_: 1
|
|
2376
|
+
}),
|
|
2377
|
+
d(F, {
|
|
2378
|
+
modelValue: m.value,
|
|
2379
|
+
"onUpdate:modelValue": p[2] || (p[2] = (b) => m.value = b),
|
|
2380
|
+
disabled: c.value,
|
|
2381
|
+
id: "reject-dialog-subject"
|
|
2382
|
+
}, null, 8, ["modelValue", "disabled"])
|
|
2383
|
+
]),
|
|
2384
|
+
h("div", Us, [
|
|
2385
|
+
d(S, { for: "reject-dialog-body" }, {
|
|
2386
|
+
default: g(() => [...p[10] || (p[10] = [
|
|
2387
|
+
k("Body:", -1)
|
|
2388
|
+
])]),
|
|
2389
|
+
_: 1
|
|
2390
|
+
}),
|
|
2391
|
+
d(N, {
|
|
2392
|
+
modelValue: a.value,
|
|
2393
|
+
"onUpdate:modelValue": p[3] || (p[3] = (b) => a.value = b),
|
|
2394
|
+
disabled: c.value,
|
|
2395
|
+
id: "reject-dialog-body"
|
|
2396
|
+
}, null, 8, ["modelValue", "disabled"])
|
|
2397
|
+
])
|
|
2398
|
+
], 2),
|
|
2399
|
+
d(U, null, {
|
|
2400
|
+
default: g(() => [
|
|
2401
|
+
d(O, {
|
|
2402
|
+
variant: "outline",
|
|
2403
|
+
onClick: p[4] || (p[4] = (b) => l.value = !1)
|
|
2404
|
+
}, {
|
|
2405
|
+
default: g(() => [...p[11] || (p[11] = [
|
|
2406
|
+
k("Close", -1)
|
|
2407
|
+
])]),
|
|
2408
|
+
_: 1
|
|
2409
|
+
}),
|
|
2410
|
+
d(O, {
|
|
2411
|
+
variant: "destructive",
|
|
2412
|
+
onClick: v
|
|
2413
|
+
}, {
|
|
2414
|
+
default: g(() => [...p[12] || (p[12] = [
|
|
2415
|
+
k("Reject reservation", -1)
|
|
2416
|
+
])]),
|
|
2417
|
+
_: 1
|
|
2418
|
+
})
|
|
2419
|
+
]),
|
|
2420
|
+
_: 1
|
|
2421
|
+
})
|
|
2422
|
+
]),
|
|
2423
|
+
_: 1
|
|
2424
|
+
})
|
|
2425
|
+
]),
|
|
2426
|
+
_: 1
|
|
2427
|
+
}, 8, ["open"]);
|
|
2428
|
+
};
|
|
2429
|
+
}
|
|
2430
|
+
}), Ws = { key: 0 }, Ks = {
|
|
2431
|
+
key: 0,
|
|
2432
|
+
class: "flex items-center gap-1.5 flex-wrap"
|
|
2433
|
+
}, Gs = {
|
|
2434
|
+
key: 0,
|
|
2435
|
+
class: "space-y-2 mb-4"
|
|
2436
|
+
}, Ys = { class: "text-xs font-medium text-muted-foreground uppercase tracking-wide" }, Qs = {
|
|
2437
|
+
key: 0,
|
|
2438
|
+
class: "text-2xl font-bold tracking-wider"
|
|
2439
|
+
}, Xs = {
|
|
2440
|
+
key: 1,
|
|
2441
|
+
class: "flex flex-wrap gap-2 mb-4"
|
|
2442
|
+
}, Js = {
|
|
2443
|
+
key: 1,
|
|
2444
|
+
class: "text-xs text-muted-foreground mr-0.5"
|
|
2445
|
+
}, Zs = {
|
|
2446
|
+
key: 2,
|
|
2447
|
+
class: "space-y-3"
|
|
2448
|
+
}, qs = { class: "bg-muted/30 rounded-lg p-4 space-y-2" }, en = { class: "text-muted-foreground flex items-center gap-1.5" }, tn = { class: "font-medium" }, Ge = /* @__PURE__ */ le({
|
|
2449
|
+
__name: "OrderMetadataDisplay",
|
|
2450
|
+
props: {
|
|
2451
|
+
metadata: { default: () => ({}) },
|
|
2452
|
+
schema: { default: () => [] },
|
|
2453
|
+
displayFilter: { default: void 0 },
|
|
2454
|
+
scope: { default: void 0 },
|
|
2455
|
+
compact: { type: Boolean, default: !1 }
|
|
2456
|
+
},
|
|
2457
|
+
setup(s, { expose: e }) {
|
|
2458
|
+
const t = s, o = Y(() => {
|
|
2459
|
+
if (!t.metadata) return [];
|
|
2460
|
+
const u = new Set(t.schema?.map((n) => n.key) || []), m = (t.schema || []).filter((n) => !(t.scope && n.scope !== t.scope || t.displayFilter && !t.displayFilter.includes(n.display) || t.metadata[n.key] === void 0 || t.metadata[n.key] === null || n.display === "hidden" || t.metadata[n.key] === !1)).sort((n, v) => (n.order || 0) - (v.order || 0)).map((n) => ({
|
|
2461
|
+
...n,
|
|
2462
|
+
value: t.metadata[n.key]
|
|
2463
|
+
}));
|
|
2464
|
+
if (t.displayFilter && !t.displayFilter.includes("field")) return m;
|
|
2465
|
+
const a = Object.entries(t.metadata).filter(([n, v]) => !u.has(n) && v !== void 0 && v !== null && v !== !1).map(([n, v]) => ({
|
|
2466
|
+
id: `_fallback_${n}`,
|
|
2467
|
+
key: n,
|
|
2468
|
+
label: n.replace(/([A-Z])/g, " $1").replace(/[_-]/g, " ").replace(/^\w/, (f) => f.toUpperCase()).trim(),
|
|
2469
|
+
display: "field",
|
|
2470
|
+
scope: "order",
|
|
2471
|
+
value: typeof v == "object" ? JSON.stringify(v) : String(v)
|
|
2472
|
+
}));
|
|
2473
|
+
return [...m, ...a];
|
|
2474
|
+
}), r = Y(() => o.value.filter((u) => u.display === "highlight")), i = Y(() => o.value.filter((u) => u.display === "badge")), l = Y(() => o.value.filter((u) => u.display === "field")), c = Y(() => o.value.length > 0);
|
|
2475
|
+
return e({ hasContent: c }), (u, m) => c.value ? (D(), A("div", Ws, [
|
|
2476
|
+
s.compact ? (D(), A("div", Ks, [
|
|
2477
|
+
(D(!0), A(H, null, q(r.value, (a) => (D(), A("span", {
|
|
2478
|
+
key: a.id,
|
|
2479
|
+
class: Q(["inline-flex items-center gap-1 px-2 py-0.5 text-xs font-bold rounded-md", a.color ? "" : "bg-primary/10 text-primary"]),
|
|
2480
|
+
style: re(a.color ? { backgroundColor: a.color + "20", color: a.color } : {})
|
|
2481
|
+
}, [
|
|
2482
|
+
(D(), G(de($(X)[a.icon]), { size: 12 })),
|
|
2483
|
+
k(" " + M(a.value === !0 ? a.label : a.value), 1)
|
|
2484
|
+
], 6))), 128)),
|
|
2485
|
+
(D(!0), A(H, null, q(i.value, (a) => (D(), A("span", {
|
|
2486
|
+
key: a.id,
|
|
2487
|
+
class: Q(["inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium rounded-full", a.color ? "" : "bg-muted text-muted-foreground"]),
|
|
2488
|
+
style: re(a.color ? { backgroundColor: a.color + "20", color: a.color } : {})
|
|
2489
|
+
}, [
|
|
2490
|
+
a.icon && $(X)[a.icon] ? (D(), G(de($(X)[a.icon]), {
|
|
2491
|
+
key: 0,
|
|
2492
|
+
size: 10
|
|
2493
|
+
})) : E("", !0),
|
|
2494
|
+
k(" " + M(a.value === !0 ? a.label : a.value), 1)
|
|
2495
|
+
], 6))), 128))
|
|
2496
|
+
])) : (D(), A(H, { key: 1 }, [
|
|
2497
|
+
r.value.length ? (D(), A("div", Gs, [
|
|
2498
|
+
(D(!0), A(H, null, q(r.value, (a) => (D(), A("div", {
|
|
2499
|
+
key: a.id,
|
|
2500
|
+
class: Q(["rounded-lg border-2 p-4 flex items-center gap-4", a.color ? "" : "border-primary/20 bg-primary/5"]),
|
|
2501
|
+
style: re(a.color ? { borderColor: a.color + "40", backgroundColor: a.color + "08" } : {})
|
|
2502
|
+
}, [
|
|
2503
|
+
h("div", {
|
|
2504
|
+
class: Q(["h-12 w-12 rounded-xl flex items-center justify-center shrink-0", a.color ? "" : "bg-primary/10"]),
|
|
2505
|
+
style: re(a.color ? { backgroundColor: a.color + "20" } : {})
|
|
2506
|
+
}, [
|
|
2507
|
+
a.icon && $(X)[a.icon] ? (D(), G(de($(X)[a.icon]), {
|
|
2508
|
+
key: 0,
|
|
2509
|
+
size: 24,
|
|
2510
|
+
style: re(a.color ? { color: a.color } : {}),
|
|
2511
|
+
class: Q(a.color ? "" : "text-primary")
|
|
2512
|
+
}, null, 8, ["style", "class"])) : E("", !0)
|
|
2513
|
+
], 6),
|
|
2514
|
+
h("div", null, [
|
|
2515
|
+
h("p", Ys, M(a.label), 1),
|
|
2516
|
+
a.value !== !0 ? (D(), A("p", Qs, M(a.value), 1)) : E("", !0)
|
|
2517
|
+
])
|
|
2518
|
+
], 6))), 128))
|
|
2519
|
+
])) : E("", !0),
|
|
2520
|
+
i.value.length ? (D(), A("div", Xs, [
|
|
2521
|
+
(D(!0), A(H, null, q(i.value, (a) => (D(), A("span", {
|
|
2522
|
+
key: a.id,
|
|
2523
|
+
class: Q(["inline-flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-full", a.color ? "" : "bg-muted text-muted-foreground"]),
|
|
2524
|
+
style: re(a.color ? { backgroundColor: a.color + "20", color: a.color } : {})
|
|
2525
|
+
}, [
|
|
2526
|
+
a.icon && $(X)[a.icon] ? (D(), G(de($(X)[a.icon]), {
|
|
2527
|
+
key: 0,
|
|
2528
|
+
size: 14
|
|
2529
|
+
})) : E("", !0),
|
|
2530
|
+
a.label ? (D(), A("span", Js, [
|
|
2531
|
+
k(M(a.label), 1),
|
|
2532
|
+
a.value !== !0 ? (D(), A(H, { key: 0 }, [
|
|
2533
|
+
k(":")
|
|
2534
|
+
], 64)) : E("", !0)
|
|
2535
|
+
])) : E("", !0),
|
|
2536
|
+
a.value !== !0 ? (D(), A(H, { key: 2 }, [
|
|
2537
|
+
k(M(a.value), 1)
|
|
2538
|
+
], 64)) : E("", !0)
|
|
2539
|
+
], 6))), 128))
|
|
2540
|
+
])) : E("", !0),
|
|
2541
|
+
l.value.length ? (D(), A("div", Zs, [
|
|
2542
|
+
m[0] || (m[0] = h("h3", { class: "text-sm font-semibold text-muted-foreground uppercase tracking-wide" }, "Additional Info", -1)),
|
|
2543
|
+
h("div", qs, [
|
|
2544
|
+
(D(!0), A(H, null, q(l.value, (a) => (D(), A("div", {
|
|
2545
|
+
key: a.id,
|
|
2546
|
+
class: "flex justify-between text-sm"
|
|
2547
|
+
}, [
|
|
2548
|
+
h("span", en, [
|
|
2549
|
+
a.icon && $(X)[a.icon] ? (D(), G(de($(X)[a.icon]), {
|
|
2550
|
+
key: 0,
|
|
2551
|
+
size: 14
|
|
2552
|
+
})) : E("", !0),
|
|
2553
|
+
k(" " + M(a.label), 1)
|
|
2554
|
+
]),
|
|
2555
|
+
h("span", tn, M(a.value === !0 ? "✓" : a.value), 1)
|
|
2556
|
+
]))), 128))
|
|
2557
|
+
])
|
|
2558
|
+
])) : E("", !0)
|
|
2559
|
+
], 64))
|
|
2560
|
+
])) : E("", !0);
|
|
2561
|
+
}
|
|
2562
|
+
}), sn = {
|
|
2563
|
+
key: 0,
|
|
2564
|
+
class: "space-y-6 py-4"
|
|
2565
|
+
}, nn = { class: "space-y-3" }, on = { class: "bg-muted/30 rounded-lg p-4 space-y-3" }, an = { class: "flex items-center gap-3" }, rn = { class: "h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center" }, ln = { class: "font-medium" }, un = { class: "grid gap-2 text-sm" }, cn = {
|
|
2566
|
+
key: 0,
|
|
2567
|
+
class: "flex items-center gap-2 text-muted-foreground"
|
|
2568
|
+
}, dn = ["href"], fn = {
|
|
2569
|
+
key: 1,
|
|
2570
|
+
class: "flex items-center gap-2 text-muted-foreground"
|
|
2571
|
+
}, pn = ["href"], mn = { class: "space-y-3" }, hn = { class: "grid grid-cols-2 gap-3" }, vn = { class: "bg-muted/30 rounded-lg p-3" }, gn = { class: "flex items-center gap-2 text-muted-foreground mb-1" }, _n = { class: "text-xs" }, yn = { class: "font-medium" }, xn = { class: "bg-muted/30 rounded-lg p-3" }, bn = { class: "flex items-center gap-2 text-muted-foreground mb-1" }, Dn = { class: "font-medium" }, Cn = {
|
|
2572
|
+
key: 0,
|
|
2573
|
+
class: "space-y-3"
|
|
2574
|
+
}, kn = { class: "bg-muted/30 rounded-lg p-4" }, An = { class: "flex items-start justify-between" }, wn = { class: "flex items-start gap-3" }, Mn = { class: "h-9 w-9 rounded-lg bg-primary/10 flex items-center justify-center mt-0.5" }, In = { class: "font-medium" }, $n = { class: "text-sm text-muted-foreground" }, Sn = { class: "font-semibold" }, En = { class: "space-y-3" }, Fn = { class: "bg-muted/30 rounded-lg p-4 space-y-3" }, Bn = { class: "space-y-2 text-sm" }, Rn = { class: "flex justify-between" }, jn = {
|
|
2575
|
+
key: 0,
|
|
2576
|
+
class: "flex justify-between"
|
|
2577
|
+
}, On = {
|
|
2578
|
+
key: 1,
|
|
2579
|
+
class: "grid"
|
|
2580
|
+
}, Tn = { class: "text-muted-foreground" }, Ln = { key: 0 }, Nn = { key: 1 }, zn = { class: "flex justify-between font-semibold" }, Pn = { class: "flex justify-between font-semibold" }, Vn = { class: "flex items-center gap-2" }, Un = {
|
|
2581
|
+
key: 1,
|
|
2582
|
+
class: "space-y-2 text-sm"
|
|
2583
|
+
}, Hn = {
|
|
2584
|
+
key: 0,
|
|
2585
|
+
class: "flex justify-between"
|
|
2586
|
+
}, Wn = { class: "text-muted-foreground flex items-center gap-1.5" }, Kn = { class: "text-green-600 dark:text-green-400" }, Gn = {
|
|
2587
|
+
key: 1,
|
|
2588
|
+
class: "flex justify-between"
|
|
2589
|
+
}, Yn = { class: "text-muted-foreground flex items-center gap-1.5" }, Qn = { class: "text-orange-600 dark:text-orange-400 font-medium" }, eo = /* @__PURE__ */ le({
|
|
2590
|
+
__name: "ReservationDetailDialog",
|
|
2591
|
+
props: {
|
|
2592
|
+
agendaData: {},
|
|
2593
|
+
showOrderLink: { type: Boolean, default: !1 }
|
|
2594
|
+
},
|
|
2595
|
+
emits: ["cancelled", "confirmed", "rejected", "openOrder"],
|
|
2596
|
+
setup(s, { expose: e, emit: t }) {
|
|
2597
|
+
const o = s, { hasPermission: r } = Mt(), { config: i } = be(), l = It(i.project), c = ct("event", R(null)), u = Y(() => o.agendaData?.metadataSchema || []), m = t, a = R(!1), n = R(null), v = R(!1), f = Y(() => n.value?.id || n.value?.orderId || ""), p = ve("cancelReservationDialog"), y = ve("approveReservationDialog"), w = ve("rejectReservationDialog"), j = ve("transferReservationDialog"), T = (I) => {
|
|
2598
|
+
const _ = I?.id || I?.orderId;
|
|
2599
|
+
!I || !_ || (n.value = { ...I, id: _ }, a.value = !0);
|
|
2600
|
+
}, S = Y(() => n.value?.customerInfo && `${n.value.customerInfo.firstName} ${n.value.customerInfo.lastName}`.trim() || "Unknown Customer"), F = Y(() => {
|
|
2601
|
+
let I = n.value?.status;
|
|
2602
|
+
const _ = n.value?.reservationStatus;
|
|
2603
|
+
switch (I === "confirmed" && ["needs_approval", "rejected", "approved", "cancelled"].includes(_) && (I = _), I) {
|
|
2604
|
+
case "pending":
|
|
2605
|
+
return { label: "Pending", class: "bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400" };
|
|
2606
|
+
case "cancelled":
|
|
2607
|
+
return { label: "Cancelled", class: "bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400" };
|
|
2608
|
+
case "needs_approval":
|
|
2609
|
+
return { label: "Needs Approval", class: "bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400" };
|
|
2610
|
+
case "rejected":
|
|
2611
|
+
return { label: "Rejected", class: "bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400" };
|
|
2612
|
+
case "approved":
|
|
2613
|
+
return { label: "Approved", class: "bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400" };
|
|
2614
|
+
case "confirmed":
|
|
2615
|
+
return { label: "Confirmed", class: "bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400" };
|
|
2616
|
+
default:
|
|
2617
|
+
return { label: I || "Unknown", class: "bg-muted text-muted-foreground" };
|
|
2618
|
+
}
|
|
2619
|
+
}), N = Y(() => n.value?.status === "cancelled"), O = (I) => I == null || typeof I != "number" ? "—" : `€${I?.toFixed(2)}`, U = (I) => {
|
|
2620
|
+
if (!I) return "—";
|
|
2621
|
+
if (I < 60) return `${I} min`;
|
|
2622
|
+
const _ = Math.floor(I / 60), P = I % 60;
|
|
2623
|
+
return P > 0 ? `${_}h ${P}min` : `${_}h`;
|
|
2624
|
+
}, B = () => {
|
|
2625
|
+
if (!n.value) return;
|
|
2626
|
+
let I = "";
|
|
2627
|
+
const _ = c?.value?.date;
|
|
2628
|
+
if (_)
|
|
2629
|
+
try {
|
|
2630
|
+
I = new Date(_).toLocaleDateString("en-US", {
|
|
2631
|
+
weekday: "long",
|
|
2632
|
+
year: "numeric",
|
|
2633
|
+
month: "long",
|
|
2634
|
+
day: "numeric"
|
|
2635
|
+
});
|
|
2636
|
+
} catch {
|
|
2637
|
+
I = _;
|
|
2638
|
+
}
|
|
2639
|
+
const P = {
|
|
2640
|
+
date: I,
|
|
2641
|
+
resourceName: c?.value?.resource?.name
|
|
2642
|
+
};
|
|
2643
|
+
bs(n.value, P);
|
|
2644
|
+
}, L = () => {
|
|
2645
|
+
y.value?.openDialog(n.value);
|
|
2646
|
+
}, b = () => {
|
|
2647
|
+
w.value?.openDialog(n.value);
|
|
2648
|
+
}, z = () => {
|
|
2649
|
+
y.value?.openDialog(n.value);
|
|
2650
|
+
}, ue = () => {
|
|
2651
|
+
p.value?.openDialog(n.value);
|
|
2652
|
+
}, J = async () => {
|
|
2653
|
+
try {
|
|
2654
|
+
if (v.value || !n.value?.id) throw new Error("Invalid state");
|
|
2655
|
+
v.value = !0;
|
|
2656
|
+
let _ = (await l.get(i.reservationsCollection, n.value.id))?.reservations || [];
|
|
2657
|
+
if (!_.find((P) => P.id === n.value.res_id))
|
|
2658
|
+
throw new Error("Reservation not found");
|
|
2659
|
+
_.find((P) => P.id === n.value.res_id).status = "cancelled", await l.update(i.reservationsCollection, n.value.id, {
|
|
2660
|
+
reservations: _
|
|
2661
|
+
}), n.value.status = "cancelled", ie.success("Reservation cancelled successfully"), m("cancelled"), a.value = !1;
|
|
2662
|
+
} catch (I) {
|
|
2663
|
+
console.error("Error cancelling reservation:", I), ie.error("Failed to cancel reservation");
|
|
2664
|
+
} finally {
|
|
2665
|
+
v.value = !1;
|
|
2666
|
+
}
|
|
2667
|
+
}, Ne = async () => {
|
|
2668
|
+
try {
|
|
2669
|
+
if (v.value || !n.value?.id) throw new Error("Invalid state");
|
|
2670
|
+
v.value = !0;
|
|
2671
|
+
let _ = (await l.get(i.reservationsCollection, n.value.id))?.reservations || [];
|
|
2672
|
+
if (!_.find((P) => P.id === n.value.res_id))
|
|
2673
|
+
throw new Error("Reservation not found");
|
|
2674
|
+
_.find((P) => P.id === n.value.res_id).status = "approved", await l.update(i.reservationsCollection, n.value.id, {
|
|
2675
|
+
reservations: _
|
|
2676
|
+
}), n.value.status = "approved", ie.success("Reservation approved successfully"), m("confirmed"), a.value = !1;
|
|
2677
|
+
} catch (I) {
|
|
2678
|
+
console.error("Error approving reservation:", I), ie.error("Failed to approve reservation");
|
|
2679
|
+
} finally {
|
|
2680
|
+
v.value = !1;
|
|
2681
|
+
}
|
|
2682
|
+
}, K = async () => {
|
|
2683
|
+
try {
|
|
2684
|
+
if (v.value || !n.value?.id) throw new Error("Invalid state");
|
|
2685
|
+
v.value = !0;
|
|
2686
|
+
let _ = (await l.get(i.reservationsCollection, n.value.id))?.reservations || [];
|
|
2687
|
+
if (!_.find((P) => P.id === n.value.res_id))
|
|
2688
|
+
throw new Error("Reservation not found");
|
|
2689
|
+
_.find((P) => P.id === n.value.res_id).status = "rejected", await l.update(i.reservationsCollection, n.value.id, {
|
|
2690
|
+
reservations: _
|
|
2691
|
+
}), n.value.status = "rejected", ie.success("Reservation rejected successfully"), m("rejected"), a.value = !1;
|
|
2692
|
+
} catch (I) {
|
|
2693
|
+
console.error("Error rejecting reservation:", I), ie.error("Failed to reject reservation");
|
|
2694
|
+
} finally {
|
|
2695
|
+
v.value = !1;
|
|
2696
|
+
}
|
|
2697
|
+
}, ae = () => {
|
|
2698
|
+
}, pe = () => {
|
|
2699
|
+
j.value?.openDialog(n.value);
|
|
2700
|
+
}, st = () => {
|
|
2701
|
+
f.value && (a.value = !1, m("openOrder", f.value));
|
|
2702
|
+
};
|
|
2703
|
+
return e({
|
|
2704
|
+
openDialog: T
|
|
2705
|
+
}), (I, _) => {
|
|
2706
|
+
const P = x("ResponsiveModalTitle"), De = x("ResponsiveModalDescription"), nt = x("ResponsiveModalHeader"), Ce = x("Separator"), ke = x("Button"), ot = x("DropdownMenuTrigger"), me = x("DropdownMenuLabel"), ce = x("DropdownMenuItem"), he = x("DropdownMenuGroup"), Ae = x("DropdownMenuSeparator"), at = x("DropdownMenuContent"), rt = x("DropdownMenu"), it = x("ResponsiveModalFooter"), lt = x("ResponsiveModalScrollContent"), ut = x("ResponsiveModal");
|
|
2707
|
+
return D(), A(H, null, [
|
|
2708
|
+
d(ut, {
|
|
2709
|
+
open: a.value,
|
|
2710
|
+
"onUpdate:open": _[0] || (_[0] = (Z) => a.value = Z)
|
|
2711
|
+
}, {
|
|
2712
|
+
default: g(() => [
|
|
2713
|
+
d(lt, { class: "sm:max-w-xl" }, {
|
|
2714
|
+
default: g(() => [
|
|
2715
|
+
d(nt, null, {
|
|
2716
|
+
default: g(() => [
|
|
2717
|
+
d(P, { class: "flex items-center gap-3" }, {
|
|
2718
|
+
default: g(() => [
|
|
2719
|
+
_[1] || (_[1] = h("span", null, "Reservation Details", -1)),
|
|
2720
|
+
h("span", {
|
|
2721
|
+
class: Q(["px-2.5 py-1 text-xs font-medium rounded-full", F.value.class])
|
|
2722
|
+
}, M(F.value.label), 3)
|
|
2723
|
+
]),
|
|
2724
|
+
_: 1
|
|
2725
|
+
}),
|
|
2726
|
+
d(De, null, {
|
|
2727
|
+
default: g(() => [
|
|
2728
|
+
k(" Booking #" + M(f.value.slice(0, 8) || "—"), 1)
|
|
2729
|
+
]),
|
|
2730
|
+
_: 1
|
|
2731
|
+
})
|
|
2732
|
+
]),
|
|
2733
|
+
_: 1
|
|
2734
|
+
}),
|
|
2735
|
+
n.value ? (D(), A("div", sn, [
|
|
2736
|
+
d(Ge, {
|
|
2737
|
+
metadata: n.value.metadata,
|
|
2738
|
+
schema: u.value,
|
|
2739
|
+
scope: "order"
|
|
2740
|
+
}, null, 8, ["metadata", "schema"]),
|
|
2741
|
+
d(Ge, {
|
|
2742
|
+
metadata: n.value.reservationMetadata,
|
|
2743
|
+
schema: u.value,
|
|
2744
|
+
scope: "reservation"
|
|
2745
|
+
}, null, 8, ["metadata", "schema"]),
|
|
2746
|
+
h("div", nn, [
|
|
2747
|
+
_[2] || (_[2] = h("h3", { class: "text-sm font-semibold text-muted-foreground uppercase tracking-wide" }, "Customer", -1)),
|
|
2748
|
+
h("div", on, [
|
|
2749
|
+
h("div", an, [
|
|
2750
|
+
h("div", rn, [
|
|
2751
|
+
d($(dt), {
|
|
2752
|
+
size: 20,
|
|
2753
|
+
class: "text-primary"
|
|
2754
|
+
})
|
|
2755
|
+
]),
|
|
2756
|
+
h("div", null, [
|
|
2757
|
+
h("p", ln, M(S.value), 1)
|
|
2758
|
+
])
|
|
2759
|
+
]),
|
|
2760
|
+
h("div", un, [
|
|
2761
|
+
n.value.customerInfo?.email ? (D(), A("div", cn, [
|
|
2762
|
+
d($(ft), { size: 14 }),
|
|
2763
|
+
h("a", {
|
|
2764
|
+
href: `mailto:${n.value.customerInfo.email}`,
|
|
2765
|
+
class: "hover:text-foreground transition-colors"
|
|
2766
|
+
}, M(n.value.customerInfo.email), 9, dn)
|
|
2767
|
+
])) : E("", !0),
|
|
2768
|
+
n.value.customerInfo?.phone ? (D(), A("div", fn, [
|
|
2769
|
+
d($(pt), { size: 14 }),
|
|
2770
|
+
h("a", {
|
|
2771
|
+
href: `tel:${n.value.customerInfo.phone}`,
|
|
2772
|
+
class: "hover:text-foreground transition-colors"
|
|
2773
|
+
}, M(n.value.customerInfo.phone), 9, pn)
|
|
2774
|
+
])) : E("", !0)
|
|
2775
|
+
])
|
|
2776
|
+
])
|
|
2777
|
+
]),
|
|
2778
|
+
h("div", mn, [
|
|
2779
|
+
_[4] || (_[4] = h("h3", { class: "text-sm font-semibold text-muted-foreground uppercase tracking-wide" }, "Reservation", -1)),
|
|
2780
|
+
h("div", hn, [
|
|
2781
|
+
h("div", vn, [
|
|
2782
|
+
h("div", gn, [
|
|
2783
|
+
d($(mt), { size: 14 }),
|
|
2784
|
+
h("span", _n, M(n.value.startTime) + " - " + M(n.value.endTime), 1)
|
|
2785
|
+
]),
|
|
2786
|
+
h("p", yn, M(new Date(n.value.date).toLocaleDateString("en-US", { weekday: "long", month: "long", day: "numeric", year: "numeric" })), 1)
|
|
2787
|
+
]),
|
|
2788
|
+
h("div", xn, [
|
|
2789
|
+
h("div", bn, [
|
|
2790
|
+
d($(ht), { size: 14 }),
|
|
2791
|
+
_[3] || (_[3] = h("span", { class: "text-xs" }, "Spots", -1))
|
|
2792
|
+
]),
|
|
2793
|
+
h("p", Dn, M(n.value.spots || 1) + " " + M(n.value.spots === 1 ? "person" : "people"), 1)
|
|
2794
|
+
])
|
|
2795
|
+
])
|
|
2796
|
+
]),
|
|
2797
|
+
n.value.pricingOption ? (D(), A("div", Cn, [
|
|
2798
|
+
_[5] || (_[5] = h("h3", { class: "text-sm font-semibold text-muted-foreground uppercase tracking-wide" }, "Package", -1)),
|
|
2799
|
+
h("div", kn, [
|
|
2800
|
+
h("div", An, [
|
|
2801
|
+
h("div", wn, [
|
|
2802
|
+
h("div", Mn, [
|
|
2803
|
+
d($(vt), {
|
|
2804
|
+
size: 18,
|
|
2805
|
+
class: "text-primary"
|
|
2806
|
+
})
|
|
2807
|
+
]),
|
|
2808
|
+
h("div", null, [
|
|
2809
|
+
h("p", In, M(n.value.pricingOption.name), 1),
|
|
2810
|
+
h("p", $n, M(U(n.value.pricingOption.duration)), 1)
|
|
2811
|
+
])
|
|
2812
|
+
]),
|
|
2813
|
+
h("p", Sn, M(O(n.value.pricingOption.price)), 1)
|
|
2814
|
+
])
|
|
2815
|
+
])
|
|
2816
|
+
])) : E("", !0),
|
|
2817
|
+
h("div", En, [
|
|
2818
|
+
_[12] || (_[12] = h("h3", { class: "text-sm font-semibold text-muted-foreground uppercase tracking-wide" }, "Payment", -1)),
|
|
2819
|
+
h("div", Fn, [
|
|
2820
|
+
h("div", Bn, [
|
|
2821
|
+
h("div", Rn, [
|
|
2822
|
+
_[6] || (_[6] = h("span", { class: "text-muted-foreground" }, "Base price", -1)),
|
|
2823
|
+
h("span", null, M(O(n.value.reservationBasePrice)), 1)
|
|
2824
|
+
]),
|
|
2825
|
+
n.value.reservationAddOnsPrice ? (D(), A("div", jn, [
|
|
2826
|
+
_[7] || (_[7] = h("span", { class: "text-muted-foreground" }, "Add-ons", -1)),
|
|
2827
|
+
h("span", null, M(O(n.value.reservationAddOnsPrice)), 1)
|
|
2828
|
+
])) : E("", !0),
|
|
2829
|
+
n.value.reservationAdjustments && n.value.reservationAdjustments.length ? (D(), A("div", On, [
|
|
2830
|
+
(D(!0), A(H, null, q(n.value.reservationAdjustments, (Z) => (D(), A("div", {
|
|
2831
|
+
key: Z,
|
|
2832
|
+
class: "flex justify-between"
|
|
2833
|
+
}, [
|
|
2834
|
+
h("span", Tn, M(Z.label), 1),
|
|
2835
|
+
Z.type == "percent" ? (D(), A("span", Ln, M(Z.value) + "% ", 1)) : (D(), A("span", Nn, M(Z.value < 0 ? "-" : "+") + M(O(Math.abs(Z.value))), 1))
|
|
2836
|
+
]))), 128))
|
|
2837
|
+
])) : E("", !0)
|
|
2838
|
+
]),
|
|
2839
|
+
d(Ce),
|
|
2840
|
+
h("div", zn, [
|
|
2841
|
+
_[8] || (_[8] = h("span", null, "Reservation Total", -1)),
|
|
2842
|
+
h("span", null, M(O(n.value.reservationPrice)), 1)
|
|
2843
|
+
]),
|
|
2844
|
+
d(Ce),
|
|
2845
|
+
h("div", Pn, [
|
|
2846
|
+
h("div", Vn, [
|
|
2847
|
+
_[9] || (_[9] = h("span", null, "Order Total", -1)),
|
|
2848
|
+
s.showOrderLink ? (D(), A("button", {
|
|
2849
|
+
key: 0,
|
|
2850
|
+
type: "button",
|
|
2851
|
+
class: "text-[10px] uppercase bg-muted hover:bg-muted/50 px-2 py-1 rounded cursor-pointer",
|
|
2852
|
+
onClick: st
|
|
2853
|
+
}, " view order ")) : E("", !0)
|
|
2854
|
+
]),
|
|
2855
|
+
h("span", null, M(O(n.value.total)), 1)
|
|
2856
|
+
]),
|
|
2857
|
+
n.value.amountPaid !== void 0 || n.value.amountDue !== void 0 ? (D(), G(Ce, { key: 0 })) : E("", !0),
|
|
2858
|
+
n.value.amountPaid !== void 0 || n.value.amountDue !== void 0 ? (D(), A("div", Un, [
|
|
2859
|
+
n.value.amountPaid !== void 0 ? (D(), A("div", Hn, [
|
|
2860
|
+
h("span", Wn, [
|
|
2861
|
+
d($(gt), { size: 14 }),
|
|
2862
|
+
_[10] || (_[10] = k(" Amount paid ", -1))
|
|
2863
|
+
]),
|
|
2864
|
+
h("span", Kn, M(O(n.value.amountPaid)), 1)
|
|
2865
|
+
])) : E("", !0),
|
|
2866
|
+
n.value.amountDue !== void 0 && n.value.amountDue > 0 ? (D(), A("div", Gn, [
|
|
2867
|
+
h("span", Yn, [
|
|
2868
|
+
d($(_t), { size: 14 }),
|
|
2869
|
+
_[11] || (_[11] = k(" Amount due ", -1))
|
|
2870
|
+
]),
|
|
2871
|
+
h("span", Qn, M(O(n.value.amountDue)), 1)
|
|
2872
|
+
])) : E("", !0)
|
|
2873
|
+
])) : E("", !0)
|
|
2874
|
+
])
|
|
2875
|
+
])
|
|
2876
|
+
])) : E("", !0),
|
|
2877
|
+
d(it, { class: "gap-2 sm:justify-between" }, {
|
|
2878
|
+
default: g(() => [
|
|
2879
|
+
n.value?.status === "confirmed" && n.value?.reservationStatus === "needs_approval" ? (D(), A(H, { key: 0 }, [
|
|
2880
|
+
d(ke, {
|
|
2881
|
+
variant: "destructive",
|
|
2882
|
+
onClick: b
|
|
2883
|
+
}, {
|
|
2884
|
+
default: g(() => [
|
|
2885
|
+
d($(yt), { size: 16 }),
|
|
2886
|
+
_[13] || (_[13] = k(" Reject Reservation ", -1))
|
|
2887
|
+
]),
|
|
2888
|
+
_: 1
|
|
2889
|
+
}),
|
|
2890
|
+
d(ke, { onClick: L }, {
|
|
2891
|
+
default: g(() => [
|
|
2892
|
+
d($(xt), { size: 16 }),
|
|
2893
|
+
_[14] || (_[14] = k(" Approve Reservation ", -1))
|
|
2894
|
+
]),
|
|
2895
|
+
_: 1
|
|
2896
|
+
})
|
|
2897
|
+
], 64)) : n.value?.status === "confirmed" && n.value?.reservationStatus === "approved" ? (D(), G(rt, { key: 1 }, {
|
|
2898
|
+
default: g(() => [
|
|
2899
|
+
d(ot, { "as-child": "" }, {
|
|
2900
|
+
default: g(() => [
|
|
2901
|
+
d(ke, {
|
|
2902
|
+
variant: "outline",
|
|
2903
|
+
class: "gap-2"
|
|
2904
|
+
}, {
|
|
2905
|
+
default: g(() => [
|
|
2906
|
+
d($(bt), { size: 16 }),
|
|
2907
|
+
_[15] || (_[15] = k(" Actions ", -1))
|
|
2908
|
+
]),
|
|
2909
|
+
_: 1
|
|
2910
|
+
})
|
|
2911
|
+
]),
|
|
2912
|
+
_: 1
|
|
2913
|
+
}),
|
|
2914
|
+
d(at, {
|
|
2915
|
+
class: "w-60",
|
|
2916
|
+
align: "start"
|
|
2917
|
+
}, {
|
|
2918
|
+
default: g(() => [
|
|
2919
|
+
d(me, { class: "text-xs text-muted-foreground font-normal" }, {
|
|
2920
|
+
default: g(() => [..._[16] || (_[16] = [
|
|
2921
|
+
k(" Reservation Actions ", -1)
|
|
2922
|
+
])]),
|
|
2923
|
+
_: 1
|
|
2924
|
+
}),
|
|
2925
|
+
d(he, null, {
|
|
2926
|
+
default: g(() => [
|
|
2927
|
+
d(ce, {
|
|
2928
|
+
onClick: B,
|
|
2929
|
+
class: "gap-2 cursor-pointer"
|
|
2930
|
+
}, {
|
|
2931
|
+
default: g(() => [
|
|
2932
|
+
d($(Dt), {
|
|
2933
|
+
size: 16,
|
|
2934
|
+
class: "text-muted-foreground"
|
|
2935
|
+
}),
|
|
2936
|
+
_[17] || (_[17] = h("span", null, "Download PDF", -1))
|
|
2937
|
+
]),
|
|
2938
|
+
_: 1
|
|
2939
|
+
})
|
|
2940
|
+
]),
|
|
2941
|
+
_: 1
|
|
2942
|
+
}),
|
|
2943
|
+
d(Ae),
|
|
2944
|
+
d(he, null, {
|
|
2945
|
+
default: g(() => [
|
|
2946
|
+
d(me, { class: "text-xs text-muted-foreground font-normal" }, {
|
|
2947
|
+
default: g(() => [..._[18] || (_[18] = [
|
|
2948
|
+
k(" Communication ", -1)
|
|
2949
|
+
])]),
|
|
2950
|
+
_: 1
|
|
2951
|
+
}),
|
|
2952
|
+
d(ce, {
|
|
2953
|
+
onClick: z,
|
|
2954
|
+
class: "gap-2 cursor-pointer"
|
|
2955
|
+
}, {
|
|
2956
|
+
default: g(() => [
|
|
2957
|
+
d($(Ct), {
|
|
2958
|
+
size: 16,
|
|
2959
|
+
class: "text-muted-foreground"
|
|
2960
|
+
}),
|
|
2961
|
+
_[19] || (_[19] = h("span", null, "(Re)send Confirmation Mail", -1))
|
|
2962
|
+
]),
|
|
2963
|
+
_: 1
|
|
2964
|
+
})
|
|
2965
|
+
]),
|
|
2966
|
+
_: 1
|
|
2967
|
+
}),
|
|
2968
|
+
$(r)("manage-reservations") ? (D(), A(H, { key: 0 }, [
|
|
2969
|
+
d(Ae),
|
|
2970
|
+
d(he, null, {
|
|
2971
|
+
default: g(() => [
|
|
2972
|
+
d(me, { class: "text-xs text-muted-foreground font-normal" }, {
|
|
2973
|
+
default: g(() => [..._[20] || (_[20] = [
|
|
2974
|
+
k(" Modify Reservation ", -1)
|
|
2975
|
+
])]),
|
|
2976
|
+
_: 1
|
|
2977
|
+
}),
|
|
2978
|
+
d(ce, {
|
|
2979
|
+
onClick: pe,
|
|
2980
|
+
class: "gap-2 cursor-pointer",
|
|
2981
|
+
disabled: N.value
|
|
2982
|
+
}, {
|
|
2983
|
+
default: g(() => [
|
|
2984
|
+
d($(kt), {
|
|
2985
|
+
size: 16,
|
|
2986
|
+
class: "text-muted-foreground"
|
|
2987
|
+
}),
|
|
2988
|
+
_[21] || (_[21] = h("span", null, "Transfer Date & Time", -1))
|
|
2989
|
+
]),
|
|
2990
|
+
_: 1
|
|
2991
|
+
}, 8, ["disabled"])
|
|
2992
|
+
]),
|
|
2993
|
+
_: 1
|
|
2994
|
+
}),
|
|
2995
|
+
d(Ae),
|
|
2996
|
+
d(he, null, {
|
|
2997
|
+
default: g(() => [
|
|
2998
|
+
d(me, { class: "text-xs text-muted-foreground font-normal" }, {
|
|
2999
|
+
default: g(() => [..._[22] || (_[22] = [
|
|
3000
|
+
k(" Cancellation ", -1)
|
|
3001
|
+
])]),
|
|
3002
|
+
_: 1
|
|
3003
|
+
}),
|
|
3004
|
+
d(ce, {
|
|
3005
|
+
onClick: ue,
|
|
3006
|
+
class: "gap-2 cursor-pointer",
|
|
3007
|
+
variant: "destructive",
|
|
3008
|
+
disabled: N.value
|
|
3009
|
+
}, {
|
|
3010
|
+
default: g(() => [
|
|
3011
|
+
d($(At), { size: 16 }),
|
|
3012
|
+
_[23] || (_[23] = h("span", null, "Cancel Reservation", -1))
|
|
3013
|
+
]),
|
|
3014
|
+
_: 1
|
|
3015
|
+
}, 8, ["disabled"]),
|
|
3016
|
+
n.value?.total && n.value.total > 0 ? (D(), G(ce, {
|
|
3017
|
+
key: 0,
|
|
3018
|
+
onClick: ae,
|
|
3019
|
+
class: "gap-2 cursor-pointer text-orange-600 dark:text-orange-400 focus:text-orange-600 dark:focus:text-orange-400",
|
|
3020
|
+
disabled: N.value
|
|
3021
|
+
}, {
|
|
3022
|
+
default: g(() => [
|
|
3023
|
+
d($(wt), {
|
|
3024
|
+
class: "text-inherit",
|
|
3025
|
+
size: 16
|
|
3026
|
+
}),
|
|
3027
|
+
_[24] || (_[24] = h("span", null, "Cancel & Refund", -1))
|
|
3028
|
+
]),
|
|
3029
|
+
_: 1
|
|
3030
|
+
}, 8, ["disabled"])) : E("", !0)
|
|
3031
|
+
]),
|
|
3032
|
+
_: 1
|
|
3033
|
+
})
|
|
3034
|
+
], 64)) : E("", !0)
|
|
3035
|
+
]),
|
|
3036
|
+
_: 1
|
|
3037
|
+
})
|
|
3038
|
+
]),
|
|
3039
|
+
_: 1
|
|
3040
|
+
})) : E("", !0)
|
|
3041
|
+
]),
|
|
3042
|
+
_: 1
|
|
3043
|
+
})
|
|
3044
|
+
]),
|
|
3045
|
+
_: 1
|
|
3046
|
+
})
|
|
3047
|
+
]),
|
|
3048
|
+
_: 1
|
|
3049
|
+
}, 8, ["open"]),
|
|
3050
|
+
d(ws, {
|
|
3051
|
+
ref_key: "cancelReservationDialog",
|
|
3052
|
+
ref: p,
|
|
3053
|
+
onConfirm: J
|
|
3054
|
+
}, null, 512),
|
|
3055
|
+
d(Ns, {
|
|
3056
|
+
ref_key: "approveReservationDialog",
|
|
3057
|
+
ref: y,
|
|
3058
|
+
onConfirm: Ne
|
|
3059
|
+
}, null, 512),
|
|
3060
|
+
d(Hs, {
|
|
3061
|
+
ref_key: "rejectReservationDialog",
|
|
3062
|
+
ref: w,
|
|
3063
|
+
onConfirm: K
|
|
3064
|
+
}, null, 512),
|
|
3065
|
+
d(Rs, {
|
|
3066
|
+
ref_key: "transferReservationDialog",
|
|
3067
|
+
ref: j
|
|
3068
|
+
}, null, 512)
|
|
3069
|
+
], 64);
|
|
3070
|
+
};
|
|
3071
|
+
}
|
|
3072
|
+
});
|
|
3073
|
+
export {
|
|
3074
|
+
oe as F,
|
|
3075
|
+
Ge as _,
|
|
3076
|
+
eo as a
|
|
3077
|
+
};
|