1function __vite__mapDeps(indexes) { 2 if (!__vite__mapDeps.viteFileDeps) { 3 __vite__mapDeps.viteFileDeps = ["assets/web-CeaVwsmW.js","assets/mui-CRsYZxVY.js","assets/vendor-Dwao9eNC.js","assets/query-8ViTdhdk.js","assets/datePickers-BIJXYOKG.js","assets/icons-D8aatgQ4.js","assets/lab-DSem1Osk.js","assets/web-CfmAXKk7.js","assets/web-vSridylW.js","assets/web-BbG_hMVU.js","assets/web-BPQLDUxY.js","assets/index-CWlpAPNh.js","assets/web-CQOiuKgg.js","assets/web-DYxq1Poh.js","assets/web-4LvmVH2w.js","assets/web-BDxgWXJd.js","assets/heic2any-CsPPvNuQ.js","assets/web-Cr-1F3rV.js","assets/RegistrationLoading-DQfpBpB3.js","assets/web-DVdaWdCR.js","assets/web-DhY6ReaQ.js","assets/web-Ctc8iQ7q.js","assets/PaywallSheetV2-DyMzzx6B.js","assets/OpenInNew-C51BFPIz.js","assets/usePricing-were7rIu.js","assets/WhatsApp-BptyU9R8.js","assets/index-DdiYuG-v.js","assets/usePricing-DMjVsepR.css","assets/usePurchasePackage-sQ0ebmEx.js","assets/react-pdf.browser-1EhQzxMi.js","assets/index-BNv7yOC_.js","assets/VectorizedPrintOrder-o2QTzEOv.js","assets/stoqui_logo-C1JOQLy2.js","assets/VectorizedPrintThermalReceipt-DV9mnvng.js","assets/OrdersReportPDF-X4V0y0_n.js","assets/CustomDateRangePicker--Q6V_lmU.js","assets/CustomDateRangePicker-C4hWU8xu.css","assets/index-D9stzMVV.js","assets/ProfilePage-ChTBqs47.js","assets/Edit-BiqqVQWD.js","assets/LogoDialog-CwK8h_CU.js","assets/ChatsPage-CbynnMKh.js","assets/parseMessage-BE7jpFco.js","assets/useProduct-BltDnkHr.js","assets/ChatPage-D33WYGPn.js","assets/tslib.es6-DPrcv4p0.js","assets/ProductPage-B3xKH4f6.js","assets/useUploadProductVideo-BWu3vmGD.js","assets/index-DK05pnC7.js","assets/yarlDarkStyles-BLdNgtCT.js","assets/useDeleteProducts-iKMbBu96.js","assets/ProductAvatar-BTM6y7KS.js","assets/StatusDotLine-CR-EBrxL.js","assets/useComboDefinitions-DJhxSNVU.js","assets/comboCart-DscpHqAi.js","assets/useProductVariations-zMUBu_ll.js","assets/StockChip-B81FVTrG.js","assets/useEditProduct-D1wHpcZy.js","assets/StockControlDialog-ni4AuJhT.js","assets/useEditVariation-CPM2Wx9Q.js","assets/StarRating-DwFdQkkj.js","assets/useProductSales-B8pUQ5_J.js","assets/ExpandLess-C1pgA_h3.js","assets/PriceTableOverrideDialog-Ctk-3Sdd.js","assets/useProductDigitalAsset-Xa_TOtN3.js","assets/ComboFormPage-CGZ9TbGt.js","assets/UnsavedChangesDialog-gqy_t4YT.js","assets/productTypeDraft-DJi2OxPk.js","assets/CategoryPickerSheet-B2lypeTk.js","assets/CategoryQuickCreateSheet-DWRrPzmh.js","assets/nativeGalleryPicker-D1sbOw5u.js","assets/useImageStudioPrompts-Ci8herT5.js","assets/WeightField-CkAlChmC.js","assets/useFiscalConfig-CQEKyhOW.js","assets/useFiscalRegras-D5dYwavN.js","assets/fiscalOptions-BZ76yhnP.js","assets/productTypeDraft-BgW0jaZT.css","assets/SectionCard-BQuBxrTO.js","assets/ProductMultiSelectDialog-CJJuliyr.js","assets/ProductSearchBar-CThCmE3j.js","assets/useFlattenedProducts-ml3vnefA.js","assets/RadioButtonUnchecked-BJKJ-TId.js","assets/CreateProductPage-DYRuOTc2.js","assets/useInAppReview-B9L0-zmE.js","assets/useCommitProductDigitalAsset-DGZeKpm7.js","assets/SwatchChip-BfTakq5s.js","assets/HelperText-CbfuMRy9.js","assets/HelpOutline-7HiWCqx6.js","assets/useSaveProductAttributes-B697gnT6.js","assets/useAttributes-B8RqNYFn.js","assets/AILoadingPlaceholder-FTYHEpKt.js","assets/useCreateProduct-C1NrnFOF.js","assets/useAddStock-54MbzO7V.js","assets/useProductPersonalizationFields-BRk4Jk1c.js","assets/OrderPage-B_L7I5Yw.js","assets/CouponAutocomplete-BexDkgcw.js","assets/useCoupons-CuAoKPbZ.js","assets/OrderItem-CsdOOeix.js","assets/OrderItemPersonalizationSummary-D7xeZSuv.js","assets/useOrder-LNg72HR0.js","assets/sortOrderItems-DQf7TVvt.js","assets/useEditOrder-huvS-0Uk.js","assets/installmentAdjustmentUtils-BOi-cx_o.js","assets/useManuallyMarkAsPaid--R2QrhA2.js","assets/useUpsertShipping-BtB9W1wN.js","assets/useOrderPayments-CFbAn2A1.js","assets/useCustomerAddresses-DvZt7JUJ.js","assets/CopyMenuItem-BcRtSJPl.js","assets/Store-BexQoHku.js","assets/PaymentMethodIcon-CIdwzC1T.js","assets/paymentMethodIcons-Ckq94o3a.js","assets/mercado-pago-color-B_n0DTpx.js","assets/pagaleve-icon-D0kfWVyv.js","assets/formatDueDateRelative-DwwUQMjj.js","assets/isTomorrow-w9r6QR7N.js","assets/CreditCardFlag-BE87Kgx3.js","assets/notaFiscalDanfe-BoR-dr4F.js","assets/CertificadoReenvioAlert-4LpNdURr.js","assets/JsBarcode-CTZHrd1V.js","assets/BluetoothPermissionDialog-BXZtrYiq.js","assets/Refresh-C4waymBA.js","assets/useSuperfreteLabel-B1foOU7S.js","assets/useEditOrderProducts-DOTx1POv.
3js","assets/index-BxYBTvZk.js","assets/NavigateNext-uXnLAjyH.js","assets/InlineEditText-O-PTkbvc.js","assets/useSuperfrete-Od49r8js.js","assets/HourglassEmpty-DSysZohU.js","assets/CreatePixPage-BMr0zfRI.js","assets/listaDeBancos-DVgYDDAw.js","assets/PixListPage-CoujHxDc.js","assets/PixKeyListItem-tCdPzAqH.js","assets/usePixKeys-CKz2VBnr.js","assets/usePaymentConfig-wna7msVS.js","assets/useUpdateProviderPreference-CqMwIXec.js","assets/EditProfilePage-CIbnN3yY.js","assets/ChangePasswordPage-Bn9F8R4O.js","assets/ChangePhoneNumberPage-BjFIiv9V.js","assets/EditProductPage-AMLZ1LGO.js","assets/CustomerPage-DPoPi4AZ.js","assets/useAddressUsedInOrders-sAMvb8LS.js","assets/useCustomerAddressMutations-BiKiu96-.js","assets/CustomerAddressListItem-C-6kO7D1.js","assets/useCustomerInstallments-BZncTEtU.js","assets/CobrancaWhatsAppModal-BMGONXcd.js","assets/TemplateMensagemPage-B-I1HzD8.js","assets/useUpsertUserPreferences-B9JC08bA.js","assets/WebCatalogPage-C3sjRm5B.js","assets/useWebCatalogSettingsSave-Byg91ItV.js","assets/HubRow-DdcKuFLd.js","assets/IdentityScreen-55IQTSHG.js","assets/WebCatalogSchema-ijwI1Cl0.js","assets/useQuizAnswers-CkTYG8hl.js","assets/SettingsScreenLayout-BWFwVJu5.js","assets/ContactScreen-DRZL1k3Y.js","assets/Facebook-RHovQ_xR.js","assets/CheckoutScreen-Bujmkbs1.js","assets/CatalogScreen-C5K8HTG8.js","assets/ChatScreen-BLrExdGO.js","assets/NotificationsScreen-PZ8eQajB.js","assets/StoreAppearancePage-78293XtG.js","assets/homeLayout-C05shHWS.js","assets/chromePresets-Ctm6doyi.js","assets/colorUtils-BVXQm18B.js","assets/appearanceTokens-DaF_sGil.js","assets/BrandScreen-BQN8vLZH.js","assets/AiLogoGeneratorPage-DfpSWs2m.js","assets/StoquiGemIcon-BgloFL5v.js","assets/CardGiftcard-B2-0q1Sg.js","assets/useCreditoSaldo-D_DqzDIj.js","assets/PromoStripScreen-VFp1k61u.js","assets/PromoStripColorPicker-Cz54nEaL.js","assets/ProductCardsScreen-CUtSjj7S.js","assets/TypographyScreen--Uq8vqAj.js","assets/FooterScreen-awIh27Ee.js","assets/LocalizedRichTextEditor-DcQWzYKR.js","assets/FaviconScreen-D_RY_l-3.js","assets/DeveloperPage-C3M_M1TW.js","assets/useCreateOrder-BquuQFE9.js","assets/BluetoothPrinterPage-DD-bBYh9.js","assets/NotificationsPage-CTfm_XNn.js","assets/ImportProductsPage-BI25G7cd.js","assets/formatRelativeDateAndTime-DMOe89_J.js","assets/FileSelector-D88j3gbb.js","assets/ImportDetailsPage-iHer4mki.js","assets/CustomersImportPage-CM2OHQfQ.js","assets/ContactsPicker-5yc6Pf7M.js","assets/CustomerImportDetailsPage-I2RCvF3g.js","assets/CategoriesPageRedesigned-Db3hj9jY.js","assets/useBatchUpdateCategoryOrder-CUUUOfvi.js","assets/CategoryDetailPage-BWGA7sHH.js","assets/useEditCategory-DFBO_RXR.js","assets/useCategoryMedia-B554yVLD.js","assets/CategoryMediaPage-jxhE7DO3.js","assets/LinkDestinationField-c7YXpHN0.js","assets/useCustomPages-DLZn-CvF.js","assets/useDraftStash-BhW-ltPG.js","assets/ReportsPage-B1xuirlx.js","assets/getDateRangeFromOption-CWdx_kxA.js","assets/DateRangeFilterChips-Co-vybTG.js","assets/reportBlur-CN9wVcyq.js","assets/useReportTopCustomers-C_k2nec_.js","assets/useReportStockMovements-g5WvMf8u.js","assets/CouponUsageTable-C9JYfU43.js","assets/VisitorsCard-CdetQjzs.js","assets/BannerCTA-ByDyLqz7.js","assets/Bolt-B4yhJBgX.js","assets/ShippingConfigPage-CrW-nQwy.js","assets/useFreeShipping-DzZ_rItv.js","assets/LocationOn-Dsl4e06L.js","assets/StorefrontOutlined-CJa6SJdE.js","assets/HandshakeOutlined-C4MqcgNd.js","assets/useCustomShipping-DufBA9hL.js","assets/useDistanceShipping-cRrYtxM-.js","assets/useValidateMelhorEnvioToken-Cr_hLqtA.js","assets/useUber-Dj2d6YgO.js","assets/FreeShippingConfigPage-C5sDmC53.js","assets/CheckoutRequirementAlert-CTmXyGW6.js","assets/ShippingMethodLayout-ymqQcyVo.js","assets/DistanceShippingConfigPage-CCsLCPlh.js","assets/CustomShippingConfigPage-BGwCOc5l.js","assets/StoreAddressConfigPage-CG5BIWoS.js","assets/useViaCep-BAAnqyZn.js","assets/BillingAddressConfigPage-CkISqQP6.js","assets/FiscalConfigPage-DWCqHunq.js","assets/FiscalEmpresaPage-Bj_8tpJ6.js","assets/useUpdateFiscalConfig-Dl-LNota.js","assets/FiscalCertificadoPage-B4bX0KU7.js","assets/FiscalSettingsPage-VlsqFW5m.js","assets/FiscalDefaultsPage-haXyY2kk.js","assets/FiscalRegrasPage-BkaXvGCN.js","assets/ContadorAlert-CyWIwwQ8.js","assets/FiscalRegraFormPage-K0SSbiEp.js","assets/NotasFiscaisPage-CZBw_Vo3.js","assets/subMonths-Doy3XBcY.js","assets/CombinarEntregaConfigPage-BDkQ4CPy.js","assets/ChoiceOption-BeWSmMeY.js","assets/RetiradaConfigPage-B3GCtBUL.js","assets/AttributesPage-BOVzEzsw.js","assets/AttributeEditPage-BDAS09EZ.js","assets/colorService-BFHRdnHk.js","assets/CreateAttributePage-BlhpAD_F.js","assets/ProductVariationsPage-DHK4OVHv.js","assets/ProductDigitalDeliveryPage-DyNpUWoX.js","assets/DigitalDeliveryEditor-BEVfRx9z.js","assets/ProductDigitalVariationDeliveryPage-DDHoaG4z.js","assets/ProductAttributesPage-1E_WlR-v.js","assets/EditVariationPage-DpdmqgWN.js","assets/barcodeGenerator-Bzfrlpsg.js","assets/StockPage-DScSIhR9.js","assets/ErrorOutline-DrJfys9F.js","assets/CheckCircleOutline-BKId1YNT.js","assets/DoneAll-twr2PrtN.js","assets/useSuppliers-CrWpT6AC.js","assets/StockProductPage-BfmmoJQF.js","assets/StockMovementSkeleton-OwZxa3oJ.js","assets/getMovementTypeInfo-D9It_2AF.js","assets/StockPageSkeleton-BuARnKWC.js","assets/stock-DrtHpNCn.js","assets/SuppliersPage-0ECZKcZN.js","assets/SupplierListItem-1bVa5msP.js","assets/SupplierPage-CKD7v5Xq.js","assets/useSupplier-DvF4zMpW.js","assets/SupplierFormPage-dUdvpWTX.js","assets/StockVariationPage-Dm9LiApq.js","assets/StockMovementPage-BrelsSvv.js","assets/useStockMovement-BudndDwo.js","assets/EditStockMovementPage-BXTFjB1L.js","assets/useEditStockMovement-CI8ShdLG.js","assets/MercadoPagoConnectPage-CWHohZ0D.js","assets/installmentLimits-BZg-h5D7.js","assets/MenuButton-CKMh6N5q.js","assets/Pix-B95Oe5Gl.js","assets/useMercadoPagoAccount-B4jrpfm_.js","assets/useValidateMercadoPagoToken-BTpvg9SZ.js","assets/useAsaasDirectStatus-Dsf5IQ01.js","assets/resolveEffectiveProviders-CiAyVzdl.js","assets/index-H82d1ykk.js","assets/AsaasConnectPage-DxdQmFzn.js","assets/CheckoutSettingsPage-nHTlb2gV.js","assets/PaymentMethodsPage-DQpiaLuW.js","assets/usePagaleveCredentials-B_LcK2J7.js","assets/usePagamentoEntrega-CG_YZZPE.js","assets/PayOnDeliveryPage-BzHQZ4Ng.js","assets/usePaymentMethods-DCYVPtRU.js","assets/PaymentMethodsListPage-B4IaV0fE.js","assets/paymentMethodConfig-D4mEO6T7.js","assets/useStoquiPayAccess-C0InWTeZ.js","assets/CreatePaymentMethodPage-CS2-UTGc.js","assets/CreatePaymentMethodForm-C8HN5QhV.js","assets/EditPaymentMethodPage-DANppV84.js","assets/CustomerFormPage-DHBWlnYc.js","assets/estados-Cf8K1rC3.js","assets/useCurrentNewOrder-ComavZ-3.js","assets/PixelsAnalyticsPage-D7uJz3jM.js","assets/ReportsAnalyticsPage-Bho-lhTl.js","assets/MelhorEnvioConfigPage-BYH_D9tm.js","assets/SuperfreteConfigPage-CfaAd2k0.js","assets/TrackChanges-Lmepp7Oy.js","assets/UberConfigPage-C13RceIH.js","assets/CouponsListPage-91sCtihC.js","assets/formatExpiration-CH00svw5.js","assets/CouponFormPage-BL
3F_dhQt.js","assets/CategoryMultiSelectDialog-COWLcKbf.js","assets/SubscriptionPage-CBtd12hO.js","assets/PaywallPage-B-Ew3hFT.js","assets/ComparePlansPage-CFYwMJ71.js","assets/CustomerAddressFormPage-BS5koWPn.js","assets/CustomerAddressesPage-w7qaOif-.js","assets/PagalevePage-C7WyjkgR.js","assets/PagaleveLeadDialog-BeEMtLck.js","assets/PagaleveConnectPage-NszlqtmK.js","assets/NewOrderResponsivePage-CLpjm2jw.js","assets/BarcodeScanner-CLh3eFSR.js","assets/Remove-DXyhlu_q.js","assets/isBarcodeLike-BAPU7j9o.js","assets/ProductListItem-C2A78enJ.js","assets/ComboConfigDialog-Cuq4scxe.js","assets/NewOrderProductSearchPage-X1hCPAC1.js","assets/PriceTableSelectRow-CxcZ-nHg.js","assets/NewOrderDetailsPage-DVD6ErOk.js","assets/NewOrderCustomerPage-DeFdTevB.js","assets/OrderCustomerSelector-mYp4su6C.js","assets/NewOrderAddressPage-7K2KsPvr.js","assets/EditOrderProductsPage-Be6wAvty.js","assets/EditOrderProductsSearchPage-C3GBRgEB.js","assets/EditOrderCustomerPage-CMDCWhW7.js","assets/EditOrderAddressPage-C_vuERsT.js","assets/SubscriptionDebugPage-lNp_ejuC.js","assets/PagaleveAddressSelectPage-CaH4vLnz.js","assets/OrderProfitabilityPage-C7mbA8rw.js","assets/AccountBalanceWallet-xIK4hYRp.js","assets/ProductProfitabilityPage-wMKo3D41.js","assets/VariationProfitabilityPage-LwzOr1Bu.js","assets/OrderPaymentSelectionPage-D2rLNwpd.js","assets/OrderPaymentConfigPage-COYo6VaE.js","assets/useSaveOrderPayments-CccH6Sro.js","assets/OrderPaymentAmountPage-Bs32bsyP.js","assets/index-gKC8C10o.js","assets/paymentMinimums-i_RWaHt4.js","assets/OrderPaymentSuccessPage-CzE5_LoB.js","assets/OrderPaymentInstallmentsPage-BDf76bPd.js","assets/useInstallmentMutations-B56Pwi6w.js","assets/OrderPaymentInstallmentPaymentPage-B1AkrJXp.js","assets/useCreateAsaasDirectPaymentLink-DZfRLHKS.js","assets/useMercadoPagoPartialPayment-BEtSz_Lo.js","assets/OrderPaymentInstallmentConfigPage-B4YIa3Xg.js","assets/OrderPaymentFiadoPage-7WmzESRU.js","assets/OrderPaymentFiadoViewPage-Dg_WrHh4.js","assets/OrderPaymentMercadoPagoPage-DRHo-uAB.js","assets/PaymentLinkDisplay-CrbRJhXg.js","assets/OrderPaymentMercadoPagoDetailsPage-shop2BI3.js","assets/OrderPaymentPagalevePage-CFiskwiE.js","assets/OrderPaymentPagaleveDetailsPage-BPG5kUpQ.js","assets/OrderPaymentPixPage-Dzz7DHW7.js","assets/OrderPaymentPixQrPage-CXi3g7Yi.js","assets/OrderPaymentManualPixDetailsPage-BoTasFMm.js","assets/OrderPaymentStoquiPayDetailsPage-B0vfQZ_p.js","assets/OrderPaymentAsaasDirectPage-DzlOL81p.js","assets/OrderPaymentAsaasDirectDetailsPage-FnJ-OelH.js","assets/ContasAReceberPage-CB4B1YCY.js","assets/ContasRecebidasView-VQBCGkDt.js","assets/ReceivedPaymentsDayList-zpP2UZnr.js","assets/formatContasAReceberGroupDate-RbDHYt2Z.js","assets/CustomerContasAReceberPage-M9lLTBu7.js","assets/ContasAPagarPage-DJt2DG-N.js","assets/MarcarPagaDialog-BE46U8Xq.js","assets/useContaPagarMutations-35NDIDTp.js","assets/ContaPagarFormPage-Kb82KZXS.js","assets/ContaPagarViewPage-DYCj9yLe.js","assets/FluxoCaixaReportPage-4jyyj_R1.js","assets/FluxoCaixaPeriodSelector-CXuMEL9L.js","assets/FluxoCaixaEntradasPage-CoXcwryj.js","assets/CategoriasGastosPage-DPvf8Fm4.js","assets/DomainConfigPage-BXWVu7xs.js","assets/GoogleMerchantCenterPage-Bvk9qdOH.js","assets/GoogleVerificationTagPage-CSNCSDy9.js","assets/LoadingFullScreen-Bk433op0.js","assets/InstagramShoppingPage-CLFdcuf5.js","assets/FacebookVerificationTagPage-BG9T6TVu.js","assets/CustomPagesPage-Ce-BGQ6D.js","assets/useCustomPageCount-Ju7B9eEb.js","assets/CustomPageFormPage-CmcSwOs4.js","assets/CatalogExportPage-CHJd_-kY.js","assets/ProductLabelsPage-Cj87LsIr.js","assets/PriceChangeHistoryPage-CkRpnuo0.js","assets/LabelProductSelectionPage-DNRPUHaA.js","assets/AllProductsReportPage-f3EISiZ-.js","assets/AllCustomersReportPage-6RXlxEE4.js","assets/StockBalanceReportPage-BhaUi4xB.js","assets/CouponUsageReportPage-Cjvle-i7.js","assets/SalesItemsReportPage-BFTIWlg4.js","assets/DailySalesReportPage-BjdTgLGi.js","assets/StockItemReportPage-CTDFWUj0.js","assets/PriceTablesPage-MZ6xBRst.js","assets/PriceTableFormPage-CLdCU8tj.js","assets/PriceTablePage-D7H9Nn5k.js","assets/PriceTableAddProductPage-CVMnjfe7.js","assets/PriceTableCustomersPage-CuhRVxgK.js","assets/PriceTableCustomerSelectPage-BB_RHl4q.js","assets/StoreScorePage-B6uaGlvY.js","assets/ProductImprovementsPage-ho940c_9.js","assets/AffiliatePage-Tr0s3POk.js","assets/AffiliateDetailsPage-ChdbESiw.js","assets/AffiliateTermsPage-i-_dLkxg.js","assets/AffiliateHowToUseCodePage-B-oQ6lSj.js","assets/AffiliateFAQPage-SPvQXUVV.js","assets/OrderSuperfreteLabelPage-DJsH7Rsd.js","assets/superfrete_loader-xtPGbAWe.js","assets/SuperfreteLabelPage-CXVEBz-z.js","assets/AbandonedCartsPage-CtTaqBCW.js","assets/AbandonedCartDetailPage-BBTuDpo_.js","assets/AbandonedCartMessageTemplatePage-JI9kaawc.js","assets/ReviewsPage-DnpIFXdS.js","assets/CancelOutlined-DqxdQWI7.js","assets/useUpdateReviewSettings-Bm-8972e.js","assets/ReviewsEmptyState-F55_vX0h.js","assets/ReviewStatusChip-DLB3SFrh.js","assets/ProductReviewsPage-BTyLfJLA.js","assets/ReviewDetailPage-BEo4QPzy.js","assets/ReviewFormPage-BjGsnyFy.js","assets/ReviewProductSelectPage-CoGDyAh_.js","assets/ReviewSettingsPage-DnGJ5H7B.js","assets/BannersScreen-CjFcYncy.js","assets/BannerStyleSelector-BMi32rlG.js","assets/ChromeColorsScreen-COPz-y3A.js","assets/HomeLayoutScreen-BoDKfZf1.js","assets/BannerEditScreen-Bp4sqp7n.js","assets/ImageStudioPage-DOtdV6RK.js","assets/ImageGenerationResult-D0OQIj64.js","assets/ImageGenerationsPage-CDWT7xCz.js","assets/ImageStudioProductSelectPage-fNow3mqC.js","assets/CreditExtratoPage-B4h7Cr3I.js","assets/FreeCreditsPage-C4EaLC0J.js","assets/BuyCreditsPage-2gEpapZm.js","assets/AppPreferencesPage-4uE5wjBz.js","assets/web-D8XOGex4.js","assets/web-D7tkmS_E.js"] 4 } 5 return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) 6} 7var CD=Object.defineProperty;var TD=(e,t,r)=>t in e?CD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ze=(e,t,r)=>(TD(e,typeof t!="symbol"?t+"":t,r),r),t2=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var H=(e,t,r)=>(t2(e,t,"read from private field"),r?r.call(e):t.get(e)),Sr=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Qt=(e,t,r,n)=>(t2(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);var Yn=(e,t,r)=>(t2(e,t,"access private method"),r);import{j as c,a7 as F,ab as me,T as V,N as De,bb as AD,o as gt,a as kD,bc as RD,C as $o,X as Fr,ai as zr,Z as Er,aq as vi,O as nn,a2 as Om,z as Ci,q as Us,aB as X0,n as Mt,a6 as bn,y as J0,a9 as sh,aa as v0,s as ni,I as mr,ap as OC,an as pc,aW as jC,bd as ID,ad as zn,be as PD,aE as OD,G as tl,ak as jD,al as jm,a8 as Lm,bf as LD,aP as zt,aV as LC,ao as Lt,aF as Q0,aj as Dh,S as Fn,aT as Pn,B as $D,aR as e1,R as $m,as as yn,ar as Vt,ac as St,aC as $C,at as Ba,aw as k_,aQ as DD,Q as ei,az as DC,aN as A4,aO as Ac,af as MD,ag as k4,ah as R4,aA as MC,bg as ND,H as FD,bh as UD,bi as wd,aD as R_}from"./mui-CRsYZxVY.js";import{d as Ns,r as v,R as BD,f as VD,b as Ee,g as NC,a as HD}from"./vendor-Dwao9eNC.js";import{Q as zD,M as WD,d as qD,u as Et,a as ao,b as jn,o as I4,e as GD}from"./query-8ViTdhdk.js";import{L as KD}from"./datePickers-BIJXYOKG.js";import{l as ps,R as YD,ad as I_,W as Rf,b as ZD,aV as XD,aW as JD,aX as QD,aY as eM,a as io,aq as tM,e as FC,aZ as rM,a_ as P_,a$ as nM,b0 as iM,b1 as oM,b2 as sM,b3 as aM,b4 as lM,o as UC,b5 as Ed,b6 as Sd,b7 as Cd,i as r2,h as Kd,p as cM,b8 as uM,b9 as n2,ar as dM,ba as hM,C as fM,M as c5,T as pM,D as mM,bb as BC,H as gM,G as vM,V as VC,bc as yM,bd as _M,ax as bM,be as xM,bf as wM,bg as EM,I as SM,F as CM,L as TM,d as AM,O as kM,Q as RM,bh as IM}from"./icons-D8aatgQ4.js";import{L as If}from"./lab-DSem1Osk.js";(function(){try{var e=typeof window<"u"?window:typeof bi<"u"?bi:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"2ad85febf9735404429b0670d4acf56a0af5a0a2"}}catch{}})();try{(function(){var e=typeof window<"u"?window:typeof bi<"u"?bi:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2cbe6784-385c-4e4b-a48a-28ab704ff766",e._sentryDebugIdIdentifier="sentry-dbid-2cbe6784-385c-4e4b-a48a-28ab704ff766")})()}catch{}function PM(e,t){for(var r=0;r<t.length;r++){const n=t[r];
7if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(n,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=r(i);fetch(i.href,o)}})();const HC=-1,Dm=0,ah=1,t1=2,O_=3,j_=4,L_=5,$_=6,zC=7,WC=8,P4=typeof self=="object"?self:globalThis,OM=(e,t)=>{const r=(i,o)=>(e.set(o,i),i),n=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case Dm:case HC:return r(s,i);case ah:{const a=r([],i);for(const l of s)a.push(n(l));return a}case t1:{const a=r({},i);for(const[l,d]of s)a[n(l)]=n(d);return a}case O_:return r(new Date(s),i);case j_:{const{source:a,flags:l}=s;return r(new RegExp(a,l),i)}case L_:{const a=r(new Map,i);for(const[l,d]of s)a.set(n(l),n(d));return a}case $_:{const a=r(new Set,i);for(const l of s)a.add(n(l));return a}case zC:{const{name:a,message:l}=s;return r(new P4[a](l),i)}case WC:return r(BigInt(s),i);case"BigInt":return r(Object(BigInt(s)),i);case"ArrayBuffer":return r(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return r(new DataView(a),s)}}return r(new P4[o](s),i)};return n},O4=e=>OM(new Map,e)(0),kc="",{toString:jM}={},{keys:LM}=Object,Td=e=>{const t=typeof e;if(t!=="object"||!e)return[Dm,t];const r=jM.call(e).slice(8,-1);switch(r){case"Array":return[ah,kc];case"Object":return[t1,kc];case"Date":return[O_,kc];case"RegExp":return[j_,kc];case"Map":return[L_,kc];case"Set":return[$_,kc];case"DataView":return[ah,r]}return r.includes("Array")?[ah,r]:r.includes("Error")?[zC,r]:[t1,r]},vp=([e,t])=>e===Dm&&(t==="function"||t==="symbol"),$M=(e,t,r,n)=>{const i=(s,a)=>{const l=n.push(s)-1;return r.set(a,l),l},o=s=>{if(r.has(s))return r.get(s);let[a,l]=Td(s);switch(a){case Dm:{let u=s;switch(l){case"bigint":a=WC,u=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([HC],s)}return i([a,u],s)}case ah:{if(l){let f=s;return l==="DataView"?f=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(f=new Uint8Array(s)),i([l,[...f]],s)}const u=[],h=i([a,u],s);for(const f of s)u.push(o(f));return h}case t1:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const u=[],h=i([a,u],s);for(const f of LM(s))(e||!vp(Td(s[f])))&&u.push([o(f),o(s[f])]);return h}case O_:return i([a,s.toISOString()],s);case j_:{const{source:u,flags:h}=s;return i([a,{source:u,flags:h}],s)}case L_:{const u=[],h=i([a,u],s);for(const[f,p]of s)(e||!(vp(Td(f))||vp(Td(p))))&&u.push([o(f),o(p)]);return h}case $_:{const u=[],h=i([a,u],s);for(const f of s)(e||!vp(Td(f)))&&u.push(o(f));return h}}const{message:d}=s;return i([a,{name:l,message:d}],s)};return o},j4=(e,{json:t,lossy:r}={})=>{const n=[];return $M(!(t||r),!!t,new Map,n)(e),n},DM=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?O4(j4(e,t)):structuredClone(e):(e,t)=>O4(j4(e,t));var qC={},Mm={};Mm.byteLength=FM;Mm.toByteArray=BM;Mm.fromByteArray=zM;var Zo=[],Yi=[],MM=typeof Uint8Array<"u"?Uint8Array:Array,i2="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Rc=0,NM=i2.length;Rc<NM;++Rc)Zo[Rc]=i2[Rc],Yi[i2.charCodeAt(Rc)]=Rc;Yi[45]=62;Yi[95]=63;function GC(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function FM(e){var t=GC(e),r=t[0],n=t[1];return(r+n)*3/4-n}function UM(e,t,r){return(t+r)*3/4-r}function BM(e){var t,r=GC(e),n=r[0],i=r[1],o=new MM(UM(e,n,i)),s=0,a=i>
vendor: 4,311 bytes, lines 7-12
70?n-4:n,l;for(l=0;l<a;l+=4)t=Yi[e.charCodeAt(l)]<<18|Yi[e.charCodeAt(l+1)]<<12|Yi[e.charCodeAt(l+2)]<<6|Yi[e.charCodeAt(l+3)],o[s++]=t>>16&255,o[s++]=t>>8&255,o[s++]=t&255;return i===2&&(t=Yi[e.charCodeAt(l)]<<2|Yi[e.charCodeAt(l+1)]>>4,o[s++]=t&255),i===1&&(t=Yi[e.charCodeAt(l)]<<10|Yi[e.charCodeAt(l+1)]<<4|Yi[e.charCodeAt(l+2)]>>2,o[s++]=t>>8&255,o[s++]=t&255),o}function VM(e){return Zo[e>>18&63]+Zo[e>>12&63]+Zo[e>>6&63]+Zo[e&63]}function HM(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),i.push(VM(n));return i.join("")}function zM(e){for(var t,r=e.length,n=r%3,i=[],o=16383,s=0,a=r-n;s<a;s+=o)i.push(HM(e,s,s+o>a?a:s+o));return n===1?(t=e[r-1],i.push(Zo[t>>2]+Zo[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(Zo[t>>10]+Zo[t>>4&63]+Zo[t<<2&63]+"=")),i.join("")}var D_={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */D_.read=function(e,t,r,n,i){var o,s,a=i*8-n-1,l=(1<<a)-1,d=l>>1,u=-7,h=r?i-1:0,f=r?-1:1,p=e[t+h];for(h+=f,o=p&(1<<-u)-1,p>>=-u,u+=a;u>0;o=o*256+e[t+h],h+=f,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=n;u>0;s=s*256+e[t+h],h+=f,u-=8);if(o===0)o=1-d;else{if(o===l)return s?NaN:(p?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-d}return(p?-1:1)*s*Math.pow(2,o-n)};D_.write=function(e,t,r,n,i,o){var s,a,l,d=o*8-i-1,u=(1<<d)-1,h=u>>1,f=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,m=n?1:-1,g=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+h>=1?t+=f/l:t+=f*Math.pow(2,1-h),t*l>=2&&(s++,l/=2),s+h>=u?(a=0,s=u):s+h>=1?(a=(t*l-1)*Math.pow(2,i),s=s+h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=a&255,p+=m,a/=256,i-=8);for(s=s<<i|a,d+=i;d>0;e[r+p]=s&255,p+=m,s/=256,d-=8);e[r+p-m]|=g*128};/*! 8 * The buffer module from node.js, for the browser. 9 * 10 * @author Feross Aboukhadijeh <https://feross.org> 11 * @license MIT 12 */(function(e){const t=Mm,r=D_,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=E,e.INSPECT_MAX_BYTES=50;const i=2147483647;e.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=o(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function o(){try{const N=new Uint8Array(1),T={foo:function(){return 42}};return Object.setPrototypeOf(T,Uint8Array.prototype),Object.setPrototypeOf(N,T),N.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function s(N){if(N>i)throw new RangeError('The value "'+N+'" is invalid for option "size"');const T=new Uint8Array(N);return Object.setPrototypeOf(T,a.prototype),T}function a(N,T,R){if(typeof N=="number"){if(typeof T=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h(N)}return l(N,T,R)}a.poolSize=8192;function l(N,T,R){if(typeof N=="string")return f(N,T);if(ArrayBuffer.isView(N))return m(N);if(N==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof N);if(he(N,ArrayBuffer)||N&&he(N.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(he(N,SharedArrayBuffer)||N&&he(N.buffer,SharedArrayBuffer)))return g(N,T,R);if(typeof N=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const B=N.valueOf&&N.valueOf();if(B!=null&&B!==N)return a.from(B,T,R);const G=y(N);if(G)return G;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof N[Symbol.toPrimitive]=="function")return a.from(N[Symbol.toPrimitive]("string"),T,R);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof N)}a.from=function(N,T,R){return l(N,T,R)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function d(N){if(typeof N!="number")throw new TypeError('"size" argument must be of type number');
12if(N<0)throw new RangeError('The value "'+N+'" is invalid for option "size"')}function u(N,T,R){return d(N),N<=0?s(N):T!==void 0?typeof R=="string"?s(N).fill(T,R):s(N).fill(T):s(N)}a.alloc=function(N,T,R){return u(N,T,R)};function h(N){return d(N),s(N<0?0:b(N)|0)}a.allocUnsafe=function(N){return h(N)},a.allocUnsafeSlow=function(N){return h(N)};function f(N,T){if((typeof T!="string"||T==="")&&(T="utf8"),!a.isEncoding(T))throw new TypeError("Unknown encoding: "+T);const R=S(N,T)|0;let B=s(R);const G=B.write(N,T);return G!==R&&(B=B.slice(0,G)),B}function p(N){const T=N.length<0?0:b(N.length)|0,R=s(T);for(let B=0;B<T;B+=1)R[B]=N[B]&255;return R}function m(N){if(he(N,Uint8Array)){const T=new Uint8Array(N);return g(T.buffer,T.byteOffset,T.byteLength)}return p(N)}function g(N,T,R){if(T<0||N.byteLength<T)throw new RangeError('"offset" is outside of buffer bounds');if(N.byteLength<T+(R||0))throw new RangeError('"length" is outside of buffer bounds');let B;return T===void 0&&R===void 0?B=new Uint8Array(N):R===void 0?B=new Uint8Array(N,T):B=new Uint8Array(N,T,R),Object.setPrototypeOf(B,a.prototype),B}function y(N){if(a.isBuffer(N)){const T=b(N.length)|0,R=s(T);return R.length===0||N.copy(R,0,0,T),R}if(N.length!==void 0)return typeof N.length!="number"||ve(N.length)?s(0):p(N);if(N.type==="Buffer"&&Array.isArray(N.data))return p(N.data)}function b(N){if(N>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return N|0}function E(N){return+N!=N&&(N=0),a.alloc(+N)}a.isBuffer=function(T){return T!=null&&T._isBuffer===!0&&T!==a.prototype},a.compare=function(T,R){if(he(T,Uint8Array)&&(T=a.from(T,T.offset,T.byteLength)),he(R,Uint8Array)&&(R=a.from(R,R.offset,R.byteLength)),!a.isBuffer(T)||!a.isBuffer(R))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(T===R)return 0;let B=T.length,G=R.length;for(let le=0,ce=Math.min(B,G);le<ce;++le)if(T[le]!==R[le]){B=T[le],G=R[le];break}return B<G?-1:G<B?1:0},a.isEncoding=function(T){switch(String(T).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(T,R){if(!Array.isArray(T))throw new TypeError('"list" argument must be an Array of Buffers');if(T.length===0)return a.alloc(0);let B;if(R===void 0)for(R=0,B=0;B<T.length;++B)R+=T[B].length;const G=a.allocUnsafe(R);let le=0;for(B=0;B<T.length;++B){let ce=T[B];if(he(ce,Uint8Array))le+ce.length>G.length?(a.isBuffer(ce)||(ce=a.from(ce)),ce.copy(G,le)):Uint8Array.prototype.set.call(G,ce,le);else if(a.isBuffer(ce))ce.copy(G,le);else throw new TypeError('"list" argument must be an Array of Buffers');le+=ce.length}return G};function S(N,T){if(a.isBuffer(N))return N.length;if(ArrayBuffer.isView(N)||he(N,ArrayBuffer))return N.byteLength;if(typeof N!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof N);const R=N.length,B=arguments.length>2&&arguments[2]===!0;if(!B&&R===0)return 0;let G=!1;for(;;)switch(T){case"ascii":case"latin1":case"binary":return R;case"utf8":case"utf-8":return Ue(N).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R*2;case"hex":return R>>>1;case"base64":return ie(N).length;default:if(G)return B?-1:Ue(N).length;T=(""+T).toLowerCase(),G=!0}}a.byteLength=S;function k(N,T,R){let B=!1;if((T===void 0||T<0)&&(T=0),T>this.length||((R===void 0||R>this.length)&&(R=this.length),R<=0)||(R>>>=0,T>>>=0,R<=T))return"";for(N||(N="utf8");;)switch(N){case"hex":return W(this,T,R);case"utf8":case"utf-8":return M(this,T,R);case"ascii":return j(this,T,R);case"latin1":case"binary":return q(this,T,R);case"base64":return D(this,T,R);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne(this,T,R);default:if(B)throw new TypeError("Unknown encoding: "+N);N=(N+"").toLowerCase(),B=!0}}a.prototype._isBuffer=!0;function A(N,T,R){const B=N[T];N[T]=N[R],N[R]=B}a.prototype.swap16=function(){const T=this.length;if(T%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let R=0;R<T;R+=2)A(this,R,R+1);return this},a.prototype.swap32=function(){const T=this.length;if(T%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let R=0;R<T;R+=4)A(this,R,R+3),A(this,R+1,R+2);return this},a.prototype.swap64=function(){const T=this.length;if(T%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let R=0;R<T;R+=8)A(this,R,R+7),A(this,R+1,R+6),A(this,R+2,R+5),A(this,R+3,R+4);return this},a.prototype.toString=function(){const T=this.length;return T===0?"":arguments.length===0?M(this,0,T):k.apply(this,arguments)}
12,a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(T){if(!a.isBuffer(T))throw new TypeError("Argument must be a Buffer");return this===T?!0:a.compare(this,T)===0},a.prototype.inspect=function(){let T="";const R=e.INSPECT_MAX_BYTES;return T=this.toString("hex",0,R).replace(/(.{2})/g,"$1 ").trim(),this.length>R&&(T+=" ... "),"<Buffer "+T+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(T,R,B,G,le){if(he(T,Uint8Array)&&(T=a.from(T,T.offset,T.byteLength)),!a.isBuffer(T))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof T);if(R===void 0&&(R=0),B===void 0&&(B=T?T.length:0),G===void 0&&(G=0),le===void 0&&(le=this.length),R<0||B>T.length||G<0||le>this.length)throw new RangeError("out of range index");if(G>=le&&R>=B)return 0;if(G>=le)return-1;if(R>=B)return 1;if(R>>>=0,B>>>=0,G>>>=0,le>>>=0,this===T)return 0;let ce=le-G,Ke=B-R;const xt=Math.min(ce,Ke),vt=this.slice(G,le),Rt=T.slice(R,B);for(let yt=0;yt<xt;++yt)if(vt[yt]!==Rt[yt]){ce=vt[yt],Ke=Rt[yt];break}return ce<Ke?-1:Ke<ce?1:0};function w(N,T,R,B,G){if(N.length===0)return-1;if(typeof R=="string"?(B=R,R=0):R>2147483647?R=2147483647:R<-2147483648&&(R=-2147483648),R=+R,ve(R)&&(R=G?0:N.length-1),R<0&&(R=N.length+R),R>=N.length){if(G)return-1;R=N.length-1}else if(R<0)if(G)R=0;else return-1;if(typeof T=="string"&&(T=a.from(T,B)),a.isBuffer(T))return T.length===0?-1:_(N,T,R,B,G);if(typeof T=="number")return T=T&255,typeof Uint8Array.prototype.indexOf=="function"?G?Uint8Array.prototype.indexOf.call(N,T,R):Uint8Array.prototype.lastIndexOf.call(N,T,R):_(N,[T],R,B,G);throw new TypeError("val must be string, number or Buffer")}function _(N,T,R,B,G){let le=1,ce=N.length,Ke=T.length;if(B!==void 0&&(B=String(B).toLowerCase(),B==="ucs2"||B==="ucs-2"||B==="utf16le"||B==="utf-16le")){if(N.length<2||T.length<2)return-1;le=2,ce/=2,Ke/=2,R/=2}function xt(Rt,yt){return le===1?Rt[yt]:Rt.readUInt16BE(yt*le)}let vt;if(G){let Rt=-1;for(vt=R;vt<ce;vt++)if(xt(N,vt)===xt(T,Rt===-1?0:vt-Rt)){if(Rt===-1&&(Rt=vt),vt-Rt+1===Ke)return Rt*le}else Rt!==-1&&(vt-=vt-Rt),Rt=-1}else for(R+Ke>ce&&(R=ce-Ke),vt=R;vt>=0;vt--){let Rt=!0;for(let yt=0;yt<Ke;yt++)if(xt(N,vt+yt)!==xt(T,yt)){Rt=!1;break}if(Rt)return vt}return-1}a.prototype.includes=function(T,R,B){return this.indexOf(T,R,B)!==-1},a.prototype.indexOf=function(T,R,B){return w(this,T,R,B,!0)},a.prototype.lastIndexOf=function(T,R,B){return w(this,T,R,B,!1)};function x(N,T,R,B){R=Number(R)||0;const G=N.length-R;B?(B=Number(B),B>G&&(B=G)):B=G;const le=T.length;B>le/2&&(B=le/2);let ce;for(ce=0;ce<B;++ce){const Ke=parseInt(T.substr(ce*2,2),16);if(ve(Ke))return ce;N[R+ce]=Ke}return ce}function C(N,T,R,B){return te(Ue(T,N.length-R),N,R,B)}function P(N,T,R,B){return te(z(T),N,R,B)}function I(N,T,R,B){return te(ie(T),N,R,B)}function O(N,T,R,B){return te(Q(T,N.length-R),N,R,B)}a.prototype.write=function(T,R,B,G){if(R===void 0)G="utf8",B=this.length,R=0;else if(B===void 0&&typeof R=="string")G=R,B=this.length,R=0;else if(isFinite(R))R=R>>>0,isFinite(B)?(B=B>>>0,G===void 0&&(G="utf8")):(G=B,B=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const le=this.length-R;if((B===void 0||B>le)&&(B=le),T.length>0&&(B<0||R<0)||R>this.length)throw new RangeError("Attempt to write outside buffer bounds");G||(G="utf8");let ce=!1;for(;;)switch(G){case"hex":return x(this,T,R,B);case"utf8":case"utf-8":return C(this,T,R,B);case"ascii":case"latin1":case"binary":return P(this,T,R,B);case"base64":return I(this,T,R,B);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,T,R,B);default:if(ce)throw new TypeError("Unknown encoding: "+G);G=(""+G).toLowerCase(),ce=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function D(N,T,R){return T===0&&R===N.length?t.fromByteArray(N):t.fromByteArray(N.slice(T,R))}function M(N,T,R){R=Math.min(N.length,R);const B=[];let G=T;for(;G<R;){const le=N[G];let ce=null,Ke=le>239?4:le>223?3:le>191?2:1;if(G+Ke<=R){let xt,vt,Rt,yt;switch(Ke){case 1:le<128&&(ce=le);break;case 2:xt=N[G+1],(xt&192)===128&&(yt=(le&31)<<6|xt&63,yt>127&&(ce=yt));break;case 3:xt=N[G+1],vt=N[G+2],(xt&192)===128&&(vt&192)===128&&(yt=(le&15)<<12|(xt&63)<<6|vt&63,yt>2047&&(yt<55296||yt>57343)&&(ce=yt));break;case 4:xt=N[G+1],vt=N[G+2],Rt=N[G+3],(xt&192)===128&&(vt&192)===128&&(Rt&192)===128&&(yt=(le&15)<<18|(xt&63)<<12|(vt&63)<<6|Rt&63,yt>65535&&yt<1114112&&(ce=yt))}}ce===null?(ce=65533,Ke=1):ce>65535&&(ce-=65536,B.push(ce>>>10&1023|55296),ce=56320|ce&1023),B.push(ce),G+=Ke}return $(B)}const U=4096;function $(N){const T=N.length;if(T<=U)return String.fromCharCode.apply(String,N);let R="",B=0;for(;B<T;)R+=String.fromCharCode.apply(String,N.slice(B,B+=U));return R}function j(N,T,R){let B="";R=Math.min(N.length,R);for(let G=T;G<R;++G)B+=String.fromCharCode(N[G]&127);return B}function q(N,T,R){let B="";R=Math.min(N.length,R);for(let G=T;G<R;++G)B+=String.fromCharCode(N[G]);return B}function W(N,T,R){const B=N.length;(!T||T<0)&&(T=0),(!R||R<0||R>B)&&(R=B);let G="";for(let le=T;le<R;++le)G+=Re[N[le]];return G}function ne(N,T,R){const B=N.slice(T,R);let G="";for(let le=0;le<B.length-1;le+=2)G+=String.fromCharCode(B[le]+B[le+1]*256);return G}a.prototype.slice=function(T,R){const B=this.length;T=~~T,R=R===void 0?B:~~R,T<0?(T+=B,T<0&&(T=0)):T>
12B&&(T=B),R<0?(R+=B,R<0&&(R=0)):R>B&&(R=B),R<T&&(R=T);const G=this.subarray(T,R);return Object.setPrototypeOf(G,a.prototype),G};function ae(N,T,R){if(N%1!==0||N<0)throw new RangeError("offset is not uint");if(N+T>R)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(T,R,B){T=T>>>0,R=R>>>0,B||ae(T,R,this.length);let G=this[T],le=1,ce=0;for(;++ce<R&&(le*=256);)G+=this[T+ce]*le;return G},a.prototype.readUintBE=a.prototype.readUIntBE=function(T,R,B){T=T>>>0,R=R>>>0,B||ae(T,R,this.length);let G=this[T+--R],le=1;for(;R>0&&(le*=256);)G+=this[T+--R]*le;return G},a.prototype.readUint8=a.prototype.readUInt8=function(T,R){return T=T>>>0,R||ae(T,1,this.length),this[T]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(T,R){return T=T>>>0,R||ae(T,2,this.length),this[T]|this[T+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(T,R){return T=T>>>0,R||ae(T,2,this.length),this[T]<<8|this[T+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(T,R){return T=T>>>0,R||ae(T,4,this.length),(this[T]|this[T+1]<<8|this[T+2]<<16)+this[T+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(T,R){return T=T>>>0,R||ae(T,4,this.length),this[T]*16777216+(this[T+1]<<16|this[T+2]<<8|this[T+3])},a.prototype.readBigUInt64LE=He(function(T){T=T>>>0,Se(T,"offset");const R=this[T],B=this[T+7];(R===void 0||B===void 0)&&je(T,this.length-8);const G=R+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24,le=this[++T]+this[++T]*2**8+this[++T]*2**16+B*2**24;return BigInt(G)+(BigInt(le)<<BigInt(32))}),a.prototype.readBigUInt64BE=He(function(T){T=T>>>0,Se(T,"offset");const R=this[T],B=this[T+7];(R===void 0||B===void 0)&&je(T,this.length-8);const G=R*2**24+this[++T]*2**16+this[++T]*2**8+this[++T],le=this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+B;return(BigInt(G)<<BigInt(32))+BigInt(le)}),a.prototype.readIntLE=function(T,R,B){T=T>>>0,R=R>>>0,B||ae(T,R,this.length);let G=this[T],le=1,ce=0;for(;++ce<R&&(le*=256);)G+=this[T+ce]*le;return le*=128,G>=le&&(G-=Math.pow(2,8*R)),G},a.prototype.readIntBE=function(T,R,B){T=T>>>0,R=R>>>0,B||ae(T,R,this.length);let G=R,le=1,ce=this[T+--G];for(;G>0&&(le*=256);)ce+=this[T+--G]*le;return le*=128,ce>=le&&(ce-=Math.pow(2,8*R)),ce},a.prototype.readInt8=function(T,R){return T=T>>>0,R||ae(T,1,this.length),this[T]&128?(255-this[T]+1)*-1:this[T]},a.prototype.readInt16LE=function(T,R){T=T>>>0,R||ae(T,2,this.length);const B=this[T]|this[T+1]<<8;return B&32768?B|4294901760:B},a.prototype.readInt16BE=function(T,R){T=T>>>0,R||ae(T,2,this.length);const B=this[T+1]|this[T]<<8;return B&32768?B|4294901760:B},a.prototype.readInt32LE=function(T,R){return T=T>>>0,R||ae(T,4,this.length),this[T]|this[T+1]<<8|this[T+2]<<16|this[T+3]<<24},a.prototype.readInt32BE=function(T,R){return T=T>>>0,R||ae(T,4,this.length),this[T]<<24|this[T+1]<<16|this[T+2]<<8|this[T+3]},a.prototype.readBigInt64LE=He(function(T){T=T>>>0,Se(T,"offset");const R=this[T],B=this[T+7];(R===void 0||B===void 0)&&je(T,this.length-8);const G=this[T+4]+this[T+5]*2**8+this[T+6]*2**16+(B<<24);return(BigInt(G)<<BigInt(32))+BigInt(R+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24)}),a.prototype.readBigInt64BE=He(function(T){T=T>>>0,Se(T,"offset");const R=this[T],B=this[T+7];(R===void 0||B===void 0)&&je(T,this.length-8);const G=(R<<24)+this[++T]*2**16+this[++T]*2**8+this[++T];return(BigInt(G)<<BigInt(32))+BigInt(this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+B)}),a.prototype.readFloatLE=function(T,R){return T=T>>>0,R||ae(T,4,this.length),r.read(this,T,!0,23,4)},a.prototype.readFloatBE=function(T,R){return T=T>>>0,R||ae(T,4,this.length),r.read(this,T,!1,23,4)},a.prototype.readDoubleLE=function(T,R){return T=T>>>0,R||ae(T,8,this.length),r.read(this,T,!0,52,8)},a.prototype.readDoubleBE=function(T,R){return T=T>>>0,R||ae(T,8,this.length),r.read(this,T,!1,52,8)};function re(N,T,R,B,G,le){if(!a.isBuffer(N))throw new TypeError('"buffer" argument must be a Buffer instance');if(T>G||T<le)throw new RangeError('"value" argument is out of bounds');if(R+B>N.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(T,R,B,G){if(T=+T,R=R>>>0,B=B>>>0,!G){const Ke=Math.pow(2,8*B)-1;re(this,T,R,B,Ke,0)}let le=1,ce=0;for(this[R]=T&255;++ce<B&&(le*=256);)this[R+ce]=T/le&255;return R+B},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(T,R,B,G){if(T=+T,R=R>>>0,B=B>>>0,!G){const Ke=Math.pow(2,8*B)-1;re(this,T,R,B,Ke,0)}let le=B-1,ce=1;for(this[R+le]=T&255;--le>=0&&(ce*=256);)this[R+le]=T/ce&255;return R+B},a.prototype.writeUint8=a.prototype.writeUInt8=function(T,R,B){return T=+T,R=R>>>0,B||re(this,T,R,1,255,0),this[R]=T&255,R+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(T,R,B){return T=+T,R=R>>>0,B||re(this,T,R,2,65535,0),this[R]=T&255,this[R+1]=T>>>8,R+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(T,R,B){return T=+T,R=R>>>0,B||re(this,T,R,2,65535,0),this[R]=T>>>8,this[R+1]=T&255,R+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(T,R,B){return T=+T,R=R>>>0,B||re(this,T,R,4,4294967295,0),this[R+3]=T>>>24,this[R+2]=T>>>16,this[R+1]=T>>>8,this[R]=T&255,R+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(T,R,B){return T=+T,R=R>>>0,B||re(this,T,R,4,4294967295,0),this[R]=T>>>24,this[R+1]=T>>>16,this[R+2]=T>>>8,this[R+3]=T&255,R+4};function _e(N,T,R,B,G){Ge(T,B,G,N,R,7);let le=Number(T&BigInt(4294967295));N[R++]=le,le=le>>8,N[R++]=le,le=le>>8,N[R++]=le,le=le>>8,N[R++]=le;let ce=Number(T>>BigInt(32)&BigInt(4294967295));return N[R++]=ce,ce=ce>>8,N[R++]=ce,ce=ce>>8,N[R++]=ce,ce=ce>>8,N[R++]=ce,R}function be(N,T,R,B,G){Ge(T,B,G,N,R,7);let le=Number(T&BigInt(4294967295));N[R+7]=le,le=le>>8,N[R+6]=le,le=le>>8,N[R+5]=le,le=le>>8,N[R+4]=le;let ce=Number(T>>BigInt(32)&BigInt(4294967295));return N[R+3]=ce,ce=ce>>8,N[R+2]=ce,ce=ce>>8,N[R+1]=ce,ce=ce>>8,N[R]=ce,R+8}a.prototype.writeBigUInt64LE=He(function(T,R=0){return _e(this,T,R,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=He(function(T,R=0){return be(this,T,R,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(T,R,B,G){if(T=+T,R=R>>>0,!G){const xt=Math.pow(2,8*B-1);re(this,T,R,B,xt-1,-xt)}let le=0,ce=1,Ke=0;for(this[R]=T&255;++le<B&&(ce*=256);)T<0&&Ke===0&&this[R+le-1]!==0&&(Ke=1),this[R+le]=(T/ce>>0)-Ke&255;return R+B},a.prototype.writeIntBE=function(T,R,B,G){if(T=+T,R=R>>>0,!G){const xt=Math.pow(2,8*B-1);re(this,T,R,B,xt-1,-xt)}let le=B-1,ce=1,Ke=0;for(this[R+le]=T&255;--le>=0&&(ce*=256);)T<0&&Ke===0&&this[R+le+1]!==0&&(Ke=1),this[R+le]=(T/ce>>0)-Ke&255;return R+B},a.prototype.writeInt8=function(T,R,B){return T=+T,R=R>>>0,B||re(this,T,R,1,127,-128),T<0&&(T=255+T+1),this[R]=T&255,R+1},a.prototype.writeInt16LE=function(T,R,B){return T=+T,R=R>>>0,B||re(this,T,R,2,32767,-32768),this[R]=T&255,this[R+1]=T>>>8,R+2},a.prototype.writeInt16BE=function(T,R,B){return T=+T,R=R>>>0,B||re(this,T,R,2,32767,-32768),this[R]=T>>>8,this[R+1]=T&255,R+2},a.prototype.writeInt32LE=function(T,R,B){return T=+T,R=R>>>0,B||re(this,T,R,4,2147483647,-2147483648),this[R]=T&255,this[R+1]=T>>>8,this[R+2]=T>>>16,this[R+3]=T>>>24,R+4},a.prototype.writeInt32BE=function(T,R,B){return T=+T,R=R>>>0,B||re(this,T,R,4,2147483647,-2147483648),T<0&&(T=4294967295+T+1),this[R]=T>>>24,this[R+1]=T>>>16,this[R+2]=T>>>8,this[R+3]=T&255,R+4},a.prototype.writeBigInt64LE=He(function(T,R=0){return _e(this,T,R,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=He(function(T,R=0){return be(this,T,R,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function J(N,T,R,B,G,le){if(R+B>N.length)throw new RangeError("Index out of range");if(R<0)throw new RangeError("Index out of range")}function xe(N,T,R,B,G){return T=+T,R=R>>>0,G||J(N,T,R,4),r.write(N,T,R,B,23,4),R+4}a.prototype.writeFloatLE=function(T,R,B){return xe(this,T,R,!0,B)},a.prototype.writeFloatBE=function(T,R,B){return xe(this,T,R,!1,B)};function Ze(N,T,R,B,G){return T=+T,R=R>>>0,G||J(N,T,R,8),r.write(N,T,R,B,52,8),R+8}a.prototype.writeDoubleLE=function(T,R,B){return Ze(this,T,R,!0,B)},a.prototype.writeDoubleBE=function(T,R,B){return Ze(this,T,R,!1,B)},a.prototype.copy=function(T,R,B,G){if(!a.isBuffer(T))throw new TypeError("argument should be a Buffer");if(B||(B=0),!G&&G!==0&&(G=this.length),R>=T.length&&(R=T.length),R||(R=0),G>0&&G<B&&(G=B),G===B||T.length===0||this.length===0)return 0;if(R<0)throw new RangeError("targetStart out of bounds");if(B<0||B>=this.length)throw new RangeError("Index out of range");if(G<0)throw new RangeError("sourceEnd out of bounds");G>
12this.length&&(G=this.length),T.length-R<G-B&&(G=T.length-R+B);const le=G-B;return this===T&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(R,B,G):Uint8Array.prototype.set.call(T,this.subarray(B,G),R),le},a.prototype.fill=function(T,R,B,G){if(typeof T=="string"){if(typeof R=="string"?(G=R,R=0,B=this.length):typeof B=="string"&&(G=B,B=this.length),G!==void 0&&typeof G!="string")throw new TypeError("encoding must be a string");if(typeof G=="string"&&!a.isEncoding(G))throw new TypeError("Unknown encoding: "+G);if(T.length===1){const ce=T.charCodeAt(0);(G==="utf8"&&ce<128||G==="latin1")&&(T=ce)}}else typeof T=="number"?T=T&255:typeof T=="boolean"&&(T=Number(T));if(R<0||this.length<R||this.length<B)throw new RangeError("Out of range index");if(B<=R)return this;R=R>>>0,B=B===void 0?this.length:B>>>0,T||(T=0);let le;if(typeof T=="number")for(le=R;le<B;++le)this[le]=T;else{const ce=a.isBuffer(T)?T:a.from(T,G),Ke=ce.length;if(Ke===0)throw new TypeError('The value "'+T+'" is invalid for argument "value"');for(le=0;le<B-R;++le)this[le+R]=ce[le%Ke]}return this};const $e={};function Le(N,T,R){$e[N]=class extends R{constructor(){super(),Object.defineProperty(this,"message",{value:T.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${N}]`,this.stack,delete this.name}get code(){return N}set code(G){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:G,writable:!0})}toString(){return`${this.name} [${N}]: ${this.message}`}}}Le("ERR_BUFFER_OUT_OF_BOUNDS",function(N){return N?`${N} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Le("ERR_INVALID_ARG_TYPE",function(N,T){return`The "${N}" argument must be of type number. Received type ${typeof T}`},TypeError),Le("ERR_OUT_OF_RANGE",function(N,T,R){let B=`The value of "${N}" is out of range.`,G=R;return Number.isInteger(R)&&Math.abs(R)>2**32?G=Fe(String(R)):typeof R=="bigint"&&(G=String(R),(R>BigInt(2)**BigInt(32)||R<-(BigInt(2)**BigInt(32)))&&(G=Fe(G)),G+="n"),B+=` It must be ${T}. Received ${G}`,B},RangeError);function Fe(N){let T="",R=N.length;const B=N[0]==="-"?1:0;for(;R>=B+4;R-=3)T=`_${N.slice(R-3,R)}${T}`;return`${N.slice(0,R)}${T}`}function ft(N,T,R){Se(T,"offset"),(N[T]===void 0||N[T+R]===void 0)&&je(T,N.length-(R+1))}function Ge(N,T,R,B,G,le){if(N>R||N<T){const ce=typeof T=="bigint"?"n":"";let Ke;throw le>3?T===0||T===BigInt(0)?Ke=`>= 0${ce} and < 2${ce} ** ${(le+1)*8}${ce}`:Ke=`>= -(2${ce} ** ${(le+1)*8-1}${ce}) and < 2 ** ${(le+1)*8-1}${ce}`:Ke=`>= ${T}${ce} and <= ${R}${ce}`,new $e.ERR_OUT_OF_RANGE("value",Ke,N)}ft(B,G,le)}function Se(N,T){if(typeof N!="number")throw new $e.ERR_INVALID_ARG_TYPE(T,"number",N)}function je(N,T,R){throw Math.floor(N)!==N?(Se(N,R),new $e.ERR_OUT_OF_RANGE(R||"offset","an integer",N)):T<0?new $e.ERR_BUFFER_OUT_OF_BOUNDS:new $e.ERR_OUT_OF_RANGE(R||"offset",`>= ${R?1:0} and <= ${T}`,N)}const Ce=/[^+/0-9A-Za-z-_]/g;function Pe(N){if(N=N.split("=")[0],N=N.trim().replace(Ce,""),N.length<2)return"";for(;N.length%4!==0;)N=N+"=";return N}function Ue(N,T){T=T||1/0;let R;const B=N.length;let G=null;const le=[];for(let ce=0;ce<B;++ce){if(R=N.charCodeAt(ce),R>55295&&R<57344){if(!G){if(R>56319){(T-=3)>-1&&le.push(239,191,189);continue}else if(ce+1===B){(T-=3)>-1&&le.push(239,191,189);continue}G=R;continue}if(R<56320){(T-=3)>-1&&le.push(239,191,189),G=R;continue}R=(G-55296<<10|R-56320)+65536}else G&&(T-=3)>-1&&le.push(239,191,189);if(G=null,R<128){if((T-=1)<0)break;le.push(R)}else if(R<2048){if((T-=2)<0)break;le.push(R>>6|192,R&63|128)}else if(R<65536){if((T-=3)<0)break;le.push(R>>12|224,R>>6&63|128,R&63|128)}else if(R<1114112){if((T-=4)<0)break;le.push(R>>18|240,R>>12&63|128,R>>6&63|128,R&63|128)}else throw new Error("Invalid code point")}return le}function z(N){const T=[];for(let R=0;R<N.length;++R)T.push(N.charCodeAt(R)&255);return T}function Q(N,T){let R,B,G;const le=[];for(let ce=0;ce<N.length&&!((T-=2)<0);++ce)R=N.charCodeAt(ce),B=R>>8,G=R%256,le.push(G),le.push(B);return le}function ie(N){return t.toByteArray(Pe(N))}function te(N,T,R,B){let G;for(G=0;G<B&&!(G+R>=T.length||G>=N.length);++G)T[G+R]=N[G];return G}function he(N,T){return N instanceof T||N!=null&&N.constructor!=null&&N.constructor.name!=null&&N.constructor.name===T.name}function ve(N){return N!==N}const Re=function(){const N="0123456789abcdef",T=new Array(256);for(let R=0;R<16;++R){const B=R*16;for(let G=0;G<16;++G)T[B+G]=N[R]+N[G]}return T}();function He(N){return typeof BigInt>"u"?dt:N}function dt(){throw new Error("BigInt not supported")}})(qC);"structuredClone"in globalThis||(globalThis.structuredClone=DM);"Buffer"in globalThis||(globalThis.Buffer=qC.Buffer);var u5={},L4=Ns;u5.createRoot=L4.createRoot,u5.hydrateRoot=L4.hydrateRoot;const WM="modulepreload",qM=function(e){return"/"+e},$4={},X=function(t,r,n){let i=Promise.resolve();if(r&&r.length>0){const o=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=Promise.all(r.map(l=>{if(l=qM(l),l in $4)return;$4[l]=!0;const d=l.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(!!n)for(let p=o.length-1;p>=0;p--){const m=o[p];if(m.href===l&&(!d||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${u}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":WM,d||(f.as="script",f.crossOrigin=""),f.href=l,a&&f.setAttribute("nonce",a),document.head.appendChild(f),d)return new Promise((p,m)=>{f.addEventListener("load",p),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}return i.then(()=>t()).catch(o=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o})};function GM(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(u){try{d(n.next(u))}catch(h){s(h)}}function l(u){try{d(n.throw(u))}catch(h){s(h)}}function d(u){u.done?o(u.value):i(u.value).then(a,l)}d((n=n.apply(e,t||[])).next())})}const KM=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);
12class M_ extends Error{constructor(t,r="FunctionsError",n){super(t),this.name=r,this.context=n}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class YM extends M_{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class D4 extends M_{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class M4 extends M_{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var d5;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(d5||(d5={}));class ZM{constructor(t,{headers:r={},customFetch:n,region:i=d5.Any}={}){this.url=t,this.headers=r,this.region=i,this.fetch=KM(n)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return GM(this,arguments,void 0,function*(r,n={}){var i;let o,s;try{const{headers:a,method:l,body:d,signal:u,timeout:h}=n;let f={},{region:p}=n;p||(p=this.region);const m=new URL(`${this.url}/${r}`);p&&p!=="any"&&(f["x-region"]=p,m.searchParams.set("forceFunctionRegion",p));let g;d&&(a&&!Object.prototype.hasOwnProperty.call(a,"Content-Type")||!a)?typeof Blob<"u"&&d instanceof Blob||d instanceof ArrayBuffer?(f["Content-Type"]="application/octet-stream",g=d):typeof d=="string"?(f["Content-Type"]="text/plain",g=d):typeof FormData<"u"&&d instanceof FormData?g=d:(f["Content-Type"]="application/json",g=JSON.stringify(d)):d&&typeof d!="string"&&!(typeof Blob<"u"&&d instanceof Blob)&&!(d instanceof ArrayBuffer)&&!(typeof FormData<"u"&&d instanceof FormData)?g=JSON.stringify(d):g=d;let y=u;h&&(s=new AbortController,o=setTimeout(()=>s.abort(),h),u?(y=s.signal,u.addEventListener("abort",()=>s.abort())):y=s.signal);const b=yield this.fetch(m.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},f),this.headers),a),body:g,signal:y}).catch(A=>{throw new YM(A)}),E=b.headers.get("x-relay-error");if(E&&E==="true")throw new D4(b);if(!b.ok)throw new M4(b);let S=((i=b.headers.get("Content-Type"))!==null&&i!==void 0?i:"text/plain").split(";")[0].trim(),k;return S==="application/json"?k=yield b.json():S==="application/octet-stream"||S==="application/pdf"?k=yield b.blob():S==="text/event-stream"?k=b:S==="multipart/form-data"?k=yield b.formData():k=yield b.text(),{data:k,error:null,response:b}}catch(a){return{data:null,error:a,response:a instanceof M4||a instanceof D4?a.context:void 0}}finally{o&&clearTimeout(o)}})}}const KC=3,N4=e=>Math.min(1e3*2**e,3e4),XM=[520,503],YC=["GET","HEAD","OPTIONS"];var JM=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.co
12de=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function F4(e,t){return new Promise(r=>{if(t!=null&&t.aborted){r();return}const n=setTimeout(()=>{t==null||t.removeEventListener("abort",i),r()},e);function i(){clearTimeout(n),r()}t==null||t.addEventListener("abort",i)})}function QM(e,t,r,n){return!(!n||r>=KC||!YC.includes(e)||!XM.includes(t))}var eN=class{constructor(e){var t,r,n,i,o;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(r=e.isMaybeSingle)!==null&&r!==void 0?r:!1,this.shouldStripNulls=(n=e.shouldStripNulls)!==null&&n!==void 0?n:!1,this.urlLengthLimit=(i=e.urlLengthLimit)!==null&&i!==void 0?i:8e3,this.retryEnabled=(o=e.retry)!==null&&o!==void 0?o:!0,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var r=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const s=this.headers.get("Accept");s==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!s||s==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const n=this.fetch;let o=(async()=>{let s=0;for(;;){const d=new Headers(r.headers);s>0&&d.set("X-Retry-Count",String(s));let u;try{u=await n(r.url.toString(),{method:r.method,headers:d,body:JSON.stringify(r.body),signal:r.signal})}catch(h){if((h==null?void 0:h.name)==="AbortError"||(h==null?void 0:h.code)==="ABORT_ERR"||!YC.includes(r.method))throw h;if(r.retryEnabled&&s<KC){const f=N4(s);s++,await F4(f,r.signal);continue}throw h}if(QM(r.method,u.status,s,r.retryEnabled)){var a,l;const h=(a=(l=u.headers)===null||l===void 0?void 0:l.get("Retry-After"))!==null&&a!==void 0?a:null,f=h!==null?Math.max(0,parseInt(h,10)||0)*1e3:N4(s);await u.text(),s++,await F4(f,r.signal);continue}return await r.processResponse(u)}})();return this.shouldThrowOnError||(o=o.catch(s=>{var a;let l="",d="",u="";const h=s==null?void 0:s.cause;if(h){var f,p,m,g;const E=(f=h==null?void 0:h.message)!==null&&f!==void 0?f:"",S=(p=h==null?void 0:h.code)!==null&&p!==void 0?p:"";l=`${(m=s==null?void 0:s.name)!==null&&m!==void 0?m:"FetchError"}: ${s==null?void 0:s.message}`,l+=` 13 14Caused by: ${(g=h==null?void 0:h.name)!==null&&g!==void 0?g:"Error"}: ${E}`,S&&(l+=` (${S})`),h!=null&&h.stack&&(l+=` 15${h.stack}`)}else{var y;l=(y=s==null?void 0:s.stack)!==null&&y!==void 0?y:""}const b=this.url.toString().length;return(s==null?void 0:s.name)==="AbortError"||(s==null?void 0:s.code)==="ABORT_ERR"?(u="",d="Request was aborted (timeout or manual cancellation)",b>this.urlLengthLimit&&(d+=`. Note: Your request URL is ${b} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((h==null?void 0:h.name)==="HeadersOverflowError"||(h==null?void 0:h.code)==="UND_ERR_HEADERS_OVERFLOW")&&(u="",d="HTTP headers exceeded server limits (typically 16KB)",b>this.urlLengthLimit&&(d+=`. Your request URL is ${b} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(a=s==null?void 0:s.name)!==null&&a!==void 0?a:"FetchError"}: ${s==null?void 0:s.message}`,details:l,hint:d,code:u},data:null,count:null,status:0,statusText:""}}
15)),o.then(e,t)}async processResponse(e){var t=this;let r=null,n=null,i=null,o=e.status,s=e.statusText;if(e.ok){var a,l;if(t.method!=="HEAD"){var d;const f=await e.text();f===""||(t.headers.get("Accept")==="text/csv"||t.headers.get("Accept")&&(!((d=t.headers.get("Accept"))===null||d===void 0)&&d.includes("application/vnd.pgrst.plan+text"))?n=f:n=JSON.parse(f))}const u=(a=t.headers.get("Prefer"))===null||a===void 0?void 0:a.match(/count=(exact|planned|estimated)/),h=(l=e.headers.get("content-range"))===null||l===void 0?void 0:l.split("/");u&&h&&h.length>1&&(i=parseInt(h[1])),t.isMaybeSingle&&Array.isArray(n)&&(n.length>1?(r={code:"PGRST116",details:`Results contain ${n.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},n=null,i=null,o=406,s="Not Acceptable"):n.length===1?n=n[0]:n=null)}else{const u=await e.text();try{r=JSON.parse(u),Array.isArray(r)&&e.status===404&&(n=[],r=null,o=200,s="OK")}catch{e.status===404&&u===""?(o=204,s="No Content"):r={message:u}}if(r&&t.shouldThrowOnError)throw new JM(r)}return{success:r===null,error:r,data:n,count:i,status:o,statusText:s}}returns(){return this}overrideTypes(){return this}},tN=class extends eN{select(e){let t=!1;const r=(e??"*").split("").map(n=>/\s/.test(n)&&!t?"":(n==='"'&&(t=!t),n)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:r,foreignTable:n,referencedTable:i=n}={}){const o=i?`${i}.order`:"order",s=this.url.searchParams.get(o);return this.url.searchParams.set(o,`${s?`${s},`:""}${e}.${t?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:r=t}={}){const n=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${e}`),this}range(e,t,{foreignTable:r,referencedTable:n=r}={}){const i=typeof n>"u"?"offset":`${n}.offset`,o=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${e}`),this.url.searchParams.set(o,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:r=!1,buffers:n=!1,wal:i=!1,format:o="text"}={}){var s;const a=[e?"analyze":null,t?"verbose":null,r?"settings":null,n?"buffers":null,i?"wal":null].filter(Boolean).join("|"),l=(s=this.headers.get("Accept"))!==null&&s!==void 0?s:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${o}; for="${l}"; options=${a};`),o==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const U4=new RegExp("[,()]");var Gc=class extends tN{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const r=Array.from(new Set(t)).map(n=>typeof n=="string"&&U4.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}notIn(e,t){const r=Array.from(new Set(t)).map(n=>typeof n=="string"&&U4.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(e,`not.in.(${r})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:r,type:n}={}){let i="";n==="plain"?i="pl":n==="phrase"?i="ph":n==="websearch"&&(i="w");const o=r===void 0?"":`(${r})`;return this.url.searchParams.append(e,`${i}fts${o}.${t}`),this}match(e){return Object.entries(e).filter(([t,r])=>
15r!==void 0).forEach(([t,r])=>{this.url.searchParams.append(t,`eq.${r}`)}),this}not(e,t,r){return this.url.searchParams.append(e,`not.${t}.${r}`),this}or(e,{foreignTable:t,referencedTable:r=t}={}){const n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${e})`),this}filter(e,t,r){return this.url.searchParams.append(e,`${t}.${r}`),this}},rN=class{constructor(e,{headers:t={},schema:r,fetch:n,urlLengthLimit:i=8e3,retry:o}){this.url=e,this.headers=new Headers(t),this.schema=r,this.fetch=n,this.urlLengthLimit=i,this.retry=o}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:r=!1,count:n}=t??{},i=r?"HEAD":"GET";let o=!1;const s=(e??"*").split("").map(d=>/\s/.test(d)&&!o?"":(d==='"'&&(o=!o),d)).join(""),{url:a,headers:l}=this.cloneRequestState();return a.searchParams.set("select",s),n&&l.append("Prefer",`count=${n}`),new Gc({method:i,url:a,headers:l,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:r=!0}={}){var n;const i="POST",{url:o,headers:s}=this.cloneRequestState();if(t&&s.append("Prefer",`count=${t}`),r||s.append("Prefer","missing=default"),Array.isArray(e)){const a=e.reduce((l,d)=>l.concat(Object.keys(d)),[]);if(a.length>
150){const l=[...new Set(a)].map(d=>`"${d}"`);o.searchParams.set("columns",l.join(","))}}return new Gc({method:i,url:o,headers:s,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:r=!1,count:n,defaultToNull:i=!0}={}){var o;const s="POST",{url:a,headers:l}=this.cloneRequestState();if(l.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),t!==void 0&&a.searchParams.set("on_conflict",t),n&&l.append("Prefer",`count=${n}`),i||l.append("Prefer","missing=default"),Array.isArray(e)){const d=e.reduce((u,h)=>u.concat(Object.keys(h)),[]);if(d.length>0){const u=[...new Set(d)].map(h=>`"${h}"`);a.searchParams.set("columns",u.join(","))}}return new Gc({method:s,url:a,headers:l,schema:this.schema,body:e,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){var r;const n="PATCH",{url:i,headers:o}=this.cloneRequestState();return t&&o.append("Prefer",`count=${t}`),new Gc({method:n,url:i,headers:o,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){var t;const r="DELETE",{url:n,headers:i}=this.cloneRequestState();return e&&i.append("Prefer",`count=${e}`),new Gc({method:r,url:n,headers:i,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function Mh(e){"@babel/helpers - typeof";return Mh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mh(e)}function nN(e,t){if(Mh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Mh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function iN(e){var t=nN(e,"string");return Mh(t)=="symbol"?t:t+""}function oN(e,t,r){return(t=iN(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function B4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function yp(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?B4(Object(r),!0).forEach(function(n){oN(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):B4(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var sN=class ZC{constructor(t,{headers:r={},schema:n,fetch:i,timeout:o,urlLengthLimit:s=8e3,retry:a}={}){this.url=t,this.headers=new Headers(r),this.schemaName=n,this.urlLengthLimit=s;const l=i??globalThis.fetch;o!==void 0&&o>0?this.fetch=(d,u)=>{const h=new AbortController,f=setTimeout(()=>h.abort(),o),p=u==null?void 0:u.signal;if(p){if(p.aborted)return clearTimeout(f),l(d,u);const m=()=>{clearTimeout(f),h.abort()};return p.addEventListener("abort",m,{once:!0}),l(d,yp(yp({},u),{},{signal:h.signal})).finally(()=>{clearTimeout(f),p.removeEventListener("abort",m)})}return l(d,yp(yp({},u),{},{signal:h.signal})).finally(()=>clearTimeout(f))}:this.fetch=l,this.retry=a}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new rN(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new ZC(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(t,r={},{head:n=!1,get:i=!1,count:o}={}){var s;let a;const l=new URL(`${this.url}/rpc/${t}`);let d;const u=p=>p!==null&&typeof p=="object"&&(!Array.isArray(p)||p.some(u)),h=n&&Object.values(r).some(u);h?(a="POST",d=r):n||i?(a=n?"HEAD":"GET",Object.entries(r).filter(([p,m])=>m!==void 0).map(([p,m])=>[p,Array.isArray(m)?`{${m.join(",")}}`:`${m}
15`]).forEach(([p,m])=>{l.searchParams.append(p,m)})):(a="POST",d=r);const f=new Headers(this.headers);return h?f.set("Prefer",o?`count=${o},return=minimal`:"return=minimal"):o&&f.set("Prefer",`count=${o}`),new Gc({method:a,url:l,headers:f,schema:this.schemaName,body:d,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class aN{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const r=globalThis.process;if(r){const n=r.versions;if(n&&n.node){const i=n.node,o=parseInt(i.replace(/^v/,"").split(".")[0]);return o>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${o} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${o} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: 16import ws from "ws" 17new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.constructor)return t.constructor;let r=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(r+=` 18 19Suggested solution: ${t.workaround}`),new Error(r)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const lN="2.103.0",cN=`realtime-js/${lN}`,uN="1.0.0",XC="2.0.0",dN=XC,hN=1e4,fN=100,Ia={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},JC={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"},h5={connecting:"connecting",open:"open",closing:"closing",closed:"closed"};class pN{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,r){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(t));let n=[t.join_ref,t.ref,t.topic,t.event,t.payload];return r(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(t){var r;return this._isArrayBuffer((r=t.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var r,n;const i=(n=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,i)}_encodeJsonUserBroadcastPush(t){var r,n;const i=(n=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:{},s=new TextEncoder().encode(JSON.stringify(i)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,s)}_encodeUserBroadcastPush(t,r,n){var i,o;const s=t.topic,a=(i=t.ref)!==null&&i!==void 0?i:"",l=(o=t.join_ref)!==null&&o!==void 0?o:"",d=t.payload.event,u=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},h=Object.keys(u).length===0?"":JSON.stringify(u);if(l.length>255)throw new Error(`joinRef length ${l.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`ref length ${a.length} exceeds maximum of 255`);if(s.length>255)throw new Error(`topic length ${s.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`userEvent length ${d.length} exceeds maximum of 255`);if(h.length>255)throw new Error(`metadata length ${h.length} exceeds maximum of 255`);const f=this.USER_BROADCAST_PUSH_META_LENGTH+l.length+a.length+s.length+d.length+h.length,p=new ArrayBuffer(this.HEADER_LENGTH+f);let m=new DataView(p),g=0;m.setUint8(g++,this.KINDS.userBroadcastPush),m.setUint8(g++,l.length),m.setUint8(g++,a.length),m.setUint8(g++,s.length),m.setUint8(g++,d.length),m.setUint8(g++,h.length),m.setUint8(g++,r),Array.from(l,b=>m.setUint8(g++,b.charCodeAt(0))),Array.from(a,b=>m.setUint8(g++,b.charCodeAt(0))),Array.from(s,b=>m.setUint8(g++,b.charCodeAt(0))),Array.from(d,b=>m.setUint8(g++,b.charCodeAt(0))),Array.from(h,b=>m.setUint8(g++,b.charCodeAt(0)));var y=new Uint8Array(p.byteLength+n.byteLength);return y.set(new Uint8Array(p),0),y.set(new Uint8Array(n),p.byteLength),y.buffer}decode(t,r){if(this._isArrayBuffer(t)){let n=this._binaryDecode(t);return r(n)}if(typeof t=="string"){const n=JSON.parse(t),[i,o,s,a,l]=n;return r({join_ref:i,ref:o,topic:s,event:a,payload:l})}return r({})}_binaryDecode(t){const r=new DataView(t),n=r.getUint8(0),i=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,r,i)}}_decodeUserBroadcast(t,r,n){const i=r.getUint8(1),o=r.getUint8(2),s=r.getUint8(3),a=r.getUint8(4);let l=this.HEADER_LENGTH+4;const d=n.decode(t.slice(l,l+i));l=l+i;
19const u=n.decode(t.slice(l,l+o));l=l+o;const h=n.decode(t.slice(l,l+s));l=l+s;const f=t.slice(l,t.byteLength),p=a===this.JSON_ENCODING?JSON.parse(n.decode(f)):f,m={type:this.BROADCAST_EVENT,event:u,payload:p};return s>0&&(m.meta=JSON.parse(h)),{join_ref:null,ref:null,topic:d,event:this.BROADCAST_EVENT,payload:m}}_isArrayBuffer(t){var r;return t instanceof ArrayBuffer||((r=t==null?void 0:t.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(t,r){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([n])=>r.includes(n)))}}var xr;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(xr||(xr={}));const V4=(e,t,r={})=>{var n;const i=(n=r.skipTypes)!==null&&n!==void 0?n:[];return t?Object.keys(t).reduce((o,s)=>(o[s]=mN(s,e,t,i),o),{}):{}},mN=(e,t,r,n)=>{const i=t.find(a=>a.name===e),o=i==null?void 0:i.type,s=r[e];return o&&!n.includes(o)?QC(o,s):f5(s)},QC=(e,t)=>{if(e.charAt(0)==="_"){const r=e.slice(1,e.length);return _N(t,r)}switch(e){case xr.bool:return gN(t);case xr.float4:case xr.float8:case xr.int2:case xr.int4:case xr.int8:case xr.numeric:case xr.oid:return vN(t);case xr.json:case xr.jsonb:return yN(t);case xr.timestamp:return bN(t);case xr.abstime:case xr.date:case xr.daterange:case xr.int4range:case xr.int8range:case xr.money:case xr.reltime:case xr.text:case xr.time:case xr.timestamptz:case xr.timetz:case xr.tsrange:case xr.tstzrange:return f5(t);default:return f5(t)}},f5=e=>e,gN=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},vN=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},yN=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},_N=(e,t)=>{if(typeof e!="string")return e;const r=e.length-1,n=e[r];if(e[0]==="{"&&n==="}"){let o;const s=e.slice(1,r);try{o=JSON.parse("["+s+"]")}catch{o=s?s.split(","):[]}return o.map(a=>QC(t,a))}return e},bN=e=>typeof e=="string"?e.replace(" ","T"):e,eT=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};var lh=e=>typeof e=="function"?e:function(){return e},xN=typeof self<"u"?self:null,Kc=typeof window<"u"?window:null,bi=xN||Kc||globalThis,wN="2.0.0",EN=1e4,SN=1e3,Ko={connecting:0,open:1,closing:2,closed:3},ui={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},ks={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},p5={longpoll:"longpoll",websocket:"websocket"},CN={complete:4},m5="base64url.bearer.phx.",_p=class{constructor(e,t,r,n){this.channel=e,this.event=t,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=n,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:r}){this.recHooks.filter(n=>n.status===e).forEach(n=>n.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},tT=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},TN=class{constructor(e,t,r){this.state=ui.closed,this.topic=e,this.params=lh(t||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new _p(this,ks.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new tT(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=ui.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(n=>n.send()),this.pushBuffer=[]}),this.joinPush.receive("error",n=>{this.state=ui.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=ui.closed,this.socket.remove(this)}),this.onError(n=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.isJoining()&&this.joinPush.reset(),this.state=ui.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new _p(this,ks.leave,lh({}),this.timeout).send(),this.state=ui.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(ks.reply,(n,i)=>{this.trigger(this.replyEventName(i),n)})}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}
vendor: 5,263 bytes, line 19
19teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=ui.closed,this.bindings=[]}onClose(e){this.on(ks.close,e)}onError(e){return this.on(ks.error,t=>e(t))}on(e,t){let r=this.bindingRef++;return this.bindings.push({event:e,ref:r,callback:t}),r}off(e,t){this.bindings=this.bindings.filter(r=>!(r.event===e&&(typeof t>"u"||t===r.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,r=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let n=new _p(this,e,function(){return t},r);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=ui.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(ks.close,"leave")},r=new _p(this,ks.leave,lh({}),e);return r.receive("ok",()=>t()).receive("timeout",()=>t()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(e,t,r){return t}filterBindings(e,t,r){return!0}isMember(e,t,r,n){return this.topic!==e?!1:n&&n!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:r,joinRef:n}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=ui.joining,this.joinPush.resend(e))}trigger(e,t,r,n){let i=this.onMessage(e,t,r,n);if(t&&!i)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let o=this.bindings.filter(s=>s.event===e&&this.filterBindings(s,t,r));for(let s=0;s<o.length;s++)o[s].callback(i,r,n||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===ui.closed}isErrored(){return this.state===ui.errored}isJoined(){return this.state===ui.joined}isJoining(){return this.state===ui.joining}isLeaving(){return this.state===ui.leaving}},r1=class{static request(e,t,r,n,i,o,s){if(bi.XDomainRequest){let a=new bi.XDomainRequest;return this.xdomainRequest(a,e,t,n,i,o,s)}else if(bi.XMLHttpRequest){let a=new bi.XMLHttpRequest;return this.xhrRequest(a,e,t,r,n,i,o,s)}else{if(bi.fetch&&bi.AbortController)return this.fetchRequest(e,t,r,n,i,o,s);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(e,t,r,n,i,o,s){let a={method:e,headers:r,body:n},l=null;return i&&(l=new AbortController,setTimeout(()=>l.abort(),i),a.signal=l.signal),bi.fetch(t,a).then(d=>d.text()).then(d=>this.parseJSON(d)).then(d=>s&&s(d)).catch(d=>{d.name==="AbortError"&&o?o():s&&s(null)}),l}static xdomainRequest(e,t,r,n,i,o,s){return e.timeout=i,e.open(t,r),e.onload=()=>{let a=this.parseJSON(e.responseText);s&&s(a)},o&&(e.ontimeout=o),e.onprogress=()=>{},e.send(n),e}static xhrRequest(e,t,r,n,i,o,s,a){e.open(t,r,!0),e.timeout=o;for(let[l,d]of Object.entries(n))e.setRequestHeader(l,d);return e.onerror=()=>a&&a(null),e.onreadystatechange=()=>{if(e.readyState===CN.complete&&a){let l=this.parseJSON(e.responseText);a(l)}},s&&(e.ontimeout=s),e.send(i),e}static parseJSON(e){if(!e||e==="")return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let r=[];for(var n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let i=t?`${t}[${n}]`:n,o=e[n];typeof o=="object"?r.push(this.serialize(o,i)):r.push(encodeURIComponent(i)+"="+encodeURIComponent(o))}return r.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let r=e.match(/\?/)?"&":"?";return`${e}${r}${this.serialize(t)}`}},AN=e=>{let t="",r=new Uint8Array(e),n=r.byteLength;for(let i=0;i<n;i++)t+=String.fromCharCode(r[i]);return btoa(t)},Ic=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(m5)&&(this.authToken=atob(t[1].slice(m5.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=Ko.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+p5.websocket),"$1/"+p5.longpoll)}endpointURL(){return r1.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,r){this.close(e,t,r),this.readyState=Ko.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===Ko.open||this.readyState===Ko.connecting}poll(){const e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),t=>{if(t){var{status:r,token:n,messages:i}=t;if(r===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=n}else r=0;switch(r){case 200:i.forEach(o=>{setTimeout(()=>this.onmessage({data:o}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=Ko.open,this.onopen({}),this.poll();break;
19case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${r}`)}})}send(e){typeof e!="string"&&(e=AN(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},e.join(` 20`),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=!1,!t||t.status!==200?(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(e,t,r){for(let i of this.reqs)i.abort();this.readyState=Ko.closed;let n=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",n)):this.onclose(n)}ajax(e,t,r,n,i){let o,s=()=>{this.reqs.delete(o),n()};o=r1.request(e,this.endpointURL(),t,r,this.timeout,s,a=>{this.reqs.delete(o),this.isActive()&&i(a)}),this.reqs.add(o)}},kN=class Yd{constructor(t,r={}){let n=r.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(n.state,i=>{let{onJoin:o,onLeave:s,onSync:a}=this.caller;this.joinRef=this.channel.joinRef(),this.state=Yd.syncState(this.state,i,o,s),this.pendingDiffs.forEach(l=>{this.state=Yd.syncDiff(this.state,l,o,s)}),this.pendingDiffs=[],a()}),this.channel.on(n.diff,i=>{let{onJoin:o,onLeave:s,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=Yd.syncDiff(this.state,i,o,s),a())})}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}list(t){return Yd.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(t,r,n,i){let o=this.clone(t),s={},a={};return this.map(o,(l,d)=>{r[l]||(a[l]=d)}),this.map(r,(l,d)=>{let u=o[l];if(u){let h=d.metas.map(g=>g.phx_ref),f=u.metas.map(g=>g.phx_ref),p=d.metas.filter(g=>f.indexOf(g.phx_ref)<0),m=u.metas.filter(g=>h.indexOf(g.phx_ref)<0);p.length>0&&(s[l]=d,s[l].metas=p),m.length>0&&(a[l]=this.clone(u),a[l].metas=m)}else s[l]=d}),this.syncDiff(o,{joins:s,leaves:a},n,i)}static syncDiff(t,r,n,i){let{joins:o,leaves:s}=this.clone(r);return n||(n=function(){}),i||(i=function(){}),this.map(o,(a,l)=>{let d=t[a];if(t[a]=this.clone(l),d){let u=t[a].metas.map(f=>f.phx_ref),h=d.metas.filter(f=>u.indexOf(f.phx_ref)<0);t[a].metas.unshift(...h)}n(a,d,l)}),this.map(s,(a,l)=>{let d=t[a];if(!d)return;let u=l.metas.map(h=>h.phx_ref);d.metas=d.metas.filter(h=>u.indexOf(h.phx_ref)<0),i(a,d,l),d.metas.length===0&&delete t[a]}),t}static list(t,r){return r||(r=function(n,i){return i}),this.map(t,(n,i)=>r(n,i))}static map(t,r){return Object.getOwnPropertyNames(t).map(n=>r(n,t[n]))}static clone(t){return JSON.parse(JSON.stringify(t))}},bp={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let r=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(r))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[r,n,i,o,s]=JSON.parse(e);return t({join_ref:r,ref:n,topic:i,event:o,payload:s})}},binaryEncode(e){let{join_ref:t,ref:r,event:n,topic:i,payload:o}=e,s=this.META_LENGTH+t.length+r.length+i.length+n.length,a=new ArrayBuffer(this.HEADER_LENGTH+s),l=new DataView(a),d=0;l.setUint8(d++,this.KINDS.push),l.setUint8(d++,t.length),l.setUint8(d++,r.length),l.setUint8(d++,i.length),l.setUint8(d++,n.length),Array.from(t,h=>l.setUint8(d++,h.charCodeAt(0))),Array.from(r,h=>l.setUint8(d++,h.charCodeAt(0))),Array.from(i,h=>l.setUint8(d++,h.charCodeAt(0))),Array.from(n,h=>l.setUint8(d++,h.charCodeAt(0)));var u=new Uint8Array(a.byteLength+o.byteLength);return u.set(new Uint8Array(a),0),u.set(new Uint8Array(o),a.byteLength),u.buffer},binaryDecode(e){let t=new DataView(e),r=t.getUint8(0),n=new TextDecoder;
20switch(r){case this.KINDS.push:return this.decodePush(e,t,n);case this.KINDS.reply:return this.decodeReply(e,t,n);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,n)}},decodePush(e,t,r){let n=t.getUint8(1),i=t.getUint8(2),o=t.getUint8(3),s=this.HEADER_LENGTH+this.META_LENGTH-1,a=r.decode(e.slice(s,s+n));s=s+n;let l=r.decode(e.slice(s,s+i));s=s+i;let d=r.decode(e.slice(s,s+o));s=s+o;let u=e.slice(s,e.byteLength);return{join_ref:a,ref:null,topic:l,event:d,payload:u}},decodeReply(e,t,r){let n=t.getUint8(1),i=t.getUint8(2),o=t.getUint8(3),s=t.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,l=r.decode(e.slice(a,a+n));a=a+n;let d=r.decode(e.slice(a,a+i));a=a+i;let u=r.decode(e.slice(a,a+o));a=a+o;let h=r.decode(e.slice(a,a+s));a=a+s;let f=e.slice(a,e.byteLength),p={status:h,response:f};return{join_ref:l,ref:d,topic:u,event:ks.reply,payload:p}},decodeBroadcast(e,t,r){let n=t.getUint8(1),i=t.getUint8(2),o=this.HEADER_LENGTH+2,s=r.decode(e.slice(o,o+n));o=o+n;let a=r.decode(e.slice(o,o+i));o=o+i;let l=e.slice(o,e.byteLength);return{join_ref:null,ref:null,topic:s,event:a,payload:l}}},RN=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||EN,this.transport=t.transport||bi.WebSocket||Ic,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||bi&&bi.sessionStorage,this.establishedConnections=0,this.defaultEncoder=bp.encode.bind(bp),this.defaultDecoder=bp.decode.bind(bp),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==Ic?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let r=null;Kc&&Kc.addEventListener&&(Kc.addEventListener("pagehide",n=>{this.conn&&(this.disconnect(),r=this.connectClock)}),Kc.addEventListener("pageshow",n=>{r===this.connectClock&&(r=null,this.connect())}),Kc.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=n=>t.rejoinAfterMs?t.rejoinAfterMs(n):[1e3,2e3,5e3][n-1]||1e4,this.reconnectAfterMs=n=>t.reconnectAfterMs?t.reconnectAfterMs(n):[10,50,100,150,200,250,500,1e3,2e3][n-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(n,i,o)=>{console.log(`${n}: ${i}`,o)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=lh(t.params||{}),this.endPoint=`${e}/${p5.websocket}`,this.vsn=t.vsn||wN,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new tT(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return Ic}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=r1.appendParams(r1.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,r){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,r)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=lh(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Ic?this.connectWithF
vendor: 4,339 bytes, line 20
20allback(Ic,this.longPollFallbackMs):this.transportConnect())}log(e,t,r){this.logger&&this.logger(e,t,r)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let n=this.onMessage(i=>{i.ref===t&&(this.off([n]),e(Date.now()-r))});return!0}transportName(e){switch(e){case Ic:return"LongPoll";default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=["phoenix",`${m5}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=t=>this.onConnError(t),this.conn.onmessage=t=>this.onConnMessage(t),this.conn.onclose=t=>this.onConnClose(t)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let r=!1,n=!0,i,o,s=this.transportName(e),a=l=>{this.log("transport",`falling back to ${s}...`,l),this.off([i,o]),n=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${s}`))return a("memorized");this.fallbackTimer=setTimeout(a,t),o=this.onError(l=>{this.log("transport","error",l),n&&!r&&(clearTimeout(this.fallbackTimer),a(l))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(r=!0,!n){let l=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${l}`,"true"),this.log("transport",`established ${l} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(a,t),this.ping(l=>{this.log("transport","connected to primary after",l),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(e){this.log("error","error in heartbeat callback",e)}this.triggerChanError(),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),SN,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,r){if(!this.conn)return e&&e();const n=this.conn;this.waitForBufferDone(n,()=>{t?n.close(t,r||""):n.close(),this.waitForSocketClosed(n,()=>{this.conn===n&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,r=1){if(r===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,r+1)},150*r)}waitForSocketClosed(e,t,r=1){if(r===5||e.readyState===Ko.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,r+1)},150*r)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport",e);let t=this.transport,r=this.establishedConnections;this.triggerStateCallbacks("error",e,t,r),(t===this.transport||r>0)&&this.triggerChanError()}
20triggerChanError(){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(ks.error)})}connectionState(){switch(this.conn&&this.conn.readyState){case Ko.connecting:return"connecting";case Ko.open:return"open";case Ko.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([r])=>e.indexOf(r)===-1)}channel(e,t={}){let r=new TN(e,t,this);return this.channels.push(r),r}push(e){if(this.hasLogger()){let{topic:t,event:r,payload:n,ref:i,join_ref:o}=e;this.log("push",`${t} ${r} (${o}, ${i})`,n)}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(e){this.log("error","error in heartbeat callback",e)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(e){this.log("error","error in heartbeat callback",e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,t=>{let{topic:r,event:n,payload:i,ref:o,join_ref:s}=t;if(o&&o===this.pendingHeartbeatRef){const a=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(i.status==="ok"?"ok":"error",a)}catch(l){this.log("error","error in heartbeat callback",l)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${i.status||""} ${r} ${n} ${o&&"("+o+")"||""}`.trim(),i);for(let a=0;a<this.channels.length;a++){const l=this.channels[a];l.isMember(r,n,i,s)&&l.trigger(n,i,o,s)}this.triggerStateCallbacks("message",t)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([r,n])=>{try{n(...t)}catch(i){this.log("error",`error in ${e} callback`,i)}})}catch(r){this.log("error",`error triggering ${e} callbacks`,r)}}leaveOpenTopic(e){let t=this.channels.find(r=>r.topic===e&&(r.isJoined()||r.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};class ch{constructor(t,r){const n=PN(r);this.presence=new kN(t.getChannel(),n),this.presence.onJoin((i,o,s)=>{const a=ch.onJoinPayload(i,o,s);t.getChannel().trigger("presence",a)}),this.presence.onLeave((i,o,s)=>{const a=ch.onLeavePayload(i,o,s);t.getChannel().trigger("presence",a)}),this.presence.onSync(()=>{t.getChannel().trigger("presence",{event:"sync"})})}get state(){return ch.transformState(this.presence.state)}static transformState(t){return t=IN(t),Object.getOwnPropertyNames(t).reduce((r,n)=>{const i=t[n];return r[n]=y0(i),r},{})}static onJoinPayload(t,r,n){const i=H4(r),o=y0(n);return{event:"join",key:t,currentPresences:i,newPresences:o}}static onLeavePayload(t,r,n){const i=H4(r),o=y0(n);return{event:"leave",key:t,currentPresences:i,leftPresences:o}}}function y0(e){return e.metas.map(t=>(t.presence_ref=t.phx_ref,delete t.phx_ref,delete t.phx_ref_prev,t))}function IN(e){return JSON.parse(JSON.stringify(e))}function PN(e){return(e==null?void 0:e.events)&&{events:e.events}}function H4(e){return e!=null&&e.metas?y0(e):[]}var z4;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(z4||(z4={}));class ON{get state(){return this.presenceAdapter.state}constructor(t,r){this.channel=t,this.presenceAdapter=new ch(this.channel.channelAdapter,r)}}class jN{constructor(t,r,n){const i=LN(n);this.channel=t.getSocket().channel(r,i),this.socket=t}get state(){return this.channel.state}set state(t){this.channel.state=t}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(t,r){return this.channel.on(t,r)}off(t,r){this.channel.off(t,r)}subscribe(t){return this.channel.join(t)}unsubscribe(t){return this.channel.leave(t)}teardown(){this.channel.teardown()}onClose(t){this.channel.onClose(t)}onError(t){return this.channel.onError(t)}push(t,r,n){let i;try{i=this.channel.push(t,r,n)}catch{throw`tried to push '${t}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`}if(this.channel.pushBuffer.length>fN){const o=this.channel.pushBuffer.shift();o.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${o.event}`,o.payload())}return i}updateJoinPayload(t){const r=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},r),t)}canPush(){return this.socket.isConnected()&&this.state===Ia.joined}isJoined(){return this.state===Ia.joined}isJoining(){return this.state===Ia.joining}isClosed(){return this.state===Ia.closed}isLeaving(){return this.state===Ia.leaving}updateFilterBindings(t){this.channel.filterBindings=t}updatePayloadTransform(t){this.channel.onMessage=t}getChannel(){return this.channel}}function LN(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}var W4;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(W4||(W4={}));var Qc;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Qc||(Qc={}));var Rs;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Rs||(Rs={}));class uh{get state(){return this.channelAdapter.state}set state(t){this.channelAdapter.state=t}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(t,r={config:{}},n){var i,o;if(this.topic=t,this.params=r,this.socket=n,this.bindings={},this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.channelAdapter=new jN(this.socket.socketAdapter,t,this.params),this.presence=new ON(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=eT(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((o=(i=this.params.config)===null||i===void 0?void 0:i.broadcast)===null||o===void 0)&&o.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(t,r=this.timeout){var n,i,o;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:s,presence:a,private:l}}=this.params,d=(i=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(p=>p.filter))!==null&&i!==void 0?i:[],u=!!this.bindings[Qc.PRESENCE]&&this.bindings[Qc.PRESENCE].length>0||((o=this.params.config.presence)===null||o===void 0?void 0:o.enabled)===!0,h={},f={broadcast:s,presence:Object.assign(Object.assign({},a),{enabled:u}),postgres_changes:d,private:l};this.socket.accessTokenValue&&(h.access_token=this.socket.accessTokenValue),this._onError(p=>{t==null||t(Rs.CHANNEL_ERROR,p)}),this._onClose(()=>t==null?void 0:t(Rs.CLOSED)),this.updateJoinPayload(Object.assign({config:f},h)),this._updateFilterMessage(),this.channelAdapter.subscribe(r).receive("ok",async({postgres_changes:p})=>{if(this.socket._isManualToken()||this.socket.setAuth(),p===void 0){t==null||t(Rs.SUBSCRIBED);return}this._updatePostgresBindings(p,t)}
20).receive("error",p=>{this.state=Ia.errored,t==null||t(Rs.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(p).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(Rs.TIMED_OUT)})}return this}_updatePostgresBindings(t,r){var n;const i=this.bindings.postgres_changes,o=(n=i==null?void 0:i.length)!==null&&n!==void 0?n:0,s=[];for(let a=0;a<o;a++){const l=i[a],{filter:{event:d,schema:u,table:h,filter:f}}=l,p=t&&t[a];if(p&&p.event===d&&uh.isFilterValueEqual(p.schema,u)&&uh.isFilterValueEqual(p.table,h)&&uh.isFilterValueEqual(p.filter,f))s.push(Object.assign(Object.assign({},l),{id:p.id}));else{this.unsubscribe(),this.state=Ia.errored,r==null||r(Rs.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=s,this.state!=Ia.errored&&r&&r(Rs.SUBSCRIBED)}presenceState(){return this.presence.state}async track(t,r={}){return await this.send({type:"presence",event:"track",payload:t},r.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,r,n){const i=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),o=t===Qc.PRESENCE||t===Qc.POSTGRES_CHANGES;if(i&&o)throw this.socket.log("channel",`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(t,r,n)}async httpSend(t,r,n={}){var i;if(r==null)return Promise.reject("Payload is required for httpSend()");const o={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(o.Authorization=`Bearer ${this.socket.accessTokenValue}`);const s={method:"POST",headers:o,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:r,private:this.private}]})},a=await this._fetchWithTimeout(this.broadcastEndpointURL,s,(i=n.timeout)!==null&&i!==void 0?i:this.timeout);if(a.status===202)return{success:!0};let l=a.statusText;try{const d=await a.json();l=d.error||d.message||l}catch{}return Promise.reject(new Error(l))}async send(t,r={}){var n,i;if(!this.channelAdapter.canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated
20in the future. Please use httpSend() explicitly for REST delivery.");const{event:o,payload:s}=t,a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);const l={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:o,payload:s,private:this.private}]})};try{const d=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((i=d.body)===null||i===void 0?void 0:i.cancel()),d.ok?"ok":"error"}catch(d){return d.name==="AbortError"?"timed out":"error"}}else return new Promise(o=>{var s,a,l;const d=this.channelAdapter.push(t.type,t,r.timeout||this.timeout);t.type==="broadcast"&&!(!((l=(a=(s=this.params)===null||s===void 0?void 0:s.config)===null||a===void 0?void 0:a.broadcast)===null||l===void 0)&&l.ack)&&o("ok"),d.receive("ok",()=>o("ok")),d.receive("error",()=>o("error")),d.receive("timeout",()=>o("timed out"))})}updateJoinPayload(t){this.channelAdapter.updateJoinPayload(t)}async unsubscribe(t=this.timeout){return new Promise(r=>{this.channelAdapter.unsubscribe(t).receive("ok",()=>r("ok")).receive("timeout",()=>r("timed out")).receive("error",()=>r("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(t,r,n){const i=new AbortController,o=setTimeout(()=>i.abort(),n),s=await this.socket.fetch(t,Object.assign(Object.assign({},r),{signal:i.signal}));return clearTimeout(o),s}_on(t,r,n){const i=t.toLocaleLowerCase(),o=this.channelAdapter.on(t,n),s={type:i,filter:r,callback:n,ref:o};return this.bindings[i]?this.bindings[i].push(s):this.bindings[i]=[s],this._updateFilterMessage(),this}_onClose(t){this.channelAdapter.onClose(t)}_onError(t){this.channelAdapter.onError(t)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((t,r,n)=>{var i,o,s,a,l,d,u;const h=t.event.toLocaleLowerCase();if(this._notThisChannelEvent(h,n))return!1;const f=(i=this.bindings[h])===null||i===void 0?void 0:i.find(p=>p.ref===t.ref);if(!f)return!0;if(["broadcast","presence","postgres_changes"].includes(h))if("id"in f){const p=f.id,m=(o=f.filter)===null||o===void 0?void 0:o.event;return p&&((s=r.ids)===null||s===void 0?void 0:s.includes(p))&&(m==="*"||(m==null?void 0:m.toLocaleLowerCase())===((a=r.data)===null||a===void 0?void 0:a.type.toLocaleLowerCase()))}else{const p=(d=(l=f==null?void 0:f.filter)===null||l===void 0?void 0:l.event)===null||d===void 0?void 0:d.toLocaleLowerCase();return p==="*"||p===((u=r==null?void 0:r.event)===null||u===void 0?void 0:u.toLocaleLowerCase())}else return f.type.toLocaleLowerCase()===h})}_notThisChannelEvent(t,r){const{close:n,error:i,leave:o,join:s}=JC;return r&&[n,i,o,s].includes(t)&&r!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((t,r,n)=>{if(typeof r=="object"&&"ids"in r){const i=r.data,{schema:o,table:s,commit_timestamp:a,type:l,errors:d}=i;return Object.assign(Object.assign({},{schema:o,table:s,commit_timestamp:a,eventType:l,new:{},old:{},errors:d}),this._getPayloadRecords(i))}return r})}copyBindings(t){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const r in t.bindings)for(const n of t.bindings[r])this._on(n.type,n.filter,n.callback)}static isFilterValueEqual(t,r){return(t??void 0)===(r??void 0)}_getPayloadRecords(t){const r={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(r.new=V4(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(r.old=V4(t.columns,t.old_record)),r}}class $N{constructor(t,r){this.socket=new RN(t,r)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(t){this.socket.heartbeatCallback=t}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(t,r,n,i=1e4){return new Promise(o=>{setTimeout(()=>
20o("timeout"),i),this.socket.disconnect(()=>{t(),o("ok")},r,n)})}push(t){this.socket.push(t)}log(t,r,n){this.socket.log(t,r,n)}makeRef(){return this.socket.makeRef()}onOpen(t){this.socket.onOpen(t)}onClose(t){this.socket.onClose(t)}onError(t){this.socket.onError(t)}onMessage(t){this.socket.onMessage(t)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==h5.connecting}isDisconnecting(){return this.socket.connectionState()==h5.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const DN={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},MN=[1e3,2e3,5e3,1e4],NN=1e4,FN=` 21 addEventListener("message", (e) => { 22 if (e.data.event === "start") { 23 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 24 } 25 });`;class UN{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(t,r){var n;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={},this.ref=0,this.serializer=new pN,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._resolveFetch=o=>o?(...s)=>o(...s):(...s)=>fetch(...s),!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey;const i=this._initializeOptions(r);this.socketAdapter=new $N(t,i),this.httpEndpoint=eT(t),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(t){const r=t.message;throw r.includes("Node.js")?new Error(`${r} 26 27To use Realtime in Node.js, you need to provide a WebSocket implementation: 28 29Option 1: Use Node.js 22+ which has native WebSocket support 30Option 2: Install and provide the "ws" package: 31 32 npm install ws 33 34 import ws from "ws" 35 const client = new RealtimeClient(url, { 36 ...options, 37 transport: ws 38 })`):new Error(`WebSocket not available: ${r}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(t,r){return this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},t,r)}getChannels(){return this.channels}async removeChannel(t){const r=await t.unsubscribe();return r==="ok"&&t.teardown(),this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){const t=this.channels.map(async n=>{const i=await n.unsubscribe();return n.teardown(),i}),r=await Promise.all(t);return this.disconnect(),r}log(t,r,n){this.socketAdapter.log(t,r,n)}connectionState(){return this.socketAdapter.connectionState()||h5.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(t,r={config:{}}){const n=`realtime:${t}`,i=this.getChannels().find(o=>o.topic===n);if(i)return i;{const o=new uh(`realtime:${t}`,r,this);return this.channels.push(o),o}}push(t){this.socketAdapter.push(t)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(t){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(t)}_makeRef(){return this.socketAdapter.makeRef()}_remove(t){this.channels=this.channels.filter(r=>r.topic!==t.topic)}async _performAuth(t=null){let r,n=!1;if(t)r=t,n=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(i){this.log("error","Error fetching access token from callback",i),r=this.accessTokenValue}else r=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEac
38h(i=>{const o={access_token:r,version:cN};r&&i.updateJoinPayload(o),i.joinedOnce&&i.channelAdapter.isJoined()&&i.channelAdapter.push(JC.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${t}`,r)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(r=>{this.log("error","error waiting for auth on connect",r)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(t=>{t.ref&&t.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(t){return(r,n)=>{r=="sent"&&this._setAuthSafely(),t&&t(r,n)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(t){let r;if(t)r=t;else{const n=new Blob([FN],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_initializeOptions(t){var r,n,i,o,s,a,l,d,u;this.worker=(r=t==null?void 0:t.worker)!==null&&r!==void 0?r:!1,this.accessToken=(n=t==null?void 0:t.accessToken)!==null&&n!==void 0?n:null;const h={};h.timeout=(i=t==null?void 0:t.timeout)!==null&&i!==void 0?i:hN,h.heartbeatIntervalMs=(o=t==null?void 0:t.heartbeatIntervalMs)!==null&&o!==void 0?o:DN.HEARTBEAT_INTERVAL,h.transport=(s=t==null?void 0:t.transport)!==null&&s!==void 0?s:aN.getWebSocketConstructor(),h.params=t==null?void 0:t.params,h.logger=t==null?void 0:t.logger,h.heartbeatCallback=this._wrapHeartbeatCallback(t==null?void 0:t.heartbeatCallback),h.reconnectAfterMs=(a=t==null?void 0:t.reconnectAfterMs)!==null&&a!==void 0?a:g=>MN[g-1]||NN;let f,p;const m=(l=t==null?void 0:t.vsn)!==null&&l!==void 0?l:dN;switch(m){case uN:f=(g,y)=>y(JSON.stringify(g)),p=(g,y)=>y(JSON.parse(g));break;case XC:f=this.serializer.encode.bind(this.serializer),p=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${h.vsn}`)}if(h.vsn=m,h.encode=(d=t==null?void 0:t.encode)!==null&&d!==void 0?d:f,h.decode=(u=t==null?void 0:t.decode)!==null&&u!==void 0?u:p,h.beforeReconnect=this._reconnectAuth.bind(this),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,h.params=Object.assign(Object.assign({},h.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl,h.autoSendHeartbeat=!this.worker}return h}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var Nh=class extends Error{constructor(e,t){var r;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((r=t.icebergType)==null?void 0:r.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function BN(e,t,r){const n=new URL(t,e);if(r)for(const[i,o]of Object.entries(r))o!==void 0&&n.searchParams.set(i,o);return n.toString()}async function VN(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function HN(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:i,body:o,headers:s}){const a=BN(e.baseUrl,n,i),l=await VN(e.auth),d=await t(a,{method:r,headers:{...o?{"Content-Type":"application/json"}:{},...l,...s},body:o?JSON.stringify(o):void 0}),u=await d.text(),h=(d.headers.get("content-type")||"").includes("application/json"),f=h&&u?JSON.parse(u):u;if(!d.ok){const p=h?f:void 0,m=p==null?void 0:p.error;throw new Nh((m==null?void 0:m.message)??`Request failed with status ${d.status}`,{status:d.status,icebergType:m==null?void 0:m.type,icebergCode:m==null?void 0:m.code,details:p})}return{status:d.status,headers:d.headers,data:f}}}}function xp(e){return e.join("�")}var zN=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:xp(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(n=>({namespace:n}))}async createNamespace(e,t){const r={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${xp(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${xp(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${xp(e.namespace)}`}),!0}catch(t){if(t instanceof Nh&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(r){if(r instanceof Nh&&r.status===409)return;throw r}}};function Pc(e){return e.join("�")}var WN=class{constructor(e,t="",r){this.client=e,this.prefix=t,this.accessDelegation=r}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Pc(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Pc(e.namespace)}/tables`,body:t,headers:r})).data.metadata}async updateTable(e,t){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Pc(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Pc(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((t==null?void 0:t.purge)??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Pc(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Pc(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(r){if(r instanceof Nh&&r.status===404)return!1;throw r}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof Nh&&r.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},qN=class{constructor(e){var n;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=HN({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(n=e.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new zN(this.client,t),this.tableOps=new WN(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}
38async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}},Nm=class extends Error{constructor(e,t="storage",r,n){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=n}};function Fm(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var g5=class extends Nm{constructor(e,t,r,n="storage"){super(e,n,t,r),this.name=n==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},rT=class extends Nm{constructor(e,t,r="storage"){super(e,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};const GN=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),KN=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},v5=e=>{if(Array.isArray(e))return e.map(r=>v5(r));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([r,n])=>{const i=r.replace(/([-_][a-z])/gi,o=>o.toUpperCase().replace(/[-_]/g,""));t[i]=v5(n)}),t},YN=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e);function Fh(e){"@babel/helpers - typeof";return Fh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fh(e)}function ZN(e,t){if(Fh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Fh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function XN(e){var t=ZN(e,"string");return Fh(t)=="symbol"?t:t+""}function JN(e,t,r){return(t=XN(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function q4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function wt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?q4(Object(r),!0).forEach(function(n){JN(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q4(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}const G4=e=>{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},QN=async(e,t,r,n)=>{if(e!==null&&typeof e=="object"&&typeof e.json=="function"){const i=e;let o=parseInt(i.status,10);Number.isFinite(o)||(o=500),i.json().then(s=>{const a=(s==null?void 0:s.statusCode)||(s==null?void 0:s.code)||o+"";t(new g5(G4(s),o,a,n))}).catch(()=>{const s=o+"";t(new g5(i.statusText||`HTTP ${o} error`,o,s,n))})}else t(new rT(G4(e),e,n))},eF=(e,t,r,n)=>{const i={method:e,headers:(t==null?void 0:t.headers)||{}};if(e==="GET"||e==="HEAD"||!n)return wt(wt({},i),r);if(KN(n)){var o;const s=(t==null?void 0:t.headers)||{};let a;for(const[l,d]of Object.entries(s))l.toLowerCase()==="content-type"&&(a=d);i.headers=tF(s,"Content-Type",(o=a)!==null&&o!==void 0?o:"application/json"),i.body=JSON.stringify(n)}else i.body=n;return t!=null&&t.duplex&&(i.duplex=t.duplex),wt(wt({},i),r)};function tF(e,t,r){const n=wt({},e);for(const i of Object.keys(n))i.toLowerCase()===t.toLowerCase()&&delete n[i];return n[t]=r,n}async function Ad(e,t,r,n,i,o,s){return new Promise((a,l)=>{e(r,eF(t,n,i,o)).then(d=>{if(!d.ok)throw d;if(n!=null&&n.noResolveJson)return d;if(s==="vectors"){const u=d.headers.get("content-type");if(d.headers.get("content-length")==="0"||d.status===204)return{};if(!u||!u.includes("application/json"))return{}}return d.json()}).then(d=>
38a(d)).catch(d=>QN(d,l,n,s))})}function nT(e="storage"){return{get:async(t,r,n,i)=>Ad(t,"GET",r,n,i,void 0,e),post:async(t,r,n,i,o)=>Ad(t,"POST",r,i,o,n,e),put:async(t,r,n,i,o)=>Ad(t,"PUT",r,i,o,n,e),head:async(t,r,n,i)=>Ad(t,"HEAD",r,wt(wt({},n),{},{noResolveJson:!0}),i,void 0,e),remove:async(t,r,n,i,o)=>Ad(t,"DELETE",r,i,o,n,e)}}const rF=nT("storage"),{get:Uh,post:yo,put:y5,head:nF,remove:N_}=rF,$i=nT("vectors");var Zu=class{constructor(e,t={},r,n="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=Object.fromEntries(Object.entries(t).map(([i,o])=>[i.toLowerCase(),o])),this.fetch=GN(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=wt(wt({},this.headers),{},{[e.toLowerCase()]:t}),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Fm(r))return{data:null,error:r};throw r}}},iF=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Fm(t))return{data:null,error:t};throw t}}};let iT;iT=Symbol.toStringTag;var oF=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[iT]="BlobDownloadBuilder",this.promise=null}asStream(){return new iF(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Fm(t))return{data:null,error:t};throw t}}};const sF={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},K4={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var aF=class extends Zu{constructor(e,t={},r,n){super(e,t,n,"storage"),this.bucketId=r}async uploadOrUpdate(e,t,r,n){var i=this;return i.handleOperation(async()=>{let o;const s=wt(wt({},K4),n);let a=wt(wt({},i.headers),e==="POST"&&{"x-upsert":String(s.upsert)});const l=s.metadata;typeof Blob<"u"&&r instanceof Blob?(o=new FormData,o.append("cacheControl",s.cacheControl),l&&o.append("metadata",i.encodeMetadata(l)),o.append("",r)):typeof FormData<"u"&&r instanceof FormData?(o=r,o.has("cacheControl")||o.append("cacheControl",s.cacheControl),l&&!o.has("metadata")&&o.append("metadata",i.encodeMetadata(l))):(o=r,a["cache-control"]=`max-age=${s.cacheControl}`,a["content-type"]=s.contentType,l&&(a["x-metadata"]=i.toBase64(i.encodeMetadata(l))),(typeof ReadableStream<"u"&&o instanceof ReadableStream||o&&typeof o=="object"&&"pipe"in o&&typeof o.pipe=="function")&&!s.duplex&&(s.duplex="half")),n!=null&&n.headers&&(a=wt(wt({},a),n.headers));const d=i._removeEmptyFolders(t),u=i._getFinalPath(d),h=await(e=="PUT"?y5:yo)(i.fetch,`${i.url}/object/${u}`,o,wt({headers:a},s!=null&&s.duplex?{duplex:s.duplex}:{}));return{path:d,id:h.Id,fullPath:h.Key}})}async upload(e,t,r){return this.uploadOrUpdate("POST",e,t,r)}async uploadToSignedUrl(e,t,r,n){var i=this;const o=i._removeEmptyFolders(e),s=i._getFinalPath(o),a=new URL(i.url+`/object/upload/sign/${s}`);return a.searchParams.set("token",t),i.handleOperation(async()=>{let l;const d=wt(wt({},K4),n),u=wt(wt({},i.headers),{"x-upsert":String(d.upsert)});return typeof Blob<"u"&&r instanceof Blob?(l=new FormData,l.append("cacheControl",d.cacheControl),l.append("",r)):typeof FormData<"u"&&r instanceof FormData?(l=r,l.append("cacheControl",d.cacheControl)):(l=r,u["cache-control"]=`max-age=${d.cacheControl}`,u["content-type"]=d.contentType),{path:o,fullPath:(await y5(i.fetch,a.toString(),l,{headers:u})).Key}})}async createSignedUploadUrl(e,t){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(e);const i=wt({},r.headers);t!=null&&t.upsert&&(i["x-upsert"]="true");const o=await yo(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:i}),s=new URL(r.url+o.url),a=s.searchParams.get("token");if(!a)throw new Nm("No token returned by API");return{signedUrl:s.toString(),path:e,token:a}})}async update(e,t,r){return this.uploadOrUpdate("PUT",e,t,r)}async move(e,t,r){var n=this;return n.handleOperation(async()=>await yo(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,de
38stinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers}))}async copy(e,t,r){var n=this;return n.handleOperation(async()=>({path:(await yo(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers})).Key}))}async createSignedUrl(e,t,r){var n=this;return n.handleOperation(async()=>{let i=n._getFinalPath(e);const o=typeof(r==null?void 0:r.transform)=="object"&&r.transform!==null&&Object.keys(r.transform).length>0;let s=await yo(n.fetch,`${n.url}/object/sign/${i}`,wt({expiresIn:t},o?{transform:r.transform}:{}),{headers:n.headers});const a=new URLSearchParams;r!=null&&r.download&&a.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&a.set("cacheNonce",String(r.cacheNonce));const l=a.toString(),d=o&&s.signedURL.includes("/object/sign/")?s.signedURL.replace("/object/sign/","/render/image/sign/"):s.signedURL;return{signedUrl:encodeURI(`${n.url}${d}${l?`&${l}`:""}`)}})}async createSignedUrls(e,t,r){var n=this;return n.handleOperation(async()=>{const i=await yo(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:t,paths:e},{headers:n.headers}),o=new URLSearchParams;r!=null&&r.download&&o.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&o.set("cacheNonce",String(r.cacheNonce));const s=o.toString();return i.map(a=>wt(wt({},a),{},{signedUrl:a.signedURL?encodeURI(`${n.url}${a.signedURL}${s?`&${s}`:""}`):null}))})}download(e,t,r){const n=typeof(t==null?void 0:t.transform)<"u"?"render/image/authenticated":"object",i=new URLSearchParams;t!=null&&t.transform&&this.applyTransformOptsToQuery(i,t.transform),(t==null?void 0:t.cacheNonce)!=null&&i.set("cacheNonce",String(t.cacheNonce));const o=i.toString(),s=this._getFinalPath(e),a=()=>Uh(this.fetch,`${this.url}/${n}/${s}${o?`?${o}`:""}`,{headers:this.headers,noResolveJson:!0},r);return new oF(a,this.shouldThrowOnError)}async info(e){var t=this;const r=t._getFinalPath(e);return t.handleOperation(async()=>v5(await Uh(t.fetch,`${t.url}/object/info/${r}`,{headers:t.headers})))}async exists(e){var t=this;const r=t._getFinalPath(e);try{return await nF(t.fetch,`${t.url}/object/${r}`,{headers:t.headers}),{data:!0,error:null}}catch(i){if(t.shouldThrowOnError)throw i;if(Fm(i)){var n;const o=i instanceof g5?i.status:i instanceof rT?(n=i.originalError)===null||n===void 0?void 0:n.status:void 0;if(o!==void 0&&[400,404].includes(o))return{data:!1,error:i}}throw i}}getPublicUrl(e,t){const r=this._getFinalPath(e),n=new URLSearchParams;t!=null&&t.download&&n.set("download",t.download===!0?"":t.download),t!=null&&t.transform&&this.applyTransformOptsToQuery(n,t.transform),(t==null?void 0:t.cacheNonce)!=null&&n.set("cacheNonce",String(t.cacheNonce));const i=n.toString(),o=typeof(t==null?void 0:t.transform)<"u"?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${o}/public/${r}`)+(i?`?${i}`:"")}}}async remove(e){var t=this;return t.handleOperation(async()=>await N_(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,r){var n=this;return n.handleOperation(async()=>{const i=wt(wt(wt({},sF),t),{},{prefix:e||""});return await yo(n.fetch,`${n.url}/object/list/${n.bucketId}`,i,{headers:n.headers},r)})}async listV2(e,t){var r=this;return r.handleOperation(async()=>{const n=wt({},e);return await yo(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(e,t){return t.width&&e.set("width",t.width.toString()),t.height&&e.set("height",t.height.toString()),t.resize&&e.set("resize",t.resize),t.format&&e.set("format",t.format),t.quality&&e.set("quality",t.quality.toString()),e}};const lF="2.103.0",Pf={"X-Client-Info":`storage-js/${lF}`};var cF=class extends Zu{constructor(e,t={},r,n){const i=new URL(e);n!=null&&n.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase."));const o=i.href.replace(/\/$/,""),s=wt(wt({},Pf),t);super(o,s,r,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const r=t.listBucketOptionsToQueryString(e);return await Uh(t.fetch,`${t.url}/bucket${r}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Uh(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var r=this;return r.handleOperation(async()=>await yo(r.fetch,`${r.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}))}async updateBucket(e,t){var r=this;return r.handleOperation(async()=>await y5(r.fetch,`${r.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await yo(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await N_(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},uF=class extends Zu{constructor(e,t={},r){const n=e.replace(/\/$/,""),i=wt(wt({},Pf),t);super(n,i,r,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await yo(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>
38{const r=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&r.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&r.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&r.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&r.set("sortOrder",e.sortOrder),e!=null&&e.search&&r.set("search",e.search);const n=r.toString(),i=n?`${t.url}/bucket?${n}`:`${t.url}/bucket`;return await Uh(t.fetch,i,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await N_(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!YN(e))throw new Nm("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const r=new qN({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(i,o){const s=i[o];return typeof s!="function"?s:async(...a)=>{try{return{data:await s.apply(i,a),error:null}}catch(l){if(n)throw l;return{data:null,error:l}}}}})}},dF=class extends Zu{constructor(e,t={},r){const n=e.replace(/\/$/,""),i=wt(wt({},Pf),{},{"Content-Type":"application/json"},t);super(n,i,r,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await $i.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var r=this;return r.handleOperation(async()=>await $i.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await $i.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var r=this;return r.handleOperation(async()=>await $i.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers})||{})}},hF=class extends Zu{constructor(e,t={},r){const n=e.replace(/\/$/,""),i=wt(wt({},Pf),{},{"Content-Type":"application/json"},t);super(n,i,r,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await $i.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await $i.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await $i.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await $i.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await $i.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},fF=class extends Zu{constructor(e,t={},r){const n=e.replace(/\/$/,""),i=wt(wt({},Pf),{},{"Content-Type":"application/json"},t);super(n,i,r,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await $i.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await $i.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await $i.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await $i.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},pF=class extends fF{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new mF(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,r=this;return t().call(r,e)}async getBucket(e){var t=()=>super.getBucket,r=this;return t().call(r,e)}async listBuckets(e={}){var t=()=>super.listBuckets,r=this;return t().call(r,e)}async deleteBucket(e){var t=()=>super.deleteBucket,r=this;return t().call(r,e)}},mF=class extends dF{constructor(e,t,r,n){super(e,t,n),this.vectorBucketName=r}async createIndex(e){var t=()=>super.createIndex,r=this;return t().call(r,wt(wt({},e),{},{vectorBucketName:r.vectorBucketName}))}
38async listIndexes(e={}){var t=()=>super.listIndexes,r=this;return t().call(r,wt(wt({},e),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,r=this;return t().call(r,r.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,r=this;return t().call(r,r.vectorBucketName,e)}index(e){return new gF(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},gF=class extends hF{constructor(e,t,r,n,i){super(e,t,i),this.vectorBucketName=r,this.indexName=n}async putVectors(e){var t=()=>super.putVectors,r=this;return t().call(r,wt(wt({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(e){var t=()=>super.getVectors,r=this;return t().call(r,wt(wt({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,r=this;return t().call(r,wt(wt({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,r=this;return t().call(r,wt(wt({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,r=this;return t().call(r,wt(wt({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},vF=class extends cF{constructor(e,t={},r,n){super(e,t,r,n)}from(e){return new aF(this.url,this.headers,e,this.fetch)}get vectors(){return new pF(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new uF(this.url+"/iceberg",this.headers,this.fetch)}};function Um(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}const oT="2.103.0",Yc=30*1e3,_5=3,o2=_5*Yc,yF="http://localhost:9999",_F="supabase.auth.token",bF={"X-Client-Info":`gotrue-js/${oT}`},b5="X-Supabase-Api-Version",sT={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},xF=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,wF=10*60*1e3;class Bh extends Error{constructor(t,r,n){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}}function ut(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class EF extends Bh{constructor(t,r,n){super(t,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function SF(e){return ut(e)&&e.name==="AuthApiError"}class Tl extends Bh{constructor(t,r){super(t),this.name="AuthUnknownError",this.originalError=r}}class na extends Bh{constructor(t,r,n,i){super(t,n,i),this.name=r,this.status=n}}class Ri extends na{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function wp(e){return ut(e)&&e.name==="AuthSessionMissingError"}class Oc extends na{constructor(){super("Auth session or user missing","AuthInvalidToken
38ResponseError",500,void 0)}}class Ep extends na{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class Sp extends na{constructor(t,r=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function CF(e){return ut(e)&&e.name==="AuthImplicitGrantRedirectError"}class Y4 extends na{constructor(t,r=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class TF extends na{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class x5 extends na{constructor(t,r){super(t,"AuthRetryableFetchError",r,void 0)}}function s2(e){return ut(e)&&e.name==="AuthRetryableFetchError"}class Z4 extends na{constructor(t,r,n){super(t,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}}class w5 extends na{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const n1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),X4=` 39\r=`.split(""),AF=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<X4.length;t+=1)e[X4[t].charCodeAt(0)]=-2;for(let t=0;t<n1.length;t+=1)e[n1[t].charCodeAt(0)]=t;return e})();function J4(e,t,r){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(n1[n]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(n1[n]),t.queuedBits-=6}}function aT(e,t,r){const n=AF[e];if(n>-1)for(t.queue=t.queue<<6|n,t.queuedBits+=6;t.queuedBits>=8;)r(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function Q4(e){const t=[],r=s=>{t.push(String.fromCodePoint(s))},n={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},o=s=>{IF(s,n,r)};for(let s=0;s<e.length;s+=1)aT(e.charCodeAt(s),i,o);return t.join("")}function kF(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function RF(e,t){for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n>55295&&n<=56319){const i=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|i)+65536,r+=1}kF(n,t)}}function IF(e,t,r){if(t.utf8seq===0){if(e<=127){r(e);return}for(let n=1;n<6;n+=1)if(!(e>>7-n&1)){t.utf8seq=n;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&r(t.codepoint)}}function fu(e){const t=[],r={queue:0,queuedBits:0},n=i=>{t.push(i)};for(let i=0;i<e.length;i+=1)aT(e.charCodeAt(i),r,n);return new Uint8Array(t)}function PF(e){const t=[];return RF(e,r=>t.push(r)),new Uint8Array(t)}function $l(e){const t=[],r={queue:0,queuedBits:0},n=i=>{t.push(i)};return e.forEach(i=>J4(i,r,n)),J4(null,r,n),t.join("")}function OF(e){return Math.round(Date.now()/1e3)+e}function jF(){return Symbol("auth-callback")}const Tn=()=>typeof window<"u"&&typeof document<"u",pl={tested:!1,writable:!1},lT=()=>{if(!Tn())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(pl.tested)return pl.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),pl.tested=!0,pl.writable=!0}catch{pl.tested=!0,pl.writable=!1}return pl.writable};function LF(e){const t={},r=new URL(e);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEac
39h((i,o)=>{t[o]=i})}catch{}return r.searchParams.forEach((n,i)=>{t[i]=n}),t}const cT=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),$F=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Zc=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},ml=async(e,t)=>{const r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return r}},En=async(e,t)=>{await e.removeItem(t)};let uT=class dT{constructor(){this.promise=new dT.promiseConstructor((t,r)=>{this.resolve=t,this.reject=r})}};uT.promiseConstructor=Promise;function Cp(e){const t=e.split(".");if(t.length!==3)throw new w5("Invalid JWT structure");for(let n=0;n<t.length;n++)if(!xF.test(t[n]))throw new w5("JWT not in base64url format");return{header:JSON.parse(Q4(t[0])),payload:JSON.parse(Q4(t[1])),signature:fu(t[2]),raw:{header:t[0],payload:t[1]}}}async function DF(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function MF(e,t){return new Promise((n,i)=>{(async()=>{for(let o=0;o<1/0;o++)try{const s=await e(o);if(!t(o,null,s)){n(s);return}}catch(s){if(!t(o,s)){i(s);return}}})()})}function NF(e){return("0"+e.toString(16)).substr(-2)}function FF(){const t=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let i="";for(let o=0;o<56;o++)i+=r.charAt(Math.floor(Math.random()*n));return i}return crypto.getRandomValues(t),Array.from(t,NF).join("")}async function UF(e){const r=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",r),i=new Uint8Array(n);return Array.from(i).map(o=>String.fromCharCode(o)).join("")}async function BF(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const r=await UF(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function jc(e,t,r=!1){const n=FF();let i=n;r&&(i+="/PASSWORD_RECOVERY"),await Zc(e,`${t}-code-verifier`,i);const o=await BF(n);return[o,n===o?"plain":"s256"]}const VF=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function HF(e){const t=e.headers.get(b5);if(!t||!t.match(VF))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function zF(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function WF(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const qF=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Lc(e){if(!qF.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function a2(){const e={};return new Proxy(e,{get:(t,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const n=r.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function GF(e,t){return new Proxy(e,{get:(r,n,i)=>{if(n==="__isInsecureUserWarningProxy")return!0;if(typeof n=="symbol"){const o=n.toString();if(o==="Symbol(Symbol.toPrimitive)"||o==="Symbol(Symbol.toStringTag)"||o==="Symbol(util.inspect.custom)"||o==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,n,i)}return!t.value&&typeof n=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(r,n,i)}})}function e6(e){return JSON.parse(JSON.stringify(e))}const wl=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),KF=[502,503,504];async function t6(e){var t;if(!$F(e))throw new x5(wl(e),0);if(KF.includes(e.status))throw new x5(wl(e),e.status);let r;try{r=await e.json()}catch(o){throw new Tl(wl(o),o)}let n;const i=HF(e);if(i&&i.getTime()>=sT["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new Z4(wl(r),e.status,((t=r.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(n==="session_not_found")throw new Ri}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((o,s)=>o&&typeof s=="string",!0))throw new Z4(wl(r),e.status,r.weak_password.reasons);throw new EF(wl(r),e.status||500,n)}const YF=(e,t,r,n)=>{const i={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),i.body=JSON.stringify(n),Object.assign(Object.assign({},i),r))};async function bt(e,t,r,n){var i;const o=Object.assign({},n==null?void 0:n.headers);o[b5]||(o[b5]=sT["2024-01-01"].name),n!=null&&n.jwt&&(o.Authorization=`Bearer ${n.jwt}`);const s=(i=n==null?void 0:n.query)!==null&&i!==void 0?i:{};n!=null&&n.redirectTo&&(s.redirect_to=n.redirectTo);const a=Object.keys(s).length?"?"+new URLSearchParams(s).toString():"",l=await ZF(e,t,r+a,{headers:o,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(l):{data:Object.assign({},l),error:null}}async function ZF(e,t,r,n,i,o){const s=YF(t,n,i,o);let a;try{a=await e(r,Object.assign({},s))}catch(l){throw console.error(l),new x5(wl(l),0)}if(a.ok||await t6(a),n!=null&&n.noResolveJson)return a;try{return await a.json()}catch(l){await t6(l)}}function ho(e){var t;let r=null;QF(e)&&(r=Object.assign({},e),e.expires_at||(r.expires_at=OF(e.expires_in)));const n=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:r,user:n},error:null}}function r6(e){const t=ho(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(t.data.weak_password=e.weak_password),t}function Pa(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function XF(e){return{data:e,error:null}}function JF(e){const{action_link:t,email_otp:r,hashed_token:n,redirect_to:i,verification_type:o}=e,s=Um(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:t,email_otp:r,hashed_token:n,redirect_to:i,verification_type:o},l=Object.assign({},s);return{data:{properties:a,user:l},error:null}}function n6(e){return e}function QF(e){return e.access_token&&e.refresh_token&&e.expires_in}const l2=["global","local","others"];class eU{constructor({url:t="",headers:r={},fetch:n}){this.url=t,this.headers=r,this.fetch=cT(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)}}async signOut(t,r=l2[0]){if(l2.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${l2.join(", ")}`);try{return await bt(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(n){if(ut(n))return{data:null,error:n};throw n}}async inviteUserByEmail(t,r={}){try{return await bt(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:Pa})}catch(n){if(ut(n))return{data:{user:null},error:n};throw n}}async generateLink(t){try{const{options:r}=t,n=Um(t,["options"]),i=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(i.new_email=n==null?void 0:n.newEmail,delete i.newEmail),await bt(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:JF,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(ut(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(t){try{return await bt(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:Pa})}catch(r){if(ut(r))return{data:{user:null},error:r};throw r}}async listUsers(t){var r,n,i,o,s,a,l;try{const d={nextPage:null,lastPage:0,total:0},u=await bt(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(o=(i=t==null?void 0:t.perPage)===null||i===void 0?void 0:i.toString())!==null&&o!==void 0?o:""},xform:n6});if(u.error)throw u.error;const h=await u.json(),f=(s=u.headers.get("x-total-count"))!==null&&s!==void 0?s:0,p=(l=(a=u.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return p.length>
390&&(p.forEach(m=>{const g=parseInt(m.split(";")[0].split("=")[1].substring(0,1)),y=JSON.parse(m.split(";")[1].split("=")[1]);d[`${y}Page`]=g}),d.total=parseInt(f)),{data:Object.assign(Object.assign({},h),d),error:null}}catch(d){if(ut(d))return{data:{users:[]},error:d};throw d}}async getUserById(t){Lc(t);try{return await bt(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:Pa})}catch(r){if(ut(r))return{data:{user:null},error:r};throw r}}async updateUserById(t,r){Lc(t);try{return await bt(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:r,headers:this.headers,xform:Pa})}catch(n){if(ut(n))return{data:{user:null},error:n};throw n}}async deleteUser(t,r=!1){Lc(t);try{return await bt(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:r},xform:Pa})}catch(n){if(ut(n))return{data:{user:null},error:n};throw n}}async _listFactors(t){Lc(t.userId);try{const{data:r,error:n}=await bt(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:r,error:n}}catch(r){if(ut(r))return{data:null,error:r};throw r}}async _deleteFactor(t){Lc(t.userId),Lc(t.id);try{return{data:await bt(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(r){if(ut(r))return{data:null,error:r};throw r}}async _listOAuthClients(t){var r,n,i,o,s,a,l;try{const d={nextPage:null,lastPage:0,total:0},u=await bt(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(o=(i=t==null?void 0:t.perPage)===null||i===void 0?void 0:i.toString())!==null&&o!==void 0?o:""},xform:n6});if(u.error)throw u.error;const h=await u.json(),f=(s=u.headers.get("x-total-count"))!==null&&s!==void 0?s:0,p=(l=(a=u.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return p.length>0&&(p.forEach(m=>{const g=parseInt(m.split(";")[0].split("=")[1].substring(0,1)),y=JSON.parse(m.split(";")[1].split("=")[1]);d[`${y}Page`]=g}),d.total=parseInt(f)),{data:Object.assign(Object.assign({},h),d),error:null}}catch(d){if(ut(d))return{data:{clients:[]},error:d};throw d}}async _createOAuthClient(t){try{return await bt(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ut(r))return{data:null,error:r};throw r}}async _getOAuthClient(t){try{return await bt(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ut(r))return{data:null,error:r};throw r}}async _updateOAuthClient(t,r){try{return await bt(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ut(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(t){try{return await bt(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(ut(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(t){try{return await bt(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ut(r))return{data:null,error:r};throw r}}async _listCustomProviders(t){try{const r={};return t!=null&&t.type&&(r.type=t.type),await bt(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:r,xform:n=>{var i;return{data:{providers:(i=n==null?void 0:n.providers)!==null&&i!==void 0?i:[]},error:null}}})}catch(r){if(ut(r))return{data:{providers:[]},error:r};throw r}}async _createCustomProvider(t){try{return await bt(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ut(r))return{data:null,error:r};throw r}}async _getCustomProvider(t){try{return await bt(this.fetch,"GET",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ut(r))return{data:null,error:r};throw r}}async _updateCustomProvider(t,r){try{return await bt(this.fetch,"PUT",`${this.url}/admin/custom-providers/${t}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ut(n))return{data:null,error:n};throw n}}async _deleteCustomProvider(t){try{return await bt(this.fetch,"DELET
39E",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(ut(r))return{data:null,error:r};throw r}}}function i6(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}const Uo={debug:!!(globalThis&&lT()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class hT extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class o6 extends hT{}async function tU(e,t,r){Uo.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const n=new globalThis.AbortController;let i;t>0&&(i=setTimeout(()=>{n.abort(),Uo.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t)),await Promise.resolve();try{return await globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async o=>{if(o){clearTimeout(i),Uo.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,o.name);try{return await r()}finally{Uo.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,o.name)}}else{if(t===0)throw Uo.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new o6(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(Uo.debug)try{const s=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(s,null," "))}catch(s){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",s)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),clearTimeout(i),await r()}})}catch(o){if(t>0&&clearTimeout(i),(o==null?void 0:o.name)==="AbortError"&&t>0){if(n.signal.aborted)return Uo.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",e),console.warn(`@supabase/gotrue-js: Lock "${e}" was not released within ${t}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,{mode:"exclusive",steal:!0},async s=>{if(s){Uo.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",e,s.name);try{return await r()}finally{Uo.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",e,s.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await r()}));throw Uo.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",e),new o6(`Lock "${e}" was released because another request stole it`)}throw o}}function rU(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function fT(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function nU(e){return parseInt(e,16)}function iU(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,n=>n.toString(16).padStart(2,"0")).join("")}function oU(e){var t;const{chainId:r,domain:n,expirationTime:i,issuedAt:o=new Date,nonce:s,notBefore:a,requestId:l,resources:d,scheme:u,uri:h,version:f}=e;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(s&&s.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${s}`);if(!h)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(f!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${f}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(` 40`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const p=fT(e.address),m=u?`${u}://${n}`:n,g=e.statement?`${e.statement} 41`:"",y=`${m} wants you to sign in with your Ethereum account: 42${p} 43 44${g}`;let b=`URI: ${h} 45Version: ${f} 46Chain ID: ${r}${s?` 47Nonce: ${s}`:""} 48Issued At: ${o.toISOString()}`;if(i&&(b+=` 49Expiration Time: ${i.toISOString()}`),a&&(b+=` 50Not Before: ${a.toISOString()}`),l&&(b+=` 51Request ID: ${l}`),d){let E=` 52Resources:`;
52for(const S of d){if(!S||typeof S!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${S}`);E+=` 53- ${S}`}b+=E}return`${y} 54${b}`}class Qr extends Error{constructor({message:t,code:r,cause:n,name:i}){var o;super(t,{cause:n}),this.__isWebAuthnError=!0,this.name=(o=i??(n instanceof Error?n.name:void 0))!==null&&o!==void 0?o:"Unknown Error",this.code=r}}class i1 extends Qr{constructor(t,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:t}),this.name="WebAuthnUnknownError",this.originalError=r}}function sU({error:e,options:t}){var r,n,i;const{publicKey:o}=t;if(!o)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Qr({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((r=o.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new Qr({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((n=o.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new Qr({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((i=o.authenticatorSelection)===null||i===void 0?void 0:i.userVerification)==="required")return new Qr({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new Qr({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new Qr({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return o.pubKeyCredParams.filter(a=>a.type==="public-key").length===0?new Qr({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new Qr({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const s=window.location.hostname;if(pT(s)){if(o.rp.id!==s)return new Qr({message:`The RP ID "${o.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Qr({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(o.user.id.byteLength<1||o.user.id.byteLength>64)return new Qr({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new Qr({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Qr({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function aU({error:e,options:t}){const{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Qr({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new Qr({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const n=window.location.hostname;if(pT(n)){if(r.rpId!==n)return new Qr({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Qr({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new Qr({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ER
54ROR",cause:e})}return new Qr({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class lU{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const cU=new lU;function uU(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:r,excludeCredentials:n}=e,i=Um(e,["challenge","user","excludeCredentials"]),o=fu(t).buffer,s=Object.assign(Object.assign({},r),{id:fu(r.id).buffer}),a=Object.assign(Object.assign({},i),{challenge:o,user:s});if(n&&n.length>0){a.excludeCredentials=new Array(n.length);for(let l=0;l<n.length;l++){const d=n[l];a.excludeCredentials[l]=Object.assign(Object.assign({},d),{id:fu(d.id).buffer,type:d.type||"public-key",transports:d.transports})}}return a}function dU(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:r}=e,n=Um(e,["challenge","allowCredentials"]),i=fu(t).buffer,o=Object.assign(Object.assign({},n),{challenge:i});if(r&&r.length>0){o.allowCredentials=new Array(r.length);for(let s=0;s<r.length;s++){const a=r[s];o.allowCredentials[s]=Object.assign(Object.assign({},a),{id:fu(a.id).buffer,type:a.type||"public-key",transports:a.transports})}}return o}function hU(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e;return{id:e.id,rawId:e.id,response:{attestationObject:$l(new Uint8Array(e.response.attestationObject)),clientDataJSON:$l(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function fU(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e,n=e.getClientExtensionResults(),i=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:$l(new Uint8Array(i.authenticatorData)),clientDataJSON:$l(new Uint8Array(i.clientDataJSON)),signature:$l(new Uint8Array(i.signature)),userHandle:i.userHandle?$l(new Uint8Array(i.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function pT(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function s6(){var e,t;return!!(Tn()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function pU(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new i1("Browser returned unexpected credential type",t)}:{data:null,error:new i1("Empty credential response",t)}}catch(t){return{data:null,error:sU({error:t,options:e})}}}async function mU(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new i1("Browser returned unexpected credential type",t)}:{data:null,error:new i1("Empty credential response",t)}}catch(t){return{data:null,error:aU({error:t,options:e})}}}const gU={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},vU={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function o1(...e){const t=i=>i!==null&&typeof i=="object"&&!Array.isArray(i),r=i=>i instanceof ArrayBuffer||ArrayBuffer.isView(i),n={};for(const i of e)if(i)for(const o in i){const s=i[o];if(s!==void 0)if(Array.isArray(s))n[o]=s;else if(r(s))n[o]=s;else if(t(s)){const a=n[o];t(a)?n[o]=o1(a,s):n[o]=o1(s)}else n[o]=s}return n}function yU(e,t){return o1(gU,e,t||{})}function _U(e,t){return o1(vU,e,t||{})}class bU{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:r,friendlyName:n,signal:i},o){var s;try{const{data:a,error:l}=await this.client.mfa.challenge({factorId:t,webauthn:r});if(!a)return{data:null,error:l};const d=i??cU.createNewAbortSignal();if(a.webauthn.type==="create"){const{user:u}=a.webauthn.credential_options.publicKey;if(!u.name){const h=n;if(h)u.name=`${u.id}:${h}`;else{const p=(await this.client.getUser()).data.user,m=((s=p==null?void 0:p.user_metadata)===null||s===void 0?void 0:s.name)||(p==null?void 0:p.email)||(p==null?void 0:p.id)||"User";u.name=`${u.id}:${m}`}}u.displayName||(u.displayName=u.name)}
54switch(a.webauthn.type){case"create":{const u=yU(a.webauthn.credential_options.publicKey,o==null?void 0:o.create),{data:h,error:f}=await pU({publicKey:u,signal:d});return h?{data:{factorId:t,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:h}},error:null}:{data:null,error:f}}case"request":{const u=_U(a.webauthn.credential_options.publicKey,o==null?void 0:o.request),{data:h,error:f}=await mU(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:u,signal:d}));return h?{data:{factorId:t,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:h}},error:null}:{data:null,error:f}}}}catch(a){return ut(a)?{data:null,error:a}:{data:null,error:new Tl("Unexpected error in challenge",a)}}}async _verify({challengeId:t,factorId:r,webauthn:n}){return this.client.mfa.verify({factorId:r,challengeId:t,webauthn:n})}async _authenticate({factorId:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},o){if(!r)return{data:null,error:new Bh("rpId is required for WebAuthn authentication")};try{if(!s6())return{data:null,error:new Tl("Browser does not support WebAuthn",null)};const{data:s,error:a}=await this.challenge({factorId:t,webauthn:{rpId:r,rpOrigins:n},signal:i},{request:o});if(!s)return{data:null,error:a};const{webauthn:l}=s;return this._verify({factorId:t,challengeId:s.challengeId,webauthn:{type:l.type,rpId:r,rpOrigins:n,credential_response:l.credential_response}})}catch(s){return ut(s)?{data:null,error:s}:{data:null,error:new Tl("Unexpected error in authenticate",s)}}}async _register({friendlyName:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},o){if(!r)return{data:null,error:new Bh("rpId is required for WebAuthn registration")};try{if(!s6())return{data:null,error:new Tl("Browser does not support WebAuthn",null)};const{data:s,error:a}=await this._enroll({friendlyName:t});if(!s)return await this.client.mfa.listFactors().then(u=>{var h;return(h=u.data)===null||h===void 0?void 0:h.all.find(f=>f.factor_type==="webauthn"&&f.friendly_name===t&&f.status!=="unverified")}).then(u=>u?this.client.mfa.unenroll({factorId:u==null?void 0:u.id}):void 0),{data:null,error:a};const{data:l,error:d}=await this._challenge({factorId:s.id,friendlyName:s.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:i},{create:o});return l?this._verify({factorId:s.id,challengeId:l.challengeId,webauthn:{rpId:r,rpOrigins:n,type:l.webauthn.type,credential_response:l.webauthn.credential_response}}):{data:null,error:d}}catch(s){return ut(s)?{data:null,error:s}:{data:null,error:new Tl("Unexpected error in register",s)}}}}rU();const xU={url:yF,storageKey:_F,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:bF,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1};async function a6(e,t,r){return await r()}const $c={};class Vh{get jwks(){var t,r;return(r=(t=$c[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(t){$c[this.storageKey]=Object.assign(Object.assign({},$c[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,r;return(r=(t=$c[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){$c[this.storageKey]=Object.assign(Object.assign({},$c[this.storageKey]),{cachedAt:t})}constructor(t){var r,n,i;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const o=Object.assign(Object.assign({},xU),t);if(this.storageKey=o.storageKey,this.instanceID=(r=Vh.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,Vh.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!o.debug,typeof o.debug=="function"&&(this.logger=o.debug),this.instanceID>0&&Tn()){const s=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(s),this.logDebugMessages&&console.trace(s)}if(this.persistSession=o.persistSession,this.autoRefreshToken=o.autoRefreshToken,this.admin=new eU({url:o.url,headers:o.headers,fetch:o.fetch}),this.url=o.url,this.headers=o.headers,this.fetch=cT(o.fetch),this.lock=o.lock||a6,this.detectSessionInUrl=o.detectSessionInUrl,this.flowType=o.flowType,this.hasCustomAuthorizationHeader=o.hasCustomAuthorizationHeader,this.throwOnError=o.throwOnError,this.lockAcquireTimeout=o.lockAcquireTimeout,o.lock?this.lock=o.lock:this.persistSession&&Tn()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=tU:this.lock=a6,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new bU(this)}
54,this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(o.storage?this.storage=o.storage:lT()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=i6(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=i6(this.memoryStorage)),Tn()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(s){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",s)}(i=this.broadcastChannel)===null||i===void 0||i.addEventListener("message",async s=>{this._debug("received broadcast notification from other tab or client",s);try{await this._notifyAllSubscribers(s.data.event,s.data.session,!1)}catch(a){this._debug("#broadcastChannel","error",a)}})}o.skipAutoInitialize||this.initialize().catch(s=>{this._debug("#initialize()","error",s)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${oT}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let r={},n="none";if(Tn()&&(r=LF(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),Tn()&&this.detectSessionInUrl&&n!=="none"){const{data:i,error:o}=await this._getSessionFromURL(r,n);if(o){if(this._debug("#_initialize()","error detecting session from URL",o),CF(o)){const l=(t=o.details)===null||t===void 0?void 0:t.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:o}}return{error:o}}const{session:s,redirectType:a}=i;return this._debug("#_initialize()","detected session in URL",s,"redirect type",a),await this._saveSession(s),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",s):await this._notifyAllSubscribers("SIGNED_IN",s)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return ut(r)?this._returnResult({error:r}):this._returnResult({error:new Tl("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var r,n,i;try{const o=await bt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(i=t==null?void 0:t.options)===null||i===void 0?void 0:i.captchaToken}},xform:ho}),{data:s,error:a}=o;if(a||!s)return this._returnResult({data:{user:null,session:null},error:a});const l=s.session,d=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:d,session:l},error:null})}catch(o){if(ut(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signUp(t){var r,n,i;try{let o;if("email"in t){const{email:u,password:h,options:f}=t;let p=null,m=null;this.flowType==="pkce"&&([p,m]=await jc(this.storage,this.storageKey)),o=await bt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f==null?void 0:f.emailRedirectTo,body:{email:u,password:h,data:(r=f==null?void 0:f.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken},code_challenge:p,code_challenge_method:m},xform:ho})}else if("phone"in t){const{phone:u,password:h,options:f}=t;o=await bt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:u,password:h,data:(n=f==null?void 0:f.data)!==null&&n!==void 0?n:{},channel:(i=f==null?void 0:f.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken}},xform:ho})}else throw new Ep("You must provide either an email or phone number and a password");const{data:s,error:a}=o;if(a||!s)return await En(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:a});const l=s.session,d=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:d,session:l},error:null})}catch(o){if(await En(this.storage,`${this.storageKey}-code-verifier`),ut(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signInWithPassword(t){try{let r;if("email"in t){const{email:o,password:s,options:a}=t;r=await bt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:o,password:s,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:r6})}else if("phone"in t){const{phone:o,password:s,options:a}=t;r=await bt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:o,password:s,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:r6})}else throw new Ep("You must provide either an email or phone number and a password");const{data:n,error:i}=r;if(i)return this._returnResult({data:{user:null,session:null},error:i});if(!n||!n.session||!n.user){const o=new Oc;return this._returnResult({data:{user:null,session:null},error:o})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:i})}catch(r){if(ut(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(t){var r,n,i,o;return await this._handleProviderSignIn(t.provider,{redirectTo:(r=t.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=t.options)===null||n===void 0?void 0:n.scopes,queryParams:(i=t.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(o=t.o
54ptions)===null||o===void 0?void 0:o.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:r}=t;switch(r){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(t){var r,n,i,o,s,a,l,d,u,h,f;let p,m;if("message"in t)p=t.message,m=t.signature;else{const{chain:g,wallet:y,statement:b,options:E}=t;let S;if(Tn())if(typeof y=="object")S=y;else{const C=window;if("ethereum"in C&&typeof C.ethereum=="object"&&"request"in C.ethereum&&typeof C.ethereum.request=="function")S=C.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof y!="object"||!(E!=null&&E.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");S=y}const k=new URL((r=E==null?void 0:E.url)!==null&&r!==void 0?r:window.location.href),A=await S.request({method:"eth_requestAccounts"}).then(C=>C).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!A||A.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const w=fT(A[0]);let _=(n=E==null?void 0:E.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!_){const C=await S.request({method:"eth_chainId"});_=nU(C)}const x={domain:k.host,address:w,statement:b,uri:k.href,version:"1",chainId:_,nonce:(i=E==null?void 0:E.signInWithEthereum)===null||i===void 0?void 0:i.nonce,issuedAt:(s=(o=E==null?void 0:E.signInWithEthereum)===null||o===void 0?void 0:o.issuedAt)!==null&&s!==void 0?s:new Date,expirationTime:(a=E==null?void 0:E.signInWithEthereum)===null||a===void 0?void 0:a.expirationTime,notBefore:(l=E==null?void 0:E.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(d=E==null?void 0:E.signInWithEthereum)===null||d===void 0?void 0:d.requestId,resources:(u=E==null?void 0:E.signInWithEthereum)===null||u===void 0?void 0:u.resources};p=oU(x),m=await S.request({method:"personal_sign",params:[iU(p),w]})}try{const{data:g,error:y}=await bt(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:m},!((h=t.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(f=t.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:ho});if(y)throw y;if(!g||!g.session||!g.user){const b=new Oc;return this._returnResult({data:{user:null,session:null},error:b})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:y})}catch(g){if(ut(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(t){var r,n,i,o,s,a,l,d,u,h,f,p;let m,g;if("message"in t)m=t.message,g=t.signature;else{const{chain:y,wallet:b,statement:E,options:S}=t;let k;if(Tn())if(typeof b=="object")k=b;else{const w=window;if("solana"in w&&typeof w.solana=="object"&&("signIn"in w.solana&&typeof w.solana.signIn=="function"||"signMessage"in w.solana&&typeof w.solana.signMessage=="function"))k=w.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof b!="object"||!(S!=null&&S.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");k=b}const A=new URL((r=S==null?void 0:S.url)!==null&&r!==void 0?r:window.location.href);
54if("signIn"in k&&k.signIn){const w=await k.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},S==null?void 0:S.signInWithSolana),{version:"1",domain:A.host,uri:A.href}),E?{statement:E}:null));let _;if(Array.isArray(w)&&w[0]&&typeof w[0]=="object")_=w[0];else if(w&&typeof w=="object"&&"signedMessage"in w&&"signature"in w)_=w;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in _&&"signature"in _&&(typeof _.signedMessage=="string"||_.signedMessage instanceof Uint8Array)&&_.signature instanceof Uint8Array)m=typeof _.signedMessage=="string"?_.signedMessage:new TextDecoder().decode(_.signedMessage),g=_.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in k)||typeof k.signMessage!="function"||!("publicKey"in k)||typeof k!="object"||!k.publicKey||!("toBase58"in k.publicKey)||typeof k.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");m=[`${A.host} wants you to sign in with your Solana account:`,k.publicKey.toBase58(),...E?["",E,""]:[""],"Version: 1",`URI: ${A.href}`,`Issued At: ${(i=(n=S==null?void 0:S.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&i!==void 0?i:new Date().toISOString()}`,...!((o=S==null?void 0:S.signInWithSolana)===null||o===void 0)&&o.notBefore?[`Not Before: ${S.signInWithSolana.notBefore}`]:[],...!((s=S==null?void 0:S.signInWithSolana)===null||s===void 0)&&s.expirationTime?[`Expiration Time: ${S.signInWithSolana.expirationTime}`]:[],...!((a=S==null?void 0:S.signInWithSolana)===null||a===void 0)&&a.chainId?[`Chain ID: ${S.signInWithSolana.chainId}`]:[],...!((l=S==null?void 0:S.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${S.signInWithSolana.nonce}`]:[],...!((d=S==null?void 0:S.signInWithSolana)===null||d===void 0)&&d.requestId?[`Request ID: ${S.signInWithSolana.requestId}`]:[],...!((h=(u=S==null?void 0:S.signInWithSolana)===null||u===void 0?void 0:u.resources)===null||h===void 0)&&h.length?["Resources",...S.signInWithSolana.resources.map(_=>`- ${_}`)]:[]].join(` 55`);const w=await k.signMessage(new TextEncoder().encode(m),"utf8");if(!w||!(w instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=w}}try{const{data:y,error:b}=await bt(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:m,signature:$l(g)},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(p=t.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:ho});if(b)throw b;if(!y||!y.session||!y.user){const E=new Oc;return this._returnResult({data:{user:null,session:null},error:E})}return y.session&&(await this._saveSession(y.session),await this._notifyAllSubscribers("SIGNED_IN",y.session)),this._returnResult({data:Object.assign({},y),error:b})}catch(y){if(ut(y))return this._returnResult({data:{user:null,session:null},error:y});throw y}}async _exchangeCodeForSession(t){const r=await ml(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/");try{if(!n&&this.flowType==="pkce")throw new TF;const{data:o,error:s}=await bt(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:n},xform:ho});if(await En(this.storage,`${this.storageKey}-code-verifier`),s)throw s;if(!o||!o.session||!o.user){const a=new Oc;return this._returnResult({data:{user:null,session:null,redirectType:null},error:a})}return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",o.session)),this._returnResult({data:Object.assign(Object.assign({},o),{redirectType:i??null}),error:s})}catch(o){if(await En(this.storage,`${this.storageKey}-code-verifier`),ut(o))return this._returnResult({data:{user:null,session:null,redirectType:null},error:o});throw o}}async signInWithIdToken(t){try{const{options:r,provider:n,token:i,access_token:o,nonce:s}=t,a=await bt(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:i,access_token:o,nonce:s,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:ho}),{data:l,error:d}=a;if(d)return this._returnResult({data:{user:null,session:null},error:d});if(!l||!l.session||!l.user){const u=new Oc;return this._returnResult({data:{user:null,session:null},error:u})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:l,error:d})}catch(r){if(ut(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(t){var r,n,i,o,s;try{if("email"in t){const{email:a,options:l}=t;let d=null,u=null;this.flowType==="pkce"&&([d,u]=await jc(this.storage,this.storageKey));const{error:h}=await bt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(r=l==null?void 0:l.data)!==null&&r!==void 0?r:{},create_user:(n=l==null?void 0:l.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},code_challenge:d,code_challenge_method:u},redirectTo:l==null?void 0:l.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:h})}if("phone"in t){const{phone:a,options:l}=t,{data:d,error:u}=await bt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(i=l==null?void 0:l.data)!==null&&i!==void 0?i:{},create_user:(o=l==null?void 0:l.shouldCreateUser)!==null&&o!==void 0?o:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(s=l==null?void 0:l.channel)!==null&&s!==void 0?s:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:d==null?void 0:d.message_id},error:u})}throw new Ep("You must provide either an email or phone number.")}catch(a){if(await En(this.storage,`${this.storageKey}-code-verifier`),ut(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async verifyOtp(t){var r,n;try{let i,o;"options"in t&&(i=(r=t.options)===null||r===void 0?void 0:r.redirectTo,o=(n=t.options)===null||n===void 0?void 0:n.captchaToken);const{data:s,error:a}=await bt(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:o}}),redirectTo:i,xform:ho});if(a)throw a;if(!s)throw new Error("An error occurred on token verification.");const l=s.session,d=s.user;return l!=null&&l.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),this._returnResult({data:{user:d,session:l},error:null})}catch(i){if(ut(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithSSO(t){var r,n,i,o,s;try{let a=null,l=null;this.flowType==="pkce"&&([a,l]=await jc(this.storage,this.storageKey));const d=await bt(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(n=(r=t.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((i=t==null?void 0:t.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:a,code_challenge_method:l}),headers:this.headers,xform:XF});return!((o=d.data)===null||o===void 0)&&o.url&&Tn()&&!(!((s=t.options)===null||s===void 0)&&s.skipBrowserRedirect)&&window.location.assign(d.data.url),this._returnResult(d)}catch(a){if(await En(this.storage,`${this.storageKey}-code-verifier`),ut(a))return this._returnResult({data:null,error:a});throw a}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)throw n;if(!r)throw new Ri;const{error:i}=await bt(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:i})})}catch(t){if(ut(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const r=`${this.url}/resend`;if("email"in t){const{email:n,type:i,options:o}=t,{error:s}=await bt(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:i,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},redirectTo:o==null?void 0:o.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:s})}else if("phone"in t){const{phone:n,type:i,options:o}=t,{data:s,error:a}=await bt(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:i,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:s==null?void 0:s.message_id},error:a})}throw new Ep("You must provide either an email or phone number and a type")}catch(r){if(ut(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async r=>r))}async _acquireLock(t,r){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await t(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const r=await ml(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?t=r:(this._debug("#getSession()","session from storage is not val
55id"),await this._removeSession())),!t)return{data:{session:null},error:null};const n=t.expires_at?t.expires_at*1e3-Date.now()<o2:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",t.expires_at),!n){if(this.userStorage){const s=await ml(this.userStorage,this.storageKey+"-user");s!=null&&s.user?t.user=s.user:t.user=a2()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const s={value:this.suppressGetSessionWarning};t.user=GF(t.user,s),s.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:i,error:o}=await this._callRefreshToken(t.refresh_token);return o?this._returnResult({data:{session:null},error:o}):this._returnResult({data:{session:i},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;const r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(t){try{return t?await bt(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Pa}):await this._useSession(async r=>{var n,i,o;const{data:s,error:a}=r;if(a)throw a;return!(!((n=s.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Ri}:await bt(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(o=(i=s.session)===null||i===void 0?void 0:i.access_token)!==null&&o!==void 0?o:void 0,xform:Pa})})}catch(r){if(ut(r))return wp(r)&&(await this._removeSession(),await En(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(t,r={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,r))}async _updateUser(t,r={}){try{return await this._useSession(async n=>{const{data:i,error:o}=n;if(o)throw o;if(!i.session)throw new Ri;const s=i.session;let a=null,l=null;this.flowType==="pkce"&&t.email!=null&&([a,l]=await jc(this.storage,this.storageKey));const{data:d,error:u}=await bt(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:a,code_challenge_method:l}),jwt:s.access_token,xform:Pa});if(u)throw u;return s.user=d.user,await this._saveSession(s),await this._notifyAllSubscribers("USER_UPDATED",s),this._returnResult({data:{user:s.user},error:null})})}catch(n){if(await En(this.storage,`${this.storageKey}-code-verifier`),ut(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new Ri;const r=Date.now()/1e3;let n=r,i=!0,o=null;const{payload:s}=Cp(t.access_token);if(s.exp&&(n=s.exp,i=n<=r),i){const{data:a,error:l}=await this._callRefreshToken(t.refresh_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!a)return{data:{user:null,session:null},error:null};o=a}else{const{data:a,error:l}=await this._getUser(t.access_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});o={access_token:t.access_token,refresh_token:t.refresh_token,user:a.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)}return this._returnResult({data:{user:o.user,session:o},error:null})}catch(r){if(ut(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async r=>{var n;if(!t){const{data:s,error:a}=r;if(a)throw a;t=(n=s.session)!==null&&n!==void 0?n:void 0}if(!(t!=null&&t.refresh_token))throw new Ri;const{data:i,error:o}=await this._callRefreshToken(t.refresh_token);return o?this._returnResult({data:{user:null,session:null},error:o}):i?this._returnResult({data:{user:i.user,session:i},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(ut(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(t,r){try{if(!Tn())throw new Sp("No browser detected.");
55if(t.error||t.error_description||t.error_code)throw new Sp(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new Y4("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Sp("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new Y4("No code detected.");const{data:E,error:S}=await this._exchangeCodeForSession(t.code);if(S)throw S;const k=new URL(window.location.href);return k.searchParams.delete("code"),window.history.replaceState(window.history.state,"",k.toString()),{data:{session:E.session,redirectType:null},error:null}}const{provider_token:n,provider_refresh_token:i,access_token:o,refresh_token:s,expires_in:a,expires_at:l,token_type:d}=t;if(!o||!a||!s||!d)throw new Sp("No session defined in URL");const u=Math.round(Date.now()/1e3),h=parseInt(a);let f=u+h;l&&(f=parseInt(l));const p=f-u;p*1e3<=Yc&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${h}s`);const m=f-h;u-m>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",m,f,u):u-m<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",m,f,u);const{data:g,error:y}=await this._getUser(o);if(y)throw y;const b={provider_token:n,provider_refresh_token:i,access_token:o,expires_in:h,expires_at:f,refresh_token:s,token_type:d,user:g.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:b,redirectType:t.type},error:null})}catch(n){if(ut(n))return this._returnResult({data:{session:null,redirectType:null},error:n});throw n}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){const r=await ml(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&r)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async r=>{var n;const{data:i,error:o}=r;if(o&&!wp(o))return this._returnResult({error:o});const s=(n=i.session)===null||n===void 0?void 0:n.access_token;if(s){const{error:a}=await this.admin.signOut(s,t);if(a&&!(SF(a)&&(a.status===404||a.status===401||a.status===403)||wp(a)))return this._returnResult({error:a})}return t!=="others"&&(await this._removeSession(),await En(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const r=jF(),n={id:r,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(t){return await this._useSession(async r=>{var n,i;try{const{data:{session:o},error:s}=r;if(s)throw s;await((n=this.stateChangeEmitters.get(t))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",o)),this._debug("INITIAL_SESSION","callback id",t,"session",o)}catch(o){await((i=this.stateChangeEmitters.get(t))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",o),wp(o)?console.warn(o):console.error(o)}})}async resetPasswordForEmail(t,r={}){let n=null,i=null;this.flowType==="pkce"&&([n,i]=await jc(this.storage,this.storageKey,!0));try{return await bt(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:n,code_challenge_method:i,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(o){if(await En(this.storage,`${this.storageKey}-code-verifier`),ut(o))return this._returnResult({data:null,error:o});throw o}}async getUserIdentities(){var t;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(t=r.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(r){if(ut(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var r;try{const{data:n,error:i}=await this._useSession(async o=>{var s,a,l,d,u;const{data:h,error:f}=o;if(f)throw f;const p=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(s=t.options)===null||s===void 0?void 0:s.redirectTo,scopes:(a=t.options)===null||a===void 0?void 0:a.scopes,queryParams:(l=t.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await bt(this.fetch,"GET",p,{headers:this.headers,jwt:(u=(d=h.session)===null||d===void 0?void 0:d.access_token)!==null&&u!==void 0?u:void 0})});if(i)throw i;return Tn()&&!(!((r=t.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),this._returnResult({data:{provider:t.provider,url:n==null?void 0:n.url},error:null})}catch(n){if(ut(n))return this._returnResult({data:{provider:t.provider,url:null},error:n});throw n}}async linkIdentityIdToken(t){return await this._useSession(async r=>{var n;try{const{error:i,data:{session:o}}=r;if(i)throw i;const{options:s,provider:a,token:l,access_token:d,nonce:u}=t,h=await bt(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=o==null?void 0:o.access_token)!==null&&n!==void 0?n:void 0,body:{provider:a,id_token:l,access_token:d,nonce:u,link_identity:!0,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}},xform:ho}),{data:f,error:p}=h;return p?this._returnResult({data:{user:null,session:null},error:p}):!f||!f.session||!f.user?this._returnResult({data:{user:null,session:null},error:new Oc}):(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("USER_UPDATED",f.session)),this._returnResult({data:f,error:p}))}catch(i){if(await En(this.storage,`${this.storageKey}-code-verifier`),ut(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}})}async unlinkIdentity(t){try{return await this._useSession(async r=>{var n,i;const{data:o,error:s}=r;if(s)throw s;
55return await bt(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(i=(n=o.session)===null||n===void 0?void 0:n.access_token)!==null&&i!==void 0?i:void 0})})}catch(r){if(ut(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(t){const r=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(r,"begin");try{const n=Date.now();return await MF(async i=>(i>0&&await DF(200*Math.pow(2,i-1)),this._debug(r,"refreshing attempt",i),await bt(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:ho})),(i,o)=>{const s=200*Math.pow(2,i);return o&&s2(o)&&Date.now()+s-n<Yc})}catch(n){if(this._debug(r,"error",n),ut(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(r,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,r){const n=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",r,"url",n),Tn()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:t,url:n},error:null}}async _recoverAndRefresh(){var t,r;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const i=await ml(this.storage,this.storageKey);if(i&&this.userStorage){let s=await ml(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!s&&(s={user:i.user},await Zc(this.userStorage,this.storageKey+"-user",s)),i.user=(t=s==null?void 0:s.user)!==null&&t!==void 0?t:a2()}else if(i&&!i.user&&!i.user){const s=await ml(this.storage,this.storageKey+"-user");s&&(s!=null&&s.user)?(i.user=s.user,await En(this.storage,this.storageKey+"-user"),await Zc(this.storage,this.storageKey,i)):i.user=a2()}if(this._debug(n,"session from storage",i),!this._isValidSession(i)){this._debug(n,"session is not valid"),i!==null&&await this._removeSession();return}const o=((r=i.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<o2;if(this._debug(n,`session has${o?"":" not"} expired with margin of ${o2}s`),o){if(this.autoRefreshToken&&i.refresh_token){const{error:s}=await this._callRefreshToken(i.refresh_token);s&&(console.error(s),s2(s)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",s),await this._removeSession()))}}else if(i.user&&i.user.__isUserNotAvailableProxy===!0)try{const{data:s,error:a}=await this._getUser(i.access_token);!a&&(s!=null&&s.user)?(i.user=s.user,await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(s){console.error("Error getting user data:",s),this._debug(n,"error getting user data, skipping SIGNED_IN notification",s)}else await this._notifyAllSubscribers("SIGNED_IN",i)}catch(i){this._debug(n,"error",i),console.error(i);return}finally{this._debug(n,"end")}}async _callRefreshToken(t){var r,n;if(!t)throw new Ri;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const i=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new uT;const{data:o,error:s}=await this._refreshAccessToken(t);if(s)throw s;if(!o.session)throw new Ri;await this._saveSession(o.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",o.session);const a={data:o.session,error:null};return this.refreshingDeferred.resolve(a),a}catch(o){if(this._debug(i,"error",o),ut(o)){const s={data:null,error:o};return s2(o)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(s),s}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(o),o}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(t,r,n=!0){const i=`#_notifyAllSubscribers(${t})`;this._debug(i,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:t,session:r});const o=[],s=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(t,r)}catch(l){o.push(l)}});if(await Promise.all(s),o.length>0){for(let a=0;a<o.length;a+=1)console.error(o[a]);throw o[0]}}finally{this._debug(i,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await En(this.storage,`${this.storageKey}-code-verifier`);const r=Object.assign({},t),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await Zc(this.userStorage,this.storageKey+"-user",{user:r.user});const i=Object.assign({},r);delete i.user;const o=e6(i);await Zc(this.storage,this.storageKey,o)}else{const i=e6(r);await Zc(this.storage,this.storageKey,i)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await En(this.storage,this.storageKey),await En(this.storage,this.storageKey+"-code-verifier"),await En(this.storage,this.storageKey+"-user"),this.userStorage&&await En(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&Tn()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}
55catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),Yc);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const i=Math.floor((n.expires_at*1e3-t)/Yc);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${Yc}ms, refresh threshold is ${_5} ticks`),i<=_5&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof hT)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Tn()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const r=`#_onVisibilityChanged(${t})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,r,n){const i=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&i.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&i.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[o,s]=await jc(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(o)}`,code_challenge_method:`${encodeURIComponent(s)}`});i.push(a.toString())}if(n!=null&&n.queryParams){const o=new URLSearchParams(n.queryParams);i.push(o.toString())}return n!=null&&n.skipBrowserRedirect&&i.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${t}?${i.join("&")}`}async _unenroll(t){try{return await this._useSession(async r=>{var n;const{data:i,error:o}=r;return o?this._returnResult({data:null,error:o}):await bt(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(ut(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(t){try{return await this._useSession(async r=>{var n,i;const{data:o,error:s}=r;if(s)return this._returnResult({data:null,error:s});const a=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:l,error:d}=await bt(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(n=o==null?void 0:o.session)===null||n===void 0?void 0:n.access_token});return d?this._returnResult({data:null,error:d}):(t.factorType==="totp"&&l.type==="totp"&&(!((i=l==null?void 0:l.totp)===null||i===void 0)&&i.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),this._returnResult({data:l,error:null}))})}catch(r){if(ut(r))return this._returnResult({data:null,error:r});throw r}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:i,error:o}=r;if(o)return this._returnResult({data:null,error:o});const s=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?hU(t.webauthn.credential_response):fU(t.webauthn.credential_response)})}:{code:t.code}),{data:a,error:l}=await bt(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:s,headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});return l?this._returnResult({data:null,error:l}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",a),this._returnResult({data:a,error:l}))})}catch(r){if(ut(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:i,error:o}=r;if(o)return this._returnResult({data:null,error:o});const s=await bt(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});if(s.error)return s;const{data:a}=s;if(a.type!=="webauthn")return{data:a,error:null};switch(a.webauthn.type){case"create":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:uU(a.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:dU(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(ut(r))return this._returnResult({data:null,error:r});throw r}})}async _challengeAndVerify(t){const{data:r,error:n}=await this._challenge({factorId:t.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:t.factorId,challengeId:r.id,code:t.code})}async _listFactors(){var t;const{data:{user:r},error:n}=await this.getUser();if(n)return{data:null,error:n};const i={all:[],phone:[],totp:[],webauthn:[]};for(const o of(t=r==null?void 0:r.factors)!==null&&t!==void 0?t:[])i.all.push(o),o.status==="verified"&&i[o.factor_type].push(o);return{data:i,error:null}}async _getAuthenticatorAssuranceLevel(t){var r,n,i,o;if(t)try{const{payload:p}=Cp(t);let m=null;p.aal&&(m=p.aal);let g=m;const{data:{user:y},error:b}=await this.getUser(t);if(b)return this._returnResult({data:null,error:b});((n=(r=y==null?void 0:y.factors)===null||r===void 0?void 0:r.filter(k=>k.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(g="aal2");const S=p.amr||[];return{data:{currentLevel:m,nextLevel:g,currentAuthenticationMethods:S},error:null}}catch(p){if(ut(p))return this._returnResult({data:null,error:p});throw p}const{data:{session:s},error:a}
55=await this.getSession();if(a)return this._returnResult({data:null,error:a});if(!s)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:l}=Cp(s.access_token);let d=null;l.aal&&(d=l.aal);let u=d;((o=(i=s.user.factors)===null||i===void 0?void 0:i.filter(p=>p.status==="verified"))!==null&&o!==void 0?o:[]).length>0&&(u="aal2");const f=l.amr||[];return{data:{currentLevel:d,nextLevel:u,currentAuthenticationMethods:f},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async r=>{const{data:{session:n},error:i}=r;return i?this._returnResult({data:null,error:i}):n?await bt(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:n.access_token,xform:o=>({data:o,error:null})}):this._returnResult({data:null,error:new Ri})})}catch(r){if(ut(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:i},error:o}=n;if(o)return this._returnResult({data:null,error:o});if(!i)return this._returnResult({data:null,error:new Ri});const s=await bt(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"approve"},xform:a=>({data:a,error:null})});return s.data&&s.data.redirect_url&&Tn()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(s.data.redirect_url),s})}catch(n){if(ut(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:i},error:o}=n;if(o)return this._returnResult({data:null,error:o});if(!i)return this._returnResult({data:null,error:new Ri});const s=await bt(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"deny"},xform:a=>({data:a,error:null})});return s.data&&s.data.redirect_url&&Tn()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(s.data.redirect_url),s})}catch(n){if(ut(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?await bt(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new Ri})})}catch(t){if(ut(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async r=>{const{data:{session:n},error:i}=r;return i?this._returnResult({data:null,error:i}):n?(await bt(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Ri})})}catch(r){if(ut(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(t,r={keys:[]}){let n=r.keys.find(a=>a.kid===t);if(n)return n;const i=Date.now();if(n=this.jwks.keys.find(a=>a.kid===t),n&&this.jwks_cached_at+wF>i)return n;const{data:o,error:s}=await bt(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(s)throw s;return!o.keys||o.keys.length===0||(this.jwks=o,this.jwks_cached_at=i,n=o.keys.find(a=>a.kid===t),!n)?null:n}async getClaims(t,r={}){try{let n=t;if(!n){const{data:p,error:m}
55=await this.getSession();if(m||!p.session)return this._returnResult({data:null,error:m});n=p.session.access_token}const{header:i,payload:o,signature:s,raw:{header:a,payload:l}}=Cp(n);r!=null&&r.allowExpired||zF(o.exp);const d=!i.alg||i.alg.startsWith("HS")||!i.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(i.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!d){const{error:p}=await this.getUser(n);if(p)throw p;return{data:{claims:o,header:i,signature:s},error:null}}const u=WF(i.alg),h=await crypto.subtle.importKey("jwk",d,u,!0,["verify"]);if(!await crypto.subtle.verify(u,h,s,PF(`${a}.${l}`)))throw new w5("Invalid JWT signature");return{data:{claims:o,header:i,signature:s},error:null}}catch(n){if(ut(n))return this._returnResult({data:null,error:n});throw n}}}Vh.nextInstanceID={};const wU=Vh,EU="2.103.0";let Zd="";typeof Deno<"u"?Zd="deno":typeof document<"u"?Zd="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Zd="react-native":Zd="node";const SU={"X-Client-Info":`supabase-js-${Zd}/${EU}`},CU={headers:SU},TU={schema:"public"},AU={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},kU={};function Hh(e){"@babel/helpers - typeof";return Hh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hh(e)}function RU(e,t){if(Hh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Hh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function IU(e){var t=RU(e,"string");return Hh(t)=="symbol"?t:t+""}function PU(e,t,r){return(t=IU(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Mr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?l6(Object(r),!0).forEach(function(n){PU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l6(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}const OU=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),jU=()=>Headers,LU=(e,t,r)=>{const n=OU(r),i=jU();return async(o,s)=>{var a;const l=(a=await t())!==null&&a!==void 0?a:e;let d=new i(s==null?void 0:s.headers);return d.has("apikey")||d.set("apikey",e),d.has("Authorization")||d.set("Authorization",`Bearer ${l}`),n(o,Mr(Mr({},s),{},{headers:d}))}};function $U(e){return e.endsWith("/")?e:e+"/"}function DU(e,t){var r,n;const{db:i,auth:o,realtime:s,global:a}=e,{db:l,auth:d,realtime:u,global:h}=t,f={db:Mr(Mr({},l),i),auth:Mr(Mr({},d),o),realtime:Mr(Mr({},u),s),storage:{},global:Mr(Mr(Mr({},h),a),{},{headers:Mr(Mr({},(r=h==null?void 0:h.headers)!==null&&r!==void 0?r:{}),(n=a==null?void 0:a.headers)!==null&&n!==void 0?n:{})}),accessToken:async()=>""};return e.accessToken?f.accessToken=e.accessToken:delete f.accessToken,f}function MU(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL($U(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var NU=class extends wU{constructor(e){super(e)}},FU=class{constructor(e,t,r){var n,i;this.supabaseUrl=e,this.supabaseKey=t;const o=MU(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",o),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",o),this.storageUrl=new URL("storage/v1",o),this.functionsUrl=new URL("functions/v1",o);const s=`sb-${o.hostname.split(".")[0]}-auth-token`,a={db:TU,realtime:kU,auth:Mr(Mr({},AU),{},{storageKey:s}),global:CU},l=DU(r??{},a);if(this.storageKey=(n=l.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(i=l.global.headers)!==null&&i!==void 0?i:{},l.accessToken)this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(u,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} is not possible`)}});else{var d;this.auth=this._initSupabaseAuthClient((d=l.auth)!==null&&d!==void 0?d:{},this.headers,l.global.fetch)}this.fetch=LU(t,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Mr({headers:this.headers,accessToken:this._getAccessToken.bind(this)},l.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(u=>this.realtime.setAuth(u)).catch(u=>console.warn("Failed to set initial Realtime auth token:",u)),this.rest=new sN(new URL("rest/v1",o).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch,timeout:l.db.timeout,urlLengthLimit:l.db.urlLengthLimit}),this.storage=new vF(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new ZM(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,r)}
55channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,r;if(e.accessToken)return await e.accessToken();const{data:n}=await e.auth.getSession();return(t=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:i,storageKey:o,flowType:s,lock:a,debug:l,throwOnError:d},u,h){const f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new NU({url:this.authUrl.href,headers:Mr(Mr({},f),u),storageKey:o,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:i,flowType:s,lock:a,debug:l,throwOnError:d,fetch:h,hasCustomAuthorizationHeader:Object.keys(this.headers).some(p=>p.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new UN(this.realtimeUrl.href,Mr(Mr({},e),{},{params:Mr(Mr({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t==null?void 0:t.access_token)})}_handleTokenChanged(e,t,r){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const UU=(e,t,r)=>new FU(e,t,r);function BU(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const r=t.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=18:!1}BU()&&console.warn("â ï¸ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const fe={PAGE_VIEW:"PageView",SHARE:{FAILED:"Share:Failed"},APP:{OPEN:"App:Open",PUSH_NOTIFICATION_OPEN:"App:PushNotification:Open",DEEP_LINK_OPEN:"App:DeepLink:Open",REVIEW_REQUESTED:"App:Review:Requested",LIVE_UPDATE_APPLIED:"App:LiveUpdate:UpdateApplied",LIVE_UPDATE_ERROR:"App:LiveUpdate:Error",LIVE_UPDATE_DEFERRED:"App:LiveUpdate:Deferred",LIVE_UPDATE_SYNC_ERROR:"App:LiveUpdate:SyncError",SUPABASE_HOST_FAILOVER:"App:SupabaseHost:Failover",SUPABASE_HOST_FALLBACK_BOOT:"App:SupabaseHost:FallbackBoot",SUPABASE_HOST_RECOVERED:"App:SupabaseHost:Recovered",SUPABASE_HOST_RESET:"App:SupabaseHost:Reset"},NAVIGATION:{BUTTON_CLICK:"Navigation:ButtonClick"},REGISTRATION:{START:"Registration:Start",STEP_SALES_CHANNELS:"Registration:Step:SalesChannels",STEP_SEGMENT:"Registration:Step:Segment",STEP_BUSINESS_TYPE:"Registration:Step:BusinessType",STEP_FIRST_GOAL:"Registration:Step:FirstGoal",STEP_PHONE:"Registration:Step:Phone",STEP_AUTH_OPTIONS:"Registration:Step:AuthOptions",STEP_VERIFICATION:"Registration:Step:Verification",STEP_STORE_NAME:"Registration:Step:StoreName",STEP_STORE_SLUG:"Registration:Step:StoreSlug",STEP_COLOR:"Registration:Step:Color",STEP_LOGO:"Registration:Step:Logo",STEP_PERSONAL_INFO:"Registration:Step:PersonalInfo",COMPLETE:"Registration:Complete",SUCCESS:"Registration:Success",ERROR:"Registration:Error",LOGO_UPLOAD_ERROR:"Registration:LogoU
55ploadError",WHATSAPP_GROUP:"Registration:WhatsAppGroup",PHONE_ERROR:"Registration:PhoneError",OTP_ERROR:"Registration:OTPError",OTP_RESEND:"Registration:OTPresend",AUTH_METHOD_SELECTED:"Registration:AuthMethodSelected",EMAIL_AUTH_SELECTED:"Registration:EmailAuthSelected",SMS_AUTH_SELECTED:"Registration:SMSAuthSelected",EMAIL_AUTH_SENT:"Registration:EmailAuthSent",EMAIL_AUTH_ERROR:"Registration:EmailAuthError",EMAIL_VERIFIED:"Registration:EmailVerified",EMAIL_RESEND:"Registration:EmailResend",EMAIL_RESEND_ERROR:"Registration:EmailResendError",GOOGLE_AUTH_SELECTED:"Registration:GoogleAuthSelected",GOOGLE_AUTH_SUCCESS:"Registration:GoogleAuthSuccess",GOOGLE_AUTH_ERROR:"Registration:GoogleAuthError",GOOGLE_VERIFIED:"Registration:GoogleVerified",PHONE_SAVED_TO_AUTH:"Registration:PhoneSavedToAuth",QUIZ_ANSWERS_SAVED:"Registration:QuizAnswersSaved",QUIZ_ANSWERS_ERROR:"Registration:QuizAnswersError",QUIZ_ANSWERS_SUBMITTED:"Registration:QuizAnswersSubmitted",STEP_NOTIFICATION_PERMISSION:"Registration:Step:NotificationPermission"},PRODUCT:{CREATE_START:"Product:Create:Start",EDIT_START:"Product:Edit:Start",CREATE_COMPLETE:"Product:Create:Complete",EDIT_COMPLETE:"Product:Edit:Complete",DELETE_COMPLETE:"Product:Delete:Complete",DELETE_ERROR:"Product:Delete:Error",CREATE_ERROR:"Product:Create:Error",EDIT_ERROR:"Product:Edit:Error",CREATE_THRESHOLD_3:"Product:Create:Threshold:3",CREATE_THRESHOLD_4:"Product:Create:Threshold:4",CREATE_THRESHOLD_6:"Product:Create:Threshold:6",CREATE_THRESHOLD_8:"Product:Create:Threshold:8",CREATE_THRESHOLD_10:"Product:Create:Threshold:10",CREATE_THRESHOLD_15:"Product:Create:Threshold:15",CREATE_THRESHOLD_18:"Product:Create:Threshold:18",CREATE_THRESHOLD_20:"Product:Create:Threshold:20",IMAGE_COMPRESSION_ERROR:"Product:Image:Compression:Error",IMAGE_COMPRESSION_SKIPPED:"Product:Image:Compression:Skipped",IMAGE_UPLOAD_ERROR:"Product:Image:Upload:Error",VIDEO_UPLOAD_STARTED:"Product:Video:Upload:Started",VIDEO_UPLOAD_COMPLETE:"Product:Video:Upload:Complete",VIDEO_UPLOAD_ERROR:"Product:Video:Upload:Error",IMAGE_STUDIO_GENERATE_STARTED:"Product:ImageStudio:Generate:Started",IMAGE_STUDIO_GENERATE_SUCCESS:"Product:ImageStudio:Generate:Success",IMAGE_STUDIO_GENERATE_ERROR:"Product:ImageStudio:Generate:Error",IMAGE_STUDIO_GENERATE_TIMEOUT:"Product:ImageStudio:Generate:Timeout",IMAGE_STUDIO_USE_IN_PRODUCT:"Product:ImageStudio:UseInProduct",QUICK_CREATE_OPEN:"Product:QuickCreate:Open",QUICK_CREATE_COMPLETE:"Product:QuickCreate:Complete",QUICK_CREATE_ERROR:"Product:QuickCreate:Error",DUPLICATE_PERSONALIZATION_COPY_ERROR:"Product:Duplicate:PersonalizationCopy:Error",DUPLICATE_COMBO_COPY_ERROR:"Product:Duplicate:ComboCopy:Error",CREATE_TYPE_SWITCH:"Product:Create:TypeSwitch"},STORE:{CUSTOMIZE_START:"Store:Customize:Start",CUSTOMIZE_COMPLETE:"Store:Customize:Complete",CUSTOMIZE_ERROR:"Store:Customize:Error",SHARE:"Store:Share"},BRAND:{LOGO_GENERATE_STARTED:"Brand:Logo:Generate:Started",LOGO_GENERATE_SUCCESS:"Brand:Logo:Generate:Success",LOGO_GENERATE_ERROR:"Brand:Logo:Generate:Error",LOGO_GENERATE_APPLIED:"Brand:Logo:Generate:Applied"},AUTH:{LOGIN_START:"Auth:Login:Start",LOGIN_SUCCESS:"Auth:Login:Success",LOGIN_PHONE_ERROR:"Auth:Login:PhoneError",LOGIN_OTP_ERROR:"Auth:Login:OTPError",MAGIC_LINK_LOGIN_START:"Auth:MagicLink:LoginStart",MAGIC_LINK_LOGIN_SUCCESS:"Auth:MagicLink:LoginSuccess",MAGIC_LINK_LOGIN_ERROR:"Auth:MagicLink:LoginError",LOGOUT:"Auth:Logout",FORCED_LOGOUT_DUE_TO_ERROR:"Auth:ForcedLogoutDueToError",FORCED_REFRESH_TOKEN:"Auth:ForcedRefreshToken",CANCEL_OTP:"Auth:CancelOTP",RESEND_OTP:"Auth:ResendOTP",FORCED_SMS:"Auth:ForcedSMS",DELETE_ACCOUNT_MENU_OPEN:"Auth:DeleteAccount:MenuOpen",DELETE_ACCOUNT_INITIAL_CONFIRM:"Auth:DeleteAccount:InitialConfirm",DELET
55E_ACCOUNT_FINAL_CONFIRM:"Auth:DeleteAccount:FinalConfirm",DELETE_ACCOUNT_SUCCESS:"Auth:DeleteAccount:Success",DELETE_ACCOUNT_ERROR:"Auth:DeleteAccount:Error",DELETE_ACCOUNT_BLOCKED_SUBSCRIPTION:"Auth:DeleteAccount:BlockedSubscription"},SUBSCRIPTION:{VIEW:"Subscription:View",PAYWALL_VIEW:"Subscription:PaywallView",PURCHASE_CLICK:"Subscription:Purchase:Click",PURCHASE_SELECT_OPTION:"Subscription:Purchase:SelectOption",COMPLETE:"Subscription:Complete",CANCEL:"Subscription:Cancel",SUBSCRIBED_TO_STOQUI:"subscribed_to_stoqui",UPDATE_PAYMENT_CLICK:"Subscription:UpdatePayment:Click"},PAYWALL:{VIEW:"Paywall:View",CLOSE:"Paywall:Close",PLAN_SELECT:"Paywall:PlanSelect",BILLING_CYCLE_CHANGE:"Paywall:BillingCycleChange",PURCHASE_CLICK:"Paywall:PurchaseClick",PURCHASE_SUCCESS:"Paywall:PurchaseSuccess",COMPARE_PLANS_CLICK:"Paywall:ComparePlansClick",SCROLL_TO_BOTTOM:"Paywall:ScrollToBottom"},EXPERIMENT:{FIRST_SCREEN_HOME:"Experiment:FirstScreen:Assigned:Home",FIRST_SCREEN_CREATE_PRODUCT:"Experiment:FirstScreen:Assigned:CreateProduct",PRODUCT_ATTRIBUTES_FREE:"Experiment:ProductAttributes:Assigned:Free",PRODUCT_ATTRIBUTES_PAID:"Experiment:ProductAttributes:Assigned:Paid"},PAYWALL_V2:{TRIGGER:"Paywall:Trigger",VIEW:"PaywallV2:View",CLOSE:"PaywallV2:Close",PLAN_SELECT:"PaywallV2:PlanSelect",BILLING_CYCLE_CHANGE:"PaywallV2:BillingCycleChange",PURCHASE_CLICK:"PaywallV2:PurchaseClick",PURCHASE_SUCCESS:"PaywallV2:PurchaseSuccess",PURCHASE_ERROR:"PaywallV2:PurchaseError",PURCHASE_UNAVAILABLE:"PaywallV2:PurchaseUnavailable",COMPARE_PLANS_CLICK:"PaywallV2:ComparePlansClick"},CANCELLATION:{FLOW_OPENED:"Cancellation:Flow:Opened",REASON_SELECTED:"Cancellation:Reason:Selected",SAVE_SHOWN:"Cancellation:Save:Shown",KEPT:"Cancellation:Kept",CONTINUED:"Cancellation:Continued",HELP_CLICK:"Cancellation:Help:Click",COMPLETED:"Cancellation:Completed",ERROR:"Cancellation:Error"},ORDER:{PRINT_CLICK:"Order:Print:Click",PRINT_SUCCESS:"Order:Print:Success",PRINT_ERROR:"Order:Print:Error",PRINTER_SEARCH:"Order:Printer:Search",PRINTER_SELECTED:"Order:Printer:Selected",PRINTER_NOT_FOUND:"Order:Printer:NotFound",PRINTER_ERROR:"Order:Printer:Error",PRINTER_CONNECTED:"Order:Printer:Connected",CREATE_CLICK:"Order:Create:Click",CREATE_START:"Order:Create:Start",CREATE_BLOCKED:"Order:Create:Blocked",CREATE_ADD_PRODUCT:"Order:Create:AddProduct",CREATE_SUCCESS:"Order:Create:Success",CREATE_ERROR:"Order:Create:Error",PERSONALIZATION_OPEN:"Order:Personalization:Open",PERSONALIZATION_ADD:"Order:Personalization:Add",PERSONALIZATION_EDIT:"Order:Personalization:Edit",PERSONALIZATION_IMPORT:"Order:Personalization:Import"},IMPORT_CART:{OPEN:"ImportCart:Open",HIT_PAYWALL:"ImportCart:HitPaywall",SUCCESS:"ImportCart:Success",ERROR:"ImportCart:Error"},SUPPORT:{SUPPORT_CLICK:"Support:Support:Click",WHATSAPP_CLICK:"Support:WhatsApp:Click",SALES_CLICK:"Support:Sales:Click"},ONESIGNAL:{PERMISSION_GRANTED:"OneSignal:Permission:Granted",PERMISSION_DENIED:"OneSignal:Permission:Denied",PERMISSION_SOFT_SKIP:"OneSignal:Permission:SoftSkip",PERMISSION_CONTEXTUAL_ACCEPTED:"OneSignal:Permission:Contextual:Accepted"},FCM:{TOKEN_REGISTERED:"FCM:Token:Registered",ERROR:"FCM:Error"},ERROR:{ERROR:"Error:General",QUERY_FAILED:"Error:Query:Failed",MUTATION_FAILED:"Error:Mutation:Failed"},SESSION:{REFRESH_ATTEMPT:"Session:Refresh:Attempt",REFRESH_SUCCESS:"Session:Refresh:Success",REFRESH_ERROR:"Session:Refresh:Error"},BANNER:{CLICK:"Banner:Click"},HOME:{REPORTS_LINK_CLICK:"Home:ReportsLink:Click"},LABEL:{PDF_GENERATED:"Label:PDF:Generated"},DELETE:{CUSTOMER:"Delete:Customer",CUSTOMER_BULK:"Delete:Customer:Bulk",CUSTOMER_RESTORE:"Delete:Customer:Restore",ORDER:"Delete:Order",ORDER_BULK:"Delete:Order:Bulk",PRODUCT_BULK:"Delete:Product:Bulk",COUPON:"Delete:Coupon",SUPPLIER:"Delete:Supplier",SUPPLIER_BULK:"Delete:Supplier:Bulk",CONVERSATION:"Delete:Conversation",CONVERSATION_BULK:"Delete:Conversation:Bulk",SHIPPING_REGION:"Delete:ShippingRegion",GENERATION:"Delete:Generation",ABANDONED_CART:"Delete:AbandonedCart",PRICE_TABLE:"Delete:PriceTable",PAYMENT_METHOD:"Delete:PaymentMethod",ATTRIBUTE:"Delete:Attribute",ATTRIBUTE_VALUE:"Delete:AttributeValue"},STOCK_CONFLICT:{DETECTED:"StockConflict:Detected",ADJUST_ACCEPTED:"StockConflict:Adjust:Accepted",ADJUST_DISMISSED_FIRST:"StockConflict:Adjust:
55DismissedFirst",RISK_ACKNOWLEDGED:"StockConflict:Risk:Acknowledged",RISK_CANCELLED:"StockConflict:Risk:Cancelled",RESOLVE_ERROR:"StockConflict:Resolve:Error",UNFIXABLE_WARNED:"StockConflict:Unfixable:Warned"},MISC:{TEST:"Test:ButtonClick"}};var VU={VITE_ONESIGNAL_APP_ID:"d275f7e8-1da8-448e-b753-3a8623d08ff9",VITE_VERCEL_GIT_REPO_ID:"903014956",VITE_FLAPP_CLIENT_ID:"stoqui-client",VITE_VERCEL_ENV:"production",VITE_VERCEL_GIT_PULL_REQUEST_ID:"",VITE_VERCEL_OBSERVABILITY_CLIENT_CONFIG:'{"analytics":{"scriptSrc":"5c7f35832be5cdac/script.js","viewEndpoint":"5c7f35832be5cdac/view","eventEndpoint":"5c7f35832be5cdac/event","sessionEndpoint":"5c7f35832be5cdac/session"},"speedInsights":{"scriptSrc":"dd9889db239eb903/script.js","endpoint":"dd9889db239eb903/vitals"}}',VITE_VERCEL_BRANCH_URL:"stoqui-app-git-master-lc-haddad.vercel.app",VITE_VERCEL_GIT_COMMIT_SHA:"2ad85febf9735404429b0670d4acf56a0af5a0a2",VITE_GOOGLE_OAUTH_ANDROID_CLIENT_ID:"496661333301-j42kqtc95kuk2gu0b640rs0lfhggpcf4.apps.googleusercontent.com",VITE_VERCEL_URL:"stoqui-knxjt64qe-lc-haddad.vercel.app",VITE_MIXPANEL_TOKEN:"bdb98d7fc008b54b925b5b099913f317",VITE_VERCEL_GIT_COMMIT_AUTHOR_NAME:"leochaddad",VITE_VERCEL_GIT_PREVIOUS_SHA:"",VITE_MERCADO_PAGO_CLIENT_ID:"5640523890674349",VITE_API_URL:"https://catalogo.stoqui.com.br/api",VITE_SUPABASE_URL:"https://spb.stoqui.com.br",VITE_VERCEL_PROJECT_ID:"prj_7Z0bhIlJOelrImZYXL4hKtSVRcnw",VITE_APP_ENV:"production",VITE_MELHOR_ENVIO_REDIRECT_URI:"https://app.stoqui.com.br/profile/shipping/melhorenvio",VITE_VERCEL_PROJECT_PRODUCTION_URL:"app.stoqui.com.br",VITE_CHAT_AVAILABLE:"true",VITE_FLAPP_AUTH_URL:"https://authorization.asaas.com",VITE_SUPABASE_ANON_KEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJ2d3N5b2xncHNidmZsaGJxaWx5Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTY5NDU5ODMsImV4cCI6MjAxMjUyMTk4M30.IeHTL6jYLp-4qOaUEcWyfaf9U88gx_Az7yCqnbKC428",VITE_VERCEL_DEPLOYMENT_ID:"dpl_52bArHmdy91NN4TjGRMA3N9YpZP3",VITE_VERCEL_GIT_REPO_OWNER:"Versi-Tecnologia-LTDA",VITE_MELHOR_ENVIO_API_URL:"https://melhorenvio.com.br",VITE_VERCEL_GIT_COMMIT_AUTHOR_LOGIN:"leochaddad",VITE_VERCEL_TARGET_ENV:"production",VITE_MERCADO_PAGO_REDIRECT_URI:"https://app.stoqui.com.br/profile/mercadopago",VITE_VERCEL_GIT_PROVIDER:"github",VITE_APP_URL:"https://app.stoqui.com.br",VITE_GOOGLE_OAUTH_WEB_CLIENT_ID:"496661333301-1rtif0doi99fcohm1on1vdbcb7vlh2rs.apps.googleusercontent.com",VITE_VERCEL_GIT_COMMIT_REF:"master",VITE_VERCEL_GIT_REPO_SLUG:"stoqui-app",VITE_DISABLE_IMAGE_RESIZING:"true",VITE_VERCEL_GIT_COMMIT_MESSAGE:`feat(relatorios): paginar "todos os produtos" e mostrar o total do perÃodo 56 57A tela pedia limit 100 e renderizava o array cru, então loja que vendeu 58mais de 100 produtos distintos no perÃodo perdia o resto sem aviso - e 59ampliar o perÃodo piorava, porque mais produtos concorrem pelo corte. 60 61- usa /reports/top-products/v2 via useInfiniteQuery, com "Carregar mais 62 produtos" e contador "X de Y"; 63- cabeçalho mostra o total real do perÃodo (vem do banco), então o 64 truncamento nunca mais é silencioso; 65- CSV agora busca todas as páginas em vez de exportar só o que estava 66 carregado na tela. 67 68O widget do dashboard (TopProductsTable) fica na v1 de propósito: ali 69top 5 é o comportamento correto. 70 71A queryKey mantém o prefixo "report-top-products", então as 72invalidações de useDeleteOrders/useEditOrder/useBulkDeleteOrders 73continuam valendo. 74 75Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>`,VITE_MELHOR_ENVIO_CLIENT_ID:"17597",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const zh="https://spb.stoqui.com.br",HU="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJ2d3N5b2xncHNidmZsaGJxaWx5Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTY5NDU5ODMsImV4cCI6MjAxMjUyMTk4M30.IeHTL6jYLp-4qOaUEcWyfaf9U88gx_Az7yCqnbKC428",Wh=VU.VITE_SUPABASE_FALLBACK_URL,zU="sb-bvwsyolgpsbvflhbqily-auth-token",E5="sb-use-fallback-host",mT=6e3;class F_ extends Error{constructor(){super("Supabase host timed out"),this.name="HostTimeoutError"}}function WU(){try{return localStorage.getItem(E5)==="1"}catch{return!1}}function U_(e){try{e?localStorage.setItem(E5,"1"):localStorage.removeItem(E5)}catch{}}function B_(e,t){X(()=>Promise.resolve().then(()=>NV),void 0).then(({trackEvent:r})=>r(e,t)).catch(()=>{})}const V_=!!Wh;let ja=V_&&WU();const gT=ja?Wh:zh;ja&&B_(fe.APP.SUPABASE_HOST_FALLBACK_BOOT,{host:gT});function vT(e){return e.startsWith(zh)?zh:V_&&e.startsWith(Wh)?Wh:null}function c6(e,t){const r=vT(e);return r?t+e.slice(r.length):e}function Xd(){return ja?Wh:zh}function qU(){return typeof navigator<"u"&&navigator.onLine===!1}function GU(e){return typeof e=="string"?e:e instanceof URL?e.toString():e.url}
75function u6(e,t){return e instanceof Request?new Request(t,e):t}const KU=new Set(["GET","HEAD","OPTIONS"]);function d6(e,t){return((t==null?void 0:t.method)??(e instanceof Request?e.method:"GET")).toUpperCase()}function YU(e){return e instanceof TypeError||e instanceof F_}async function ZU(e,t,r,n){if(!n||r.includes("/storage/v1/"))return fetch(e,t);const i=new AbortController,o=t==null?void 0:t.signal;let s=!1;const a=setTimeout(()=>{s=!0,i.abort()},mT),l=()=>i.abort();o==null||o.addEventListener("abort",l);try{return await fetch(e,{...t,signal:i.signal})}catch(d){throw s&&!(o!=null&&o.aborted)?new F_:d}finally{clearTimeout(a),o==null||o.removeEventListener("abort",l)}}let yT=null,S5=0;const XU=3e4,JU=async(e,t)=>{if(!V_)return fetch(e,t);const r=GU(e);if(!vT(r))return fetch(e,t);const n=KU.has(d6(e,t)),i=Xd(),o=c6(r,i),s=o===r?e:u6(e,o);try{const a=await ZU(s,t,o,n);return ja&&eB(),a}catch(a){if(!YU(a)||(yT=i,qU()))throw a;const l=Date.now();if(Xd()===i&&l-S5>=XU&&(S5=l,ja=!ja,U_(ja),B_(fe.APP.SUPABASE_HOST_FAILOVER,{reason:a instanceof F_?"timeout":"network",method:d6(e,t),endpoint:new URL(o).pathname,from:i,to:Xd()})),!n)throw a;const d=Xd();if(d===i)throw a;return fetch(u6(e,c6(r,d)),t)}};let C5=0;const QU=10*60*1e3;async function eB(){const e=Date.now();if(e-C5<QU)return;C5=e;const t=new AbortController,r=setTimeout(()=>t.abort(),mT);try{await fetch(`${zh}/auth/v1/health`,{method:"GET",signal:t.signal}),U_(!1),B_(fe.APP.SUPABASE_HOST_RECOVERED)}catch{}finally{clearTimeout(r)}}const Te=UU(gT,HU,{auth:{storageKey:zU},global:{fetch:JU}});function tB(){ja=!1,U_(!1),C5=0,S5=0}function rB(){try{return new URL(yT??Xd()).hostname}catch{return""}}function nB(e){return e?e.name==="AuthRetryableFetchError"?!0:/failed to fetch|load failed|networkerror|network error/i.test(e.message??""):!1}var ko={DEBUG:!1,LIB_VERSION:"2.70.0"},tt;if(typeof window>"u"){var h6={hostname:""};tt={crypto:{randomUUID:function(){throw Error("unsupported")}},navigator:{userAgent:"",onLine:!0},document:{createElement:function(){return{}},location:h6,referrer:""},screen:{width:0,height:0},location:h6,addEventListener:function(){},removeEventListener:function(){}}}else tt=window;var f6=tt.setImmediate,Va,T5,A5,_T=Object.prototype.toString,iB=typeof f6<"u"?function(t){return f6(t)}:setTimeout;try{Object.defineProperty({},"x",{}),Va=function(t,r,n,i){return Object.defineProperty(t,r,{value:n,writable:!0,configurable:i!==!1})}}catch{Va=function(r,n,i){return r[n]=i,r}}A5=function(){var t,r,n;function i(o,s){this.fn=o,this.self=s,this.next=void 0}return{add:function(s,a){n=new i(s,a),r?r.next=n:t=n,r=n,n=void 0},drain:function(){var s=t;for(t=r=T5=void 0;s;)s.fn.call(s.self),s=s.next}}}();function s1(e,t){A5.add(e,t),T5||(T5=iB(A5.drain))}function bT(e){var t,r=typeof e;return e!==null&&(r==="object"||r==="function")&&(t=e.then),typeof t=="function"?t:!1}function H_(){for(var e=0;e<this.chain.length;e++)oB(this,this.state===1?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function oB(e,t,r){var n,i;try{t===!1?r.reject(e.msg):(t===!0?n=e.msg:n=t.call(void 0,e.msg),n===r.promise?r.reject(TypeError("Promise-chain cycle")):(i=bT(n))?i.call(n,r.resolve,r.reject):r.resolve(n))}catch(o){r.reject(o)}}function xT(e){var t,r=this;if(!r.triggered){r.triggered=!0,r.def&&(r=r.def);try{(t=bT(e))?s1(function(){var n=new p6(r);try{t.call(e,function(){xT.apply(n,arguments)},function(){dh.apply(n,arguments)})}catch(i){dh.call(n,i)}}):(r.msg=e,r.state=1,r.chain.length>0&&s1(H_,r))}catch(n){dh.call(new p6(r),n)}}}function dh(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&s1(H_,t))}function wT(e,t,r,n){for(var i=0;i<t.length;i++)(function(s){e.resolve(t[s]).then(function(l){r(s,l)},n)})(i)}function p6(e){this.def=e,this.triggered=!1}function sB(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function rl(e){if(typeof e!="function")throw TypeError("Not a function");if(this.__NPO__!==0)throw TypeError("Not a promise");this.__NPO__=1;var t=new sB(this);this.then=function(n,i){var o={success:typeof n=="function"?n:!0,failure:typeof i=="function"?i:!1};return o.promise=new this.constructor(function(a,l){if(typeof a!="function"||typeof l!="function")throw TypeError("Not a function");o.resolve=a,o.reject=l}),t.chain.push(o),t.state!==0&&s1(H_,t),o.promise},this.catch=function(n){return this.then(void 0,n)};try{e.call(void 0,function(n){xT.call(t,n)},function(n){dh.call(t,n)})}
75catch(r){dh.call(t,r)}}var ET=Va({},"constructor",rl,!1);rl.prototype=ET;Va(ET,"__NPO__",0,!1);Va(rl,"resolve",function(t){var r=this;return t&&typeof t=="object"&&t.__NPO__===1?t:new r(function(i,o){if(typeof i!="function"||typeof o!="function")throw TypeError("Not a function");i(t)})});Va(rl,"reject",function(t){return new this(function(n,i){if(typeof n!="function"||typeof i!="function")throw TypeError("Not a function");i(t)})});Va(rl,"all",function(t){var r=this;return _T.call(t)!=="[object Array]"?r.reject(TypeError("Not an array")):t.length===0?r.resolve([]):new r(function(i,o){if(typeof i!="function"||typeof o!="function")throw TypeError("Not a function");var s=t.length,a=Array(s),l=0;wT(r,t,function(u,h){a[u]=h,++l===s&&i(a)},o)})});Va(rl,"race",function(t){var r=this;return _T.call(t)!=="[object Array]"?r.reject(TypeError("Not an array")):new r(function(i,o){if(typeof i!="function"||typeof o!="function")throw TypeError("Not a function");wT(r,t,function(a,l){i(l)},o)})});var br;typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1?br=Promise:br=rl;var aB=24*60*60*1e3,Bm=Array.prototype,lB=Function.prototype,ST=Object.prototype,La=Bm.slice,Of=ST.toString,Vm=ST.hasOwnProperty,Zr=tt.console,$a=tt.navigator,nr=tt.document,Tp=tt.opera,m6=tt.screen,Is=$a.userAgent,c2=lB.bind,g6=Bm.forEach,v6=Bm.indexOf,y6=Bm.map,cB=Array.isArray,k5={},L={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},Jt={log:function(){if(ko.DEBUG&&!L.isUndefined(Zr)&&Zr)try{Zr.log.apply(Zr,arguments)}catch{L.each(arguments,function(t){Zr.log(t)})}},warn:function(){if(ko.DEBUG&&!L.isUndefined(Zr)&&Zr){var e=["Mixpanel warning:"].concat(L.toArray(arguments));try{Zr.warn.apply(Zr,e)}catch{L.each(e,function(r){Zr.warn(r)})}}},error:function(){if(ko.DEBUG&&!L.isUndefined(Zr)&&Zr){var e=["Mixpanel error:"].concat(L.toArray(arguments));try{Zr.error.apply(Zr,e)}catch{L.each(e,function(r){Zr.error(r)})}}},critical:function(){if(!L.isUndefined(Zr)&&Zr){var e=["Mixpanel error:"].concat(L.toArray(arguments));try{Zr.error.apply(Zr,e)}catch{L.each(e,function(r){Zr.error(r)})}}}},u2=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(Jt,arguments)}},jf=function(e){return{log:u2(Jt.log,e),error:u2(Jt.error,e),critical:u2(Jt.critical,e)}},z_=function(e){return function(){try{return e.apply(this,arguments)}catch(t){Jt.critical("Implementation error. Please turn on debug and contact [email protected]."),ko.DEBUG&&Jt.critical(t)}}},CT=function(e){var t=e.prototype;for(var r in t)typeof t[r]=="function"&&(t[r]=z_(t[r]))};L.bind=function(e,t){var r,n;if(c2&&e.bind===c2)return c2.apply(e,La.call(arguments,1));if(!L.isFunction(e))throw new TypeError;return r=La.call(arguments,2),n=function(){if(!(this instanceof n))return e.apply(t,r.concat(La.call(arguments)));var i={};i.prototype=e.prototype;var o=new i;i.prototype=null;var s=e.apply(o,r.concat(La.call(arguments)));return Object(s)===s?s:o},n};L.each=function(e,t,r){if(e!=null){if(g6&&e.forEach===g6)e.forEach(t,r);else if(e.length===+e.length){for(var n=0,i=e.length;n<i;n++)if(n in e&&t.call(r,e[n],n,e)===k5)return}else for(var o in e)if(Vm.call(e,o)&&t.call(r,e[o],o,e)===k5)return}};L.extend=function(e){return L.each(La.call(arguments,1),function(t){for(var r in t)t[r]!==void 0&&(e[r]=t[r])}),e};L.isArray=cB||function(e){return Of.call(e)==="[object Array]"};L.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch{return!1}};L.isArguments=function(e){return!!(e&&Vm.call(e,"callee"))};L.toArray=function(e){return e?e.toArray?e.toArray():L.isArray(e)||L.isArguments(e)?La.call(e):L.values(e):[]};L.map=function(e,t,r){if(y6&&e.map===y6)return e.map(t,r);var n=[];return L.each(e,function(i){n.push(t.call(r,i))}),n};L.keys=function(e){var t=[];return e===null||L.each(e,function(r,n){t[t.length]=n}),t};L.values=function(e){var t=[];return e===null||L.each(e,function(r){t[t.length]=r}),t};L.include=function(e,t){var r=!1;return e===null?r:v6&&e.indexOf===v6?e.indexOf(t)!=-1:(L.each(e,function(n){if(r||(r=n===t))return k5}),r)};L.includes=function(e,t){return e.indexOf(t)!==-1};L.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e};L.isObject=function(e){return e===Object(e)&&!L.isArray(e)};L.isEmptyObject=function(e){if(L.isObject(e)){for(var t in e)if(Vm.call(e,t))return!1;return!0}return!1};L.isUndefined=function(e){return e===void 0};L.isString=function(e){return Of.call(e)=="[object String]"};L.isDate=function(e){return Of.call(e)=="[object Date]"};L.isNumber=function(e){return Of.call(e)=="[object Number]"};L.isElement=function(e){return!!(e&&e.nodeType===1)};L.encodeDates=function(e){return L.each(e,function(t,r){L.isDate(t)?e[r]=L.formatDate(t):L.isObject(t)&&(e[r]=L.encodeDates(t))}),e};L.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()};L.formatDate=function(e){function t(r){return r<10?"0"+r:r}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())};L.strip_empty_properties=function(e){var t={};return L.each(e,function(r,n){L.isString(r)&&r.length>0&&(t[n]=r)}),t};L.truncate=function(e,t){var r;return typeof e=="string"?r=e.slice(0,t):L.isArray(e)?(r=[],L.each(e,function(n){r.push(L.truncate(n,t))})):L.isObject(e)?(r={},L.each(e,function(n,i){r[i]=L.truncate(n,t)})):r=e,r};L.JSONEncode=function(){return function(e){var t=e,r=function(i){var o=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return o.lastIndex=0,o.test(i)?'"'+i.replace(o,function(a){var l=s[a];
vendor: 18,735 bytes, lines 75-81
75return typeof l=="string"?l:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+i+'"'},n=function(i,o){var s="",a=" ",l=0,d="",u="",h=0,f=s,p=[],m=o[i];switch(m&&typeof m=="object"&&typeof m.toJSON=="function"&&(m=m.toJSON(i)),typeof m){case"string":return r(m);case"number":return isFinite(m)?String(m):"null";case"boolean":case"null":return String(m);case"object":if(!m)return"null";if(s+=a,p=[],Of.apply(m)==="[object Array]"){for(h=m.length,l=0;l<h;l+=1)p[l]=n(l,m)||"null";return u=p.length===0?"[]":s?`[ 76`+s+p.join(`, 77`+s)+` 78`+f+"]":"["+p.join(",")+"]",s=f,u}for(d in m)Vm.call(m,d)&&(u=n(d,m),u&&p.push(r(d)+(s?": ":":")+u));return u=p.length===0?"{}":s?"{"+p.join(",")+f+"}":"{"+p.join(",")+"}",s=f,u}};return n("",{"":t})}}();L.JSONDecode=function(){var e,t,r={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:` 79`,r:"\r",t:" "},n,i=function(p){var m=new SyntaxError(p);throw m.at=e,m.text=n,m},o=function(p){return p&&p!==t&&i("Expected '"+p+"' instead of '"+t+"'"),t=n.charAt(e),e+=1,t},s=function(){var p,m="";for(t==="-"&&(m="-",o("-"));t>="0"&&t<="9";)m+=t,o();if(t===".")for(m+=".";o()&&t>="0"&&t<="9";)m+=t;if(t==="e"||t==="E")for(m+=t,o(),(t==="-"||t==="+")&&(m+=t,o());t>="0"&&t<="9";)m+=t,o();if(p=+m,!isFinite(p))i("Bad number");else return p},a=function(){var p,m,g="",y;if(t==='"')for(;o();){if(t==='"')return o(),g;if(t==="\\")if(o(),t==="u"){for(y=0,m=0;m<4&&(p=parseInt(o(),16),!!isFinite(p));m+=1)y=y*16+p;g+=String.fromCharCode(y)}else if(typeof r[t]=="string")g+=r[t];else break;else g+=t}i("Bad string")},l=function(){for(;t&&t<=" ";)o()},d=function(){switch(t){case"t":return o("t"),o("r"),o("u"),o("e"),!0;case"f":return o("f"),o("a"),o("l"),o("s"),o("e"),!1;case"n":return o("n"),o("u"),o("l"),o("l"),null}i('Unexpected "'+t+'"')},u,h=function(){var p=[];if(t==="["){if(o("["),l(),t==="]")return o("]"),p;for(;t;){if(p.push(u()),l(),t==="]")return o("]"),p;o(","),l()}}i("Bad array")},f=function(){var p,m={};if(t==="{"){if(o("{"),l(),t==="}")return o("}"),m;for(;t;){if(p=a(),l(),o(":"),Object.hasOwnProperty.call(m,p)&&i('Duplicate key "'+p+'"'),m[p]=u(),l(),t==="}")return o("}"),m;o(","),l()}}i("Bad object")};return u=function(){switch(l(),t){case"{":return f();case"[":return h();case'"':return a();case"-":return s();default:return t>="0"&&t<="9"?s():d()}},function(p){var m;return n=p,e=0,t=" ",m=u(),l(),t&&i("Syntax error"),m}}();L.base64Encode=function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r,n,i,o,s,a,l,d,u=0,h=0,f="",p=[];if(!e)return e;e=L.utf8Encode(e);do r=e.charCodeAt(u++),n=e.charCodeAt(u++),i=e.charCodeAt(u++),d=r<<16|n<<8|i,o=d>>18&63,s=d>>12&63,a=d>>6&63,l=d&63,p[h++]=t.charAt(o)+t.charAt(s)+t.charAt(a)+t.charAt(l);while(u<e.length);switch(f=p.join(""),e.length%3){case 1:f=f.slice(0,-2)+"==";break;case 2:f=f.slice(0,-1)+"=";break}return f};L.utf8Encode=function(e){e=(e+"").replace(/\r\n/g,` 80`).replace(/\r/g,` 81`);var t="",r,n,i=0,o;for(r=n=0,i=e.length,o=0;o<i;o++){var s=e.charCodeAt(o),a=null;s<128?n++:s>127&&s<2048?a=String.fromCharCode(s>>6|192,s&63|128):a=String.fromCharCode(s>>12|224,s>>6&63|128,s&63|128),a!==null&&(n>r&&(t+=e.substring(r,n)),t+=a,r=n=o+1)}return n>r&&(t+=e.substring(r,e.length)),t};L.UUID=function(){try{return tt.crypto.randomUUID()}catch{for(var e=new Array(36),t=0;t<36;t++)e[t]=Math.floor(Math.random()*16);return e[14]=4,e[19]=e[19]&=-5,e[19]=e[19]|=8,e[8]=e[13]=e[18]=e[23]="-",L.map(e,function(n){return n.toString(16)}).join("")}};var _6=["ahrefsbot","ahrefssiteaudit","amazonbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandex","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];L.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t<_6.length;t++)if(e.indexOf(_6[t])!==-1)return!0;return!1};L.HTTPBuildQuery=function(e,t){var r,n,i=[];return L.isUndefined(t)&&(t="&"),L.each(e,function(o,s){r=encodeURIComponent(o.toString()),n=encodeURIComponent(s),i[i.length]=n+"="+r}),i.join(t)};L.getQueryParam=function(e,t){t=t.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var r="[\\?&]"+t+"=([^&#]*)",n=new RegExp(r),i=n.exec(e);if(i===null||i&&typeof i[1]!="string"&&i[1].length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch{Jt.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")};L.cookie={get:function(e){for(var t=e+"=",r=nr.cookie.split(";"),n=0;n<r.length;n++){for(var i=r[n];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return decodeURIComponent(i.substring(t.length,i.length))}return null},parse:function(e){var t;try{t=L.JSONDecode(L.cookie.get(e))||{}}catch{}return t},set_seconds:function(e,t,r,n,i,o,s){var a="",l="",d="";if(s)a="; domain="+s;else if(n){var u=b6(nr.location.hostname);a=u?"; domain=."+u:""}if(r){var h=new Date;h.setTime(h.getTime()+r*1e3),l="; expires="+h.toGMTString()}o&&(i=!0,d="; SameSite=None"),i&&(d+="; secure"),nr.cookie=e+"="+encodeURIComponent(t)+l+"; path=/"+a+d},set:function(e,t,r,n,i,o,s){var a="",l="",d="";if(s)a="; domain="+s;else if(n){var u=b6(nr.location.hostname);a=u?"; domain=."+u:""}if(r){var h=new Date;h.setTime(h.getTime()+r*24*60*60*1e3),l="; expires="+h.toGMTString()}o&&(i=!0,d="; SameSite=None"),i&&(d+="; secure");var f=e+"="+encodeURIComponent(t)+l+"; path=/"+a+d;return nr.cookie=f,f},remove:function(e,t,r){L.cookie.set(e,"",-1,t,!1,!1,r)}};var TT=function(e){var t=!0;try{var r="__mplss_"+W_(8),n="xyz";e.setItem(r,n),e.getItem(r)!==n&&(t=!1),e.removeItem(r)}catch{t=!1}return t},d2=null,a1=function(e,t){return d2!==null&&!t?d2:d2=TT(e||tt.localStorage)},h2=null,uB=function(e,t){return h2!==null&&!t?h2:h2=TT(e||tt.sessionStorage)};function AT(e,t,r){var n=function(i){Jt.error(t+" error: "+i)};return{is_supported:function(i){var o=r(e,i);return o||Jt.error(t+" unsupported"),o},error:n,get:function(i){try{return e.getItem(i)}catch(o){n(o)}return null},parse:function(i){try{return L.JSONDecode(e.getItem(i))||{}}catch{}return null},set:function(i,o){try{e.setItem(i,o)}catch(s){n(s)}},remove:function(i){try{e.removeItem(i)}catch(o){n(o)}}}}L.localStorage=AT(tt.localStorage,"localStorage",a1);L.sessionStorage=AT(tt.sessionStorage,"sessionStorage",uB);L.register_event=function(){var e=function(n,i,o,s,a){if(!n){Jt.error("No valid element provided to register_event");return}if(n.addEventListener&&!s)n.addEventListener(i,o,!!a);else{var l="on"+i,d=n[l];n[l]=t(n,o,d)}};function t(n,i,o){var s=function(a){if(a=a||r(tt.event),!!a){var l=!0,d,u;return L.isFunction(o)&&(d=o(a)),u=i.call(n,a),(d===!1||u===!1)&&(l=!1),l}};return s}function r(n){return n&&(n.preventDefault=r.preventDefault,n.stopPropagation=r.stopPropagation),n}return r.preventDefault=function(){this.returnValue=!1},r.stopPropagation=function(){this.cancelBubble=!0},e}();var dB=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');L.dom_query=function(){function e(i){return i.all?i.all:i.getElementsByTagName("*")}var t=/[\t\r\n]/g;function r(i,o){var s=" "+o+" ";return(" "+i.className+" ").replace(t," ").indexOf(s)>=0}function n(i){if(!nr.getElementsByTagName)return[];var o=i.split(" "),s,a,l,d,u,h,f,p,m,g,y=[nr];for(h=0;h<o.length;h++){if(s=o[h].replace(/^\s+/,"").replace(/\s+$/,""),s.indexOf("#")>-1){a=s.split("#"),l=a[0];var b=a[1],E=nr.getElementById(b);if(!E||l&&E.nodeName.toLowerCase()!=l)return[];y=[E];continue}if(s.indexOf(".")>-1){a=s.split("."),l=a[0];var S=a[1];for(l||(l="*"),d=[],u=0,f=0;f<y.length;f++)for(l=="*"?m=e(y[f]):m=y[f].getElementsByTagName(l),p=0;p<m.length;p++)d[u++]=m[p];for(y=[],g=0,f=0;f<d.length;f++)d[f].className&&L.isString(d[f].className)&&r(d[f],S)&&(y[g++]=d[f]);continue}var k=s.match(dB);if(k){l=k[1];var A=k[2],w=k[3],_=k[4];for(l||(l="*"),d=[],u=0,f=0;f<y.length;f++)for(l=="*"?m=e(y[f]):m=y[f].getElementsByTagName(l),p=0;p<m.length;p++)d[u++]=m[p];y=[],g=0;var x;switch(w){case"=":x=function(C){return C.getAttribute(A)==_};break;case"~":x=function(C){return C.getAttribute(A).match(new RegExp("\\b"+_+"\\b"))};break;case"|":x=function(C){return C.getAttribute(A).match(new RegExp("^"+_+"-?"))};break;case"^":x=function(C){return C.getAttribute(A).indexOf(_)===0};break;case"$":x=function(C){return C.getAttribute(A).lastIndexOf(_)==C.getAttribute(A).length-_.length};break;case"*":x=function(C){return C.getAttribute(A).indexOf(_)>-1};break;default:x=function(C){return C.getAttribute(A)}}for(y=[],g=0,f=0;f<d.length;f++)x(d[f])&&(y[g++]=d[f]);continue}for(l=s,d=[],u=0,f=0;f<y.length;f++)for(m=y[f].getElementsByTagName(l),p=0;p<m.length;p++)d[u++]=m[p];y=d}return y}return function(i){return L.isElement(i)?[i]:L.isObject(i)&&!L.isUndefined(i.length)?i:n.call(this,i)}}();var hB=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],fB=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];L.info={campaignParams:function(e){var t="",r={};return L.each(hB,function(n){t=L.getQueryParam(nr.URL,n),t.length?r[n]=t:e!==void 0&&(r[n]=e)}),r},clickParams:function(){var e="",t={};return L.each(fB,function(r){e=L.getQueryParam(nr.URL,r),e.length&&(t[r]=e)}),t},marketingParams:function(){return L.extend(L.info.campaignParams(),L.info.clickParams())},searchEngine:function(e){return e.search("https?://(.*)google.([^/?]*)")===0?"google":e.search("https?://(.*)bing.com")===0?"bing":e.search("https?://(.*)yahoo.com")===0?"yahoo":e.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null},searchInfo:function(e){var t=L.info.searchEngine(e),r=t!="yahoo"?"q":"p",n={};if(t!==null){n.$search_engine=t;var i=L.getQueryParam(e,r);i.length&&(n.mp_keyword=i)}return n},browser:function(e,t,r){return t=t||"",r||L.includes(e," OPR/")?L.includes(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":L.includes(e,"IEMobile")||L.includes(e,"WPDesktop")?"Internet Explorer Mobile":L.includes(e,"SamsungBrowser/")?"Samsung Internet":L.includes(e,"Edge")||L.includes(e,"Edg/")?"Microsoft Edge":L.includes(e,"FBIOS")?"Facebook Mobile":L.includes(e,"Whale/")?"Whale Browser":L.includes(e,"Chrome")?"Chrome":L.includes(e,"CriOS")?"Chrome iOS":L.includes(e,"UCWEB")||L.includes(e,"UCBrowser")?"UC Browser":L.includes(e,"FxiOS")?"Firefox iOS":L.includes(t,"Apple")?L.includes(e,"Mobile")?"Mobile Safari":"Safari":L.includes(e,"Android")?"Android Mobile":L.includes(e,"Konqueror")?"Konqueror":L.includes(e,"Firefox")?"Firefox":L.includes(e,"MSIE")||L.includes(e,"Trident/")?"Internet Explorer":L.includes(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,r){var n=L.info.browser(e,t,r),i={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/,"Whale Browser":/Whale\/(\d+(\.\d+)?)/},o=i[n];if(o===void 0)return null;var s=e.match(o);return s?parseFloat(s[s.length-2]):null},os:function(){var e=Is;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)?"Android":""},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},currentUrl:function(){return tt.location.href},properties:function(e){return typeof e!="object"&&(e={}),L.extend(L.strip_empty_properties({$os:L.info.os(),$browser:L.info.browser(Is,$a.vendor,Tp),$referrer:nr.referrer,$referring_domain:L.info.referringDomain(nr.referrer),$device:L.info.device(Is)}),{$current_url:L.info.currentUrl(),$browser_version:L.info.browserVersion(Is,$a.vendor,Tp),$screen_height:m6.height,$screen_width:m6.width,mp_lib:"web",$lib_version:ko.LIB_VERSION,$insert_id:W_(),time:L.timestamp()/1e3},L.strip_empty_properties(e))},people_properties:function(){return L.extend(L.strip_empty_properties({$os:L.info.os(),$browser:L.info.browser(Is,$a.vendor,Tp)}),{$browser_version:L.info.browserVersion(Is,$a.vendor,Tp)})},mpPageViewProperties:function(){return L.strip_empty_properties({current_page_title:nr.title,current_domain:tt.location.hostname,current_url_path:tt.location.pathname,current_url_protocol:tt.location.protocol,current_url_search:tt.location.search})}};var pB=function(e,t){var r=null,n=[];return function(i){var o=this;return n.push(i),r||(r=new br(function(s){setTimeout(function(){var a=e.apply(o,[n]);r=null,n=[],s(a)},t)})),r}},W_=function(e){var t=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return e?t.substring(0,e):t},mB=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,gB=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,b6=function(e){var t=gB,r=e.split("."),n=r[r.length-1];(n.length>4||n==="com"||n==="org")&&(t=mB);var i=e.match(t);return i?i[0]:""},vB=function(){var e=tt.navigator.onLine;return L.isUndefined(e)||e},qh=function(){},Tu=null,l1=null;typeof JSON<"u"&&(Tu=JSON.stringify,l1=JSON.parse);Tu=Tu||L.JSONEncode;l1=l1||L.JSONDecode;L.info=L.info;L.info.browser=L.info.browser;L.info.browserVersion=L.info.browserVersion;L.info.device=L.info.device;L.info.properties=L.info.properties;L.isBlockedUA=L.isBlockedUA;L.isEmptyObject=L.isEmptyObject;L.isObject=L.isObject;L.JSONDecode=L.JSONDecode;L.JSONEncode=L.JSONEncode;L.toArray=L.toArray;L.NPO=rl;var yB=function(e){var t=Date.now();return!e||t>e.maxExpires||t>e.idleExpires},c1="change",ec="click",x6="hashchange",Dc="mp_locationchange",w6="popstate",E6="scrollend",R5="submit",_B=["clientX","clientY","offsetX","offsetY","pageX","pageY","screenX","screenY","x","y"],S6=["mp-include"],I5=["mp-no-track"],C6=I5.concat(["mp-sensitive"]),bB=["aria-label","aria-labelledby","aria-describedby","href","name","role","title","type"],ii=jf("autocapture");function P5(e){for(var t={},r=kT(e).split(" "),n=0;n<r.length;n++){var i=r[n];i&&(t[i]=!0)}return t}function kT(e){switch(typeof e.className){case"string":return e.className;case"object":return e.className.baseVal||e.getAttribute("class")||"";default:return""}}function xB(e){if(e.previousElementSibling)return e.previousElementSibling;do e=e.previousSibling;while(e&&!RT(e));return e}function T6(e,t,r,n,i,o){var s={$classes:kT(e).split(" "),$tag_name:e.tagName.toLowerCase()},a=e.id;a&&(s.$id=a),q_(e,t,i,o)&&L.each(bB.concat(n),function(h){if(e.hasAttribute(h)&&!r[h]){var f=e.getAttribute(h);u1(f)&&(s["$attr-"+h]=f)}});for(var l=1,d=1,u=e;u=xB(u);)l++,u.tagName===e.tagName&&d++;return s.$nth_child=l,s.$nth_of_type=d,s}function wB(e,t){var r=t.allowElementCallback,n=t.allowSelectors||[],i=t.blockAttrs||[],o=t.blockElementCallback,s=t.blockSelectors||[],a=t.captureTextContent||!1,l=t.captureExtraAttrs||[],d=t.capturedForHeatMap||!1,u={};L.each(i,function(A){u[A]=!0});var h=null,f=typeof e.target>"u"?e.srcElement:e.target;if(IT(f)&&(f=f.parentNode),CB(f,e)&&O5(f,e,r,n)&&!f2(f,e,o,s)){for(var p=[f],m=f;m.parentNode&&!rs(m,"body");)p.push(m.parentNode),m=m.parentNode;var g=[],y,b=!1;if(L.each(p,function(A){var w=q_(A,e,r,n);!u.href&&A.tagName.toLowerCase()==="a"&&(y=A.getAttribute("href"),y=w&&u1(y)&&y),f2(A,e,o,s)&&(b=!0),g.push(T6(A,e,u,l,r,n))},this),!b){var E=nr.documentElement;if(h={$event_type:e.type,$host:tt.location.host,$pathname:tt.location.pathname,$elements:g,$el_attr__href:y,$viewportHeight:Math.max(E.clientHeight,tt.innerHeight||0),$viewportWidth:Math.max(E.clientWidth,tt.innerWidth||0),$pageHeight:nr.body.offsetHeight||0,$pageWidth:nr.body.offsetWidth||0},L.each(l,function(A){if(!u[A]&&f.hasAttribute(A)){var w=f.getAttribute(A);u1(w)&&(h["$el_attr__"+A]=w)}}),a&&(S=A6(f,e,r,n),S&&S.length&&(h.$el_text=S)),e.type===ec&&(L.each(_B,function(A){A in e&&(h["$"+A]=e[A])}),d&&(h.$captured_for_heatmap=!0),f=EB(e)),a){var S=A6(f,e,r,n);S&&S.length&&(h.$el_text=S)}if(f){if(!O5(f,e,r,n)||f2(f,e,o,s))return null;var k=T6(f,e,u,l,r,n);h.$target=k,h.$el_classes=k.$classes,L.extend(h,L.strip_empty_properties({$el_id:k.$id,$el_tag_name:k.$tag_name}))}}}return h}function A6(e,t,r,n){var i="";return q_(e,t,r,n)&&e.childNodes&&e.childNodes.length&&L.each(e.childNodes,function(o){IT(o)&&o.textContent&&(i+=L.trim(o.textContent).split(/(\s+)/).filter(u1).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),L.trim(i)}function EB(e){for(var t=e.target,r=e.composedPath(),n=0;n<r.length;n++){var i=r[n];if(rs(i,"a")||rs(i,"button")||rs(i,"input")||rs(i,"select")||i.getAttribute&&i.getAttribute("role")==="button"){t=i;break}if(i===t)break}return t}function O5(e,t,r,n){if(r)try{if(!r(e,t))return!1}catch(s){return ii.critical("Error while checking element in allowElementCallback",s),!1}if(!n.length)return!0;for(var i=0;i<n.length;i++){var o=n[i];try{if(e.matches(o))return!0}catch(s){ii.critical("Error while checking selector: "+o,s)}}return!1}function f2(e,t,r,n){var i;if(r)try{if(r(e,t))return!0}catch(a){return ii.critical("Error while checking element in blockElementCallback",a),!0}if(n&&n.length)for(i=0;i<n.length;i++){var o=n[i];try{if(e.matches(o))return!0}catch(a){ii.critical("Error while checking selector: "+o,a)}}var s=P5(e);for(i=0;i<I5.length;i++)if(s[I5[i]])return!0;return!1}function RT(e){return e&&e.nodeType===1}function rs(e,t){return e&&e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function IT(e){return e&&e.nodeType===3}function SB(){try{var e=nr.createElement("div");return!!e.matches}catch{return!1}}function CB(e,t){if(!e||rs(e,"html")||!RT(e))return!1;var r=e.tagName.toLowerCase();switch(r){case"form":return t.type===R5;case"input":return["button","submit"].indexOf(e.getAttribute("type"))===-1?t.type===c1:t.type===ec;case"select":case"textarea":return t.type===c1;default:return t.type===ec}}function q_(e,t,r,n){var i;if(!O5(e,t,r,n))return!1;for(var o=e;o.parentNode&&!rs(o,"body");o=o.parentNode){var s=P5(o);for(i=0;i<C6.length;i++)if(s[C6[i]])return!1}var a=P5(e);for(i=0;i<S6.length;
81i++)if(a[S6[i]])return!0;if(rs(e,"input")||rs(e,"select")||rs(e,"textarea")||e.getAttribute("contenteditable")==="true")return!1;var l=e.type||"";if(typeof l=="string")switch(l.toLowerCase()){case"hidden":return!1;case"password":return!1}var d=e.name||e.id||"";if(typeof d=="string"){var u=/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i;if(u.test(d.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function u1(e){if(e===null||L.isUndefined(e))return!1;if(typeof e=="string"){e=L.trim(e);var t=/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/;if(t.test((e||"").replace(/[- ]/g,"")))return!1;var r=/(^\d{3}-?\d{2}-?\d{4}$)/;if(r.test(e))return!1}return!0}var TB=30,AB=1e3,kB=4;function PT(){this.clicks=[]}PT.prototype.isRageClick=function(e,t,r){r=r||{};var n=r.threshold_px||TB,i=r.timeout_ms||AB,o=r.click_count||kB,s=Date.now(),a=this.clicks[this.clicks.length-1];if(a&&s-a.timestamp<i&&Math.sqrt(Math.pow(e-a.x,2)+Math.pow(t-a.y,2))<n){if(this.clicks.push({x:e,y:t,timestamp:s}),this.clicks.length>=o)return this.clicks=[],!0}else this.clicks=[{x:e,y:t,timestamp:s}];return!1};var OT="autocapture",RB="track_pageview",jT="full-url",IB="url-with-path-and-query-string",PB="url-with-path",OB="allow_element_callback",LT="allow_selectors",$T="allow_url_regexes",DT="block_attrs",MT="block_element_callback",NT="block_selectors",FT="block_url_regexes",UT="capture_extra_attrs",BT="capture_text_content",VT="scroll_capture_all",HT="scroll_depth_percent_checkpoints",d1="click",j5="input",zT="pageview",WT="rage_click",L5="scroll",$5="submit",xn={};xn[LT]=[];xn[$T]=[];xn[DT]=[];xn[MT]=null;xn[NT]=[];xn[FT]=[];xn[UT]=[];xn[BT]=!1;xn[VT]=!1;xn[HT]=[25,50,75,100];xn[d1]=!0;xn[j5]=!0;xn[zT]=jT;xn[WT]=!0;xn[L5]=!0;xn[$5]=!0;var h1={$mp_autocapture:!0},qT="$mp_click",jB="$mp_input_change",GT="$mp_rage_click",LB="$mp_scroll",$B="$mp_submit",ai=function(e){this.mp=e};ai.prototype.init=function(){if(!SB()){ii.critical("Autocapture unavailable: missing required DOM APIs");return}this.initPageviewTracking(),this.initClickTracking(),this.initInputTracking(),this.initScrollTracking(),this.initSubmitTracking(),this.initRageClickTracking()};ai.prototype.getFullConfig=function(){var e=this.mp.get_config(OT);return e?L.isObject(e)?L.extend({},xn,e):xn:{}};ai.prototype.getConfig=function(e){return this.getFullConfig()[e]};ai.prototype.currentUrlBlocked=function(){var e,t=L.info.currentUrl(),r=this.getConfig($T)||[];if(r.length){var n=!1;for(e=0;e<r.length;e++){var i=r[e];try{if(t.match(i)){n=!0;break}}catch(s){return ii.critical("Error while checking block URL regex: "+i,s),!0}}if(!n)return!0}var o=this.getConfig(FT)||[];if(!o||!o.length)return!1;for(e=0;e<o.length;e++)try{if(t.match(o[e]))return!0}catch(s){return ii.critical("Error while checking block URL regex: "+o[e],s),!0}return!1};ai.prototype.pageviewTrackingConfig=function(){return this.mp.get_config(OT)?this.getConfig(zT):this.mp.get_config(RB)};ai.prototype.trackDomEvent=function(e,t){if(!this.currentUrlBlocked()){var r=this.mp.is_recording_heatmap_data()&&(t===qT&&!this.getConfig(d1)||t===GT&&!this._getRageClickConfig()),n=wB(e,{allowElementCallback:this.getConfig(OB),allowSelectors:this.getConfig(LT),blockAttrs:this.getConfig(DT),blockElementCallback:this.getConfig(MT),blockSelectors:this.getConfig(NT),captureExtraAttrs:this.getConfig(UT),captureTextContent:this.getConfig(BT),capturedForHeatMap:r});n&&(L.extend(n,h1),this.mp.track(t,n))}};ai.prototype._getRageClickConfig=function(){var e=this.getConfig(WT);return e?e===!0?{}:typeof e=="object"?e:{}:null};ai.prototype.initClickTracking=function(){tt.removeEventListener(ec,this.listenerClick),!(!this.getConfig(d1)&&!this.mp.get_config("record_heatmap_data"))&&(ii.log("Initializing click tracking"),this.listenerClick=tt.addEventListener(ec,(function(e){!this.getConfig(d1)&&!this.mp.is_recording_heatmap_data()||this.trackDomEvent(e,qT)}).bind(this)))};ai.prototype.initInputTracking=function(){tt.removeEventListener(c1,this.listenerChange),this.getConfig(j5)&&(ii.log("Initializing input tracking"),this.listenerChange=tt.addEventListener(c1,(function(e){this.getConfig(j5)&&this.trackDomEvent(e,jB)}).bind(this)))};ai.prototype.initPageviewTracking=function(){if(tt.removeEventListener(w6,this.listenerPopstate),tt.removeEventListener(x6,this.listenerHashchange),tt.removeEventListener(
81Dc,this.listenerLocationchange),!!this.pageviewTrackingConfig()){ii.log("Initializing pageview tracking");var e="",t=!1;this.currentUrlBlocked()||(t=this.mp.track_pageview(h1)),t&&(e=L.info.currentUrl()),this.listenerPopstate=tt.addEventListener(w6,function(){tt.dispatchEvent(new Event(Dc))}),this.listenerHashchange=tt.addEventListener(x6,function(){tt.dispatchEvent(new Event(Dc))});var r=tt.history.pushState;typeof r=="function"&&(tt.history.pushState=function(i,o,s){r.call(tt.history,i,o,s),tt.dispatchEvent(new Event(Dc))});var n=tt.history.replaceState;typeof n=="function"&&(tt.history.replaceState=function(i,o,s){n.call(tt.history,i,o,s),tt.dispatchEvent(new Event(Dc))}),this.listenerLocationchange=tt.addEventListener(Dc,z_((function(){if(!this.currentUrlBlocked()){var i=L.info.currentUrl(),o=!1,s=i.split("#")[0].split("?")[0]!==e.split("#")[0].split("?")[0],a=this.pageviewTrackingConfig();if(a===jT?o=i!==e:a===IB?o=i.split("#")[0]!==e.split("#")[0]:a===PB&&(o=s),o){var l=this.mp.track_pageview(h1);l&&(e=i),s&&(this.lastScrollCheckpoint=0,ii.log("Path change: re-initializing scroll depth checkpoints"))}}}).bind(this)))}};ai.prototype.initRageClickTracking=function(){tt.removeEventListener(ec,this.listenerRageClick);var e=this._getRageClickConfig();!e&&!this.mp.get_config("record_heatmap_data")||(ii.log("Initializing rage click tracking"),this._rageClickTracker||(this._rageClickTracker=new PT),this.listenerRageClick=(function(t){var r=this._getRageClickConfig();!r&&!this.mp.is_recording_heatmap_data()||this.currentUrlBlocked()||this._rageClickTracker.isRageClick(t.pageX,t.pageY,r)&&this.trackDomEvent(t,GT)}).bind(this),tt.addEventListener(ec,this.listenerRageClick))};ai.prototype.initScrollTracking=function(){tt.removeEventListener(E6,this.listenerScroll),this.getConfig(L5)&&(ii.log("Initializing scroll tracking"),this.lastScrollCheckpoint=0,this.listenerScroll=tt.addEventListener(E6,z_((function(){if(this.getConfig(L5)&&!this.currentUrlBlocked()){var e=this.getConfig(VT),t=(this.getConfig(HT)||[]).slice().sort(function(l,d){return l-d}),r=tt.scrollY,n=L.extend({$scroll_top:r},h1);try{var i=nr.body.scrollHeight,o=Math.round(r/(i-tt.innerHeight)*100);if(n.$scroll_height=i,n.$scroll_percentage=o,o>this.lastScrollCheckpoint)for(var s=0;s<t.length;s++){var a=t[s];o>=a&&this.lastScrollCheckpoint<a&&(n.$scroll_checkpoint=a,this.lastScrollCheckpoint=a,e=!0)}}catch(l){ii.critical("Error while calculating scroll percentage",l)}e&&this.mp.track(LB,n)}}).bind(this))))};ai.prototype.initSubmitTracking=function(){tt.removeEventListener(R5,this.listenerSubmit),this.getConfig($5)&&(ii.log("Initializing submit tracking"),this.listenerSubmit=tt.addEventListener(R5,(function(e){this.getConfig($5)&&this.trackDomEvent(e,$B)}).bind(this)))};CT(ai);var DB=tt.fetch,ri=jf("flags"),f1="flags",p1="context",D5={};D5[p1]={};var qt=function(e){this.getFullApiRoute=e.getFullApiRoute,this.getMpConfig=e.getConfigFunc,this.setMpConfig=e.setConfigFunc,this.getMpProperty=e.getPropertyFunc,this.track=e.trackingFunc};qt.prototype.init=function(){if(!MB()){ri.critical("Feature Flags unavailable: missing minimum required APIs");return}this.flags=null,this.fetchFlags(),this.trackedFeatures=new Set};qt.prototype.getFullConfig=function(){var e=this.getMpConfig(f1);return e?L.isObject(e)?L.extend({},D5,e):D5:{}};qt.prototype.getConfig=function(e){return this.getFullConfig()[e]};qt.prototype.isSystemEnabled=function(){return!!this.getMpConfig(f1)};qt.prototype.updateContext=function(e,t){if(!this.isSystemEnabled())return ri.critical("Feature Flags not enabled, cannot update context"),Promise.resolve();var r=this.getMpConfig(f1);L.isObject(r)||(r={});var n=t&&t.replace?{}:this.getConfig(p1);return r[p1]=L.extend({},n,e),this.setMpConfig(f1,r),this.fetchFlags()};qt.prototype.areFlagsReady=function(){return this.isSystemEnabled()||ri.error("Feature Flags not enabled"),!!this.flags};qt.prototype.fetchFlags=function(){if(!this.isSystemEnabled())return Promise.resolve();var e=this.getMpProperty("distinct_id"),t=this.getMpProperty("$device_id");ri.log("Fetching flags for distinct ID: "+e);var r=L.extend({distinct_id:e,device_id:t},this.getConfig(p1)),n=new URLSearchParams;n.set("context",JSON.stringify(r)),n.set("token",this.getMpConfig("token")),n.set("mp_lib","web"),n.set("$lib_version",ko.LIB_VERSION);var i=this.getFullApiRoute()+"?"+n.toString();return this._fetchInProgressStartTime=Date.now(),this.fetchPromise=tt.fetch(i,{method:"GET",headers:{Authorization:"Basic "+btoa(this.getMpConfig("token")+":")}}).then((function(o){return this.markFetchComplete(),o.json().then((function(s){var a=s.flags;if(!a)throw new Error("No flags in API response");var l=new Map;L.each(a,function(d,u){l.set(u,{key:d.variant_key,value:d.variant_value})}),this.flags=l}).bind(this)).catch((function(s){this.markFetchComplete(),ri.error(s)}).bind(this))}).bind(this)).catch((function(o){this.markFetchComplete(),ri.error(o)}).bind(this)),this.fetchPromise};qt.prototype.markFetchComplete=function(){if(!this._fetchInProgressStartTime){ri.error("Fetch in progress started time not set, cannot mark fetch complete");return}this._fetchStartTime=this._fetchInProgressStartTime,this._fetchCompleteTime=Date.now(),this._fetchLatency=this._fetchCompleteTime-this._fetchStartTime,this._fetchInProgressStartTime=null};qt.prototype.getVariant=function(e,t){return this.fetchPromise?this.fetchPromise.then((function(){return this.getVariantSync(e,t)}).bind(this)).catch(function(r){return ri.error(r),t}):new Promise(function(r){ri.critical("Feature Flags not initialized"),r(t)})};qt.prototype.getVariantSync=function(e,t){if(!this.areFlagsReady())return ri.log("Flags not loaded yet"),t;var r=this.flags.get(e);return r?(this.trackFeatureCheck(e,r),r):(ri.log('No flag found: "'+e+'"'),t)};qt.prototype.getVariantValue=function(e,t){return this.getVariant(e,{value:t}).then(function(r){return r.value}).catch(function(r){return ri.error(r),t})};qt.prototype.getFeatureData=function(e,t){return ri.critical("mixpanel.flags.get_feature_data() is deprecated and will be removed in a future release. Use mixpanel.flags.get_variant_value(
81) instead."),this.getVariantValue(e,t)};qt.prototype.getVariantValueSync=function(e,t){return this.getVariantSync(e,{value:t}).value};qt.prototype.isEnabled=function(e,t){return this.getVariantValue(e).then((function(){return this.isEnabledSync(e,t)}).bind(this)).catch(function(r){return ri.error(r),t})};qt.prototype.isEnabledSync=function(e,t){t=t||!1;var r=this.getVariantValueSync(e,t);return r!==!0&&r!==!1&&(ri.error('Feature flag "'+e+'" value: '+r+" is not a boolean; returning fallback value: "+t),r=t),r};qt.prototype.trackFeatureCheck=function(e,t){this.trackedFeatures.has(e)||(this.trackedFeatures.add(e),this.track("$experiment_started",{"Experiment name":e,"Variant name":t.key,$experiment_type:"feature_flag","Variant fetch start time":new Date(this._fetchStartTime).toISOString(),"Variant fetch complete time":new Date(this._fetchCompleteTime).toISOString(),"Variant fetch latency (ms)":this._fetchLatency}))};function MB(){return!!DB&&typeof Promise<"u"&&typeof Map<"u"&&typeof Set<"u"}CT(qt);qt.prototype.are_flags_ready=qt.prototype.areFlagsReady;qt.prototype.get_variant=qt.prototype.getVariant;qt.prototype.get_variant_sync=qt.prototype.getVariantSync;qt.prototype.get_variant_value=qt.prototype.getVariantValue;qt.prototype.get_variant_value_sync=qt.prototype.getVariantValueSync;qt.prototype.is_enabled=qt.prototype.isEnabled;qt.prototype.is_enabled_sync=qt.prototype.isEnabledSync;qt.prototype.update_context=qt.prototype.updateContext;qt.prototype.get_feature_data=qt.prototype.getFeatureData;var ia=function(){};ia.prototype.create_properties=function(){};ia.prototype.event_handler=function(){};ia.prototype.after_track_handler=function(){};ia.prototype.init=function(e){return this.mp=e,this};ia.prototype.track=function(e,t,r,n){var i=this,o=L.dom_query(e);if(o.length===0){Jt.error("The DOM query ("+e+") returned 0 elements");return}return L.each(o,function(s){L.register_event(s,this.override_event,function(a){var l={},d=i.create_properties(r,this),u=i.mp.get_config("track_links_timeout");i.event_handler(a,this,l),window.setTimeout(i.track_callback(n,d,l,!0),u),i.mp.track(t,d,i.track_callback(n,d,l))})},this),!0};ia.prototype.track_callback=function(e,t,r,n){n=n||!1;var i=this;return function(){r.callback_fired||(r.callback_fired=!0,!(e&&e(n,t)===!1)&&i.after_track_handler(t,r,n))}};ia.prototype.create_properties=function(e,t){var r;return typeof e=="function"?r=e(t):r=L.extend({},e),r};var Au=function(){this.override_event="click"};L.inherit(Au,ia);Au.prototype.create_properties=function(e,t){var r=Au.superclass.create_properties.apply(this,arguments);return t.href&&(r.url=t.href),r};Au.prototype.event_handler=function(e,t,r){r.new_tab=e.which===2||e.metaKey||e.ctrlKey||t.target==="_blank",r.href=t.href,r.new_tab||e.preventDefault()};Au.prototype.after_track_handler=function(e,t){t.new_tab||setTimeout(function(){window.location=t.href},0)};var Hm=function(){this.override_event="submit"};L.inherit(Hm,ia);Hm.prototype.event_handler=function(e,t,r){r.element=t,e.preventDefault()};Hm.prototype.after_track_handler=function(e,t){setTimeout(function(){t.element.submit()},0)};var NB=jf("lock"),KT=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||tt.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3,this.promiseImpl=t.promiseImpl||br};KT.prototype.withLock=function(e,t){var r=this.promiseImpl;return new r(L.bind(function(n,i){var o=t||new Date().getTime()+"|"+Math.random(),s=new Date().getTime(),a=this.storageKey,l=this.pollIntervalMS,d=this.timeoutMS,u=this.storage,h=a+":X",f=a+":Y",p=a+":Z",m=function(S){if(new Date().getTime()-s>d){NB.error("Timeout waiting for mutex on "+a+"; clearing lock. ["+o+"]"),u.removeItem(p),u.removeItem(f),b();return}setTimeout(function(){try{S()}catch(k){i(k)}},l*(Math.random()+.1))},g=function(S,k){S()?k():m(function(){g(S,k)})},y=function(){var S=u.getItem(f);return S&&S!==o?!1:(u.setItem(f,o),u.getItem(f)===o?!0:(a1(u,!0)||i(new Error("localStorage support dropped while acquiring lock")),!1))},b=function(){u.setItem(h,o),g(y,function(){if(u.getItem(h)===o){E();return}m(function(){if(u.getItem(f)!==o){b();return}g(function(){return!u.getItem(p)},E)})})},E=function(){u.setItem(p,"1");var S=function(){u.removeItem(p),u.getItem(f)===o&&u.removeItem(f),u.getItem(h)===o&&u.removeItem(h)};e().then(function(k){S(),n(k)}).catch(function(k){S(),i(k)})};try{if(a1(u,!0))b();else throw new Error("localStorage support check failed")}catch(S){i(S)}},this))};var Xu=function(e){this.storage=e||tt.localStorage};Xu.prototype.init=function(){return br.resolve()};Xu.prototype.isInitialized=function(){return!0};Xu.prototype.setItem=function(e,t){return new br(L.bind(function(r,n){try{this.storage.setItem(e,Tu(t))}catch(i){n(i)}r()},this))};Xu.prototype.getItem=function(e){return new br(L.bind(function(t,r){var n;try{n=l1(this.storage.getItem(e))}catch(i){r(i)}t(n)},this))};Xu.prototype.removeItem=function(e){return new br(L.bind(function(t,r){try{this.storage.removeItem(e)}catch(n){r(n)}t()},this))};var k6=jf("batch"),bs=function(e,t){t=t||{},this.storageKey=e,this.usePersistence=t.usePersistence,this.usePersistence&&(this.queueStorage=t.queueStorage||new Xu,this.lock=new KT(e,{storage:t.sharedLockStorage||tt.localStorage,timeoutMS:t.sharedLockTimeoutMS})),this.reportError=t.errorReporter||L.bind(k6.error,k6),this.pid=t.pid||null,this.memQueue=[],this.initialized=!1,t.enqueueThrottleMs?this.enqueuePersisted=pB(L.bind(this._enqueuePersisted,this),t.enqueueThrottleMs):this.enqueuePersisted=L.bind(function(r){return this._enqueuePersisted([r])},this)};bs.prototype.ensureInit=function(){return this.initialized||!this.usePersistence?br.resolve():this.queueStorage.init(
vendor: 8,477 bytes, line 81
81).then(L.bind(function(){this.initialized=!0},this)).catch(L.bind(function(e){this.reportError("Error initializing queue persistence. Disabling persistence",e),this.initialized=!0,this.usePersistence=!1},this))};bs.prototype.enqueue=function(e,t){var r={id:W_(),flushAfter:new Date().getTime()+t*2,payload:e};return this.usePersistence?this.enqueuePersisted(r):(this.memQueue.push(r),br.resolve(!0))};bs.prototype._enqueuePersisted=function(e){var t=L.bind(function(){return this.ensureInit().then(L.bind(function(){return this.readFromStorage()},this)).then(L.bind(function(r){return this.saveToStorage(r.concat(e))},this)).then(L.bind(function(r){return r&&(this.memQueue=this.memQueue.concat(e)),r},this)).catch(L.bind(function(r){return this.reportError("Error enqueueing items",r,e),!1},this))},this);return this.lock.withLock(t,this.pid).catch(L.bind(function(r){return this.reportError("Error acquiring storage lock",r),!1},this))};bs.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);return this.usePersistence&&t.length<e?this.ensureInit().then(L.bind(function(){return this.readFromStorage()},this)).then(L.bind(function(r){if(r.length){var n={};L.each(t,function(s){n[s.id]=!0});for(var i=0;i<r.length;i++){var o=r[i];if(new Date().getTime()>o.flushAfter&&!n[o.id]&&(o.orphaned=!0,t.push(o),t.length>=e))break}}return t},this)):br.resolve(t)};var R6=function(e,t){var r=[];return L.each(e,function(n){n.id&&!t[n.id]&&r.push(n)}),r};bs.prototype.removeItemsByID=function(e){var t={};if(L.each(e,function(n){t[n]=!0}),this.memQueue=R6(this.memQueue,t),this.usePersistence){var r=L.bind(function(){return this.ensureInit().then(L.bind(function(){return this.readFromStorage()},this)).then(L.bind(function(n){return n=R6(n,t),this.saveToStorage(n)},this)).then(L.bind(function(){return this.readFromStorage()},this)).then(L.bind(function(n){for(var i=0;i<n.length;i++){var o=n[i];if(o.id&&t[o.id])throw new Error("Item not removed from storage")}return!0},this)).catch(L.bind(function(n){return this.reportError("Error removing items",n,e),!1},this))},this);return this.lock.withLock(r,this.pid).catch(L.bind(function(n){return this.reportError("Error acquiring storage lock",n),a1(this.lock.storage,!0)?!1:r().then(L.bind(function(i){return i||this.queueStorage.removeItem(this.storageKey).then(function(){return i})},this)).catch(L.bind(function(i){return this.reportError("Error clearing queue",i),!1},this))},this))}else return br.resolve(!0)};var I6=function(e,t){var r=[];return L.each(e,function(n){var i=n.id;if(i in t){var o=t[i];o!==null&&(n.payload=o,r.push(n))}else r.push(n)}),r};bs.prototype.updatePayloads=function(e){return this.memQueue=I6(this.memQueue,e),this.usePersistence?this.lock.withLock(L.bind(function(){return this.ensureInit().then(L.bind(function(){return this.readFromStorage()},this)).then(L.bind(function(r){return r=I6(r,e),this.saveToStorage(r)},this)).catch(L.bind(function(r){return this.reportError("Error updating items",e,r),!1},this))},this),this.pid).catch(L.bind(function(t){return this.reportError("Error acquiring storage lock",t),!1},this)):br.resolve(!0)};bs.prototype.readFromStorage=function(){return this.ensureInit().then(L.bind(function(){return this.queueStorage.getItem(this.storageKey)},this)).then(L.bind(function(e){return e&&(L.isArray(e)||(this.reportError("Invalid storage entry:",e),e=null)),e||[]},this)).catch(L.bind(function(e){return this.reportError("Error retrieving queue",e),[]},this))};bs.prototype.saveToStorage=function(e){return this.ensureInit().then(L.bind(function(){return this.queueStorage.setItem(this.storageKey,e)},this)).then(function(){return!0}).catch(L.bind(function(t){return this.reportError("Error saving queue",t),!1},this))};bs.prototype.clear=function(){return this.memQueue=[],this.usePersistence?this.ensureInit().then(L.bind(function(){return this.queueStorage.removeItem(this.storageKey)},this)):br.resolve()};var FB=10*60*1e3,hh=jf("batch"),Do=function(e,t){this.errorReporter=t.errorReporter,this.queue=new bs(e,{errorReporter:L.bind(this.reportError,this),queueStorage:t.queueStorage,sharedLockStorage:t.sharedLockStorage,sharedLockTimeoutMS:t.sharedLockTimeoutMS,usePersistence:t.usePersistence,enqueueThrottleMs:t.enqueueThrottleMs}),this.libConfig=t.libConfig,this.sendRequest=t.sendRequestFunc,this.beforeSendHook=t.beforeSendHook,this.stopAllBatching=t.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=t.flushOnlyOnInterval||!1,this._flushPromise=null};Do.prototype.enqueue=function(e){return this.queue.enqueue(e,this.flushInterval)};Do.prototype.start=function(){return this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()};Do.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)};Do.prototype.clear=function(){return this.queue.clear()};Do.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size};Do.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)};Do.prototype.scheduleFlush=function(e){this.flushInterval=e,this.stopped||(this.timeoutID=setTimeout(L.bind(function(){this.stopped||(this._flushPromise=this.flush())},this),this.flushInterval))};Do.prototype.sendRequestPromise=function(e,t){return new br(L.bind(function(r){this.sendRequest(e,t,r)},this))};Do.prototype.flush=function(e){if(this.requestInProgress)return hh.log("Flush: Request already in progress"),br.resolve();this.requestInProgress=!0,e=e||{};var t=this.libConfig.batch_request_timeout_ms,r=new Date().getTime(),n=this.batchSize;return this.queue.fillBatch(n).then(L.bind(function(i){var o=i.length===n,s=[],a={};if(L.each(i,function(h){var f=h.payload;if(this.beforeSendHook&&!h.orphaned&&(f=this.beforeSendHook(f)),f){f.event&&f.properties&&(f.properties=L.extend({},f.properties,{mp_sent_by_lib_version:ko.LIB_VERSION}));var p=!0,m=h.id;m?(this.itemIdsSentSuccessfully[m]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:h,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[m]}),p=!1):this.reportError("[dupe] found item with no ID",{item:h}),p&&s.push(f)}a[h.id]=f},this),s.length<1)return this.requestInProgress=!1,this.resetFlush(),br.resolve();var l=L.bind(function(){return this.queue.removeItemsByID(L.map(i,function(h){return h.id})).then(L.bind(function(h){return L.each(i,L.bind(function(f){var p=f.id;p?(this.itemIdsSentSuccessfully[p]=this.itemIdsSentSuccessfully[p]||0,this.itemIdsSentSuccessfully[p]++,this.itemIdsSentSuccessfully[p]>5&&this.reportError("[dupe] item ID sent too many times",{item:f,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[p]})):this.reportError("[dupe] found item with no ID while removing",{item:f})},this)),h?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!o?(this.resetFlush(),br.resolve()):this.flush()):(++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush(),br.resolve())},this))},this),d=L.bind(function(h){this.requestInProgress=!1;try{if(e.unloading)return this.queue.updatePayloads(a);if(L.isObject(h)&&h.error==="timeout"&&new Date().getTime()-r>=t)return this.reportError("Network timeout; retrying"),this.flush();if(L.isObject(h)&&(h.httpStatusCode>=500||h.httpStatusCode===429||h.httpStatusCode<=0&&!vB()||h.error==="timeout")){var f=this.flushInterval*2;return h.retryAfter&&(f=parseInt(h.retryAfter,10)*1e3||f),f=Math.min(FB,f),this.reportError("Error; retry in "+f+" ms"),this.scheduleFlush(f),br.resolve()}else if(L.isObject(h)&&h.httpStatusCode===413)if(i.length>1){var p=Math.max(1,Math.floor(n/2));return this.batchSize=Math.min(this.batchSize,p,i.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush(),br.resolve()}else return this.reportError("Single-event request too large; dropping",i),this.resetBatchSize(),l();else return l()}catch(m){this.reportError("Error handling API response",m),this.resetFlush()}},this),u={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};return e.unloading&&(u.transport="sendBeacon"),hh.log("MIXPANEL REQUEST:",s),this.sendRequestPromise(s,u).then(d)},this)).catch(L.bind(function(i){this.reportError("Error flushing request queue",i
vendor: 8,471 bytes, line 81
81),this.resetFlush()},this))};Do.prototype.reportError=function(e,t){if(hh.error.apply(hh.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(r){hh.error(r)}};var UB="__mp_opt_in_out_";function BB(e,t){XT(!0,e,t)}function VB(e,t){XT(!1,e,t)}function HB(e,t){return ZT(e,t)==="1"}function YT(e,t){if(WB(t))return Jt.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var r=ZT(e,t)==="0";return r&&Jt.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),r}function mc(e){return Y_(e,function(t){return this.get_config(t)})}function nl(e){return Y_(e,function(t){return this._get_config(t)})}function Ju(e){return Y_(e,function(t){return this._get_config(t)})}function zB(e,t){t=t||{},G_(t).remove(K_(e,t),!!t.crossSubdomainCookie,t.cookieDomain)}function G_(e){return e=e||{},e.persistenceType==="localStorage"?L.localStorage:L.cookie}function K_(e,t){return t=t||{},(t.persistencePrefix||UB)+e}function ZT(e,t){return G_(t).get(K_(e,t))}function WB(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||tt,r=t.navigator||{},n=!1;return L.each([r.doNotTrack,r.msDoNotTrack,t.doNotTrack],function(i){L.includes([!0,1,"1","yes"],i)&&(n=!0)}),n}function XT(e,t,r){if(!L.isString(t)||!t.length){Jt.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token");return}r=r||{},G_(r).set(K_(t,r),e?1:0,L.isNumber(r.cookieExpiration)?r.cookieExpiration:null,!!r.crossSubdomainCookie,!!r.secureCookie,!!r.crossSiteCookie,r.cookieDomain),r.track&&e&&r.track(r.trackEventName||"$opt_in",r.trackProperties,{send_immediately:!0})}function Y_(e,t){return function(){var r=!1;try{var n=t.call(this,"token"),i=t.call(this,"ignore_dnt"),o=t.call(this,"opt_out_tracking_persistence_type"),s=t.call(this,"opt_out_tracking_cookie_prefix"),a=t.call(this,"window");n&&(r=YT(n,{ignoreDnt:i,persistenceType:o,persistencePrefix:s,window:a}))}catch(d){Jt.error("Unexpected error when checking tracking opt-out status: "+d)}if(!r)return e.apply(this,arguments);var l=arguments[arguments.length-1];typeof l=="function"&&l(0)}}var Ha="$set",ku="$set_once",Eo="$unset",tc="$add",ls="$append",rc="$union",Bs="$remove",qB="$delete",JT={set_action:function(e,t){var r={},n={};return L.isObject(e)?L.each(e,function(i,o){this._is_reserved_property(o)||(n[o]=i)},this):n[e]=t,r[Ha]=n,r},unset_action:function(e){var t={},r=[];return L.isArray(e)||(e=[e]),L.each(e,function(n){this._is_reserved_property(n)||r.push(n)},this),t[Eo]=r,t},set_once_action:function(e,t){var r={},n={};return L.isObject(e)?L.each(e,function(i,o){this._is_reserved_property(o)||(n[o]=i)},this):n[e]=t,r[ku]=n,r},union_action:function(e,t){var r={},n={};return L.isObject(e)?L.each(e,function(i,o){this._is_reserved_property(o)||(n[o]=L.isArray(i)?i:[i])},this):n[e]=L.isArray(t)?t:[t],r[rc]=n,r},append_action:function(e,t){var r={},n={};return L.isObject(e)?L.each(e,function(i,o){this._is_reserved_property(o)||(n[o]=i)},this):n[e]=t,r[ls]=n,r},remove_action:function(e,t){var r={},n={};return L.isObject(e)?L.each(e,function(i,o){this._is_reserved_property(o)||(n[o]=i)},this):n[e]=t,r[Bs]=n,r},delete_action:function(){var e={};return e[qB]="",e}},Tr=function(){};L.extend(Tr.prototype,JT);Tr.prototype._init=function(e,t,r){this._mixpanel=e,this._group_key=t,this._group_id=r};Tr.prototype.set=Ju(function(e,t,r){var n=this.set_action(e,t);return L.isObject(e)&&(r=t),this._send_request(n,r)});Tr.prototype.set_once=Ju(function(e,t,r){var n=this.set_once_action(e,t);return L.isObject(e)&&(r=t),this._send_request(n,r)});Tr.prototype.unset=Ju(function(e,t){var r=this.unset_action(e);return this._send_request(r,t)});Tr.prototype.union=Ju(function(e,t,r){L.isObject(e)&&(r=t);var n=this.union_action(e,t);return this._send_request(n,r)});Tr.prototype.delete=Ju(function(e){var t=this.delete_action();return this._send_request(t,e)});Tr.prototype.remove=Ju(function(e,t,r){var n=this.remove_action(e,t);return this._send_request(n,r)});Tr.prototype._send_request=function(e,t){e.$group_key=this._group_key,e.$group_id=this._group_id,e.$token=this._get_config("token");var r=L.encodeDates(e);return this._mixpanel._track_or_batch({type:"groups",data:r,endpoint:this._mixpanel.get_api_host("groups")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},t)};Tr.prototype._is_reserved_property=function(e){return e==="$group_key"||e==="$group_id"};Tr.prototype._get_config=function(e){return this._mixpanel.get_config(e)};Tr.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id};Tr.prototype.remove=Tr.prototype.remove;Tr.prototype.set=Tr.prototype.set;Tr.prototype.set_once=Tr.prototype.set_once;Tr.prototype.union=Tr.prototype.union;Tr.prototype.unset=Tr.prototype.unset;Tr.prototype.toString=Tr.prototype.toString;var Pt=function(){};L.extend(Pt.prototype,JT);Pt.prototype._init=function(e){this._mixpanel=e};Pt.prototype.set=nl(function(e,t,r){var n=this.set_action(e,t);return L.isObject(e)&&(r=t),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),n[Ha]=L.extend({},L.info.people_properties(),n[Ha]),this._send_request(n,r)});Pt.prototype.set_once=nl(function(e,t,r){var n=this.set_once_action(e,t);return L.isObject(e)&&(r=t),this._send_request(n,r)});Pt.prototype.unset=nl(function(e,t){var r=this.unset_action(e);return this._send_request(r,t)});Pt.prototype.increment=nl(function(e,t,r){var n={},i={};return L.isObject(e)?(L.each(e,function(o,s){if(!this._is_reserved_property(s))if(isNaN(parseFloat(o))){Jt.error("Invalid increment value passed to mixpanel.people.increment - must be a number");return}else i[s]=o},this),r=t):(L.isUndefined(t)&&(t=1),i[e]=t),n[tc]=i,this._send_request(n,r)});Pt.prototype.append=nl(function(e,t,r){L.isObject(e)&&(r=t);var n=this.append_action(e,t);return this._send_request(n,r)});Pt.prototype.remove=nl(function(e,t,r){L.isObject(e)&&(r=t);var n=this.remove_action(e,t);return this._send_request(n,r)});Pt.prototype.union=nl(function(e,t,r){L.isObject(e)&&(r=t);var n=this.union_action(e,t);return this._send_request(n,r)});Pt.prototype.track_charge=nl(function(){Jt.error("mixpanel.people.track_charge() is deprecated and no longer has any effect.")});Pt.prototype.clear_charges=function(e){return this.set("$transactions",[],e)};Pt.prototype.delete_user=function(){if(!this._identify_called()){Jt.error("mixpanel.people.delete_user() requires you to call identify() first");return}var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)};Pt.prototype.toString=function(){return this._mixpanel.toString()+".people"};Pt.prototype._send_request=function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._mixpanel.get_distinct_id();var r=this._mixpanel.get_property("$device_id"),n=this._mixpanel.get_property("$user_id"),i=this._mixpanel.get_property("$had_persisted_distinct_id");r&&(e.$device_id=r),n&&(e.$user_id=n),i&&(e.$had_persisted_distinct_id=i);var o=L.encodeDates(e);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:o,endpoint:this._mixpanel.get_api_host("people")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},t):(this._enqueue(e),L.isUndefined(t)||(this._get_config("verbose")?t({status:-1,error:null}):t(-1)),L.truncate(o,255))};Pt.prototype._get_config=function(e){return this._mixpanel.get_config(e)};Pt.prototype._identify_called=function(){return this._mixpanel._flags.identify_called===!0};Pt.prototype._enqueue=function(e){Ha in e?this._mixpanel.persistence._add_to_people_queue(Ha,e):ku in e?this._mixpanel.persistence._add_to_people_queue(ku,e):Eo in e?this._mixpanel.persistence._add_to_people_queue(Eo,e):tc in e?this._mixpanel.persistence._add_to_people_queue(tc,e):ls in e?this._mixpanel.persistence._add_to_people_queue(ls,e):Bs in e?this._mixpanel.persistence._add_to_people_queue(Bs,e):rc in e?this._mixpanel.persistence._add_to_people_queue(rc,e):Jt.error("Invalid call to _enqueue():",e)};Pt.prototype._flush_one_queue=function(e,t,r,n){var i=this,o=L.extend({},this._mixpanel.persistence.load_queue(e)),s=o;!L.isUndefined(o)&&L.isObject(o)&&!L.isEmptyObject(o)&&(i._mixpanel.persistence._pop_from_people_queue(e,o),i._mi
81xpanel.persistence.save(),n&&(s=n(o)),t.call(i,s,function(a,l){a===0&&i._mixpanel.persistence._add_to_people_queue(e,o),L.isUndefined(r)||r(a,l)}))};Pt.prototype._flush=function(e,t,r,n,i,o,s){var a=this;this._flush_one_queue(Ha,this.set,e),this._flush_one_queue(ku,this.set_once,n),this._flush_one_queue(Eo,this.unset,o,function(y){return L.keys(y)}),this._flush_one_queue(tc,this.increment,t),this._flush_one_queue(rc,this.union,i);var l=this._mixpanel.persistence.load_queue(ls);if(!L.isUndefined(l)&&L.isArray(l)&&l.length)for(var d,u=function(y,b){y===0&&a._mixpanel.persistence._add_to_people_queue(ls,d),L.isUndefined(r)||r(y,b)},h=l.length-1;h>=0;h--)l=this._mixpanel.persistence.load_queue(ls),d=l.pop(),a._mixpanel.persistence.save(),L.isEmptyObject(d)||a.append(d,u);var f=this._mixpanel.persistence.load_queue(Bs);if(!L.isUndefined(f)&&L.isArray(f)&&f.length)for(var p,m=function(y,b){y===0&&a._mixpanel.persistence._add_to_people_queue(Bs,p),L.isUndefined(s)||s(y,b)},g=f.length-1;g>=0;g--)f=this._mixpanel.persistence.load_queue(Bs),p=f.pop(),a._mixpanel.persistence.save(),L.isEmptyObject(p)||a.remove(p,m)};Pt.prototype._is_reserved_property=function(e){return e==="$distinct_id"||e==="$token"||e==="$device_id"||e==="$user_id"||e==="$had_persisted_distinct_id"};Pt.prototype.set=Pt.prototype.set;Pt.prototype.set_once=Pt.prototype.set_once;Pt.prototype.unset=Pt.prototype.unset;Pt.prototype.increment=Pt.prototype.increment;Pt.prototype.append=Pt.prototype.append;Pt.prototype.remove=Pt.prototype.remove;Pt.prototype.union=Pt.prototype.union;Pt.prototype.track_charge=Pt.prototype.track_charge;Pt.prototype.clear_charges=Pt.prototype.clear_charges;Pt.prototype.delete_user=Pt.prototype.delete_user;Pt.prototype.toString=Pt.prototype.toString;var Z_="__mps",X_="__mpso",J_="__mpus",Q_="__mpa",eb="__mpap",tb="__mpr",rb="__mpu",QT="$people_distinct_id",m1="__alias",Gh="__timers",GB=[Z_,X_,J_,Q_,eb,tb,rb,QT,m1,Gh],Ft=function(e){this.props={},this.campaign_params_saved=!1,e.persistence_name?this.name="mp_"+e.persistence_name:this.name="mp_"+e.token+"_mixpanel";var t=e.persistence;t!=="cookie"&&t!=="localStorage"&&(Jt.critical("Unknown persistence type "+t+"; falling back to cookie"),t=e.persistence="cookie"),t==="localStorage"&&L.localStorage.is_supported()?this.storage=L.localStorage:this.storage=L.cookie,this.load(),this.update_config(e),this.upgrade(),this.save()};Ft.prototype.properties=function(){var e={};return this.load(),L.each(this.props,function(t,r){L.include(GB,r)||(e[r]=t)}),e};Ft.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=L.extend({},e))}};Ft.prototype.upgrade=function(){var e,t;this.storage===L.localStorage?(e=L.cookie.parse(this.name),L.cookie.remove(this.name),L.cookie.remove(this.name,!0),e&&this.register_once(e)):this.storage===L.cookie&&(t=L.localStorage.parse(this.name),L.localStorage.remove(this.name),t&&this.register_once(t))};Ft.prototype.save=function(){this.disabled||this.storage.set(this.name,Tu(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)};Ft.prototype.load_prop=function(e){return this.load(),this.props[e]};Ft.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)};Ft.prototype.clear=function(){this.remove(),this.props={}};Ft.prototype.register_once=function(e,t,r){return L.isObject(e)?(typeof t>"u"&&(t="None"),this.expire_days=typeof r>"u"?this.default_expiry:r,this.load(),L.each(e,function(n,i){(!this.props.hasOwnProperty(i)||this.props[i]===t)&&(this.props[i]=n)},this),this.save(),!0):!1};Ft.prototype.register=function(e,t){return L.isObject(e)?(this.expire_days=typeof t>"u"?this.default_expiry:t,this.load(),L.extend(this.props,e),this.save(),!0):!1};Ft.prototype.unregister=function(e){this.load(),e in this.props&&(delete this.props[e],this.save())};Ft.prototype.update_search_keyword=function(e){this.register(L.info.searchInfo(e))};Ft.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:L.info.referringDomain(e)||"$direct"},"")};Ft.prototype.get_referrer_info=function(){return L.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})};Ft.prototype.update_config=function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cookie_domain(e.cookie_domain),this.set_cross_site(e.cross_site_cookie),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)};Ft.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()};Ft.prototype.set_cookie_domain=function(e){e!==this.cookie_domain&&(this.remove(),this.cookie_domain=e,this.save())};Ft.prototype.set_cross_site=function(e){e!==this.cross_site&&(this.cross_site=e,this.remove(),this.save())};Ft.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())};Ft.prototype.get_cross_subdomain=function(){return this.cross_subdomain};Ft.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())};Ft.prototype._add_to_people_queue=function(e,t){var r=this._get_queue_key(e),n=t[e],i=this._get_or_create_queue(Ha),o=this._get_or_create_queue(ku),s=this._get_or_create_queue(Eo),a=this._get_or_create_queue(tc),l=this._get_or_create_queue(rc),d=this._get_or_create_queue(Bs,[]),u=this._get_or_create_queue(ls,[]);r===Z_?(L.extend(i,n),this._pop_from_people_queue(tc,n),this._pop_from_people_queue(rc,n),this._pop_from_people_queue(Eo,n)):r===X_?(L.each(n,function(h,f){f in o||(o[f]=h)}),this._pop_from_people_queue(Eo,n)):r===J_?L.each(n,function(h){L.each([i,o,a,l],function(f){h in f&&delete f[h]}),L.each(u,function(f){h in f&&delete f[h]}),s[h]=!0}):r===Q_?(L.each(n,function(h,f){f in i?i[f]+=h:(f in a||(a[f]=0),a[f]+=h)},this),this._pop_from_people_queue(Eo,n)):r===rb?(L.each(n,function(h,f){L.isArray(h)&&(f in l||(l[f]=[]),L.each(h,function(p){L.include(l[f],p)||l[f].push(p)}))}),this._pop_from_people_queue(Eo,n)):r===tb?(d.push(n),this._pop_from_people_queue(ls,n)):r===eb&&(u.push(n),this._pop_from_people_queue(Eo,n)),Jt.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),Jt.log(t),this.save()};Ft.prototype._pop_from_people_queue=function(e,t){var r=this.props[this._get_queue_key(e)];L.isUndefined(r)||L.each(t,function(n,i){e===ls||e===Bs?L.each(r,function(o){o[i]===n&&delete o[i]}):delete r[i]},this)};Ft.prototype.load_queue=function(e){return this.load_prop(this._get_queue_key(e))};Ft.prototype._get_queue_key=function(e){if(e===Ha)return Z_;if(e===ku)return X_;if(e===Eo)return J_;if(e===tc)return Q_;if(e===ls)return eb;if(e===Bs)return tb;if(e===rc)return rb;Jt.error("Invalid queue:",e)};Ft.prototype._get_or_create_queue=function(e,t){var r=this._get_queue_key(e);return t=L.isUndefined(t)?{}:t,this.props[r]||(this.props[r]=t)};Ft.prototype.set_event_timer=function(e,t){var r=this.load_prop(Gh)||{};r[e]=t,this.props[Gh]=r,this.save()};Ft.prototype.remove_event_timer=function(e){var t=this.load_prop(Gh)||{},r=t[e];return L.isUndefined(r)||(delete this.props[Gh][e],this.save()),r};var KB="mixpanelBrowserDb",YB="mixpanelRecordingEvents",eA="mixpanelRecordingRegistry",ZB=1,XB=[YB,eA],oa=function(e){this.dbPromise=null,this.storeName=e};oa.prototype._openDb=function(){return new br(function(e,t){var r=tt.indexedDB.open(KB,ZB);r.onerror=function(){t(r.error)},r.onsuccess=function(){e(r.result)},r.onupgradeneeded=function(n){var i=n.target.result;
81XB.forEach(function(o){i.createObjectStore(o)})}})};oa.prototype.init=function(){return tt.indexedDB?(this.dbPromise||(this.dbPromise=this._openDb()),this.dbPromise.then(function(e){return e instanceof tt.IDBDatabase?br.resolve():br.reject(e)})):br.reject("indexedDB is not supported in this browser")};oa.prototype.isInitialized=function(){return!!this.dbPromise};oa.prototype.makeTransaction=function(e,t){var r=this.storeName,n=function(i){return new br(function(o,s){var a=i.transaction(r,e);a.oncomplete=function(){o(a)},a.onabort=a.onerror=function(){s(a.error)},t(a.objectStore(r))})};return this.dbPromise.then(n).catch((function(i){return i&&i.name==="InvalidStateError"?(this.dbPromise=this._openDb(),this.dbPromise.then(n)):br.reject(i)}).bind(this))};oa.prototype.setItem=function(e,t){return this.makeTransaction("readwrite",function(r){r.put(t,e)})};oa.prototype.getItem=function(e){var t;return this.makeTransaction("readonly",function(r){t=r.get(e)}).then(function(){return t.result})};oa.prototype.removeItem=function(e){return this.makeTransaction("readwrite",function(t){t.delete(e)})};oa.prototype.getAll=function(){var e;return this.makeTransaction("readonly",function(t){e=t.getAll()}).then(function(){return e.result})};var nb,tA=function(e,t){throw new Error(e+" not available in this build.")},Mn,rA=0,JB=1,QB=function(e){return e},Ji="mixpanel",nA="base64",eV="json",ib="$device:",pu=tt.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,iA=!pu&&Is.indexOf("MSIE")===-1&&Is.indexOf("Mozilla")===-1,g1=null;$a.sendBeacon&&(g1=function(){return $a.sendBeacon.apply($a,arguments)});var oA={track:"track/",engage:"engage/",groups:"groups/",record:"record/",flags:"flags/"},P6={api_host:"https://api-js.mixpanel.com",api_hosts:{},api_routes:oA,api_extra_query_params:{},api_method:"POST",api_transport:"XHR",api_payload_format:nA,app_host:"https://mixpanel.com",autocapture:!1,cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:qh,flags:!1,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:qh,mp_loader:null,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,stop_utm_persistence:!1,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{},record_block_class:new RegExp("^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$"),record_block_selector:"img, video, audio",record_canvas:!1,record_collect_fonts:!1,record_heatmap_data:!1,record_idle_timeout_ms:30*60*1e3,record_mask_text_class:new RegExp("^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$"),record_mask_text_selector:"*",record_max_ms:aB,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},sA=!1,ge=function(){},M5=function(e,t,r){var n,i=r===Ji?Mn:Mn[r];if(i&&nb===rA)n=i;else{if(i&&!L.isArray(i)){Jt.error("You have already initialized "+r);return}n=new ge}if(n._cached_groups={},n._init(e,t,r),n.people=new Pt,n.people._init(n),!n.get_config("skip_first_touch_marketing")){var o=L.info.campaignParams(null),s={},a=!1;L.each(o,function(l,d){s["initial_"+d]=l,l&&(a=!0)}),a&&n.people.set_once(s)}return ko.DEBUG=ko.DEBUG||n.get_config("debug"),!L.isUndefined(i)&&L.isArray(i)&&(n._execute_array.call(n.people,i.people),n._execute_array(i)),n};ge.prototype.init=function(e,t,r){if(L.isUndefined(r)){this.report_error("You must name your new library: init(token, config, name)");return}if(r===Ji){this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");return}var n=M5(e,t,r);return Mn[r]=n,n._loaded(),n};ge.prototype._init=function(e,t,r){t=t||{},this.__loaded=!0,this.config={};var n={};if(!("api_payload_format"in t)){var i=t.api_host||P6.api_host;i.match(/\.mixpanel\.com/)&&(n.api_payload_format=eV)}if(this.set_config(L.extend({},P6,n,t,{name:r,token:e,callback_fn:(r===Ji?r:Ji+"."+r)+"._jsc"})),this._jsc=qh,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests){if(!L.localStorage.is_supported(!0)||!pu)this._batch_requests=!1,Jt.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),L.each(this.get_batcher_configs(),function(a){Jt.log("Clearing batch queue "+a.queue_key),L.localStorage.remove(a.queue_key)});else if(this.init_batchers(),g1&&tt.addEventListener){var o=L.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);tt.addEventListener("pagehide",function(a){a.persisted&&o()}),tt.addEventListener("visibilitychange",function(){nr.visibilityState==="hidden"&&o()})}}this.persistence=this.cookie=new Ft(this.config),this.unpersisted_superprops={},this._gdpr_init();var s=L.UUID();this.get_distinct_id()||this.register_once({distinct_id:ib+s,$device_id:s},""),this.flags=new qt({getFullApiRoute:L.bind(function(){return this.get_api_host("flags")+"/"+this.get_config("api_routes").flags},this),getConfigFunc:L.bind(this.get_config,this),setConfigFunc:L.bind(this.set_config,this),getPropertyFunc:L.bind(this.get_property,this),trackingFunc:L.bind(this.track,this)}),this.flags.init(),this.flags=this.flags,this.autocapture=new ai(this),this.autocapture.init(),this._init_tab_id(),this._check_and_start_session_recording()};ge.prototype._init_tab_id=function(){if(this.get_config("disable_persistence"))Jt.log("Tab ID initialization skipped due to disable_persistence config");
81else if(L.sessionStorage.is_supported())try{var e=this.get_config("name")+"_"+this.get_config("token"),t="mp_tab_id_"+e,r="mp_gen_new_tab_id_"+e;(L.sessionStorage.get(r)||!L.sessionStorage.get(t))&&L.sessionStorage.set(t,"$tab-"+L.UUID()),L.sessionStorage.set(r,"1"),this.tab_id=L.sessionStorage.get(t),tt.addEventListener("beforeunload",function(){L.sessionStorage.remove(r)})}catch(n){this.report_error("Error initializing tab id",n)}else this.report_error("Session storage is not supported, cannot keep track of unique tab ID.")};ge.prototype.get_tab_id=function(){return this.tab_id||null};ge.prototype._should_load_recorder=function(){if(this.get_config("disable_persistence"))return Jt.log("Load recorder check skipped due to disable_persistence config"),Promise.resolve(!1);var e=new oa(eA),t=this.get_tab_id();return e.init().then(function(){return e.getAll()}).then(function(r){for(var n=0;n<r.length;n++)if(yB(r[n])||r[n].tabId===t)return!0;return!1}).catch(L.bind(function(r){this.report_error("Error checking recording registry",r)},this))};ge.prototype._check_and_start_session_recording=mc(function(e){if(!tt.MutationObserver){Jt.critical("Browser does not support MutationObserver; skipping session recording");return}var t=L.bind(function(n){var i=L.bind(function(){this._recorder=this._recorder||new tt.__mp_recorder(this),this._recorder.resumeRecording(n)},this);L.isUndefined(tt.__mp_recorder)?tA(this.get_config("recorder_src"),i):i()},this),r=this.get_config("record_sessions_percent")>0&&Math.random()*100<=this.get_config("record_sessions_percent");e||r?t(!0):this._should_load_recorder().then(function(n){n&&t(!1)})});ge.prototype.start_session_recording=function(){this._check_and_start_session_recording(!0)};ge.prototype.stop_session_recording=function(){return this._recorder?this._recorder.stopRecording():Promise.resolve()};ge.prototype.pause_session_recording=function(){return this._recorder?this._recorder.pauseRecording():Promise.resolve()};ge.prototype.resume_session_recording=function(){return this._recorder?this._recorder.resumeRecording():Promise.resolve()};ge.prototype.is_recording_heatmap_data=function(){return this._get_session_replay_id()&&this.get_config("record_heatmap_data")};ge.prototype.get_session_recording_properties=function(){var e={},t=this._get_session_replay_id();return t&&(e.$mp_replay_id=t),e};ge.prototype.get_session_replay_url=function(){var e=null,t=this._get_session_replay_id();if(t){var r=L.HTTPBuildQuery({replay_id:t,distinct_id:this.get_distinct_id(),token:this.get_config("token")});e="https://mixpanel.com/projects/replay-redirect?"+r}return e};ge.prototype._get_session_replay_id=function(){var e=null;return this._recorder&&(e=this._recorder.replayId),e||null};ge.prototype.__get_recorder=function(){return this._recorder};ge.prototype._loaded=function(){if(this.get_config("loaded")(this),this._set_default_superprops(),this.people.set_once(this.persistence.get_referrer_info()),this.get_config("store_google")&&this.get_config("stop_utm_persistence")){var e=L.info.campaignParams(null);L.each(e,(function(t,r){this.unregister(r)}).bind(this))}};ge.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(nr.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(L.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(nr.referrer)};ge.prototype._dom_loaded=function(){L.each(this.__dom_loaded_queue,function(e){this._track_dom.apply(this,e)},this),this.has_opted_out_tracking()||L.each(this.__request_queue,function(e){this._send_request.apply(this,e)},this),delete this.__dom_loaded_queue,delete this.__request_queue};ge.prototype._track_dom=function(e,t){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!sA)return this.__dom_loaded_queue.push([e,t]),!1;var r=new e().init(this);return r.track.apply(r,t)};ge.prototype._prepare_callback=function(e,t){if(L.isUndefined(e))return null;if(pu){var r=function(s){e(s,t)};return r}else{var n=this._jsc,i=""+Math.floor(Math.random()*1e8),o=this.get_config("callback_fn")+"["+i+"]";return n[i]=function(s){delete n[i],e(s,t)},o}};ge.prototype._send_request=function(e,t,r,n){var i=!0;if(iA)return this.__request_queue.push(arguments),i;var o={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose
vendor: 8,104 bytes, line 81
81:this.get_config("verbose")},s=null;!n&&(L.isFunction(r)||typeof r=="string")&&(n=r,r=null),r=L.extend(o,r||{}),pu||(r.method="GET");var a=r.method==="POST",l=g1&&a&&r.transport.toLowerCase()==="sendbeacon",d=r.verbose;t.verbose&&(d=!0),this.get_config("test")&&(t.test=1),d&&(t.verbose=1),this.get_config("img")&&(t.img=1),pu||(n?t.callback=n:(d||this.get_config("test"))&&(t.callback="(function(){})")),t.ip=this.get_config("ip")?1:0,t._=new Date().getTime().toString(),a&&(s="data="+encodeURIComponent(t.data),delete t.data),L.extend(t,this.get_config("api_extra_query_params")),e+="?"+L.HTTPBuildQuery(t);var u=this;if("img"in t){var h=nr.createElement("img");h.src=e,nr.body.appendChild(h)}else if(l){try{i=g1(e,s)}catch(b){u.report_error(b),i=!1}try{n&&n(i?1:0)}catch(b){u.report_error(b)}}else if(pu)try{var f=new XMLHttpRequest;f.open(r.method,e,!0);var p=this.get_config("xhr_headers");if(a&&(p["Content-Type"]="application/x-www-form-urlencoded"),L.each(p,function(b,E){f.setRequestHeader(E,b)}),r.timeout_ms&&typeof f.timeout<"u"){f.timeout=r.timeout_ms;var m=new Date().getTime()}f.withCredentials=!0,f.onreadystatechange=function(){if(f.readyState===4)if(f.status===200){if(n)if(d){var b;try{b=L.JSONDecode(f.responseText)}catch(k){if(u.report_error(k),r.ignore_json_errors)b=f.responseText;else return}n(b)}else n(Number(f.responseText))}else{var E;if(f.timeout&&!f.status&&new Date().getTime()-m>=f.timeout?E="timeout":E="Bad HTTP status: "+f.status+" "+f.statusText,u.report_error(E),n)if(d){var S=f.responseHeaders||{};n({status:0,httpStatusCode:f.status,error:E,retryAfter:S["Retry-After"]})}else n(0)}},f.send(s)}catch(b){u.report_error(b),i=!1}else{var g=nr.createElement("script");g.type="text/javascript",g.async=!0,g.defer=!0,g.src=e;var y=nr.getElementsByTagName("script")[0];y.parentNode.insertBefore(g,y)}return i};ge.prototype._execute_array=function(e){var t,r=[],n=[],i=[];L.each(e,function(s){s&&(t=s[0],L.isArray(t)?i.push(s):typeof s=="function"?s.call(this):L.isArray(s)&&t==="alias"?r.push(s):L.isArray(s)&&t.indexOf("track")!==-1&&typeof this[t]=="function"?i.push(s):n.push(s))},this);var o=function(s,a){L.each(s,function(l){if(L.isArray(l[0])){var d=a;L.each(l,function(u){d=d[u[0]].apply(d,u.slice(1))})}else this[l[0]].apply(this,l.slice(1))},a)};o(r,this),o(n,this),o(i,this)};ge.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events};ge.prototype.get_batcher_configs=function(){var e="__mpq_"+this.get_config("token");return this._batcher_configs=this._batcher_configs||{events:{type:"events",api_name:"track",queue_key:e+"_ev"},people:{type:"people",api_name:"engage",queue_key:e+"_pp"},groups:{type:"groups",api_name:"groups",queue_key:e+"_gr"}},this._batcher_configs};ge.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var e=L.bind(function(r){return new Do(r.queue_key,{libConfig:this.config,errorReporter:this.get_config("error_reporter"),sendRequestFunc:L.bind(function(n,i,o){var s=this.get_config("api_routes");this._send_request(this.get_api_host(r.api_name)+"/"+s[r.api_name],this._encode_data_for_request(n),i,this._prepare_callback(o,n))},this),beforeSendHook:L.bind(function(n){return this._run_hook("before_send_"+r.type,n)},this),stopAllBatchingFunc:L.bind(this.stop_batch_senders,this),usePersistence:!0})},this),t=this.get_batcher_configs();this.request_batchers={events:e(t.events),people:e(t.people),groups:e(t.groups)}}this.get_config("batch_autostart")&&this.start_batch_senders()};ge.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,L.each(this.request_batchers,function(e){e.start()}))};ge.prototype.stop_batch_senders=function(){this._batch_requests=!1,L.each(this.request_batchers,function(e){e.stop(),e.clear()})};ge.prototype.push=function(e){this._execute_array([e])};ge.prototype.disable=function(e){typeof e>"u"?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)};ge.prototype._encode_data_for_request=function(e){var t=Tu(e);return this.get_config("api_payload_format")===nA&&(t=L.base64Encode(t)),{data:t}};ge.prototype._track_or_batch=function(e,t){var r=L.truncate(e.data,255),n=e.endpoint,i=e.batcher,o=e.should_send_immediately,s=e.send_request_options||{};t=t||qh;var a=!0,l=L.bind(function(){return s.skip_hooks||(r=this._run_hook("before_send_"+e.type,r)),r?(Jt.log("MIXPANEL REQUEST:"),Jt.log(r),this._send_request(n,this._encode_data_for_request(r),s,this._prepare_callback(t,r))):null},this);return this._batch_requests&&!o?i.enqueue(r).then(function(d){d?t(1,r):l()}):a=l(),a&&r};ge.prototype.track=mc(function(e,t,r,n){!n&&typeof r=="function"&&(n=r,r=null),r=r||{};var i=r.transport;i&&(r.transport=i);var o=r.send_immediately;if(typeof n!="function"&&(n=qh),L.isUndefined(e)){this.report_error("No event name provided to mixpanel.track");return}if(this._event_is_disabled(e)){n(0);return}t=L.extend({},t),t.token=this.get_config("token");var s=this.persistence.remove_event_timer(e);if(!L.isUndefined(s)){var a=new Date().getTime()-s;t.$duration=parseFloat((a/1e3).toFixed(3))}this._set_default_superprops();var l=this.get_config("track_marketing")?L.info.marketingParams():{};t=L.extend({},L.info.properties({mp_loader:this.get_config("mp_loader")}),l,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),t);var d=this.get_config("property_blacklist");L.isArray(d)?L.each(d,function(f){delete t[f]}):this.report_error("Invalid value for property_blacklist config: "+d);var u={event:e,properties:t},h=this._track_or_batch({type:"events",data:u,endpoint:this.get_api_host("events")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:o,send_request_options:r},n);return h});ge.prototype.set_group=mc(function(e,t,r){L.isArray(t)||(t=[t]);var n={};return n[e]=t,this.register(n),this.people.set(e,t,r)});ge.prototype.add_group=mc(function(e,t,r){var n=this.get_property(e),i={};return n===void 0?(i[e]=[t],this.register(i)):n.indexOf(t)===-1&&(n.push(t),i[e]=n,this.register(i)),this.people.union(e,t,r)});ge.prototype.remove_group=mc(function(e,t,r){var n=this.get_property(e);if(n!==void 0){var i=n.indexOf(t);i>-1&&(n.splice(i,1),this.register({group_key:n})),n.length===0&&this.unregister(e)}return this.people.remove(e,t,r)});ge.prototype.track_with_groups=mc(function(e,t,r,n){var i=L.extend({},t||{});return L.each(r,function(o,s){o!=null&&(i[s]=o)}),this.track(e,i,n)});ge.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)};ge.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]};ge.prototype.get_group=function(e,t){var r=this._create_map_key(e,t),n=this._cached_groups[r];return(n===void 0||n._group_key!==e||n._group_id!==t)&&(n=new Tr,n._init(this,e,t),this._cached_groups[r]=n),n};ge.prototype.track_pageview=mc(function(e,t){typeof e!="object"&&(e={}),t=t||{};var r=t.event_name||"$mp_web_page_view",n=L.extend(L.info.mpPageViewProperties(),L.info.campaignParams(),L.info.clickParams()),i=L.extend({},n,e);return this.track(r,i)});ge.prototype.track_links=function(){return this._track_dom.call(this,Au,arguments)};ge.prototype.track_forms=function(){return this._track_dom.call(this,Hm,arguments)};ge.prototype.time_event=function(e){if(L.isUndefined(e)){this.report_error("No event name provided to mixpanel.time_event");return}this._event_is_disabled(e)||this.persistence.set_event_timer(e,new Date().getTime())};var tV={persistent:!0},ob=function(e){var t;return L.isObject(e)?t=e:L.isUndefined(e)?t={}:t={days:e},L.extend({},tV,t)};ge.prototype.register=function(e,t){var r=ob(t);r.persistent?this.persistence.register(e,r.days):L.extend(this.unpersisted_superprops,e)};ge.prototype.register_once=function(e,t,r){var n=ob(r);n.persistent?this.persistence.register_once(e,t,n.days):(typeof t>"u"&&(t="None"),L.each(e,function(i,o){(!this.unpersisted_superprops.hasOwnProperty(o)||this.unpersisted_superprops[o]===t)&&(this.unpersisted_superprops[o]=i)},this))};
81ge.prototype.unregister=function(e,t){t=ob(t),t.persistent?this.persistence.unregister(e):delete this.unpersisted_superprops[e]};ge.prototype._register_single=function(e,t){var r={};r[e]=t,this.register(r)};ge.prototype.identify=function(e,t,r,n,i,o,s,a){var l=this.get_distinct_id();if(e&&l!==e){if(typeof e=="string"&&e.indexOf(ib)===0)return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:e})}if(!this.get_property("$device_id")){var d=l;this.register_once({$had_persisted_distinct_id:!0,$device_id:d},"")}e!==l&&e!==this.get_property(m1)&&(this.unregister(m1),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(t,r,n,i,o,s,a),e!==l&&this.track("$identify",{distinct_id:e,$anon_distinct_id:l},{skip_hooks:!0}),e!==l&&this.flags.fetchFlags()};ge.prototype.reset=function(){this.stop_session_recording(),this.persistence.clear(),this._flags.identify_called=!1;var e=L.UUID();this.register_once({distinct_id:ib+e,$device_id:e},""),this._check_and_start_session_recording()};ge.prototype.get_distinct_id=function(){return this.get_property("distinct_id")};ge.prototype.alias=function(e,t){if(e===this.get_property(QT))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var r=this;return L.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(m1,e),this.track("$create_alias",{alias:e,distinct_id:t},{skip_hooks:!0},function(){r.identify(e)})):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)};ge.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)};ge.prototype.set_config=function(e){if(L.isObject(e)){L.extend(this.config,e);var t=e.batch_size;t&&L.each(this.request_batchers,function(r){r.resetBatchSize()}),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),ko.DEBUG=ko.DEBUG||this.get_config("debug"),("autocapture"in e||"record_heatmap_data"in e)&&this.autocapture&&this.autocapture.init()}};ge.prototype.get_config=function(e){return this.config[e]};ge.prototype._run_hook=function(e){var t=(this.config.hooks[e]||QB).apply(this,La.call(arguments,1));return typeof t>"u"&&(this.report_error(e+" hook did not return a value"),t=null),t};ge.prototype.get_property=function(e){return this.persistence.load_prop([e])};ge.prototype.get_api_host=function(e){return this.get_config("api_hosts")[e]||this.get_config("api_host")};ge.prototype.toString=function(){var e=this.get_config("name");return e!==Ji&&(e=Ji+"."+e),e};ge.prototype._event_is_disabled=function(e){return L.isBlockedUA(Is)||this._flags.disable_all_events||L.include(this.__disabled_events,e)};ge.prototype._gdpr_init=function(){var e=this.get_config("opt_out_tracking_persistence_type")==="localStorage";e&&L.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):!this.has_opted_in_tracking()&&(this.get_config("opt_out_tracking_by_default")||L.cookie.get("mp_optout"))&&(L.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))};ge.prototype._gdpr_update_persistence=function(e){var t;if(e&&e.clear_persistence)t=!0;else if(e&&e.enable_persistence)t=!1;else return;!this.get_config("disable_persistence")&&this.persistence.disabled!==t&&this.persistence.set_disabled(t),t?(this.stop_batch_senders(),this.stop_session_recording()):this._batchers_were_started&&this.start_batch_senders()};ge.prototype._gdpr_call_func=function(e,t){return t=L.extend({track:L.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},t),L.localStorage.is_supported()||(t.persistence_type="cookie"),e(this.get_config("token"),{track:t.track,trackEventName:t.track_event_name,trackProperties:t.track_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieDomain:t.cookie_domain,cookieExpiration:t.cookie_expiration,crossSiteCookie
81:t.cross_site_cookie,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie,ignoreDnt:t.ignore_dnt})};ge.prototype.opt_in_tracking=function(e){e=L.extend({enable_persistence:!0},e),this._gdpr_call_func(BB,e),this._gdpr_update_persistence(e)};ge.prototype.opt_out_tracking=function(e){e=L.extend({clear_persistence:!0,delete_user:!0},e),e.delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(VB,e),this._gdpr_update_persistence(e)};ge.prototype.has_opted_in_tracking=function(e){return this._gdpr_call_func(HB,e)};ge.prototype.has_opted_out_tracking=function(e){return this._gdpr_call_func(YT,e)};ge.prototype.clear_opt_in_out_tracking=function(e){e=L.extend({enable_persistence:!0},e),this._gdpr_call_func(zB,e),this._gdpr_update_persistence(e)};ge.prototype.report_error=function(e,t){Jt.error.apply(Jt.error,arguments);try{!t&&!(e instanceof Error)&&(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(r){Jt.error(r)}};ge.prototype.init=ge.prototype.init;ge.prototype.reset=ge.prototype.reset;ge.prototype.disable=ge.prototype.disable;ge.prototype.time_event=ge.prototype.time_event;ge.prototype.track=ge.prototype.track;ge.prototype.track_links=ge.prototype.track_links;ge.prototype.track_forms=ge.prototype.track_forms;ge.prototype.track_pageview=ge.prototype.track_pageview;ge.prototype.register=ge.prototype.register;ge.prototype.register_once=ge.prototype.register_once;ge.prototype.unregister=ge.prototype.unregister;ge.prototype.identify=ge.prototype.identify;ge.prototype.alias=ge.prototype.alias;ge.prototype.name_tag=ge.prototype.name_tag;ge.prototype.set_config=ge.prototype.set_config;ge.prototype.get_config=ge.prototype.get_config;ge.prototype.get_api_host=ge.prototype.get_api_host;ge.prototype.get_property=ge.prototype.get_property;ge.prototype.get_distinct_id=ge.prototype.get_distinct_id;ge.prototype.toString=ge.prototype.toString;ge.prototype.opt_out_tracking=ge.prototype.opt_out_tracking;ge.prototype.opt_in_tracking=ge.prototype.opt_in_tracking;ge.prototype.has_opted_out_tracking=ge.prototype.has_opted_out_tracking;ge.prototype.has_opted_in_tracking=ge.prototype.has_opted_in_tracking;ge.prototype.clear_opt_in_out_tracking=ge.prototype.clear_opt_in_out_tracking;ge.prototype.get_group=ge.prototype.get_group;ge.prototype.set_group=ge.prototype.set_group;ge.prototype.add_group=ge.prototype.add_group;ge.prototype.remove_group=ge.prototype.remove_group;ge.prototype.track_with_groups=ge.prototype.track_with_groups;ge.prototype.start_batch_senders=ge.prototype.start_batch_senders;ge.prototype.stop_batch_senders=ge.prototype.stop_batch_senders;ge.prototype.start_session_recording=ge.prototype.start_session_recording;ge.prototype.stop_session_recording=ge.prototype.stop_session_recording;ge.prototype.pause_session_recording=ge.prototype.pause_session_recording;ge.prototype.resume_session_recording=ge.prototype.resume_session_recording;ge.prototype.get_session_recording_properties=ge.prototype.get_session_recording_properties;ge.prototype.get_session_replay_url=ge.prototype.get_session_replay_url;ge.prototype.get_tab_id=ge.prototype.get_tab_id;ge.prototype.DEFAULT_API_ROUTES=oA;ge.prototype.__get_recorder=ge.prototype.__get_recorder;Ft.prototype.properties=Ft.prototype.properties;Ft.prototype.update_search_keyword=Ft.prototype.update_search_keyword;Ft.prototype.update_referrer_info=Ft.prototype.update_referrer_info;Ft.prototype.get_cross_subdomain=Ft.prototype.get_cross_subdomain;Ft.prototype.clear=Ft.prototype.clear;var eu={},rV=function(){L.each(eu,function(e,t){t!==Ji&&(Mn[t]=e)}),Mn._=L},nV=function(){Mn.init=function(e,t,r){if(r)return Mn[r]||(Mn[r]=eu[r]=M5(e,t,r),Mn[r]._loaded()),Mn[r];var n=Mn;eu[Ji]?n=eu[Ji]:e&&(n=M5(e,t,Ji),n._loaded(),eu[Ji]=n),Mn=n,nb===JB&&(tt[Ji]=Mn),rV()}},iV=function(){function e(){e.done||(e.done=!0,sA=!0,iA=!1,L.each(eu,function(n){n._dom_loaded()}))}function t(){try{nr.documentElement.doScroll("left")}catch{setTimeout(t,1);return}e()}if(nr.addEventListener)nr.readyState==="complete"?e():nr.addEventListener("DOMContentLoaded",e,!1);else if(nr.attachEvent){nr.attachEvent("onreadystatechange",e);var r=!1;try{r=tt.frameElement===null}catch{}nr.documentElement.doScroll&&r&&t()}L.register_event(tt,"load",e,!0)};function oV(e){return tA=e,nb=rA,Mn=new ge,nV(),Mn.init(),iV(),Mn}function sV(e,t){var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.onload=t,r.src=e,document.head.appendChild(r)}var Kh=oV(sV);const aV="bdb98d7fc008b54b925b5b099913f317",lV=()=>{Kh.init(aV,{debug:!1,track_pageview:!1,autotrack:!1,ignore_dnt:!0,persistence:"localStorage",record_sessions_percent:25})},cV=(e,t)=>{Kh.identify(e),t&&Kh.people.set(t)},uV=()=>{Kh.reset()},fh=(e,t)=>{Kh.track(e,t)};var dV=class{constructor(t){this.baseUrl=t.baseUrl,this.headers={"Content-Type":"application/json",...t.defaultHeaders},this.maxRetries=t.maxRetries??3,this.initialRetryDelay=t.initialRetryDelay??500}async resolveHeaders(){let t={};for(let[r,n]of Object.entries(this.headers)){let i=await n;i!==null&&(t[r]=i)}return t}addHeader(t,r){this.headers[t]=r}async post(t,r,n,i){try{let o=await fetch(t,{method:"POST",headers:await this.resolveHeaders(),body:r?JSON.stringify(r??{}):void 0,keepalive:!0,...n});if(o.status===401)return null;if(o.status!==200&&o.status!==202)throw new Error(`HTTP error! status: ${o.status}`);let s=await o.text();return s?JSON.parse(s):null}catch(o){if(i<this.maxRetries){let s=this.initialRetryDelay*2**i;return await new Promise(a=>setTimeout(a,s)),this.post(t,r,n,i+1)}return console.error("Max retries reached:",o),null}}async fetch(t,r,n={}){let i=`${this.baseUrl}${t}`;return this.post(i,r,n,0)}},hV=class{constructor(t){this.groups=[],this.queue=[],this.options=t;let r={"openpanel-client-id":t.clientId};t.clientSecret&&(r["openpanel-client-secret"]=t.clientSecret),r["openpanel-sdk-name"]=t.sdk||"node",r["openpanel-sdk-version"]=t.sdkVersion||"1.3.1",this.api=new dV({baseUrl:t.apiUrl||"https://api.openpanel.dev",defaultHeaders:r})}init(){}ready(){this.options.disabled=!1,this.options.waitForProfile=!1,this.flush()}
81shouldQueue(t){return!!(this.options.disabled||this.options.waitForProfile&&!this.profileId||t.type==="replay"&&!this.sessionId)}addQueue(t){t.type==="track"&&(t.payload.properties={...t.payload.properties??{},__timestamp:new Date().toISOString()}),this.queue.push(t)}async send(t){if(this.options.filter&&!this.options.filter(t))return Promise.resolve();if(this.shouldQueue(t))return this.addQueue(t),Promise.resolve();let r=await this.api.fetch("/track",t,{keepalive:t.type!=="replay"});this.deviceId=r==null?void 0:r.deviceId;let n=!!this.sessionId;return this.sessionId=r==null?void 0:r.sessionId,!n&&this.sessionId&&this.flush(),r}setGlobalProperties(t){this.global={...this.global,...t}}track(t,r){this.log("track event",t,r);let{groups:n,profileId:i,...o}=r??{},s=[...new Set([...this.groups,...n??[]])];return this.send({type:"track",payload:{name:t,profileId:i??this.profileId,groups:s.length>0?s:void 0,properties:{...this.global??{},...o}}})}identify(t){if(this.log("identify user",t),t.profileId&&(this.profileId=t.profileId,this.flush()),t.profileId&&Object.keys(t).length>1)return this.send({type:"identify",payload:{...t,properties:{...this.global,...t.properties}}})}upsertGroup(t){return this.log("upsert group",t),this.send({type:"group",payload:t})}setGroup(t){return this.log("set group",t),this.groups.includes(t)||(this.groups=[...this.groups,t]),this.send({type:"assign_group",payload:{groupIds:[t],profileId:this.profileId}})}setGroups(t){return this.log("set groups",t),this.groups=[...new Set([...this.groups,...t])],this.send({type:"assign_group",payload:{groupIds:t,profileId:this.profileId}})}alias(t){}increment(t){return this.send({type:"increment",payload:t})}decrement(t){return this.send({type:"decrement",payload:t})}revenue(t,r){let n=r==null?void 0:r.deviceId;return r==null||delete r.deviceId,this.track("revenue",{...r??{},...n?{__deviceId:n}:{},__revenue:t})}getDeviceId(){return this.deviceId??""}getSessionId(){return this.sessionId??""}fetchDeviceId(){return Promise.resolve(this.deviceId??"")}clear(){this.profileId=void 0,this.groups=[],this.deviceId=void 0,this.sessionId=void 0}buildFlushPayload(t){if(t.type==="replay")return t.payload;if(t.type==="track"){let r="groups"in t.payload?t.payload.groups??[]:[],n=[...new Set([...this.groups,...r])];return{...t.payload,profileId:t.payload.profileId??this.profileId,groups:n.length>0?n:void 0}}return t.type==="identify"||t.type==="increment"||t.type==="decrement"?{...t.payload,profileId:t.payload.profileId??this.profileId}:t.type==="assign_group"?{...t.payload,profileId:t.payload.profileId??this.profileId}:t.payload}flush(){let t=[];for(let r of this.queue){if(this.shouldQueue(r)){t.push(r);continue}let n=this.buildFlushPayload(r);this.send({...r,payload:n})}this.queue=t}log(...t){this.options.debug&&console.log("[OpenPanel.dev]",...t)}},fV=typeof document<"u"?document.currentScript:null;function pV(e){return e.replace(/([-_][a-z])/gi,t=>t.toUpperCase().replace("-","").replace("_",""))}var mV=class extends hV{constructor(t){var r;if(super({sdk:"web",sdkVersion:"1.4.1",...t}),this.options=t,this.lastPath="",this.pendingRevenues=[],!this.isServer()){try{let n=sessionStorage.getItem("openpanel-pending-revenues");if(n){let i=JSON.parse(n);Array.isArray(i)&&(this.pendingRevenues=i)}}catch{this.pendingRevenues=[]}if(this.setGlobalProperties({__referrer:document.referrer}),this.options.trackScreenViews&&(this.trackScreenViews(),setTimeout(()=>this.screenView(),0)),this.options.trackOutgoingLinks&&this.trackOutgoingLinks(),this.options.trackAttributes&&this.trackAttributes(),(r=this.options.sessionReplay)==null?void 0:r.enabled){let n=this.options.sessionReplay.sampleRate??1;Math.random()<n&&this.loadReplayModule().then(i=>{i&&i.startReplayRecorder(this.options.sessionReplay,o=>{this.send({type:"replay",payload:{...o}})})})}}}async loadReplayModule(){var t,r;try{if(typeof __OPENPANEL_REPLAY_URL__<"u"){let n=fV,i=((t=this.options.sessionReplay)==null?void 0:t.scriptUrl)||((r=n==null?void 0:n.src)==null?void 0:r.replace(".js","-replay.js"))||"https://openpanel.dev/op1-replay.js";return window.__openpanel_replay?window.__openpanel_replay:new Promise(o=>{let s=document.createElement("script");s.src=i,s.onload=()=>{o(window.__openpanel_replay??null)},s.onerror=()=>{console.warn("[OpenPanel] Failed to load replay script from",i),o(null)},document.head.appendChild(s)})}return await X(()=>import("./replay-V6FXES7X-BWVu-Dm-.js"),[])}catch(n){return console.warn("[OpenPanel] Failed to load replay module",n),null}}debounce(t,r){clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(t,r)}isServer(){return typeof document>"u"}trackOutgoingLinks(){this.isServer()||document.addEventListener("click",t=>{let r=t.target,n=r.closest("a");if(n&&r){let i=n.getAttribute("href");if(i!=null&&i.startsWith("http"))try{let o=new URL(i),s=window.location.hostname;o.hostname!==s&&super.track("link_out",{href:i,text:n.innerText||n.getAttribute("title")||r.getAttribute("alt")||r.getAttribute("title")})}catch{}}})}trackScreenViews(){if(this.isServer())return;let t=history.pushState;history.pushState=function(...i){let o=t.apply(this,i);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),o};let r=history.replaceState;history.replaceState=function(...i){let o=r.apply(this,i);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),o},window.addEventListener("popstate",()=>{window.dispatchEvent(new Event("locationchange"))});let n=()=>this.debounce(()=>this.screenView(),50);this.options.trackHashChanges?window.addEventListener("hashchange",n):window.addEventListener("locationchange",n)}trackAttributes(){this.isServer()||document.addEventListener("click",t=>{let r=t.target,n=r.closest("button"),i=r.closest("a"),o=n!=null&&n.getAttribute("data-track")?n:i!=null&&i.getAttribute("data-track")?i:null;if(o){let s={};for(let l of o.attributes)l.name.startsWith("data-")&&l.name!=="data-track"&&(s[pV(l.name.replace(/^data-/,""))]=l.value);let a=o.getAttribute("data-track");a&&super.track(a,s)}})}track(t,r){return super.track(t,{...r,__path:this.lastPath})}screenView(t,r){if(this.isServer())return;let n,i;typeof t=="string"?(n=t,i=r):(n=window.location.href,i=t),this.lastPath!==n&&(this.lastPath=n,super.track("screen_view",{...i??{},__path:n,__title:document.title}))}async flushRevenue(){let t=this.pendingRevenues.map(r=>super.revenue(r.amount,r.properties));await Promise.all(t),this.clearRevenue()}clearRevenue(){if(this.pendingRevenues=[],!this.isServer())try{sessionStorage.removeItem("openpanel-pending-revenues")}catch{}}pendingRevenue(t,r){if(this.pendingRevenues.push({amount:t,properties:r}),!this.isServer())try{sessionStorage.setItem("openpanel-pending-revenues",JSON.stringify(this.pendingRevenues))}catch{}}};const gV="71fed120-d250-4394-abb6-e6235d95329a",vV="https://op.stoqui.com.br/api";let za=null;const yV=()=>{za||(za=new mV({clientId:gV,apiUrl:vV,trackScreenViews:!0,trackOutgoingLinks:!0,trackAttributes:!0,sessionReplay:{enabled:!0,sampleRate:.25,maskAllInputs:!0,maskAllText:!0}}))},_V=e=>{const t=(e==null?void 0:e.trim())||"";if(!t)return{firstName:void 0,lastName:void 0};const r=t.split(/\s+/);return{firstName:r[0],lastName:r.slice(1).join(" ")||void 0}},bV=(e,t)=>{if(!za)return;
81const{$name:r,$email:n,$phone_number:i,...o}=t??{},{firstName:s,lastName:a}=_V(r);za.identify({profileId:e,firstName:s,lastName:a,email:n,properties:{...typeof i=="string"?{phone:i}:{},...o}})},xV=()=>{za&&za.clear()},wV=(e,t)=>{za&&za.track(e,t)};/*! Capacitor: https://capacitorjs.com/ - MIT License */var Ru;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(Ru||(Ru={}));class p2 extends Error{constructor(t,r,n){super(t),this.message=t,this.code=r,this.data=n}}const EV=e=>{var t,r;return e!=null&&e.androidBridge?"android":!((r=(t=e==null?void 0:e.webkit)===null||t===void 0?void 0:t.messageHandlers)===null||r===void 0)&&r.bridge?"ios":"web"},SV=e=>{const t=e.CapacitorCustomPlatform||null,r=e.Capacitor||{},n=r.Plugins=r.Plugins||{},i=()=>t!==null?t.name:EV(e),o=()=>i()!=="web",s=h=>{const f=d.get(h);return!!(f!=null&&f.platforms.has(i())||a(h))},a=h=>{var f;return(f=r.PluginHeaders)===null||f===void 0?void 0:f.find(p=>p.name===h)},l=h=>e.console.error(h),d=new Map,u=(h,f={})=>{const p=d.get(h);if(p)return console.warn(`Capacitor plugin "${h}" already registered. Cannot register plugins twice.`),p.proxy;const m=i(),g=a(h);let y;const b=async()=>(!y&&m in f?y=typeof f[m]=="function"?y=await f[m]():y=f[m]:t!==null&&!y&&"web"in f&&(y=typeof f.web=="function"?y=await f.web():y=f.web),y),E=(x,C)=>{var P,I;if(g){const O=g==null?void 0:g.methods.find(D=>C===D.name);if(O)return O.rtype==="promise"?D=>r.nativePromise(h,C.toString(),D):(D,M)=>r.nativeCallback(h,C.toString(),D,M);if(x)return(P=x[C])===null||P===void 0?void 0:P.bind(x)}else{if(x)return(I=x[C])===null||I===void 0?void 0:I.bind(x);throw new p2(`"${h}" plugin is not implemented on ${m}`,Ru.Unimplemented)}},S=x=>{let C;const P=(...I)=>{const O=b().then(D=>{const M=E(D,x);if(M){const U=M(...I);return C=U==null?void 0:U.remove,U}else throw new p2(`"${h}.${x}()" is not implemented on ${m}`,Ru.Unimplemented)});return x==="addListener"&&(O.remove=async()=>C()),O};return P.toString=()=>`${x.toString()}() { [capacitor code] }`,Object.defineProperty(P,"name",{value:x,writable:!1,configurable:!1}),P},k=S("addListener"),A=S("removeListener"),w=(x,C)=>{const P=k({eventName:x},C),I=async()=>{const D=await P;A({eventName:x,callbackId:D},C)},O=new Promise(D=>P.then(()=>D({remove:I})));return O.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await I()},O},_=new Proxy({},{get(x,C){switch(C){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return g?w:k;case"removeListener":return A;default:return S(C)}}});return n[h]=_,d.set(h,{name:h,proxy:_,platforms:new Set([...Object.keys(f),...g?[m]:[]])}),_};return r.convertFileSrc||(r.convertFileSrc=h=>h),r.getPlatform=i,r.handleError=l,r.isNativePlatform=o,r.isPluginAvailable=s,r.registerPlugin=u,r.Exception=p2,r.DEBUG=!!r.DEBUG,r.isLoggingEnabled=!!r.isLoggingEnabled,r},CV=e=>e.Capacitor=SV(e),qe=CV(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}),Kr=qe.registerPlugin;class sb{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(t,r){let n=!1;this.listeners[t]||(this.listeners[t]=[],n=!0),this.listeners[t].push(r);const o=this.windowListeners[t];o&&!o.registered&&this.addWindowListener(o),n&&this.sendRetainedArgumentsForEvent(t);const s=async()=>this.removeListener(t,r);return Promise.resolve({remove:s})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,r,n){const i=this.listeners[t];if(!i){if(n){let o=this.retainedEventArguments[t];o||(o=[]),o.push(r),this.retainedEventArguments[t]=o}return}i.forEach(o=>o(r))}hasListeners(t){return!!this.listeners[t].length}registerWindowListener(t,r){this.windowListeners[r]={registered:!1,windowEventName:t,pluginEventName:r,handler:n=>{this.notifyListeners(r,n)}}}unimplemented(t="not implemented"){return new qe.Exception(t,Ru.Unimplemented)}unavailable(t="not available"){return new qe.Exception(t,Ru.Unavailable)}async removeListener(t,r){const n=this.listeners[t];if(!n)return;const i=n.indexOf(r);this.listeners[t].splice(i,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}
81addWindowListener(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0}removeWindowListener(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)}sendRetainedArgumentsForEvent(t){const r=this.retainedEventArguments[t];r&&(delete this.retainedEventArguments[t],r.forEach(n=>{this.notifyListeners(t,n)}))}}const O6=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),j6=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class TV extends sb{async getCookies(){const t=document.cookie,r={};return t.split(";").forEach(n=>{if(n.length<=0)return;let[i,o]=n.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");i=j6(i).trim(),o=j6(o).trim(),r[i]=o}),r}async setCookie(t){try{const r=O6(t.key),n=O6(t.value),i=`; expires=${(t.expires||"").replace("expires=","")}`,o=(t.path||"/").replace("path=",""),s=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${r}=${n||""}${i}; path=${o}; ${s};`}catch(r){return Promise.reject(r)}}async deleteCookie(t){try{document.cookie=`${t.key}=; Max-Age=0`}catch(r){return Promise.reject(r)}}async clearCookies(){try{const t=document.cookie.split(";")||[];for(const r of t)document.cookie=r.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(t){return Promise.reject(t)}}async clearAllCookies(){try{await this.clearCookies()}catch(t){return Promise.reject(t)}}}Kr("CapacitorCookies",{web:()=>new TV});const AV=async e=>new Promise((t,r)=>{const n=new FileReader;n.onload=()=>{const i=n.result;t(i.indexOf(",")>=0?i.split(",")[1]:i)},n.onerror=i=>r(i),n.readAsDataURL(e)}),kV=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(i=>i.toLocaleLowerCase()).reduce((i,o,s)=>(i[o]=e[t[s]],i),{})},RV=(e,t=!0)=>e?Object.entries(e).reduce((n,i)=>{const[o,s]=i;let a,l;return Array.isArray(s)?(l="",s.forEach(d=>{a=t?encodeURIComponent(d):d,l+=`${o}=${a}&`}),l.slice(0,-1)):(a=t?encodeURIComponent(s):s,l=`${o}=${a}`),`${n}&${l}`},"").substr(1):null,IV=(e,t={})=>{const r=Object.assign({method:e.method||"GET",headers:e.headers},t),i=kV(e.headers)["content-type"]||"";if(typeof e.data=="string")r.body=e.data;else if(i.includes("application/x-www-form-urlencoded")){const o=new URLSearchParams;for(const[s,a]of Object.entries(e.data||{}))o.set(s,a);r.body=o.toString()}else if(i.includes("multipart/form-data")||e.data instanceof FormData){const o=new FormData;if(e.data instanceof FormData)e.data.forEach((a,l)=>{o.append(l,a)});else for(const a of Object.keys(e.data))o.append(a,e.data[a]);r.body=o;const s=new Headers(r.headers);s.delete("content-type"),r.headers=s}else(i.includes("application/json")||typeof e.data=="object")&&(r.body=JSON.stringify(e.data));return r};class PV extends sb{async request(t){const r=IV(t,t.webFetchExtra),n=RV(t.params,t.shouldEncodeUrlParams),i=n?`${t.url}?${n}`:t.url,o=await fetch(i,r),s=o.headers.get("content-type")||"";let{responseType:a="text"}=o.ok?t:{};s.includes("application/json")&&(a="json");let l,d;switch(a){case"arraybuffer":case"blob":d=await o.blob(),l=await AV(d);break;case"json":l=await o.json();break;case"document":case"text":default:l=await o.text()}const u={};return o.headers.forEach((h,f)=>{u[f]=h}),{data:l,headers:u,status:o.status,url:o.url}}async get(t){return this.request(Object.assign(Object.assign({},t),{method:"GET"}))}async post(t){return this.request(Object.assign(Object.assign({},t),{method:"POST"}))}async put(t){return this.request(Object.assign(Object.assign({},t),{method:"PUT"}))}async patch(t){return this.request(Object.assign(Object.assign({},t),{method:"PATCH"}))}async delete(t){return this.request(Object.assign(Object.assign({},t),{method:"DELETE"}))}}Kr("CapacitorHttp",{web:()=>new PV});const Iu=Kr("FirebaseAnalytics",{web:()=>X(()=>import("./web-CeaVwsmW.js"),__vite__mapDeps([0,1,2,3,4,5,6])).then(e=>new e.FirebaseAnalyticsWeb)}),OV=async()=>{try{qe.getPlatform()==="web"&&(await Iu.initializeFirebase({apiKey:"AIzaSyAMwc6SqURwlOKGD3M4-lwVr3ar0yD1KN8",authDomain:"stoqui-app.firebaseapp.com",projectId:"stoqui-app",storageBucket:"stoqui-app.firebasestorage.app",messagingSenderId:"164762051772",appId:"1:164762051772:web:84364754346273462b9cb9",measurementId:"G-JYS7KWPY0T"}),console.log("Firebase Analytics initialized on the web")),await Iu.setCollectionEnabled({enabled:!0})}catch(e){console.error("Error initializing Firebase Analytics on the web:",e)}},jV=async e=>{try{await Iu.setUserId({userId:e})}catch(t){console.error("Error setting user ID for Firebase Analytics:",t)}},LV=async e=>{try{for(const[t,r]of Object.entries(e))await Iu.setUserProperty({name:t,value:r})}catch(t){console.error("Error setting user properties for Firebase Analytics:",t)}},aA=async(e,t)=>{try{console.log("[0111] Tracking event:",e),await Iu.logEvent({name:e,params:t||{}})}catch(r){console.error(`Error logging event ${e} to Firebase Analytics:`,r)}},$V=async e=>{try{await Iu.setScreenName({screenName:e})}catch(t){console.error(`Error logging screen view ${e} to Firebase Analytics:`,t)}},DV=Kr("FacebookEvents",{web:()=>X(()=>import("./web-CfmAXKk7.js"),__vite__mapDeps([7,1,2,3,4,5,6])).then(e=>new e.FacebookEventsWeb)}),MV=async(e,t)=>{try{await DV.logEvent({event:e,params:t})}catch(r){console.error(`Error logging event ${e} to Facebook:`,r)}},pe=(e,t)=>{try{console.log("[0999] Tracking event:",e);const r=e.toLowerCase().replace(/:/g,"_").replace(/[^a-z0-9_]/g,"");fh(e,t),wV(e,t),aA(r,t),MV(r)}catch(r){console.error("Error in unified tracking:",r)}},NV=Object.freeze(Object.defineProperty({__proto__:null,trackEvent:pe},Symbol.toStringTag,{value:"Module"}));function lA(e,t){return function(){return e.apply(t,arguments)}}const{toString:FV}=Object.prototype,{getPrototypeOf:ab}=Object,zm=(e=>t=>{const r=FV.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Mo=e=>(e=e.toLowerCase(),t=>zm(t)===e),Wm=e=>t=>typeof t===e,{isArray:Qu}=Array,Yh=Wm("undefined");function UV(e){return e!==null&&!Yh(e)&&e.constructor!==null&&!Yh(e.constructor)&&Fi(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const cA=Mo("ArrayBuffer");function BV(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&cA(e.buffer),t}const VV=Wm("string"),Fi=Wm("function"),uA=Wm("number"),qm=e=>e!==null&&typeof e=="object",HV=e=>e===!0||e===!1,_0=e=>{if(zm(e)!=="object")return!1;const t=ab(e);
81return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},zV=Mo("Date"),WV=Mo("File"),qV=Mo("Blob"),GV=Mo("FileList"),KV=e=>qm(e)&&Fi(e.pipe),YV=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Fi(e.append)&&((t=zm(e))==="formdata"||t==="object"&&Fi(e.toString)&&e.toString()==="[object FormData]"))},ZV=Mo("URLSearchParams"),[XV,JV,QV,eH]=["ReadableStream","Request","Response","Headers"].map(Mo),tH=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Lf(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),Qu(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{const o=r?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let a;for(n=0;n<s;n++)a=o[n],t.call(null,e[a],a,e)}}function dA(e,t){t=t.toLowerCase();const r=Object.keys(e);let n=r.length,i;for(;n-- >0;)if(i=r[n],t===i.toLowerCase())return i;return null}const Dl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:globalThis,hA=e=>!Yh(e)&&e!==Dl;function N5(){const{caseless:e}=hA(this)&&this||{},t={},r=(n,i)=>{const o=e&&dA(t,i)||i;_0(t[o])&&_0(n)?t[o]=N5(t[o],n):_0(n)?t[o]=N5({},n):Qu(n)?t[o]=n.slice():t[o]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&Lf(arguments[n],r);return t}const rH=(e,t,r,{allOwnKeys:n}={})=>(Lf(t,(i,o)=>{r&&Fi(i)?e[o]=lA(i,r):e[o]=i},{allOwnKeys:n}),e),nH=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),iH=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},oH=(e,t,r,n)=>{let i,o,s;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],(!n||n(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=r!==!1&&ab(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},sH=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},aH=e=>{if(!e)return null;if(Qu(e))return e;let t=e.length;if(!uA(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},lH=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ab(Uint8Array)),cH=(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=n.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},uH=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},dH=Mo("HTMLFormElement"),hH=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),L6=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),fH=Mo("RegExp"),fA=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Lf(r,(i,o)=>{let s;(s=t(i,o,e))!==!1&&(n[o]=s||i)}),Object.defineProperties(e,n)},pH=e=>{fA(e,(t,r)=>{if(Fi(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(Fi(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},mH=(e,t)=>{const r={},n=i=>{i.forEach(o=>{r[o]=!0})};return Qu(e)?n(e):n(String(e).split(t)),r},gH=()=>{},vH=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,m2="abcdefghijklmnopqrstuvwxyz",$6="0123456789",pA={DIGIT:$6,ALPHA:m2,ALPHA_DIGIT:m2+m2.toUpperCase()+$6},yH=(e=16,t=pA.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r};function _H(e){return!!(e&&Fi(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const bH=e=>{const t=new Array(10),r=(n,i)=>{if(qm(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;const o=Qu(n)?[]:{};return Lf(n,(s,a)=>{const l=r(s,i+1);!Yh(l)&&(o[a]=l)}),t[i]=void 0,o}}return n};return r(e,0)},xH=Mo("AsyncFunction"),wH=e=>e&&(qm(e)||Fi(e))&&Fi(e.then)&&Fi(e.catch),mA=((e,t)=>e?setImmediate:t?((r,n)=>(Dl.addEventListener("message",({source:i,data:o})=>{i===Dl&&o===r&&n.length&&n.shift()()},!1),i=>{n.push(i),Dl.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Fi(Dl.postMessage)),EH=typeof queueMicrotask<"u"?queueMicrotask.bind(Dl):typeof process<"u"&&process.nextTick||mA,we={isArray:Qu,isArrayBuffer:cA,isBuffer:UV,isFormData:YV,isArrayBufferView:BV,isString:VV,isNumber:uA,isBoolean:HV,isObject:qm,isPlainObject:_0,isReadableStream:XV,isRequest:JV,isResponse:QV,isHeaders:eH,isUndefined:Yh,isDate:zV,isFile:WV,isBlob:qV,isRegExp:fH,isFunction:Fi,isStream:KV,isURLSearchParams:ZV,isTypedArray:lH,isFileList:GV,forEac
81h:Lf,merge:N5,extend:rH,trim:tH,stripBOM:nH,inherits:iH,toFlatObject:oH,kindOf:zm,kindOfTest:Mo,endsWith:sH,toArray:aH,forEachEntry:cH,matchAll:uH,isHTMLForm:dH,hasOwnProperty:L6,hasOwnProp:L6,reduceDescriptors:fA,freezeMethods:pH,toObjectSet:mH,toCamelCase:hH,noop:gH,toFiniteNumber:vH,findKey:dA,global:Dl,isContextDefined:hA,ALPHABET:pA,generateString:yH,isSpecCompliantForm:_H,toJSONObject:bH,isAsyncFn:xH,isThenable:wH,setImmediate:mA,asap:EH};function jt(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}we.inherits(jt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:we.toJSONObject(this.config),code:this.code,status:this.status}}});const gA=jt.prototype,vA={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{vA[e]={value:e}});Object.defineProperties(jt,vA);Object.defineProperty(gA,"isAxiosError",{value:!0});jt.from=(e,t,r,n,i,o)=>{const s=Object.create(gA);return we.toFlatObject(e,s,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),jt.call(s,e.message,t,r,n,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};const SH=null;function F5(e){return we.isPlainObject(e)||we.isArray(e)}function yA(e){return we.endsWith(e,"[]")?e.slice(0,-2):e}function D6(e,t,r){return e?e.concat(t).map(function(i,o){return i=yA(i),!r&&o?"["+i+"]":i}).join(r?".":""):t}function CH(e){return we.isArray(e)&&!e.some(F5)}const TH=we.toFlatObject(we,{},null,function(t){return/^is[A-Z]/.test(t)});function Gm(e,t,r){if(!we.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=we.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,y){return!we.isUndefined(y[g])});const n=r.metaTokens,i=r.visitor||u,o=r.dots,s=r.indexes,l=(r.Blob||typeof Blob<"u"&&Blob)&&we.isSpecCompliantForm(t);if(!we.isFunction(i))throw new TypeError("visitor must be a function");function d(m){if(m===null)return"";if(we.isDate(m))return m.toISOString();if(!l&&we.isBlob(m))throw new jt("Blob is not supported. Use a Buffer instead.");return we.isArrayBuffer(m)||we.isTypedArray(m)?l&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function u(m,g,y){let b=m;if(m&&!y&&typeof m=="object"){if(we.endsWith(g,"{}"))g=n?g:g.slice(0,-2),m=JSON.stringify(m);else if(we.isArray(m)&&CH(m)||(we.isFileList(m)||we.endsWith(g,"[]"))&&(b=we.toArray(m)))return g=yA(g),b.forEach(function(S,k){!(we.isUndefined(S)||S===null)&&t.append(s===!0?D6([g],k,o):s===null?g:g+"[]",d(S))}),!1}return F5(m)?!0:(t.append(D6(y,g,o),d(m)),!1)}const h=[],f=Object.assign(TH,{defaultVisitor:u,convertValue:d,isVisitable:F5});function p(m,g){if(!we.isUndefined(m)){if(h.indexOf(m)!==-1)throw Error("Circular reference detected in "+g.join("."));h.push(m),we.forEach(m,function(b,E){(!(we.isUndefined(b)||b===null)&&i.call(t,b,we.isString(E)?E.trim():E,g,f))===!0&&p(b,g?g.concat(E):[E])}),h.pop()}}if(!we.isObject(e))throw new TypeError("data must be an object");return p(e),t}function M6(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function lb(e,t){this._pairs=[],e&&Gm(e,this,t)}const _A=lb.prototype;_A.append=function(t,r){this._pairs.push([t,r])};_A.toString=function(t){const r=t?function(n){return t.call(this,n,M6)}:M6;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function AH(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function bA(e,t,r){if(!t)return e;const n=r&&r.encode||AH;we.isFunction(r)&&(r={serialize:r});const i=r&&r.serialize;let o;if(i?o=i(t,r):o=we.isURLSearchParams(t)?t.toString():new lb(t,r).toString(n),o){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class N6{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){we.forEach(this.handlers,function(n){n!==null&&t(n)})}}const xA={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},kH=typeof URLSearchParams<"u"?URLSearchParams:lb,RH=typeof FormData<"u"?FormData:null,IH=typeof Blob<"u"?Blob:null,PH={isBrowser:!0,classes:{
vendor: 6,468 bytes, lines 81-83
81URLSearchParams:kH,FormData:RH,Blob:IH},protocols:["http","https","file","blob","url","data"]},cb=typeof window<"u"&&typeof document<"u",U5=typeof navigator=="object"&&navigator||void 0,OH=cb&&(!U5||["ReactNative","NativeScript","NS"].indexOf(U5.product)<0),jH=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",LH=cb&&window.location.href||"http://localhost",$H=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:cb,hasStandardBrowserEnv:OH,hasStandardBrowserWebWorkerEnv:jH,navigator:U5,origin:LH},Symbol.toStringTag,{value:"Module"})),Un={...$H,...PH};function DH(e,t){return Gm(e,new Un.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,o){return Un.isNode&&we.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function MH(e){return we.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function NH(e){const t={},r=Object.keys(e);let n;const i=r.length;let o;for(n=0;n<i;n++)o=r[n],t[o]=e[o];return t}function wA(e){function t(r,n,i,o){let s=r[o++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),l=o>=r.length;return s=!s&&we.isArray(i)?i.length:s,l?(we.hasOwnProp(i,s)?i[s]=[i[s],n]:i[s]=n,!a):((!i[s]||!we.isObject(i[s]))&&(i[s]=[]),t(r,n,i[s],o)&&we.isArray(i[s])&&(i[s]=NH(i[s])),!a)}if(we.isFormData(e)&&we.isFunction(e.entries)){const r={};return we.forEachEntry(e,(n,i)=>{t(MH(n),i,r,0)}),r}return null}function FH(e,t,r){if(we.isString(e))try{return(t||JSON.parse)(e),we.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const ub={transitional:xA,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",i=n.indexOf("application/json")>-1,o=we.isObject(t);if(o&&we.isHTMLForm(t)&&(t=new FormData(t)),we.isFormData(t))return i?JSON.stringify(wA(t)):t;if(we.isArrayBuffer(t)||we.isBuffer(t)||we.isStream(t)||we.isFile(t)||we.isBlob(t)||we.isReadableStream(t))return t;if(we.isArrayBufferView(t))return t.buffer;if(we.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return DH(t,this.formSerializer).toString();if((a=we.isFileList(t))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Gm(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return o||i?(r.setContentType("application/json",!1),FH(t)):t}],transformResponse:[function(t){const r=this.transitional||ub.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(we.isResponse(t)||we.isReadableStream(t))return t;if(t&&we.isString(t)&&(n&&!this.responseType||i)){const s=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?jt.from(a,jt.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Un.classes.FormData,Blob:Un.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};we.forEach(["delete","get","head","post","put","patch"],e=>{ub.headers[e]={}});const db=ub,UH=we.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),BH=e=>{const t={};let r,n,i;return e&&e.split(` 82`).forEach(function(s){i=s.indexOf(":"),r=s.substring(0,i).trim().toLowerCase(),n=s.substring(i+1).trim(),!(!r||t[r]&&UH[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},F6=Symbol("internals");function kd(e){return e&&String(e).trim().toLowerCase()}function b0(e){return e===!1||e==null?e:we.isArray(e)?e.map(b0):String(e)}function VH(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const HH=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function g2(e,t,r,n,i){if(we.isFunction(n))return n.call(this,t,r);if(i&&(t=r),!!we.isString(t)){if(we.isString(n))return t.indexOf(n)!==-1;if(we.isRegExp(n))return n.test(t)}}function zH(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function WH(e,t){const r=we.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,o,s){return this[n].call(this,t,i,o,s)},configurable:!0})})}class Km{constructor(t){t&&this.set(t)}set(t,r,n){const i=this;function o(a,l,d){const u=kd(l);if(!u)throw new Error("header name must be a non-empty string");const h=we.findKey(i,u);(!h||i[h]===void 0||d===!0||d===void 0&&i[h]!==!1)&&(i[h||l]=b0(a))}const s=(a,l)=>we.forEach(a,(d,u)=>o(d,u,l));if(we.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(we.isString(t)&&(t=t.trim())&&!HH(t))s(BH(t),r);else if(we.isHeaders(t))for(const[a,l]of t.entries())o(l,a,n);else t!=null&&o(r,t,n);return this}get(t,r){if(t=kd(t),t){const n=we.findKey(this,t);if(n){const i=this[n];if(!r)return i;if(r===!0)return VH(i);if(we.isFunction(r))return r.call(this,i,n);if(we.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=kd(t),t){const n=we.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||g2(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let i=!1;function o(s){if(s=kd(s),s){const a=we.findKey(n,s);a&&(!r||g2(n,n[a],a,r))&&(delete n[a],i=!0)}}return we.isArray(t)?t.forEach(o):o(t),i}clear(t){const r=Object.keys(this);let n=r.length,i=!1;for(;n--;){const o=r[n];(!t||g2(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const r=this,n={};return we.forEach(this,(i,o)=>{const s=we.findKey(n,o);if(s){r[s]=b0(i),delete r[o];return}const a=t?zH(o):String(o).trim();a!==o&&delete r[o],r[a]=b0(i),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return we.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=t&&we.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(` 83`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(i=>
83n.set(i)),n}static accessor(t){const n=(this[F6]=this[F6]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=kd(s);n[a]||(WH(i,s),n[a]=!0)}return we.isArray(t)?t.forEach(o):o(t),this}}Km.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);we.reduceDescriptors(Km.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});we.freezeMethods(Km);const Ro=Km;function v2(e,t){const r=this||db,n=t||r,i=Ro.from(n.headers);let o=n.data;return we.forEach(e,function(a){o=a.call(r,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function EA(e){return!!(e&&e.__CANCEL__)}function ed(e,t,r){jt.call(this,e??"canceled",jt.ERR_CANCELED,t,r),this.name="CanceledError"}we.inherits(ed,jt,{__CANCEL__:!0});function SA(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new jt("Request failed with status code "+r.status,[jt.ERR_BAD_REQUEST,jt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function qH(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function GH(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i=0,o=0,s;return t=t!==void 0?t:1e3,function(l){const d=Date.now(),u=n[o];s||(s=d),r[i]=l,n[i]=d;let h=o,f=0;for(;h!==i;)f+=r[h++],h=h%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),d-s<t)return;const p=u&&d-u;return p?Math.round(f*1e3/p):void 0}}function KH(e,t){let r=0,n=1e3/t,i,o;const s=(d,u=Date.now())=>{r=u,i=null,o&&(clearTimeout(o),o=null),e.apply(null,d)};return[(...d)=>{const u=Date.now(),h=u-r;h>=n?s(d,u):(i=d,o||(o=setTimeout(()=>{o=null,s(i)},n-h)))},()=>i&&s(i)]}const v1=(e,t,r=3)=>{let n=0;const i=GH(50,250);return KH(o=>{const s=o.loaded,a=o.lengthComputable?o.total:void 0,l=s-n,d=i(l),u=s<=a;n=s;const h={loaded:s,total:a,progress:a?s/a:void 0,bytes:l,rate:d||void 0,estimated:d&&a&&u?(a-s)/d:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(h)},r)},U6=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},B6=e=>(...t)=>we.asap(()=>e(...t)),YH=Un.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Un.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Un.origin),Un.navigator&&/(msie|trident)/i.test(Un.navigator.userAgent)):()=>!0,ZH=Un.hasStandardBrowserEnv?{write(e,t,r,n,i,o){const s=[e+"="+encodeURIComponent(t)];we.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),we.isString(n)&&s.push("path="+n),we.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function XH(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function JH(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function CA(e,t){return e&&!XH(t)?JH(e,t):t}const V6=e=>e instanceof Ro?{...e}:e;function nc(e,t){t=t||{};const r={};function n(d,u,h,f){return we.isPlainObject(d)&&we.isPlainObject(u)?we.merge.call({caseless:f},d,u):we.isPlainObject(u)?we.merge({},u):we.isArray(u)?u.slice():u}function i(d,u,h,f){if(we.isUndefined(u)){if(!we.isUndefined(d))return n(void 0,d,h,f)}else return n(d,u,h,f)}function o(d,u){if(!we.isUndefined(u))return n(void 0,u)}function s(d,u){if(we.isUndefined(u)){if(!we.isUndefined(d))return n(void 0,d)}else return n(void 0,u)}function a(d,u,h){if(h in t)return n(d,u);if(h in e)return n(void 0,d)}const l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(d,u,h)=>i(V6(d),V6(u),h,!0)};return we.forEach(Object.keys(Object.assign({},e,t)),function(u){const h=l[u]||i,f=h(e[u],t[u],u);we.isUndefined(f)&&h!==a||(r[u]=f)}),r}const TA=e=>{const t=nc({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:a}=t;t.headers=s=Ro.from(s),t.url=bA(CA(t.baseURL,t.url),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(we.isFormData(r)){if(Un.hasStandardBrowserEnv||Un.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((l=s.getContentType())!==!1){const[d,...u]=l?l.split(";").map(h=>
83h.trim()).filter(Boolean):[];s.setContentType([d||"multipart/form-data",...u].join("; "))}}if(Un.hasStandardBrowserEnv&&(n&&we.isFunction(n)&&(n=n(t)),n||n!==!1&&YH(t.url))){const d=i&&o&&ZH.read(o);d&&s.set(i,d)}return t},QH=typeof XMLHttpRequest<"u",ez=QH&&function(e){return new Promise(function(r,n){const i=TA(e);let o=i.data;const s=Ro.from(i.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:d}=i,u,h,f,p,m;function g(){p&&p(),m&&m(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let y=new XMLHttpRequest;y.open(i.method.toUpperCase(),i.url,!0),y.timeout=i.timeout;function b(){if(!y)return;const S=Ro.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),A={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:S,config:e,request:y};SA(function(_){r(_),g()},function(_){n(_),g()},A),y=null}"onloadend"in y?y.onloadend=b:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(b)},y.onabort=function(){y&&(n(new jt("Request aborted",jt.ECONNABORTED,e,y)),y=null)}
83,y.onerror=function(){n(new jt("Network Error",jt.ERR_NETWORK,e,y)),y=null},y.ontimeout=function(){let k=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const A=i.transitional||xA;i.timeoutErrorMessage&&(k=i.timeoutErrorMessage),n(new jt(k,A.clarifyTimeoutError?jt.ETIMEDOUT:jt.ECONNABORTED,e,y)),y=null},o===void 0&&s.setContentType(null),"setRequestHeader"in y&&we.forEach(s.toJSON(),function(k,A){y.setRequestHeader(A,k)}),we.isUndefined(i.withCredentials)||(y.withCredentials=!!i.withCredentials),a&&a!=="json"&&(y.responseType=i.responseType),d&&([f,m]=v1(d,!0),y.addEventListener("progress",f)),l&&y.upload&&([h,p]=v1(l),y.upload.addEventListener("progress",h),y.upload.addEventListener("loadend",p)),(i.cancelToken||i.signal)&&(u=S=>{y&&(n(!S||S.type?new ed(null,e,y):S),y.abort(),y=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));const E=qH(i.url);if(E&&Un.protocols.indexOf(E)===-1){n(new jt("Unsupported protocol "+E+":",jt.ERR_BAD_REQUEST,e));return}y.send(o||null)})},tz=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,i;const o=function(d){if(!i){i=!0,a();const u=d instanceof Error?d:this.reason;n.abort(u instanceof jt?u:new ed(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{s=null,o(new jt(`timeout ${t} of ms exceeded`,jt.ETIMEDOUT))},t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(o):d.removeEventListener("abort",o)}),e=null)};e.forEach(d=>d.addEventListener("abort",o));const{signal:l}=n;return l.unsubscribe=()=>we.asap(a),l}},rz=tz,nz=function*(e,t){let r=e.byteLength;if(!t||r<t){yield e;return}let n=0,i;for(;n<r;)i=n+t,yield e.slice(n,i),n=i},iz=async function*(e,t){for await(const r of oz(e))yield*nz(r,t)},oz=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},H6=(e,t,r,n)=>{const i=iz(e,t);let o=0,s,a=l=>{s||(s=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:d,value:u}=await i.next();if(d){a(),l.close();return}let h=u.byteLength;if(r){let f=o+=h;r(f)}l.enqueue(new Uint8Array(u))}catch(d){throw a(d),d}},cancel(l){return a(l),i.return()}},{highWaterMark:2})},Ym=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",AA=Ym&&typeof ReadableStream=="function",sz=Ym&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),kA=(e,...t)=>{try{return!!e(...t)}catch{return!1}},az=AA&&kA(()=>{let e=!1;const t=new Request(Un.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),z6=64*1024,B5=AA&&kA(()=>we.isReadableStream(new Response("").body)),y1={stream:B5&&(e=>e.body)};Ym&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!y1[t]&&(y1[t]=we.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new jt(`Response type '${t}' is not supported`,jt.ERR_NOT_SUPPORT,n)})})})(new Response);const lz=async e=>{if(e==null)return 0;if(we.isBlob(e))return e.size;if(we.isSpecCompliantForm(e))return(await new Request(Un.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(we.isArrayBufferView(e)||we.isArrayBuffer(e))return e.byteLength;if(we.isURLSearchParams(e)&&(e=e+""),we.isString(e))return(await sz(e)).byteLength},cz=async(e,t)=>{const r=we.toFiniteNumber(e.getContentLength());return r??lz(t)},uz=Ym&&(async e=>{let{url:t,method:r,data:n,signal:i,cancelToken:o,timeout:s,onDownloadProgress:a,onUploadProgress:l,responseType:d,headers:u,withCredentials:h="same-origin",fetchOptions:f}=TA(e);d=d?(d+"").toLowerCase():"text";let p=rz([i,o&&o.toAbortSignal()],s),m;const g=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(l&&az&&r!=="get"&&r!=="head"&&(y=await cz(u,n))!==0){let A=new Request(t,{method:"POST",body:n,duplex:"half"}),w;if(we.isFormData(n)&&(w=A.headers.get("content-type"))&&u.setContentType(w),A.body){const[_,x]=U6(y,v1(B6(l)));n=H6(A.body,z6,_,x)}}we.isString(h)||(h=h?"include":"omit");const b="credentials"in Request.prototype;
83m=new Request(t,{...f,signal:p,method:r.toUpperCase(),headers:u.normalize().toJSON(),body:n,duplex:"half",credentials:b?h:void 0});let E=await fetch(m);const S=B5&&(d==="stream"||d==="response");if(B5&&(a||S&&g)){const A={};["status","statusText","headers"].forEach(C=>{A[C]=E[C]});const w=we.toFiniteNumber(E.headers.get("content-length")),[_,x]=a&&U6(w,v1(B6(a),!0))||[];E=new Response(H6(E.body,z6,_,()=>{x&&x(),g&&g()}),A)}d=d||"text";let k=await y1[we.findKey(y1,d)||"text"](E,e);return!S&&g&&g(),await new Promise((A,w)=>{SA(A,w,{data:k,headers:Ro.from(E.headers),status:E.status,statusText:E.statusText,config:e,request:m})})}catch(b){throw g&&g(),b&&b.name==="TypeError"&&/fetch/i.test(b.message)?Object.assign(new jt("Network Error",jt.ERR_NETWORK,e,m),{cause:b.cause||b}):jt.from(b,b&&b.code,e,m)}}),V5={http:SH,xhr:ez,fetch:uz};we.forEach(V5,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const W6=e=>`- ${e}`,dz=e=>we.isFunction(e)||e===null||e===!1,RA={getAdapter:e=>{e=we.isArray(e)?e:[e];const{length:t}=e;let r,n;const i={};for(let o=0;o<t;o++){r=e[o];let s;if(n=r,!dz(r)&&(n=V5[(s=String(r)).toLowerCase()],n===void 0))throw new jt(`Unknown adapter '${s}'`);if(n)break;i[s||"#"+o]=n}if(!n){const o=Object.entries(i).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let s=t?o.length>1?`since : 84`+o.map(W6).join(` 85`):" "+W6(o[0]):"as no adapter specified";throw new jt("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return n},adapters:V5};function y2(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ed(null,e)}function q6(e){return y2(e),e.headers=Ro.from(e.headers),e.data=v2.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),RA.getAdapter(e.adapter||db.adapter)(e).then(function(n){return y2(e),n.data=v2.call(e,e.transformResponse,n),n.headers=Ro.from(n.headers),n},function(n){return EA(n)||(y2(e),n&&n.response&&(n.response.data=v2.call(e,e.transformResponse,n.response),n.response.headers=Ro.from(n.response.headers))),Promise.reject(n)})}const IA="1.7.9",Zm={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Zm[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const G6={};Zm.transitional=function(t,r,n){function i(o,s){return"[Axios v"+IA+"] Transitional option '"+o+"'"+s+(n?". "+n:"")}return(o,s,a)=>{if(t===!1)throw new jt(i(s," has been removed"+(r?" in "+r:"")),jt.ERR_DEPRECATED);return r&&!G6[s]&&(G6[s]=!0,console.warn(i(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(o,s,a):!0}};Zm.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function hz(e,t,r){if(typeof e!="object")throw new jt("options must be an object",jt.E
85RR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const o=n[i],s=t[o];if(s){const a=e[o],l=a===void 0||s(a,o,e);if(l!==!0)throw new jt("option "+o+" must be "+l,jt.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new jt("Unknown option "+o,jt.ERR_BAD_OPTION)}}const x0={assertOptions:hz,validators:Zm},Bo=x0.validators;class _1{constructor(t){this.defaults=t,this.interceptors={request:new N6,response:new N6}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?o&&!String(n.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(n.stack+=` 86`+o):n.stack=o}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=nc(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:o}=r;n!==void 0&&x0.assertOptions(n,{silentJSONParsing:Bo.transitional(Bo.boolean),forcedJSONParsing:Bo.transitional(Bo.boolean),clarifyTimeoutError:Bo.transitional(Bo.boolean)},!1),i!=null&&(we.isFunction(i)?r.paramsSerializer={serialize:i}:x0.assertOptions(i,{encode:Bo.function,serialize:Bo.function},!0)),x0.assertOptions(r,{baseUrl:Bo.spelling("baseURL"),withXsrfToken:Bo.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=o&&we.merge(o.common,o[r.method]);o&&we.forEach(["delete","get","head","post","put","patch","common"],m=>{delete o[m]}),r.headers=Ro.concat(s,o);const a=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(r)===!1||(l=l&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const d=[];this.interceptors.response.forEach(function(g){d.push(g.fulfilled,g.rejected)});let u,h=0,f;if(!l){const m=[q6.bind(this),void 0];for(m.unshift.apply(m,a),m.push.apply(m,d),f=m.length,u=Promise.resolve(r);h<f;)u=u.then(m[h++],m[h++]);return u}f=a.length;let p=r;for(h=0;h<f;){const m=a[h++],g=a[h++];try{p=m(p)}catch(y){g.call(this,y);break}}try{u=q6.call(this,p)}catch(m){return Promise.reject(m)}for(h=0,f=d.length;h<f;)u=u.then(d[h++],d[h++]);return u}getUri(t){t=nc(this.defaults,t);const r=CA(t.baseURL,t.url);return bA(r,t.params,t.paramsSerializer)}}we.forEach(["delete","get","head","options"],function(t){_1.prototype[t]=function(r,n){return this.request(nc(n||{},{method:t,url:r,data:(n||{}).data}))}});we.forEach(["post","put","patch"],function(t){function r(n){return function(o,s,a){return this.request(nc(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}_1.prototype[t]=r(),_1.prototype[t+"Form"]=r(!0)});const w0=_1;class hb{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(i=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](i);n._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{n.subscribe(a),o=a}).then(i);return s.cancel=function(){n.unsubscribe(o)},s},t(function(o,s,a){n.reason||(n.reason=new ed(o,s,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new hb(function(i){t=i}),cancel:t}}}const fz=hb;function pz(e){return function(r){return e.apply(null,r)}}function mz(e){return we.isObject(e)&&e.isAxiosError===!0}const H5={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,Parti
86alContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(H5).forEach(([e,t])=>{H5[t]=e});const gz=H5;function PA(e){const t=new w0(e),r=lA(w0.prototype.request,t);return we.extend(r,w0.prototype,t,{allOwnKeys:!0}),we.extend(r,t,null,{allOwnKeys:!0}),r.create=function(i){return PA(nc(e,i))},r}const Gr=PA(db);Gr.Axios=w0;Gr.CanceledError=ed;Gr.CancelToken=fz;Gr.isCancel=EA;Gr.VERSION=IA;Gr.toFormData=Gm;Gr.AxiosError=jt;Gr.Cancel=Gr.CanceledError;Gr.all=function(t){return Promise.all(t)};Gr.spread=pz;Gr.isAxiosError=mz;Gr.mergeConfig=nc;Gr.AxiosHeaders=Ro;Gr.formToJSON=e=>wA(we.isHTMLForm(e)?new FormData(e):e);Gr.getAdapter=RA.getAdapter;Gr.HttpStatusCode=gz;Gr.default=Gr;const Io=Gr.create({baseURL:"https://catalogo.stoqui.com.br/api",headers:{"Content-Type":"application/json"}});let Rd=null,b1=!1;async function vz(e,t){b1||(b1=!0,console.error("Forcing logout:",e),pe(fe.AUTH.FORCED_LOGOUT_DUE_TO_ERROR,{reason:e,...t}),await Te.auth.signOut({scope:"local"}),window.location.href="/")}async function OA(){return b1?null:Rd||(Rd=(async()=>{try{const{data:e,error:t}=await Te.auth.refreshSession();return t||!e.session?null:e.session.access_token}catch{return null}finally{Rd=null}})(),Rd)}Io.interceptors.request.use(async e=>{var t;try{const{data:{session:r},error:n}=await Te.auth.getSession();if(n)throw console.error("[Fetcher] getSession error:",n.message),n;if(!r||!r.access_token)throw new Error("No auth session available");if(e.headers.Authorization=`Bearer ${r.access_token}`,(t=e.url)!=null&&t.includes("stoqui-pay")){const i=sessionStorage.getItem("stoqui_pay_pin_token"),o=sessionStorage.getItem("stoqui_pay_pin_expires_at");i&&o&&(Date.now()>=parseInt(o,10)||(e.headers["x-stoqui-pin-token"]=i))}return e}catch(r){return console.error("Error getting auth session:",r),e}});Io.interceptors.response.use(e=>e,async e=>{var n;const t=(n=e.response)==null?void 0:n.status,r=e.config;if(t===401&&!b1){if(r._isRetry)return await vz("retry_still_unauthorized",{endpoint:r==null?void 0:r.url}),Promise.reject(e);r._isRetry=!0,pe(fe.AUTH.FORCED_REFRESH_TOKEN,{status:t,endpoint:r==null?void 0:r.url});const i=await OA();return i?(r.headers.Authorization=`Bearer ${i}`,Io(r)):Promise.reject(e)}return Promise.reject(e)});const jA=e=>{var n;if(typeof e!="object"||e===null)return!1;const t=e.code,r=((n=e.message)==null?void 0:n.toLowerCase())??"";return!!(t&&(parseInt(t,10)===404||t==="PGRST116")||r.includes("not found")||r.includes("0 rows"))},yz=e=>{var s;if(typeof e!="object"||e===null)return!1;const t=["PGRST301","42501","42502"],r=[401,403],n=e.code,i=((s=e.message)==null?void 0:s.toLowerCase())??"",o=n?parseInt(n,10):NaN;return!!(!isNaN(o)&&r.includes(o)||t.includes(n??"")||i.includes("claim timestamp")||i.includes("exp")||i.includes("jwt")||i.includes("token")||i.includes("unauthorized")||i.includes("authorization")||i.includes("row-level security")||i.includes("insufficient_privilege"))},_z=new zD({onError:(e,t)=>{try{if(jA(e))return;pe(fe.ERROR.QUERY_FAILED,{errorMessage:e.message,errorCode:e.code,errorDetails:e.details,errorHint:e.hint,queryKey:JSON.stringify(t.queryKey)}),yz(e)&&OA().then(r=>{r&&pe(fe.SESSION.REFRESH_SUCCESS,{source:"query"})})}catch(r){console.error("Error in query error handler:",r)}}}),bz=new WD({onError:(e,t)=>
86{try{if(jA(e))return;pe(fe.ERROR.MUTATION_FAILED,{errorMessage:e.message,errorCode:e.code,errorDetails:e.details,errorHint:e.hint,variables:t})}catch(r){console.error("Error in mutation error handler:",r)}}}),x1=new qD({queryCache:_z,mutationCache:bz}),Xm=Kr("SocialLogin",{web:()=>X(()=>import("./web-vSridylW.js"),__vite__mapDeps([8,1,2,3,4,5,6])).then(e=>new e.SocialLoginWeb)}),LA=async()=>{qe.isNativePlatform()&&await Xm.initialize({google:{webClientId:"496661333301-1rtif0doi99fcohm1on1vdbcb7vlh2rs.apps.googleusercontent.com"}})},xz=async e=>{var t,r;try{if(!qe.isNativePlatform()){const u="https://app.stoqui.com.br/",{error:h}=await Te.auth.signInWithOAuth({provider:"google",options:{redirectTo:e||u}});if(h)throw h;return{user:null}}const n=await Xm.login({provider:"google",options:{scopes:["email","profile"]}});if(console.log("Google login result:",n),!n||!n.result)throw new Error("No result received from Google");const i=n.result,o=i.idToken||i.id_token||((t=i.authentication)==null?void 0:t.idToken),s=i.accessToken||i.access_token||((r=i.authentication)==null?void 0:r.accessToken);if(!o)throw new Error("No ID token received from Google");const a={provider:"google",token:o};s&&typeof s=="string"&&(a.access_token=s);const{data:l,error:d}=await Te.auth.signInWithIdToken(a);if(d)throw d;return{user:l.user,googleResult:n.result}}catch(n){throw console.error("Google sign in error:",n),n}},wz=async()=>{try{qe.isNativePlatform()&&await Xm.logout({provider:"google"}),await Te.auth.signOut()}catch(e){throw console.error("Google sign out error:",e),e}},Ez=async()=>{try{return qe.isNativePlatform()?(await Xm.isLoggedIn({provider:"google"})).isLoggedIn:!1}catch(e){return console.error("Google login check error:",e),!1}},$A=Object.freeze(Object.defineProperty({__proto__:null,initializeGoogleAuth:LA,isGoogleLoggedIn:Ez,signInWithGoogle:xz,signOutFromGoogle:wz},Symbol.toStringTag,{value:"Module"}));/** 87 * @remix-run/router v1.23.2 88 * 89 * Copyright (c) Remix Software Inc. 90 * 91 * This source code is licensed under the MIT license found in the 92 * LICENSE.md file in the root directory of this source tree. 93 * 94 * @license MIT 95 */function Ar(){return Ar=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ar.apply(this,arguments)}var Vr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Vr||(Vr={}));const K6="popstate";function Sz(e){e===void 0&&(e={});function t(n,i){let{pathname:o,search:s,hash:a}=n.location;return Zh("",{pathname:o,search:s,hash:a},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(n,i){return typeof i=="string"?i:oc(i)}return Tz(t,r,null,e)}function It(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ic(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Cz(){return Math.random().toString(36).substr(2,8)}function Y6(e,t){return{usr:e.state,key:e.key,idx:t}}function Zh(e,t,r,n){return r===void 0&&(r=null),Ar({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?sa(t):t,{state:r,key:t&&t.key||n||Cz()})}function oc(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function sa(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function Tz(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:o=!1}=n,s=i.history,a=Vr.Pop,l=null,d=u();d==null&&(d=0,s.replaceState(Ar({},s.state,{idx:d}),""));function u(){return(s.state||{idx:null}).idx}function h(){a=Vr.Pop;let y=u(),b=y==null?null:y-d;d=y,l&&l({action:a,location:g.location,delta:b})}function f(y,b){a=Vr.Push;let E=Zh(g.location,y,b);r&&r(E,y),d=u()+1;let S=Y6(E,d),k=g.createHref(E);try{s.pushState(S,"",k)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;i.location.assign(k)}o&&l&&l({action:a,location:g.location,delta:1})}function p(y,b){a=Vr.Replace;let E=Zh(g.location,y,b);r&&r(E,y),d=u();let S=Y6(E,d),k=g.createHref(E);s.replaceState(S,"",k),o&&l&&l({action:a,location:g.location,delta:0})}function m(y){let b=i.location.origin!=="null"?i.location.origin:i.location.href,E=typeof y=="string"?y:oc(y);return E=E.replace(/ $/,"%20"),It(b,"No window.location.(origin|href) available to create URL for href: "+E),new URL(E,b)}let g={get action(){return a},get location(){return e(i,s)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(K6,h),l=y,()=>{i.removeEventListener(K6,h),l=null}},createHref(y){return t(i,y)},createURL:m,encodeLocation(y){let b=m(y);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:f,replace:p,go(y){return s.go(y)}};return g}var fr;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(fr||(fr={}));
95const Az=new Set(["lazy","caseSensitive","path","id","index","children"]);function kz(e){return e.index===!0}function w1(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((i,o)=>{let s=[...r,String(o)],a=typeof i.id=="string"?i.id:s.join("-");if(It(i.index!==!0||!i.children,"Cannot specify children on an index route"),It(!n[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),kz(i)){let l=Ar({},i,t(i),{id:a});return n[a]=l,l}else{let l=Ar({},i,t(i),{id:a,children:void 0});return n[a]=l,i.children&&(l.children=w1(i.children,t,s,n)),l}})}function Al(e,t,r){return r===void 0&&(r="/"),E0(e,t,r,!1)}function E0(e,t,r,n){let i=typeof t=="string"?sa(t):t,o=gc(i.pathname||"/",r);if(o==null)return null;let s=MA(e);Rz(s);let a=null;for(let l=0;a==null&&l<s.length;++l){let d=Uz(o);a=Nz(s[l],d,n)}return a}function DA(e,t){let{route:r,pathname:n,params:i}=e;return{id:r.id,pathname:n,params:i,data:t[r.id],handle:r.handle}}function MA(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let i=(o,s,a)=>{let l={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};l.relativePath.startsWith("/")&&(It(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let d=Vs([n,l.relativePath]),u=r.concat(l);o.children&&o.children.length>0&&(It(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),MA(o.children,t,u,d)),!(o.path==null&&!o.index)&&t.push({path:d,score:Dz(d,o.index),routesMeta:u})};return e.forEach((o,s)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))i(o,s);else for(let l of NA(o.path))i(o,s,l)}),t}function NA(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return i?[o,""]:[o];let s=NA(n.join("/")),a=[];return a.push(...s.map(l=>l===""?o:[o,l].join("/"))),i&&a.push(...s),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function Rz(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Mz(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const Iz=/^:[\w-]+$/,Pz=3,Oz=2,jz=1,Lz=10,$z=-2,Z6=e=>e==="*";function Dz(e,t){let r=e.split("/"),n=r.length;return r.some(Z6)&&(n+=$z),t&&(n+=Oz),r.filter(i=>!Z6(i)).reduce((i,o)=>i+(Iz.test(o)?Pz:o===""?jz:Lz),n)}function Mz(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function Nz(e,t,r){r===void 0&&(r=!1);let{routesMeta:n}=e,i={},o="/",s=[];for(let a=0;a<n.length;++a){let l=n[a],d=a===n.length-1,u=o==="/"?t:t.slice(o.length)||"/",h=X6({path:l.relativePath,caseSensitive:l.caseSensitive,end:d},u),f=l.route;if(!h&&d&&r&&!n[n.length-1].route.index&&(h=X6({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!h)return null;
95Object.assign(i,h.params),s.push({params:i,pathname:Vs([o,h.pathname]),pathnameBase:zz(Vs([o,h.pathnameBase])),route:f}),h.pathnameBase!=="/"&&(o=Vs([o,h.pathnameBase]))}return s}function X6(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Fz(e.path,e.caseSensitive,e.end),i=t.match(r);if(!i)return null;let o=i[0],s=o.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:n.reduce((d,u,h)=>{let{paramName:f,isOptional:p}=u;if(f==="*"){let g=a[h]||"";s=o.slice(0,o.length-g.length).replace(/(.)\/+$/,"$1")}const m=a[h];return p&&!m?d[f]=void 0:d[f]=(m||"").replace(/%2F/g,"/"),d},{}),pathname:o,pathnameBase:s,pattern:e}}function Fz(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),ic(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,l)=>(n.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function Uz(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ic(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function gc(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const Bz=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Vz=e=>Bz.test(e);function Hz(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?sa(e):e,o;if(r)if(Vz(r))o=r;else{if(r.includes("//")){let s=r;r=r.replace(/\/\/+/g,"/"),ic(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+r))}r.startsWith("/")?o=J6(r.substring(1),"/"):o=J6(r,t)}else o=t;return{pathname:o,search:Wz(n),hash:qz(i)}}function J6(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function _2(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function FA(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Jm(e,t){let r=FA(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Qm(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=sa(e):(i=Ar({},e),It(!i.pathname||!i.pathname.includes("?"),_2("?","pathname","search",i)),It(!i.pathname||!i.pathname.includes("#"),_2("#","pathname","hash",i)),It(!i.search||!i.search.includes("#"),_2("#","search","hash",i)));let o=e===""||i.pathname==="",s=o?"/":i.pathname,a;if(s==null)a=r;else{let h=t.length-1;if(!n&&s.startsWith("..")){let f=s.split("/");for(;f[0]==="..";)f.shift(),h-=1;i.pathname=f.join("/")}a=h>=0?t[h]:"/"}let l=Hz(i,a),d=s&&s!=="/"&&s.endsWith("/"),u=(o||s===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(d||u)&&(l.pathname+="/"),l}const Vs=e=>e.join("/").replace(/\/\/+/g,"/"),zz=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Wz=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,qz=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class E1{constructor(t,r,n,i){i===void 0&&(i=!1),this.status=t,this.statusText=r||"",this.internal=i,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function Xh(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const UA=["post","put","patch","delete"],Gz=new Set(UA),Kz=["get",...UA],Yz=new Set(Kz),Zz=new Set([301,302,303,307,308]),Xz=ne
95w Set([307,308]),b2={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Jz={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Id={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},fb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qz=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),BA="remix-router-transitions";function eW(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",n=!r;It(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let Z=e.detectErrorBoundary;i=se=>({hasErrorBoundary:Z(se)})}else i=Qz;let o={},s=w1(e.routes,i,void 0,o),a,l=e.basename||"/",d=e.dataStrategy||iW,u=e.patchRoutesOnNavigation,h=Ar({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),f=null,p=new Set,m=null,g=null,y=null,b=e.hydrationData!=null,E=Al(s,e.history.location,l),S=!1,k=null;if(E==null&&!u){let Z=yi(404,{pathname:e.history.location.pathname}),{matches:se,route:de}=cw(s);E=se,k={[de.id]:Z}}E&&!e.hydrationData&&Ut(E,s,e.history.location.pathname).active&&(E=null);let A;if(E)if(E.some(Z=>Z.route.lazy))A=!1;else if(!E.some(Z=>Z.route.loader))A=!0;else if(h.v7_partialHydration){let Z=e.hydrationData?e.hydrationData.loaderData:null,se=e.hydrationData?e.hydrationData.errors:null;if(se){let de=E.findIndex(Ae=>se[Ae.route.id]!==void 0);A=E.slice(0,de+1).every(Ae=>!W5(Ae.route,Z,se))}else A=E.every(de=>!W5(de.route,Z,se))}else A=e.hydrationData!=null;else if(A=!1,E=[],h.v7_partialHydration){let Z=Ut(null,s,e.history.location.pathname);Z.active&&Z.matches&&(S=!0,E=Z.matches)}let w,_={historyAction:e.history.action,location:e.history.location,matches:E,initialized:A,navigation:b2,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||k,fetchers:new Map,blockers:new Map},x=Vr.Pop,C=!1,P,I=!1,O=new Map,D=null,M=!1,U=!1,$=[],j=new Set,q=new Map,W=0,ne=-1,ae=new Map,re=new Set,_e=new Map,be=new Map,J=new Set,xe=new Map,Ze=new Map,$e;function Le(){if(f=e.history.listen(Z=>{let{action:se,location:de,delta:Ae}=Z;if($e){$e(),$e=void 0;return}ic(Ze.size===0||Ae!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Ve=it({currentLocation:_.location,nextLocation:de,historyAction:se});if(Ve&&Ae!=null){let Je=new Promise(at=>{$e=at});e.history.go(Ae*-1),Me(Ve,{state:"blocked",location:de,proceed(){Me(Ve,{state:"proceeding",proceed:void 0,reset:void 0,location:de}),Je.then(()=>e.history.go(Ae))},reset(){let at=new Map(_.blockers);at.set(Ve,Id),Ge({blockers:at})}});return}return Pe(se,de)}),r){yW(t,O);let Z=()=>_W(t,O);t.addEventListener("pagehide",Z),D=()=>t.removeEventListener("pagehide",Z)}return _.initialized||Pe(Vr.Pop,_.location,{initialHydration:!0}),w}function Fe(){f&&f(),D&&D(),p.clear(),P&&P.abort(),_.fetchers.forEach((Z,se)=>G(se)),_.blockers.forEach((Z,se)=>yt(se))}function ft(Z){return p.add(Z),()=>p.delete(Z)}function Ge(Z,se){se===void 0&&(se={}),_=Ar({},_,Z);let de=[],Ae=[];h.v7_fetcherPersist&&_.fetchers.forEach((Ve,Je)=>{Ve.state==="idle"&&(J.has(Je)?Ae.push(Je):de.push(Je))}),J.forEach(Ve=>{!_.fetchers.has(Ve)&&!q.has(Ve)&&Ae.push(Ve)}),[...p].forEach(Ve=>Ve(_,{deletedFetchers:Ae,viewTransitionOpts:se.viewTransitionOpts,flushSync:se.flushSync===!0})),h.v7_fetcherPersist?(de.forEach(Ve=>_.fetchers.delete(Ve)),Ae.forEach(Ve=>G(Ve))):Ae.forEach(Ve=>J.delete(Ve))}function Se(Z,se,de){var Ae,Ve;let{flushSync:Je}=de===void 0?{}:de,at=_.actionData!=null&&_.navigation.formMethod!=null&&xo(_.navigation.formMethod)&&_.navigation.state==="loading"&&((Ae=Z.state)==null?void 0:Ae._isRedirect)!==!0,Qe;se.actionData?Object.keys(se.actionData).length>0?Qe=se.actionData:Qe=null:at?Qe=_.actionData:Qe=null;let Xe=se.loaderData?aw(_.loaderData,se.loaderData,se.matches||[],se.errors):_.loaderData,ue=_.blockers;ue.size>0&&(ue=new Map(ue),ue.forEach((ct,Ot)=>ue.set(Ot,Id)));let ye=C===!0||_.navigation.formMethod!=null&&xo(_.navigation.formMethod)&&((Ve=Z.state)==null?void 0:Ve._isRedirect)!==!0;a&&(s=a,a=void 0),M||x===Vr.Pop||(x===Vr.Push?e.history.push(Z,Z.state):x===Vr.Replace&&e.history.replace(Z,Z.state));let Oe;if(x===Vr.Pop){let ct=O.get(_.location.pathname);ct&&ct.has(Z.pathname)?Oe={currentLocation:_.location,nextLocation:Z}:O.has(Z.pathname)&&(Oe={currentLocation:Z,nextLocation:_.location})}else if(I){let ct=O.get(_.location.pathname);ct?ct.add(Z.pathname):(ct=new Set([Z.pathname]),O.set(_.location.pathname,ct)),Oe={currentLocation:_.location,nextLocation:Z}}Ge(Ar({},se,{actionData:Qe,loaderData:Xe,historyAction:x,location:Z,initialized:!0,navigation:b2,revalidation:"idle",restoreScrollPosition:ur(Z,se.matches||_.matches),preventScrollReset:ye,blockers:ue}),{viewTransitionOpts:Oe,flushSync:Je===!0}),x=Vr.Pop,C=!1,I=!1,M=!1,U=!1,$=[]}async function je(Z,se){if(typeof Z=="number"){e.history.go(Z);return}
95let de=z5(_.location,_.matches,l,h.v7_prependBasename,Z,h.v7_relativeSplatPath,se==null?void 0:se.fromRouteId,se==null?void 0:se.relative),{path:Ae,submission:Ve,error:Je}=Q6(h.v7_normalizeFormMethod,!1,de,se),at=_.location,Qe=Zh(_.location,Ae,se&&se.state);Qe=Ar({},Qe,e.history.encodeLocation(Qe));let Xe=se&&se.replace!=null?se.replace:void 0,ue=Vr.Push;Xe===!0?ue=Vr.Replace:Xe===!1||Ve!=null&&xo(Ve.formMethod)&&Ve.formAction===_.location.pathname+_.location.search&&(ue=Vr.Replace);let ye=se&&"preventScrollReset"in se?se.preventScrollReset===!0:void 0,Oe=(se&&se.flushSync)===!0,ct=it({currentLocation:at,nextLocation:Qe,historyAction:ue});if(ct){Me(ct,{state:"blocked",location:Qe,proceed(){Me(ct,{state:"proceeding",proceed:void 0,reset:void 0,location:Qe}),je(Z,se)},reset(){let Ot=new Map(_.blockers);Ot.set(ct,Id),Ge({blockers:Ot})}});return}return await Pe(ue,Qe,{submission:Ve,pendingError:Je,preventScrollReset:ye,replace:se&&se.replace,enableViewTransition:se&&se.viewTransition,flushSync:Oe})}function Ce(){if(N(),Ge({revalidation:"loading"}),_.navigation.state!=="submitting"){if(_.navigation.state==="idle"){Pe(_.historyAction,_.location,{startUninterruptedRevalidation:!0});return}Pe(x||_.historyAction,_.navigation.location,{overrideNavigation:_.navigation,enableViewTransition:I===!0})}}async function Pe(Z,se,de){P&&P.abort(),P=null,x=Z,M=(de&&de.startUninterruptedRevalidation)===!0,pt(_.location,_.matches),C=(de&&de.preventScrollReset)===!0,I=(de&&de.enableViewTransition)===!0;let Ae=a||s,Ve=de&&de.overrideNavigation,Je=de!=null&&de.initialHydration&&_.matches&&_.matches.length>0&&!S?_.matches:Al(Ae,se,l),at=(de&&de.flushSync)===!0;
95if(Je&&_.initialized&&!U&&uW(_.location,se)&&!(de&&de.submission&&xo(de.submission.formMethod))){Se(se,{matches:Je},{flushSync:at});return}let Qe=Ut(Je,Ae,se.pathname);if(Qe.active&&Qe.matches&&(Je=Qe.matches),!Je){let{error:Be,notFoundMatches:Y,route:ke}=tr(se.pathname);Se(se,{matches:Y,loaderData:{},errors:{[ke.id]:Be}},{flushSync:at});return}P=new AbortController;let Xe=Mc(e.history,se,P.signal,de&&de.submission),ue;if(de&&de.pendingError)ue=[kl(Je).route.id,{type:fr.error,error:de.pendingError}];else if(de&&de.submission&&xo(de.submission.formMethod)){let Be=await Ue(Xe,se,de.submission,Je,Qe.active,{replace:de.replace,flushSync:at});if(Be.shortCircuited)return;if(Be.pendingActionResult){let[Y,ke]=Be.pendingActionResult;if(ji(ke)&&Xh(ke.error)&&ke.error.status===404){P=null,Se(se,{matches:Be.matches,loaderData:{},errors:{[Y]:ke.error}});return}}Je=Be.matches||Je,ue=Be.pendingActionResult,Ve=x2(se,de.submission),at=!1,Qe.active=!1,Xe=Mc(e.history,Xe.url,Xe.signal)}let{shortCircuited:ye,matches:Oe,loaderData:ct,errors:Ot}=await z(Xe,se,Je,Qe.active,Ve,de&&de.submission,de&&de.fetcherSubmission,de&&de.replace,de&&de.initialHydration===!0,at,ue);ye||(P=null,Se(se,Ar({matches:Oe||Je},lw(ue),{loaderData:ct,errors:Ot})))}async function Ue(Z,se,de,Ae,Ve,Je){Je===void 0&&(Je={}),N();let at=gW(se,de);if(Ge({navigation:at},{flushSync:Je.flushSync===!0}),Ve){let ue=await lr(Ae,se.pathname,Z.signal);if(ue.type==="aborted")return{shortCircuited:!0};if(ue.type==="error"){let ye=kl(ue.partialMatches).route.id;return{matches:ue.partialMatches,pendingActionResult:[ye,{type:fr.error,error:ue.error}]}}else if(ue.matches)Ae=ue.matches;else{let{notFoundMatches:ye,error:Oe,route:ct}=tr(se.pathname);return{matches:ye,pendingActionResult:[ct.id,{type:fr.error,error:Oe}]}}}let Qe,Xe=Jd(Ae,se);if(!Xe.route.action&&!Xe.route.lazy)Qe={type:fr.error,error:yi(405,{method:Z.method,pathname:se.pathname,routeId:Xe.route.id})};else if(Qe=(await He("action",_,Z,[Xe],Ae,null))[Xe.route.id],Z.signal.aborted)return{shortCircuited:!0};if(Ml(Qe)){let ue;return Je&&Je.replace!=null?ue=Je.replace:ue=iw(Qe.response.headers.get("Location"),new URL(Z.url),l,e.history)===_.location.pathname+_.location.search,await Re(Z,Qe,!0,{submission:de,replace:ue}),{shortCircuited:!0}}if(Da(Qe))throw yi(400,{type:"defer-action"});if(ji(Qe)){let ue=kl(Ae,Xe.route.id);return(Je&&Je.replace)!==!0&&(x=Vr.Push),{matches:Ae,pendingActionResult:[ue.route.id,Qe]}}return{matches:Ae,pendingActionResult:[Xe.route.id,Qe]}}async function z(Z,se,de,Ae,Ve,Je,at,Qe,Xe,ue,ye){let Oe=Ve||x2(se,Je),ct=Je||at||dw(Oe),Ot=!M&&(!h.v7_partialHydration||!Xe);if(Ae){if(Ot){let _r=Q(ye);Ge(Ar({navigation:Oe},_r!==void 0?{actionData:_r}:{}),{flushSync:ue})}let $t=await lr(de,se.pathname,Z.signal);if($t.type==="aborted")return{shortCircuited:!0};if($t.type==="error"){let _r=kl($t.partialMatches).route.id;return{matches:$t.partialMatches,loaderData:{},errors:{[_r]:$t.error}}}else if($t.matches)de=$t.matches;else{let{error:_r,notFoundMatches:ha,route:fl}=tr(se.pathname);return{matches:ha,loaderData:{},errors:{[fl.id]:_r}}}}let Be=a||s,[Y,ke]=tw(e.history,_,de,ct,se,h.v7_partialHydration&&Xe===!0,h.v7_skipActionErrorRevalidation,U,$,j,J,_e,re,Be,l,ye);if(lt($t=>!(de&&de.some(_r=>_r.route.id===$t))||Y&&Y.some(_r=>_r.route.id===$t)),ne=++W,Y.length===0&&ke.length===0){let $t=xt();return Se(se,Ar({matches:de,loaderData:{},errors:ye&&ji(ye[1])?{[ye[0]]:ye[1].error}:null},lw(ye),$t?{fetchers:new Map(_.fetchers)}:{}),{flushSync:ue}),{shortCircuited:!0}}if(Ot){let $t={};if(!Ae){$t.navigation=Oe;let _r=Q(ye);_r!==void 0&&($t.actionData=_r)}ke.length>0&&($t.fetchers=ie(ke)),Ge($t,{flushSync:ue})}ke.forEach($t=>{ce($t.key),$t.controller&&q.set($t.key,$t.controller)});let et=()=>ke.forEach($t=>ce($t.key));P&&P.signal.addEventListener("abort",et);let{loaderResults:Gt,fetcherResults:gr}=await dt(_,de,Y,ke,Z);if(Z.signal.aborted)return{shortCircuited:!0};P&&P.signal.removeEventListener("abort",et),ke.forEach($t=>q.delete($t.key));let rr=Ap(Gt);if(rr)return await Re(Z,rr.result,!0,{replace:Qe}),{shortCircuited:!0};if(rr=Ap(gr),rr)return re.add(rr.key),await Re(Z,rr.result,!0,{replace:Qe}),{shortCircuited:!0};let{loaderData:Yr,errors:wn}=sw(_,de,Gt,ye,ke,gr,xe);xe.forEach(($t,_r)=>{$t.subscribe(ha=>{(ha||$t.done)&&xe.delete(_r)})}),h.v7_partialHydration&&Xe&&_.errors&&(wn=Ar({},_.errors,wn));let Kn=xt(),Fo=vt(ne),kr=Kn||Fo||ke.length>0;return Ar({matches:de,loaderData:Yr,errors:wn},kr?{fetchers:new Map(_.fetchers)}:{})}
95function Q(Z){if(Z&&!ji(Z[1]))return{[Z[0]]:Z[1].data};if(_.actionData)return Object.keys(_.actionData).length===0?null:_.actionData}function ie(Z){return Z.forEach(se=>{let de=_.fetchers.get(se.key),Ae=Pd(void 0,de?de.data:void 0);_.fetchers.set(se.key,Ae)}),new Map(_.fetchers)}function te(Z,se,de,Ae){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");ce(Z);let Ve=(Ae&&Ae.flushSync)===!0,Je=a||s,at=z5(_.location,_.matches,l,h.v7_prependBasename,de,h.v7_relativeSplatPath,se,Ae==null?void 0:Ae.relative),Qe=Al(Je,at,l),Xe=Ut(Qe,Je,at);if(Xe.active&&Xe.matches&&(Qe=Xe.matches),!Qe){R(Z,se,yi(404,{pathname:at}),{flushSync:Ve});return}let{path:ue,submission:ye,error:Oe}=Q6(h.v7_normalizeFormMethod,!0,at,Ae);if(Oe){R(Z,se,Oe,{flushSync:Ve});return}let ct=Jd(Qe,ue),Ot=(Ae&&Ae.preventScrollReset)===!0;if(ye&&xo(ye.formMethod)){he(Z,se,ue,ct,Qe,Xe.active,Ve,Ot,ye);return}_e.set(Z,{routeId:se,path:ue}),ve(Z,se,ue,ct,Qe,Xe.active,Ve,Ot,ye)}async function he(Z,se,de,Ae,Ve,Je,at,Qe,Xe){N(),_e.delete(Z);function ue(Lr){if(!Lr.route.action&&!Lr.route.lazy){let fa=yi(405,{method:Xe.formMethod,pathname:de,routeId:se});return R(Z,se,fa,{flushSync:at}),!0}return!1}if(!Je&&ue(Ae))return;let ye=_.fetchers.get(Z);T(Z,vW(Xe,ye),{flushSync:at});let Oe=new AbortController,ct=Mc(e.history,de,Oe.signal,Xe);if(Je){let Lr=await lr(Ve,new URL(ct.url).pathname,ct.signal,Z);if(Lr.type==="aborted")return;if(Lr.type==="error"){R(Z,se,Lr.error,{flushSync:at});return}else if(Lr.matches){if(Ve=Lr.matches,Ae=Jd(Ve,de),ue(Ae))return}else{R(Z,se,yi(404,{pathname:de}),{flushSync:at});return}}q.set(Z,Oe);let Ot=W,Y=(await He("action",_,ct,[Ae],Ve,Z))[Ae.route.id];if(ct.signal.aborted){q.get(Z)===Oe&&q.delete(Z);return}if(h.v7_fetcherPersist&&J.has(Z)){if(Ml(Y)||ji(Y)){T(Z,Ea(void 0));return}}else{if(Ml(Y))if(q.delete(Z),ne>Ot){T(Z,Ea(void 0));return}else return re.add(Z),T(Z,Pd(Xe)),Re(ct,Y,!1,{fetcherSubmission:Xe,preventScrollReset:Qe});if(ji(Y)){R(Z,se,Y.error);return}}if(Da(Y))throw yi(400,{type:"defer-action"});let ke=_.navigation.location||_.location,et=Mc(e.history,ke,Oe.signal),Gt=a||s,gr=_.navigation.state!=="idle"?Al(Gt,_.navigation.location,l):_.matches;It(gr,"Didn't find any matches after fetcher action");let rr=++W;ae.set(Z,rr);let Yr=Pd(Xe,Y.data);_.fetchers.set(Z,Yr);let[wn,Kn]=tw(e.history,_,gr,Xe,ke,!1,h.v7_skipActionErrorRevalidation,U,$,j,J,_e,re,Gt,l,[Ae.route.id,Y]);Kn.filter(Lr=>Lr.key!==Z).forEach(Lr=>{let fa=Lr.key,gp=_.fetchers.get(fa),e2=Pd(void 0,gp?gp.data:void 0);_.fetchers.set(fa,e2),ce(fa),Lr.controller&&q.set(fa,Lr.controller)}),Ge({fetchers:new Map(_.fetchers)});let Fo=()=>Kn.forEach(Lr=>ce(Lr.key));Oe.signal.addEventListener("abort",Fo);let{loaderResults:kr,fetcherResults:$t}=await dt(_,gr,wn,Kn,et);if(Oe.signal.aborted)return;Oe.signal.removeEventListener("abort",Fo),ae.delete(Z),q.delete(Z),Kn.forEach(Lr=>q.delete(Lr.key));let _r=Ap(kr);if(_r)return Re(et,_r.result,!1,{preventScrollReset:Qe});if(_r=Ap($t),_r)return re.add(_r.key),Re(et,_r.result,!1,{preventScrollReset:Qe});let{loaderData:ha,errors:fl}=sw(_,gr,kr,void 0,Kn,$t,xe);if(_.fetchers.has(Z)){let Lr=Ea(Y.data);_.fetchers.set(Z,Lr)}vt(rr),_.navigation.state==="loading"&&rr>ne?(It(x,"Expected pending action"),P&&P.abort(),Se(_.navigation.location,{matches:gr,loaderData:ha,errors:fl,fetchers:new Map(_.fetchers)})):(Ge({errors:fl,loaderData:aw(_.loaderData,ha,gr,fl),fetchers:new Map(_.fetchers)}),U=!1)}async function ve(Z,se,de,Ae,Ve,Je,at,Qe,Xe){let ue=_.fetchers.get(Z);T(Z,Pd(Xe,ue?ue.data:void 0),{flushSync:at});let ye=new AbortController,Oe=Mc(e.history,de,ye.signal);if(Je){let Y=await lr(Ve,new URL(Oe.url).pathname,Oe.signal,Z);if(Y.type==="aborted")return;if(Y.type==="error"){R(Z,se,Y.error,{flushSync:at});return}
95else if(Y.matches)Ve=Y.matches,Ae=Jd(Ve,de);else{R(Z,se,yi(404,{pathname:de}),{flushSync:at});return}}q.set(Z,ye);let ct=W,Be=(await He("loader",_,Oe,[Ae],Ve,Z))[Ae.route.id];if(Da(Be)&&(Be=await pb(Be,Oe.signal,!0)||Be),q.get(Z)===ye&&q.delete(Z),!Oe.signal.aborted){if(J.has(Z)){T(Z,Ea(void 0));return}if(Ml(Be))if(ne>ct){T(Z,Ea(void 0));return}else{re.add(Z),await Re(Oe,Be,!1,{preventScrollReset:Qe});return}if(ji(Be)){R(Z,se,Be.error);return}It(!Da(Be),"Unhandled fetcher deferred data"),T(Z,Ea(Be.data))}}async function Re(Z,se,de,Ae){let{submission:Ve,fetcherSubmission:Je,preventScrollReset:at,replace:Qe}=Ae===void 0?{}:Ae;se.response.headers.has("X-Remix-Revalidate")&&(U=!0);let Xe=se.response.headers.get("Location");It(Xe,"Expected a Location header on the redirect Response"),Xe=iw(Xe,new URL(Z.url),l,e.history);let ue=Zh(_.location,Xe,{_isRedirect:!0});if(r){let Y=!1;if(se.response.headers.has("X-Remix-Reload-Document"))Y=!0;else if(fb.test(Xe)){const ke=e.history.createURL(Xe);Y=ke.origin!==t.location.origin||gc(ke.pathname,l)==null}if(Y){Qe?t.location.replace(Xe):t.location.assign(Xe);return}}P=null;let ye=Qe===!0||se.response.headers.has("X-Remix-Replace")?Vr.Replace:Vr.Push,{formMethod:Oe,formAction:ct,formEncType:Ot}=_.navigation;!Ve&&!Je&&Oe&&ct&&Ot&&(Ve=dw(_.navigation));let Be=Ve||Je;if(Xz.has(se.response.status)&&Be&&xo(Be.formMethod))await Pe(ye,ue,{submission:Ar({},Be,{formAction:Xe}),preventScrollReset:at||C,enableViewTransition:de?I:void 0});else{let Y=x2(ue,Ve);await Pe(ye,ue,{overrideNavigation:Y,fetcherSubmission:Je,preventScrollReset:at||C,enableViewTransition:de?I:void 0})}}async function He(Z,se,de,Ae,Ve,Je){let at,Qe={};try{at=await oW(d,Z,se,de,Ae,Ve,Je,o,i)}catch(Xe){return Ae.forEach(ue=>{Qe[ue.route.id]={type:fr.error,error:Xe}}),Qe}for(let[Xe,ue]of Object.entries(at))if(dW(ue)){let ye=ue.result;Qe[Xe]={type:fr.redirect,response:lW(ye,de,Xe,Ve,l,h.v7_relativeSplatPath)}}else Qe[Xe]=await aW(ue);return Qe}async function dt(Z,se,de,Ae,Ve){let Je=Z.matches,at=He("loader",Z,Ve,de,se,null),Qe=Promise.all(Ae.map(async ye=>{if(ye.matches&&ye.match&&ye.controller){let ct=(await He("loader",Z,Mc(e.history,ye.path,ye.controller.signal),[ye.match],ye.matches,ye.key))[ye.match.route.id];return{[ye.key]:ct}}else return Promise.resolve({[ye.key]:{type:fr.error,error:yi(404,{pathname:ye.path})}})})),Xe=await at,ue=(await Qe).reduce((ye,Oe)=>Object.assign(ye,Oe),{});return await Promise.all([pW(se,Xe,Ve.signal,Je,Z.loaderData),mW(se,ue,Ae)]),{loaderResults:Xe,fetcherResults:ue}}function N(){U=!0,$.push(...lt()),_e.forEach((Z,se)=>{q.has(se)&&j.add(se),ce(se)})}function T(Z,se,de){de===void 0&&(de={}),_.fetchers.set(Z,se),Ge({fetchers:new Map(_.fetchers)},{flushSync:(de&&de.flushSync)===!0})}function R(Z,se,de,Ae){Ae===void 0&&(Ae={});let Ve=kl(_.matches,se);G(Z),Ge({errors:{[Ve.route.id]:de},fetchers:new Map(_.fetchers)},{flushSync:(Ae&&Ae.flushSync)===!0})}function B(Z){return be.set(Z,(be.get(Z)||0)+1),J.has(Z)&&J.delete(Z),_.fetchers.get(Z)||Jz}function G(Z){let se=_.fetchers.get(Z);q.has(Z)&&!(se&&se.state==="loading"&&ae.has(Z))&&ce(Z),_e.delete(Z),ae.delete(Z),re.delete(Z),h.v7_fetcherPersist&&J.delete(Z),j.delete(Z),_.fetchers.delete(Z)}function le(Z){let se=(be.get(Z)||0)-1;se<=0?(be.delete(Z),J.add(Z),h.v7_fetcherPersist||G(Z)):be.set(Z,se),Ge({fetchers:new Map(_.fetchers)})}function ce(Z){let se=q.get(Z);se&&(se.abort(),q.delete(Z))}function Ke(Z){for(let se of Z){let de=B(se),Ae=Ea(de.data);_.fetchers.set(se,Ae)}}function xt(){let Z=[],se=!1;for(let de of re){let Ae=_.fetchers.get(de);It(Ae,"Expected fetcher: "+de),Ae.state==="loading"&&(re.delete(de),Z.push(de),se=!0)}return Ke(Z),se}function vt(Z){let se=[];for(let[de,Ae]of ae)if(Ae<Z){let Ve=_.fetchers.get(de);It(Ve,"Expected fetcher: "+de),Ve.state==="loading"&&(ce(de),ae.delete(de),se.push(de))}return Ke(se),se.length>0}function Rt(Z,se){let de=_.blockers.get(Z)||Id;return Ze.get(Z)!==se&&Ze.set(Z,se),de}function yt(Z){_.blockers.delete(Z),Ze.delete(Z)}function Me(Z,se){let de=_.blockers.get(Z)||Id;It(de.state==="unblocked"&&se.state==="blocked"||de.state==="blocked"&&se.state==="blocked"||de.state==="blocked"&&se.state==="proceeding"||de.state==="blocked"&&se.state==="unblocked"||de.state==="proceeding"&&se.state==="unblocked","Invalid blocker state transition: "+de.state+" -> "+se.state);let Ae=new Map(_.blockers);Ae.set(Z,se),Ge({blockers:Ae})}function it(Z){let{currentLocation:se,nextLocation:de,historyAction:Ae}=Z;if(Ze.size===0)return;Ze.size>1&&ic(!1,"A router only supports one blocker at a time");let Ve=Array.from(Ze.entries()),[Je,at]=Ve[Ve.length-1],Qe=_.blockers.get(Je);if(!(Qe&&Qe.state==="proceeding")&&at({currentLocation:se,nextLocation:de,historyAction:Ae}))return Je}function tr(Z){let se=yi(404,{pathname:Z}),de=a||s,{matches:Ae,route:Ve}=cw(de);return lt(),{notFoundMatches:Ae,route:Ve,error:se}}function lt(Z){let se=[];return xe.forEach((de,Ae)=>{(!Z||Z(Ae))&&(de.cancel(),se.push(Ae),xe.delete(Ae))}),se}
95function Ct(Z,se,de){if(m=Z,y=se,g=de||null,!b&&_.navigation===b2){b=!0;let Ae=ur(_.location,_.matches);Ae!=null&&Ge({restoreScrollPosition:Ae})}return()=>{m=null,y=null,g=null}}function Zt(Z,se){return g&&g(Z,se.map(Ae=>DA(Ae,_.loaderData)))||Z.key}function pt(Z,se){if(m&&y){let de=Zt(Z,se);m[de]=y()}}function ur(Z,se){if(m){let de=Zt(Z,se),Ae=m[de];if(typeof Ae=="number")return Ae}return null}function Ut(Z,se,de){if(u)if(Z){if(Object.keys(Z[0].params).length>0)return{active:!0,matches:E0(se,de,l,!0)}}else return{active:!0,matches:E0(se,de,l,!0)||[]};return{active:!1,matches:null}}async function lr(Z,se,de,Ae){if(!u)return{type:"success",matches:Z};let Ve=Z;for(;;){let Je=a==null,at=a||s,Qe=o;try{await u({signal:de,path:se,matches:Ve,fetcherKey:Ae,patch:(ye,Oe)=>{de.aborted||nw(ye,Oe,at,Qe,i)}})}catch(ye){return{type:"error",error:ye,partialMatches:Ve}}finally{Je&&!de.aborted&&(s=[...s])}if(de.aborted)return{type:"aborted"};let Xe=Al(at,se,l);if(Xe)return{type:"success",matches:Xe};let ue=E0(at,se,l,!0);if(!ue||Ve.length===ue.length&&Ve.every((ye,Oe)=>ye.route.id===ue[Oe].route.id))return{type:"success",matches:null};Ve=ue}}function Ln(Z){o={},a=w1(Z,i,void 0,o)}function yr(Z,se){let de=a==null;nw(Z,se,a||s,o,i),de&&(s=[...s],Ge({}))}return w={get basename(){return l},get future(){return h},get state(){return _},get routes(){return s},get window(){return t},initialize:Le,subscribe:ft,enableScrollRestoration:Ct,navigate:je,fetch:te,revalidate:Ce,createHref:Z=>e.history.createHref(Z),encodeLocation:Z=>e.history.encodeLocation(Z),getFetcher:B,deleteFetcher:le,dispose:Fe,getBlocker:Rt,deleteBlocker:yt,patchRoutes:yr,_internalFetchControllers:q,_internalActiveDeferreds:xe,_internalSetRoutes:Ln},w}function tW(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function z5(e,t,r,n,i,o,s,a){let l,d;if(s){l=[];for(let h of t)if(l.push(h),h.route.id===s){d=h;break}}else l=t,d=t[t.length-1];let u=Qm(i||".",Jm(l,o),gc(e.pathname,r)||e.pathname,a==="path");if(i==null&&(u.search=e.search,u.hash=e.hash),(i==null||i===""||i===".")&&d){let h=mb(u.search);if(d.route.index&&!h)u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&h){let f=new URLSearchParams(u.search),p=f.getAll("index");f.delete("index"),p.filter(g=>g).forEach(g=>f.append("index",g));let m=f.toString();u.search=m?"?"+m:""}}return n&&r!=="/"&&(u.pathname=u.pathname==="/"?r:Vs([r,u.pathname])),oc(u)}function Q6(e,t,r,n){if(!n||!tW(n))return{path:r};if(n.formMethod&&!fW(n.formMethod))return{path:r,error:yi(405,{method:n.formMethod})};let i=()=>({path:r,error:yi(400,{type:"invalid-body"})}),o=n.formMethod||"get",s=e?o.toUpperCase():o.toLowerCase(),a=zA(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!xo(s))return i();let f=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((p,m)=>{let[g,y]=m;return""+p+g+"="+y+` 96`},""):String(n.body);return{path:r,submission:{formMethod:s,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:f}}}else if(n.formEncType==="application/json"){if(!xo(s))return i();try{let f=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:s,formAction:a,formEncType:n.formEncType,formData:void 0,json:f,text:void 0}}}catch{return i()}}}It(typeof FormData=="function","FormData is not available in this environment");let l,d;if(n.formData)l=q5(n.formData),d=n.formData;else if(n.body instanceof FormData)l=q5(n.body),d=n.body;else if(n.body instanceof URLSearchParams)l=n.body,d=ow(l);else if(n.body==null)l=new URLSearchParams,d=new FormData;else try{l=new URLSearchParams(n.body),d=ow(l)}catch{return i()}let u={formMethod:s,formAction:a,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:d,json:void 0,text:void 0};if(xo(u.formMethod))return{path:r,submission:u};let h=sa(r);return t&&h.search&&mb(h.search)&&l.append("index",""),h.search="?"+l,{path:oc(h),submission:u}}function ew(e,t,r){r===void 0&&(r=!1);let n=e.findIndex(i=>i.route.id===t);return n>=0?e.slice(0,r?n+1:n):e}function tw(e,t,r,n,i,o,s,a,l,d,u,h,f,p,m,g){let y=g?ji(g[1])?g[1].error:g[1].data:void 0,b=e.createURL(t.location),E=e.createURL(i),S=r;o&&t.errors?S=ew(r,Object.keys(t.errors)[0],!0):g&&ji(g[1])&&(S=ew(r,g[0]));let k=g?g[1].statusCode:void 0,A=s&&k&&k>=400,w=S.filter((x,C)=>{let{route:P}=x;if(P.lazy)return!0;
96if(P.loader==null)return!1;if(o)return W5(P,t.loaderData,t.errors);if(rW(t.loaderData,t.matches[C],x)||l.some(D=>D===x.route.id))return!0;let I=t.matches[C],O=x;return rw(x,Ar({currentUrl:b,currentParams:I.params,nextUrl:E,nextParams:O.params},n,{actionResult:y,actionStatus:k,defaultShouldRevalidate:A?!1:a||b.pathname+b.search===E.pathname+E.search||b.search!==E.search||VA(I,O)}))}),_=[];return h.forEach((x,C)=>{if(o||!r.some(M=>M.route.id===x.routeId)||u.has(C))return;let P=Al(p,x.path,m);if(!P){_.push({key:C,routeId:x.routeId,path:x.path,matches:null,match:null,controller:null});return}let I=t.fetchers.get(C),O=Jd(P,x.path),D=!1;f.has(C)?D=!1:d.has(C)?(d.delete(C),D=!0):I&&I.state!=="idle"&&I.data===void 0?D=a:D=rw(O,Ar({currentUrl:b,currentParams:t.matches[t.matches.length-1].params,nextUrl:E,nextParams:r[r.length-1].params},n,{actionResult:y,actionStatus:k,defaultShouldRevalidate:A?!1:a})),D&&_.push({key:C,routeId:x.routeId,path:x.path,matches:P,match:O,controller:new AbortController})}),[w,_]}function W5(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;let n=t!=null&&t[e.id]!==void 0,i=r!=null&&r[e.id]!==void 0;return!n&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!n&&!i}function rW(e,t,r){let n=!t||r.route.id!==t.route.id,i=e[r.route.id]===void 0;return n||i}function VA(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function rw(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function nw(e,t,r,n,i){var o;let s;if(e){let d=n[e];It(d,"No route found to patch children into: routeId = "+e),d.children||(d.children=[]),s=d.children}else s=r;let a=t.filter(d=>!s.some(u=>HA(d,u))),l=w1(a,i,[e||"_","patch",String(((o=s)==null?void 0:o.length)||"0")],n);s.push(...l)}function HA(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((r,n)=>{var i;return(i=t.children)==null?void 0:i.some(o=>HA(r,o))}):!1}async function nW(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let i=r[e.id];It(i,"No route found in manifest");let o={};for(let s in n){let l=i[s]!==void 0&&s!=="hasErrorBoundary";ic(!l,'Route "'+i.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!l&&!Az.has(s)&&(o[s]=n[s])}Object.assign(i,o),Object.assign(i,Ar({},t(i),{lazy:void 0}))}async function iW(e){let{matches:t}=e,r=t.filter(i=>i.shouldLoad);return(await Promise.all(r.map(i=>i.resolve()))).reduce((i,o,s)=>Object.assign(i,{[r[s].route.id]:o}),{})}async function oW(e,t,r,n,i,o,s,a,l,d){let u=o.map(p=>p.route.lazy?nW(p.route,l,a):void 0),h=o.map((p,m)=>{let g=u[m],y=i.some(E=>E.route.id===p.route.id);return Ar({},p,{shouldLoad:y,resolve:async E=>(E&&n.method==="GET"&&(p.route.lazy||p.route.loader)&&(y=!0),y?sW(t,n,p,g,E,d):Promise.resolve({type:fr.data,result:void 0}))})}),f=await e({matches:h,request:n,params:o[0].params,fetcherKey:s,context:d});try{await Promise.all(u)}catch{}return f}async function sW(e,t,r,n,i,o){let s,a,l=d=>{let u,h=new Promise((m,g)=>u=g);a=()=>u(),t.signal.addEventListener("abort",a);let f=m=>typeof d!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+r.route.id+"]"))):d({request:t,params:r.params,context:o},...m!==void 0?[m]:[]),p=(async()=>{try{return{type:"data",result:await(i?i(g=>f(g)):f())}}catch(m){return{type:"error",result:m}}})();return Promise.race([p,h])};try{let d=r.route[e];if(n)if(d){let u,[h]=await Promise.all([l(d).catch(f=>{u=f}),n]);if(u!==void 0)throw u;s=h}else if(await n,d=r.route[e],d)s=await l(d);else if(e==="action"){let u=new URL(t.url),h=u.pathname+u.search;throw yi(405,{method:t.method,pathname:h,routeId:r.route.id})}else return{type:fr.data,result:void 0};else if(d)s=await l(d);else{let u=new URL(t.url),h=u.pathname+u.search;throw yi(404,{pathname:h})}It(s.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(d){return{type:fr.error,result:d}}finally{a&&t.signal.removeEventListener("abort",a)}return s}async function aW(e){let{result:t,type:r}=e;if(WA(t)){let h;try{let f=t.headers.get("Content-Type");f&&/\bapplication\/json\b/.test(f)?t.body==null?h=null:h=await t.json():h=await t.text()}catch(f){return{type:fr.error,error:f}}return r===fr.error?{type:fr.error,error:new E1(t.status,t.statusText,h),statusCode:t.status,headers:t.headers}:{type:fr.data,data:h,statusCode:t.status,headers:t.headers}}if(r===fr.error){if(uw(t)){var n,i;if(t.data instanceof Error){var o,s;return{type:fr.error,error:t.data,statusCode:(o=t.init)==null?void 0:o.status,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}}return{type:fr.error,error:new E1(((n=t.init)==null?void 0:n.status)||500,void 0,t.data),statusCode:Xh(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}}return{type:fr.error,error:t,statusCode:Xh(t)?t.status:void 0}}if(hW(t)){var a,l;return{type:fr.deferred,deferredData:t,statusCode:(a=t.init)==null?void 0:a.status,headers:((l=t.init)==null?void 0:l.headers)&&new Headers(t.init.headers)}}if(uw(t)){var d,u;return{type:fr.data,data:t.data,statusCode:(d=t.init)==null?void 0:d.status,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}}return{type:fr.data,data:t}}function lW(e,t,r,n,i,o){let s=e.headers.get("Location");if(It(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!fb.test(s)){let a=n.slice(0,n.findIndex(l=>l.route.id===r)+1);s=z5(new URL(t.url),a,i,!0,s,o),e.headers.set("Location",s)}return e}function iw(e,t,r,n){let i=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(fb.test(e)){let o=e,s=o.startsWith("//")?new URL(t.protocol+o):new URL(o);if(i.includes(s.protocol))throw new Error("Invalid redirect location");let a=gc(s.pathname,r)!=null;if(s.origin===t.origin&&a)return s.pathname+s.search+s.hash}try{let o=n.createURL(e);if(i.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Mc(e,t,r,n){let i=e.createURL(zA(t)).toString(),o={signal:r};if(n&&xo(n.formMethod)){let{formMethod:s,formEncType:a}=n;o.method=s.toUpperCase(),a==="application/json"?(o.headers=new Headers({"Content-Type":a}),o.body=JSON.stringify(n.json)):a==="text/plain"?o.body=n.text:a==="application/x-www-form-urlencoded"&&n.formData?o.body=q5(n.formData):o.body=n.formData}
96return new Request(i,o)}function q5(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function ow(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function cW(e,t,r,n,i){let o={},s=null,a,l=!1,d={},u=r&&ji(r[1])?r[1].error:void 0;return e.forEach(h=>{if(!(h.route.id in t))return;let f=h.route.id,p=t[f];if(It(!Ml(p),"Cannot handle redirect results in processLoaderData"),ji(p)){let m=p.error;if(u!==void 0&&(m=u,u=void 0),s=s||{},i)s[f]=m;else{let g=kl(e,f);s[g.route.id]==null&&(s[g.route.id]=m)}o[f]=void 0,l||(l=!0,a=Xh(p.error)?p.error.status:500),p.headers&&(d[f]=p.headers)}else Da(p)?(n.set(f,p.deferredData),o[f]=p.deferredData.data,p.statusCode!=null&&p.statusCode!==200&&!l&&(a=p.statusCode),p.headers&&(d[f]=p.headers)):(o[f]=p.data,p.statusCode&&p.statusCode!==200&&!l&&(a=p.statusCode),p.headers&&(d[f]=p.headers))}),u!==void 0&&r&&(s={[r[0]]:u},o[r[0]]=void 0),{loaderData:o,errors:s,statusCode:a||200,loaderHeaders:d}}function sw(e,t,r,n,i,o,s){let{loaderData:a,errors:l}=cW(t,r,n,s,!1);return i.forEach(d=>{let{key:u,match:h,controller:f}=d,p=o[u];if(It(p,"Did not find corresponding fetcher result"),!(f&&f.signal.aborted))if(ji(p)){let m=kl(e.matches,h==null?void 0:h.route.id);l&&l[m.route.id]||(l=Ar({},l,{[m.route.id]:p.error})),e.fetchers.delete(u)}else if(Ml(p))It(!1,"Unhandled fetcher revalidation redirect");else if(Da(p))It(!1,"Unhandled fetcher deferred data");else{let m=Ea(p.data);e.fetchers.set(u,m)}}),{loaderData:a,errors:l}}function aw(e,t,r,n){let i=Ar({},t);for(let o of r){let s=o.route.id;if(t.hasOwnProperty(s)?t[s]!==void 0&&(i[s]=t[s]):e[s]!==void 0&&o.route.loader&&(i[s]=e[s]),n&&n.hasOwnProperty(s))break}return i}function lw(e){return e?ji(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function kl(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function cw(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function yi(e,t){let{pathname:r,routeId:n,method:i,type:o,message:s}=t===void 0?{}:t,a="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(a="Bad Request",i&&r&&n?l="You made a "+i+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":o==="defer-action"?l="defer() is not supported in actions":o==="invalid-body"&&(l="Unable to encode submission body")):e===403?(a="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):e===404?(a="Not Found",l='No route matches URL "'+r+'"'):e===405&&(a="Method Not Allowed",i&&r&&n?l="You made a "+i.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":i&&(l='Invalid request method "'+i.toUpperCase()+'"')),new E1(e||500,a,new Error(l),!0)}function Ap(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[n,i]=t[r];if(Ml(i))return{key:n,result:i}}}function zA(e){let t=typeof e=="string"?sa(e):e;return oc(Ar({},t,{hash:""}))}function uW(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function dW(e){return WA(e.result)&&Zz.has(e.result.status)}function Da(e){return e.type===fr.deferred}function ji(e){return e.type===fr.error}function Ml(e){return(e&&e.type)===fr.redirect}function uw(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function hW(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function WA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function fW(e){return Yz.has(e.toLowerCase())}function xo(e){return Gz.has(e.toLowerCase())}async function pW(e,t,r,n,i){let o=Object.entries(t);for(let s=0;s<o.length;s++){let[a,l]=o[s],d=e.find(f=>(f==null?void 0:f.route.id)===a);if(!d)continue;let u=n.find(f=>f.route.id===d.route.id),h=u!=null&&!VA(u,d)&&(i&&i[d.route.id])!==void 0;Da(l)&&h&&await pb(l,r,!1).then(f=>{f&&(t[a]=f)})}}async function mW(e,t,r){for(let n=0;n<r.length;n++){let{key:i,routeId:o,controller:s}=r[n],a=t[i];e.find(d=>(d==null?void 0:d.route.id)===o)&&Da(a)&&(It(s,"Expected an AbortController for revalidating fetcher deferred result"),await pb(a,s.signal,!0).then(d=>{d&&(t[i]=d)}))}}async function pb(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:fr.data,data:e.deferredData.unwrappedData}
96}catch(i){return{type:fr.error,error:i}}return{type:fr.data,data:e.deferredData.data}}}function mb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Jd(e,t){let r=typeof t=="string"?sa(t).search:t.search;if(e[e.length-1].route.index&&mb(r||""))return e[e.length-1];let n=FA(e);return n[n.length-1]}function dw(e){let{formMethod:t,formAction:r,formEncType:n,text:i,formData:o,json:s}=e;if(!(!t||!r||!n)){if(i!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:i};if(o!=null)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};if(s!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:s,text:void 0}}}function x2(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function gW(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Pd(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function vW(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Ea(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function yW(e,t){try{let r=e.sessionStorage.getItem(BA);if(r){let n=JSON.parse(r);for(let[i,o]of Object.entries(n||{}))o&&Array.isArray(o)&&t.set(i,new Set(o||[]))}}catch{}}function _W(e,t){if(t.size>0){let r={};for(let[n,i]of t)r[n]=[...i];try{e.sessionStorage.setItem(BA,JSON.stringify(r))}catch(n){ic(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/** 97 * React Router v6.30.3 98 * 99 * Copyright (c) Remix Software Inc. 100 * 101 * This source code is licensed under the MIT license found in the 102 * LICENSE.md file in the root directory of this source tree. 103 * 104 * @license MIT 105 */function Jh(){return Jh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jh.apply(this,arguments)}const $f=v.createContext(null),gb=v.createContext(null),aa=v.createContext(null),eg=v.createContext(null),xs=v.createContext({outlet:null,matches:[],isDataRoute:!1}),qA=v.createContext(null);function bW(e,t){let{relative:r}=t===void 0?{}:t;td()||It(!1);let{basename:n,navigator:i}=v.useContext(aa),{hash:o,pathname:s,search:a}=KA(e,{relative:r}),l=s;return n!=="/"&&(l=s==="/"?n:Vs([n,s])),i.createHref({pathname:l,search:a,hash:o})}function td(){return v.useContext(eg)!=null}function sn(){return td()||It(!1),v.useContext(eg).location}function GA(e){v.useContext(aa).static||v.useLayoutEffect(e)}function At(){let{isDataRoute:e}=v.useContext(xs);return e?$W():xW()}function xW(){td()||It(!1);let e=v.useContext($f),{basename:t,future:r,navigator:n}=v.useContext(aa),{matches:i}=v.useContext(xs),{pathname:o}=sn(),s=JSON.stringify(Jm(i,r.v7_relativeSplatPath)),a=v.useRef(!1);return GA(()=>{a.current=!0}),v.useCallback(function(d,u){if(u===void 0&&(u={}),!a.current)return;if(typeof d=="number"){n.go(d);return}let h=Qm(d,JSON.parse(s),o,u.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Vs([t,h.pathname])),(u.replace?n.replace:n.push)(h,u.state,u)},[t,n,s,o,e])}const wW=v.createContext(null);function EW(e){let t=v.useContext(xs).outlet;return t&&v.createElement(wW.Provider,{value:e},t)}function m7e(){let{matches:e}=v.useContext(xs),t=e[e.length-1];return t?t.params:{}}function KA(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=v.useContext(aa),{matches:i}=v.useContext(xs),{pathname:o}=sn(),s=JSON.stringify(Jm(i,n.v7_relativeSplatPath));return v.useMemo(()=>Qm(e,JSON.parse(s),o,r==="path"),[e,s,o,r])}function SW(e,t){return YA(e,t)}function YA(e,t,r,n){td()||It(!1);let{navigator:i}=v.useContext(aa),{matches:o}=v.useContext(xs),s=o[o.length-1],a=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let d=sn(),u;if(t){var h;let y=typeof t=="string"?sa(t):t;l==="/"||(h=y.pathname)!=null&&h.startsWith(l)||It(!1),u=y}else u=d;let f=u.pathname||"/",p=f;if(l!=="/"){let y=l.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(y.length).join("/")}let m=Al(e,{pathname:p}),g=RW(m&&m.map(y=>Object.assign({},y,{params:Object.assign({},a,y.params),pathname:Vs([l,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:Vs([l,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),o,r,n);return t&&g?v.createElement(eg.Provider,{value:{location:Jh({pathname:"/",search:"",hash:"",state:null,key:"default"}
105,u),navigationType:Vr.Pop}},g):g}function CW(){let e=LW(),t=Xh(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),r?v.createElement("pre",{style:i},r):null,null)}const TW=v.createElement(CW,null);class AW extends v.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?v.createElement(xs.Provider,{value:this.props.routeContext},v.createElement(qA.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function kW(e){let{routeContext:t,match:r,children:n}=e,i=v.useContext($f);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),v.createElement(xs.Provider,{value:t},n)}function RW(e,t,r,n){var i;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var o;if(!r)return null;if(r.errors)e=r.matches;else if((o=n)!=null&&o.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let s=e,a=(i=r)==null?void 0:i.errors;if(a!=null){let u=s.findIndex(h=>h.route.id&&(a==null?void 0:a[h.route.id])!==void 0);u>=0||It(!1),s=s.slice(0,Math.min(s.length,u+1))}let l=!1,d=-1;if(r&&n&&n.v7_partialHydration)for(let u=0;u<s.length;u++){let h=s[u];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(d=u),h.route.id){let{loaderData:f,errors:p}=r,m=h.route.loader&&f[h.route.id]===void 0&&(!p||p[h.route.id]===void 0);if(h.route.lazy||m){l=!0,d>=0?s=s.slice(0,d+1):s=[s[0]];break}}}return s.reduceRight((u,h,f)=>{let p,m=!1,g=null,y=null;r&&(p=a&&h.route.id?a[h.route.id]:void 0,g=h.route.errorElement||TW,l&&(d<0&&f===0?(DW("route-fallback",!1),m=!0,y=null):d===f&&(m=!0,y=h.route.hydrateFallbackElement||null)));let b=t.concat(s.slice(0,f+1)),E=()=>{let S;return p?S=g:m?S=y:h.route.Component?S=v.createElement(h.route.Component,null):h.route.element?S=h.route.element:S=u,v.createElement(kW,{match:h,routeContext:{outlet:u,matches:b,isDataRoute:r!=null},children:S})};return r&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?v.createElement(AW,{location:r.location,revalidation:r.revalidation,component:g,error:p,children:E(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):E()},null)}var ZA=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(ZA||{}),Pu=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Pu||{});function IW(e){let t=v.useContext($f);return t||It(!1),t}function vb(e){let t=v.useContext(gb);return t||It(!1),t}function PW(e){let t=v.useContext(xs);return t||It(!1),t}function XA(e){let t=PW(),r=t.matches[t.matches.length-1];return r.route.id||It(!1),r.route.id}function OW(){return vb(Pu.UseNavigation).navigation}function jW(){let{matches:e,loaderData:t}=vb(Pu.UseMatches);return v.useMemo(()=>e.map(r=>DA(r,t)),[e,t])}function LW(){var e;let t=v.useContext(qA),r=vb(Pu.UseRouteError),n=XA(Pu.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function $W(){let{router:e}=IW(ZA.UseNavigateStable),t=XA(Pu.UseNavigateStable),r=v.useRef(!1);return GA(()=>{r.current=!0}),v.useCallback(function(i,o){o===void 0&&(o={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Jh({fromRouteId:t},o)))},[e,t])}const hw={};function DW(e,t,r){!t&&!hw[e]&&(hw[e]=!0)}function MW(e,t){e==null||e.v7_startTransition,(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function Hs(e){let{to:t,replace:r,state:n,relative:i}=e;td()||It(!1);let{future:o,static:s}=v.useContext(aa),{matches:a}=v.useContext(xs),{pathname:l}=sn(),d=At(),u=Qm(t,Jm(a,o.v7_relativeSplatPath),l,i==="path"),h=JSON.stringify(u);return v.useEffect(()=>d(JSON.parse(h),{replace:r,state:n,relative:i}),[d,h,i,r,n]),null}function rd(e){return EW(e.context)}function K(e){It(!1)}function NW(e){let{basename:t="/",children:r=null,location:n,navigationType:i=Vr.Pop,navigator:o,static:s=!1,future:a}=e;td()&&It(!1);let l=t.replace(/^\/*/,"/"),d=v.useMemo(()=>({basename:l,navigator:o,static:s,future:Jh({v7_relativeSplatPath:!1},a)}),[l,a,o,s]);typeof n=="string"&&(n=sa(n));
105let{pathname:u="/",search:h="",hash:f="",state:p=null,key:m="default"}=n,g=v.useMemo(()=>{let y=gc(u,l);return y==null?null:{location:{pathname:y,search:h,hash:f,state:p,key:m},navigationType:i}},[l,u,h,f,p,m,i]);return g==null?null:v.createElement(aa.Provider,{value:d},v.createElement(eg.Provider,{children:r,value:g}))}function yb(e){let{children:t,location:r}=e;return SW(S1(t),r)}new Promise(()=>{});function S1(e,t){t===void 0&&(t=[]);let r=[];return v.Children.forEach(e,(n,i)=>{if(!v.isValidElement(n))return;let o=[...t,i];if(n.type===v.Fragment){r.push.apply(r,S1(n.props.children,o));return}n.type!==K&&It(!1),!n.props.index||!n.props.children||It(!1);let s={id:n.props.id||o.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(s.children=S1(n.props.children,o)),r.push(s)}),r}function FW(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:v.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:v.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:v.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** 106 * React Router DOM v6.30.3 107 * 108 * Copyright (c) Remix Software Inc. 109 * 110 * This source code is licensed under the MIT license found in the 111 * LICENSE.md file in the root directory of this source tree. 112 * 113 * @license MIT 114 */function Ou(){return Ou=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ou.apply(this,arguments)}function UW(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,o;for(o=0;o<n.length;o++)i=n[o],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function BW(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function VW(e,t){return e.button===0&&(!t||t==="_self")&&!BW(e)}function G5(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(i=>[r,i]):[[r,n]])},[]))}function HW(e,t){let r=G5(e);return t&&t.forEach((n,i)=>{r.has(i)||t.getAll(i).forEach(o=>{r.append(i,o)})}),r}const zW=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],WW="6";try{window.__reactRouterVersion=WW}catch{}function qW(e,t){return eW({basename:t==null?void 0:t.basename,future:Ou({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:Sz({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||GW(),routes:e,mapRouteProperties:FW,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function GW(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Ou({},t,{errors:KW(t.errors)})),t}function KW(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,i]of t)if(i&&i.__type==="RouteErrorResponse")r[n]=new E1(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let o=window[i.__subType];if(typeof o=="function")try{let s=new o(i.message);s.stack="",r[n]=s}catch{}}if(r[n]==null){let o=new Error(i.message);o.stack="",r[n]=o}}else r[n]=i;return r}const YW=v.createContext({isTransitioning:!1}),ZW=v.createContext(new Map),XW="startTransition",fw=BD[XW],JW="flushSync",pw=VD[JW];function QW(e){fw?fw(e):e()}function Od(e){pw?pw(e):e()}class eq{constructor(){this.status="pending",this.promise=new Promise((t,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function tq(e){let{fallbackElement:t,router:r,future:n}=e,[i,o]=v.useState(r.state),[s,a]=v.useState(),[l,d]=v.useState({isTransitioning:!1}),[u,h]=v.useState(),[f,p]=v.useState(),[m,g]=v.useState(),y=v.useRef(new Map),{v7_startTransition:b}=n||{},E=v.useCallback(x=>{b?QW(x):x()},[b]),S=v.useCallback((x,C)=>{let{deletedFetchers:P,flushSync:I,viewTransitionOpts:O}=C;
114x.fetchers.forEach((M,U)=>{M.data!==void 0&&y.current.set(U,M.data)}),P.forEach(M=>y.current.delete(M));let D=r.window==null||r.window.document==null||typeof r.window.document.startViewTransition!="function";if(!O||D){I?Od(()=>o(x)):E(()=>o(x));return}if(I){Od(()=>{f&&(u&&u.resolve(),f.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:O.currentLocation,nextLocation:O.nextLocation})});let M=r.window.document.startViewTransition(()=>{Od(()=>o(x))});M.finished.finally(()=>{Od(()=>{h(void 0),p(void 0),a(void 0),d({isTransitioning:!1})})}),Od(()=>p(M));return}f?(u&&u.resolve(),f.skipTransition(),g({state:x,currentLocation:O.currentLocation,nextLocation:O.nextLocation})):(a(x),d({isTransitioning:!0,flushSync:!1,currentLocation:O.currentLocation,nextLocation:O.nextLocation}))},[r.window,f,u,y,E]);v.useLayoutEffect(()=>r.subscribe(S),[r,S]),v.useEffect(()=>{l.isTransitioning&&!l.flushSync&&h(new eq)},[l]),v.useEffect(()=>{if(u&&s&&r.window){let x=s,C=u.promise,P=r.window.document.startViewTransition(async()=>{E(()=>o(x)),await C});P.finished.finally(()=>{h(void 0),p(void 0),a(void 0),d({isTransitioning:!1})}),p(P)}},[E,s,u,r.window]),v.useEffect(()=>{u&&s&&i.location.key===s.location.key&&u.resolve()},[u,f,i.location,s]),v.useEffect(()=>{!l.isTransitioning&&m&&(a(m.state),d({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),g(void 0))},[l.isTransitioning,m]),v.useEffect(()=>{},[]);let k=v.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:x=>r.navigate(x),push:(x,C,P)=>r.navigate(x,{state:C,preventScrollReset:P==null?void 0:P.preventScrollReset}),replace:(x,C,P)=>r.navigate(x,{replace:!0,state:C,preventScrollReset:P==null?void 0:P.preventScrollReset})}),[r]),A=r.basename||"/",w=v.useMemo(()=>({router:r,navigator:k,static:!1,basename:A}),[r,k,A]),_=v.useMemo(()=>({v7_relativeSplatPath:r.future.v7_relativeSplatPath}),[r.future.v7_relativeSplatPath]);return v.useEffect(()=>MW(n,r.future),[n,r.future]),v.createElement(v.Fragment,null,v.createElement($f.Provider,{value:w},v.createElement(gb.Provider,{value:i},v.createElement(ZW.Provider,{value:y.current},v.createElement(YW.Provider,{value:l},v.createElement(NW,{basename:A,location:i.location,navigationType:i.historyAction,navigator:k,future:_},i.initialized||r.future.v7_partialHydration?v.createElement(rq,{routes:r.routes,future:r.future,state:i}):t))))),null)}const rq=v.memo(nq);function nq(e){let{routes:t,future:r,state:n}=e;return YA(t,void 0,n,r)}const iq=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",oq=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,w2=v.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:o,replace:s,state:a,target:l,to:d,preventScrollReset:u,viewTransition:h}=t,f=UW(t,zW),{basename:p}=v.useContext(aa),m,g=!1;if(typeof d=="string"&&oq.test(d)&&(m=d,iq))try{let S=new URL(window.location.href),k=d.startsWith("//")?new URL(S.protocol+d):new URL(d),A=gc(k.pathname,p);k.origin===S.origin&&A!=null?d=A+k.search+k.hash:g=!0}catch{}let y=bW(d,{relative:i}),b=cq(d,{replace:s,state:a,target:l,preventScrollReset:u,relative:i,viewTransition:h});function E(S){n&&n(S),S.defaultPrevented||b(S)}return v.createElement("a",Ou({},f,{href:m||y,onClick:g||o?n:E,ref:r,target:l}))});function sq(e){let{getKey:t,storageKey:r}=e;return uq({getKey:t,storageKey:r}),null}var K5;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(K5||(K5={}));var Y5;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Y5||(Y5={}));function aq(e){let t=v.useContext($f);return t||It(!1),t}function lq(e){let t=v.useContext(gb);return t||It(!1),t}function cq(e,t){let{target:r,replace:n,state:i,preventScrollReset:o,relative:s,viewTransition:a}=t===void 0?{}:t,l=At(),d=sn(),u=KA(e,{relative:s});return v.useCallback(h=>{if(VW(h,r)){h.preventDefault();let f=n!==void 0?n:oc(d)===oc(u);l(e,{replace:f,state:i,preventScrollReset:o,relative:s,viewTransition:a})}},[d,l,u,n,i,r,e,o,s,a])}function ws(e){let t=v.useRef(G5(e)),r=v.useRef(!1),n=sn(),i=v.useMemo(()=>HW(n.search,r.current?null:t.current),[n.search]),o=At(),s=v.useCallback((a,l)=>{const d=G5(typeof a=="function"?a(i):a);r.current=!0,o("?"+d,l)},[o,i]);return[i,s]}const mw="react-router-scroll-positions";let kp={};function uq(e){let{getKey:t,storageKey:r}=e===void 0?{}:e,{router:n}=aq(K5.UseScrollRestoration),{restoreScrollPosition:i,preventScrollReset:o}=lq(Y5.UseScrollRestoration),{basename:s}=v.useContext(aa),a=sn(),l=jW(),d=OW();v.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),dq(v.useCallback(()=>
114{if(d.state==="idle"){let u=(t?t(a,l):null)||a.key;kp[u]=window.scrollY}try{sessionStorage.setItem(r||mw,JSON.stringify(kp))}catch{}window.history.scrollRestoration="auto"},[r,t,d.state,a,l])),typeof document<"u"&&(v.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(r||mw);u&&(kp=JSON.parse(u))}catch{}},[r]),v.useLayoutEffect(()=>{let u=t&&s!=="/"?(f,p)=>t(Ou({},f,{pathname:gc(f.pathname,s)||f.pathname}),p):t,h=n==null?void 0:n.enableScrollRestoration(kp,()=>window.scrollY,u);return()=>h&&h()},[n,s,t]),v.useLayoutEffect(()=>{if(i!==!1){if(typeof i=="number"){window.scrollTo(0,i);return}if(a.hash){let u=document.getElementById(decodeURIComponent(a.hash.slice(1)));if(u){u.scrollIntoView();return}}o!==!0&&window.scrollTo(0,0)}},[a,i,o]))}function dq(e,t){let{capture:r}=t||{};v.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,n),()=>{window.removeEventListener("pagehide",e,n)}},[e,r])}const sc=Kr("App",{web:()=>X(()=>import("./web-BbG_hMVU.js"),__vite__mapDeps([9,1,2,3,4,5,6])).then(e=>new e.AppWeb)});var gw;(function(e){e[e.Min=1]="Min",e[e.Low=2]="Low",e[e.Default=3]="Default",e[e.High=4]="High",e[e.Max=5]="Max"})(gw||(gw={}));var vw;(function(e){e[e.Secret=-1]="Secret",e[e.Private=0]="Private",e[e.Public=1]="Public"})(vw||(vw={}));const Ps=Kr("FirebaseMessaging",{web:()=>X(()=>import("./web-BPQLDUxY.js"),__vite__mapDeps([10,1,2,3,4,5,6])).then(e=>new e.FirebaseMessagingWeb)}),ph=()=>qe.isNativePlatform()&&qe.isPluginAvailable("FirebaseMessaging"),Z5=e=>({granted:e==="granted",canRequest:e==="prompt"||e==="prompt-with-rationale"});let Qd=null,Rl=null;const yw=e=>"custom"in e||"os_data"in e,hq=[{id:"geral",name:"Geral",importance:3},{id:"pedidos",name:"Pedidos",importance:4},{id:"mensagens",name:"Mensagens",importance:4},{id:"conversas",name:"Conversas",importance:4},{id:"aniversarios",name:"Aniversários de clientes",importance:3},{id:"resumo_vendas",name:"Resumo de vendas",importance:3},{id:"recebimentos",name:"Contas a receber",importance:3},{id:"contas_a_pagar",name:"Contas a pagar",importance:3}],fq=()=>{const e=At(),{user:t}=ot(),r=v.useRef(e);v.useEffect(()=>{r.current=e},[e]);const n=v.useRef(!1),i=v.useRef(null);return v.useEffect(()=>{if(!ph()||qe.getPlatform()!=="android"||n.current)return;n.current=!0,(async()=>{for(const s of hq)try{await Ps.createChannel(s)}catch(a){console.error("[FCM] Failed to create channel",s.id,a)}})()},[]),v.useEffect(()=>{if(!ph())return;if(!(t!=null&&t.id)){Qd=null;return}const o=async(l=!1)=>{for(;Rl;)await Rl;const d=(async()=>{try{if((await Ps.checkPermissions()).receive!=="granted")return;const{token:h}=await Ps.getToken();if(!h)return;const f=`${t.id}:${h}`;if(Qd===f)return;const p=await sc.getInfo();await Io.post("/push/register",{fcmToken:h,platform:qe.getPlatform(),appBuild:parseInt(p.build,10)||void 0}),Qd=f,pe(fe.FCM.TOKEN_REGISTERED,{userId:t.id,platform:qe.getPlatform()}),console.log("[FCM] Token registered")}catch(u){console.error("[FCM] Token registration failed:",u),l?pe(fe.FCM.ERROR,{userId:t.id,errorType:"token_registration",error:u instanceof Error?u.message:String(u)}):(i.current&&clearTimeout(i.current),i.current=setTimeout(()=>o(!0),5e3))}})();Rl=d;try{await d}finally{Rl===d&&(Rl=null)}};o();const s=sc.addListener("appStateChange",l=>{l.isActive&&o()}),a=Ps.addListener("tokenReceived",()=>{Qd=null,o()});return()=>{s.then(l=>l.remove()),a.then(l=>l.remove()),i.current&&clearTimeout(i.current)}},[t==null?void 0:t.id]),v.useEffect(()=>{if(!ph())return;const o=l=>typeof l=="string"?l:void 0,s=Ps.addListener("notificationActionPerformed",l=>{if(l.actionId&&l.actionId!=="tap")return;const d=l.notification,u=(d==null?void 0:d.data)??{};if(yw(u))return;const h=o(u.path),f=(d==null?void 0:d.title)??o(u["gcm.notification.title"]),p=(d==null?void 0:d.body)??o(u["gcm.notification.body"]);pe(fe.APP.PUSH_NOTIFICATION_OPEN,{provider:"fcm",notificationId:o(u.notificacao_id),title:f,body:p,additionalData:{path:h,tipo:o(u.tipo),notificacao_id:o(u.notificacao_id)}}),h!=null&&h.startsWith("/")&&r.current(h)}),a=Ps.addListener("notificationReceived",l=>{var u;const d=((u=l.notification)==null?void 0:u.data)??{};yw(d)||(x1.invalidateQueries({queryKey:["notifications"]}),x1.invalidateQueries({queryKey:["unreadNotificationCount"]}))});return()=>{s.then(l=>l.remove()),a.then(l=>l.remove())}},[]),null},pq=async()=>
114{if(ph())try{for(;Rl;)await Rl;const{token:e}=await Ps.getToken();if(!e)return;await Io.delete("/push/register",{data:{fcmToken:e},timeout:5e3}),console.log("[FCM] Token unregistered")}catch(e){console.error("[FCM] Token unregister failed:",e)}finally{Qd=null}},JA=v.createContext({session:null,user:null,signOut:()=>{}}),mq=({children:e})=>{const[t,r]=v.useState(),[n,i]=v.useState(),[o,s]=v.useState(!0);v.useEffect(()=>{const d=async()=>{const{data:{session:h},error:f}=await Te.auth.getSession();if(f)throw f;let p=h;if(p!=null&&p.expires_at){const m=Math.floor(Date.now()/1e3);if(p.expires_at-m<60){const{data:g,error:y}=await Te.auth.refreshSession();!y&&g.session&&(p=g.session)}}i(p),r(p==null?void 0:p.user),s(!1);try{await LA()}catch(m){console.error("Failed to initialize Google Auth:",m)}},{data:u}=Te.auth.onAuthStateChange((h,f)=>{i(f),r(f==null?void 0:f.user),h!=="INITIAL_SESSION"&&s(!1),f&&x1.invalidateQueries({queryKey:["subscription"]})});return d().catch(h=>{console.error("Failed to initialize auth session:",h),s(!1)}),()=>{u==null||u.subscription.unsubscribe()}},[]);const l={session:n,user:t,signOut:async()=>{await pq(),pe(fe.AUTH.LOGOUT),uV(),xV(),await Te.auth.signOut()}};return c.jsx(JA.Provider,{value:l,children:!o&&e})},ot=()=>v.useContext(JA);function gq(){var e,t;try{(t=(e=window.__stoquiBoot)==null?void 0:e.ready)==null||t.call(e)}catch{}}class vq extends v.Component{constructor(){super(...arguments);ze(this,"state",{error:null})}static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,n){X(()=>import("./index-CWlpAPNh.js"),__vite__mapDeps([11,1,2,3,4,5,6])).then(i=>{i.captureException(r,{extra:{componentStack:n.componentStack,tier:"root"}})}).catch(()=>{})}render(){return this.state.error?c.jsx("div",{style:{position:"fixed",inset:0,background:"#F6F6FA",display:"flex",alignItems:"center",justifyContent:"center",padding:16,fontFamily:"system-ui, sans-serif"},children:c.jsxs("div",{style:{maxWidth:480,width:"100%",background:"#fff",borderRadius:12,padding:24,textAlign:"center"},children:[c.jsx("p",{style:{margin:"0 0 8px",fontSize:"1.125rem",fontWeight:700,color:"#041E42"},children:"Não conseguimos abrir o app"}),c.jsx("p",{style:{margin:"0 0 20px",fontSize:".875rem",color:"#415064",lineHeight:1.5},children:"Verifique sua conexão com a internet e tente novamente."}),c.jsx("button",{type:"button",onClick:()=>window.location.reload(),style:{width:"100%",padding:"12px 16px",border:0,borderRadius:12,background:"#8865FE",color:"#fff",font:"inherit",fontWeight:600,cursor:"pointer"},children:"Tentar novamente"})]})}):this.props.children}}const ht=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Ht=globalThis,cs="9.38.0";function il(){return tg(Ht),Ht}function tg(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||cs,t[cs]=t[cs]||{}}function rg(e,t,r=Ht){const n=r.__SENTRY__=r.__SENTRY__||{},i=n[cs]=n[cs]||{};return i[e]||(i[e]=t())}const yq=["debug","info","warn","error","log","assert","trace"],_q="Sentry Logger ",C1={};function nd(e){if(!("console"in Ht))return e();const t=Ht.console,r={},n=Object.keys(C1);n.forEach(i=>{const o=C1[i];r[i]=t[i],t[i]=o});try{return e()}finally{n.forEach(i=>{t[i]=r[i]})}}function QA(){bb().enabled=!0}function ek(){bb().enabled=!1}function _b(){return bb().enabled}function tk(...e){vc("log",...e)}function bq(...e){vc("info",...e)}function rk(...e){vc("warn",...e)}function nk(...e){vc("error",...e)}function xq(...e){vc("debug",...e)}function wq(...e){vc("assert",...e)}function Eq(...e){vc("trace",...e)}function vc(e,...t){ht&&_b()&&nd(()=>{Ht.console[e](`${_q}[${e}]:`,...t)})}function bb(){return ht?rg("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const Or={enable:QA,disable:ek,isEnabled:_b,log:tk,info:bq,warn:rk,error:nk,debug:xq,assert:wq,trace:Eq},st={enable:QA,disable:ek,isEnabled:_b,log:tk,warn:rk,error:nk},ik=50,ac="?",_w=/\(error: (.*)\)/,bw=/captureMessage|captureException/;function ok(...e){const t=e.sort((r,n)=>r[0]-n[0]).map(r=>r[1]);return(r,n=0,i=0)=>{const o=[],s=r.split(` 115`);for(let a=n;a<s.length;a++){const l=s[a];if(l.length>1024)continue;const d=_w.test(l)?l.replace(_w,"$1"):l;if(!d.match(/\S*Error: /)){for(const u of t){const h=u(d);if(h){o.push(h);break}}if(o.length>=ik+i)break}}return Cq(o.slice(i))}}function Sq(e){return Array.isArray(e)?ok(...e):e}function Cq(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(Rp(t).function||"")&&t.pop(),t.reverse(),bw.test(Rp(t).function||"")&&(t.pop(),bw.test(Rp(t).function||"")&&t.pop()),t.slice(0,ik).map(r=>({...r,filename:r.filename||Rp(t).filename,function:r.function||ac}))}function Rp(e){return e[e.length-1]||{}}const E2="<anonymous>";function Gs(e){try{return!e||typeof e!="function"?E2:e.name||E2}catch{return E2}}function xw(e){const t=e.exception;if(t){const r=[];
115try{return t.values.forEach(n=>{n.stacktrace.frames&&r.push(...n.stacktrace.frames)}),r}catch{return}}}const S0={},ww={};function ol(e,t){S0[e]=S0[e]||[],S0[e].push(t)}function sl(e,t){if(!ww[e]){ww[e]=!0;try{t()}catch(r){ht&&st.error(`Error while instrumenting ${e}`,r)}}}function eo(e,t){const r=e&&S0[e];if(r)for(const n of r)try{n(t)}catch(i){ht&&st.error(`Error while triggering instrumentation handler. 116Type: ${e} 117Name: ${Gs(n)} 118Error:`,i)}}let S2=null;function sk(e){const t="error";ol(t,e),sl(t,Tq)}function Tq(){S2=Ht.onerror,Ht.onerror=function(e,t,r,n,i){return eo("error",{column:n,error:i,line:r,msg:e,url:t}),S2?S2.apply(this,arguments):!1},Ht.onerror.__SENTRY_INSTRUMENTED__=!0}let C2=null;function ak(e){const t="unhandledrejection";ol(t,e),sl(t,Aq)}function Aq(){C2=Ht.onunhandledrejection,Ht.onunhandledrejection=function(e){return eo("unhandledrejection",e),C2?C2.apply(this,arguments):!0},Ht.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const lk=Object.prototype.toString;function xb(e){switch(lk.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Ks(e,Error)}}function id(e,t){return lk.call(e)===`[object ${t}]`}function ck(e){return id(e,"ErrorEvent")}function Ew(e){return id(e,"DOMError")}function kq(e){return id(e,"DOMException")}function zs(e){return id(e,"String")}function ng(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Qh(e){return e===null||ng(e)||typeof e!="object"&&typeof e!="function"}function ef(e){return id(e,"Object")}function ig(e){return typeof Event<"u"&&Ks(e,Event)}function Rq(e){return typeof Element<"u"&&Ks(e,Element)}function Iq(e){return id(e,"RegExp")}function Df(e){return!!(e!=null&&e.then&&typeof e.then=="function")}function Pq(e){return ef(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function Ks(e,t){try{return e instanceof t}catch{return!1}}function uk(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue))}function dk(e){return typeof Request<"u"&&Ks(e,Request)}const wb=Ht,Oq=80;function ms(e,t={}){if(!e)return"<unknown>";try{let r=e;const n=5,i=[];let o=0,s=0;const a=" > ",l=a.length;let d;const u=Array.isArray(t)?t:t.keyAttrs,h=!Array.isArray(t)&&t.maxStringLength||Oq;for(;r&&o++<n&&(d=jq(r,u),!(d==="html"||o>1&&s+i.length*l+d.length>=h));)i.push(d),s+=d.length,r=r.parentNode;return i.reverse().join(a)}catch{return"<unknown>"}}function jq(e,t){const r=e,n=[];if(!(r!=null&&r.tagName))return"";if(wb.HTMLElement&&r instanceof HTMLElement&&r.dataset){if(r.dataset.sentryComponent)return r.dataset.sentryComponent;if(r.dataset.sentryElement)return r.dataset.sentryElement}n.push(r.tagName.toLowerCase());const i=t!=null&&t.length?t.filter(s=>r.getAttribute(s)).map(s=>[s,r.getAttribute(s)]):null;if(i!=null&&i.length)i.forEach(s=>{n.push(`[${s[0]}="${s[1]}"]`)});else{r.id&&n.push(`#${r.id}`);const s=r.className;if(s&&zs(s)){const a=s.split(/\s+/);for(const l of a)n.push(`.${l}`)}}const o=["aria-label","type","name","title","alt"];for(const s of o){const a=r.getAttribute(s);a&&n.push(`[${s}="${a}"]`)}return n.join("")}function Mf(){try{return wb.document.location.href}catch{return""}}function hk(e){if(!wb.HTMLElement)return null;let t=e;const r=5;for(let n=0;n<r;n++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}function T1(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Sw(e,t){if(!Array.isArray(e))return"";const r=[];for(let n=0;n<e.length;n++){const i=e[n];try{uk(i)?r.push("[VueViewModel]"):r.push(String(i))}catch{r.push("[value cannot be serialized]")}}return r.join(t)}function Lq(e,t,r=!1){return zs(e)?Iq(t)?t.test(e):zs(t)?r?e===t:e.includes(t):!1:!1}function Fa(e,t=[],r=!1){return t.some(n=>Lq(e,n,r))}function Ei(e,t,r){if(!(t in e))return;const n=e[t];if(typeof n!="function")return;const i=r(n);typeof i=="function"&&fk(i,n);try{e[t]=i}catch{ht&&st.log(`Failed to replace method "${t}" in object`,e)}}function Ui(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{ht&&st.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function fk(e,t){try{const r=t.prototype||{};e.prototype=t.prototype=r,Ui(e,"__sentry_original__",t)}catch{}}function Eb(e){return e.__sentry_original__}function pk(e){if(xb(e))return{message:e.message,name:e.name,stack:e.stack,...Tw(e)};if(ig(e)){const t={type:e.type,target:Cw(e.target),currentTarget:Cw(e.currentTarget),...Tw(e)};return typeof CustomEvent<"u"&&Ks(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function Cw(e){try{return Rq(e)?ms(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Tw(e){if(typeof e=="object"&&e!==null){const t={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}else return{}}function $q(e,t=40){const r=Object.keys(pk(e));r.sort();const n=r[0];if(!n)return"[object has no keys]";if(n.length>=t)return T1(n,t);for(let i=r.length;i>0;i--){const o=r.slice(0,i).join(", ");
118if(!(o.length>t))return i===r.length?o:T1(o,t)}return""}function Dq(){const e=Ht;return e.crypto||e.msCrypto}function to(e=Dq()){let t=()=>Math.random()*16;try{if(e!=null&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e!=null&&e.getRandomValues&&(t=()=>{const r=new Uint8Array(1);return e.getRandomValues(r),r[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(t()&15)>>r/4).toString(16))}function mk(e){var t,r;return(r=(t=e.exception)==null?void 0:t.values)==null?void 0:r[0]}function Il(e){const{message:t,event_id:r}=e;if(t)return t;const n=mk(e);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}function X5(e,t,r){const n=e.exception=e.exception||{},i=n.values=n.values||[],o=i[0]=i[0]||{};o.value||(o.value=t||""),o.type||(o.type=r||"Error")}function ju(e,t){const r=mk(e);if(!r)return;const n={type:"generic",handled:!0},i=r.mechanism;if(r.mechanism={...n,...i,...t},t&&"data"in t){const o={...i==null?void 0:i.data,...t.data};r.mechanism.data=o}}function Aw(e){if(Mq(e))return!0;try{Ui(e,"__sentry_captured__",!0)}catch{}return!1}function Mq(e){try{return e.__sentry_captured__}catch{}}const gk=1e3;function yc(){return Date.now()/gk}function Nq(){const{performance:e}=Ht;if(!(e!=null&&e.now)||!e.timeOrigin)return yc;const t=e.timeOrigin;return()=>(t+e.now())/gk}let kw;function _n(){return(kw??(kw=Nq()))()}let T2;function Fq(){var u;const{performance:e}=Ht;if(!(e!=null&&e.now))return[void 0,"none"];const t=3600*1e3,r=e.now(),n=Date.now(),i=e.timeOrigin?Math.abs(e.timeOrigin+r-n):t,o=i<t,s=(u=e.timing)==null?void 0:u.navigationStart,l=typeof s=="number"?Math.abs(s+r-n):t,d=l<t;return o||d?i<=l?[e.timeOrigin,"timeOrigin"]:[s,"navigationStart"]:[n,"dateNow"]}function Ai(){return T2||(T2=Fq()),T2[0]}function Uq(e){const t=_n(),r={sid:to(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Vq(r)};return e&&Lu(r,e),r}function Lu(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||_n(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:to()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{const r=e.timestamp-e.started;e.duration=r>=0?r:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function Bq(e,t){let r={};t?r={status:t}:e.status==="ok"&&(r={status:"exited"}),Lu(e,r)}function Vq(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function Nf(e,t,r=2){if(!t||typeof t!="object"||r<=0)return t;if(e&&Object.keys(t).length===0)return e;const n={...e};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=Nf(n[i],t[i],r-1));return n}function Wa(){return to()}function Ff(){return to().substring(16)}const J5="_sentrySpan";function lc(e,t){t?Ui(e,J5,t):delete e[J5]}function tf(e){return e[J5]}const Hq=100;class gs{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Wa(),sampleRand:Math.random()}}clone(){const t=new gs;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,lc(t,tf(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Lu(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,r){return this._tags={...this._tags,[t]:r},this._notifyScopeListeners(),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,r){return this._extra={...this._extra,[t]:r},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,r){return r===null?delete this._contexts[t]:this._contexts[t]=r,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const r=typeof t=="function"?t(this):t,n=r instanceof gs?r.getScopeData():ef(r)?t:void 0,{tags:i,extra:o,user:s,contexts:a,level:l,fingerprint:d=[],propagationContext:u}=n||{};return this._tags={...this._tags,...i},this._extra={...this._extra,...o},this._contexts={...this._contexts,...a},s&&Object.keys(s).length&&(this._user=s),l&&(this._level=l),d.length&&(this._fingerprint=d),u&&(this._propagationContext=u),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,lc(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Wa(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(t,r){var o;const n=typeof r=="number"?r:Hq;if(n<=0)return this;const i={timestamp:yc(),...t,message:t.message?T1(t.message,2048):t.message};return this._breadcrumbs.push(i),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),(o=this._client)==null||o.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:tf(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=Nf(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,r){const n=(r==null?void 0:r.event_id)||to();if(!this._client)return ht&&st.warn("No client configured on scope - will not capture exception!"),n;const i=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:i,...r,event_id:n},this),n}captureMessage(t,r,n){const i=(n==null?void 0:n.event_id)||to();if(!this._client)return ht&&st.warn("No client configured on scope - will not capture message!"),i;const o=new Error(t);return this._client.captureMessage(t,r,{originalException:t,syntheticException:o,...n,event_id:i},this),i}captureEvent(t,r){const n=(r==null?void 0:r.event_id)||to();return this._client?(this._client.captureEvent(t,{...r,event_id:n},this),n):(ht&&st.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEac
118h(t=>{t(this)}),this._notifyingListeners=!1)}}function zq(){return rg("defaultCurrentScope",()=>new gs)}function Wq(){return rg("defaultIsolationScope",()=>new gs)}class qq{constructor(t,r){let n;t?n=t:n=new gs;let i;r?i=r:i=new gs,this._stack=[{scope:n}],this._isolationScope=i}withScope(t){const r=this._pushScope();let n;try{n=t(r)}catch(i){throw this._popScope(),i}return Df(n)?n.then(i=>(this._popScope(),i),i=>{throw this._popScope(),i}):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function $u(){const e=il(),t=tg(e);return t.stack=t.stack||new qq(zq(),Wq())}function Gq(e){return $u().withScope(e)}function Kq(e,t){const r=$u();return r.withScope(()=>(r.getStackTop().scope=e,t(e)))}function Rw(e){return $u().withScope(()=>e($u().getIsolationScope()))}function Yq(){return{withIsolationScope:Rw,withScope:Gq,withSetScope:Kq,withSetIsolationScope:(e,t)=>Rw(t),getCurrentScope:()=>$u().getScope(),getIsolationScope:()=>$u().getIsolationScope()}}function od(e){const t=tg(e);return t.acs?t.acs:Yq()}function cr(){const e=il();return od(e).getCurrentScope()}function qn(){const e=il();return od(e).getIsolationScope()}function Sb(){return rg("globalScope",()=>new gs)}function _c(...e){const t=il(),r=od(t);if(e.length===2){const[n,i]=e;return n?r.withSetScope(n,i):r.withScope(i)}return r.withScope(e[0])}function Yt(){return cr().getClient()}function vk(e){const t=e.getPropagationContext(),{traceId:r,parentSpanId:n,propagationSpanId:i}=t,o={trace_id:r,span_id:i||Ff()};return n&&(o.parent_span_id=n),o}const ns="sentry.source",Cb="sentry.sample_rate",yk="sentry.previous_trace_sample_rate",Ys="sentry.op",on="sentry.origin",A1="sentry.idle_span_finish_reason",Uf="sentry.measurement_unit",Bf="sentry.measurement_value",Iw="sentry.custom_span_name",Tb="sentry.profile_id",sd="sentry.exclusive_time",Zq="sentry.link.type",Xq=0,_k=1,en=2;function Jq(e){if(e<400&&e>=100)return{code:_k};if(e>=400&&e<500)switch(e){case 401:return{code:en,message:"unauthenticated"};case 403:return{code:en,message:"permission_denied"};case 404:return{code:en,message:"not_found"};case 409:return{code:en,message:"already_exists"};case 413:return{code:en,message:"failed_precondition"};case 429:return{code:en,message:"resource_exhausted"};case 499:return{code:en,message:"cancelled"};default:return{code:en,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:en,message:"unimplemented"};case 503:return{code:en,message:"unavailable"};case 504:return{code:en,message:"deadline_exceeded"};default:return{code:en,message:"internal_error"}}return{code:en,message:"unknown_error"}}function bk(e,t){e.setAttribute("http.response.status_code",t);const r=Jq(t);r.message!=="unknown_error"&&e.setStatus(r)}const xk="_sentryScope",wk="_sentryIsolationScope";function Qq(e,t,r){e&&(Ui(e,wk,r),Ui(e,xk,t))}function k1(e){return{scope:e[xk],isolationScope:e[wk]}}const Ab="sentry-",eG=/^sentry-/,tG=8192;function Ek(e){const t=nG(e);if(!t)return;const r=Object.entries(t).reduce((n,[i,o])=>{if(i.match(eG)){const s=i.slice(Ab.length);n[s]=o}return n},{});if(Object.keys(r).length>0)return r}function rG(e){if(!e)return;const t=Object.entries(e).reduce((r,[n,i])=>(i&&(r[`${Ab}${n}`]=i),r),{});return iG(t)}function nG(e){if(!(!e||!zs(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,r)=>{const n=Pw(r);return Object.entries(n).forEach(([i,o])=>{t[i]=o}),t},{}):Pw(e)}function Pw(e){return e.split(",").map(t=>t.split("=").map(r=>{try{return decodeURIComponent(r.trim())}catch{return}})).reduce((t,[r,n])=>(r&&n&&(t[r]=n),t),{})}function iG(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[r,n],i)=>{const o=`${encodeURIComponent(r)}=${encodeURIComponent(n)}`,s=i===0?o:`${t},${o}`;return s.length>tG?(ht&&st.warn(`Not adding key: ${r} with val: ${n} to baggage header due to exceeding baggage size limits.`),t):s},"")}function rf(e){if(typeof e=="boolean")return Number(e);const t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}const Sk=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function oG(e){if(!e)return;const t=e.match(Sk);if(!t)return;let r;return t[3]==="1"?r=!0:t[3]==="0"&&(r=!1),{traceId:t[1],parentSampled:r,parentSpanId:t[2]}}function sG(e,t){const r=oG(e),n=Ek(t);
118if(!(r!=null&&r.traceId))return{traceId:Wa(),sampleRand:Math.random()};const i=aG(r,n);n&&(n.sample_rand=i.toString());const{traceId:o,parentSpanId:s,parentSampled:a}=r;return{traceId:o,parentSpanId:s,sampled:a,dsc:n||{},sampleRand:i}}function Ck(e=Wa(),t=Ff(),r){let n="";return r!==void 0&&(n=r?"-1":"-0"),`${e}-${t}${n}`}function aG(e,t){const r=rf(t==null?void 0:t.sample_rand);if(r!==void 0)return r;const n=rf(t==null?void 0:t.sample_rate);return n&&(e==null?void 0:e.parentSampled)!==void 0?e.parentSampled?Math.random()*n:n+Math.random()*(1-n):Math.random()}const Tk=0,kb=1;let Ow=!1;function lG(e){const{spanId:t,traceId:r}=e.spanContext(),{data:n,op:i,parent_span_id:o,status:s,origin:a,links:l}=ir(e);return{parent_span_id:o,span_id:t,trace_id:r,data:n,op:i,status:s,origin:a,links:l}}function Ak(e){const{spanId:t,traceId:r,isRemote:n}=e.spanContext(),i=n?t:ir(e).parent_span_id,o=k1(e).scope,s=n?(o==null?void 0:o.getPropagationContext().propagationSpanId)||Ff():t;return{parent_span_id:i,span_id:s,trace_id:r}}function cG(e){const{traceId:t,spanId:r}=e.spanContext(),n=bc(e);return Ck(t,r,n)}function kk(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:r,traceFlags:n,...i},attributes:o})=>({span_id:t,trace_id:r,sampled:n===kb,attributes:o,...i}))}function ql(e){return typeof e=="number"?jw(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?jw(e.getTime()):_n()}function jw(e){return e>9999999999?e/1e3:e}function ir(e){var n;if(dG(e))return e.getSpanJSON();const{spanId:t,traceId:r}=e.spanContext();if(uG(e)){const{attributes:i,startTime:o,name:s,endTime:a,status:l,links:d}=e,u="parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?(n=e.parentSpanContext)==null?void 0:n.spanId:void 0;return{span_id:t,trace_id:r,data:i,description:s,parent_span_id:u,start_timestamp:ql(o),timestamp:ql(a)||void 0,status:Rk(l),op:i[Ys],origin:i[on],links:kk(d)}}return{span_id:t,trace_id:r,start_timestamp:0,data:{}}}function uG(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function dG(e){return typeof e.getSpanJSON=="function"}function bc(e){const{traceFlags:t}=e.spanContext();return t===kb}function Rk(e){if(!(!e||e.code===Xq))return e.code===_k?"ok":e.message||"unknown_error"}const Gl="_sentryChildSpans",Q5="_sentryRootSpan";function Ik(e,t){const r=e[Q5]||e;Ui(t,Q5,r),e[Gl]?e[Gl].add(t):Ui(e,Gl,new Set([t]))}function hG(e,t){e[Gl]&&e[Gl].delete(t)}function C0(e){const t=new Set;function r(n){if(!t.has(n)&&bc(n)){t.add(n);const i=n[Gl]?Array.from(n[Gl]):[];for(const o of i)r(o)}}return r(e),Array.from(t)}function Wn(e){return e[Q5]||e}function li(){const e=il(),t=od(e);return t.getActiveSpan?t.getActiveSpan():tf(cr())}function ey(){Ow||(nd(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly.")}),Ow=!0)}let Lw=!1;function fG(){Lw||(Lw=!0,sk(ty),ak(ty))}function ty(){const e=li(),t=e&&Wn(e);if(t){const r="internal_error";ht&&st.log(`[Tracing] Root span: ${r} -> Global error occurred`),t.setStatus({code:en,message:r})}}ty.tag="sentry_tracingErrorCallback";function qa(e){var r;if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=e||((r=Yt())==null?void 0:r.getOptions());return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}const Rb="production",pG=/^o(\d+)\./,mG=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function gG(e){return e==="http"||e==="https"}function Vf(e,t=!1){const{host:r,path:n,pass:i,port:o,projectId:s,protocol:a,publicKey:l}=e;return`${a}://${l}${t&&i?`:${i}`:""}@${r}${o?`:${o}`:""}/${n&&`${n}/`}${s}`}function vG(e){const t=mG.exec(e);if(!t){nd(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[r,n,i="",o="",s="",a=""]=t.slice(1);let l="",d=a;const u=d.split("/");if(u.length>1&&(l=u.slice(0,-1).join("/"),d=u.pop()),d){const h=d.match(/^\d+/);h&&(d=h[0])}return Pk({host:o,pass:i,path:l,projectId:d,port:s,protocol:r,publicKey:n})}function Pk(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function yG(e){if(!ht)return!0;const{port:t,projectId:r,protocol:n}=e;return["protocol","publicKey","host","projectId"].find(s=>e[s]?!1:(st.error(`Invalid Sentry Dsn: ${s} missing`),!0))?!1:r.match(/^\d+$/)?gG(n)?t&&isNaN(parseInt(t,10))?(st.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(st.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),!1):(st.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),!1)}function _G(e){const t=e.match(pG);return t==null?void 0:t[1]}function bG(e){const t=typeof e=="string"?vG(e):Pk(e);if(!(!t||!yG(t)))return t}const Ok="_frozenDsc";function T0(e,t){Ui(e,Ok,t)}function jk(e,t){const r=t.getOptions(),{publicKey:n,host:i}=t.getDsn()||{};let o;r.orgId?o=String(r.orgId):i&&(o=_G(i));const s={environment:r.environment||Rb,release:r.release,public_key:n,trace_id:e,org_id:o};return t.emit("createDsc",s),s}function Ib(e,t){const r=t.getPropagationContext();return r.dsc||jk(r.traceId,e)}function Zs(e){var m;const t=Yt();if(!t)return{};const r=Wn(e),n=ir(r),i=n.data,o=r.spanContext().traceState,s=(o==null?void 0:o.get("sentry.sample_rate"))??i[Cb]??i[yk];function a(g){return(typeof s=="number"||typeof s=="string")&&(g.sample_rate=`${s}`),g}const l=r[Ok];if(l)return a(l);const d=o==null?void 0:o.get("sentry.dsc"),u=d&&Ek(d);if(u)return a(u);const h=jk(e.spanContext().traceId,t),f=i[ns],p=n.description;return f!=="url"&&p&&(h.transaction=p),qa()&&(h.sampled=String(bc(r)),h.sample_rand=(o==null?void 0:o.get("sentry.sample_rand"))??((m=k1(r).scope)==null?void 0:m.getPropagationContext().sampleRand.toString())),a(h),t.emit("createDsc",h,r),h}class Xs{constructor(t={}){this._traceId=t.traceId||Wa(),this._spanId=t.spanId||Ff()}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:Tk}}end(t){}setAttribute(t,r){return this}setAttributes(t){return this}setStatus(t){return this}updateName(t){return this}isRecording(){return!1}
118addEvent(t,r,n){return this}addLink(t){return this}addLinks(t){return this}recordException(t,r){}}function Lk(e,t,r=()=>{}){let n;try{n=e()}catch(i){throw t(i),r(),i}return xG(n,t,r)}function xG(e,t,r){return Df(e)?e.then(n=>(r(),n),n=>{throw t(n),r(),n}):(r(),e)}function wG(e){if(!ht)return;const{description:t="< unknown name >",op:r="< unknown op >",parent_span_id:n}=ir(e),{spanId:i}=e.spanContext(),o=bc(e),s=Wn(e),a=s===e,l=`[Tracing] Starting ${o?"sampled":"unsampled"} ${a?"root ":""}span`,d=[`op: ${r}`,`name: ${t}`,`ID: ${i}`];if(n&&d.push(`parent ID: ${n}`),!a){const{op:u,description:h}=ir(s);d.push(`root ID: ${s.spanContext().spanId}`),u&&d.push(`root op: ${u}`),h&&d.push(`root description: ${h}`)}st.log(`${l} 119 ${d.join(` 120 `)}`)}function EG(e){if(!ht)return;const{description:t="< unknown name >",op:r="< unknown op >"}=ir(e),{spanId:n}=e.spanContext(),o=Wn(e)===e,s=`[Tracing] Finishing "${r}" ${o?"root ":""}span "${t}" with ID ${n}`;st.log(s)}function SG(e,t,r){if(!qa(e))return[!1];let n,i;typeof e.tracesSampler=="function"?(i=e.tracesSampler({...t,inheritOrSampleWith:a=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):a}),n=!0):t.parentSampled!==void 0?i=t.parentSampled:typeof e.tracesSampleRate<"u"&&(i=e.tracesSampleRate,n=!0);const o=rf(i);if(o===void 0)return ht&&st.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(i)} of type ${JSON.stringify(typeof i)}.`),[!1];if(!o)return ht&&st.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,o,n];const s=r<o;return s||ht&&st.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(i)})`),[s,o,n]}function Wo(e,t=100,r=1/0){try{return ry("",e,t,r)}catch(n){return{ERROR:`**non-serializable** (${n})`}}}function $k(e,t=3,r=100*1024){const n=Wo(e,t);return kG(n)>r?$k(e,t-1,r):n}function ry(e,t,r=1/0,n=1/0,i=RG()){const[o,s]=i;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const a=CG(e,t);if(!a.startsWith("[object "))return a;if(t.__sentry_skip_normalization__)return t;const l=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:r;if(l===0)return a.replace("object ","");if(o(t))return"[Circular ~]";const d=t;if(d&&typeof d.toJSON=="function")try{const p=d.toJSON();return ry("",p,l-1,n,i)}catch{}const u=Array.isArray(t)?[]:{};let h=0;const f=pk(t);for(const p in f){if(!Object.prototype.hasOwnProperty.call(f,p))continue;if(h>=n){u[p]="[MaxProperties ~]";break}const m=f[p];u[p]=ry(p,m,l-1,n,i),h++}return s(t),u}function CG(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof globalThis<"u"&&t===globalThis)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(uk(t))return"[VueViewModel]";if(Pq(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${Gs(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const r=TG(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(r){return`**non-serializable** (${r})`}}function TG(e){const t=Object.getPrototypeOf(e);return t!=null&&t.constructor?t.constructor.name:"null prototype"}function AG(e){return~-encodeURI(e).split(/%..|./).length}function kG(e){return AG(JSON.stringify(e))}function RG(){const e=new WeakSet;function t(n){return e.has(n)?!0:(e.add(n),!1)}function r(n){e.delete(n)}return[t,r]}function ad(e,t=[]){return[e,t]}function IG(e,t){const[r,n]=e;return[r,[...n,t]]}function $w(e,t){const r=e[1];for(const n of r){const i=n[0].type;if(t(n,i))return!0}return!1}function ny(e){const t=tg(Ht);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function PG(e){const[t,r]=e;let n=JSON.stringify(t);
120function i(o){typeof n=="string"?n=typeof o=="string"?n+o:[ny(n),o]:n.push(typeof o=="string"?ny(o):o)}for(const o of r){const[s,a]=o;if(i(` 121${JSON.stringify(s)} 122`),typeof a=="string"||a instanceof Uint8Array)i(a);else{let l;try{l=JSON.stringify(a)}catch{l=JSON.stringify(Wo(a))}i(l)}}return typeof n=="string"?n:OG(n)}function OG(e){const t=e.reduce((i,o)=>i+o.length,0),r=new Uint8Array(t);let n=0;for(const i of e)r.set(i,n),n+=i.length;return r}function jG(e){return[{type:"span"},e]}function LG(e){const t=typeof e.data=="string"?ny(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const $G={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security",log:"log_item"};function Dw(e){return $G[e]}function Dk(e){if(!(e!=null&&e.sdk))return;const{name:t,version:r}=e.sdk;return{name:t,version:r}}function DG(e,t,r,n){var o;const i=(o=e.sdkProcessingMetadata)==null?void 0:o.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!r&&n&&{dsn:Vf(n)},...i&&{trace:i}}}function MG(e,t){return t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]]),e}function NG(e,t,r,n){const i=Dk(r),o={sent_at:new Date().toISOString(),...i&&{sdk:i},...!!n&&t&&{dsn:Vf(t)}},s="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return ad(o,[s])}function FG(e,t,r,n){const i=Dk(r),o=e.type&&e.type!=="replay_event"?e.type:"event";MG(e,r==null?void 0:r.sdk);const s=DG(e,i,n,t);return delete e.sdkProcessingMetadata,ad(s,[[{type:o},e]])}function UG(e,t){function r(u){return!!u.trace_id&&!!u.public_key}const n=Zs(e[0]),i=t==null?void 0:t.getDsn(),o=t==null?void 0:t.getOptions().tunnel,s={sent_at:new Date().toISOString(),...r(n)&&{trace:n},...!!o&&i&&{dsn:Vf(i)}},a=t==null?void 0:t.getOptions().beforeSendSpan,l=a?u=>{const h=ir(u),f=a(h);return f||(ey(),h)}:ir,d=[];for(const u of e){const h=l(u);h&&d.push(jG(h))}return ad(s,d)}function BG(e,t,r,n=li()){const i=n&&Wn(n);i&&(ht&&st.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${r}`),i.addEvent(e,{[Bf]:t,[Uf]:r}))}function Mw(e){if(!e||e.length===0)return;const t={};return e.forEach(r=>{const n=r.attributes||{},i=n[Uf],o=n[Bf];typeof i=="string"&&typeof o=="number"&&(t[r.name]={value:o,unit:i})}),t}const Nw=1e3;class Pb{constructor(t={}){this._traceId=t.traceId||Wa(),this._spanId=t.spanId||Ff(),this._startTime=t.startTimestamp||_n(),this._links=t.links,this._attributes={},this.setAttributes({[on]:"manual",[Ys]:t.op,...t.attributes}),this._name=t.name,t.parentSpanId&&(this._parentSpanId=t.parentSpanId),"sampled"in t&&(this._sampled=t.sampled),t.endTimestamp&&(this._endTime=t.endTimestamp),this._events=[],this._isStandaloneSpan=t.isStandalone,this._endTime&&this._onSpanEnded()}addLink(t){return this._links?this._links.push(t):this._links=[t],this}addLinks(t){return this._links?this._links.push(...t):this._links=t,this}recordException(t,r){}spanContext(){const{_spanId:t,_traceId:r,_sampled:n}=this;return{spanId:t,traceId:r,traceFlags:n?kb:Tk}}setAttribute(t,r){return r===void 0?delete this._attributes[t]:this._attributes[t]=r,this}setAttributes(t){return Object.keys(t).forEach(r=>this.setAttribute(r,t[r])),this}updateStartTime(t){this._startTime=ql(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(ns,"custom"),this}end(t){this._endTime||(this._endTime=ql(t),EG(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[Ys],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:Rk(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[on],profile_id:this._attributes[Tb],exclusive_time:this._attributes[sd],measurements:Mw(this._events),is_segment:this._isStandaloneSpan&&Wn(this)===this||void 0,segment_id:this._isStandaloneSpan?Wn(this).spanContext().spanId:void 0,links:kk(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,r,n){ht&&st.log("[Tracing] Adding an event to span:",t);const i=Fw(r)?r:n||_n(),o=Fw(r)?{}:r||{}
122,s={name:t,time:ql(i),attributes:o};return this._events.push(s),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=Yt();if(t&&t.emit("spanEnd",this),!(this._isStandaloneSpan||this===Wn(this)))return;if(this._isStandaloneSpan){this._sampled?HG(UG([this],t)):(ht&&st.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}const n=this._convertSpanToTransaction();n&&(k1(this).scope||cr()).captureEvent(n)}_convertSpanToTransaction(){var u;if(!Uw(ir(this)))return;this._name||(ht&&st.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:t,isolationScope:r}=k1(this),n=(u=t==null?void 0:t.getScopeData().sdkProcessingMetadata)==null?void 0:u.normalizedRequest;if(this._sampled!==!0)return;const o=C0(this).filter(h=>h!==this&&!VG(h)).map(h=>ir(h)).filter(Uw),s=this._attributes[ns];delete this._attributes[Iw],o.forEach(h=>{delete h.data[Iw]});const a={contexts:{trace:lG(this)},spans:o.length>Nw?o.sort((h,f)=>h.start_timestamp-f.start_timestamp).slice(0,Nw):o,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:r,dynamicSamplingContext:Zs(this)},request:n,...s&&{transaction_info:{source:s}}},l=Mw(this._events);return l&&Object.keys(l).length&&(ht&&st.log("[Measurements] Adding measurements to transaction event",JSON.stringify(l,void 0,2)),a.measurements=l),a}}function Fw(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function Uw(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function VG(e){return e instanceof Pb&&e.isStandaloneSpan()}function HG(e){const t=Yt();if(!t)return;const r=e[1];if(!r||r.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}const R1="__SENTRY_SUPPRESS_TRACING__";function zG(e,t){const r=Hf();if(r.startSpan)return r.startSpan(e,t);const n=Lb(e),{forceTransaction:i,parentSpan:o,scope:s}=e,a=s==null?void 0:s.clone();return _c(a,()=>Mk(o)(()=>{const d=cr(),u=$b(d,o),f=e.onlyIfParent&&!u?new Xs:jb({parentSpan:u,spanArguments:n,forceTransaction:i,scope:d});return lc(d,f),Lk(()=>t(f),()=>{const{status:p}=ir(f);f.isRecording()&&(!p||p==="ok")&&f.setStatus({code:en,message:"internal_error"})},()=>{f.end()})}))}function g7e(e,t){const r=Hf();if(r.startSpanManual)return r.startSpanManual(e,t);const n=Lb(e),{forceTransaction:i,parentSpan:o,scope:s}=e,a=s==null?void 0:s.clone();return _c(a,()=>Mk(o)(()=>{const d=cr(),u=$b(d,o),f=e.onlyIfParent&&!u?new Xs:jb({parentSpan:u,spanArguments:n,forceTransaction:i,scope:d});return lc(d,f),Lk(()=>t(f,()=>f.end()),()=>{const{status:p}=ir(f);f.isRecording()&&(!p||p==="ok")&&f.setStatus({code:en,message:"internal_error"})})}))}function ld(e){const t=Hf();if(t.startInactiveSpan)return t.startInactiveSpan(e);const r=Lb(e),{forceTransaction:n,parentSpan:i}=e;return(e.scope?s=>_c(e.scope,s):i!==void 0?s=>Ob(i,s):s=>s())(()=>{const s=cr(),a=$b(s,i);return e.onlyIfParent&&!a?new Xs:jb({parentSpan:a,spanArguments:r,forceTransaction:n,scope:s})})}function Ob(e,t){const r=Hf();return r.withActiveSpan?r.withActiveSpan(e,t):_c(n=>(lc(n,e||void 0),t(n)))}function v7e(e){const t=Hf();return t.suppressTracing?t.suppressTracing(e):_c(r=>{r.setSDKProcessingMetadata({[R1]:!0});const n=e();return r.setSDKProcessingMetadata({[R1]:void 0}),n})}function jb({parentSpan:e,spanArguments:t,forceTransaction:r,scope:n}){if(!qa()){const s=new Xs;if(r||!e){const a={sampled:"false",sample_rate:"0",transaction:t.name,...Zs(s)};T0(s,a)}return s}const i=qn();let o;if(e&&!r)o=WG(e,n,t),Ik(e,o);else if(e){const s=Zs(e),{traceId:a,spanId:l}=e.spanContext(),d=bc(e);o=Bw({traceId:a,parentSpanId:l,...t},n,d),T0(o,s)}else{const{traceId:s,dsc:a,parentSpanId:l,sampled:d}={...i.getPropagationContext(),...n.getPropagationContext()};o=Bw({traceId:s,parentSpanId:l,...t},n,d),a&&T0(o,a)}return wG(o),Qq(o,n,i),o}function Lb(e){const r={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const n={...r};return n.startTimestamp=ql(e.startTime),delete n.startTime,n}return r}function Hf(){const e=il();return od(e)}function Bw(e,t,r){var m;const n=Yt(),i=(n==null?void 0:n.getOptions())||{},{name:o=""}=e,s={spanAttributes:{...e.attributes},spanName:o,parentSampled:r};n==null||n.emit("beforeSampling",s,{decision:!1});const a=s.parentSampled??r,l=s.spanAttributes,d=t.getPropagationContext(),[u,h,f]=t.getScopeData().sdkProcessingMetadata[R1]?[!1]:SG(i,{name:o,parentSampled:a,attributes:l,parentSampleRate:rf((m=
122d.dsc)==null?void 0:m.sample_rate)},d.sampleRand),p=new Pb({...e,attributes:{[ns]:"custom",[Cb]:h!==void 0&&f?h:void 0,...l},sampled:u});return!u&&n&&(ht&&st.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),n.recordDroppedEvent("sample_rate","transaction")),n&&n.emit("spanStart",p),p}function WG(e,t,r){const{spanId:n,traceId:i}=e.spanContext(),o=t.getScopeData().sdkProcessingMetadata[R1]?!1:bc(e),s=o?new Pb({...r,parentSpanId:n,traceId:i,sampled:o}):new Xs({traceId:i});Ik(e,s);const a=Yt();return a&&(a.emit("spanStart",s),r.endTimestamp&&a.emit("spanEnd",s)),s}function $b(e,t){if(t)return t;if(t===null)return;const r=tf(e);if(!r)return;const n=Yt();return(n?n.getOptions():{}).parentSpanIsAlwaysRootSpan?Wn(r):r}function Mk(e){return e!==void 0?t=>Ob(e,t):t=>t()}const A0={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},qG="heartbeatFailed",GG="idleTimeout",KG="finalTimeout",YG="externalFinish";function Nk(e,t={}){const r=new Map;let n=!1,i,o=YG,s=!t.disableAutoFinish;const a=[],{idleTimeout:l=A0.idleTimeout,finalTimeout:d=A0.finalTimeout,childSpanTimeout:u=A0.childSpanTimeout,beforeSpanEnd:h}=t,f=Yt();if(!f||!qa()){const w=new Xs,_={sample_rate:"0",sampled:"false",...Zs(w)};return T0(w,_),w}const p=cr(),m=li(),g=ZG(e);g.end=new Proxy(g.end,{apply(w,_,x){if(h&&h(g),_ instanceof Xs)return;const[C,...P]=x,I=C||_n(),O=ql(I),D=C0(g).filter(q=>q!==g);if(!D.length)return A(O),Reflect.apply(w,_,[O,...P]);const M=D.map(q=>ir(q).timestamp).filter(q=>!!q),U=M.length?Math.max(...M):void 0,$=ir(g).start_timestamp,j=Math.min($?$+d/1e3:1/0,Math.max($||-1/0,Math.min(O,U||1/0)));return A(j),Reflect.apply(w,_,[j,...P])}});function y(){i&&(clearTimeout(i),i=void 0)}function b(w){y(),i=setTimeout(()=>{!n&&r.size===0&&s&&(o=GG,g.end(w))},l)}function E(w){i=setTimeout(()=>{!n&&s&&(o=qG,g.end(w))},u)}function S(w){y(),r.set(w,!0);const _=_n();E(_+u/1e3)}function k(w){if(r.has(w)&&r.delete(w),r.size===0){const _=_n();b(_+l/1e3)}}function A(w){n=!0,r.clear(),a.forEach(O=>O()),lc(p,m);const _=ir(g),{start_timestamp:x}=_;if(!x)return;_.data[A1]||g.setAttribute(A1,o),st.log(`[Tracing] Idle span "${_.op}" finished`);const P=C0(g).filter(O=>O!==g);let I=0;P.forEach(O=>{O.isRecording()&&(O.setStatus({code:en,message:"cancelled"}),O.end(w),ht&&st.log("[Tracing] Cancelling span since span ended early",JSON.stringify(O,void 0,2)));const D=ir(O),{timestamp:M=0,start_timestamp:U=0}=D,$=U<=w,j=(d+l)/1e3,q=M-U<=j;if(ht){const W=JSON.stringify(O,void 0,2);$?q||st.log("[Tracing] Discarding span since it finished after idle span final timeout",W):st.log("[Tracing] Discarding span since it happened after idle span was finished",W)}(!q||!$)&&(hG(g,O),I++)}),I>0&&g.setAttribute("sentry.idle_span_discarded_spans",I)}return a.push(f.on("spanStart",w=>{if(n||w===g||ir(w).timestamp)return;C0(g).includes(w)&&S(w.spanContext().spanId)})),a.push(f.on("spanEnd",w=>{n||k(w.spanContext().spanId)})),a.push(f.on("idleSpanEnableAutoFinish",w=>{w===g&&(s=!0,b(),r.size&&E())})),t.disableAutoFinish||b(),setTimeout(()=>{n||(g.setStatus({code:en,message:"deadline_exceeded"}),o=KG,g.end())},d),g}function ZG(e){const t=ld(e);return lc(cr(),t),ht&&st.log("[Tracing] Started span is an idle span"),t}const A2=0,Vw=1,Hw=2;function cc(e){return new Ga(t=>{t(e)})}function I1(e){return new Ga((t,r)=>{r(e)})}class Ga{constructor(t){this._state=A2,this._handlers=[],this._runExecutor(t)}then(t,r){return new Ga((n,i)=>{this._handlers.push([!1,o=>{if(!t)n(o);else try{n(t(o))}catch(s){i(s)}},o=>{if(!r)i(o);else try{n(r(o))}catch(s){i(s)}}]),this._executeHandlers()})}catch(t){return this.then(r=>r,t)}finally(t){return new Ga((r,n)=>{let i,o;return this.then(s=>{o=!1,i=s,t&&t()},s=>{o=!0,i=s,t&&t()}).then(()=>{if(o){n(i);return}r(i)})})}_executeHandlers(){if(this._state===A2)return;const t=this._handlers.slice();this._handlers=[],t.forEach(r=>{r[0]||(this._state===Vw&&r[1](this._value),this._state===Hw&&r[2](this._value),r[0]=!0)})}_runExecutor(t){const r=(o,s)=>{if(this._state===A2){if(Df(s)){s.then(n,i);return}this._state=o,this._value=s,this._executeHandlers()}},n=o=>{r(Vw,o)},i=o=>{r(Hw,o)};try{t(n,i)}catch(o){i(o)}}}function iy(e,t,r,n=0){return new Ga((i,o)=>{const s=e[n];if(t===null||typeof s!="function")i(t);else{const a=s({...t},r);ht&&s.id&&a===null&&st.log(`Event processor "${s.id}" dropped event`),Df(a)?a.then(l=>iy(e,l,r,n+1).then(i)).then(null,o):iy(e,a,r,n+1).then(i).then(null,o)}})}
122function XG(e,t){const{fingerprint:r,span:n,breadcrumbs:i,sdkProcessingMetadata:o}=t;JG(e,t),n&&tK(e,n),rK(e,r),QG(e,i),eK(e,o)}function P1(e,t){const{extra:r,tags:n,user:i,contexts:o,level:s,sdkProcessingMetadata:a,breadcrumbs:l,fingerprint:d,eventProcessors:u,attachments:h,propagationContext:f,transactionName:p,span:m}=t;Ip(e,"extra",r),Ip(e,"tags",n),Ip(e,"user",i),Ip(e,"contexts",o),e.sdkProcessingMetadata=Nf(e.sdkProcessingMetadata,a,2),s&&(e.level=s),p&&(e.transactionName=p),m&&(e.span=m),l.length&&(e.breadcrumbs=[...e.breadcrumbs,...l]),d.length&&(e.fingerprint=[...e.fingerprint,...d]),u.length&&(e.eventProcessors=[...e.eventProcessors,...u]),h.length&&(e.attachments=[...e.attachments,...h]),e.propagationContext={...e.propagationContext,...f}}function Ip(e,t,r){e[t]=Nf(e[t],r,1)}function JG(e,t){const{extra:r,tags:n,user:i,contexts:o,level:s,transactionName:a}=t;Object.keys(r).length&&(e.extra={...r,...e.extra}),Object.keys(n).length&&(e.tags={...n,...e.tags}),Object.keys(i).length&&(e.user={...i,...e.user}),Object.keys(o).length&&(e.contexts={...o,...e.contexts}),s&&(e.level=s),a&&e.type!=="transaction"&&(e.transaction=a)}function QG(e,t){const r=[...e.breadcrumbs||[],...t];e.breadcrumbs=r.length?r:void 0}function eK(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function tK(e,t){e.contexts={trace:Ak(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:Zs(t),...e.sdkProcessingMetadata};const r=Wn(t),n=ir(r).description;n&&!e.transaction&&e.type==="transaction"&&(e.transaction=n)}function rK(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}let Pp,zw,Op;function nK(e){const t=Ht._sentryDebugIds;if(!t)return{};const r=Object.keys(t);return Op&&r.length===zw||(zw=r.length,Op=r.reduce((n,i)=>{Pp||(Pp={});const o=Pp[i];if(o)n[o[0]]=o[1];else{const s=e(i);for(let a=s.length-1;a>=0;a--){const l=s[a],d=l==null?void 0:l.filename,u=t[i];if(d&&u){n[d]=u,Pp[i]=[d,u];break}}}return n},{})),Op}function iK(e,t,r,n,i,o){const{normalizeDepth:s=3,normalizeMaxBreadth:a=1e3}=e,l={...t,event_id:t.event_id||r.event_id||to(),timestamp:t.timestamp||yc()},d=r.integrations||e.integrations.map(y=>y.name);oK(l,e),lK(l,d),i&&i.emit("applyFrameMetadata",t),t.type===void 0&&sK(l,e.stackParser);const u=uK(n,r.captureContext);r.mechanism&&ju(l,r.mechanism);const h=i?i.getEventProcessors():[],f=Sb().getScopeData();if(o){const y=o.getScopeData();P1(f,y)}if(u){const y=u.getScopeData();P1(f,y)}const p=[...r.attachments||[],...f.attachments];p.length&&(r.attachments=p),XG(l,f);const m=[...h,...f.eventProcessors];return iy(m,l,r).then(y=>(y&&aK(y),typeof s=="number"&&s>0?cK(y,s,a):y))}function oK(e,t){const{environment:r,release:n,dist:i,maxValueLength:o=250}=t;e.environment=e.environment||r||Rb,!e.release&&n&&(e.release=n),!e.dist&&i&&(e.dist=i);const s=e.request;s!=null&&s.url&&(s.url=T1(s.url,o))}function sK(e,t){var n,i;const r=nK(t);(i=(n=e.exception)==null?void 0:n.values)==null||i.forEach(o=>{var s,a;(a=(s=o.stacktrace)==null?void 0:s.frames)==null||a.forEach(l=>{l.filename&&(l.debug_id=r[l.filename])})})}function aK(e){var n,i;const t={};if((i=(n=e.exception)==null?void 0:n.values)==null||i.forEach(o=>{var s,a;(a=(s=o.stacktrace)==null?void 0:s.frames)==null||a.forEach(l=>{l.debug_id&&(l.abs_path?t[l.abs_path]=l.debug_id:l.filename&&(t[l.filename]=l.debug_id),delete l.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const r=e.debug_meta.images;Object.entries(t).forEach(([o,s])=>{r.push({type:"sourcemap",code_file:o,debug_id:s})})}function lK(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function cK(e,t,r){var i,o;if(!e)return null;const n={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(s=>({...s,...s.data&&{data:Wo(s.data,t,r)}}))},...e.user&&{user:Wo(e.user,t,r)},...e.contexts&&{contexts:Wo(e.contexts,t,r)},...e.extra&&{extra:Wo(e.extra,t,r)}};return(i=e.contexts)!=null&&i.trace&&n.contexts&&(n.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(n.contexts.trace.data=Wo(e.contexts.trace.data,t,r))),e.spans&&(n.spans=e.spans.map(s=>({...s,...s.data&&{data:Wo(s.data,t,r)}}))),(o=e.contexts)!=null&&o.flags&&n.contexts&&(n.contexts.flags=Wo(e.contexts.flags,3,r)),n}function uK(e,t){if(!t)return e;const r=e?e.clone():new gs;return r.update(t),r}function dK(e){if(e)return hK(e)?{captureContext:e}:pK(e)?{captureContext:e}:e}function hK(e){return e instanceof gs||typeof e=="function"}const fK=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function pK(e){return Object.keys(e).some(t=>fK.includes(t))}function Db(e,t){return cr().captureException(e,dK(t))}function y7e(e,t){const r=typeof t=="string"?t:void 0,n=typeof t!="string"?{captureContext:t}:void 0;return cr().captureMessage(e,r,n)}function Fk(e,t){return cr().captureEvent(e,t)}function mK(e,t){qn().setContext(e,t)}function _7e(e){qn().setExtras(e)}function b7e(e,t){qn().setExtra(e,t)}function x7e(e){qn().setTags(e)}function w7e(e,t){qn().setTag(e,t)}function E7e(e){qn().setUser(e)}async function S7e(e){const t=Yt();return t?t.flush(e):(ht&&st.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}function gK(){const e=Yt();return(e==null?void 0:e.getOptions().enabled)!==!1&&!!(e!=null&&e.getTransport())}function C7e(e){qn().addEventProcessor(e)}function Ww(e){const t=qn(),r=cr(),{userAgent:n}=Ht.navigator||{},i=Uq({user:r.getUser()||t.getUser(),...n&&{userAgent:n},...e}),o=t.getSession();return(o==null?void 0:o.status)==="ok"&&Lu(o,{status:"exited"}),Uk(),t.setSession(i),i}function Uk(){const e=qn(),r=cr().getSession()||e.getSession();r&&Bq(r),Bk(),e.setSession()}function Bk(){const e=qn(),t=Yt(),r=e.getSession();r&&t&&t.captureSession(r)}function qw(e=!1){if(e){Uk();return}Bk()}const vK="7";function yK(e){const t=e.protocol?`${e.protocol}:`:"",r=e.port?`:${e.port}`:"";return`${t}//${e.host}${r}${e.path?`/${e.path}`:""}/api/`}function _K(e){return`${yK(e)}${e.projectId}/envelope/`}function bK(e,t){const r={sentry_version:vK};return e.publicKey&&(r.sentry_key=e.publicKey),t&&(r.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(r).toString()}function xK(e,t,r){return t||`${_K(e)}?${bK(e,r)}`}const Gw=[];function wK(e){const t={};return e.forEach(r=>{const{name:n}=r,i=t[n];i&&!i.isDefaultInstance&&r.isDefaultInstance||(t[n]=r)}),Object.values(t)}function Vk(e){const t=e.defaultIntegrations||[],r=e.integrations;t.forEach(i=>
122{i.isDefaultInstance=!0});let n;if(Array.isArray(r))n=[...t,...r];else if(typeof r=="function"){const i=r(t);n=Array.isArray(i)?i:[i]}else n=t;return wK(n)}function EK(e,t){const r={};return t.forEach(n=>{n&&Hk(e,n,r)}),r}function Kw(e,t){for(const r of t)r!=null&&r.afterAllSetup&&r.afterAllSetup(e)}function Hk(e,t,r){if(r[t.name]){ht&&st.log(`Integration skipped because it was already installed: ${t.name}`);return}if(r[t.name]=t,Gw.indexOf(t.name)===-1&&typeof t.setupOnce=="function"&&(t.setupOnce(),Gw.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",(i,o)=>n(i,o,e))}if(typeof t.processEvent=="function"){const n=t.processEvent.bind(t),i=Object.assign((o,s)=>n(o,s,e),{id:t.name});e.addEventProcessor(i)}ht&&st.log(`Integration installed: ${t.name}`)}function SK(e){const t=Yt();if(!t){ht&&st.warn(`Cannot add integration "${e.name}" because no SDK Client is available.`);return}t.addIntegration(e)}function CK(e,t,r){const n=[{type:"client_report"},{timestamp:r||yc(),discarded_events:e}];return ad(t?{dsn:t}:{},[n])}function zk(e){const t=[];e.message&&t.push(e.message);try{const r=e.exception.values[e.exception.values.length-1];r!=null&&r.value&&(t.push(r.value),r.type&&t.push(`${r.type}: ${r.value}`))}catch{}return t}function TK(e){var l;const{trace_id:t,parent_span_id:r,span_id:n,status:i,origin:o,data:s,op:a}=((l=e.contexts)==null?void 0:l.trace)??{};return{data:s??{},description:e.transaction,op:a,parent_span_id:r,span_id:n??"",start_timestamp:e.start_timestamp??0,status:i,timestamp:e.timestamp,trace_id:t??"",origin:o,profile_id:s==null?void 0:s[Tb],exclusive_time:s==null?void 0:s[sd],measurements:e.measurements,is_segment:!0}}function AK(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[Tb]:e.profile_id},...e.exclusive_time&&{[sd]:e.exclusive_time}}}},measurements:e.measurements}}const Yw="Not capturing exception because it's already been captured.",Zw="Discarded session because of missing or non-string release",Wk=Symbol.for("SentryInternalError"),qk=Symbol.for("SentryDoNotSendEventError");function k0(e){return{message:e,[Wk]:!0}}function k2(e){return{message:e,[qk]:!0}}function Xw(e){return!!e&&typeof e=="object"&&Wk in e}function Jw(e){return!!e&&typeof e=="object"&&qk in e}class kK{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],t.dsn?this._dsn=bG(t.dsn):ht&&st.warn("No DSN provided, client will not send events."),this._dsn){const r=xK(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:r})}}captureException(t,r,n){const i=to();if(Aw(t))return ht&&st.log(Yw),i;const o={event_id:i,...r};return this._process(this.eventFromException(t,o).then(s=>this._captureEvent(s,o,n))),o.event_id}captureMessage(t,r,n,i){const o={event_id:to(),...n},s=ng(t)?t:String(t),a=Qh(t)?this.eventFromMessage(s,r,o):this.eventFromException(t,o);return this._process(a.then(l=>this._captureEvent(l,o,i))),o.event_id}captureEvent(t,r,n){const i=to();if(r!=null&&r.originalException&&Aw(r.originalException))return ht&&st.log(Yw),i;const o={event_id:i,...r},s=t.sdkProcessingMetadata||{},a=s.capturedSpanScope,l=s.capturedSpanIsolationScope;return this._process(this._captureEvent(t,o,a||n,l)),o.event_id}captureSession(t){this.sendSession(t),Lu(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(t){const r=this._transport;
122return r?(this.emit("flush"),this._isClientDoneProcessing(t).then(n=>r.flush(t).then(i=>n&&i))):cc(!0)}close(t){return this.flush(t).then(r=>(this.getOptions().enabled=!1,this.emit("close"),r))}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){const r=this._integrations[t.name];Hk(this,t,this._integrations),r||Kw(this,[t])}sendEvent(t,r={}){this.emit("beforeSendEvent",t,r);let n=FG(t,this._dsn,this._options._metadata,this._options.tunnel);for(const o of r.attachments||[])n=IG(n,LG(o));const i=this.sendEnvelope(n);i&&i.then(o=>this.emit("afterSendEvent",t,o),null)}sendSession(t){const{release:r,environment:n=Rb}=this._options;if("aggregates"in t){const o=t.attrs||{};if(!o.release&&!r){ht&&st.warn(Zw);return}o.release=o.release||r,o.environment=o.environment||n,t.attrs=o}else{if(!t.release&&!r){ht&&st.warn(Zw);return}t.release=t.release||r,t.environment=t.environment||n}this.emit("beforeSendSession",t);const i=NG(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(i)}recordDroppedEvent(t,r,n=1){if(this._options.sendClientReports){const i=`${t}:${r}`;ht&&st.log(`Recording outcome: "${i}"${n>1?` (${n} times)`:""}`),this._outcomes[i]=(this._outcomes[i]||0)+n}}on(t,r){const n=this._hooks[t]=this._hooks[t]||[];return n.push(r),()=>{const i=n.indexOf(r);i>-1&&n.splice(i,1)}}emit(t,...r){const n=this._hooks[t];n&&n.forEach(i=>i(...r))}sendEnvelope(t){return this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport?this._transport.send(t).then(null,r=>(ht&&st.error("Error while sending envelope:",r),r)):(ht&&st.error("Transport disabled"),cc({}))}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=EK(this,t),Kw(this,t)}_updateSessionFromEvent(t,r){var l;let n=r.level==="fatal",i=!1;const o=(l=r.exception)==null?void 0:l.values;if(o){i=!0;for(const d of o){const u=d.mechanism;if((u==null?void 0:u.handled)===!1){n=!0;break}}}const s=t.status==="ok";(s&&t.errors===0||s&&n)&&(Lu(t,{...n&&{status:"crashed"},errors:t.errors||Number(i||n)}),this.captureSession(t))}_isClientDoneProcessing(t){return new Ga(r=>{let n=0;const i=1,o=setInterval(()=>{this._numProcessing==0?(clearInterval(o),r(!0)):(n+=i,t&&n>=t&&(clearInterval(o),r(!1)))},i)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,r,n,i){const o=this.getOptions(),s=Object.keys(this._integrations);return!r.integrations&&(s!=null&&s.length)&&(r.integrations=s),this.emit("preprocessEvent",t,r),t.type||i.setLastEventId(t.event_id||r.event_id),iK(o,t,r,n,this,i).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,r),a.contexts={trace:vk(n),...a.contexts};const l=Ib(this,n);return a.sdkProcessingMetadata={dynamicSamplingContext:l,...a.sdkProcessingMetadata},a})}_captureEvent(t,r={},n=cr(),i=qn()){return ht&&oy(t)&&st.log(`Captured error event \`${zk(t)[0]||"<unknown>"}\``),this._processEvent(t,r,n,i).then(o=>o.event_id,o=>{ht&&(Jw(o)?st.log(o.message):Xw(o)?st.warn(o.message):st.warn(o))})}_processEvent(t,r,n,i){const o=this.getOptions(),{sampleRate:s}=o,a=Gk(t),l=oy(t),d=t.type||"error",u=`before send for type \`${d}\``,h=typeof s>"u"?void 0:rf(s);if(l&&typeof h=="number"&&Math.random()>h)return this.recordDroppedEvent("sample_rate","error"),I1(k2(`Discarding event because it's not included in the random sample (sampling rate = ${s})`));const f=d==="replay_event"?"replay":d;return this._prepareEvent(t,r,n,i).then(p=>{if(p===null)throw this.recordDroppedEvent("event_processor",f),k2("An event processor returned `null`, will not send event.");if(r.data&&r.data.__sentry__===!0)return p;const g=IK(this,o,p,r);return RK(g,u)}).then(p=>{var y;if(p===null){if(this.recordDroppedEvent("before_send",f),a){const E=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",E)}throw k2(`${u} returned \`null\`, will not send event.`)}const m=n.getSession()||i.getSession();if(l&&m&&this._updateSessionFromEvent(m,p),a){const b=((y=p.sdkProcessingMetadata)==null?void 0:y.spanCountBeforeProcessing)||0,E=p.spans?p.spans.length:0,S=b-E;S>0&&this.recordDroppedEvent("before_send","span",S)}const g=p.transaction_info;if(a&&g&&p.transaction!==t.transaction){const b="custom";p.transaction_info={...g,source:b}}return this.sendEvent(p,r),p}).then(null,p=>{throw Jw(p)||Xw(p)?p:(this.captureException(p,{data:{__sentry__:!0},originalException:p}),k0(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event. 123Reason: ${p}`))})}_process(t){this._numProcessing++,t.then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([r,n])=>{const[i,o]=r.split(":");return{reason:i,category:o,quantity:n}})}_flushOutcomes(){ht&&st.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){ht&&st.log("No outcomes to send");return}if(!this._dsn){ht&&st.log("No dsn provided, will not send outcomes");return}ht&&st.log("Sending outcomes:",t);const r=CK(t,this._options.tunnel&&Vf(this._dsn));this.sendEnvelope(r)}}function RK(e,t){const r=`${t} must return \`null\` or a valid event.`;if(Df(e))return e.then(n=>{if(!ef(n)&&n!==null)throw k0(r);return n},n=>{throw k0(`${t} rejected with ${n}`)});if(!ef(e)&&e!==null)throw k0(r);return e}function IK(e,t,r,n){const{beforeSend:i,beforeSendTransaction:o,beforeSendSpan:s}=t;let a=r;if(oy(a)&&i)return i(a,n);if(Gk(a)){if(s){const l=s(TK(a));if(l?a=Nf(r,AK(l)):ey(),a.spans){const d=[];for(const u of a.spans){const h=s(u);h?d.push(h):(ey(),d.push(u))}a.spans=d}}if(o){if(a.spans){const l=a.spans.length;a.sdkProcessingMetadata={...r.sdkProcessingMetadata,spanCountBeforeProcessing:l}}return o(a,n)}}return a}function oy(e){return e.type===void 0}function Gk(e){return e.type==="transaction"}function PK(e,t){return t?_c(t,()=>{const r=li(),n=r?Ak(r):vk(t);return[r?Zs(r):Ib(e,t),n]}):[void 0,void 0]}const OK={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function jK(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function LK(e,t,r,n){const i={};return t!=null&&t.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),r&&n&&(i.dsn=Vf(n)),ad(i,[jK(e)])}const $K=100;Ht._sentryClientToLogBufferMap=new WeakMap;function DK(e){switch(typeof e){case"number":return Number.isInteger(e)?{value:e,type:"integer"}:{value:e,type:"double"};case"boolean":return{value:e,type:"boolean"};case"string":return{value:e,type:"string"};default:{let t="";try{t=JSON.stringify(e)??""}catch{}return{value:t,type:"string"}}}}function ma(e,t,r,n=!0){r&&(!e[t]||n)&&(e[t]=r)}function MK(e,t){var n,i;const r=Kk(e);r===void 0?(n=Ht._sentryClientToLogBufferMap)==null||n.set(e,[t]):((i=Ht._sentryClientToLogBufferMap)==null||i.set(e,[...r,t]),r.length>=$K&&R0(e,r))}function T7e(e,t=Yt(),r=cr(),n=MK){var C;if(!t){ht&&st.warn("No client available to capture log.");return}const{_experiments:i,release:o,environment:s}=t.getOptions(),{enableLogs:a=!1,beforeSendLog:l}=i??{};if(!a){ht&&st.warn("logging option not enabled, log will not be captured.");return}const[,d]=PK(t,r),u={...e.attributes},{user:{id:h,email:f,username:p}}=NK(r);ma(u,"user.id",h,!1),ma(u,"user.email",f,!1),ma(u,"user.name",p,!1),ma(u,"sentry.release",o),ma(u,"sentry.environment",s);const{name:m,version:g}=((C=t.getSdkMetadata())==null?void 0:C.sdk)??{};ma(u,"sentry.sdk.name",m),ma(u,"sentry.sdk.version",g);const y=e.message;
123if(ng(y)){const{__sentry_template_string__:P,__sentry_template_values__:I=[]}=y;u["sentry.message.template"]=P,I.forEach((O,D)=>{u[`sentry.message.parameter.${D}`]=O})}const b=tf(r);ma(u,"sentry.trace.parent_span_id",b==null?void 0:b.spanContext().spanId);const E={...e,attributes:u};t.emit("beforeCaptureLog",E);const S=l?l(E):E;if(!S){t.recordDroppedEvent("before_send","log_item",1),ht&&st.warn("beforeSendLog returned null, log will not be captured.");return}const{level:k,message:A,attributes:w={},severityNumber:_}=S,x={timestamp:_n(),level:k,body:A,trace_id:d==null?void 0:d.trace_id,severity_number:_??OK[k],attributes:Object.keys(w).reduce((P,I)=>(P[I]=DK(w[I]),P),{})};n(t,x),t.emit("afterCaptureLog",S)}function R0(e,t){var o;const r=t??Kk(e)??[];if(r.length===0)return;const n=e.getOptions(),i=LK(r,n._metadata,n.tunnel,e.getDsn());(o=Ht._sentryClientToLogBufferMap)==null||o.set(e,[]),e.emit("flushLogs"),e.sendEnvelope(i)}function Kk(e){var t;return(t=Ht._sentryClientToLogBufferMap)==null?void 0:t.get(e)}function NK(e){const t=Sb().getScopeData();return P1(t,qn().getScopeData()),P1(t,e.getScopeData()),t}function FK(e,t){t.debug===!0&&(ht?st.enable():nd(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),cr().update(t.initialScope);const n=new e(t);return UK(n),n.init(),n}function UK(e){cr().setClient(e)}const Yk=Symbol.for("SentryBufferFullError");function Zk(e){const t=[];function r(){return e===void 0||t.length<e}function n(s){return t.splice(t.indexOf(s),1)[0]||Promise.resolve(void 0)}function i(s){if(!r())return I1(Yk);const a=s();return t.indexOf(a)===-1&&t.push(a),a.then(()=>n(a)).then(null,()=>n(a).then(null,()=>{})),a}function o(s){return new Ga((a,l)=>{let d=t.length;if(!d)return a(!0);const u=setTimeout(()=>{s&&s>0&&a(!1)},s);t.forEach(h=>{cc(h).then(()=>{--d||(clearTimeout(u),a(!0))},l)})})}return{$:t,add:i,drain:o}}const BK=60*1e3;function VK(e,t=Date.now()){const r=parseInt(`${e}`,10);if(!isNaN(r))return r*1e3;const n=Date.parse(`${e}`);return isNaN(n)?BK:n-t}function HK(e,t){return e[t]||e.all||0}function zK(e,t,r=Date.now()){return HK(e,t)>r}function WK(e,{statusCode:t,headers:r},n=Date.now()){const i={...e},o=r==null?void 0:r["x-sentry-rate-limits"],s=r==null?void 0:r["retry-after"];if(o)for(const a of o.trim().split(",")){const[l,d,,,u]=a.split(":",5),h=parseInt(l,10),f=(isNaN(h)?60:h)*1e3;if(!d)i.all=n+f;else for(const p of d.split(";"))p==="metric_bucket"?(!u||u.split(";").includes("custom"))&&(i[p]=n+f):i[p]=n+f}else s?i.all=n+VK(s,n):t===429&&(i.all=n+60*1e3);return i}const qK=64;function GK(e,t,r=Zk(e.bufferSize||qK)){let n={};const i=s=>r.drain(s);function o(s){const a=[];if($w(s,(h,f)=>{const p=Dw(f);zK(n,p)?e.recordDroppedEvent("ratelimit_backoff",p):a.push(h)}),a.length===0)return cc({});const l=ad(s[0],a),d=h=>{$w(l,(f,p)=>{e.recordDroppedEvent(h,Dw(p))})},u=()=>t({body:PG(l)}).then(h=>(h.statusCode!==void 0&&(h.statusCode<200||h.statusCode>=300)&&ht&&st.warn(`Sentry responded with status code ${h.statusCode} to sent event.`),n=WK(n,h),h),h=>{throw d("network_error"),ht&&st.error("Encountered error running transport request:",h),h});return r.add(u).then(h=>h,h=>{if(h===Yk)return ht&&st.error("Skipped sending event because buffer is full."),d("queue_overflow"),cc({});throw h})}return{send:o,flush:i}}function KK(e){var t;((t=e.user)==null?void 0:t.ip_address)===void 0&&(e.user={...e.user,ip_address:"{{auto}}"})}function YK(e){var t;"aggregates"in e?((t=e.attrs)==null?void 0:t.ip_address)===void 0&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function Xk(e,t,r=[t],n="npm"){const i=e._metadata||{};i.sdk||(i.sdk={name:`sentry.javascript.${t}`,packages:r.map(o=>({name:`${n}:@sentry/${o}`,version:cs})),version:cs}),e._metadata=i}function Jk(e={}){const t=e.client||Yt();if(!gK()||!t)return{};const r=il(),n=od(r);if(n.getTraceData)return n.getTraceData(e);const i=e.scope||cr(),o=e.span||li(),s=o?cG(o):ZK(i),a=o?Zs(o):Ib(t,i),l=rG(a);return Sk.test(s)?{"sentry-trace":s,baggage:l}:(st.warn("Invalid sentry-trace data. Cannot generate trace data"),{})}function ZK(e){const{traceId:t,sampled:r,propagationSpanId:n}=e.getPropagationContext();return Ck(t,n,r)}const XK=100;function uc(e,t){const r=Yt(),n=qn();if(!r)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:o=XK}=r.getOptions();if(o<=0)return;const a={timestamp:yc(),...e},l=i?nd(()=>i(a,t)):a;l!==null&&(r.emit&&r.emit("beforeAddBreadcrumb",l,t),n.addBreadcrumb(l,o))}let Qw;const JK="FunctionToString",e8=new WeakMap,QK=()=>({name:JK,setupOnce(){Qw=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Eb(this),r=e8.has(Yt())&&t!==void 0?t:this;return Qw.apply(r,e)}}catch{}},setup(e){e8.set(e,!0)}}),eY=QK,tY=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,`can't redefine non-configurable property "solana"`,"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],rY="EventFilters",nY=(e={})=>{let t;return{name:rY,setup(r){const n=r.getOptions();t=t8(e,n)},processEvent(r,n,i){if(!t){const o=i.getOptions();t=t8(e,o)}return oY(r,t)?null:r}}},iY=(e={})=>({...nY(e),name:"InboundFilters"});function t8(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:tY],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function oY(e,t){if(e.type){if(e.type==="transaction"&&aY(e,t.ignoreTransactions))return ht&&st.warn(`Event dropped due to being matched by \`ignoreTransactions\` option. 124Event: ${Il(e)}`),!0}else{if(sY(e,t.ignoreErrors))return ht&&st.warn(`Event dropped due to being matched by \`ignoreErrors\` option. 125Event: ${Il(e)}`),!0;if(dY(e))return ht&&st.warn(`Event dropped due to not having an error message, error type or stacktrace. 126Event: ${Il(e)}`),!0;if(lY(e,t.denyUrls))return ht&&st.warn(`Event dropped due to being matched by \`denyUrls\` option. 127Event: ${Il(e)}. 128Url: ${O1(e)}`),!0;if(!cY(e,t.allowUrls))return ht&&st.warn(`Event dropped due to not being matched by \`allowUrls\` option. 129Event: ${Il(e)}. 130Url: ${O1(e)}`),!0}return!1}function sY(e,t){return t!=null&&t.length?zk(e).some(r=>Fa(r,t)):!1}function aY(e,t){if(!(t!=null&&t.length))return!1;const r=e.transaction;return r?Fa(r,t):!1}
130function lY(e,t){if(!(t!=null&&t.length))return!1;const r=O1(e);return r?Fa(r,t):!1}function cY(e,t){if(!(t!=null&&t.length))return!0;const r=O1(e);return r?Fa(r,t):!0}function uY(e=[]){for(let t=e.length-1;t>=0;t--){const r=e[t];if(r&&r.filename!=="<anonymous>"&&r.filename!=="[native code]")return r.filename||null}return null}function O1(e){var t,r;try{const n=[...((t=e.exception)==null?void 0:t.values)??[]].reverse().find(o=>{var s,a,l;return((s=o.mechanism)==null?void 0:s.parent_id)===void 0&&((l=(a=o.stacktrace)==null?void 0:a.frames)==null?void 0:l.length)}),i=(r=n==null?void 0:n.stacktrace)==null?void 0:r.frames;return i?uY(i):null}catch{return ht&&st.error(`Cannot extract url for event ${Il(e)}`),null}}function dY(e){var t,r;return(r=(t=e.exception)==null?void 0:t.values)!=null&&r.length?!e.message&&!e.exception.values.some(n=>n.stacktrace||n.type&&n.type!=="Error"||n.value):!1}function hY(e,t,r,n,i,o){var a;if(!((a=i.exception)!=null&&a.values)||!o||!Ks(o.originalException,Error))return;const s=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;s&&(i.exception.values=sy(e,t,n,o.originalException,r,i.exception.values,s,0))}function sy(e,t,r,n,i,o,s,a){if(o.length>=r+1)return o;let l=[...o];if(Ks(n[i],Error)){r8(s,a);const d=e(t,n[i]),u=l.length;n8(d,i,u,a),l=sy(e,t,r,n[i],i,[d,...l],d,u)}return Array.isArray(n.errors)&&n.errors.forEach((d,u)=>{if(Ks(d,Error)){r8(s,a);const h=e(t,d),f=l.length;n8(h,`errors[${u}]`,f,a),l=sy(e,t,r,d,i,[h,...l],h,f)}}),l}function r8(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,...e.type==="AggregateError"&&{is_exception_group:!0},exception_id:t}}function n8(e,t,r,n){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:r,parent_id:n}}function fY(e){const t="console";ol(t,e),sl(t,pY)}function pY(){"console"in Ht&&yq.forEach(function(e){e in Ht.console&&Ei(Ht.console,e,function(t){return C1[e]=t,function(...r){eo("console",{args:r,level:e});const i=C1[e];i==null||i.apply(Ht.console,r)}})})}function mY(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const gY="Dedupe",vY=()=>{let e;return{name:gY,processEvent(t){if(t.type)return t;try{if(_Y(t,e))return ht&&st.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}},yY=vY;function _Y(e,t){return t?!!(bY(e,t)||xY(e,t)):!1}function bY(e,t){const r=e.message,n=t.message;return!(!r&&!n||r&&!n||!r&&n||r!==n||!eR(e,t)||!Qk(e,t))}function xY(e,t){const r=i8(t),n=i8(e);return!(!r||!n||r.type!==n.type||r.value!==n.value||!eR(e,t)||!Qk(e,t))}function Qk(e,t){let r=xw(e),n=xw(t);if(!r&&!n)return!0;if(r&&!n||!r&&n||(r=r,n=n,n.length!==r.length))return!1;for(let i=0;i<n.length;i++){const o=n[i],s=r[i];if(o.filename!==s.filename||o.lineno!==s.lineno||o.colno!==s.colno||o.function!==s.function)return!1}return!0}function eR(e,t){let r=e.fingerprint,n=t.fingerprint;if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;r=r,n=n;try{return r.join("")===n.join("")}catch{return!1}}function i8(e){var t;return((t=e.exception)==null?void 0:t.values)&&e.exception.values[0]}function wY(e,t){let r=0;for(let n=e.length-1;n>=0;n--){const i=e[n];i==="."?e.splice(n,1):i===".."?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}const EY=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function SY(e){const t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,r=EY.exec(t);return r?r.slice(1):[]}function o8(...e){let t="",r=!1;for(let n=e.length-1;n>=-1&&!r;n--){const i=n>=0?e[n]:"/";i&&(t=`${i}/${t}`,r=i.charAt(0)==="/")}return t=wY(t.split("/").filter(n=>!!n),!r).join("/"),(r?"/":"")+t||"."}function s8(e){let t=0;for(;t<e.length&&e[t]==="";t++);let r=e.length-1;for(;r>=0&&e[r]==="";r--);return t>r?[]:e.slice(t,r-t+1)}function CY(e,t){e=o8(e).slice(1),t=o8(t).slice(1);const r=s8(e.split("/")),n=s8(t.split("/")),i=Math.min(r.length,n.length);let o=i;for(let a=0;a<i;a++)if(r[a]!==n[a]){o=a;break}let s=[];for(let a=o;a<r.length;a++)s.push("..");return s=s.concat(n.slice(o)),s.join("/")}function TY(e,t){let r=SY(e)[2]||"";return t&&r.slice(t.length*-1)===t&&(r=r.slice(0,r.length-t.length)),r}const AY="RewriteFrames",kY=(e={})=>{const t=e.root,r=e.prefix||"app:///",n="window"in Ht&&!!Ht.window,i=e.iteratee||RY({isBrowser:n,root:t,prefix:r});function o(a){try{return{...a,exception:{...a.exception,values:a.exception.values.map(l
130=>({...l,...l.stacktrace&&{stacktrace:s(l.stacktrace)}}))}}}catch{return a}}function s(a){return{...a,frames:(a==null?void 0:a.frames)&&a.frames.map(l=>i(l))}}return{name:AY,processEvent(a){let l=a;return a.exception&&Array.isArray(a.exception.values)&&(l=o(l)),l}}};function RY({isBrowser:e,root:t,prefix:r}){return n=>{if(!n.filename)return n;const i=/^[a-zA-Z]:\\/.test(n.filename)||n.filename.includes("\\")&&!n.filename.includes("/"),o=/^\//.test(n.filename);if(e){if(t){const s=n.filename;s.indexOf(t)===0&&(n.filename=s.replace(t,r))}}else if(i||o){const s=i?n.filename.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"):n.filename,a=t?CY(t,s):TY(s);n.filename=`${r}${a}`}return n}}const IY="thismessage:/";function tR(e){return"isRelative"in e}function rR(e,t){const r=e.indexOf("://")<=0&&e.indexOf("//")!==0,n=t??(r?IY:void 0);try{if("canParse"in URL&&!URL.canParse(e,n))return;const i=new URL(e,n);return r?{isRelative:r,pathname:i.pathname,search:i.search,hash:i.hash}:i}catch{}}function PY(e){if(tR(e))return e.pathname;const t=new URL(e);return t.search="",t.hash="",["80","443"].includes(t.port)&&(t.port=""),t.password&&(t.password="%filtered%"),t.username&&(t.username="%filtered%"),t.toString()}function Kl(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const r=t[6]||"",n=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:r,hash:n,relative:t[5]+r+n}}function OY(e){return e.split(/[?#]/,1)[0]}function jY(e,t,r,n,i="auto.http.browser"){if(!e.fetchData)return;const{method:o,url:s}=e.fetchData,a=qa()&&t(s);if(e.endTimestamp&&a){const h=e.fetchData.__span;if(!h)return;const f=n[h];f&&($Y(f,e),delete n[h]);return}const l=!!li(),d=a&&l?ld(MY(s,o,i)):new Xs;if(e.fetchData.__span=d.spanContext().spanId,n[d.spanContext().spanId]=d,r(e.fetchData.url)){const h=e.args[0],f=e.args[1]||{},p=LY(h,f,qa()&&l?d:void 0);p&&(e.args[1]=f,f.headers=p)}const u=Yt();if(u){const h={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};u.emit("beforeOutgoingRequestSpan",d,h)}return d}function LY(e,t,r){const n=Jk({span:r}),i=n["sentry-trace"],o=n.baggage;if(!i)return;const s=t.headers||(dk(e)?e.headers:void 0);if(s)if(DY(s)){const a=new Headers(s);if(a.get("sentry-trace")||a.set("sentry-trace",i),o){const l=a.get("baggage");l?jp(l)||a.set("baggage",`${l},${o}`):a.set("baggage",o)}return a}else if(Array.isArray(s)){const a=[...s];s.find(d=>d[0]==="sentry-trace")||a.push(["sentry-trace",i]);const l=s.find(d=>d[0]==="baggage"&&jp(d[1]));return o&&!l&&a.push(["baggage",o]),a}else{const a="sentry-trace"in s?s["sentry-trace"]:void 0,l="baggage"in s?s.baggage:void 0,d=l?Array.isArray(l)?[...l]:[l]:[],u=l&&(Array.isArray(l)?l.find(h=>jp(h)):jp(l));return o&&!u&&d.push(o),{...s,"sentry-trace":a??i,baggage:d.length>0?d.join(","):void 0}}else return{...n}}function $Y(e,t){var r;if(t.response){bk(e,t.response.status);const n=((r=t.response)==null?void 0:r.headers)&&t.response.headers.get("content-length");if(n){const i=parseInt(n);i>0&&e.setAttribute("http.response_content_length",i)}}else t.error&&e.setStatus({code:en,message:"internal_error"});e.end()}function jp(e){return e.split(",").some(t=>t.trim().startsWith(Ab))}function DY(e){return typeof Headers<"u"&&Ks(e,Headers)}function MY(e,t,r){const n=rR(e);return{name:n?`${t} ${PY(n)}`:t,attributes:NY(e,n,t,r)}}function NY(e,t,r,n){const i={url:e,type:"fetch","http.method":r,[on]:n,[Ys]:"http.client"};return t&&(tR(t)||(i["http.url"]=t.href,i["server.address"]=t.host),t.search&&(i["http.query"]=t.search),t.hash&&(i["http.fragment"]=t.hash)),i}function nR(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const nf=Ht;function FY(){return"history"in nf&&!!nf.history}function UY(){if(!("fetch"in nf))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function ay(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function BY(){var r;if(typeof EdgeRuntime=="string")return!0;if(!UY())return!1;if(ay(nf.fetch))return!0;let e=!1;const t=nf.document;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),(r=n.contentWindow)!=null&&r.fetch&&(e=ay(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){ht&&st.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n
130)}return e}function iR(e,t){const r="fetch";ol(r,e),sl(r,()=>oR(void 0,t))}function VY(e){const t="fetch-body-resolved";ol(t,e),sl(t,()=>oR(zY))}function oR(e,t=!1){t&&!BY()||Ei(Ht,"fetch",function(r){return function(...n){const i=new Error,{method:o,url:s}=WY(n),a={args:n,fetchData:{method:o,url:s},startTimestamp:_n()*1e3,virtualError:i,headers:qY(n)};return e||eo("fetch",{...a}),r.apply(Ht,n).then(async l=>(e?e(l):eo("fetch",{...a,endTimestamp:_n()*1e3,response:l}),l),l=>{if(eo("fetch",{...a,endTimestamp:_n()*1e3,error:l}),xb(l)&&l.stack===void 0&&(l.stack=i.stack,Ui(l,"framesToPop",1)),l instanceof TypeError&&(l.message==="Failed to fetch"||l.message==="Load failed"||l.message==="NetworkError when attempting to fetch resource."))try{const d=new URL(a.fetchData.url);l.message=`${l.message} (${d.host})`}catch{}throw l})}})}async function HY(e,t){if(e!=null&&e.body){const r=e.body,n=r.getReader(),i=setTimeout(()=>{r.cancel().then(null,()=>{})},90*1e3);let o=!0;for(;o;){let s;try{s=setTimeout(()=>{r.cancel().then(null,()=>{})},5e3);const{done:a}=await n.read();clearTimeout(s),a&&(t(),o=!1)}catch{o=!1}finally{clearTimeout(s)}}clearTimeout(i),n.releaseLock(),r.cancel().then(null,()=>{})}}function zY(e){let t;try{t=e.clone()}catch{return}HY(t,()=>{eo("fetch-body-resolved",{endTimestamp:_n()*1e3,response:e})})}function ly(e,t){return!!e&&typeof e=="object"&&!!e[t]}function a8(e){return typeof e=="string"?e:e?ly(e,"url")?e.url:e.toString?e.toString():"":""}function WY(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[r,n]=e;return{url:a8(r),method:ly(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:a8(t),method:ly(t,"method")?String(t.method).toUpperCase():"GET"}}function qY(e){const[t,r]=e;try{if(typeof r=="object"&&r!==null&&"headers"in r&&r.headers)return new Headers(r.headers);if(dk(t))return new Headers(t.headers)}catch{}}function A7e(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function GY(){return"npm"}const Nt=Ht;let cy=0;function sR(){return cy>0}function KY(){cy++,setTimeout(()=>{cy--})}function Du(e,t={}){function r(i){return typeof i=="function"}if(!r(e))return e;try{const i=e.__sentry_wrapped__;if(i)return typeof i=="function"?i:e;if(Eb(e))return e}catch{return e}const n=function(...i){try{const o=i.map(s=>Du(s,t));return e.apply(this,o)}catch(o){throw KY(),_c(s=>{s.addEventProcessor(a=>(t.mechanism&&(X5(a,void 0,void 0),ju(a,t.mechanism)),a.extra={...a.extra,arguments:i},a)),Db(o)}),o}};try{for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}catch{}fk(n,e),Ui(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get(){return e.name}})}catch{}return n}function Mb(){const e=Mf(),{referrer:t}=Nt.document||{},{userAgent:r}=Nt.navigator||{},n={...t&&{Referer:t},...r&&{"User-Agent":r}};return{url:e,headers:n}}const YY={replayIntegration:"replay",replayCanvasIntegration:"replay-canvas",feedbackIntegration:"feedback",feedbackModalIntegration:"feedback-modal",feedbackScreenshotIntegration:"feedback-screenshot",captureConsoleIntegration:"captureconsole",contextLinesIntegration:"contextlines",linkedErrorsIntegration:"linkederrors",dedupeIntegration:"dedupe",extraErrorDataIntegration:"extraerrordata",graphqlClientIntegration:"graphqlclient",httpClientIntegration:"httpclient",reportingObserverIntegration:"reportingobserver",rewriteFramesIntegration:"rewriteframes",browserProfilingIntegration:"browserprofiling",moduleMetadataIntegration:"modulemetadata"},l8=Nt;async function ZY(e,t){const r=YY[e],n=l8.Sentry=l8.Sentry||{};if(!r)throw new Error(`Cannot lazy load integration: ${e}`);const i=n[e];if(typeof i=="function"&&!("_isShim"in i))return i;const o=XY(r),s=Nt.document.createElement("script");s.src=o,s.crossOrigin="anonymous",s.referrerPolicy="strict-origin",t&&s.setAttribute("nonce",t);const a=new Promise((h,f)=>{s.addEventListener("load",()=>h()),s.addEventListener("error",f)}),l=Nt.document.currentScript,d=Nt.document.body||Nt.document.head||(l==null?void 0:l.parentElement);if(d)d.appendChild(s);else throw new Error(`Could not find parent element to insert lazy-loaded ${e} script`);try{await a}catch{throw new Error(`Error when loading integration: ${e}`)}const u=n[e];if(typeof u!="function")throw new Error(`Could not load integration: ${e}`);return u}function XY(e){var n;const t=Yt(),r=((n=t==null?void 0:t.getOptions())==null?void 0:n.cdnBaseUrl)||"https://browser.sentry-cdn.com";return new URL(`/${cs}
130/${e}.min.js`,r).toString()}function Nb(e,t){const r=Fb(e,t),n={type:rZ(t),value:nZ(t)};return r.length&&(n.stacktrace={frames:r}),n.type===void 0&&n.value===""&&(n.value="Unrecoverable error caught"),n}function JY(e,t,r,n){const i=Yt(),o=i==null?void 0:i.getOptions().normalizeDepth,s=lZ(t),a={__serialized__:$k(t,o)};if(s)return{exception:{values:[Nb(e,s)]},extra:a};const l={exception:{values:[{type:ig(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:sZ(t,{isUnhandledRejection:n})}]},extra:a};if(r){const d=Fb(e,r);d.length&&(l.exception.values[0].stacktrace={frames:d})}return l}function R2(e,t){return{exception:{values:[Nb(e,t)]}}}function Fb(e,t){const r=t.stacktrace||t.stack||"",n=eZ(t),i=tZ(t);try{return e(r,n,i)}catch{}return[]}const QY=/Minified React error #\d+;/i;function eZ(e){return e&&QY.test(e.message)?1:0}function tZ(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function aR(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function rZ(e){const t=e==null?void 0:e.name;return!t&&aR(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function nZ(e){const t=e==null?void 0:e.message;return aR(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?t.error.message:t:"No error message"}function iZ(e,t,r,n){const i=(r==null?void 0:r.syntheticException)||void 0,o=Ub(e,t,i,n);return ju(o),o.level="error",r!=null&&r.event_id&&(o.event_id=r.event_id),cc(o)}function oZ(e,t,r="info",n,i){const o=(n==null?void 0:n.syntheticException)||void 0,s=uy(e,t,o,i);return s.level=r,n!=null&&n.event_id&&(s.event_id=n.event_id),cc(s)}function Ub(e,t,r,n,i){let o;if(ck(t)&&t.error)return R2(e,t.error);if(Ew(t)||kq(t)){const s=t;if("stack"in t)o=R2(e,t);else{const a=s.name||(Ew(s)?"DOMError":"DOMException"),l=s.message?`${a}: ${s.message}`:a;o=uy(e,l,r,n),X5(o,l)}return"code"in s&&(o.tags={...o.tags,"DOMException.code":`${s.code}`}),o}return xb(t)?R2(e,t):ef(t)||ig(t)?(o=JY(e,t,r,i),ju(o,{synthetic:!0}),o):(o=uy(e,t,r,n),X5(o,`${t}`,void 0),ju(o,{synthetic:!0}),o)}function uy(e,t,r,n){const i={};if(n&&r){const o=Fb(e,r);o.length&&(i.exception={values:[{value:t,stacktrace:{frames:o}}]}),ju(i,{synthetic:!0})}if(ng(t)){const{__sentry_template_string__:o,__sentry_template_values__:s}=t;return i.logentry={message:o,params:s},i}return i.message=t,i}function sZ(e,{isUnhandledRejection:t}){const r=$q(e),n=t?"promise rejection":"exception";return ck(e)?`Event \`ErrorEvent\` captured as ${n} with message \`${e.message}\``:ig(e)?`Event \`${aZ(e)}\` (type=${e.type}) captured as ${n}`:`Object captured as ${n} with keys: ${r}`}function aZ(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function lZ(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const r=e[t];if(r instanceof Error)return r}}const cZ=5e3;class uZ extends kK{constructor(t){const r=dZ(t),n=Nt.SENTRY_SDK_SOURCE||GY();Xk(r,"browser",["browser"],n),super(r);const{sendDefaultPii:i,sendClientReports:o,_experiments:s}=this._options,a=s==null?void 0:s.enableLogs;Nt.document&&(o||a)&&Nt.document.addEventListener("visibilitychange",()=>{Nt.document.visibilityState==="hidden"&&(o&&this._flushOutcomes(),a&&R0(this))}),a&&(this.on("flush",()=>{R0(this)}),this.on("afterCaptureLog",()=>{this._logFlushIdleTimeout&&clearTimeout(this._logFlushIdleTimeout),this._logFlushIdleTimeout=setTimeout(()=>{R0(this)},cZ)})),i&&(this.on("postprocessEvent",KK),this.on("beforeSendSession",YK))}eventFromException(t,r){return iZ(this._options.stackParser,t,r,this._options.attachStacktrace)}eventFromMessage(t,r="info",n){return oZ(this._options.stackParser,t,r,n,this._options.attachStacktrace)}_prepareEvent(t,r,n,i){return t.platform=t.platform||"javascript",super._prepareEvent(t,r,n,i)}}function dZ(e){var t;return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:(t=Nt.SENTRY_RELEASE)==null?void 0:t.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const og=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,kt=Ht,hZ=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",cd=(e,t,r,n)=>{let i,o;return s=>{t.value>=0&&(s||n)&&(o=t.value-(i??0),(o||i===void 0)&&(i=t.value,t.delta=o,t.rating=hZ(t.value,r),e(t)))}},fZ=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,zf=(e=!0)=>{var r,n;const t=(n=(r=kt.performance)==null?void 0:r.getEntriesByType)==null?void 0:n.call(r,"navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},ud=()=>{const e=zf();return(e==null?void 0:e.activationStart)??0},dd=(e,t=-1)=>{var o,s;const r=zf();let n="navigate";return r&&((o=kt.document)!=null&&o.prerendering||ud()>0?n="prerender":(s=kt.document)!=null&&s.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:fZ(),navigationType:n}},I2=new WeakMap;function Bb(e,t){return I2.get(e)||I2.set(e,new t),I2.get(e)}class j1{constructor(){j1.prototype.__init.call(this),j1.prototype.__init2.call(this)}__init(){this._sessionValue=0}__init2(){this._sessionEntries=[]}_processEntry(t){var i;if(t.hadRecentInput)return;const r=this._sessionEntries[0],n=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&r&&n&&t.startTime-n.startTime<1e3&&t.startTime-r.startTime<5e3?(this._sessionValue+=t.value,this._sessionEntries.push(t)):(this._sessionValue=t.value,this._sessionEntries=[t]),(i=this._onAfterProcessingUnexpectedShift)==null||i.call(this,t)}}const xc=(e,t,r={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const n=new PerformanceObserver(i=>{Promise.resolve().then(()=>{t(i.getEntries())})});return n.observe({type:e,buffered:!0,...r}),n}}catch{}},sg=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let mh=-1;const pZ=()=>{var e,t;return((e=kt.document)==null?void 0:e.visibilityState)==="hidden"&&!((t=kt.document)!=null&&t.prerendering)?0:1/0},L1=e=>{kt.document.visibilityState==="hidden"&&mh>-1&&(mh=e.type==="visibilitychange"?e.timeStamp:0,gZ())},mZ=()=>{addEventListener("visibilitychange",L1,!0),addEventListener("prerenderingchange",L1,!0)},gZ=()=>{removeEventListener("visibilitychange",L1,!0),removeEventListener("prerenderingchange",L1,!0)},ag=()=>{var e;if(kt.document&&mh<0){const t=ud();mh=(kt.document.prerendering||(e=globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>t)[0])==null?void 0:e.startTime)??pZ(),mZ()}return{get firstHiddenTime(){return mh}}},Wf=e=>{var t;(t=kt.document)!=null&&t.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},vZ=[1800,3e3],yZ=(e,t={})=>{Wf(()=>{const r=ag(),n=dd("FCP");let i;const s=xc("paint",a=>
130{for(const l of a)l.name==="first-contentful-paint"&&(s.disconnect(),l.startTime<r.firstHiddenTime&&(n.value=Math.max(l.startTime-ud(),0),n.entries.push(l),i(!0)))});s&&(i=cd(e,n,vZ,t.reportAllChanges))})},_Z=[.1,.25],bZ=(e,t={})=>{yZ(sg(()=>{var a,l;const r=dd("CLS",0);let n;const i=Bb(t,j1),o=d=>{for(const u of d)i._processEntry(u);i._sessionValue>r.value&&(r.value=i._sessionValue,r.entries=i._sessionEntries,n())},s=xc("layout-shift",o);s&&(n=cd(e,r,_Z,t.reportAllChanges),(a=kt.document)==null||a.addEventListener("visibilitychange",()=>{var d;((d=kt.document)==null?void 0:d.visibilityState)==="hidden"&&(o(s.takeRecords()),n(!0))}),(l=kt==null?void 0:kt.setTimeout)==null||l.call(kt,n))}))},lg=e=>{const t=r=>{var n;(r.type==="pagehide"||((n=kt.document)==null?void 0:n.visibilityState)==="hidden")&&e(r)};kt.document&&(addEventListener("visibilitychange",t,!0),addEventListener("pagehide",t,!0))},xZ=[100,300],wZ=(e,t={})=>{Wf(()=>{const r=ag(),n=dd("FID");let i;const o=l=>{l.startTime<r.firstHiddenTime&&(n.value=l.processingStart-l.startTime,n.entries.push(l),i(!0))},s=l=>{l.forEach(o)},a=xc("first-input",s);i=cd(e,n,xZ,t.reportAllChanges),a&&lg(sg(()=>{s(a.takeRecords()),a.disconnect()}))})};let lR=0,P2=1/0,Lp=0;const EZ=e=>{e.forEach(t=>{t.interactionId&&(P2=Math.min(P2,t.interactionId),Lp=Math.max(Lp,t.interactionId),lR=Lp?(Lp-P2)/7+1:0)})};let dy;const cR=()=>dy?lR:performance.interactionCount||0,SZ=()=>{"interactionCount"in performance||dy||(dy=xc("event",EZ,{type:"event",buffered:!0,durationThreshold:0}))},O2=10;let uR=0;const CZ=()=>cR()-uR;class $1{constructor(){$1.prototype.__init.call(this),$1.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){uR=cR(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const t=Math.min(this._longestInteractionList.length-1,Math.floor(CZ()/50));return this._longestInteractionList[t]}_processEntry(t){var i,o;if((i=this._onBeforeProcessingEntry)==null||i.call(this,t),!(t.interactionId||t.entryType==="first-input"))return;const r=this._longestInteractionList.at(-1);let n=this._longestInteractionMap.get(t.interactionId);if(n||this._longestInteractionList.length<O2||t.duration>r._latency){if(n?t.duration>n._latency?(n.entries=[t],n._latency=t.duration):t.duration===n._latency&&t.startTime===n.entries[0].startTime&&n.entries.push(t):(n={id:t.interactionId,entries:[t],_latency:t.duration},this._longestInteractionMap.set(n.id,n),this._longestInteractionList.push(n)),this._longestInteractionList.sort((s,a)=>a._latency-s._latency),this._longestInteractionList.length>O2){const s=this._longestInteractionList.splice(O2);for(const a of s)this._longestInteractionMap.delete(a.id)}(o=this._onAfterProcessingINPCandidate)==null||o.call(this,n)}}}const dR=e=>{var r;const t=kt.requestIdleCallback||kt.setTimeout;((r=kt.document)==null?void 0:r.visibilityState)==="hidden"?e():(e=sg(e),t(e),lg(e))},TZ=[200,500],AZ=40,kZ=(e,t={})=>{globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype&&Wf(()=>{SZ();const r=dd("INP");let n;const i=Bb(t,$1),o=a=>{dR(()=>{for(const d of a)i._processEntry(d);const l=i._estimateP98LongestInteraction();l&&l._latency!==r.value&&(r.value=l._latency,r.entries=l.entries,n())})},s=xc("event",o,{durationThreshold:t.durationThreshold??AZ});n=cd(e,r,TZ,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),lg(()=>{o(s.takeRecords()),n(!0)}))})};class RZ{_processEntry(t){var r;(r=this._onBeforeProcessingEntry)==null||r.call(this,t)}}const IZ=[2500,4e3],PZ=(e,t={})=>{Wf(()=>{const r=ag(),n=dd("LCP");let i;const o=Bb(t,RZ),s=l=>{t.reportAllChanges||(l=l.slice(-1));for(const d of l)o._processEntry(d),d.startTime<r.firstHiddenTime&&(n.value=Math.max(d.startTime-ud(),0),n.entries=[d],i())},a=xc("largest-contentful-paint",s);if(a){i=cd(e,n,IZ,t.reportAllChanges);const l=sg(()=>{s(a.takeRecords()),a.disconnect(),i(!0)});for(const d of["keydown","click","visibilitychange"])kt.document&&addEventListener(d,()=>dR(l),{capture:!0,once:!0})}})},OZ=[800,1800],hy=e=>{var t,r;(t=kt.document)!=null&&t.prerendering?Wf(()=>hy(e)):((r=kt.document)==null?void 0:r.readyState)!=="complete"?addEventListener("load",()=>hy(e),!0):setTimeout(e)},jZ=(e,t={})=>{const r=dd("TTFB"),n=cd(e,r,OZ,t.reportAllChanges);hy(()=>{const i=zf();i&&(r.value=Math.max(i.responseStart-ud(),0),r.entries=[i],n(!0))})},gh={},D1={};let hR,fR,pR,mR,gR;
130function vR(e,t=!1){return qf("cls",e,MZ,hR,t)}function yR(e,t=!1){return qf("lcp",e,FZ,pR,t)}function LZ(e){return qf("fid",e,NZ,fR)}function $Z(e){return qf("ttfb",e,UZ,mR)}function DZ(e){return qf("inp",e,BZ,gR)}function Mu(e,t){return _R(e,t),D1[e]||(VZ(e),D1[e]=!0),bR(e,t)}function hd(e,t){const r=gh[e];if(r!=null&&r.length)for(const n of r)try{n(t)}catch(i){og&&Or.error(`Error while triggering instrumentation handler. 131Type: ${e} 132Name: ${Gs(n)} 133Error:`,i)}}function MZ(){return bZ(e=>{hd("cls",{metric:e}),hR=e},{reportAllChanges:!0})}function NZ(){return wZ(e=>{hd("fid",{metric:e}),fR=e})}function FZ(){return PZ(e=>{hd("lcp",{metric:e}),pR=e},{reportAllChanges:!0})}function UZ(){return jZ(e=>{hd("ttfb",{metric:e}),mR=e})}function BZ(){return kZ(e=>{hd("inp",{metric:e}),gR=e})}function qf(e,t,r,n,i=!1){_R(e,t);let o;return D1[e]||(o=r(),D1[e]=!0),n&&t({metric:n}),bR(e,t,i?o:void 0)}function VZ(e){const t={};e==="event"&&(t.durationThreshold=0),xc(e,r=>{hd(e,{entries:r})},t)}function _R(e,t){gh[e]=gh[e]||[],gh[e].push(t)}function bR(e,t,r){return()=>{r&&r();const n=gh[e];if(!n)return;const i=n.indexOf(t);i!==-1&&n.splice(i,1)}}function HZ(e){return"duration"in e}function j2(e){return typeof e=="number"&&isFinite(e)}function Js(e,t,r,{...n}){const i=ir(e).start_timestamp;return i&&i>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),Ob(e,()=>{const o=ld({startTime:t,...n});return o&&o.end(r),o})}function Vb(e){var y;const t=Yt();if(!t)return;const{name:r,transaction:n,attributes:i,startTime:o}=e,{release:s,environment:a,sendDefaultPii:l}=t.getOptions(),d=t.getIntegrationByName("Replay"),u=d==null?void 0:d.getReplayId(),h=cr(),f=h.getUser(),p=f!==void 0?f.email||f.id||f.ip_address:void 0;let m;try{m=h.getScopeData().contexts.profile.profile_id}catch{}const g={release:s,environment:a,user:p||void 0,profile_id:m||void 0,replay_id:u||void 0,transaction:n,"user_agent.original":(y=kt.navigator)==null?void 0:y.userAgent,"client.address":l?"{{auto}}":void 0,...i};return ld({name:r,attributes:g,startTime:o,experimental:{standalone:!0}})}function cg(){return kt.addEventListener&&kt.performance}function Cr(e){return e/1e3}function xR(e){let t="unknown",r="unknown",n="";for(const i of e){if(i==="/"){[t,r]=e.split("/");break}if(!isNaN(Number(i))){t=n==="h"?"http":n,r=e.split(n)[1];break}n+=i}return n===e&&(t=n),{name:t,version:r}}function wR(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function ER(e){let t,r=!1;function n(i){!r&&t&&e(i,t),r=!0}lg(()=>{r||n("pagehide")}),setTimeout(()=>{const i=Yt();if(!i)return;const o=i.on("beforeStartNavigationSpan",(a,l)=>{l!=null&&l.isRedirect||(n("navigation"),o==null||o())}),s=li();if(s){const a=Wn(s);ir(a).op==="pageload"&&(t=a.spanContext().spanId)}},0)}function zZ(){let e=0,t;if(!wR("layout-shift"))return;const r=vR(({metric:n})=>{const i=n.entries[n.entries.length-1];i&&(e=n.value,t=i)},!0);ER((n,i)=>{WZ(e,t,i,n),r()})}function WZ(e,t,r,n){var d;og&&Or.log(`Sending CLS span (${e})`);const i=Cr((Ai()||0)+((t==null?void 0:t.startTime)||0)),o=cr().getScopeData().transactionName,s=t?ms((d=t.sources[0])==null?void 0:d.node):"Layout shift",a={[on]:"auto.http.browser.cls",[Ys]:"ui.webvital.cls",[sd]:(t==null?void 0:t.duration)||0,"sentry.pageload.span_id":r,"sentry.report_event":n};t!=null&&t.sources&&t.sources.forEach((u,h)=>{a[`cls.source.${h+1}`]=ms(u.node)});const l=Vb({name:s,transaction:o,attributes:a,startTime:i});l&&(l.addEvent("cls",{[Uf]:"",[Bf]:e}),l.end(i))}function qZ(){let e=0,t;if(!wR("largest-contentful-paint"))return;const r=yR(({metric:n})=>{const i=n.entries[n.entries.length-1];i&&(e=n.value,t=i)},!0);ER((n,i)=>{GZ(e,t,i,n),r()})}function GZ(e,t,r,n){og&&Or.log(`Sending LCP span (${e})`);const i=Cr((Ai()||0)+((t==null?void 0:t.startTime)||0)),o=cr().getScopeData().transactionName,s=t?ms(t.element):"Largest contentful paint",a={[on]:"auto.http.browser.lcp",[Ys]:"ui.webvital.lcp",[sd]:0,"sentry.pageload.span_id":r,"sentry.report_event":n};t&&(t.element&&(a["lcp.element"]=ms(t.element)),t.id&&(a["lcp.id"]=t.id),t.url&&(a["lcp.url"]=t.url.trim().slice(0,200)),t.loadTime!=null&&(a["lcp.loadTime"]=t.loadTime),t.renderTime!=null&&(a["lcp.renderTime"]=t.renderTime),t.size!=null&&(a["lcp.size"]=t.size));const l=Vb({name:s,transaction:o,attributes:a,startTime:i});l&&(l.addEvent("lcp",{[Uf]:"millisecond",[Bf]:e}),l.end(i))}const KZ=2147483647;let c8=0,mn={},gi,tu;function YZ({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t}){const r=cg();if(r&&Ai()){r.mark&&kt.performance.mark("sentry-tracing-init");const n=tX(),i=t?qZ():eX(),o=rX(),s=e?zZ():QZ();return()=>{n(),i==null||i(),o(),s==null||s()}}return()=>{}}function ZZ(){Mu("longtask",({entries:e})=>{const t=li();if(!t)return;const{op:r,start_timestamp:n}=ir(t);for(const i of e){const o=Cr(Ai()+i.startTime),s=Cr(i.duration);r==="navigation"&&n&&o<n||Js(t,o,o+s,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[on]:"auto.ui.browser.metrics"}})}})}function XZ(){new PerformanceObserver(t=>{const r=li();if(r)for(const n of t.getEntries()){if(!n.scripts[0])continue;const i=Cr(Ai()+n.startTime),{start_timestamp:o,op:s}=ir(r);if(s==="navigation"&&o&&i<o)continue;const a=Cr(n.duration),l={[on]:"auto.ui.browser.metrics"},d=n.scripts[0],{invoker:u,invokerType:h,sourceURL:f,sourceFunctionName:p,sourceCharPosition:m}=d;l["browser.script.invoker"]=u,l["browser.script.invoker_type"]=h,f&&(l["code.filepath"]=f),p&&(l["code.function"]=p),m!==-1&&(l["browser.script.source_char_position"]=m),Js(r,i,i+a,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:l})}}).observe({type:"long-animation-frame",buffered:!0})}function JZ(){Mu("event",({entries:e})=>{const t=li();if(t){for(const r of e)if(r.name==="click"){const n=Cr(Ai()+r.startTime),i=Cr(r.duration),o={name:ms(r.target),op:`ui.interaction.${r.name}`,startTime:n,attributes:{[on]:"auto.ui.browser.metrics"}},s=hk(r.target);
133s&&(o.attributes["ui.component_name"]=s),Js(t,n,n+i,o)}}})}function QZ(){return vR(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(mn.cls={value:e.value,unit:""},tu=t)},!0)}function eX(){return yR(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(mn.lcp={value:e.value,unit:"millisecond"},gi=t)},!0)}function tX(){return LZ(({metric:e})=>{const t=e.entries[e.entries.length-1];if(!t)return;const r=Cr(Ai()),n=Cr(t.startTime);mn.fid={value:e.value,unit:"millisecond"},mn["mark.fid"]={value:r+n,unit:"second"}})}function rX(){return $Z(({metric:e})=>{e.entries[e.entries.length-1]&&(mn.ttfb={value:e.value,unit:"millisecond"})})}function nX(e,t){const r=cg(),n=Ai();if(!(r!=null&&r.getEntries)||!n)return;const i=Cr(n),o=r.getEntries(),{op:s,start_timestamp:a}=ir(e);if(o.slice(c8).forEach(l=>{const d=Cr(l.startTime),u=Cr(Math.max(0,l.duration));if(!(s==="navigation"&&a&&i+d<a))switch(l.entryType){case"navigation":{sX(e,l,i);break}case"mark":case"paint":case"measure":{iX(e,l,d,u,i,t.ignorePerformanceApiSpans);const h=ag(),f=l.startTime<h.firstHiddenTime;l.name==="first-paint"&&f&&(mn.fp={value:l.startTime,unit:"millisecond"}),l.name==="first-contentful-paint"&&f&&(mn.fcp={value:l.startTime,unit:"millisecond"});break}case"resource":{cX(e,l,l.name,d,u,i,t.ignoreResourceSpans);break}}}),c8=Math.max(o.length-1,0),uX(e),s==="pageload"){hX(mn);const l=mn["mark.fid"];
133l&&mn.fid&&(Js(e,l.value,l.value+Cr(mn.fid.value),{name:"first input delay",op:"ui.action",attributes:{[on]:"auto.ui.browser.metrics"}}),delete mn["mark.fid"]),(!("fcp"in mn)||!t.recordClsOnPageloadSpan)&&delete mn.cls,t.recordLcpOnPageloadSpan||delete mn.lcp,Object.entries(mn).forEach(([d,u])=>{BG(d,u.value,u.unit)}),e.setAttribute("performance.timeOrigin",i),e.setAttribute("performance.activationStart",ud()),dX(e,t)}gi=void 0,tu=void 0,mn={}}function iX(e,t,r,n,i,o){if(["mark","measure"].includes(t.entryType)&&Fa(t.name,o))return;const s=zf(!1),a=Cr(s?s.requestStart:0),l=i+Math.max(r,a),d=i+r,u=d+n,h={[on]:"auto.resource.browser.metrics"};l!==d&&(h["sentry.browser.measure_happened_before_request"]=!0,h["sentry.browser.measure_start_time"]=l),oX(h,t),l<=u&&Js(e,l,u,{name:t.name,op:t.entryType,attributes:h})}function oX(e,t){try{const r=t.detail;if(!r)return;if(typeof r=="object"){for(const[n,i]of Object.entries(r))if(i&&Qh(i))e[`sentry.browser.measure.detail.${n}`]=i;else if(i!==void 0)try{e[`sentry.browser.measure.detail.${n}`]=JSON.stringify(i)}catch{}return}if(Qh(r)){e["sentry.browser.measure.detail"]=r;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(r)}catch{}}catch{}}function sX(e,t,r){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(n=>{$p(e,t,n,r)}),$p(e,t,"secureConnection",r,"TLS/SSL"),$p(e,t,"fetch",r,"cache"),$p(e,t,"domainLookup",r,"DNS"),lX(e,t,r)}function $p(e,t,r,n,i=r){const o=aX(r),s=t[o],a=t[`${r}Start`];!a||!s||Js(e,n+Cr(a),n+Cr(s),{op:`browser.${i}`,name:t.name,attributes:{[on]:"auto.ui.browser.metrics",...r==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function aX(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function lX(e,t,r){const n=r+Cr(t.requestStart),i=r+Cr(t.responseEnd),o=r+Cr(t.responseStart);t.responseEnd&&(Js(e,n,i,{op:"browser.request",name:t.name,attributes:{[on]:"auto.ui.browser.metrics"}}),Js(e,o,i,{op:"browser.response",name:t.name,attributes:{[on]:"auto.ui.browser.metrics"}}))}function cX(e,t,r,n,i,o,s){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;const a=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(s!=null&&s.includes(a))return;const l=Kl(r),d={[on]:"auto.resource.browser.metrics"};L2(d,t,"transferSize","http.response_transfer_size"),L2(d,t,"encodedBodySize","http.response_content_length"),L2(d,t,"decodedBodySize","http.decoded_response_content_length");const u=t.deliveryType;u!=null&&(d["http.response_delivery_type"]=u);const h=t.renderBlockingStatus;if(h&&(d["resource.render_blocking_status"]=h),l.protocol&&(d["url.scheme"]=l.protocol.split(":").pop()),l.host&&(d["server.address"]=l.host),d["url.same_origin"]=r.includes(kt.location.origin),t.nextHopProtocol!=null){const{name:m,version:g}=xR(t.nextHopProtocol);d["network.protocol.name"]=m,d["network.protocol.version"]=g}const f=o+n,p=f+i;Js(e,f,p,{name:r.replace(kt.location.origin,""),op:a,attributes:d})}function uX(e){const t=kt.navigator;if(!t)return;const r=t.connection;r&&(r.effectiveType&&e.setAttribute("effectiveConnectionType",r.effectiveType),r.type&&e.setAttribute("connectionType",r.type),j2(r.rtt)&&(mn["connection.rtt"]={value:r.rtt,unit:"millisecond"})),j2(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),j2(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}function dX(e,t){gi&&t.recordLcpOnPageloadSpan&&(gi.element&&e.setAttribute("lcp.element",ms(gi.element)),gi.id&&e.setAttribute("lcp.id",gi.id),gi.url&&e.setAttribute("lcp.url",gi.url.trim().slice(0,200)),gi.loadTime!=null&&e.setAttribute("lcp.loadTime",gi.loadTime),gi.renderTime!=null&&e.setAttribute("lcp.renderTime",gi.renderTime),e.setAttribute("lcp.size",gi.size)),tu!=null&&tu.sources&&t.recordClsOnPageloadSpan&&tu.sources.forEach((r,n)=>e.setAttribute(`cls.source.${n+1}`,ms(r.node)))}function L2(e,t,r,n){const i=t[r];i!=null&&i<KZ&&(e[n]=i)}function hX(e){const t=zf(!1);if(!t)return;const{responseStart:r,requestStart:n}=t;n<=r&&(e["ttfb.requestTime"]={value:r-n,unit:"millisecond"})}function fX(){return cg()&&Ai()?Mu("element",pX):()=>{}}const pX=({entries:e})=>{const t=li(),r=t?Wn(t):void 0,n=r?ir(r).description:cr().getScopeData().transactionName;e.forEach(i=>
133{var p,m;const o=i;if(!o.identifier)return;const s=o.name,a=o.renderTime,l=o.loadTime,[d,u]=l?[Cr(l),"load-time"]:a?[Cr(a),"render-time"]:[_n(),"entry-emission"],h=s==="image-paint"?Cr(Math.max(0,(a??0)-(l??0))):0,f={[on]:"auto.ui.browser.elementtiming",[Ys]:"ui.elementtiming",[ns]:"component","sentry.span_start_time_source":u,"sentry.transaction_name":n,"element.id":o.id,"element.type":((m=(p=o.element)==null?void 0:p.tagName)==null?void 0:m.toLowerCase())||"unknown","element.size":o.naturalWidth&&o.naturalHeight?`${o.naturalWidth}x${o.naturalHeight}`:void 0,"element.render_time":a,"element.load_time":l,"element.url":o.url||void 0,"element.identifier":o.identifier,"element.paint_type":s};zG({name:`element[${o.identifier}]`,attributes:f,startTime:d,onlyIfParent:!0},g=>{g.end(d+h)})})},mX=1e3;let u8,fy,py;function gX(e){const t="dom";ol(t,e),sl(t,vX)}function vX(){if(!kt.document)return;const e=eo.bind(null,"dom"),t=d8(e,!0);kt.document.addEventListener("click",t,!1),kt.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(r=>{var o,s;const i=(o=kt[r])==null?void 0:o.prototype;(s=i==null?void 0:i.hasOwnProperty)!=null&&s.call(i,"addEventListener")&&(Ei(i,"addEventListener",function(a){return function(l,d,u){if(l==="click"||l=="keypress")try{const h=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},f=h[l]=h[l]||{refCount:0};if(!f.handler){const p=d8(e);f.handler=p,a.call(this,l,p,u)}f.refCount++}catch{}return a.call(this,l,d,u)}}),Ei(i,"removeEventListener",function(a){return function(l,d,u){if(l==="click"||l=="keypress")try{const h=this.__sentry_instrumentation_handlers__||{},f=h[l];f&&(f.refCount--,f.refCount<=0&&(a.call(this,l,f.handler,u),f.handler=void 0,delete h[l]),Object.keys(h).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return a.call(this,l,d,u)}}))})}function yX(e){if(e.type!==fy)return!1;try{if(!e.target||e.target._sentryId!==py)return!1}catch{}return!0}function _X(e,t){return e!=="keypress"?!1:t!=null&&t.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function d8(e,t=!1){return r=>{if(!r||r._sentryCaptured)return;const n=bX(r);if(_X(r.type,n))return;Ui(r,"_sentryCaptured",!0),n&&!n._sentryId&&Ui(n,"_sentryId",to());const i=r.type==="keypress"?"input":r.type;yX(r)||(e({event:r,name:i,global:t}),fy=r.type,py=n?n._sentryId:void 0),clearTimeout(u8),u8=kt.setTimeout(()=>{py=void 0,fy=void 0},mX)}}function bX(e){try{return e.target}catch{return null}}let Dp;function Hb(e){const t="history";ol(t,e),sl(t,xX)}function xX(){if(kt.addEventListener("popstate",()=>{const t=kt.location.href,r=Dp;if(Dp=t,r===t)return;eo("history",{from:r,to:t})}),!FY())return;function e(t){return function(...r){const n=r.length>2?r[2]:void 0;if(n){const i=Dp,o=wX(String(n));if(Dp=o,i===o)return t.apply(this,r);eo("history",{from:i,to:o})}return t.apply(this,r)}}Ei(kt.history,"pushState",e),Ei(kt.history,"replaceState",e)}function wX(e){try{return new URL(e,kt.location.origin).toString()}catch{return e}}const I0={};function SR(e){const t=I0[e];if(t)return t;let r=kt[e];if(ay(r))return I0[e]=r.bind(kt);const n=kt.document;if(n&&typeof n.createElement=="function")try{const i=n.createElement("iframe");i.hidden=!0,n.head.appendChild(i);const o=i.contentWindow;o!=null&&o[e]&&(r=o[e]),n.head.removeChild(i)}catch(i){og&&Or.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,i)}return r&&(I0[e]=r.bind(kt))}function h8(e){I0[e]=void 0}function k7e(...e){return SR("setTimeout")(...e)}const ru="__sentry_xhr_v3__";function CR(e){const t="xhr";ol(t,e),sl(t,EX)}function EX(){if(!kt.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,r,n){const i=new Error,o=_n()*1e3,s=zs(n[0])?n[0].toUpperCase():void 0,a=SX(n[1]);if(!s||!a)return t.apply(r,n);r[ru]={method:s,url:a,request_headers:{}},s==="POST"&&a.match(/sentry_key/)&&(r.__sentry_own_request__=!0);const l=()=>{const d=r[ru];if(d&&r.readyState===4){try{d.status_code=r.status}catch{}const u={endTimestamp:_n()*1e3,startTimestamp:o,xhr:r,virtualError:i};eo("xhr",u)}};return"onreadystatechange"in r&&typeof r.onreadystatechange=="function"?r.onreadystatechange=new Proxy(r.onreadystatechange,{apply(d,u,h){return l(),d.apply(u,h)}}):r.addEventListener("readystatechange",l),r.setRequestHeader=new Proxy(r.setRequestHeader,{apply(d,u,h){const[f,p]=h,m=u[ru];return m&&zs(f)&&zs(p)&&(m.request_headers[f.toLowerCase()]=p),d.apply(u,h)}}),t.apply(r,n)}}),e.send=new Proxy(e.send,{apply(t,r,n){const i=r[ru];if(!i)return t.apply(r,n);n[0]!==void 0&&(i.body=n[0]);const o={startTimestamp:_n()*1e3,xhr:r};return eo("xhr",o),t.apply(r,n)}})}function SX(e){if(zs(e))return e;try{return e.toString()}catch{}}const $2=[],P0=new Map,CX=60;
133function TX(){if(cg()&&Ai()){const t=AX();return()=>{t()}}return()=>{}}const f8={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function AX(){return DZ(kX)}const kX=({metric:e})=>{if(e.value==null)return;const t=Cr(e.value);if(t>CX)return;const r=e.entries.find(m=>m.duration===e.value&&f8[m.name]);if(!r)return;const{interactionId:n}=r,i=f8[r.name],o=Cr(Ai()+r.startTime),s=li(),a=s?Wn(s):void 0,d=(n!=null?P0.get(n):void 0)||a,u=d?ir(d).description:cr().getScopeData().transactionName,h=ms(r.target),f={[on]:"auto.http.browser.inp",[Ys]:`ui.interaction.${i}`,[sd]:r.duration},p=Vb({name:h,transaction:u,attributes:f,startTime:o});p&&(p.addEvent("inp",{[Uf]:"millisecond",[Bf]:e.value}),p.end(o+t))};function RX(){const e=({entries:t})=>{const r=li(),n=r&&Wn(r);t.forEach(i=>{if(!HZ(i)||!n)return;const o=i.interactionId;if(o!=null&&!P0.has(o)){if($2.length>10){const s=$2.shift();P0.delete(s)}$2.push(o),P0.set(o,n)}})};Mu("event",e),Mu("first-input",e)}function IX(e,t=SR("fetch")){let r=0,n=0;function i(o){const s=o.body.length;r+=s,n++;const a={body:o.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:r<=6e4&&n<15,...e.fetchOptions};if(!t)return h8("fetch"),I1("No fetch implementation available");try{return t(e.url,a).then(l=>(r-=s,n--,{statusCode:l.status,headers:{"x-sentry-rate-limits":l.headers.get("X-Sentry-Rate-Limits"),"retry-after":l.headers.get("Retry-After")}}))}catch(l){return h8("fetch"),r-=s,n--,I1(l)}}return GK(e,i)}const PX=30,OX=50;function my(e,t,r,n){const i={filename:e,function:t==="<anonymous>"?ac:t,in_app:!0};return r!==void 0&&(i.lineno=r),n!==void 0&&(i.colno=n),i}const jX=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,LX=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,$X=/\((\S*)(?::(\d+))(?::(\d+))\)/,DX=e=>{const t=jX.exec(e);if(t){const[,n,i,o]=t;return my(n,ac,+i,+o)}const r=LX.exec(e);if(r){if(r[2]&&r[2].indexOf("eval")===0){const s=$X.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}const[i,o]=TR(r[1]||ac,r[2]);return my(o,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},MX=[PX,DX],NX=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,FX=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,UX=e=>{const t=NX.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const o=FX.exec(t[3]);o&&(t[1]=t[1]||"eval",t[3]=o[1],t[4]=o[2],t[5]="")}let n=t[3],i=t[1]||ac;return[i,n]=TR(i,n),my(n,i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},BX=[OX,UX],VX=[MX,BX],HX=ok(...VX),TR=(e,t)=>{const r=e.indexOf("safari-extension")!==-1,n=e.indexOf("safari-web-extension")!==-1;return r||n?[e.indexOf("@")!==-1?e.split("@")[0]:ac,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},oo=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Mp=1024,zX="Breadcrumbs",WX=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:zX,setup(r){t.console&&fY(YX(r)),t.dom&&gX(KX(r,t.dom)),t.xhr&&CR(ZX(r)),t.fetch&&iR(XX(r)),t.history&&Hb(JX(r)),t.sentry&&r.on("beforeSendEvent",GX(r))}}},qX=WX;function GX(e){return function(r){Yt()===e&&uc({category:`sentry.${r.type==="transaction"?"transaction":"event"}`,event_id:r.event_id,level:r.level,message:Il(r)},{event:r})}}function KX(e,t){return function(n){if(Yt()!==e)return;let i,o,s=typeof t=="object"?t.serializeAttribute:void 0,a=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;a&&a>Mp&&(oo&&Or.warn(`\`dom.maxStringLength\` cannot exceed ${Mp}, but a value of ${a} was configured. Sentry will use ${Mp} instead.`),a=Mp),typeof s=="string"&&(s=[s]);try{const d=n.event,u=QX(d)?d.target:d;i=ms(u,{keyAttrs:s,maxStringLength:a}),o=hk(u)}catch{i="<unknown>"}if(i.length===0)return;const l={category:`ui.${n.name}`,message:i};o&&(l.data={"ui.component_name":o}),uc(l,{event:n.event,name:n.name,global:n.global})}}function YX(e){return function(r){if(Yt()!==e)return;const n={category:"console",data:{arguments:r.args,logger:"console"},level:mY(r.level),message:Sw(r.args," ")};if(r.level==="assert")if(r.args[0]===!1)n.message=`Assertion failed: ${Sw(r.args.slice(1)," ")||"console.assert"}`,n.data.arguments=r.args.slice(1);else return;uc(n,{input:r.args,level:r.level})}}function ZX(e){return function(r){if(Yt()!==e)return;const{startTimestamp:n,endTimestamp:i}=r,o=r.xhr[ru];if(!n||!i||!o)return;const{method:s,url:a,status_code:l,body:d}=o,u={method:s,url:a,status_code:l},h={xhr:r.xhr,input:d,startTimestamp:n,endTimestamp:i},f={category:"xhr",data:u,type:"http",level:nR(l)};e.emit("beforeOutgoingRequestBreadcrumb",f,h),uc(f,h)}}function XX(e){return function(r){if(Yt()!==e)return;const{startTimestamp:n,endTimestamp:i}=r;
133if(i&&!(r.fetchData.url.match(/sentry_key/)&&r.fetchData.method==="POST"))if(r.fetchData.method,r.fetchData.url,r.error){const o=r.fetchData,s={data:r.error,input:r.args,startTimestamp:n,endTimestamp:i},a={category:"fetch",data:o,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",a,s),uc(a,s)}else{const o=r.response,s={...r.fetchData,status_code:o==null?void 0:o.status};r.fetchData.request_body_size,r.fetchData.response_body_size,o==null||o.status;const a={input:r.args,response:o,startTimestamp:n,endTimestamp:i},l={category:"fetch",data:s,type:"http",level:nR(s.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",l,a),uc(l,a)}}}function JX(e){return function(r){if(Yt()!==e)return;let n=r.from,i=r.to;const o=Kl(Nt.location.href);let s=n?Kl(n):void 0;const a=Kl(i);s!=null&&s.path||(s=o),o.protocol===a.protocol&&o.host===a.host&&(i=a.relative),o.protocol===s.protocol&&o.host===s.host&&(n=s.relative),uc({category:"navigation",data:{from:n,to:i}})}}function QX(e){return!!e&&!!e.target}const eJ=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],tJ="BrowserApiErrors",rJ=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:tJ,setupOnce(){t.setTimeout&&Ei(Nt,"setTimeout",p8),t.setInterval&&Ei(Nt,"setInterval",p8),t.requestAnimationFrame&&Ei(Nt,"requestAnimationFrame",iJ),t.XMLHttpRequest&&"XMLHttpRequest"in Nt&&Ei(XMLHttpRequest.prototype,"send",oJ);const r=t.eventTarget;r&&(Array.isArray(r)?r:eJ).forEach(i=>sJ(i,t))}}},nJ=rJ;function p8(e){return function(...t){const r=t[0];return t[0]=Du(r,{mechanism:{data:{function:Gs(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function iJ(e){return function(t){return e.apply(this,[Du(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Gs(e)},handled:!1,type:"instrument"}})])}}function oJ(e){return function(...t){const r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(i=>{i in r&&typeof r[i]=="function"&&Ei(r,i,function(o){const s={mechanism:{data:{function:i,handler:Gs(o)},handled:!1,type:"instrument"}},a=Eb(o);return a&&(s.mechanism.data.handler=Gs(a)),Du(o,s)})}),e.apply(this,t)}}function sJ(e,t){var i,o;const n=(i=Nt[e])==null?void 0:i.prototype;(o=n==null?void 0:n.hasOwnProperty)!=null&&o.call(n,"addEventListener")&&(Ei(n,"addEventListener",function(s){return function(a,l,d){try{aJ(l)&&(l.handleEvent=Du(l.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Gs(l),target:e},handled:!1,type:"instrument"}}))}catch{}return t.unregisterOriginalCallbacks&&lJ(this,a,l),s.apply(this,[a,Du(l,{mechanism:{data:{function:"addEventListener",handler:Gs(l),target:e},handled:!1,type:"instrument"}}),d])}}),Ei(n,"removeEventListener",function(s){return function(a,l,d){try{const u=l.__sentry_wrapped__;u&&s.call(this,a,u,d)}catch{}return s.call(this,a,l,d)}}))}function aJ(e){return typeof e.handleEvent=="function"}function lJ(e,t,r){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,r)}const cJ=()=>({name:"BrowserSession",setupOnce(){if(typeof Nt.document>"u"){oo&&Or.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}Ww({ignoreDuration:!0}),qw(),Hb(({from:e,to:t})=>{e!==void 0&&e!==t&&(Ww({ignoreDuration:!0}),qw())})}}),uJ="GlobalHandlers",dJ=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:uJ,setupOnce(){Error.stackTraceLimit=50},setup(r){t.onerror&&(fJ(r),m8("onerror")),t.onunhandledrejection&&(pJ(r),m8("onunhandledrejection"))}}},hJ=dJ;function fJ(e){sk(t=>{const{stackParser:r,attachStacktrace:n}=AR();if(Yt()!==e||sR())return;const{msg:i,url:o,line:s,column:a,error:l}=t,d=vJ(Ub(r,l||i,void 0,n,!1),o,s,a);d.level="error",Fk(d,{originalException:l,mechanism:{handled:!1,type:"onerror"}})})}function pJ(e){ak(t=>{const{stackParser:r,attachStacktrace:n}=AR();if(Yt()!==e||sR())return;const i=mJ(t),o=Qh(i)?gJ(i):Ub(r,i,void 0,n,!0);o.level="error",Fk(o,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function mJ(e){if(Qh(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function gJ(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function vJ(e,t,r,n){const i=e.exception=e.exception||{},o=i.values=i.values||[],s=o[0]=o[0]||{},a=s.stacktrace=s.stacktrace||{},l=a.frames=a.frames||[],d=n,u=r,h=zs(t)&&t.length>0?t:Mf();return l.length===0&&l.push({colno:d,filename:h,function:ac,in_app:!0,lineno:u}),e}function m8(e){oo&&Or.log(`Global Handler attached: ${e}`)}function AR(){const e=Yt();return(e==null?void 0:e.getOptions())||{stackParser:()=>[],attachStacktrace:!1}}const yJ=()=>({name:"HttpContext",preprocessEvent(e){var n;if(!Nt.navigator&&!Nt.location&&!Nt.document)return;const t=Mb(),r={...t.headers,...(n=e.request)==null?void 0:n.headers};e.request={...t,...e.request,headers:r}}}),_J="cause",bJ=5,xJ="LinkedErrors",wJ=(e={})=>{const t=e.limit||bJ,r=e.key||_J;return{name:xJ,preprocessEvent(n,i,o){const s=o.getOptions();hY(Nb,s.stackParser,r,t,n,i)}}},EJ=wJ;function SJ(){return CJ()?(oo&&nd(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function CJ(){var o;if(typeof Nt.window>"u")return!1;const e=Nt;if(e.nw)return!1;const t=e.chrome||e.browser;if(!((o=t==null?void 0:t.runtime)!=null&&o.id))return!1;const r=Mf(),n=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];
133return!(Nt===Nt.top&&n.some(s=>r.startsWith(`${s}://`)))}function TJ(e){return[iY(),eY(),nJ(),qX(),hJ(),EJ(),yY(),yJ(),cJ()]}function kR(e={}){const t=!e.skipBrowserExtensionCheck&&SJ(),r={...e,enabled:t?!1:e.enabled,stackParser:Sq(e.stackParser||HX),integrations:Vk({integrations:e.integrations,defaultIntegrations:e.defaultIntegrations==null?TJ():e.defaultIntegrations}),transport:e.transport||IX};return FK(uZ,r)}function Vo(e=0){return((Ai()||performance.timeOrigin)+e)/1e3}function AJ(e){const t=[];if(e.nextHopProtocol!=null){const{name:r,version:n}=xR(e.nextHopProtocol);t.push(["network.protocol.version",n],["network.protocol.name",r])}return Ai()?[...t,["http.request.redirect_start",Vo(e.redirectStart)],["http.request.fetch_start",Vo(e.fetchStart)],["http.request.domain_lookup_start",Vo(e.domainLookupStart)],["http.request.domain_lookup_end",Vo(e.domainLookupEnd)],["http.request.connect_start",Vo(e.connectStart)],["http.request.secure_connection_start",Vo(e.secureConnectionStart)],["http.request.connection_end",Vo(e.connectEnd)],["http.request.request_start",Vo(e.requestStart)],["http.request.response_start",Vo(e.responseStart)],["http.request.response_end",Vo(e.responseEnd)]]:t}const g8=new WeakMap,D2=new Map,RR={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function kJ(e,t){const{traceFetch:r,traceXHR:n,trackFetchStreamPerformance:i,shouldCreateSpanForRequest:o,enableHTTPTimings:s,tracePropagationTargets:a,onRequestSpanStart:l}={...RR,...t},d=typeof o=="function"?o:f=>!0,u=f=>IJ(f,a),h={};r&&(e.addEventProcessor(f=>(f.type==="transaction"&&f.spans&&f.spans.forEach(p=>{if(p.op==="http.client"){const m=D2.get(p.span_id);m&&(p.timestamp=m/1e3,D2.delete(p.span_id))}}),f)),i&&VY(f=>{if(f.response){const p=g8.get(f.response);p&&f.endTimestamp&&D2.set(p,f.endTimestamp)}}),iR(f=>{const p=jY(f,d,u,h);if(f.response&&f.fetchData.__span&&g8.set(f.response,f.fetchData.__span),p){const m=IR(f.fetchData.url),g=m?Kl(m).host:void 0;p.setAttributes({"http.url":m,"server.address":g}),s&&v8(p),l==null||l(p,{headers:f.headers})}})),n&&CR(f=>{var m;const p=PJ(f,d,u,h);if(p){s&&v8(p);let g;try{g=new Headers((m=f.xhr.__sentry_xhr_v3__)==null?void 0:m.request_headers)}catch{}l==null||l(p,{headers:g})}})}function RJ(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function v8(e){const{url:t}=ir(e).data;if(!t||typeof t!="string")return;const r=Mu("resource",({entries:n})=>{n.forEach(i=>{RJ(i)&&i.name.endsWith(t)&&(AJ(i).forEach(s=>e.setAttribute(...s)),setTimeout(r))})})}function IJ(e,t){const r=Mf();if(r){let n,i;try{n=new URL(e,r),i=new URL(r).origin}catch{return!1}const o=n.origin===i;return t?Fa(n.toString(),t)||o&&Fa(n.pathname,t):o}else{const n=!!e.match(/^\/(?!\/)/);return t?Fa(e,t):n}}function PJ(e,t,r,n){const i=e.xhr,o=i==null?void 0:i[ru];if(!i||i.__sentry_own_request__||!o)return;const{url:s,method:a}=o,l=qa()&&t(s);if(e.endTimestamp&&l){const g=i.__sentry_xhr_span_id__;if(!g)return;const y=n[g];y&&o.status_code!==void 0&&(bk(y,o.status_code),y.end(),delete n[g]);return}const d=IR(s),u=Kl(d||s),h=OY(s),f=!!li(),p=l&&f?ld({name:`${a} ${h}`,attributes:{url:s,type:"xhr","http.method":a,"http.url":d,"server.address":u==null?void 0:u.host,[on]:"auto.http.browser",[Ys]:"http.client",...(u==null?void 0:u.search)&&{"http.query":u==null?void 0:u.search},...(u==null?void 0:u.hash)&&{"http.fragment":u==null?void 0:u.hash}}}):new Xs;i.__sentry_xhr_span_id__=p.spanContext().spanId,n[i.__sentry_xhr_span_id__]=p,r(s)&&OJ(i,qa()&&f?p:void 0);const m=Yt();return m&&m.emit("beforeOutgoingRequestSpan",p,e),p}function OJ(e,t){const{"sentry-trace":r,baggage:n}=Jk({span:t});r&&jJ(e,r,n)}function jJ(e,t,r){var i;const n=(i=e.__sentry_xhr_v3__)==null?void 0:i.request_headers;if(!(n!=null&&n["sentry-trace"]))try{if(e.setRequestHeader("sentry-trace",t),r){const o=n==null?void 0:n.baggage;(!o||!LJ(o))&&e.setRequestHeader("baggage",r)}}catch{}}function LJ(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function IR(e){try{return new URL(e,Nt.location.origin).href}catch{return}}function $J(){Nt.document?Nt.document.addEventListener("visibilitychange",()=>{const e=li();if(!e)return;const t=Wn(e);if(Nt.document.hidden&&t){const r="cancelled",{op:n,status:i}=ir(t);oo&&Or.log(`[Tracing] Transaction: ${r} -> since tab moved to the background, op: ${n}`),i||t.setStatus({code:en,message:r}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):oo&&Or.warn("[Tracing] Could not set up background tab detection due to lack of global document")}
133const DJ=3600,PR="sentry_previous_trace",MJ="sentry.previous_trace";function NJ(e,{linkPreviousTrace:t,consistentTraceSampling:r}){const n=t==="session-storage";let i=n?BJ():void 0;e.on("spanStart",s=>{if(Wn(s)!==s)return;const a=cr().getPropagationContext();i=FJ(i,s,a),n&&UJ(i)});let o=!0;r&&e.on("beforeSampling",s=>{if(!i)return;const a=cr(),l=a.getPropagationContext();if(o&&l.parentSpanId){o=!1;return}a.setPropagationContext({...l,dsc:{...l.dsc,sample_rate:String(i.sampleRate),sampled:String(gy(i.spanContext))},sampleRand:i.sampleRand}),s.parentSampled=gy(i.spanContext),s.parentSampleRate=i.sampleRate,s.spanAttributes={...s.spanAttributes,[yk]:i.sampleRate}})}function FJ(e,t,r){const n=ir(t);function i(){var a,l;try{return Number((a=r.dsc)==null?void 0:a.sample_rate)??Number((l=n.data)==null?void 0:l[Cb])}catch{return 0}}const o={spanContext:t.spanContext(),startTimestamp:n.start_timestamp,sampleRate:i(),sampleRand:r.sampleRand};if(!e)return o;const s=e.spanContext;return s.traceId===n.trace_id?e:(Date.now()/1e3-e.startTimestamp<=DJ&&(oo&&Or.info(`Adding previous_trace ${s} link to span ${{op:n.op,...t.spanContext()}}`),t.addLink({context:s,attributes:{[Zq]:"previous_trace"}}),t.setAttribute(MJ,`${s.traceId}-${s.spanId}-${gy(s)?1:0}`)),o)}function UJ(e){try{Nt.sessionStorage.setItem(PR,JSON.stringify(e))}catch(t){oo&&Or.warn("Could not store previous trace in sessionStorage",t)}}function BJ(){var e;try{const t=(e=Nt.sessionStorage)==null?void 0:e.getItem(PR);return JSON.parse(t)}catch{return}}function gy(e){return e.traceFlags===1}const VJ="BrowserTracing",HJ={...A0,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,enableElementTiming:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,_experiments:{},...RR},zJ=(e={})=>{const t={name:void 0,source:void 0},r=Nt.document,{enableInp:n,enableElementTiming:i,enableLongTask:o,enableLongAnimationFrame:s,_experiments:{enableInteractions:a,enableStandaloneClsSpans:l,enableStandaloneLcpSpans:d},beforeStartSpan:u,idleTimeout:h,finalTimeout:f,childSpanTimeout:p,markBackgroundSpan:m,traceFetch:g,traceXHR:y,trackFetchStreamPerformance:b,shouldCreateSpanForRequest:E,enableHTTPTimings:S,ignoreResourceSpans:k,ignorePerformanceApiSpans:A,instrumentPageLoad:w,instrumentNavigation:_,detectRedirects:x,linkPreviousTrace:C,consistentTraceSampling:P,onRequestSpanStart:I}={...HJ,...e};let O,D;function M(U,$,j=!0){const q=$.op==="pageload",W=u?u($):$,ne=W.attributes||{};if($.name!==W.name&&(ne[ns]="custom",W.attributes=ne),!j){const _e=yc();ld({...W,startTime:_e}).end(_e);return}t.name=W.name,t.source=ne[ns];const ae=Nk(W,{idleTimeout:h,finalTimeout:f,childSpanTimeout:p,disableAutoFinish:q,beforeSpanEnd:_e=>{O==null||O(),nX(_e,{recordClsOnPageloadSpan:!l,recordLcpOnPageloadSpan:!d,ignoreResourceSpans:k,ignorePerformanceApiSpans:A}),_8(U,void 0);const be=cr(),J=be.getPropagationContext();be.setPropagationContext({...J,traceId:ae.spanContext().traceId,sampled:bc(ae),dsc:Zs(_e)})}});_8(U,ae);function re(){r&&["interactive","complete"].includes(r.readyState)&&U.emit("idleSpanEnableAutoFinish",ae)}q&&r&&(r.addEventListener("readystatechange",()=>{re()}),re())}return{name:VJ,setup(U){if(fG(),O=YZ({recordClsStandaloneSpans:l||!1,recordLcpStandaloneSpans:d||!1}),n&&TX(),i&&fX(),s&&Ht.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?XZ():o&&ZZ(),a&&JZ(),x&&r){const j=()=>{D=_n()};addEventListener("click",j,{capture:!0}),addEventListener("keydown",j,{capture:!0,passive:!0})}function $(){const j=of(U);j&&!ir(j).timestamp&&(oo&&Or.log(`[Tracing] Finishing current active span with op: ${ir(j).op}`),j.setAttribute(A1,"cancelled"),j.end())}U.on("startNavigationSpan",(j,q)=>{if(Yt()!==U)return;if(q!=null&&q.isRedirect){oo&&Or.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),M(U,{op:"navigation.redirect",...j},!1);return}$(),qn().setPropagationContext({traceId:Wa(),sampleRand:Math.random()});const W=cr();W.setPropagationContext({traceId:Wa(),sampleRand:Math.random()}),W.setSDKProcessingMetadata({normalizedRequest:void 0}),M(U,{op:"navigation",...j})}),U.on("startPageLoadSpan",(j,q={})=>
133{if(Yt()!==U)return;$();const W=q.sentryTrace||y8("sentry-trace"),ne=q.baggage||y8("baggage"),ae=sG(W,ne),re=cr();re.setPropagationContext(ae),re.setSDKProcessingMetadata({normalizedRequest:Mb()}),M(U,{op:"pageload",...j})})},afterAllSetup(U){let $=Mf();if(C!=="off"&&NJ(U,{linkPreviousTrace:C,consistentTraceSampling:P}),Nt.location){if(w){const j=Ai();WJ(U,{name:Nt.location.pathname,startTime:j?j/1e3:void 0,attributes:{[ns]:"url",[on]:"auto.pageload.browser"}})}_&&Hb(({to:j,from:q})=>{if(q===void 0&&($==null?void 0:$.indexOf(j))!==-1){$=void 0;return}$=void 0;const W=rR(j),ne=of(U),ae=ne&&x&&KJ(ne,D);qJ(U,{name:(W==null?void 0:W.pathname)||Nt.location.pathname,attributes:{[ns]:"url",[on]:"auto.navigation.browser"}},{url:j,isRedirect:ae})})}m&&$J(),a&&GJ(U,h,f,p,t),n&&RX(),kJ(U,{traceFetch:g,traceXHR:y,trackFetchStreamPerformance:b,tracePropagationTargets:U.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:E,enableHTTPTimings:S,onRequestSpanStart:I})}}};function WJ(e,t,r){return e.emit("startPageLoadSpan",t,r),cr().setTransactionName(t.name),of(e)}function qJ(e,t,r){const{url:n,isRedirect:i}=r||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:i}),e.emit("startNavigationSpan",t,{isRedirect:i});const o=cr();return o.setTransactionName(t.name),n&&!i&&o.setSDKProcessingMetadata({normalizedRequest:{...Mb(),url:n}}),of(e)}function y8(e){const t=Nt.document,r=t==null?void 0:t.querySelector(`meta[name=${e}]`);return(r==null?void 0:r.getAttribute("content"))||void 0}function GJ(e,t,r,n,i){const o=Nt.document;let s;const a=()=>{const l="ui.action.click",d=of(e);if(d){const u=ir(d).op;if(["navigation","pageload"].includes(u)){oo&&Or.warn(`[Tracing] Did not create ${l} span because a pageload or navigation span is in progress.`);return}}if(s&&(s.setAttribute(A1,"interactionInterrupted"),s.end(),s=void 0),!i.name){oo&&Or.warn(`[Tracing] Did not create ${l} transaction because _latestRouteName is missing.`);return}s=Nk({name:i.name,op:l,attributes:{[ns]:i.source||"url"}},{idleTimeout:t,finalTimeout:r,childSpanTimeout:n})};o&&addEventListener("click",a,{capture:!0})}const OR="_sentry_idleSpan";function of(e){return e[OR]}function _8(e,t){Ui(e,OR,t)}const b8=.3;function KJ(e,t){const r=ir(e),n=yc(),i=r.start_timestamp;return!(n-i>b8||t&&n-t<=b8)}const YJ="sentry.javascript.capacitor",x8="2.2.0";function ZJ(e){return{attachStacktrace:e.attachStacktrace,attachThreads:e.attachThreads,debug:e.debug,dist:e.dist,dsn:e.dsn,enabled:e.enabled,enableNdkScopeSync:e.enableNdkScopeSync,enableWatchdogTerminationTracking:e.enableWatchdogTerminationTracking,environment:e.environment,maxBreadcrumbs:e.maxBreadcrumbs,release:e.release,sampleRate:e.sampleRate,sendClientReports:e.sendClientReports,sendDefaultPii:e.sendDefaultPii,sessionTrackingIntervalMillis:e.sessionTrackingIntervalMillis,tracesSampleRate:e.tracesSampleRate,enableCaptureFailedRequests:e.enableCaptureFailedRequests,...XJ(e),...JJ(e)}}function XJ(e){return qe.getPlatform()==="ios"?{enableAppHangTracking:e.enableAppHangTracking,appHangTimeoutInterval:e.appHangTimeoutInterval}:{}}function JJ(e){var t,r;if(!((t=e._experiments)===null||t===void 0)&&t.enableLogs&&qe.getPlatform()==="android")return{enableLogs:(r=e._experiments)===null||r===void 0?void 0:r.enableLogs}}const di=Kr("SentryCapacitor"),QJ="value";function jR(e){var t;const r=(t=Yt())===null||t===void 0?void 0:t.getOptions(),n=Wo(e,r==null?void 0:r.normalizeDepth,r==null?void 0:r.normalizeMaxBreadth);return n===null||typeof n!="object"?{[QJ]:n}:n}function eh(e,t){t=t||1/0;let r;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>
1336&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}const Hr={async sendEnvelope(e){if(!this.enableNative)throw this._DisabledNativeError;if(!this.isNativeClientAvailable())throw this._NativeClientError;const t=10,[r,n]=e,i=JSON.stringify(r);let o=eh(i);o.push(t);for(const a of n){const[l,d]=this._processItem(a);let u,h=[];typeof d=="string"?(u="text/plain",h=eh(d)):d instanceof Uint8Array?(u=typeof l.content_type=="string"?l.content_type:"application/octet-stream",h=[...d]):(u="application/vnd.sentry.items.log+json",h=eh(JSON.stringify(d))),l.content_type=u,l.length=h.length;const f=JSON.stringify(l);o.push(...eh(f)),o.push(t),o=o.concat(h),o.push(t)}let s=200;return await di.captureEnvelope({envelope:o}).then(a=>a,a=>{Or.error("Failed to capture Envelope: ",a),s=500}),{statusCode:s}},async initNativeSdk(e){if(!e.dsn)return Or.warn("Warning: No DSN was provided. The Sentry SDK will be disabled. Native SDK will also not be initalized."),this.enableNative=!1,!1;if(!e.enableNative)return e.enableNativeNagger&&Or.warn("Note: Native Sentry SDK is disabled."),this.enableNative=!1,!1;if(!this.isNativeClientAvailable())throw this._NativeClientError;const t=ZJ(e);return di.initNativeSdk({options:t})},async fetchNativeDeviceContexts(){if(!this.enableNative)throw this._DisabledNativeError;if(!this.isNativeClientAvailable())throw this._NativeClientError;return this.platform!=="ios"?{}:di.fetchNativeDeviceContexts()},async fetchNativeRelease(){if(!this.enableNative)throw this._DisabledNativeError;return di.fetchNativeRelease()},async fetchNativeSdkInfo(){if(!this.enableNative)throw this._DisabledNativeError;return di.fetchNativeSdkInfo()},crash(){if(this.enableNative){if(!this.isNativeClientAvailable())throw this._NativeClientError;di.crash()}},setUser(e){if(!this.enableNative)return;if(!this.isNativeClientAvailable())throw this._NativeClientError;let t=null,r=null;if(e){const{id:n,ip_address:i,email:o,username:s,...a}=e;t=this._serializeObject({email:o,id:n,ip_address:i,username:s},!0),r=this._serializeObject(a,!0)}di.setUser({defaultUserKeys:t,otherUserKeys:r})},setTag(e,t){if(!this.enableNative)return;if(!this.isNativeClientAvailable())throw this._NativeClientError;const r=typeof t=="string"?t:JSON.stringify(t);di.setTag({key:e,value:r})},setExtra(e,t){if(!this.enableNative)return;if(!this.isNativeClientAvailable())throw this._NativeClientError;const r=typeof t=="string"?t:JSON.stringify(t);di.setExtra({key:e,value:r})},addBreadcrumb(e){if(this.enableNative){if(!this.isNativeClientAvailable())throw this._NativeClientError;di.addBreadcrumb({...e,level:e.level?this._processLevel(e.level):void 0,data:e.data?jR(e.data):void 0})}},clearBreadcrumbs(){if(this.enableNative){if(!this.isNativeClientAvailable())throw this._NativeClientError;di.clearBreadcrumbs()}},closeNativeSdk(){if(!this.enableNative)return Or.debug(this._DisabledNativeError),Promise.resolve();if(!this.isNativeClientAvailable())throw this._NativeClientError;return di.closeNativeSdk().then(()=>{this.enableNative=!1})},setContext(e,t){if(this.enableNative){if(!this.isNativeClientAvailable())throw this._NativeClientError;this.platform==="android"?this.setExtra(e,t):di.setContext({key:e,value:t!==null?this._serializeObject(t):null})}},_processItem(e){if(Hr.platform==="android"){const[t,r]=e;if(t.type=="event"||t.type=="transaction"){const n=this._processLevels(r);return"message"in n&&(n.message={message:n.message}),n.breadcrumbs&&(n.breadcrumbs=[]),[t,n]}}return e},_serializeObject(e,t){const r={};return Object.keys(e).forEach(n=>{const i=e[n];(t!==!0||i!==void 0)&&(r[n]=typeof i=="string"?i:JSON.stringify(i))}),r},_processLevels(e){var t;return{...e,level:e.level?this._processLevel(e.level):void 0,breadcrumbs:(t=e.breadcrumbs)===null||t===void 0?void 0:t.map(n=>({...n,level:n.level?this._processLevel(n.level):void 0}))}},_processLevel(e){return e=="log"?"debug":e=="critical"?"fatal":e},isModuleLoaded(){return!!di},isNativeClientAvailable(){return this.isModuleLoaded()&&qe.isPluginAvailable("SentryCapacitor")},_DisabledNativeError:new Error("Native is disabled"),_NativeClientError:new Error("Native Client is not available, can't start on native."),enableNative:!0,platform:qe.getPlatform()},eQ="DeviceContext",tQ=()=>({name:eQ,processEvent:rQ});async function rQ(e){try{const t=await Hr.fetchNativeDeviceContexts(),r=t.context;if(e.contexts={...r,...e.contexts},"user"in t){const n=t.user;e.user||(e.user={...n})}}catch(t){Or.log(`Failed to get device context from native: ${t}`)}return e}const nQ="EventOrigin",iQ=()=>({name:nQ,preprocessEvent:oQ});async function oQ(e){var t;return e.tags=(t=e.tags)!==null&&t!==void 0?t:{},e.tags["event.origin"]="javascript",e.tags["event.environment"]="javascript",e}const sQ="Release",aQ=()=>({name:sQ,processEvent:lQ});async function lQ(e,t,r){const n=r.getOptions();if(typeof(n==null?void 0:n.release)=="string"&&(e.release=n.release),typeof(n==null?void 0:n.dist)=="str
133ing"&&(e.dist=n.dist),e.release&&e.dist)return e;try{const i=await Hr.fetchNativeRelease();i&&(e.release||(e.release=`${i.id}@${i.version}+${i.build}`),e.dist||(e.dist=`${i.build}`))}catch{}return e}const cQ=Ht;function uQ(){return cQ.WEBVIEW_SERVER_URL}const dQ=()=>kY({iteratee:hQ});function hQ(e){if(e.filename){const t=/^https?:\/\//.test(e.filename),r=uQ();if(r?e.filename=e.filename.replace(r,""):e.filename=e.filename.replace(/^https?:\/\/localhost(:\d+)?/,"").replace(/^capacitor:\/\/localhost(:\d+)?/,""),e.filename=e.filename.replace(/^ng:\/\//,""),e.filename==="[native code]"||e.filename==="native")e.in_app=!1;else{if(!t){const i=e.filename.startsWith("/")?e.filename:`/${e.filename}`,o="app://";e.filename=`${o}${i}`}e.in_app=!0}}return e}const fQ="SdkInfo";let Np=null,vy;const pQ=()=>({name:fQ,processEvent:mQ,setup(e){vy=e.getOptions().sendDefaultPii,vy&&e.on("beforeSendEvent",r=>{var n;((n=r.user)===null||n===void 0?void 0:n.ip_address)==="{{auto}}"&&delete r.user.ip_address})}});async function mQ(e){if(Hr.platform==="ios"&&Np===null)try{Np=await Hr.fetchNativeSdkInfo()}catch{Or.warn("[SdkInfo] Native SDK Info retrieval failed...something could be wrong with your Sentry installation.")}e.platform=e.platform||"javascript";const t=e.sdk||{};return t.name=t.name||YJ,t.version=t.version||x8,t.packages=[...t.packages||[],...Np&&[Np]||[],{name:"npm:@sentry/capacitor",version:x8}],t.settings={infer_ip:vy?"auto":"never",...t.settings},e.sdk=t,e}function gQ(e){const t=[];return t.push(dQ()),t.push(aQ()),t.push(iQ()),t.push(pQ()),e.enableNative&&t.push(tQ()),t}const vQ="info";function ga(e,t,r){Ei(e,t,r)}const w8=new WeakMap;function E8(e){w8.has(e)||(w8.set(e,!0),ga(e,"setUser",t=>r=>(Hr.setUser(r),t.call(e,r))),ga(e,"setTag",t=>(r,n)=>(Hr.setTag(r,n),t.call(e,r,n))),ga(e,"setTags",t=>r=>(Object.keys(r).forEach(n=>{Hr.setTag(n,r[n])}),t.call(e,r))),ga(e,"setExtras",t=>r=>(Object.keys(r).forEach(n=>{Hr.setExtra(n,r[n])}),t.call(e,r))),ga(e,"setExtra",t=>(r,n)=>(Hr.setExtra(r,n),t.call(e,r,n))),ga(e,"addBreadcrumb",t=>(r,n)=>{const i={...r,level:r.level||vQ,data:r.data?jR(r.data):void 0};t.call(e,i,n);const o=e.getLastBreadcrumb();return o&&Hr.addBreadcrumb(o),e}),ga(e,"clearBreadcrumbs",t=>()=>(Hr.clearBreadcrumbs(),t.call(e))),ga(e,"setContext",t=>(r,n)=>(Hr.setContext(r,n),t.call(e,r,n))))}const yQ=()=>{const e=il(),t=e.__SENTRY__=e.__SENTRY__||{};(t[cs]=t[cs]||{}).encodePolyfill=_Q},_Q=e=>new Uint8Array(eh(e)),LR=30;class bQ{constructor(t={}){this._buffer=Zk(t.bufferSize||LR)}send(t){return this._buffer.add(()=>Hr.sendEnvelope(t))}flush(t){return this._buffer.drain(t)}}function xQ(e={}){return new bQ(e)}function wQ(e,t={}){return typeof e=="function"?(...r)=>{try{return e(...r)}catch(n){return Or.error(t.loggerMessage?t.loggerMessage:`The ${e.name} callback threw an error`,n),r[0]}}:e}const EQ=()=>typeof TextEncoder<"u";function SQ(e,t=kR){var r,n,i;const o={enableAutoSessionTracking:!0,enableWatchdogTerminationTracking:!0,enableCaptureFailedRequests:!1,...e};o.enabled===!1||Hr.platform==="web"?(o.enableNative=!1,o.enableNativeNagger=!1):((r=o.enableNativeNagger)!==null&&r!==void 0||(o.enableNativeNagger=!0),(n=o.enableNative)!==null&&n!==void 0||(o.enableNative=!0));const s=e.defaultIntegrations===void 0?gQ(e):e.defaultIntegrations;o.integrations=Vk({integrations:wQ(e.integrations,{loggerMessage:"The integrations threw an error"}),defaultIntegrations:s}),o.enableNative&&!e.transport&&Hr.platform!=="web"&&(o.transport=e.transport||xQ,o.transportOptions={...(i=e.transportOptions)!==null&&i!==void 0?i:{},bufferSize:LR}),EQ()||yQ(),o.enableNative&&(E8(Sb()),E8(qn()));const a={...o,autoSessionTracking:Hr.platform==="web"&&o.enableAutoSessionTracking},l={...o,enableAutoSessionTracking:Hr.platform!=="web"&&o.enableAutoSessionTracking};Hr.initNativeSdk(l),t(a)}async function R7e(){try{const e=Yt();e&&(await e.close(),await Hr.closeNativeSdk())}catch{Or.error("Failed to close the SDK")}}function I7e(){Hr.crash()}function M1({children:e}){return c.jsx(F,{sx:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"background.default",p:2},children:e??c.jsx(F,{"aria-hidden":!0,sx:{width:48,height:48,border:"5px solid #8865FE66",borderRadius:"50%",borderTopColor:"#8865FE",animation:"boot-shell-spin 1s ease-in-out infinite","@keyframes boot-shell-spin":{to:{transform:"rotate(360deg)"}}}})})}function $R({title:e,body:t,onRetry:r,retrying:n,secondaryLabel:i,onSecondary:o}){return c.jsx(F,{sx:{px:2,py:{xs:4,sm:6}},children:c.jsxs(me,{spacing:2.5,maxWidth:480,mx:"auto",children:[c.jsx(V,{variant:"h6",fontWeight:700,textAlign:"center",children:e}),c.jsx(V,{variant:"body2",color:"text.secondary",textAlign:"center",children:t}),c.jsxs(me,{spacing:1.5,children:[c.jsx(De,{variant:"contained",color:"primary",fullWidth:!0,onClick:r,disabled:n,children:n?"Tentando...":"Tentar novamente"}),i&&o&&c.jsx(De,{variant:"text",color:"primary",fullWidth:!0,onClick:o,children:i})]})]})})}const vh=new Map;let CQ=0;function TQ(){return`lazy:${CQ++}`}let DR=0;const yy=new Set;function AQ(){for(const e of[...yy])e()}function kQ(e){return yy.add(e),()=>{yy.delete(e)}}function S8(){return DR}function RQ(e,t){vh.has(e)||vh.set(e,{loader:t,current:v.lazy(t)});const r=n=>{v.useSyncExternalStore(kQ,S8,S8);const i=vh.get(e);return i?v.createElement(i.current,n):null};return r.displayName=`LazyPage(${e})`,r}function MR(e){if(e!==void 0){const t=vh.get(e);if(!t)return;t.current=v.lazy(t.loader)}else for(const t of vh.values())t.current=v.lazy(t.loader);DR+=1,AQ()}function NR(e){if(!e)return!1;const t=e.name;if(t==="ChunkLoadError"||t==="ChunkReloadStalledError")return!0;const r=e.message;if(typeof r!="string")return!1;const n=r.toLowerCase();return n.includes("failed to fetch dynamically imported module")||n.includes("error loading dynamically imported module")||n.includes("importing a module script failed")||n.includes("unable to preload css")||n.includes("dynamically imported module")}let IQ=class extends v.Component{constructor(){super(...arguments);ze(this,"state",{error:null,attempts:0});ze(this,"retry",()=>{MR(),this.setState(r=>({error:null,attempts:r.attempts+1}))});ze(this,"reload",()=>{window.location.reload()})}static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,n){try{Db(r,{extra:{componentStack:n.componentStack,tier:"app"}})}catch{}}render(){const{error:r,attempts:n}=this.state;if(!r)return this.props.children;const i=n>=1||NR(r);return c.jsx(M1,{children:c.jsx($R,{title:"Algo deu errado",body:"Não conseguimos carregar esta parte do app. Você pode tentar de novo.",onRetry:i?this.reload:this.retry,secondaryLabel:i?void 0:"Recarregar o app",onSecondary:i?void 0:this.reload})})}};function PQ({children:e}){return c.jsx(IQ,{children:e})}const Sn={primary:{main:"#8865FE",contrastText:"#ffffff"},secondary:{main:"#f07838",contrastText:"#ffffff"},background:{default:"#F6F6FA",paper:"#F6F6FA"},info:{main:"#658FFE",light:"#E9EFFF"},error:{main:"#FF3355",light:"#FFE5E9"},success:{main:"#17A24A",light:"#E6F7ED"},warning:{main:"#FFB82E",light:"#FFF6E5"},text:{primary:"#041E42",secondary:"#415064"}},OQ={fontFamily:'"Plus Jakarta Sans Variable", sans-serif'},jQ=AD({palette:Sn,typography:OQ,spacing:8,shape:{borderRadius:12},shadows:["none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none"],components:{MuiAppBar:{styleOverrides:{root:{backgroundColor:"#ffffff",color:Sn.text.primary}}}
133,MuiBottomNavigation:{styleOverrides:{root:{backgroundColor:"#ffffff"}}},MuiBottomNavigationAction:{styleOverrides:{root:{color:gt(Sn.text.secondary,.75),"&.Mui-selected":{color:Sn.text.primary,"& .MuiSvgIcon-root":{transform:"scale(1.04)"}},"& .MuiBottomNavigationAction-label":{fontSize:"0.6875rem","&.Mui-selected":{fontSize:"0.6875rem"}},"& .MuiSvgIcon-root":{fontSize:"1.4rem",transition:"transform 0.2s ease"}}}},MuiCard:{styleOverrides:{root:{boxShadow:"none",borderRadius:"10px",backgroundColor:"white"}}},MuiListItem:{styleOverrides:{root:{backgroundColor:"#ffffff",borderBottom:"none",borderRadius:"12px",marginBottom:"8px"}}},MuiListItemButton:{styleOverrides:{root:{padding:"12px 16px",borderRadius:"12px","& .MuiTouchRipple-root":{borderRadius:"12px"},"&:hover, &.Mui-focusVisible":{backgroundColor:gt(Sn.text.primary,.01)},"&:active":{backgroundColor:gt(Sn.text.primary,.04)},"&.Mui-disabled":{backgroundColor:"white",opacity:.6}}}},MuiListItemIcon:{styleOverrides:{root:{color:Sn.primary.main,minWidth:"36px"}}},MuiListItemText:{styleOverrides:{primary:{fontWeight:500},secondary:{color:Sn.text.secondary}}},MuiTextField:{defaultProps:{InputLabelProps:{shrink:!0}},styleOverrides:{root:{"& .MuiInputLabel-root":{position:"relative",transform:"none",marginBottom:8,fontSize:"0.875rem",fontWeight:600,color:Sn.text.primary,"&.Mui-focused":{color:Sn.text.primary},"&.Mui-error":{color:Sn.error.main}},"& .MuiInputBase-root":{marginTop:0},"& .MuiOutlinedInput-root":{backgroundColor:"#ffffff",borderRadius:12,transition:"all 0.2s ease","& fieldset":{borderColor:"#e5e7eb",borderWidth:2,transition:"border-color 0.2s ease"},"&:hover fieldset":{borderColor:"#d1d5db"},"&.Mui-focused fieldset":{borderColor:Sn.primary.main,borderWidth:2},"&.Mui-error fieldset":{borderColor:Sn.error.main}}}}},MuiInputLabel:{defaultProps:{shrink:!0},styleOverrides:{root:{fontWeight:600,position:"relative",transform:"none"}}},MuiInputBase:{styleOverrides:{root:{backgroundColor:"transparent"},input:{fontWeight:600}}},MuiOutlinedInput:{styleOverrides:{root:{backgroundColor:"#ffffff",borderRadius:12,"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#d1d5db"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:Sn.primary.main,borderWidth:2}},notchedOutline:{borderColor:"#e5e7eb",borderWidth:2,borderRadius:"inherit",top:0,"& legend":{display:"none"}}}},MuiFormLabel:{styleOverrides:{root:{fontWeight:600,fontSize:"0.875rem",color:Sn.text.primary,marginBottom:8,"&.Mui-focused":{color:Sn.text.primary}}}},MuiFormControlLabel:{styleOverrides:{label:{fontWeight:600}}},MuiInputAdornment:{styleOverrides:{root:{color:gt(Sn.text.primary,.52)}}},MuiFormHelperText:{styleOverrides:{root:{fontWeight:600}}},MuiButton:{styleOverrides:{root:{fontWeight:600,textTransform:"none"}},defaultProps:{size:"large"}},MuiMenu:{styleOverrides:{paper:{backgroundColor:"#ffffff",boxShadow:"rgba(0, 0, 0, 0.1) 0px 0px 5px 0px, rgba(0, 0, 0, 0.1) 0px 0px 1px 0px",maxHeight:"calc(100vh - 144px)"}}},MuiPopover:{styleOverrides:{paper:{boxShadow:"rgba(0, 0, 0, 0.1) 0px 0px 5px 0px, rgba(0, 0, 0, 0.1) 0px 0px 1px 0px"}}},MuiAutocomplete:{styleOverrides:{paper:{boxShadow:"rgba(0, 0, 0, 0.1) 0px 0px 5px 0px, rgba(0, 0, 0, 0.1) 0px 0px 1px 0px",backgroundColor:"#ffffff"}}},MuiDialog:{styleOverrides:{paper:{boxShadow:"rgba(0, 0, 0, 0.1) 0px 0px 5px 0px, rgba(0, 0, 0, 0.1) 0px 0px 1px 0px",maxHeight:"calc(100vh - var(--safe-area-inset-top) - var(--safe-area-inset-bottom) - 96px)"},paperFullScreen:{maxHeight:"100vh !important",height:"100%",width:"100%",margin:0,borderRadius:0}}},MuiSnackbar:{styleOverrides:{anchorOriginTopCenter:{top:"calc(var(--safe-area-inset-top) + 8px)","@media (min-width: 600px)":{top:"calc(var(--safe-area-inset-top) + 24px)"}},anchorOriginTopLeft:{top:"calc(var(--safe-area-inset-top) + 8px)","@media (min-width: 600px)":{top:"calc(var(--safe-area-inset-top) + 24px)"}},anchorOriginTopRight:{top:"calc(var(--safe-area-inset-top) + 8px)","@media (min-width: 600px)":{top:"calc(var(--safe-area-inset-top) + 24px)"}}}}}});function nt(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function pr(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function wc(e,t){const r=nt(e);return isNaN(t)?pr(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function zb(e,t){const r=+nt(e);return pr(e,r+t)}function LQ(e,t){return zb(e,t*1e3)}const FR=6048e5,$Q=864e5,ug=6e4,dg=36e5,DQ=1e3,Fp=43200,C8=1440;function MQ(e,t){return zb(e,t*ug)}function NQ(e,t){return zb(e,t*dg)}function FQ(e,t){const r=t*7;return wc(e,r)}function Wb(e,t){const r=nt(e);if(isNaN(t))return pr(e,NaN);if(!t)return r;const n=r.getDate(),i=pr(e,r.getTime());i.setMonth(r.getMonth()+t+1,0);const o=i.getDate();return n>=o?i:(r.setFullYear(i.getFullYear(),i.getMonth(),n),r)}function UQ(e,t){return Wb(e,t*12)}function Ka(e){const t=nt(e);return t.setHours(23,59,59,999),t}let UR={};function la(){return UR}function BQ(e){UR=e}function BR(e,t){var a,l,d,u;const r=la(),n=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??r.weekStartsOn??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,i=nt(e),o=i.getDay(),s=(o<n?-7:0)+6-(o-n);return i.setDate(i.getDate()+s),i.setHours(23,59,59,999),i}function T8(e){const t=nt(e),r=t.getFullYear();return t.setFullYear(r+1,0,0),t.setHours(23,59,59,999),t}const VQ={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},HQ=(e,t,r)=>{let n;const i=VQ[e];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function mu(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const zQ={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},WQ={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},qQ={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},GQ={date:mu({formats:zQ,defaultWidth:"full"}),time:mu({formats:WQ,defaultWidth:"full"}),dateTime:mu({formats:qQ,defaultWidth:"full"})},KQ={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},YQ=(e,t,r,n)=>KQ[e];function Xo(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let i;if(n==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,a=r!=null&&r.width?String(r.width):s;i=e.formattingValues[a]||e.formattingValues[s]}else{const s=e.defaultWidth,a=r!=null&&r.width?String(r.width):e.defaultWidth;i=e.values[a]||e.values[s]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const ZQ={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},XQ={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},JQ={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},QQ={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
133ay","Saturday"]},eee={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},tee={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ree=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},nee={ordinalNumber:ree,era:Xo({values:ZQ,defaultWidth:"wide"}),quarter:Xo({values:XQ,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Xo({values:JQ,defaultWidth:"wide"}),day:Xo({values:QQ,defaultWidth:"wide"}),dayPeriod:Xo({values:eee,defaultWidth:"wide",formattingValues:tee,defaultFormattingWidth:"wide"})};function Jo(e){return(t,r={})=>{const n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const s=o[0],a=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?oee(a,h=>h.test(s)):iee(a,h=>h.test(s));let d;d=e.valueCallback?e.valueCallback(l):l,d=r.valueCallback?r.valueCallback(d):d;const u=t.slice(s.length);return{value:d,rest:u}}}function iee(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function oee(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function VR(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const i=n[0],o=t.match(e.parsePattern);if(!o)return null;let s=e.valueCallback?e.valueCallback(o[0]):o[0];s=r.valueCallback?r.valueCallback(s):s;const a=t.slice(i.length);return{value:s,rest:a}}}const see=/^(\d+)(th|st|nd|rd)?/i,aee=/\d+/i,lee={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},cee={any:[/^b/i,/^(a|c)/i]},uee={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},dee={any:[/1/i,/2/i,/3/i,/4/i]},hee={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},fee={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},pee={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},mee={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},gee={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},vee={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},yee={ordinalNumber:VR({matchPattern:see,parsePattern:aee,valueCallback:e=>parseInt(e,10)}),era:Jo({matchPatterns:lee,defaultMatchWidth:"wide",parsePatterns:cee,defaultParseWidth:"any"}),quarter:Jo({matchPatterns:uee,defaultMatchWidth:"wide",parsePatterns:dee,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Jo({matchPatterns:hee,defaultMatchWidth:"wide",parsePatterns:fee,defaultParseWidth:"any"}),day:Jo({matchPatterns:pee,defaultMatchWidth:"wide",parsePatterns:mee,defaultParseWidth:"any"}),dayPeriod:Jo({matchPatterns:gee,defaultMatchWidth:"any",parsePatterns:vee,defaultParseWidth:"any"})},hg={code:"en-US",formatDistance:HQ,formatLong:GQ,formatRelative:YQ,localize:nee,match:yee,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Bn(e){const t=nt(e);return t.setHours(0,0,0,0),t}function Nu(e){const t=nt(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function HR(e,t){const r=Bn(e),n=Bn(t),i=+r-Nu(r),o=+n-Nu(n);return Math.round((i-o)/$Q)}function zR(e){const t=nt(e),r=pr(e,0);return r.setFullYear(t.getFullYear(),0,1),r.setHours(0,0,0,0),r}function _ee(e){const t=nt(e);return HR(t,zR(t))+1}function vs(e,t){var a,l,d,u;const r=la(),n=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??r.weekStartsOn??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,i=nt(e),o=i.getDay(),s=(o<n?7:0)+o-n;return i.setDate(i.getDate()-s),i.setHours(0,0,0,0),i}function Fu(e){return vs(e,{weekStartsOn:1}
133)}function WR(e){const t=nt(e),r=t.getFullYear(),n=pr(e,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);const i=Fu(n),o=pr(e,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const s=Fu(o);return t.getTime()>=i.getTime()?r+1:t.getTime()>=s.getTime()?r:r-1}function bee(e){const t=WR(e),r=pr(e,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),Fu(r)}function qR(e){const t=nt(e),r=+Fu(t)-+bee(t);return Math.round(r/FR)+1}function qb(e,t){var u,h,f,p;const r=nt(e),n=r.getFullYear(),i=la(),o=(t==null?void 0:t.firstWeekContainsDate)??((h=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??i.firstWeekContainsDate??((p=(f=i.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,s=pr(e,0);s.setFullYear(n+1,0,o),s.setHours(0,0,0,0);const a=vs(s,t),l=pr(e,0);l.setFullYear(n,0,o),l.setHours(0,0,0,0);const d=vs(l,t);return r.getTime()>=a.getTime()?n+1:r.getTime()>=d.getTime()?n:n-1}function xee(e,t){var a,l,d,u;const r=la(),n=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??r.firstWeekContainsDate??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,i=qb(e,t),o=pr(e,0);return o.setFullYear(i,0,n),o.setHours(0,0,0,0),vs(o,t)}function Gb(e,t){const r=nt(e),n=+vs(r,t)-+xee(r,t);return Math.round(n/FR)+1}function hr(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const va={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return hr(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):hr(r+1,2)},d(e,t){return hr(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return hr(e.getHours()%12||12,t.length)},H(e,t){return hr(e.getHours(),t.length)},m(e,t){return hr(e.getMinutes(),t.length)},s(e,t){return hr(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),i=Math.trunc(n*Math.pow(10,r-3));return hr(i,t.length)}},Nc={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},A8={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),i=n>0?n:1-n;return r.ordinalNumber(i,{unit:"year"})}return va.y(e,t)},Y:function(e,t,r,n){const i=qb(e,n),o=i>0?i:1-i;if(t==="YY"){const s=o%100;return hr(s,2)}return t==="Yo"?r.ordinalNumber(o,{unit:"year"}):hr(o,t.length)},R:function(e,t){const r=WR(e);return hr(r,t.length)},u:function(e,t){const r=e.getFullYear();return hr(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return hr(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return hr(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return va.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return hr(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const i=Gb(e,n);return t==="wo"?r.ordinalNumber(i,{unit:"week"}):hr(i,t.length)},I:function(e,t,r){const n=qR(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):hr(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):va.d(e,t)},D:function(e,t,r){const n=_ee(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):hr(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const i=e.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return hr(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const i=e.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return hr(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),i=n===0?7:n;switch(t){case"i":return String(i);case"ii":return hr(i,t.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let i;switch(n===12?i=Nc.noon:n===0?i=Nc.midnight:i=n/12>
133=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let i;switch(n>=17?i=Nc.evening:n>=12?i=Nc.afternoon:n>=4?i=Nc.morning:i=Nc.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return va.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):va.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):hr(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):hr(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):va.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):va.s(e,t)},S:function(e,t){return va.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return R8(n);case"XXXX":case"XX":return El(n);case"XXXXX":case"XXX":default:return El(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return R8(n);case"xxxx":case"xx":return El(n);case"xxxxx":case"xxx":default:return El(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+k8(n,":");case"OOOO":default:return"GMT"+El(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+k8(n,":");case"zzzz":default:return"GMT"+El(n,":")}},t:function(e,t,r){const n=Math.trunc(e.getTime()/1e3);return hr(n,t.length)},T:function(e,t,r){const n=e.getTime();return hr(n,t.length)}};function k8(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.trunc(n/60),o=n%60;return o===0?r+String(i):r+String(i)+t+hr(o,2)}function R8(e,t){return e%60===0?(e>0?"-":"+")+hr(Math.abs(e)/60,2):El(e,t)}function El(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=hr(Math.trunc(n/60),2),o=hr(n%60,2);return r+i+t+o}const I8=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},GR=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},wee=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return I8(e,t);let o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",I8(n,t)).replace("{{time}}",GR(i,t))},N1={p:GR,P:wee},Eee=/^D+$/,See=/^Y+$/,Cee=["D","DD","YY","YYYY"];function KR(e){return Eee.test(e)}function YR(e){return See.test(e)}function _y(e,t,r){const n=Tee(e,t,r);if(console.warn(n),Cee.includes(e))throw new RangeError(n)}function Tee(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function Aee(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ZR(e){if(!Aee(e)&&typeof e!="number")return!1;const t=nt(e);return!isNaN(Number(t))}const kee=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ree=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Iee=/^'([^]*?)'?$/,Pee=/''/g,Oee=/[a-zA-Z]/;function Di(e,t,r){var u,h,f,p,m,g,y,b;const n=la(),i=(r==null?void 0:r.locale)??n.locale??hg,o=(r==null?void 0:r.firstWeekContainsDate)??((h=(u=r==null?void 0:r.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??n.firstWeekContainsDate??((p=(f=n.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,s=(r==null?void 0:r.weekStartsOn)??((g=(m=r==null?void 0:r.locale)==null?void 0:m.options)==null?void 0:g.weekStartsOn)??n.weekStartsOn??((b=(y=n.locale)==null?void 0:y.options)==null?void 0:b.weekStartsOn)??0,a=nt(e);if(!ZR(a))throw new RangeError("Invalid time value");let l=t.match(Ree).map(E=>{const S=E[0];if(S==="p"||S==="P"){const k=N1[S];return k(E,i.formatLong)}return E}).join("").match(kee).map(E=>{if(E==="''")return{isToken:!1,value:"'"};const S=E[0];if(S==="'")return{isToken:!1,value:jee(E)};if(A8[S])return{isToken:!0,value:E};
133if(S.match(Oee))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:E}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const d={firstWeekContainsDate:o,weekStartsOn:s,locale:i};return l.map(E=>{if(!E.isToken)return E.value;const S=E.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&YR(S)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&KR(S))&&_y(S,t,String(e));const k=A8[S[0]];return k(a,S,i.localize,d)}).join("")}function jee(e){const t=e.match(Iee);return t?t[1].replace(Pee,"'"):e}function Lee(e){return nt(e).getDate()}function XR(e){const t=nt(e),r=t.getFullYear(),n=t.getMonth(),i=pr(e,0);return i.setFullYear(r,n+1,0),i.setHours(0,0,0,0),i.getDate()}function $ee(e){return nt(e).getHours()}function Dee(e){return nt(e).getMinutes()}function Mee(e){return nt(e).getMonth()}function Nee(e){return nt(e).getSeconds()}function Fee(e){return nt(e).getMilliseconds()}function Uee(e){return nt(e).getFullYear()}function M2(e,t){const r=nt(e),n=nt(t);return r.getTime()>n.getTime()}function gu(e,t){const r=nt(e),n=nt(t);return+r<+n}function Bee(e,t){const r=nt(e),n=nt(t);return+r==+n}function Kb(e,t){const r=Bn(e),n=Bn(t);return+r==+n}function Vee(e,t){const r=nt(e),n=nt(t);return r.getFullYear()===n.getFullYear()}function Hee(e,t){const r=nt(e),n=nt(t);return r.getFullYear()===n.getFullYear()&&r.getMonth()===n.getMonth()}function P8(e){const t=nt(e);return t.setMinutes(0,0,0),t}function zee(e,t){const r=P8(e),n=P8(t);return+r==+n}function Wee(){return Object.assign({},la())}function qee(e,t){const r=t instanceof Date?pr(t,0):new t(0);return r.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),r.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),r}const Gee=10;class JR{constructor(){ze(this,"subPriority",0)}validate(t,r){return!0}}class Kee extends JR{constructor(t,r,n,i,o){super(),this.value=t,this.validateValue=r,this.setValue=n,this.priority=i,o&&(this.subPriority=o)}validate(t,r){return this.validateValue(t,this.value,r)}set(t,r,n){return this.setValue(t,r,this.value,n)}}class Yee extends JR{constructor(){super(...arguments);ze(this,"priority",Gee);ze(this,"subPriority",-1)}set(r,n){return n.timestampIsSet?r:pr(r,qee(r,Date))}}class ar{run(t,r,n,i){const o=this.parse(t,r,n,i);return o?{setter:new Kee(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(t,r,n){return!0}}class Zee extends ar{constructor(){super(...arguments);ze(this,"priority",140);ze(this,"incompatibleTokens",["R","u","t","T"])}parse(r,n,i){switch(n){case"G":case"GG":case"GGG":return i.era(r,{width:"abbreviated"})||i.era(r,{width:"narrow"});case"GGGGG":return i.era(r,{width:"narrow"});case"GGGG":default:return i.era(r,{width:"wide"})||i.era(r,{width:"abbreviated"})||i.era(r,{width:"narrow"})}}set(r,n,i){return n.era=i,r.setFullYear(i,0,1),r.setHours(0,0,0,0),r}}const Wr={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Qo={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function qr(e,t){return e&&{value:t(e.value),rest:e.rest}}function Ir(e,t){const r=t.match(e);return r?{value:parseInt(r[0],10),rest:t.slice(r[0].length)}:null}function es(e,t){const r=t.match(e);if(!r)return null;if(r[0]==="Z")return{value:0,rest:t.slice(1)};const n=r[1]==="+"?1:-1,i=r[2]?parseInt(r[2],10):0,o=r[3]?parseInt(r[3],10):0,s=r[5]?parseInt(r[5],10):0;return{value:n*(i*dg+o*ug+s*DQ),rest:t.slice(r[0].length)}}function QR(e){return Ir(Wr.anyDigitsSigned,e)}function Ur(e,t){switch(e){case 1:return Ir(Wr.singleDigit,t);case 2:return Ir(Wr.twoDigits,t);case 3:return Ir(Wr.threeDigits,t);case 4:return Ir(Wr.fourDigits,t);default:return Ir(new RegExp("^\\d{1,"+e+"}"),t)}}function F1(e,t){switch(e){case 1:return Ir(Wr.singleDigitSigned,t);case 2:return Ir(Wr.twoDigitsSigned,t);case 3:return Ir(Wr.threeDigitsSigned,t);case 4:return Ir(Wr.fourDigitsSigned,t);default:return Ir(new RegExp("^-?\\d{1,"+e+"}"),t)}}function Yb(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function eI(e,t){const r=t>0,n=r?t:1-t;let i;if(n<=50)i=e||100;
133else{const o=n+50,s=Math.trunc(o/100)*100,a=e>=o%100;i=e+s-(a?100:0)}return r?i:1-i}function tI(e){return e%400===0||e%4===0&&e%100!==0}class Xee extends ar{constructor(){super(...arguments);ze(this,"priority",130);ze(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(r,n,i){const o=s=>({year:s,isTwoDigitYear:n==="yy"});switch(n){case"y":return qr(Ur(4,r),o);case"yo":return qr(i.ordinalNumber(r,{unit:"year"}),o);default:return qr(Ur(n.length,r),o)}}validate(r,n){return n.isTwoDigitYear||n.year>0}set(r,n,i){const o=r.getFullYear();if(i.isTwoDigitYear){const a=eI(i.year,o);return r.setFullYear(a,0,1),r.setHours(0,0,0,0),r}const s=!("era"in n)||n.era===1?i.year:1-i.year;return r.setFullYear(s,0,1),r.setHours(0,0,0,0),r}}class Jee extends ar{constructor(){super(...arguments);ze(this,"priority",130);ze(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(r,n,i){const o=s=>({year:s,isTwoDigitYear:n==="YY"});switch(n){case"Y":return qr(Ur(4,r),o);case"Yo":return qr(i.ordinalNumber(r,{unit:"year"}),o);default:return qr(Ur(n.length,r),o)}}validate(r,n){return n.isTwoDigitYear||n.year>0}set(r,n,i,o){const s=qb(r,o);if(i.isTwoDigitYear){const l=eI(i.year,s);return r.setFullYear(l,0,o.firstWeekContainsDate),r.setHours(0,0,0,0),vs(r,o)}const a=!("era"in n)||n.era===1?i.year:1-i.year;return r.setFullYear(a,0,o.firstWeekContainsDate),r.setHours(0,0,0,0),vs(r,o)}}class Qee extends ar{constructor(){super(...arguments);ze(this,"priority",130);ze(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(r,n){return F1(n==="R"?4:n.length,r)}set(r,n,i){const o=pr(r,0);return o.setFullYear(i,0,4),o.setHours(0,0,0,0),Fu(o)}}class ete extends ar{constructor(){super(...arguments);ze(this,"priority",130);ze(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(r,n){return F1(n==="u"?4:n.length,r)}set(r,n,i){return r.setFullYear(i,0,1),r.setHours(0,0,0,0),r}}class tte extends ar{constructor(){super(...arguments);ze(this,"priority",120);ze(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(r,n,i){switch(n){case"Q":case"QQ":return Ur(n.length,r);case"Qo":return i.ordinalNumber(r,{unit:"quarter"});case"QQQ":return i.quarter(r,{width:"abbreviated",context:"formatting"})||i.quarter(r,{width:"narrow",context:"formatting"});case"QQQQQ":return i.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(r,{width:"wide",context:"formatting"})||i.quarter(r,{width:"abbreviated",context:"formatting"})||i.quarter(r,{width:"narrow",context:"formatting"})}}validate(r,n){return n>=1&&n<=4}set(r,n,i){return r.setMonth((i-1)*3,1),r.setHours(0,0,0,0),r}}class rte extends ar{constructor(){super(...arguments);ze(this,"priority",120);ze(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(r,n,i){switch(n){case"q":case"qq":return Ur(n.length,r);case"qo":return i.ordinalNumber(r,{unit:"quarter"});case"qqq":return i.quarter(r,{width:"abbreviated",context:"standalone"})||i.quarter(r,{width:"narrow",context:"standalone"});case"qqqqq":return i.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(r,{width:"wide",context:"standalone"})||i.quarter(r,{width:"abbreviated",context:"standalone"})||i.quarter(r,{width:"narrow",context:"standalone"})}}validate(r,n){return n>=1&&n<=4}set(r,n,i){return r.setMonth((i-1)*3,1),r.setHours(0,0,0,0),r}}class nte extends ar{constructor(){super(...arguments);ze(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);ze(this,"priority",110)}parse(r,n,i){const o=s=>s-1;switch(n){case"M":return qr(Ir(Wr.month,r),o);case"MM":return qr(Ur(2,r),o);case"Mo":return qr(i.ordinalNumber(r,{unit:"month"}),o);case"MMM":return i.month(r,{width:"abbreviated",context:"formatting"})||i.month(r,{width:"narrow",context:"formatting"});case"MMMMM":return i.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(r,{width:"wide",context:"formatting"})||i.month(r,{width:"abbreviated",context:"formatting"})||i.month(r,{width:"narrow",context:"formatting"})}}validate(r,n){return n>=0&&n<=11}set(r,n,i){return r.setMonth(i,1),r.setHours(0,0,0,0),r}}class ite extends ar{constructor(){super(...arguments);ze(this,"priority",110);ze(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(r,n,i){const o=s=>s-1;switch(n){case"L":return qr(Ir(Wr.month,r),o);case"LL":return qr(Ur(2,r),o);case"Lo":return qr(i.ordinalNumber(r,{unit:"month"}),o);case"LLL":return i.month(r,{width:"abbreviated",context:"standalone"})||i.month(r,{width:"narrow",context:"standalone"});case"LLLLL":return i.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(r,{width:"wide",context:"standalone"})||i.month(r,{width:"abbreviated",context:"standalone"})||i.month(r,{width:"narrow",context:"standalone"})}}validate(r,n){return n>=0&&n<=11}set(r,n,i){return r.setMonth(i,1),r.setHours(0,0,0,0),r}}function ote(e,t,r){const n=nt(e),i=Gb(n,r)-t;return n.setDate(n.getDate()-i*7),n}class ste extends ar{constructor(){super(...arguments);ze(this,"priority",100);ze(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(r,n,i){switch(n){case"w":return Ir(Wr.week,r);case"wo":return i.ordinalNumber(r,{unit:"week"});default:return Ur(n.length,r)}}validate(r,n){return n>=1&&n<=53}set(r,n,i,o){return vs(ote(r,i,o),o)}}function ate(e,t){const r=nt(e),n=qR(r)-t;return r.setDate(r.getDate()-n*7),r}class lte extends ar{constructor(){super(...arguments);ze(this,"priority",100);ze(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(r,n,i){switch(n){case"I":return Ir(Wr.week,r);case"Io":return i.ordinalNumber(r,{unit:"week"});default:return Ur(n.length,r)}}validate(r,n){return n>=1&&n<=53}set(r,n,i){return Fu(ate(r,i))}}const cte=[31,28,31,30,31,30,31,31,30,31,30,31],ute=[31,29,31,30,31,30,31,31,30,31,30,31];class dte extends ar{constructor(){super(...arguments);ze(this,"priority",90);ze(this,"subPriority",1);ze(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(r,n,i){switch(n){case"d":return Ir(Wr.date,r);case"do":return i.ordinalNumber(r,{unit:"date"});default:return Ur(n.length,r)}}validate(r,n){const i=r.getFullYear(),o=tI(i),s=r.getMonth();return o?n>=1&&n<=ute[s]:n>=1&&n<=cte[s]}set(r,n,i){return r.setDate(i),r.setHours(0,0,0,0),r}}class hte extends ar{constructor(){super(...arguments);ze(this,"priority",90);ze(this,"subpriority",1);ze(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(r,n,i){switch(n){case"D":case"DD":return Ir(Wr.dayOfYear,r);case"Do":return i.ordinalNumber(r,{unit:"date"});default:return Ur(n.length,r)}}validate(r,n){const i=r.getFullYear();return tI(i)?n>=1&&n<=366:n>=1&&n<=365}set(r,n,i){return r.setMonth(0,i),r.setHours(0,0,0,0),r}}function Zb(e,t,r){var h,f,p,m;const n=la(),i=(r==null?void 0:r.weekStartsOn)??((f=(h=r==null?void 0:r.locale)==null?void 0:h.options)==null?void 0:f.weekStartsOn)??n.weekStartsOn??((m=(p=n.locale)==null?void 0:p.options)==null?void 0:m.weekStartsOn)??0,o=nt(e),s=o.getDay(),l=(t%7+7)%7,d=7-i,u=t<0||t>6?t-(s+d)%7:(l+d)%7-(s+d)%7;return wc(o,u)}class fte extends ar{constructor(){super(...arguments);ze(this,"priority",90);ze(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(r,n,i){switch(n){case"E":case"EE":case"EEE":return i.day(r,{width:"abbreviated",context:"formatting"})||i.day(r,{width:"short",context:"formatting"})||i.day(r,{width:"narrow",context:"formatting"});case"EEEEE":return i.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(r,{width:"short",context:"formatting"})||i.day(r,{width:"narrow",context:"formatting"});case"EEEE":default:return i.day(r,{width:"wide",context:"formatting"})||i.day(r,{width:"abbreviated",context:"formatting"})||i.day(r,{width:"short",context:"formatting"})||i.day(r,{width:"narrow",context:"formatting"})}}validate(r,n){return n>=0&&n<=6}set(r,n,i,o){return r=Zb(r,i,o),r.setHours(0,0,0,0),r}}class pte extends ar{constructor(){super(...arguments);ze(this,"priority",90);ze(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(r,n,i,o){const s=a=>{const l=Math.floor((a-1)/7)*7;return(a+o.weekStartsOn+6)%7+l};switch(n){case"e":case"ee":return qr(Ur(n.length,r),s);case"eo":return qr(i.ordinalNumber(r,{unit:"day"}),s);case"eee":return i.day(r,{width:"abbreviated",context:"formatting"})||i.day(r,{width:"short",context:"formatting"})||i.day(r,{width:"narrow",context:"formatting"});case"eeeee":return i.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(r,{width:"short",context:"formatting"})||i.day(r,{width:"narrow",context:"formatting"});case"eeee":default:return i.day(r,{width:"wide",context:"formatting"})||i.day(r,{width:"abbreviated",context:"formatting"})||i.day(r,{width:"short",context:"formatting"})||i.day(r,{width:"narrow",context:"formatting"})}}validate(r,n){return n>=0&&n<=6}set(r,n,i,o){return r=Zb(r,i,o),r.setHours(0,0,0,0),r}}class mte extends ar{constructor(){super(...arguments);ze(this,"priority",90);ze(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(r,n,i,o){const s=a=>{const l=Math.floor((a-1)/7)*7;return(a+o.weekStartsOn+6)%7+l};switch(n){case"c":case"cc":return qr(Ur(n.length,r),s);case"co":return qr(i.ordinalNumber(r,{unit:"day"}),s);case"ccc":return i.day(r,{width:"abbreviated",context:"standalone"})||i.day(r,{width:"short",context:"standalone"})||i.day(r,{width:"narrow",context:"standalone"});case"ccccc":return i.day(r,{width:"narrow",context:"standalone"});case"cccccc":return i.day(r,{width:"short",context:"standalone"})||i.day(r,{width:"narrow",context:"standalone"});case"cccc":default:return i.day(r,{width:"wide",context:"standalone"})||i.day(r,{width:"abbreviated",context:"standalone"})||i.day(r,{width:"short",context:"standalone"})||i.day(r,{width:"narrow",context:"standalone"})}}validate(r,n){return n>=0&&n<=6}set(r,n,i,o){return r=Zb(r,i,o),r.setHours(0,0,0,0),r}}function gte(e){let r=nt(e).getDay();return r===0&&(r=7),r}function vte(e,t){const r=nt(e),n=gte(r),i=t-n;return wc(r,i)}class yte extends ar{constructor(){super(...arguments);ze(this,"priority",90);ze(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(r,n,i){const o=s=>s===0?7:s;switch(n){case"i":case"ii":return Ur(n.length,r);case"io":return i.ordinalNumber(r,{unit:"day"});case"iii":return qr(i.day(r,{width:"abbreviated",context:"formatting"})||i.day(r,{width:"short",context:"formatting"})||i.day(r,{width:"narrow",context:"formatting"}),o);case"iiiii":return qr(i.day(r,{width:"narrow",context:"formatting"}),o);case"iiiiii":return qr(i.day(r,{width:"short",context:"formatting"})||i.day(r,{width:"narrow",context:"formatting"}),o);case"iiii":default:return qr(i.day(r,{width:"wide",context:"formatting"})||i.day(r,{width:"abbreviated",context:"formatting"})||i.day(r,{width:"short",context:"formatting"})||i.day(r,{width:"narrow",context:"formatting"}),o)}}validate(r,n){return n>=1&&n<=7}set(r,n,i){return r=vte(r,i),r.setHours(0,0,0,0),r}}class _te extends ar{constructor(){super(...arguments);ze(this,"priority",80);ze(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(r,n,i){switch(n){case"a":case"aa":case"aaa":return i.dayPeriod(r,{width:"abbreviated",context:"formatting"})||i.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaaa":return i.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(r,{width:"wide",context:"formatting"})||i.dayPeriod(r,{width:"abbreviated",context:"formatting"})||i.dayPeriod(r,{width:"narrow",context:"formatting"})}}set(r,n,i){return r.setHours(Yb(i),0,0,0),r}}class bte extends ar{constructor(){super(...arguments);ze(this,"priority",80);ze(this,"incompatibleTokens",["a","B","H","k","t","T"])}
133parse(r,n,i){switch(n){case"b":case"bb":case"bbb":return i.dayPeriod(r,{width:"abbreviated",context:"formatting"})||i.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbbb":return i.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(r,{width:"wide",context:"formatting"})||i.dayPeriod(r,{width:"abbreviated",context:"formatting"})||i.dayPeriod(r,{width:"narrow",context:"formatting"})}}set(r,n,i){return r.setHours(Yb(i),0,0,0),r}}class xte extends ar{constructor(){super(...arguments);ze(this,"priority",80);ze(this,"incompatibleTokens",["a","b","t","T"])}parse(r,n,i){switch(n){case"B":case"BB":case"BBB":return i.dayPeriod(r,{width:"abbreviated",context:"formatting"})||i.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBBB":return i.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(r,{width:"wide",context:"formatting"})||i.dayPeriod(r,{width:"abbreviated",context:"formatting"})||i.dayPeriod(r,{width:"narrow",context:"formatting"})}}set(r,n,i){return r.setHours(Yb(i),0,0,0),r}}class wte extends ar{constructor(){super(...arguments);ze(this,"priority",70);ze(this,"incompatibleTokens",["H","K","k","t","T"])}parse(r,n,i){switch(n){case"h":return Ir(Wr.hour12h,r);case"ho":return i.ordinalNumber(r,{unit:"hour"});default:return Ur(n.length,r)}}validate(r,n){return n>=1&&n<=12}set(r,n,i){const o=r.getHours()>=12;return o&&i<12?r.setHours(i+12,0,0,0):!o&&i===12?r.setHours(0,0,0,0):r.setHours(i,0,0,0),r}}class Ete extends ar{constructor(){super(...arguments);ze(this,"priority",70);ze(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(r,n,i){switch(n){case"H":return Ir(Wr.hour23h,r);case"Ho":return i.ordinalNumber(r,{unit:"hour"});default:return Ur(n.length,r)}}validate(r,n){return n>=0&&n<=23}set(r,n,i){return r.setHours(i,0,0,0),r}}class Ste extends ar{constructor(){super(...arguments);ze(this,"priority",70);ze(this,"incompatibleTokens",["h","H","k","t","T"])}parse(r,n,i){switch(n){case"K":return Ir(Wr.hour11h,r);case"Ko":return i.ordinalNumber(r,{unit:"hour"});default:return Ur(n.length,r)}}validate(r,n){return n>=0&&n<=11}set(r,n,i){return r.getHours()>=12&&i<12?r.setHours(i+12,0,0,0):r.setHours(i,0,0,0),r}}class Cte extends ar{constructor(){super(...arguments);ze(this,"priority",70);ze(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(r,n,i){switch(n){case"k":return Ir(Wr.hour24h,r);case"ko":return i.ordinalNumber(r,{unit:"hour"});default:return Ur(n.length,r)}}validate(r,n){return n>=1&&n<=24}set(r,n,i){const o=i<=24?i%24:i;return r.setHours(o,0,0,0),r}}class Tte extends ar{constructor(){super(...arguments);ze(this,"priority",60);ze(this,"incompatibleTokens",["t","T"])}parse(r,n,i){switch(n){case"m":return Ir(Wr.minute,r);case"mo":return i.ordinalNumber(r,{unit:"minute"});default:return Ur(n.length,r)}}validate(r,n){return n>=0&&n<=59}set(r,n,i){return r.setMinutes(i,0,0),r}}class Ate extends ar{constructor(){super(...arguments);ze(this,"priority",50);ze(this,"incompatibleTokens",["t","T"])}parse(r,n,i){switch(n){case"s":return Ir(Wr.second,r);case"so":return i.ordinalNumber(r,{unit:"second"});default:return Ur(n.length,r)}}validate(r,n){return n>=0&&n<=59}set(r,n,i){return r.setSeconds(i,0),r}}class kte extends ar{constructor(){super(...arguments);ze(this,"priority",30);ze(this,"incompatibleTokens",["t","T"])}parse(r,n){const i=o=>Math.trunc(o*Math.pow(10,-n.length+3));return qr(Ur(n.length,r),i)}set(r,n,i){return r.setMilliseconds(i),r}}class Rte extends ar{constructor(){super(...arguments);ze(this,"priority",10);ze(this,"incompatibleTokens",["t","T","x"])}parse(r,n){switch(n){case"X":return es(Qo.basicOptionalMinutes,r);case"XX":return es(Qo.basic,r);case"XXXX":return es(Qo.basicOptionalSeconds,r);case"XXXXX":return es(Qo.extendedOptionalSeconds,r);case"XXX":default:return es(Qo.extended,r)}}set(r,n,i){return n.timestampIsSet?r:pr(r,r.getTime()-Nu(r)-i)}}class Ite extends ar{constructor(){super(...arguments);ze(this,"priority",10);ze(this,"incompatibleTokens",["t","T","X"])}parse(r,n){switch(n){case"x":return es(Qo.basicOptionalMinutes,r);case"xx":return es(Qo.basic,r);case"xxxx":return es(Qo.basicOptionalSeconds,r);case"xxxxx":return es(Qo.extendedOptionalSeconds,r);case"xxx":default:return es(Qo.extended,r)}}set(r,n,i){return n.timestampIsSet?r:pr(r,r.getTime()-Nu(r)-i)}}class Pte extends ar{constructor(){super(...arguments);ze(this,"priority",40);ze(this,"incompatibleTokens","*")}parse(r){return QR(r)}set(r,n,i){return[pr(r,i*1e3),{timestampIsSet:!0}]}}class Ote extends ar{constructor(){super(...arguments);ze(this,"priority",20);ze(this,"incompatibleTokens","*")}parse(r){return QR(r)}set(r,n,i){return[pr(r,i),{timestampIsSet:!0}]}}const jte={G:new Zee,y:new Xee,Y:new Jee,R:new Qee,u:new ete,Q:new tte,q:new rte,M:new nte,L:new ite,w:new ste,I:new lte,d:new dte,D:new hte,E:new fte,e:ne
133w pte,c:new mte,i:new yte,a:new _te,b:new bte,B:new xte,h:new wte,H:new Ete,K:new Ste,k:new Cte,m:new Tte,s:new Ate,S:new kte,X:new Rte,x:new Ite,t:new Pte,T:new Ote},Lte=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$te=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Dte=/^'([^]*?)'?$/,Mte=/''/g,Nte=/\S/,Fte=/[a-zA-Z]/;function Ute(e,t,r,n){var g,y,b,E,S,k,A,w;const i=Wee(),o=(n==null?void 0:n.locale)??i.locale??hg,s=(n==null?void 0:n.firstWeekContainsDate)??((y=(g=n==null?void 0:n.locale)==null?void 0:g.options)==null?void 0:y.firstWeekContainsDate)??i.firstWeekContainsDate??((E=(b=i.locale)==null?void 0:b.options)==null?void 0:E.firstWeekContainsDate)??1,a=(n==null?void 0:n.weekStartsOn)??((k=(S=n==null?void 0:n.locale)==null?void 0:S.options)==null?void 0:k.weekStartsOn)??i.weekStartsOn??((w=(A=i.locale)==null?void 0:A.options)==null?void 0:w.weekStartsOn)??0;if(t==="")return e===""?nt(r):pr(r,NaN);const l={firstWeekContainsDate:s,weekStartsOn:a,locale:o},d=[new Yee],u=t.match($te).map(_=>{const x=_[0];if(x in N1){const C=N1[x];return C(_,o.formatLong)}return _}).join("").match(Lte),h=[];for(let _ of u){!(n!=null&&n.useAdditionalWeekYearTokens)&&YR(_)&&_y(_,t,e),!(n!=null&&n.useAdditionalDayOfYearTokens)&&KR(_)&&_y(_,t,e);const x=_[0],C=jte[x];if(C){const{incompatibleTokens:P}=C;if(Array.isArray(P)){const O=h.find(D=>P.includes(D.token)||D.token===x);if(O)throw new RangeError(`The format string mustn't contain \`${O.fullToken}\` and \`${_}\` at the same time`)}else if(C.incompatibleTokens==="*"&&h.length>0)throw new RangeError(`The format string mustn't contain \`${_}\` and any other token at the same time`);h.push({token:x,fullToken:_});const I=C.run(e,_,o.match,l);if(!I)return pr(r,NaN);d.push(I.setter),e=I.rest}else{if(x.match(Fte))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");if(_==="''"?_="'":x==="'"&&(_=Bte(_)),e.indexOf(_)===0)e=e.slice(_.length);else return pr(r,NaN)}}if(e.length>0&&Nte.test(e))return pr(r,NaN);const f=d.map(_=>_.priority).sort((_,x)=>x-_).filter((_,x,C)=>C.indexOf(_)===x).map(_=>d.filter(x=>x.priority===_).sort((x,C)=>C.subPriority-x.subPriority)).map(_=>_[0]);let p=nt(r);if(isNaN(p.getTime()))return pr(r,NaN);const m={};for(const _ of f){if(!_.validate(p,l))return pr(r,NaN);const x=_.set(p,m,l);Array.isArray(x)?(p=x[0],Object.assign(m,x[1])):p=x}return pr(r,p)}function Bte(e){return e.match(Dte)[1].replace(Mte,"'")}function Vte(e,t){const r=nt(e);return r.setDate(t),r}function Hte(e,t){const r=nt(e);return r.setHours(t),r}function zte(e,t){const r=nt(e);return r.setMinutes(t),r}function Wte(e,t){const r=nt(e),n=r.getFullYear(),i=r.getDate(),o=pr(e,0);o.setFullYear(n,t,15),o.setHours(0,0,0,0);const s=XR(o);return r.setMonth(t,Math.min(i,s)),r}function qte(e,t){const r=nt(e);return r.setSeconds(t),r}function Gte(e,t){const r=nt(e);return r.setMilliseconds(t),r}function Kte(e,t){const r=nt(e);return isNaN(+r)?pr(e,NaN):(r.setFullYear(t),r)}function fg(e){const t=nt(e);return t.setDate(1),t.setHours(0,0,0,0),t}function pg(e){const t=nt(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}function Yte(e,t){const r=+nt(e),[n,i]=[+nt(t.start),+nt(t.end)].sort((o,s)=>o-s);return r>=n&&r<=i}const Zte={y:{sectionType:"year",contentType:"digit",maxLength:4},yy:"year",yyy:{sectionType:"year",contentType:"digit",maxLength:4},yyyy:"year",M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMMM:{sectionType:"month",contentType:"letter"},MMM:{sectionType:"month",contentType:"letter"},L:{sectionType:"month",contentType:"digit",maxLength:2},LL:"month",LLL:{sectionType:"month",contentType:"letter"},LLLL:{sectionType:"month",contentType:"letter"},d:{sectionType:"day",contentType:"digit",maxLength:2},dd:"day",do:{sectionType:"day",contentType:"digit-with-letter"},E:{sectionType:"weekDay",contentType:"letter"},EE:{sectionType:"weekDay",contentType:"letter"},EEE:{sectionType:"weekDay",contentType:"letter"},EEEE:{sectionType:"weekDay",contentType:"letter"},EEEEE:{sectionType:"weekDay",contentType:"letter"},i:{sectionType:"weekDay",contentType:"digit",maxLength:1},ii:"weekDay",iii:{sectionType:"weekDay",contentType:"letter"},iiii:{sectionType:"weekDay",contentType:"letter"},e:{sectionType:"weekDay",contentType:"digit",maxLength:1},ee:"weekDay",eee:{sectionType:"weekDay",contentType:"letter"},eeee:{sectionType:"weekDay",contentType:"letter"},eeeee:{sectionType:"weekDay",contentType:"letter"},eeeeee:{sectionType:"weekDay",contentType:"letter"}
133,c:{sectionType:"weekDay",contentType:"digit",maxLength:1},cc:"weekDay",ccc:{sectionType:"weekDay",contentType:"letter"},cccc:{sectionType:"weekDay",contentType:"letter"},ccccc:{sectionType:"weekDay",contentType:"letter"},cccccc:{sectionType:"weekDay",contentType:"letter"},a:"meridiem",aa:"meridiem",aaa:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},Xte={year:"yyyy",month:"LLLL",monthShort:"MMM",dayOfMonth:"d",dayOfMonthFull:"do",weekday:"EEEE",weekdayShort:"EEEEEE",hours24h:"HH",hours12h:"hh",meridiem:"aa",minutes:"mm",seconds:"ss",fullDate:"PP",keyboardDate:"P",shortDate:"MMM d",normalDate:"d MMMM",normalDateWithWeekday:"EEE, MMM d",fullTime:"p",fullTime12h:"hh:mm aa",fullTime24h:"HH:mm",keyboardDateTime:"P p",keyboardDateTime12h:"P hh:mm aa",keyboardDateTime24h:"P HH:mm"};class Jte{constructor(t){this.isMUIAdapter=!0,this.isTimezoneCompatible=!1,this.lib=void 0,this.locale=void 0,this.formats=void 0,this.formatTokenMap=Zte,this.escapedCharacters={start:"'",end:"'"},this.longFormatters=void 0,this.date=s=>typeof s>"u"?new Date:s===null?null:new Date(s),this.getInvalidDate=()=>new Date("Invalid Date"),this.getTimezone=()=>"default",this.setTimezone=s=>s,this.toJsDate=s=>s,this.getCurrentLocaleCode=()=>this.locale.code,this.is12HourCycleInCurrentLocale=()=>/a/.test(this.locale.formatLong.time({width:"short"})),this.expandFormat=s=>{const a=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;return s.match(a).map(l=>{const d=l[0];if(d==="p"||d==="P"){const u=this.longFormatters[d];return u(l,this.locale.formatLong)}return l}).join("")},this.formatNumber=s=>s,this.getDayOfWeek=s=>s.getDay()+1;const{locale:r,formats:n,longFormatters:i,lib:o}=t;this.locale=r,this.formats=kD({},Xte,n),this.longFormatters=i,this.lib=o||"date-fns"}}class Qte extends Jte{constructor({locale:t,formats:r}={}){super({locale:t??hg,formats:r,longFormatters:N1}),this.parse=(n,i)=>n===""?null:Ute(n,i,new Date,{locale:this.locale}),this.isValid=n=>n==null?!1:ZR(n),this.format=(n,i)=>this.formatByString(n,this.formats[i]),this.formatByString=(n,i)=>Di(n,i,{locale:this.locale}),this.isEqual=(n,i)=>n===null&&i===null?!0:n===null||i===null?!1:Bee(n,i),this.isSameYear=(n,i)=>Vee(n,i),this.isSameMonth=(n,i)=>Hee(n,i),this.isSameDay=(n,i)=>Kb(n,i),this.isSameHour=(n,i)=>zee(n,i),this.isAfter=(n,i)=>M2(n,i),this.isAfterYear=(n,i)=>M2(n,T8(i)),this.isAfterDay=(n,i)=>M2(n,Ka(i)),this.isBefore=(n,i)=>gu(n,i),this.isBeforeYear=(n,i)=>gu(n,this.startOfYear(i)),this.isBeforeDay=(n,i)=>gu(n,this.startOfDay(i)),this.isWithinRange=(n,[i,o])=>Yte(n,{start:i,end:o}),this.startOfYear=n=>zR(n),this.startOfMonth=n=>fg(n),this.startOfWeek=n=>vs(n,{locale:this.locale}),this.startOfDay=n=>Bn(n),this.endOfYear=n=>T8(n),this.endOfMonth=n=>pg(n),this.endOfWeek=n=>BR(n,{locale:this.locale}),this.endOfDay=n=>Ka(n),this.addYears=(n,i)=>UQ(n,i),this.addMonths=(n,i)=>Wb(n,i),this.addWeeks=(n,i)=>FQ(n,i),this.addDays=(n,i)=>wc(n,i),this.addHours=(n,i)=>NQ(n,i),this.addMinutes=(n,i)=>MQ(n,i),this.addSeconds=(n,i)=>LQ(n,i),this.getYear=n=>Uee(n),this.getMonth=n=>Mee(n),this.getDate=n=>Lee(n),this.getHours=n=>$ee(n),this.getMinutes=n=>
133Dee(n),this.getSeconds=n=>Nee(n),this.getMilliseconds=n=>Fee(n),this.setYear=(n,i)=>Kte(n,i),this.setMonth=(n,i)=>Wte(n,i),this.setDate=(n,i)=>Vte(n,i),this.setHours=(n,i)=>Hte(n,i),this.setMinutes=(n,i)=>zte(n,i),this.setSeconds=(n,i)=>qte(n,i),this.setMilliseconds=(n,i)=>Gte(n,i),this.getDaysInMonth=n=>XR(n),this.getWeekArray=n=>{const i=this.startOfWeek(this.startOfMonth(n)),o=this.endOfWeek(this.endOfMonth(n));let s=0,a=i;const l=[];for(;this.isBefore(a,o);){const d=Math.floor(s/7);l[d]=l[d]||[],l[d].push(a),a=this.addDays(a,1),s+=1}return l},this.getWeekNumber=n=>Gb(n,{locale:this.locale}),this.getYearRange=([n,i])=>{const o=this.startOfYear(n),s=this.endOfYear(i),a=[];let l=o;for(;this.isBefore(l,s);)a.push(l),l=this.addYears(l,1);return a}}}const ere={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"cerca de 1 hora",other:"cerca de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"cerca de 1 semana",other:"cerca de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"cerca de 1 mês",other:"cerca de {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"cerca de 1 ano",other:"cerca de {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},tre=(e,t,r)=>{let n;const i=ere[e];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",String(t)),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"em "+n:"há "+n:n},rre={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},nre={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},ire={full:"{{date}} 'à s' {{time}}",long:"{{date}} 'à s' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ore={date:mu({formats:rre,defaultWidth:"full"}),time:mu({formats:nre,defaultWidth:"full"}),dateTime:mu({formats:ire,defaultWidth:"full"})},sre={lastWeek:e=>{const t=e.getDay();return"'"+(t===0||t===6?"último":"última")+"' eeee 'à s' p"},yesterday:"'ontem à s' p",today:"'hoje à s' p",tomorrow:"'amanhã à s' p",nextWeek:"eeee 'à s' p",other:"P"},are=(e,t,r,n)=>{const i=sre[e];return typeof i=="function"?i(t):i},lre={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},cre={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},ure={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},dre={narrow:["D","S","T","Q","Q","S","S"],short:["dom","seg","ter","qua","qui","sex","sab"],abbreviated:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},hre={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"}},fre={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"}},pre=(e,t)=>
133{const r=Number(e);return(t==null?void 0:t.unit)==="week"?r+"ª":r+"º"},mre={ordinalNumber:pre,era:Xo({values:lre,defaultWidth:"wide"}),quarter:Xo({values:cre,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Xo({values:ure,defaultWidth:"wide"}),day:Xo({values:dre,defaultWidth:"wide"}),dayPeriod:Xo({values:hre,defaultWidth:"wide",formattingValues:fre,defaultFormattingWidth:"wide"})},gre=/^(\d+)[ºªo]?/i,vre=/\d+/i,yre={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},_re={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},bre={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},xre={any:[/1/i,/2/i,/3/i,/4/i]},wre={narrow:/^[jfmajsond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},Ere={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^fev/i,/^mar/i,/^abr/i,/^mai/i,/^jun/i,/^jul/i,/^ago/i,/^set/i,/^out/i,/^nov/i,/^dez/i]},Sre={narrow:/^(dom|[23456]ª?|s[aá]b)/i,short:/^(dom|[23456]ª?|s[aá]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,wide:/^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i},Cre={short:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],narrow:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[aá]b/i]},Tre={narrow:/^(a|p|mn|md|(da) (manhã|tarde|noite))/i,any:/^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(d
133a) (manhã|tarde|noite))/i},Are={any:{am:/^a/i,pm:/^p/i,midnight:/^mn|^meia[-\s]noite/i,noon:/^md|^meio[-\s]dia/i,morning:/manhã/i,afternoon:/tarde/i,evening:/tarde/i,night:/noite/i}},kre={ordinalNumber:VR({matchPattern:gre,parsePattern:vre,valueCallback:e=>parseInt(e,10)}),era:Jo({matchPatterns:yre,defaultMatchWidth:"wide",parsePatterns:_re,defaultParseWidth:"any"}),quarter:Jo({matchPatterns:bre,defaultMatchWidth:"wide",parsePatterns:xre,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Jo({matchPatterns:wre,defaultMatchWidth:"wide",parsePatterns:Ere,defaultParseWidth:"any"}),day:Jo({matchPatterns:Sre,defaultMatchWidth:"wide",parsePatterns:Cre,defaultParseWidth:"any"}),dayPeriod:Jo({matchPatterns:Tre,defaultMatchWidth:"any",parsePatterns:Are,defaultParseWidth:"any"})},Uu={code:"pt-BR",formatDistance:tre,formatLong:ore,formatRelative:are,localize:mre,match:kre,options:{weekStartsOn:0,firstWeekContainsDate:1}},rI={bold:"Negrito",italic:"Itálico",underline:"Sublinhado",strikethrough:"Riscado",code:"Código",codeBlock:"Bloco de código",bulletList:"Lista com marcadores",orderedList:"Lista numerada",taskList:"Lista de tarefas",indent:"Aumentar recuo",outdent:"Diminuir recuo",link:"Link",unlink:"Remover link",image:"Imagem",insertTable:"Tabela",quote:"Citação",horizontalRule:"Linha horizontal",undo:"Desfazer",redo:"Refazer",clearFormatting:"Limpar formatação",heading:"TÃtulo",heading1:"TÃtulo 1",heading2:"TÃtulo 2",heading3:"TÃtulo 3",heading4:"TÃtulo 4",heading5:"TÃtulo 5",heading6:"TÃtulo 6",paragraph:"Parágrafo",alignLeft:"Alinhar à esquerda",alignCenter:"Centralizar",alignRight:"Alinhar à direita",alignJustify:"Justificar",fontSize:"Tamanho da fonte",fontFamily:"FamÃlia da fonte",textColor:"Cor do texto",backgroundColor:"Cor de fundo",highlight:"Destacar",linkDialog:{title:"Inserir link",url:"URL",text:"Texto do link",openInNewTab:"Abrir em nova aba",save:"Salvar",cancel:"Cancelar",remove:"Remover link",edit:"Editar link"},imageDialog:{title:"Inserir imagem",url:"URL da imagem",alt:"Texto alternativo",width:"Largura",height:"Altura",save:"Salvar",cancel:"Cancelar",upload:"Fazer upload",selectFile:"Selecionar arquivo"},table:{insertTable:"Inserir tabela",deleteTable:"Excluir tabela",addRowBefore:"Adicionar linha acima",addRowAfter:"Adicionar linha abaixo",deleteRow:"Excluir linha",addColumnBefore:"Adicionar coluna à esquerda",addColumnAfter:"Adicionar coluna à direita",deleteColumn:"Excluir coluna",mergeCells:"Mesclar células",splitCell:"Dividir célula",toggleHeaderRow:"Alternar linha de cabeçalho",toggleHeaderColumn:"Alternar coluna de cabeçalho"},actions:{save:"Salvar",cancel:"Cancelar",delete:"Excluir",edit:"Editar",add:"Adicionar",remove:"Remover",close:"Fechar",apply:"Aplicar",reset:"Redefinir"},errors:{invalidUrl:"URL inválida",uploadFailed:"Falha no upload da imagem",unsupportedFormat:"Formato não suportado",fileTooLarge:"Arquivo muito grande"},placeholders:{enterText:"Digite seu texto aqui...",searchEmojis:"Buscar emojis...",enterUrl:"Digite a URL...",enterAltText:"Digite o texto alternativo..."},accessibility:{toolbar:"Barra de ferramentas do editor",editor:"Editor de texto rico",menuButton:"Botão do menu",dialog:"Caixa de diálogo",closeDialog:"Fechar caixa de diálogo"}},nI=v.createContext(null),Rre=({children:e,locale:t=rI})=>{const r=v.useCallback((i,o)=>{const s=i.split(".");let a=t;for(const l of s)if(a&&typeof a=="object"&&l in a)a=a[l];else return o||i;return typeof a=="string"?a:o||i},[t]),n=v.useMemo(()=>({locale:t,t:r}),[t,r]);return c.jsx(nI.Provider,{value:n,children:e})},O7e=()=>{const e=v.useContext(nI);if(!e)throw new Error("useMuiTiptapLocale must be used within a MuiTiptapLocaleProvider");return e};var iI={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},by=Ee.createContext&&Ee.createContext(iI),Ire=["attr","size","title"];function Pre(e,t){if(e==null)return{};var r=Ore(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ore(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function U1(){return U1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
133for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},U1.apply(this,arguments)}function O8(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function B1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?O8(Object(r),!0).forEach(function(n){jre(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O8(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function jre(e,t,r){return t=Lre(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lre(e){var t=$re(e,"string");return typeof t=="symbol"?t:t+""}function $re(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function oI(e){return e&&e.map((t,r)=>Ee.createElement(t.tag,B1({key:r},t.attr),oI(t.child)))}function ee(e){return t=>Ee.createElement(Dre,U1({attr:B1({},e.attr)},t),oI(e.child))}function Dre(e){var t=r=>{var{attr:n,size:i,title:o}=e,s=Pre(e,Ire),a=i||r.size||"1em",l;return r.className&&(l=r.className),e.className&&(l=(l?l+" ":"")+e.className),Ee.createElement("svg",U1({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,s,{className:l,style:B1(B1({color:e.color||r.color},r.style),e.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),o&&Ee.createElement("title",null,o),e.children)};return by!==void 0?Ee.createElement(by.Consumer,null,r=>t(r)):t(iI)}const Mre={className:"MuiSvgIcon-root MuiSvgIcon-fontSizeMedium",style:{fontSize:"24px",display:"inline-block",flexShrink:0,userSelect:"none",color:"inherit"},attr:{focusable:"false","aria-hidden":"true"}},Nre=({children:e})=>c.jsx(by.Provider,{value:Mre,children:e}),Fre=({children:e})=>c.jsx(KD,{dateAdapter:Qte,adapterLocale:Uu,children:c.jsx(RD,{theme:jQ,children:c.jsx(Nre,{children:c.jsx(Rre,{locale:rI,children:e})})})});function Ure(){return c.jsxs(c.Fragment,{children:[c.jsx(rd,{}),c.jsx(sq,{getKey:e=>["/orders","/chats","/products","/general"].includes(e.pathname)?e.pathname:e.key})]})}function O0(e,t){const r=nt(e),n=nt(t),i=r.getTime()-n.getTime();return i<0?-1:i>0?1:i}function Xb(e){return pr(e,Date.now())}function Bre(e,t){const r=nt(e),n=nt(t),i=r.getFullYear()-n.getFullYear(),o=r.getMonth()-n.getMonth();return i*12+o}function Jb(e,t){const r=nt(e),n=nt(t),i=j8(r,n),o=Math.abs(HR(r,n));r.setDate(r.getDate()-i*o);const s=+(j8(r,n)===-i),a=i*(o-s);return a===0?0:a}function j8(e,t){const r=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return r<0?-1:r>0?1:r}function Vre(e){return t=>{const n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function Hre(e,t){return+nt(e)-+nt(t)}function zre(e){const t=nt(e);return+Ka(t)==+pg(t)}function Wre(e,t){const r=nt(e),n=nt(t),i=O0(r,n),o=Math.abs(Bre(r,n));let s;if(o<1)s=0;else{r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-i*o);let a=O0(r,n)===-i;zre(nt(e))&&o===1&&O0(e,n)===1&&(a=!1),s=i*(o-Number(a))}return s===0?0:s}function qre(e,t,r){const n=Hre(e,t)/1e3;return Vre(r==null?void 0:r.roundingMethod)(n)}function Gre(e,t,r){const n=la(),i=(r==null?void 0:r.locale)??n.locale??hg,o=2520,s=O0(e,t);if(isNaN(s))throw new RangeError("Invalid time value");const a=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:s});let l,d;s>0?(l=nt(t),d=nt(e)):(l=nt(e),d=nt(t));const u=qre(d,l),h=(Nu(d)-Nu(l))/1e3,f=Math.round((u-h)/60);let p;if(f<2)return r!=null&&r.includeSeconds?u<5?i.formatDistance("lessThanXSeconds",5,a):u<10?i.formatDistance("lessThanXSeconds",10,a):u<20?i.formatDistance("lessThanXSeconds",20,a):u<40?i.formatDistance("halfAMinute",0,a):u<60?
133i.formatDistance("lessThanXMinutes",1,a):i.formatDistance("xMinutes",1,a):f===0?i.formatDistance("lessThanXMinutes",1,a):i.formatDistance("xMinutes",f,a);if(f<45)return i.formatDistance("xMinutes",f,a);if(f<90)return i.formatDistance("aboutXHours",1,a);if(f<C8){const m=Math.round(f/60);return i.formatDistance("aboutXHours",m,a)}else{if(f<o)return i.formatDistance("xDays",1,a);if(f<Fp){const m=Math.round(f/C8);return i.formatDistance("xDays",m,a)}else if(f<Fp*2)return p=Math.round(f/Fp),i.formatDistance("aboutXMonths",p,a)}if(p=Wre(d,l),p<12){const m=Math.round(f/Fp);return i.formatDistance("xMonths",m,a)}else{const m=p%12,g=Math.trunc(p/12);return m<3?i.formatDistance("aboutXYears",g,a):m<9?i.formatDistance("overXYears",g,a):i.formatDistance("almostXYears",g+1,a)}}function Kre(e,t){return Gre(e,Xb(e),t)}function mg(e){return Kb(e,Xb(e))}function V1(e,t){return wc(e,-t)}function sI(e){return Kb(e,V1(Xb(e),1))}function _o(e,t){const r=(t==null?void 0:t.additionalDigits)??2,n=Jre(e);let i;if(n.date){const l=Qre(n.date,r);i=ene(l.restDateString,l.year)}if(!i||isNaN(i.getTime()))return new Date(NaN);const o=i.getTime();let s=0,a;if(n.time&&(s=tne(n.time),isNaN(s)))return new Date(NaN);if(n.timezone){if(a=rne(n.timezone),isNaN(a))return new Date(NaN)}else{const l=new Date(o+s),d=new Date(0);return d.setFullYear(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()),d.setHours(l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds()),d}return new Date(o+s+a)}const Up={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Yre=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Zre=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Xre=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Jre(e){const t={},r=e.split(Up.dateTimeDelimiter);let n;if(r.length>2)return t;if(/:/.test(r[0])?n=r[0]:(t.date=r[0],n=r[1],Up.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Up.timeZoneDelimiter)[0],n=e.substr(t.date.length,e.length))),n){const i=Up.timezone.exec(n);i?(t.time=n.replace(i[1],""),t.timezone=i[1]):t.time=n}return t}function Qre(e,t){const r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(r);if(!n)return{year:NaN,restDateString:""};const i=n[1]?parseInt(n[1]):null,o=n[2]?parseInt(n[2]):null;return{year:o===null?i:o*100,restDateString:e.slice((n[1]||n[2]).length)}}function ene(e,t){if(t===null)return new Date(NaN);const r=e.match(Yre);if(!r)return new Date(NaN);const n=!!r[4],i=jd(r[1]),o=jd(r[2])-1,s=jd(r[3]),a=jd(r[4]),l=jd(r[5])-1;if(n)return ane(t,a,l)?nne(t,a,l):new Date(NaN);{const d=new Date(0);return!one(t,o,s)||!sne(t,i)?new Date(NaN):(d.setUTCFullYear(t,o,Math.max(i,s)),d)}}function jd(e){return e?parseInt(e):1}function tne(e){const t=e.match(Zre);if(!t)return NaN;const r=N2(t[1]),n=N2(t[2]),i=N2(t[3]);return lne(r,n,i)?r*dg+n*ug+i*1e3:NaN}function N2(e){return e&&parseFloat(e.replace(",","."))||0}function rne(e){if(e==="Z")return 0;const t=e.match(Xre);if(!t)return 0;const r=t[1]==="+"?-1:1,n=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return cne(n,i)?r*(n*dg+i*ug):NaN}function nne(e,t,r){const n=new Date(0);n.setUTCFullYear(e,0,4);const i=n.getUTCDay()||7,o=(t-1)*7+r+1-i;return n.setUTCDate(n.getUTCDate()+o),n}const ine=[31,null,31,30,31,30,31,31,30,31,30,31];function aI(e){return e%400===0||e%4===0&&e%100!==0}function one(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(ine[t]||(aI(e)?29:28))}function sne(e,t){return t>=1&&t<=(aI(e)?366:365)}function ane(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}function lne(e,t,r){return e===24?t===0&&r===0:r>=0&&r<60&&t>=0&&t<60&&e>=0&&e<25}function cne(e,t){return t>=0&&t<=59}function une(e){const t={},r=la();for(const n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n]);for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]===void 0?delete t[n]:t[n]=e[n]);BQ(t)}const dne=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","fbclid","ttclid","referrerUrl","src","page","ref"],lI="acquisition_first_touch",hne=200,cI=()=>{try{const e=localStorage.getItem(lI);return e?JSON.parse(e):null}catch{return null}},uI=(e,t)=>
133{const r=new URLSearchParams(e),n={};for(const s of dne){const a=r.get(s);a&&(n[s]=a.slice(0,hne))}if(Object.keys(n).length===0)return null;const i=cI();if(i)return i;const o={...n,captured_at:new Date().toISOString(),captured_via:t,platform:qe.getPlatform()};try{localStorage.setItem(lI,JSON.stringify(o))}catch{}return o},dI=e=>!(/[:&=]/.test(e)||e.length>12||/[a-z]/.test(e)),fne=()=>{const e=sn();v.useEffect(()=>{if(qe.isNativePlatform())return;const t=new URLSearchParams(e.search),r=t.get("affiliate")||t.get("ref");r&&dI(r)&&(localStorage.setItem("affiliate_code",r.toUpperCase()),console.log("Affiliate code stored:",r.toUpperCase()))},[e.search])},pne=e=>{if(e.protocol==="stoqui:"){const t=e.searchParams.get("page");return t&&t.startsWith("/")?t:e.host==="open"||!e.host?"/":`/${e.host}${e.pathname}`}return e.pathname+e.search},mne=()=>{const e=At();return v.useEffect(()=>{qe.isNativePlatform()&&(console.log("Adding LISTENER"),sc.addListener("appUrlOpen",async t=>{var o,s;const r=new URL(t.url),n=pne(r);uI(r.search,"deeplink");const i=r.searchParams.get("ref")||r.searchParams.get("affiliate");if(i&&dI(i)&&localStorage.setItem("affiliate_code",i.toUpperCase()),pe(fe.APP.DEEP_LINK_OPEN,{url:t.url,slug:n||""}),console.log("Deep link opened:",t.url),t.url.includes("#access_token=")){console.log("Magic link detected, authenticating...");const a=(o=t.url.split("#access_token=").pop())==null?void 0:o.split("&")[0],l=(s=t.url.split("&refresh_token=").pop())==null?void 0:s.split("&")[0];if(a&&l){pe(fe.AUTH.MAGIC_LINK_LOGIN_START,{email:"unknown"});try{const{data:d,error:u}=await Te.auth.setSession({access_token:a,refresh_token:l});u?(console.error("Magic link auth error:",u),pe(fe.AUTH.MAGIC_LINK_LOGIN_ERROR,{error:u.message,errorCode:u.code})):d.session&&(console.log("Magic link auth success"),pe(fe.AUTH.MAGIC_LINK_LOGIN_SUCCESS,{email:d.session.user.email}))}catch(d){console.error("Unexpected magic link error:",d),pe(fe.AUTH.MAGIC_LINK_LOGIN_ERROR,{error:"Unexpected error"})}}}n&&e(n)}))},[]),null};var L8;(function(e){e[e.SCAN_MODE_LOW_POWER=0]="SCAN_MODE_LOW_POWER",e[e.SCAN_MODE_BALANCED=1]="SCAN_MODE_BALANCED",e[e.SCAN_MODE_LOW_LATENCY=2]="SCAN_MODE_LOW_LATENCY"})(L8||(L8={}));var $8;(function(e){e[e.CONNECTION_PRIORITY_BALANCED=0]="CONNECTION_PRIORITY_BALANCED",e[e.CONNECTION_PRIORITY_HIGH=1]="CONNECTION_PRIORITY_HIGH",e[e.CONNECTION_PRIORITY_LOW_POWER=2]="CONNECTION_PRIORITY_LOW_POWER"})($8||($8={}));function yh(e){return new DataView(Uint8Array.from(e).buffer)}function gne(e){return Array.from(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function vne(e){return`0000${e.toString(16).padStart(4,"0")}-0000-1000-8000-00805f9b34fb`}function yne(e){const t=[];let r,n,i=1,o=0;for(r=0;r<e.length;r++)n=e.charCodeAt(r),(n>47&&n<58||n>64&&n<71||n>96&&n<103)&&(o=o<<4^(n>64?n+9:n)&15,(i^=1)&&t.push(o&255));return yh(t)}function F2(e){return gne(e).map(t=>{let r=t.toString(16);return r.length==1&&(r="0"+r),r}).join("")}function j7e(e){if(typeof e=="string")return e;if(typeof e=="number")return vne(e);throw new Error("Invalid UUID")}function L7e(e){const t={};if(e)return e.forEach((r,n)=>{t[n.toString()]=r}),t}const Dt=Kr("BluetoothLe",{web:()=>X(()=>import("./web-CQOiuKgg.js"),__vite__mapDeps([12,1,2,3,4,5,6])).then(e=>new e.BluetoothLeWeb)}),_ne=()=>{let e=Promise.resolve();return t=>new Promise((r,n)=>{e=e.then(()=>t()).then(r).catch(n)})};function U2(e){return e?_ne():t=>t()}function cn(e){if(typeof e!="string")throw new Error(`Invalid UUID type ${typeof e}. Expected string.`);if(e=e.toLowerCase(),!(e.search(/^[0-9a-f]{8}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{12}$/)>=0))throw new Error(`Invalid UUID format ${e}. Expected 128 bit string (e.g. "0000180d-0000-1000-8000-00805f9b34fb").`);return e}class bne{constructor(){this.scanListener=null,this.eventListeners=new Map,this.queue=U2(!0)}enableQueue(){this.queue=U2(!0)}disableQueue(){this.queue=U2(!1)}async initialize(t){await this.queue(async()=>{await Dt.initialize(t)})}async isEnabled(){return await this.queue(async()=>(await Dt.isEnabled()).value)}async requestEnable(){await this.queue(async()=>{await Dt.requestEnable()})}async enable(){await this.queue(async()=>{await Dt.enable()})}async disable(){await this.queue(async()=>{await Dt.disable()})}async startEnabledNotifications(t){await this.queue(async()=>{var r;const n="onEnabledChanged";await((r=this.eventListeners.get(n))===null||r===void 0?void 0:r.remove());const i=await Dt.addListener(n,o=>{t(o.value)});this.eventListeners.set(n,i),await Dt.startEnabledNotifications()})}async stopEnabledNotifications(){await this.queue(async()=>{var t;const r="onEnabledChanged";await((t=this.eventListeners.get(r))===null||t===void 0?void 0:t.remove()),this.eventListeners.delete(r),await Dt.stopEnabledNotifications()})}async isLocationEnabled(){return await this.queue(async()=>(await Dt.isLocationEnabled()).value)}async openLocationSettings(){await this.queue(async()=>{await Dt.openLocationSettings()})}async openBluetoothSettings(){await this.queue(async()=>{await Dt.openBluetoothSettings()})}async openAppSettings(){await this.queue(async()=>{await Dt.openAppSettings()})}async setDisplayStrings(t){await this.queue(async()=>{await Dt.setDisplayStrings(t)})}async requestDevice(t){return t=t?this.validateRequestBleDeviceOptions(t):void 0,await this.queue(async()=>await Dt.requestDevice(t))}async requestLEScan(t,r){t=this.validateRequestBleDeviceOptions(t),await this.queue(async()=>{var n;await((n=this.scanListener)===null||n===void 0?void 0:n.remove()),this.scanListener=await Dt.addListener("onScanResult",i=>{const o=Object.assign(Object.assign({},i),{manufacturerData:this.convertObject(i.manufacturerData),serviceData:this.convertObject(i.serviceData),rawAdvertisement:i.rawAdvertisement?this.convertValue(i.rawAdvertisement):void 0});r(o)}),await Dt.requestLEScan(t)})}async stopLEScan(){await this.queue(async()=>{var t;await((t=this.scanListener)===null||t===void 0?void 0:t.remove()),this.scanListener=null,await Dt.stopLEScan()})}async getDevices(t){if(!Array.isArray(t))throw new Error("deviceIds must be an array");return this.queue(async()=>(await Dt.getDevices({deviceIds:t})).devices)}async getConnectedDevices(t){if(!Array.isArray(t))throw new Error("services must be an array");return t=t.map(cn),this.queue(async()=>(await Dt.getConnectedDevices({services:t})).devices)}async getBondedDevices(){return this.queue(async()=>(await Dt.getBondedDevices()).devices)}async connect(t,r,n){await this.queue(async()=>{var i;if(r){const o=`disconnected|${t}`;await((i=this.eventListeners.get(o))===null||i===void 0?void 0:i.remove());const s=await Dt.addListener(o,()=>{r(t)});this.eventListeners.set(o,s)}await Dt.connect(Object.assign({deviceId:t},n))})}async createBond(t,r){await this.queue(async()=>{await Dt.createBond(Object.assign({deviceId:t},r))})}async isBonded(t){return await this.queue(async()=>(await Dt.isBonded({deviceId:t})).value)}async disconnect(t){await this.queue(async()=>{await Dt.disconnect({deviceId:t})})}async getServices(t){return await this.queue(async()=>(await Dt.getServices({deviceId:t})).services)}async discoverServices(t){await this.queue(async()=>{await Dt.discoverServices({deviceId:t})})}async getMtu(t){return await this.queue(async()=>(await Dt.getMtu({deviceId:t})).value)}async requestConnectionPriority(t,r){await this.queue(async()=>{await Dt.requestConnectionPriority({deviceId:t,connectionPriority:r})})}async readRssi(t){return await this.queue(async()=>{const n=await Dt.readRssi({deviceId:t});return parseFloat(n.value)})}async read(t,r,n,i){return r=cn(r),n=cn(n),await this.queue(async()=>{const s=await Dt.read(Object.assign({deviceId:t,service:r,characteristic:n},i));return this.convertValue(s.value)})}async write(t,r,n,i,o){return r=cn(r),n=cn(n),this.queue(async()=>
133{if(!(i!=null&&i.buffer))throw new Error("Invalid data.");let s=i;qe.getPlatform()!=="web"&&(s=F2(i)),await Dt.write(Object.assign({deviceId:t,service:r,characteristic:n,value:s},o))})}async writeWithoutResponse(t,r,n,i,o){r=cn(r),n=cn(n),await this.queue(async()=>{if(!(i!=null&&i.buffer))throw new Error("Invalid data.");let s=i;qe.getPlatform()!=="web"&&(s=F2(i)),await Dt.writeWithoutResponse(Object.assign({deviceId:t,service:r,characteristic:n,value:s},o))})}async readDescriptor(t,r,n,i,o){return r=cn(r),n=cn(n),i=cn(i),await this.queue(async()=>{const a=await Dt.readDescriptor(Object.assign({deviceId:t,service:r,characteristic:n,descriptor:i},o));return this.convertValue(a.value)})}async writeDescriptor(t,r,n,i,o,s){return r=cn(r),n=cn(n),i=cn(i),this.queue(async()=>{if(!(o!=null&&o.buffer))throw new Error("Invalid data.");let a=o;qe.getPlatform()!=="web"&&(a=F2(o)),await Dt.writeDescriptor(Object.assign({deviceId:t,service:r,characteristic:n,descriptor:i,value:a},s))})}async startNotifications(t,r,n,i){r=cn(r),n=cn(n),await this.queue(async()=>{var o;const s=`notification|${t}|${r}|${n}`;await((o=this.eventListeners.get(s))===null||o===void 0?void 0:o.remove());const a=await Dt.addListener(s,l=>{i(this.convertValue(l==null?void 0:l.value))});this.eventListeners.set(s,a),await Dt.startNotifications({deviceId:t,service:r,characteristic:n})})}async stopNotifications(t,r,n){r=cn(r),n=cn(n),await this.queue(async()=>{var i;const o=`notification|${t}|${r}|${n}`;await((i=this.eventListeners.get(o))===null||i===void 0?void 0:i.remove()),this.eventListeners.delete(o),await Dt.stopNotifications({deviceId:t,service:r,characteristic:n})})}validateRequestBleDeviceOptions(t){return t.services&&(t.services=t.services.map(cn)),t.optionalServices&&(t.optionalServices=t.optionalServices.map(cn)),t}convertValue(t){return typeof t=="string"?yne(t):t===void 0?new DataView(new ArrayBuffer(0)):t}convertObject(t){if(t===void 0)return;const r={};for(const n of Object.keys(t))r[n]=this.convertValue(t[n]);return r}}const Jr=new bne;function gg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bp=gg(new class{grayscale(e){for(let t=0;t<e.data.length;t+=4){const r=.299*e.data[t]+.587*e.data[t+1]+.114*e.data[t+2];e.data.fill(r,t,t+3)}return e}threshold(e,t){for(let r=0;r<e.data.length;r+=4){const n=.299*e.data[r]+.587*e.data[r+1]+.114*e.data[r+2]<t?0:255;e.data.fill(n,r,r+3)}return e}bayer(e,t){const r=[[15,135,45,165],[195,75,225,105],[60,180,30,150],[240,120,210,90]];for(let n=0;n<e.data.length;n+=4){const i=.299*e.data[n]+.587*e.data[n+1]+.114*e.data[n+2],o=n/4%e.width,s=Math.floor(n/4/e.width),a=Math.floor((i+r[o%4][s%4])/2)<t?0:255;e.data.fill(a,n,n+3)}return e}floydsteinberg(e){const t=e.width,r=new Uint8ClampedArray(e.width*e.height);for(let n=0,i=0;i<e.data.length;n++,i+=4)r[n]=.299*e.data[i]+.587*e.data[i+1]+.114*e.data[i+2];for(let n=0,i=0;i<e.data.length;n++,i+=4){const o=r[n]<129?0:255,s=Math.floor((r[n]-o)/16);e.data.fill(o,i,i+3),r[n+1]+=7*s,r[n+t-1]+=3*s,r[n+t]+=5*s,r[n+t+1]+=1*s}return e}atkinson(e){const t=e.width,r=new Uint8ClampedArray(e.width*e.height);for(let n=0,i=0;i<e.data.length;n++,i+=4)r[n]=.299*e.data[i]+.587*e.data[i+1]+.114*e.data[i+2];for(let n=0,i=0;i<e.data.length;n++,i+=4){const o=r[n]<129?0:255,s=Math.floor((r[n]-o)/8);e.data.fill(o,i,i+3),r[n+1]+=s,r[n+2]+=s,r[n+t-1]+=s,r[n+t]+=s,r[n+t+1]+=s,r[n+2*t]+=s}return e}}),xne=gg(new class{flatten(e,t){for(let r=0;r<e.data.length;r+=4){const n=e.data[r+3],i=255-n;e.data[r]=(n*e.data[r]+i*t[0])/255,e.data[r+1]=(n*e.data[r+1]+i*t[1])/255,e.data[r+2]=(n*e.data[r+2]+i*t[2])/255,e.data[r+3]=255}return e}});const un={ascii:{name:"ASCII",languages:["en"],value:new Array(256).fill(1,0,128).map((e,t)=>t)},cp437:{name:"USA, Standard Europe",languages:["en"],extends:"ascii",value:[[,9786,9787,9829,9830,9827,9824,8226,9688,9675,9689,9794,9792,9834,9835,9788],[9658,9668,8597,8252,182,167,9644,8616,8593,8595,8594,8592,8735,8596,9650,9660],,,,,,[,,,,,,,,,,,,,,,8962],[199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197],[201,230,198,244,246,242,251,249,25
1335,214,220,162,163,165,8359,402],[225,237,243,250,241,209,170,186,191,8976,172,189,188,161,171,187],[9617,9618,9619,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488],[9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575],[9576,9572,9573,9561,9560,9554,9555,9579,9578,9496,9484,9608,9604,9612,9616,9600],[945,223,915,960,931,963,181,964,934,920,937,948,8734,966,949,8745],[8801,177,8805,8804,8992,8993,247,8776,176,8729,183,8730,8319,178,9632,160]]},cp720:{name:"Arabic",languages:["ar"],extends:"cp437",value:[,,,,,,,,[65533,65533,,,65533,,65533,,,,,,,65533,65533,65533],[65533,1617,1618,,164,1600,,,1569,1570,1571,1572,,1573,1574,1575],[1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,,,],,,,[1590,1591,1592,1593,1594,1601,,1602,1603,1604,1605,1606,1607,1608,1609,1610],[,1611,1612,1613,1614,1615,1616,,,,,,,,,,]]},cp737:{name:"Greek",languages:["el"],extends:"cp437",value:[,,,,,,,,[913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928],[929,931,932,933,934,935,936,937,945,946,947,948,949,950,951,952],[953,954,955,956,957,958,959,960,961,963,962,964,965,966,967,968],,,,[969,940,941,942,970,943,972,973,971,974,902,904,905,906,908,910],[911,,,,938,939,,,,,,,,,,,]]},cp771:{name:"Lithuanian KBL",languages:["lt"],extends:"cp866",value:[,,,,,,,,,,,,,[,,,,,,,,,,,,260,261,268,269],,[280,281,278,279,302,303,352,353,370,371,362,363,381,382,,,]]},cp772:{name:"Lithuanian LST 1284",languages:["lt"],extends:"cp866",value:[,,,,,,,,,,,[,,,,,260,268,280,278,,,,,302,352,,],[,,,,,,370,362,,,,,,,,381],[261,269,281,279,303,353,371,363,382,,,,,,,,],,[,,8805,8804,8222,8220,247,8776,,,,,8319,178,,,]]},cp774:{name:"Lithuanian LST 1283",languages:["lt"],extends:"cp437",value:[,,,,,,,,,,,[,,,,,260,268,280,278,,,,,302,352,,],[,,,,,,370,362,,,,,,,,381],[261,269,281,279,303,353,371,363,382,,,,,,,,],[,946,,,,,,,,,,,,,,8898],[,,,,8222,8220,,,,,729,,,,,,]]},cp775:{name:"Baltic Rim",languages:["et","lt"],extends:"cp437",value:[,,,,,,,,[262,,,257,,291,,263,322,275,342,343,299,377,,,],[,,,333,,290,162,346,347,,,248,,216,215,164],[256,298,,379,380,378,8221,166,169,174,,,,321,,,],[,,,,,260,268,280,278,,,,,302,352,,],[,,,,,,370,362,,,,,,,,381],[261,269,281,279,303,353,371,363,382,,,,,,,,],[211,,332,323,245,213,,324,310,311,315,316,326,274,325,8217],[173,,8220,190,182,167,,8222,,,,185,179,,,,]]},cp850:{name:"Multilingual",languages:["en"],extends:"cp437",value:[,,,,,,,,,[,,,,,,,,,,,248,,216,215,,],[,,,,,,,,,174,,,,,,,],[,,,,,193,194,192,169,,,,,162,165,,],[,,,,,,227,195,,,,,,,,164],[240,208,202,203,200,305,205,206,207,,,,,166,204,,],[211,,212,210,245,213,,254,222,218,219,217,253,221,175,180],[173,,8215,190,182,167,,184,,168,,185,179,,,,]]},cp851:{name:"Greek",languages:["el"],extends:"cp437",value:[,,,,,,,,[,,,,,,902,,,,,,,904,,905],[906,65533,908,,,910,,,911,,,940,,941,942,943],[970,912,972,973,913,914,915,916,917,918,919,,920,921,,,],[,,,,,922,923,924,925,,,,,926,927,,],[,,,,,,928,929,,,,,,,,931],[932,933,934,935,936,937,945,946,947,,,,,948,949,,],[950,951,952,953,954,955,956,957,958,959,960,961,963,962,964,180],[173,,965,966,967,167,968,184,,168,969,971,944,974,,,]]},cp852:{name:"Latin 2",languages:["hu","pl","cz"],extends:"cp850",value:[,,,,,,,,[,,,,,367,263,,322,,336,337,,377,,262],[,313,314,,,317,318,346,347,,,356,357,321,,269],[,,,,260,261,381,382,280,281,,378,268,351,,,],[,,,,,,,282,350,,,,,379,380,,],[,,,,,,258,259,,,,,,,,,],[273,272,270,,271,327,,,283,,,,,354,366,,],[,,,323,324,328,352,353,340,,341,368,,,355,,],[,733,731,711,728,,,,,,729,369,344,345,,,]]},cp853:{name:"Turkish",languages:["tr"],extends:"cp437",value:[,,,,,,,,[,,,,,,265,,,,,,,,,264],[,267,266,,,,,,304,,,285,,284,215,309],[,,,,,,286,287,292,293,65533,,308,351,,,],[,,,,,193,194,192,350,,,,,379,380,,],[,,,,,,348,349,,,,,,,,164],[65533,65533,202,203,200,305,205,206,207,,,,,65533,204,,],[211,,212,210,288,289,,294,295,218,219,217,364,365,65533,180],[173,65533,8467,329,728,167,,184,,168,729,65533,179,,,,]]},cp855:{name:"Cyrillic",languages:["bg"],extends:"cp437",value:[,,,,,,,,[1106,1026,1107,1027,1105,1025,1108,1028,1109,1029,1110,1030,1111,1031,1112,1032],[1113,1033,1114,1034,1115,1035,
1331116,1036,1118,1038,1119,1039,1102,1070,1098,1066],[1072,1040,1073,1041,1094,1062,1076,1044,1077,1045,1092,1060,1075,1043,,,],[,,,,,1093,1061,1080,1048,,,,,1081,1049,,],[,,,,,,1082,1050,,,,,,,,164],[1083,1051,1084,1052,1085,1053,1086,1054,1087,,,,,1055,1103,,],[1071,1088,1056,1089,1057,1090,1058,1091,1059,1078,1046,1074,1042,1100,1068,8470],[173,1099,1067,1079,1047,1096,1064,1101,1069,1097,1065,1095,1063,167,,,]]},cp857:{name:"Turkish",languages:["tr"],extends:"cp437",value:[,,,,,,,,[,,,,,,,,,,,,,305,,,],[,,,,,,,,304,,,248,,216,350,351],[,,,,,,286,287,,174,,,,,,,],[,,,,,193,194,192,169,,,,,162,165,,],[,,,,,,227,195,,,,,,,,164],[186,170,202,203,200,8364,205,206,207,,,,,166,204,,],[211,,212,210,245,213,,65533,215,218,219,217,236,255,175,180],[173,,65533,190,182,167,,184,,168,,185,179,,,,]]},cp858:{name:"Euro",languages:["en"],extends:"cp850",value:[,,,,,,,,,,,,,[,,,,,8364,,,,,,,,,,,],,,]},cp860:{name:"Portuguese",languages:["pt"],extends:"cp437",value:[,,,,,,,,[,,,,227,,193,,,202,,205,212,,195,194],[,192,200,,245,,218,,204,213,,,,217,,211],[,,,,,,,,,210,,,,,,,],,,,,,]},cp861:{name:"Icelandic",languages:["is"],extends:"cp437",value:[,,,,,,,,[,,,,,,,,,,,208,240,222,,,],[,,,,,254,,221,253,,,248,,216,,,],[,,,,193,205,211,218,,,,,,,,,],,,,,,]},cp862:{name:"Hebrew",languages:["he"],extends:"cp437",value:[,,,,,,,,[1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503],[1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,,,,,,],,,,,,,]},cp863:{name:"Canadian French",languages:["fr"],extends:"cp437",value:[,,,,,,,,[,,,,194,,182,,,,,,,8215,192,167],[,200,202,,203,207,,,164,212,,,,217,219,,],[166,180,,,168,184,179,175,206,,,,,190,,,],,,,,,]},cp864:{name:"Arabic",languages:["ar"],extends:"cp437",offset:128,value:[176,183,8729,8730,9618,9472,9474,9532,9508,9516,9500,9524,9488,9484,9492,9496,946,8734,966,177,189,188,8776,171,187,65271,65272,65533,65533,65275,65276,65533,160,173,65154,163,164,65156,65533,65533,65166,65167,65173,65177,1548,65181,65185,65189,1632,1633,1634,1635,1636,1637,1638,1639,1640,1641,65233,1563,65201,65205,65209,1567,162,65152,65153,65155,65157,65226,65163,65165,65169,65171,65175,65179,65183,65187,65191,65193,65195,65197,65199,65203,65207,65211,65215,65217,65221,65227,65231,166,172,247,215,65225,1600,65235,65239,65243,65247,65251,65255,65259,65261,65263,65267,65213,65228,65230,65229,65249,65149,1617,65253,65257,65260,65264,65266,65232,65237,65269,65270,65245,65241,65265,9632,65533]},cp865:{name:"Nordic",languages:["sv","dk"],extends:"cp437",value:[,,,,,,,,,[,,,,,,,,,,,248,,216,,,],[,,,,,,,,,,,,,,,164],,,,,,]},cp866:{name:"Cyrillic 2",languages:["ru"],extends:"cp437",value:[,,,,,,,,[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055],[1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071],[1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087],,,,[1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103],[1025,1105,1028,1108,1031,1111,1038,1118,,,,,8470,164,,,]]},cp869:{name:"Greek",languages:["el"],extends:"cp437",value:[,,,,,,,,[65533,65533,65533,65533,65533,65533,902,65533,183,172,166,8216,8217,904,8213,905],[906,938,908,65533,65533,910,939,169,911,178,179,940,,941,942,943],[970,912,972,973,913,914,915,916,917,918,919,,920,921,,,],[,,,,,922,923,924,925,,,,,926,927,,],[,,,,,,928,929,,,,,,,,931],[932,933,934,935,936,937,945,946,947,,,,,948,949,,],[950,951,952,953,954,955,956,957,958,959,960,961,963,962,964,900],[173,,965,966,967,167,968,901,,168,969,971,944,974,,,]]},cp874:{name:"Thai",languages:["th"],extends:"ascii",offset:128,value:[8364,65533,65533,65533,65533,8230,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,8216,8217,8220,8221,8226,8211,8212,65533,65533,65533,65533,65533,65533,65533,65533,160,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,65533,65533,65533,65533,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,65533,65533,65533,65533]},cp1001:{name:"Arabic",languages:["ar"],extends:"cp437",value:[,,,,,,,,[1569,1570,1571,1572,1573,65163,1575,1576,65169,1577,1578,65175,1579,65179,1583,1584],[1585,1586,1587,65203,65204,1588,65207,65208,1589,65211,65212,1590,65215,65216,1591,1592],[1593,65227,1594,65231,1601,65235,1602,65239,1603,1705,1604,65271,65273,65275,9496,1605],[65251,
1331606,65255,1607,65259,1608,1609,1657,65267,9474,1548,1563,1567,65154,65156,65162],[,1580,65183,1581,65187,1582,65191,65226,65228,65230,65231,65272,65274,65276,65259,65260],[1632,65264,9472,65533,1632,1633,1634,1635,1636,1637,1638,1639,1640,1641,65533,65533],[65533,65533,65275,65533,65533,65533,65533,9524,,,,,,,,,],,]},cp1098:{name:"Farsi",languages:["fa"],extends:"cp437",value:[,,[,,,,,65533,,,,,65533,,,,,,],,,,,,[65533,65533,1548,1563,1567,1611,1570,65154,63738,1575,65166,63739,1569,1571,65156,63737],[1572,65163,1576,65169,64342,64344,1578,65175,1579,65179,1580,65183,64378,64380,215,1581],[65187,1582,65191,1583,1584,1585,1586,64394,1587,65203,1588,65207,1589,65211,,,],[,,,,,1590,65215,65217,65219,,,,,164,65221,,],[,,,,,,65223,1593,,,,,,,,65533],[65226,65227,65228,1594,65230,65231,65232,1601,65235,,,,,1602,65239,,],[64398,65243,64402,64404,1604,65247,1605,65251,1606,65255,1608,1607,65259,65260,64420,64508],[173,64509,64510,1600,1632,1633,1634,1635,1636,1637,1638,1639,1640,1641,,,]]},cp1125:{name:"Ukrainian",languages:["uk"],extends:"cp866",value:[,,,,,,,,,,,,,,,[,,1168,1169,1028,1108,1030,1110,1031,1111,247,177,,,,,]]},cp3001:{name:"Estonian 1 or 1116",languages:["et"],extends:"cp850",value:[,,,,,,,,,,,,,[353,352,,,,,,,,,,,,,,,],[,,,,,,,382,381,,,,,,,,],,]},cp3002:{name:"Estonian 2",languages:["et"],extends:"iso8859-1",value:[,,,,,,,,[65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533],[65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533],[32,,,,,,,,,,,,,,,8254],,,[352,,,,,,,,,,,,,,381,,],,[353,,,,,,,,,,,,,,382,,]]},cp3011:{name:"Latvian 1",languages:["lv"],extends:"cp437",value:[,,,,,,,,,,,[,,,,,256,,326,,,,,,,,,],[,,,,,,257,,,,,,,,,,],[352,,269,268,,,291,298,299,,,,,363,362,,],,[274,275,290,311,310,316,315,382,381,,,,325,353,,,]]},cp3012:{name:"Latvian 2 (modified 866)",languages:["lv"],extends:"cp866",value:[,,,,,,,,,,,[,,,,,256,,326,,,,,,332,,,],[,,,,,,257,,,,,,,,,,],[352,,269,268,,,291,298,299,,,,,363,362,,],,[274,275,290,311,310,316,315,382,381,333,,,325,353,,,]]},cp3021:{name:"Bulgarian (MIK)",languages:["bg"],extends:"cp866",value:[,,,,,,,,,,,[1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103],[,,,,,,9571,9553,,,,,,,,9488],[9617,9618,9619,9474,9508,8470,167,9559,9565,,,,,,,,],[945,223,915,960,931,963,181,964,934,920,937,948,8734,966,949,8745],[8801,177,8805,8804,8992,8993,247,8776,,,,,8319,178,,,]]},cp3041:{name:"Maltese ISO 646",languages:["mt"],extends:"ascii",value:[,,,,,[,,,,,,,,,,,289,380,295,,,],[267,,,,,,,,,,,,,,,,],[,,,,,,,,,,,288,379,294,266,,],,,,,,,,,]},cp3840:{name:"Russian (modified 866)",languages:["ru"],extends:"cp866",value:[,,,,,,,,,,,,,,,[8801,177,8805,8804,8992,8993,247,8776,,,,,8319,178,,,]]},cp3841:{name:"Ghost",languages:["ru"],extends:"cp437",offset:128,value:[1171,1241,1105,1110,1111,1112,1181,1257,1118,1199,1277,1224,1209,1207,1108,163,1170,1240,1025,1030,1031,1032,1180,1256,1038,1198,1276,1223,1208,1206,1028,1066,32,33,34,35,164,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,8709]},cp3843:{name:"Polish (Mazovia)",languages:["pl"],extends:"cp437",value:[,,,,,,,,[,,,,,,261,,,,,,,263,,260],[280,281,322,,,262,,,346,,,,321,,347,,],[377,379,,211,324,323,378,380,,,,,,,,,],,,,,,]},cp3844:{name:"Czech (Kamenický)",languages:["cz"],extends:"cp437",value:[,,,,,,,,[268,,,271,,270,356,269,283,282,313,205,318,314,,193],[,382,381,,,211,367,218,253,,,352,317,221,344,357],[,,,,328,327,366,212,353,345,341,340,,167,,,],,,,,,]},cp3845:{name:"Hungarian (CWI-2)",languages:["hu"],extends:"cp437",value:[,,,,,,,,[,,,,,,,,,,,,,205,,193],[,,,337,,211,369,218,368,,,,,,,,],[,,,,,,,336,,,,,,,,,],,,,,,]},cp3846:{name:"Turkish",languages:["tr"],extends:"cp437",value:[,,,,,,,,[,,,,,,,,,,,,,305,,,],[,,,,,,,,304,,,,,,350,351],[,,,,,,286,287,,,,,,,,,],,,,,,]},cp3847:{name:"Brazil ABNT",languages:["pt"],extends:"iso8859-1",value:[,,,,,,,,,,,,,[,,,,,,,65533,,,,,,,,,],,[,,,,,,,65533,,,,,,,,,]]},cp3848:{name:"Brazil ABICOMP",languages:["pt"],extends:"ascii",value:[,,,,,,,,,,[160,192,193,194,195,196,199,200,201,202,203,204,205,206,205,209],[210,211,212,213,214,198,217,218,219,220,376,168,163,166,167,176],[161,224,225,226,227,228,231,232,233,234,235,236,237,238,239,241],[242,243,244,245,246,230,249,250,251,252,255,223,170,186,191,177],,,]},"iso8859-1":{name:"Latin 1",languages:["en"],extends:"ascii",offset:128,value:[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]},"iso8859-2":{name:"Latin 2",languages:["hu","pl","cz"],extends:"iso8859-1",value:[,,,,,,,,,,[,260,728,321,,317,346,,,352,350,356,377,,381,379],[,261,731,322,,318,347,711,,353,351,357,378,733,382,380],[340,,,258,,313,262,,268,,280,,282,,,270],[272,323,327,,,336,,,344,366,,368,,,354,,],[341,,,259,,314,263,,269,,281,,283,,,271],[273,324,328,,,337,,,345,367,,369,,,355,729]]},"iso8859-7":{name:"Greek",languages:["el"],extends:"iso8859-1",value:[,,,,,,,,,,[,8216,8217,,8364,8367,,,,,890,,,,,8213],[,,,,900,901,902,,904,905,906,,908,,910,911],[912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927],[928,929,,931,932,933,934,935,936,937,938,939,940,941,942,943],[944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959],[960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,,]]},"iso8859-15":{name:"Latin 9",languages:["fr"],extends:"iso8859-1",value:[,,,,,,,,,,[,,,,8364,,352,,353,,,,,,,,],[,,,,381,,,,382,,,,338,339,376,,],,,,,]},windows1250:{name:"Latin 2",languages:["hu","pl","cz"],extends:"windows1252",value:[,,,,,,,,[,,,65533,,,,,65533,,,,346,356,,377],[,,,,,,,,65533,,,,347,357,,378],[,711,728,321,,260,,,,,350,,,,,379],[,,731,322,,,,,,261,351,,317,733,318,380],[340,,,258,,313,262,,268,,280,,282,,,270],[272,323,327,,,336,,,344,366,,368,,,354,,],[341,,,259,,314,263,,269,,281,,283,,,271],[273,324,328,,,337,,,345,367,,369,,,355,729]]},windows1251:{name:"Cyrillic",languages:["ru"],extends:"windows1252",value:[,,,,,,,,[1026,1027,,1107,,,,,8364,,1033,,1034,1036,1035,1039],[1106,,,,,,,,65533,,1113,,1114,1116,1115,1119],[,1038,1118,1032,,1168,,,1025,,1028,,,,,1031],[,,1030,1110,1169,,,,1105,8470,1108,,1112,1029,1109,1111],[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055],[1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071],[1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087],[1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103]]},windows1252:{name:"Latin",languages:["fr"],extends:"iso8859-1",value:[,,,,,,,,[8364,65533,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,65533,381,65533],[65533,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,65533,382,376],,,,,,,]},windows1253:{name:"Greek",languages:["el"],extends:"windows1252",value:[,,,,,,,,[,,,,,,,,65533,,65533,,65533,,65533,,],[,,,,,,,,65533,,65533,,65533,,65533,65533],[,901,902,,,,,,,,65533,,,,,8213],[,,,,900,,,,904,905,906,,908,,910,911],[912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927],[928,929,65533,931,932,933,934,935,936,937,938,939,940,941,942,943],[944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959],[960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,65533]]},windows1254:{name:"Turkish",languages:["tr"],extends:"windows1252",value:[,,,,,,,,[,,,,,,,,,,,,,,65533,,],[,,,,,,,,,,,,,,65533,,],,,,[286,,,,,,,,,,,,,304,350,,],,[287,,,,,,,,,,,,,305,351,,]]},windows1255:{name:"Hebrew",languages:["he"],extends:"windows1252",value:[,,,,,,,,[,,,,,,,,,,65533,,65533,,65533,,],[,,,,,,,,,,65533,,65533,,65533,65533],[,,,,8362,,,,,,215,,,,,,],[,,,,,,,,,,247,,,,,,],[1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,65533,1467,1468,1469,1470,1471],[1472,1473,1474,1475,1520,1521,1522,1523,1524,65533,65533,65533,65533,65533,65533,65533],[1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503],[1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,65533,65533,8206,8207,65533]]},windows1256:{name:"Arabic",languages:["ar"],extends:"windows1252",value:[,,,,,,,,[,1662,,,,,,,,,1657,,,1670,1688,1672],[1711,,,,,,,,1705,,1681,,,8204,8205,1722],[,1548,,,,,,,,,1726,,,,,,],[,,,,,,,,,,1563,,,,,1567],[1729,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583],[1584,1585,1586,1587,1588,1589,1590,,1591,1592,1593,1594,1600,1601,1602,1603],[,1604,,1605,1606,1607,1608,,,,,,1609,1610,,,],[1611,1612,1613,1614,,1615,1616,,1617,,1618,,,8206,8207,1746]]},windows1257:{name:"Baltic Rim",languages:["et","lt"],extends:"windows1252",value:[,,,,,,,,[,,,65533,,,,,65533,,65533,,65533,168,711,184],[,,,,,,,,65533,,65533,,65533,175,731,65533],[,65533,,,,65533,,,216,,342,,,,,198],[,,,,,,,,248,,343,,,,,230],[260,302,256,262,,,280,274,268,,377,278,290,310,298,315],[352,323,325,,332,,,,370,321,346,362,,379,381,,],[261,303,257,263,,,281,275,269,,378,279,291,311,299,316],[353,324,326,,333,,,,371,322,347,363,,380,382,729]]},windows1258:{name:"Vietnamese",languages:["vi"],extends:"windows1252",value:[,,,,,,,,[,,,,,,,,,,65533,,,,65533,,],[,,,,,,,,,,65533,,,,65533,,],,,[,,,258,,,,,,,,,768,,,,],[272,,777,,,416,,,,,,,,431,771,,],[,,,259,,,,,,,,,769,,,,],[273,,803,,,417,,,,,,,,432,8363,,]]},rk1048:{name:"Kazakh",languages:["kk"],extends:"windows1251",value:[,,,,,,,,[,,,,,,,,,,,,,1178,1210,,],[,,,,,,,,,,,,,1179,1211,,],[,1200,1201,1240,,1256,,,,,1170,,,,,1198],[,,,,1257,,,,,,1171,,1241,1186,1187,1199],,,,,]},thai11:{name:"Thai (Charcter Code 11)",languages:["th"],extends:"thai13",value:[,,,,,,,,,[,,,,,,,,,9484,9488,9492,9496,9474,9500,9508],,,,[,,,,,,,,,,,9472,9524,9516,9532,,],,[,,,,,,,,,,,3658,3650,3651,3652,65533]]},thai13:{name:"Thai (Charcter Code 13)",languages:["th"],extends:"cp874",value:[,,,,,,,,[65533,,,,,65533,,,,,,,,,,,],[,65533,65533,65533,65533,65533,65533,65533,,,,,,,,,],,,,[,,,,,,,,,,,3619,,,3648,,],,[,,,,,,,,,,,,8592,8593,8594,8595]]},thai14:{name:"Thai (Charcter Code 14)",languages:["th"],extends:"cp874",value:[,,,,,,,,[9484,9488,9492,9496,9474,9472,9500,9508,9524,9516,9532,9608,,,,,],[3619,3634,65533,3632,65533,65533,65533,65533,,,,,,,,3648],,,,,,[,,,,,,,,,,3675,65533,,,,3652]]},thai16:{name:"Thai (Charcter Code 16)",languages:["th"],extends:"thai18",value:[,,,,,,,,,[3650,3651,,,,,,,,,,,,,,,],,,,,,,]},thai18:{name:"Thai (Charcter Code 18)",languages:["th"],extends:"thai14",value:[,,,,,,,,[,,,,,,,,,,,,8592,8593,8594,8595],,,,,,[,,,,,,,,,,,,,,3652,,],[,,,,,,,,,,,,,,,65533]]},thai42:{name:"Thai (Charcter Code 42)",languages:["th"],extends:"thai18",value:[,,,,,,,,,[3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3587,3589,3619,3634,3652,,],[,,,3588,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601],[3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617],[3618,3619,3620,3621,3623,3624,3625,3626,3627,3628,3629,3630,3632,3622,3634,3635],[3648,3649,3650,3651,3652,3654,3631,3640,3641,3636,3637,3638,3639,3658,3661,3655],[3656,3657,3658,3659,3660,65533,65533,65533,65533,65533,65533,3632,65533,65533,65533,65533],[65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,65533,,,,,160]]},tcvn3:{name:"Vietnamese (VSCII3 / TCVN3)",languages:["vi"],extends:"ascii",value:[,,,,,,,,,,[,,,,,,,,259,226,234,244,417,432,273,,],[,,,,,224,7843,227,225,7841,,7857,7859,7861,7855,,],[,,,,,,7863,7847,7849,7851,7845,7853,232,,7867,7869],[233,7865,7873,7875,7877,7871,7879,236,7881,,,,297,237,7883,242],[,7887,245,243,7885,7891,7893,7895,7889,7897,7901,7903,7905,7899,7907,249],[,7911,361,250,7909,7915,7917,7919,7913,7921,7923,7927,7929,253,7925,,]]},tcvn3capitals:{name:"Vietnamese (VSCII3 / TCVN3 Capitals)",languages:["vi"],extends:"ascii",value:[,,,,,,,,,,[,258,194,,,,,208,,,202,212,416,431,,,],[,,,,,192,7842,195,193,7840,,7856,7858,7860,7854,,],[,,,,,,7862,7846,7848,7850,7844,7852,200,,7866,7868],[201,7864,7872,7874,7876,7870,7878,204,7880,,,,296,205,7882,210],[,7886,213,211,7884,7890,7892,7894,7888,7896,7900,7902,7904,7898,7906,217],[,7910,360,218,7908,7914,7916,7918,7912,7920,7922,7926,7928,221,7924,,]]},viscii:{name:"Vietnamese (VISCII)",languages:["vi"],extends:"ascii",value:[[,,7858,,,7860,7850,,,,,,,,,,],[,,,,7926,,,,,7928,,,,,7924,,],,,,,,,[7840,7854,7856,7862,7844,7846,7848,7852,7868,7864,7870,7872,7874,7876,7878,7888],[7890,7892,7894,7896,7906,7898,7900,7902,7882,7886,7884,7880,7910,360,7908,7922],[213,7855,7857,7863,7845,7847,7849,7853,7869,7865,7871,7873,7875,7877,7879,7889],[7891,7893,7895,7904,416,7897,7901,7903,7883,7920,7912,7914,7916,417,7899,431],[192,193,194,195,7842,258,7859,7861,200,201,202,7866,204,205,296,7923],[272,7913,210,211,212,7841,7927,7915,7917,217,218,7929,7925,221,7905,432],[224,225,226,227,7843,259,7919,7851,232,233,234,7867,236,237,297,7881],[273,7921,242,243,244,245,7887,7885,7909,249,250,361,7911,253,7907,7918]]},khmer:{name:"Khmer",languages:["km"],extends:"ascii",value:[,,,,,,,,[6016,6017,6016,6019,6020,6021,6022,6023,6024,6025,6026,6027,
1336028,6029,6030,6031],[6032,6033,6032,6035,6036,6037,6038,6039,6040,6041,6042,6043,6044,6045,6046,6047],[6048,6049,6048,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063],[6064,6065,6064,6067,6068,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079],[6080,6081,6080,6083,6084,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095],[6096,6097,6096,6099,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,,,],[6112,6113,6112,6115,6116,6117,6118,6119,6120,6121,,,,,,,],[6128,6129,6128,6131,6132,6133,6134,,,,,,,,,,]]},latvian:{name:"Latvian (based on cp3012)",languages:["lv"],extends:"cp3012",value:[,,,,,,,,,,,,,[,,,,298,299,,,,,,,,,,,],,,]},"epson/katakana":{name:"Katakana",languages:["ja"],extends:"cp437",offset:128,value:[9601,9602,9603,9604,9605,9606,9607,9608,9615,9614,9613,9612,9611,9610,9609,9532,9524,9516,9508,9500,9620,9472,9474,9621,9484,9488,9492,9496,9581,9582,9584,9583,32,65377,65378,65379,65380,65381,65382,65383,65384,65385,65386,65387,65388,65389,65390,65391,65392,65393,65394,65395,65396,65397,65398,65399,65400,65401,65402,65403,65404,65405,65406,65407,65408,65409,65410,65411,65412,65413,65414,65415,65416,65417,65418,65419,65420,65421,65422,65423,65424,65425,65426,65427,65428,65429,65430,65431,65432,65433,65434,65435,65436,65437,65438,65439,9552,9566,9578,9569,9698,9699,9701,9700,9824,9829,9830,9827,9679,9675,9585,9586,9587,20870,24180,26376,26085,26178,20998,31186,12306,24066,21306,30010,26449,20154,9618,160]},"epson/iso8859-2":{name:"Latin 2 modified with box drawing characters",languages:["hu","pl","cz"],extends:"iso8859-2",value:[,,,,,,,,[9617,9618,9619,9474,9508,9496,9484,9608,169,9571,9553,9559,9565,162,165,9488],[9492,9524,9516,9500,9472,9532,9604,9600,9562,9556,9577,9574,9568,9552,9580,174],,,,,,,]},"star/standard":{name:"Standard",languages:["en"],extends:"cp437",offset:128,value:[160,129904,129910,129905,129911,129906,129912,129907,129913,129908,129914,129909,9500,129915,129916,129918,129919,129917,9624,9623,9622,9629,9585,9586,9701,9700,9484,9524,9516,9508,9830,9587,196,214,220,223,167,170,186,65533,162,189,65533,65533,165,188,256,235,233,232,275,234,239,237,236,299,238,246,243,242,333,244,252,250,249,363,251,231,191,65533,65533,274,8580,161,197,248,216,228,225,224,257,226,176,8451,8457,937,181,931,963,65533,65533,967,8734,177,247,960,9612,9604,9600,9616,9532,9496,9492,9488,9608,9618,9162,8592,8593,8594,8595,9581,9161,129923,65533,9601,9613,65533,129928,9626,9630,9698,9699,129840,9208,9584,9583,9582]},"star/katakana":{name:"Katakana",languages:["ja"],extends:"star/standard",value:[,,,,,,,,,,[32,65377,65378,65379,65380,65381,65382,65383,65384,65385,65386,65387,65388,65389,65390,65391],[65392,65393,65394,65395,65396,65397,65398,65399,65400,65401,65402,65403,65404,65405,65406,65407],[65408,65409,65410,65411,65412,65413,65414,65415,65416,65417,65418,65419,65420,65421,65422,65423],[65424,65425,65426,65427,65428,65429,65430,65431,65432,65433,65434,65435,65436,65437,65438,65439],,,]},"star/cp874":{name:"Thai",languages:["th"],extends:"cp874",value:[,,,,,,,,,[,,,,,9474,9472,9532,9484,9488,9492,9496,9500,9516,9508,9524],,,,[,,,,,,,,,,,3657,3658,3659,3660,,],,[,,,,,,,,,,,,162,172,166,,]]},"star/cp928":{name:"Greek",languages:["el"],extends:"cp437",value:[,,,,,,,,,,[160,8216,8217,163,65533,65533,166,167,168,169,65533,171,172,173,65533,8213],[176,177,178,179,900,901,902,183,904,905,906,187,908,189,910,911],[912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927],[928,929,65533,931,932,933,934,935,936,937,938,939,940,941,942,943],[944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959],[960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,65533]]},"bixolon/cp866":{name:"Cyrillic 2 (modified with euro sign)",languages:["ru"],extends:"cp866",value:[,,,,,,,,,,,,,,,[,,,,9093,1055,8801,9824,8364,,,,,,,,]]},"bixolon/hebrew":{name:"Hebrew",languages:["he"],extends:"cp437",value:[,,,,,,,,,,[32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],[48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63],[64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79],[80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95],[1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503],[1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,123,124,125,126,,]]}
133,"xprinter/hebrew":{name:"Hebrew (based on CP862 minus CP437)",languages:["he"],extends:"ascii",value:[,,,,,,,,[1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503],[1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,,,,,,],,,,,,,]},"pos8360/hebrew":{name:"Hebrew (based on cp862 with repeated characters)",languages:["he"],extends:"cp862",value:[,,,,,,,,,,,,,,[1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503],[1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,,,,,,]]}},Fc={cp2001:"cp771",cp1119:"cp772",cp1118:"cp774",cp1162:"cp874",iso88591:"iso8859-1",iso88592:"iso8859-2",iso88597:"iso8859-7",iso885915:"iso8859-15",shiftjis:"epson/katakana",katakana:"epson/katakana",cp928:"star/cp928"},wne={en:"The quick brown fox jumps over the lazy dog.",jp:"ã¤ãããããã ããªãã«ã² ã¯ã«ã¨ã¿ã¬ã½ ãããã©ã ",pt:"O próximo vôo à noite sobre o Atlântico, põe freqüentemente o único médico.",fr:"Les naïfs ægithales hâtifs pondant à Noël où il gèle sont sûrs d'être déçus en voyant leurs drôles d'Åufs abîmés.",sv:"Flygande bäckasiner söka strax hwila pÃ¥ mjuka tuvor.",dk:"Quizdeltagerne spiste jordbær med fløde",el:"ξεÏκεÏÎ¬Î¶Ï Ïην ÏÏ
ÏοÏθÏÏα βδελÏ
γμία",tr:"Pijamalı hasta, yaÄız Åoföre çabucak güvendi.",ru:"СÑеÑÑ Ð¶Ðµ еÑÑ ÑÑиÑ
мÑгкиÑ
ÑÑанÑÑзÑкиÑ
бÑлок да вÑпей ÑаÑ",hu:"ÃrvÃztűrÅ tükörfúrógép",pl:"PchnÄ
Ä w tÄ Åódź jeża lub oÅm skrzyÅ fig",cz:"Mohu jÃst sklo, neublÞà mi.",ar:"Ø£ÙØ§ ÙØ§Ø¯Ø± عÙ٠أÙÙ Ø§ÙØ²Ø¬Ø§Ø¬ Ù ÙØ°Ø§ ÙØ§ ÙØ¤ÙÙ
ÙÙ.",et:"Ma võin klaasi süüa, see ei tee mulle midagi.",lt:"AÅ¡ galiu valgyti stiklÄ
ir jis manÄs nežeidžia.",bg:"Ðога да Ñм ÑÑÑкло, Ñо не ми вÑеди.",is:"Ãg get etið gler án þess að meiða mig.",he:"×× × ×××× ××××× ×××××ת ××× ×× ××××§ ××.",fa:".Ù
Ù Ù
Û ØªÙØ§ÙÙ
بدÙÙÙ Ø§ØØ³Ø§Ø³ درد Ø´ÙØ´Ù Ø¨Ø®ÙØ±Ù
",uk:"Я Ð¼Ð¾Ð¶Ñ ÑÑÑи Ñкло, Ñ Ð²Ð¾Ð½Ð¾ Ð¼ÐµÐ½Ñ Ð½Ðµ заÑкодиÑÑ.",vi:"Tôi có thá» Än thá»§y tinh mà không hại gì.",kk:"ÒазаÒÑа",lv:"Es varu Äst stiklu, tas man nekaitÄ.",mt:"Nista' niekol il-ħġieÄ¡ u ma jagħmilli xejn.",th:"à¸à¸±à¸à¸à¸´à¸à¸à¸£à¸°à¸à¸à¹à¸à¹ à¹à¸à¹à¸¡à¸±à¸à¹à¸¡à¹à¸à¸³à¹à¸«à¹à¸à¸±à¸à¹à¸à¹à¸"};let is=class{static getEncodings(){return Object.keys(un)}static getEncoding(t){return Fc[t]!==void 0&&(t=Fc[t]),un[t]===void 0&&(t="ascii"),un[t].codepoints===void 0&&(un[t].codepoints=this.getCodepoints(t,!0)),structuredClone(un[t])}static getTestStrings(t){return Fc[t]!==void 0&&(t=Fc[t]),un[t]!==void 0&&un[t].languages!==void 0?un[t].languages.map(r=>({language:r,string:wne[r]})):[]}static supports(t){return Fc[t]!==void 0&&(t=Fc[t]),un[t]!==void 0}static encode(t,r){const n=new Uint8Array(t.length),i=this.getEncoding(r);for(let o=0;o<t.length;o++){const s=t.codePointAt(o),a=i.codepoints.findIndex(l=>l===s);n[o]=a!==-1?a:63}return n}static autoEncode(t,r){const n=[];let i,o=-1;for(let s=0;s<t.length;s++){const a=t.codePointAt(s);let l,d=0;if(!l&&i){const u=this.getEncoding(i).codepoints.findIndex(h=>h===a);u!==-1&&(l=i,d=u)}if(!l)for(let u=0;u<r.length;u++){const h=this.getEncoding(r[u]).codepoints.findIndex(f=>f===a);if(h!==-1){l=r[u],d=h;break}}l||(l=i||r[0],d=63),i!=l&&(i&&(n[o].bytes=new Uint8Array(n[o].bytes)),o++,n[o]={codepage:l,bytes:[]},i=l),n[o].bytes.push(d)}return i&&(n[o].bytes=new Uint8Array(n[o].bytes)),n}static getCodepoints(t,r){let n=new Array(256);if(r&&(n=un[t].extends===void 0?n.fill(65533):this.getEncoding(un[t].extends).codepoints),un[t].value.length===16){for(let i=0;i<16;i++)if(typeof un[t].value[i]=="object")for(let o=0;o<16;o++)typeof un[t].value[i][o]=="number"&&(n[16*i+o]=un[t].value[i][o])}else{const i=un[t].offset||0;for(let o=0;o<un[t].value.length;o++)typeof un[t].value[o]=="number"&&(n[i+o]=un[t].value[o])}return n}};var hI=ImageData,Vp=gg(hI);const Ene=hI;function Sne(e,t){let r=0;for(let n=0;n<t.height;n++)for(let i=0;i<t.width;i++){const o=Math.floor(i*e.width/t.width);let s=4*(Math.floor(n*e.height/t.height)*e.width+o);t.data[r++]=e.data[s++],t.data[r++]=e.data[s++],t.data[r++]=e.data[s++],t.data[r++]=e.data[s++]}}function Cne(e,t){function r(s,a,l,d,u){return Math.round((s-a)*u+(l-s)*d)}function n(s,a,l,d,u){const h=e.data[4*(l*e.width+d)+s];return d===u?h:r(a,d,u,h,e.data[4*(l*e.width+u)+s])}function i(s,a,l,d,u,h,f){const p=n(s,a,h,l,d);return h===f?p:r(u,h,f,p,n(s,a,f,l,d))}let o=0;for(let s=0;s<t.height;s++)for(let a=0;a<t.width;a++){const l=a*e.width/t.width,d=s*e.height/t.height,u=Math.floor(l),h=Math.floor(d),f=Math.min(Math.ceil(l),e.width-1),p=Math.min(Math.ceil(d),e.height-1);t.data[o++]=i(0,l,u,f,d,h,p),t.data[o++]=i(1,l,u,f,d,h,p),t.data[o++]=i(2,l,u,f,d,h,p),t.data[o++]=i(3,l,u,f,d,h,p)}}var Tne=gg(function(e,t,r,n){let i;switch(n=n||"bilinear-interpolation"){case"nearest-neighbor":i=Sne;break;case"bilinear-interpolation":case"biliniear-interpolation":i=Cne;break;default:throw new Error(`Unknown algorithm: ${n}`)}const o=new Ene(t,r);return i(e,o),o});let Ane=class{initialize(){return[{type:"initialize",payload:[27,64]},{type:"character-mode",value:"single byte",payload:[28,46]},{type:"font",value:"A",payload:[27,77,0]}]}font(t){const r=t.charCodeAt(0)-65;return[{type:"font",value:t,payload:[27,77,r]}]}align(t){let r=0;return t==="center"?r=1:t==="right"&&(r=2),[{type:"align",value:t,payload:[27,97,r]}]}barcode(t,r,n){const i=[],o={upca:0,upce:1,ean13:2,ean8:3,code39:4,coda39:4,itf:5,"interleaved-2-of-5":5,"nw-7":6,codabar:6,code93:72,code128:73,"gs1-128":72,"gs1-databar-omni":75,"gs1-databar-truncated":76,"gs1-databar-limited":77,"gs1-databar-expanded":78,"code128-auto":79};if(typeof r=="string"&&o[r]===void 0)throw new Error(`Symbology '${r}' not supported by language`);
133if(n.width<1||n.width>3)throw new Error("Width must be between 1 and 3");let s=n.width+1;r==="itf"&&(s=2*n.width),r!=="gs1-128"&&r!=="gs1-databar-omni"&&r!=="gs1-databar-truncated"&&r!=="gs1-databar-limited"&&r!=="gs1-databar-expanded"||(s=n.width),i.push({type:"barcode",property:"height",value:n.height,payload:[29,104,n.height]},{type:"barcode",property:"width",value:n.width,payload:[29,119,s]},{type:"barcode",property:"text",value:n.text,payload:[29,72,n.text?2:0]}),r!="code128"||t.startsWith("{")||(t="{B"+t),r=="gs1-128"&&(t=t.replace(/[()*]/g,""));const a=is.encode(t,"ascii"),l=typeof r=="string"?o[r]:r;return l>64?i.push({type:"barcode",value:{symbology:r,data:t},payload:[29,107,l,a.length,...a]}):i.push({type:"barcode",value:{symbology:r,data:t},payload:[29,107,l,...a,0]}),i}qrcode(t,r){const n=[];if(typeof r.model=="number"){const a={1:49,2:50};if(!(r.model in a))throw new Error("Model must be 1 or 2");n.push({type:"qrcode",property:"model",value:r.model,payload:[29,40,107,4,0,49,65,a[r.model],0]})}if(typeof r.size!="number")throw new Error("Size must be a number");if(r.size<1||r.size>8)throw new Error("Size must be between 1 and 8");n.push({type:"qrcode",property:"size",value:r.size,payload:[29,40,107,3,0,49,67,r.size]});const i={l:48,m:49,q:50,h:51};if(!(r.errorlevel in i))throw new Error("Error level must be l, m, q or h");n.push({type:"qrcode",property:"errorlevel",value:r.errorlevel,payload:[29,40,107,3,0,49,69,i[r.errorlevel]]});const o=is.encode(t,"iso8859-1"),s=o.length+3;return n.push({type:"qrcode",property:"data",value:t,payload:[29,40,107,255&s,s>>8&255,49,80,48,...o]}),n.push({type:"qrcode",command:"print",payload:[29,40,107,3,0,49,81,48]}),n}pdf417(t,r){const n=[];if(typeof r.columns!="number")throw new Error("Columns must be a number");if(r.columns!==0&&(r.columns<1||r.columns>30))throw new Error("Columns must be 0, or between 1 and 30");if(n.push({type:"pdf417",property:"columns",value:r.columns,payload:[29,40,107,3,0,48,65,r.columns]}),typeof r.rows!="number")throw new Error("Rows must be a number");if(r.rows!==0&&(r.rows<3||r.rows>90))throw new Error("Rows must be 0, or between 3 and 90");if(n.push({type:"pdf417",property:"rows",value:r.rows,payload:[29,40,107,3,0,48,66,r.rows]}),typeof r.width!="number")throw new Error("Width must be a number");if(r.width<2||r.width>8)throw new Error("Width must be between 2 and 8");if(n.push({type:"pdf417",property:"width",value:r.width,payload:[29,40,107,3,0,48,67,r.width]}),typeof r.height!="number")throw new Error("Height must be a number");if(r.height<2||r.height>8)throw new Error("Height must be between 2 and 8");if(n.push({type:"pdf417",property:"height",value:r.height,payload:[29,40,107,3,0,48,68,r.height]}),typeof r.errorlevel!="number")throw new Error("Errorlevel must be a number");if(r.errorlevel<0||r.errorlevel>8)throw new Error("Errorlevel must be between 0 and 8");n.push({type:"pdf417",property:"errorlevel",value:r.errorlevel,payload:[29,40,107,4,0,48,69,48,r.errorlevel+48]}),n.push({type:"pdf417",property:"truncated",value:!!r.truncated,payload:[29,40,107,3,0,48,70,r.truncated?1:0]});const i=is.encode(t,"ascii"),o=i.length+3;return n.push({type:"pdf417",property:"data",value:t,payload:[29,40,107,255&o,o>>8&255,48,80,48,...i]}),n.push({type:"pdf417",command:"print",payload:[29,40,107,3,0,48,81,48]}),n}image(t,r,n,i){const o=[],s=(l,d)=>l<r&&d<n?t.data[4*(r*d+l)]>0?0:1:0,a=(l,d)=>{const u=new Uint8Array(l*d>>3);for(let h=0;h<d;h++)for(let f=0;f<l;f+=8)for(let p=0;p<8;p++)u[h*(l>>3)+(f>>3)]|=s(f+p,h)<<7-p;return u};return i=="column"&&(o.push({type:"line-spacing",value:"24 dots",payload:[27,51,36]}),((l,d)=>{const u=[];for(let h=0;h<Math.ceil(d/24);h++){const f=new Uint8Array(3*l);for(let p=0;p<l;p++)for(let m=0;m<3;m++)for(let g=0;g<8;g++)f[3*p+m]|=s(p,24*h+g+8*m)<<7-g;u.push(f)}return u})(r,n).forEach(l=>{o.push({type:"image",property:"data",value:"column",width:r,height:24,payload:[27,42,33,255&r,r>>8&255,...l,10]})}),o.push({type:"line-spacing",value:"default",payload:[27,50]})),i=="raster"&&o.push({type:"image",command:"data",value:"raster",width:r,height:n,payload:[29,118,48,0,r>>3&255,r>>3>>8&255,255&n,n>>8&255,...a(r,n)]}),o}cut(t){let r=0;return t=="partial"&&(r=1),[{type:"cut",payload:[29,86,r]}]}pulse(t,r,n){return t===void 0&&(t=0),r===void 0&&(r=100),n===void 0&&(n=500),[{type:"pulse",payload:[27,112,t?1:0,255&(r=Math.min(500,Math.round(r/2))),255&(n=Math.min(500,Math.round(n/2)))]}]}bold(t){let r=0;return t&&(r=1),[27,69,r]}underline(t){let r=0;return t&&(r=1),[27,45,r]}italic(t){let r=0;return t&&(r=1),[27,52,r]}invert(t){let r=0;return t&&(r=1),[29,66,r]}size(t,r){return[29,33,r-1|t-1<<4]}codepage(t){return[27,116,t]}flush(){return[]}},kne=class{initialize(){return[{type:"initialize",payload:[27,64,24]}]}font(t){let r=0;return t==="B"&&(r=1),t==="C"&&(r=2),[{type:"font",value:t,payload:[27,30,70,r]}]}align(t){let r=0;return t==="center"?r=1:t==="right"&&(r=2),[{type:"align",value:t,payload:[27,29,97,r]}]}barcode(t,r,n){const i=[],o={upce:0,upca:1,ean8:2,ean13:3,code39:4,itf:5,"interleaved-2-of-5":5,code128:6,code93:7,"nw-7":8,codabar:8,"gs1-128":9,"gs1-databar-omni":10,"gs1-databar-truncated":11,"gs1-databar-limited":12,"gs1-databar-expanded":13};if(typeof r=="string"&&o[r]===void 0)throw new Error(`Symbology '${r}' not supported by language`);
133if(n.width<1||n.width>3)throw new Error("Width must be between 1 and 3");r==="code128"&&t.startsWith("{")&&(t=t.slice(2));const s=is.encode(t,"ascii"),a=typeof r=="string"?o[r]:r;return i.push({type:"barcode",value:{symbology:r,data:t,width:n.width,height:n.height,text:n.text},payload:[27,98,a,n.text?2:1,n.width,n.height,...s,30]}),i}qrcode(t,r){const n=[],i={1:1,2:2};if(!(r.model in i))throw new Error("Model must be 1 or 2");if(n.push({type:"qrcode",property:"model",value:r.model,payload:[27,29,121,83,48,i[r.model]]}),typeof r.size!="number")throw new Error("Size must be a number");if(r.size<1||r.size>8)throw new Error("Size must be between 1 and 8");n.push({type:"qrcode",property:"size",value:r.size,payload:[27,29,121,83,50,r.size]});const o={l:0,m:1,q:2,h:3};if(!(r.errorlevel in o))throw new Error("Error level must be l, m, q or h");n.push({type:"qrcode",property:"errorlevel",value:r.errorlevel,payload:[27,29,121,83,49,o[r.errorlevel]]});const s=is.encode(t,"iso8859-1"),a=s.length;return n.push({type:"qrcode",property:"data",value:t,payload:[27,29,121,68,49,0,255&a,a>>8&255,...s]}),n.push({type:"qrcode",command:"print",payload:[27,29,121,80]}),n}pdf417(t,r){const n=[];if(typeof r.columns!="number")throw new Error("Columns must be a number");if(r.columns!==0&&(r.columns<1||r.columns>30))throw new Error("Columns must be 0, or between 1 and 30");if(typeof r.rows!="number")throw new Error("Rows must be a number");if(r.rows!==0&&(r.rows<3||r.rows>90))throw new Error("Rows must be 0, or between 3 and 90");if(n.push({type:"pdf417",value:`rows: ${r.rows}, columns: ${r.columns}`,payload:[27,29,120,83,48,1,r.rows,r.columns]}),typeof r.width!="number")throw new Error("Width must be a number");if(r.width<2||r.width>8)throw new Error("Width must be between 2 and 8");if(n.push({type:"pdf417",property:"width",value:r.width,payload:[27,29,120,83,50,r.width]}),typeof r.height!="number")throw new Error("Height must be a number");if(r.height<2||r.height>8)throw new Error("Height must be between 2 and 8");if(n.push({type:"pdf417",property:"height",value:r.height,payload:[27,29,120,83,51,r.height]}),typeof r.errorlevel!="number")throw new Error("Errorlevel must be a number");if(r.errorlevel<0||r.errorlevel>8)throw new Error("Errorlevel must be between 0 and 8");n.push({type:"pdf417",property:"errorlevel",value:r.errorlevel,payload:[27,29,120,83,49,r.errorlevel]});const i=is.encode(t,"ascii"),o=i.length;return n.push({type:"pdf417",property:"data",value:t,payload:[27,29,120,68,255&o,o>>8&255,...i]}),n.push({type:"pdf417",command:"print",payload:[27,29,120,80]}),n}image(t,r,n,i){const o=[],s=(a,l)=>t.data[4*(r*l+a)]===void 0||t.data[4*(r*l+a)]>0?0:1;o.push({type:"line-spacing",value:"24 dots",payload:[27,48]});for(let a=0;a<n/24;a++){const l=24*a,d=new Uint8Array(3*r);for(let u=0;u<r;u++){const h=3*u;d[h]=s(u,l+0)<<7|s(u,l+1)<<6|s(u,l+2)<<5|s(u,l+3)<<4|s(u,l+4)<<3|s(u,l+5)<<2|s(u,l+6)<<1|s(u,l+7),d[h+1]=s(u,l+8)<<7|s(u,l+9)<<6|s(u,l+10)<<5|s(u,l+11)<<4|s(u,l+12)<<3|s(u,l+13)<<2|s(u,l+14)<<1|s(u,l+15),d[h+2]=s(u,l+16)<<7|s(u,l+17)<<6|s(u,l+18)<<5|s(u,l+19)<<4|s(u,l+20)<<3|s(u,l+21)<<2|s(u,l+22)<<1|s(u,l+23)}o.push({type:"image",property:"data",value:"column",width:r,height:24,payload:[27,88,255&r,r>>8&255,...d,10,13]})}return o.push({type:"line-spacing",value:"default",payload:[27,122,1]}),o}cut(t){let r=0;return t=="partial"&&(r=1),[{type:"cut",payload:[27,100,r]}]}pulse(t,r,n){return t===void 0&&(t=0),r===void 0&&(r=200),n===void 0&&(n=200),[{type:"pulse",payload:[27,7,255&(r=Math.min(127,Math.round(r/10))),255&(n=Math.min(127,Math.round(n/10))),t?26:7]}]}bold(t){let r=70;return t&&(r=69),[27,r]}underline(t){let r=0;return t&&(r=1),[27,45,r]}italic(t){return[]}invert(t){let r=53;return t&&(r=52),[27,r]}size(t,r){return[27,105,r-1,t-1]}codepage(t){return[27,29,116,t]}flush(){return[{type:"print-mode",value:"page",payload:[27,29,80,48]},{type:"print-mode",value:"line",payload:[27,29,80,49]}]}};var Os,er,Go;class Rne{constructor(t){Sr(this,Os,{bold:!1,italic:!1,underline:!1,invert:!1,width:1,height:1});Sr(this,er,void 0);Sr(this,Go,void 0);Qt(this,er,structuredClone(H(this,Os))),Qt(this,Go,t.callback||(()=>{}))}store(){const t=[],r=new Map;for(const n in H(this,er))H(this,er)[n]!==H(this,Os)[n]&&(n==="width"||n==="height"?r.set("size",{width:H(this,Os).width,height:H(this,Os).height}):r.set(n,H(this,Os)[n]));for(const n of r)t.push({type:"style",property:n[0],value:n[1]});return t}restore(){const t=[],r=new Map;for(const n in H(this,er))H(this,er)[n]!==H(this,Os)[n]&&(n==="width"||n==="height"?r.set("size",{width:H(this,er).width,height:H(this,er).height}):r.set(n,H(this,er)[n]));for(const n of r)t.push({type:"style",property:n[0],value:n[1]});return t}set bold(t){t!==H(this,er).bold&&(H(this,er).bold=t,H(this,Go).call(this,{type:"style",property:"bold",value:t}))}get bold(){return H(this,er).bold}set italic(t){t!==H(this,er).italic&&(H(this,er).italic=t,H(this,Go).call(this,{type:"style",property:"italic",value:t}))}get italic(){return H(this,er).italic}set underline(t){t!==H(this,er).underline&&(H(this,er).underline=t,H(this,Go).call(this,{type:"style",property:"underline",value:t}))}get underline(){return H(this,er).underline}set invert(t){t!==H(this,er).invert&&(H(this,er).invert=t,H(this,Go).call(this,{type:"style",property:"invert",value:t}))}get invert(){return H(this,er).invert}set width(t){t!==H(this,er).width&&(H(this,er).width=t,H(this,Go).call(this,{type:"style",property:"size",value:{width:H(this,er).width,height:H(this,er).height}}))}get width(){return H(this,er).width}set height(t){t!==H(this,er).height&&(H(this,er).height=t,H(this,Go).call(this,{type:"style",property:"size",value:{width:H(this,er).width,height:H(this,er).height}}))}get height(){return H(this,er).height}}Os=new WeakMap,er=new WeakMap,Go=new WeakMap;let Ine=class{static wrap(t,r){const n=[];let i=[],o=r.indent||0;const s=r.width||1,a=r.columns||42,l=String(t).split(/\r\n|\n/g);for(const d of l){const u=d.match(/[^\s-]+?-\b|\S+|\s+|\r\n?|\n/g)||["~~empty~~"];for(const h of u)if(h!=="~~empty~~"){if(o+h.length*s>a){if(h.length*s>a){const f=a-o,p=h.split("");let m;const g=[];for(f>8*s&&(m=p.splice(0,Math.floor(f/s)).join(""),i.push(m),n.push(i),i=[],o=0);(m=p.splice(0,Math.floor(a/s))).length;)g.push(m.join(""));for(const y of g)o+y.length*s>a&&(n.push(i),i=[],o=0),i.push(y),o+=y.length*s;continue}n.push(i),i=[],o=0}h.match(/\s+/)&&o==0||(i.push(h),o+=h.length*s)}else n.push(i),i=[],o=0;i.length>0&&(n.push(i),i=[],o=0)}for(let d=0;d<n.length;d++)n[d]=n[d].join(""),d<n.length-1&&(n[d]=n[d].trimEnd());return n}};var zl,Pi,bo,Af,pn,js,kn,Wl,th;class Pne{constructor(t){Sr(this,Wl);Sr(this,zl,void 0);Sr(this,Pi,void 0);Sr(this,bo,void 0);Sr(this,Af,void 0);Sr(this,pn,0);Sr(this,js,void 0);Sr(this,kn,[]);Qt(this,zl,t.embedded||!1),Qt(this,Pi,t.columns||42),Qt(this,bo,t.align||"left"),Qt(this,Af,t.callback||(()=>{})),this.style=new Rne({callback:r=>{this.add(r,0)}}),Qt(this,js,this.style.store())}text(t,r){const n=Ine.wrap(t,{columns:H(this,Pi),width:this.style.width,indent:H(this,pn)});for(let i=0;i<n.length;i++)n[i].length?(this.add({type:"text",value:n[i],codepage:r},n[i].length*this.style.width),i<n.length-1&&this.flush()):this.flush({forceNewline:!0})}space(t){this.add({type:"space",size:t},t)}raw(t,r){this.add({type:"raw",payload:t},r||0)}add(t,r){if(t instanceof Array){for(const n of t)this.add(n);Qt(this,pn,H(this,pn)+(r||0))}else(r=r||0)+H(this,pn)>H(this,Pi)&&this.flush(),Qt(this,pn,H(this,pn)+r),Qt(this,kn,H(this,kn).c
133oncat(t))}end(){Qt(this,pn,H(this,Pi))}fetch(t){if(H(this,pn)===0&&!t.forceNewline&&!t.forceFlush)return[];const r={current:H(this,bo),next:null};for(let a=0;a<H(this,kn).length-1;a++)H(this,kn)[a].type!=="align"||H(this,kn)[a].payload||(r.current=H(this,kn)[a].value);if(H(this,kn).length){const a=H(this,kn)[H(this,kn).length-1];a.type!=="align"||a.payload||(r.next=a.value)}Qt(this,bo,r.current);const n=H(this,kn).filter(a=>a.type!=="align"||a.payload);let i=[];const o=this.style.restore(),s=this.style.store();if(H(this,pn)!==0||!t.ignoreAlignment&&H(this,zl)){if(H(this,bo)==="right"){let a;for(let l=n.length-1;l>=0;l--)if(n[l].type==="text"||n[l].type==="space"){a=l;break}typeof a=="number"&&(n[a].type==="space"&&n[a].size>this.style.width&&(n[a].size-=this.style.width,Qt(this,pn,H(this,pn)-this.style.width)),n[a].type==="text"&&n[a].value.endsWith(" ")&&(n[a].value=n[a].value.slice(0,-1),Qt(this,pn,H(this,pn)-this.style.width))),i=Yn(this,Wl,th).call(this,[{type:"space",size:H(this,Pi)-H(this,pn)},...H(this,js),...n,...s])}if(H(this,bo)==="center"){const a=H(this,Pi)-H(this,pn)>>1;i=Yn(this,Wl,th).call(this,[{type:"space",size:a},...H(this,js),...n,...s,{type:"space",size:H(this,zl)?H(this,Pi)-H(this,pn)-a:0}])}H(this,bo)==="left"&&(i=Yn(this,Wl,th).call(this,[...H(this,js),...n,...s,{type:"space",size:H(this,zl)?H(this,Pi)-H(this,pn):0}]))}else i=Yn(this,Wl,th).call(this,[...H(this,js),...n,...s]);return Qt(this,js,o),Qt(this,kn,[]),Qt(this,pn,0),i.length===0&&t.forceNewline&&i.push({type:"empty"}),r.next&&Qt(this,bo,r.next),i}flush(t){t=Object.assign({forceNewline:!1,forceFlush:!1,ignoreAlignment:!1},t||{});const r=this.fetch(t);r.length&&H(this,Af).call(this,r)}get cursor(){return H(this,pn)}set align(t){this.add({type:"align",value:t},0)}get align(){let t=H(this,bo);for(let r=0;r<H(this,kn).length;r++)H(this,kn)[r].type==="align"&&(t=H(this,kn)[r].value);return t}set columns(t){Qt(this,Pi,t)}get columns(){return H(this,Pi)}}zl=new WeakMap,Pi=new WeakMap,bo=new WeakMap,Af=new WeakMap,pn=new WeakMap,js=new WeakMap,kn=new WeakMap,Wl=new WeakSet,th=function(t){const r=[];let n=-1;for(let i of t){if(i.type==="space"){if(i.size===0)continue;i={type:"text",value:" ".repeat(i.size),codepage:null}}if(i.type==="text"){if(n>=0&&r[n].type==="text"&&(r[n].codepage===i.codepage||r[n].codepage===null||i.codepage===null)){r[n].value+=i.value,r[n].codepage=r[n].codepage||i.codepage;continue}r.push(i),n++}else if(i.type==="style"&&i.property==="size"){if(n>=0&&r[n].type==="style"&&r[n].property==="size"){r[n].value=i.value;continue}r.push(i),n++}else r.push(i),n++}return r};const nu={"esc-pos":{"bixolon/legacy":["cp437","epson/katakana","cp850","cp860","cp863","cp865",,,,,,,,,,,,,,"cp858"],bixolon:["cp437","epson/katakana","cp850","cp860","cp863","cp865",,,,,,,,,,,"windows1252","cp866","cp852","cp858",,"cp862","cp864","thai42","windows1253","windows1254","windows1257",,"windows1251","cp737","cp775","thai14","bixolon/hebrew","windows1255","thai11","thai18","cp885","cp857","iso8859-7","thai16","windows1256","windows1258","khmer",,,,"bixolon/cp866","windows1250",,"tcvn3","tcvn3capitals","viscii"],citizen:["cp437","epson/katakana","cp858","cp860","cp863","cp865","cp852","cp866","cp857",,,,,,,,"windows1252",,,,,"thai11",,,,,"thai13",,,,"tcvn3","tcvn3capitals","windows1258",,,,,,,,"cp864"],"epson/legacy":["cp437","epson/katakana","cp850","cp860","cp863","cp865",,,,,,,,,,,"windows1252","cp866","cp852","cp858"],epson:["cp437","epson/katakana","cp850","cp860","cp863","cp865",,,,,,"cp851","cp853","cp857","cp737","iso8859-7","windows1252","cp866","cp852","cp858","thai42","thai11",,,,,"thai13",,,,"tcvn3","tcvn3capitals","cp720","cp775","cp855","cp861","cp862","cp864","cp869","epson/iso8859-2","iso8859-15","cp1098","cp774","cp772","cp1125","windows1250","windows1251","windows1253","windows1254","windows1255","windows1256","windows1257","windows1258","rk1048"],fujitsu:["cp437","epson/katakana","cp850","cp860","cp863","cp865",,,"cp857",,,,,,,,"windows1252","cp866","cp852","cp858",,,,,,,"thai13",,,,,,,,,,,,,,"cp864"],hp:["cp437","cp850","cp852","cp860","cp863","cp865","cp858","cp866","windows1252","cp862","cp737","cp874","cp857","windows1251","windows1255","rk1048"],metapace:["cp437","epson/katakana","cp850","cp860","cp863","cp865",,,,,,,,,,,,,,"cp858"],mpt:["cp437",,"cp850","cp860","cp863","cp865","windows1251","cp866","cp3021","cp3012"],"pos-5890":["cp437","epson/katakana","cp850","cp860","cp863","cp865","iso8859-1",,"cp862",,,,,,,,"windows1252","cp866","cp852","cp858",,,,"windows1251","cp737","windows1257",,"windows1258","cp864",,,,"windows1255",,,,,,,,,,,,,,,,,,,,,,,,"cp861",,,,"cp855","cp857",,,,"cp851","cp869",,"cp772","cp774",,,"windows1250",,"cp3840",,"cp3843","cp3844","cp3845","cp3846","cp3847","cp3848",,"cp771","cp3001","cp3002","cp3011","cp3012",,"cp3041","windows1253","windows1254","windows1256","cp720",,"cp775"],"pos-8360":["cp437","epson/katakana","cp850","cp860","cp863","cp865","iso8859-1","windows1253","cp862",,,,,,,,"windows1252","cp866","cp852","cp858",,"latvian",,"windows1251","cp737","windows1257",,"windows1258","cp864",,,"pos8360/hebrew","windows1255",,,,,,,,,,,,,,,,,,,,,,,,"cp861",,,,"cp855","cp857",,,,"cp851","cp869",,"cp772","cp774",,,"windows1250",,"cp3840",,"cp3843","cp3844","cp3845","cp3846","cp3847","cp3848",,"cp771","cp3001","cp3002","cp3011","cp3012",,,,"windows1254","windows1256","cp720",,"cp775"],star:["cp437","star/katakana","cp850","cp860","cp863","cp865",,,,,,,,,,,"windows1252","cp866","cp852","cp858","thai42","thai11","thai13","thai14","thai16",,"thai18"],xprinter:["cp437","epson/katakana","cp850","cp860","cp863","cp865","iso8859-1","windows1253","xprinter/
133hebrew","cp3012",,"windows1255",,,,,"windows1252","cp866","cp852","cp858",,"latvian","cp864","windows1251","cp737","windows1257",,,,,,,,"windows1256"],youku:["cp437","epson/katakana","cp850","cp860","cp863","cp865","windows1251","cp866","cp3021","cp3012",,,,,,"cp862","windows1252",,"cp852","cp858",,,"cp864","iso8859-1","cp737","windows1257",,,"cp855","cp857","windows1250","cp775","windows1254","windows1255","windows1256","windows1258",,,"iso8859-1",,,,,,"iso8859-15",,,"cp874"]},"star-prnt":{star:["star/standard","cp437","star/katakana",,"cp858","cp852","cp860","cp861","cp863","cp865","cp866","cp855","cp857","cp862","cp864","cp737","cp851","cp869","star/cp928","cp772","cp774","star/cp874",,,,,,,,,,,"windows1252","windows1250","windows1251",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"cp3840","cp3841","cp3843","cp3844","cp3845","cp3846","cp3847","cp3848","cp1001","cp771","cp3001","cp3002","cp3011","cp3012","cp3021","cp3041"]}};nu["star-line"]=nu["star-prnt"],nu["esc-pos"].zijang=nu["esc-pos"]["pos-5890"];const B2={"bixolon-srp350":{vendor:"Bixolon",model:"SRP-350",media:{dpi:180,width:80},capabilities:{language:"esc-pos",codepages:"bixolon/legacy",fonts:{A:{size:"12x24",columns:42},B:{size:"9x17",columns:56}},barcodes:{supported:!0,symbologies:["upca","upce","ean13","ean8","code39","itf","codabar","code93","code128"]},qrcode:{supported:!1,models:[]},pdf417:{supported:!1},cutter:{feed:4}}},"bixolon-srp350iii":{vendor:"Bixolon",model:"SRP-350III",media:{dpi:180,width:80},capabilities:{language:"esc-pos",codepages:"bixolon",fonts:{A:{size:"12x24",columns:42},B:{size:"9x17",columns:56},C:{size:"9x24",columns:56}},barcodes:{supported:!0,symbologies:["upca","upce","ean13","ean8","code39","itf","codabar","code93","code128"]},qrcode:{supported:!0,models:["2"]},pdf417:{supported:!0},cutter:{feed:4}}},"citizen-ct-s310ii":{vendor:"Citizen",model:"CT-S310II",media:{dpi:203,width:80},capabilities:{language:"esc-pos",codepages:"citizen",fonts:{A:{size:"12x24",columns:48},B:{size:"9x24",columns:64},C:{size:"8x16",columns:72}},barcodes:{supported:!0,symbologies:["upca","upce","ean13","ean8","code39","itf","codabar","code93","code128","gs1-databar-omni","gs1-databar-truncated","gs1-databar-limited","gs1-databar-expanded"]},qrcode:{supported:!0,models:["1","2"]},pdf417:{supported:!0},cutter:{feed:3}}},"epson-tm-p20ii":{vendor:"Epson",model:"TM-P20II",media:{dpi:203,width:58},capabilities:{language:"esc-pos",codepages:"epson",fonts:{A:{size:"12x24",columns:32},B:{size:"9x24",columns:42},C:{size:"9x17",columns:42},D:{size:"10x24",columns:38},E:{size:"8x16",columns:48}},barcodes:{supported:!0,symbologies:["upca","upce","ean13","ean8","code39","itf","codabar","code93","code128","gs1-databar-omni","gs1-databar-truncated","gs1-databar-limited","gs1-databar-expanded","code128-auto"]},qrcode:{supported:!0,models:["1","2"]},pdf417:{supported:!0},images:{mode:"raster"},cutter:{feed:3}}},"epson-tm-t20iii":{vendor:"Epson",model:"TM-T20III",interfaces:{usb:{productName:"TM-T20III"}},media:{dpi:203,width:80},capabilities:{language:"esc-pos",codepages:"epson",fonts:{A:{size:"12x24",columns:48},B:{size:"9x17",columns:64}},barcodes:{supported:!0,symbologies:["upca","upce","ean13","ean8","code39","itf","codabar","code93","code128","gs1-databar-omni","gs1-databar-truncated","gs1-databar-limited","gs1-databar-expanded"]},qrcode:{supported:!0,models:["1","2"]},pdf417:{supported:!0},cutter:{feed:4}}},"epson-tm-t70":{vendor:"Epson",model:"TM-T70",media:{dpi:180,width:80},capabilities:{language:"esc-pos",codepages:"epson/legacy",fonts:{A:{size:"12x24",columns:42},B:{size:"9x17",columns:56}},barcodes:{supported:!0,symbologies:["upca","upce","ean13","ean8","code39","itf","codabar","code93","code128"]},qrcode:{supported:!0,models:["1","2"]},pdf417:{supported:!0},images:{mode:"raster"},cutter:{feed:4}}},"epson-tm-t70ii":{vendor:"Epson",model:"TM-T70II",interface:{usb:{productName:"TM-T70II"}},media:{dpi:180,width:80},capabilities:{language:"esc-pos",codepages:"epson",fonts:{A:{size:"12x24",columns:42},B:{size:"9x17",columns:56}},barcodes:{supported:!0,symbologies:["upca","upce","ean13","ean8","code39","
133itf","codabar","code93","code128","gs1-databar-omni","gs1-databar-truncated","gs1-databar-limited","gs1-databar-expanded"]},qrcode:{supported:!0,models:["1","2"]},pdf417:{supported:!0},images:{mode:"raster"},cutter:{feed:4}}},"epson-tm-t88ii":{vendor:"Epson",model:"TM-T88II",media:{dpi:180,width:80},capabilities:{language:"esc-pos",codepages:"epson/legacy",fonts:{A:{size:"12x24",columns:42},B:{size:"9x17",columns:56}},barcodes:{supported:!0,symbologies:["upca","upce","ean13","ean8","code39","itf","codabar","code93","code128"]},qrcode:{supported:!0,models:["1","2"]},pdf417:{supported:!0},cutter:{feed:4}}},"epson-tm-t88iii":{vendor:"Epson",model:"TM-T88III",media:{dpi:180,width:80},capabilities:{language:"esc-pos",codepages:"epson/legacy",fonts:{A:{size:"12x24",columns:42},B:{size:"9x17",columns:56}},barcodes:{supported:!0,symbologies:["upca","upce","ean13","ean8","code39","itf","codabar","code93","code128"]},qrcode:{supported:!0,models:["1","2"]},pdf417:{supported:!0},cutter:{feed:4}}},"epson-tm-t88iv":{vendor:"Epson",model:"TM-T88IV",media:{dpi:180,width:80},capabilities:{language:"esc-pos",codepages:"epson/legacy",fonts:{A:{size:"12x24",columns:42},B:{size:"9x17",columns:56}},barcodes:{supported:!0,symbologies:["upca","upce","ean13","ean8","code39","itf","codabar","code93","code128"]},qrcode:{supported:!0,models:["1","2"]},pdf417:{supported:!0},cutter:{feed:4}}},"epson-tm-t88v":{vendor:"Epson",model:"TM-T88V",media:{dpi:180,width:80},capabilities:{language:"esc-pos",codepages:"epson",fonts:{A:{size:"12x24",columns:42},B:{size:"9x17",columns:56}},barcodes:{supported:!0,symbologies:["upca","upce","ean13","ean8","code39","itf","codabar","code93","code128","gs1-databar-omni","gs1-databar-truncated","gs1-databar-limited","gs1-databar-expanded"]},qrcode:{supported:!0,models:["1","2"]},pdf417:{supported:!0},cutter:{feed:4}}},"epson-tm-t88vi":{vendor:"Epson",model:"TM-T88VI",media:{dpi:180,width:80},capabilities:{language:"esc-pos",codepages:"epson",fonts:{A:{size:"12x24",columns:42},B:{size:"9x17",columns:56}},barcodes:{supported:!0,symbologies:["upca","upce","ean13","ean8","code39","itf","codabar","code93","code128","gs1-databar-omni","gs1-databar-truncated","gs1-databar-limited","gs1-databar-expanded"]},qrcode:{supported:!0,models:["1","2"]},pdf417:{supported:!0},cutter:{feed:4}}},"epson-tm-t88vii":{vendor:"Epson",model:"TM-T88VII",media:{dpi:180,width:80},capabilities:{language:"esc-pos",codepages:"epson",fonts:{A:{size:"12x24",columns:42},B:{size:"9x17",columns:56}},barcodes:{supported:!0,symbologies:["upca","upce","ean13","ean8","code39","itf","codabar","code93","code128","gs1-databar-omni","gs1-databar-truncated","gs1-databar-limited","gs1-databar-expanded","code128-auto"]},qrcode:{supported:!0,models:["1","2"]},pdf417:{supported:!0},cutter:{feed:4}}},"fujitsu-fp1000":{vendor:"Fujitsu",model:"FP-1000",media:{dpi:203,width:80},capabilities:{language:"esc-pos",codepages:"fujitsu",fonts:{A:{size:"12x24",columns:48},B:{size:"9x24",columns:56},C:{size:"8x16",columns:64}},barcodes:{supported:!0,symbologies:["upca","upce","ean13","ean8","code39","itf","codabar","code93","code128","gs1-databar-omni","gs1-databar-truncated","gs1-databar-limited","gs1-databar-expanded"]},qrcode:{supported:!0,models:["1","2"]},pdf417:{supported:!1},cutter:{feed:4}}},"hp-a779":{vendor:"HP",model:"A779",media:{dpi:180,width:80},capabilities:{language:"esc-pos",codepages:"hp",newline:` 134`,fonts:{A:{size:"12x24",columns:44}},barcodes:{supported:!0,symbologies:["upca","upce","ean13","ean8","code39","itf","codabar","code93","code128"]},qrcode:{supported:!0,models:["1","2"]},pdf417:{supported:!1,fallback:{type:"barcode",symbology:75}},cutter:{feed:4}}},"metapace-t1":{vendor:"Metapace",model:"T-1",media:{dpi:180,width:80},capabilities:{language:"esc-pos",codepages:"metapace",fonts:{A:{size:"12x24",columns:42},B:{size:"9x17",columns:56}},barcodes:{supported:!0,symbologies:["upca","upce","ean13","ean8","code39","itf","codabar","code93","code128"]},qrcode:{supported:!1,models:[]},pdf417:{supported:!1},cutter:{feed:4}}},"mpt-ii":{vendor:"",model:"MPT-II",media:{dpi:180,width:80},capabilities:{language:"esc-pos",codepages:"mpt",fonts:{A:{size:"12x24",columns:48},B:{size:"9x17",columns:64},C:{size:"0x0",columns:64}},barcodes:{supported:!0,symbologies:["upca","upce","ean13","ean8","code39","
134itf","codabar","code93","code128"]},qrcode:{supported:!0,models:[]},pdf417:{supported:!1}}},"pos-5890":{vendor:"",model:"POS-5890",media:{dpi:203,width:58},capabilities:{language:"esc-pos",codepages:"pos-5890",fonts:{A:{size:"12x24",columns:32},B:{size:"9x17",columns:42}},barcodes:{supported:!0,symbologies:["upca","ean13","ean8","code39","itf","codabar","code93","code128"]},qrcode:{supported:!0,models:["2"]},pdf417:{supported:!0},images:{mode:"raster"},cutter:{feed:1}}},"pos-8360":{vendor:"",model:"POS-8360",media:{dpi:203,width:80},capabilities:{language:"esc-pos",codepages:"pos-8360",fonts:{A:{size:"12x24",columns:48},B:{size:"9x17",columns:64}},barcodes:{supported:!0,symbologies:["upca","ean13","ean8","code39","itf","codabar","code93","code128"]},qrcode:{supported:!0,models:["2"]},pdf417:{supported:!0},images:{mode:"raster"},cutter:{feed:4}}},"star-mc-print2":{vendor:"Star",model:"mC-Print2",interfaces:{usb:{productName:"mC-Print2"}},media:{dpi:203,width:58},capabilities:{language:"star-prnt",codepages:"star",fonts:{A:{size:"12x24",columns:32},B:{size:"9x24",columns:42}},barcodes:{supported:!0,symbologies:["upca","upce","ean13","ean8","itf","codabar","code93","code128","gs1-128","gs1-databar-omni","gs1-databar-truncated","gs1-databar-limited","gs1-databar-expanded"]},qrcode:{supported:!0,models:["1","2"]},pdf417:{supported:!0},cutter:{feed:3}}},"star-mpop":{vendor:"Star",model:"mPOP",interfaces:{usb:{productName:"mPOP"}},media:{dpi:203,width:58},capabilities:{language:"star-prnt",codepages:"star",fonts:{A:{size:"12x24",columns:32},B:{size:"9x24",columns:42}},barcodes:{supported:!0,symbologies:["upca","upce","ean13","ean8","itf","codabar","code93","code128","gs1-128","gs1-databar-omni","gs1-databar-truncated","gs1-databar-limited","gs1-databar-expanded"]},qrcode:{supported:!0,models:["1","2"]},pdf417:{supported:!0},cutter:{feed:3}}},"star-sm-l200":{vendor:"Star",model:"SM-L200",media:{dpi:203,width:58},capabilities:{language:"star-prnt",codepages:"star",fonts:{A:{size:"12x24",columns:32},B:{size:"9x24",columns:42},C:{size:"9x17",columns:42}},barcodes:{supported:!0,symbologies:["upca","upce","ean13","ean8","itf","codabar","code93","code128"]},qrcode:{supported:!0,models:["2"]},pdf417:{supported:!0}}},"star-tsp100iii":{vendor:"Star",model:"TSP100III",media:{dpi:203,width:80},capabilities:{language:"star-prnt",codepages:"star",fonts:{A:{size:"12x24",columns:48},B:{size:"9x24",columns:64}},barcodes:{supported:!0,symbologies:["upca","upce","ean13","ean8","code39","itf","codabar","code93","code128"]},qrcode:{supported:!0,models:["1","2"]},pdf417:{supported:!0},cutter:{feed:3}}},"star-tsp100iv":{vendor:"Star",model:"TSP100IV",media:{dpi:203,width:80},capabilities:{language:"star-prnt",codepages:"star",fonts:{A:{size:"12x24",columns:48},B:{size:"9x24",columns:64}},barcodes:{supported:!0,symbologies:["upca","upce","ean13","ean8","code39","itf","codabar","code93","code128","gs1-128","gs1-databar-omni","gs1-databar-truncated","gs1-databar-limited","gs1-databar-expanded"]},qrcode:{supported:!0,models:["1","2"]},pdf417:{supported:!0},cutter:{feed:3}}},"star-tsp650":{vendor:"Star",model:"TSP650",media:{dpi:203,width:80},capabilities:{language:"star-line",codepages:"star",fonts:{A:{size:"12x24",columns:48},B:{size:"9x24",columns:64}},barcodes:{supported:!0,symbologies:["upca","upce","ean13","ean8","code39","itf","codabar","code93","code128"]},qrcode:{supported:!1,models:[]},pdf417:{supported:!1},cutter:{feed:3}}},"star-tsp650ii":{vendor:"Star",model:"TSP650II",media:{dpi:203,width:80},capabilities:{language:"star-line",codepages:"star",fonts:{A:{size:"12x24",columns:48},B:{size:"9x24",columns:64}},barcodes:{supported:!0,symbologies:["upca","upce","ean13","ean8","code39","itf","codabar","code93","code128","gs1-128","gs1-databar-omni","gs1-databar-truncated","gs1-databar-limited","gs1-databar-expanded"]},qrcode:{supported:!0,models:["1","2"]},pdf417:{supported:!0},cutter:{feed:3}}},"xprinter-xp-n160ii":{vendor:"Xprinter",model:"XP-N160II",interfaces:{usb:{productName:"Printer-80\0"}},media:{dpi:203,width:80},capabilities:{language:"esc-pos",codepages:"xprinter",fonts:{A:{size:"12x24",columns:48},B:{size:"9x17",columns:64}},barcodes:{supported:!0,symbologies:["upca","upce","ean13","ean8","code39","
134itf","codabar","code93","code128","gs1-128"]},qrcode:{supported:!0,models:["2"]},pdf417:{supported:!0},cutter:{feed:4}}},"xprinter-xp-t80q":{vendor:"Xprinter",model:"XP-T80Q",media:{dpi:203,width:80},capabilities:{language:"esc-pos",codepages:"xprinter",fonts:{A:{size:"12x24",columns:48},B:{size:"9x17",columns:64}},barcodes:{supported:!0,symbologies:["upca","upce","ean13","ean8","code39","itf","codabar","code93","code128","gs1-128"]},qrcode:{supported:!0,models:["2"]},pdf417:{supported:!0},cutter:{feed:4}}},"youku-58t":{vendor:"Youku",model:"58T",media:{dpi:203,width:58},capabilities:{language:"esc-pos",codepages:"youku",fonts:{A:{size:"12x24",columns:32},B:{size:"9x24",columns:42}},barcodes:{supported:!0,symbologies:["upca","ean13","ean8","code39","itf","codabar","code93","code128"]},qrcode:{supported:!0,models:["2"]},pdf417:{supported:!1}}}};var _t,Oa,dr,Ne,Dr,Zi,Cu,Ls,$s,kf,xy,Im,fI,Pm,pI,Ds,Sl,Yu;let Qb=(Yu=class{constructor(t){Sr(this,kf);Sr(this,Im);Sr(this,Pm);Sr(this,Ds);Sr(this,_t,{});Sr(this,Oa,[]);Sr(this,dr,void 0);Sr(this,Ne,void 0);Sr(this,Dr,{fonts:{A:{size:"12x24",columns:42},B:{size:"9x24",columns:56}},barcodes:{supported:!0,symbologies:["upca","upce","ean13","ean8","code39","itf","codabar","code93","code128","gs1-databar-omni","gs1-databar-truncated","gs1-databar-limited","gs1-databar-expanded"]},qrcode:{supported:!0,models:["1","2"]},pdf417:{supported:!0}});Sr(this,Zi,{});Sr(this,Cu,[]);Sr(this,Ls,"cp437");Sr(this,$s,{codepage:0,font:"A"});var n,i,o,s,a;const r={columns:42,language:"esc-pos",imageMode:"column",feedBeforeCut:0,newline:` 135\r`,codepageMapping:"epson",codepageCandidates:null,errors:"relaxed"};if(typeof(t=t||{}).language=="string"&&(r.columns=t.language==="esc-pos"?42:48,r.codepageMapping=t.language==="esc-pos"?"epson":"star"),typeof t.printerModel=="string"){if(B2[t.printerModel]===void 0)throw new Error("Unknown printer model");Qt(this,Dr,B2[t.printerModel].capabilities),r.columns=H(this,Dr).fonts.A.columns,r.language=H(this,Dr).language,r.codepageMapping=H(this,Dr).codepages,r.newline=((n=H(this,Dr))==null?void 0:n.newline)||r.newline,r.feedBeforeCut=((o=(i=H(this,Dr))==null?void 0:i.cutter)==null?void 0:o.feed)||r.feedBeforeCut,r.imageMode=((a=(s=H(this,Dr))==null?void 0:s.images)==null?void 0:a.mode)||r.imageMode}if(t&&Qt(this,_t,Object.assign(r,{debug:!1,embedded:!1,createCanvas:null},t)),H(this,_t).width&&(H(this,_t).columns=H(this,_t).width),H(this,_t).language==="esc-pos")Qt(this,dr,new Ane);else{if(H(this,_t).language!=="star-prnt"&&H(this,_t).language!=="star-line")throw new Error("The specified language is not supported");Qt(this,dr,new kne)}if(H(this,_t).autoFlush===void 0&&(H(this,_t).autoFlush=!H(this,_t).embedded&&H(this,_t).language=="star-prnt"),![32,35,42,44,48].includes(H(this,_t).columns)&&!H(this,_t).embedded)throw new Error("The width of the paper must me either 32, 35, 42, 44 or 48 columns");if(typeof H(this,_t).codepageMapping=="string"){if(nu[H(this,_t).language][H(this,_t).codepageMapping]===void 0)throw new Error("Unknown codepage mapping");Qt(this,Zi,Object.fromEntries(nu[H(this,_t).language][H(this,_t).codepageMapping].map((l,d)=>[l,d]).filter(l=>l)))}else Qt(this,Zi,H(this,_t).codepageMapping);H(this,_t).codepageCandidates?Qt(this,Cu,H(this,_t).codepageCandidates):Qt(this,Cu,Object.keys(H(this,Zi))),Qt(this,Ne,new Pne({embedded:H(this,_t).embedded,columns:H(this,_t).columns,align:"left",size:1,callback:l=>H(this,Oa).push(l)})),Yn(this,kf,xy).call(this)}initialize(){if(H(this,_t).embedded)throw new Error("Initialize is not supported in table cells or boxes");return H(this,Ne).add(H(this,dr).initialize()),this}codepage(t){if(t==="auto")return Qt(this,Ls,t),this;if(!is.supports(t))throw new Error("Unknown codepage");if(H(this,Zi)[t]===void 0)throw new Error("Codepage not supported by printer");return Qt(this,Ls,t),this}text(t){return H(this,Ne).text(t,H(this,Ls)),this}newline(t){t=parseInt(t,10)||1;for(let r=0;r<t;r++)H(this,Ne).flush({forceNewline:!0});return this}line(t){return this.text(t),this.newline(),this}underline(t){return H(this,Ne).style.underline=t===void 0?!H(this,Ne).style.underline:t,this}
135italic(t){return H(this,Ne).style.italic=t===void 0?!H(this,Ne).style.italic:t,this}bold(t){return H(this,Ne).style.bold=t===void 0?!H(this,Ne).style.bold:t,this}invert(t){return H(this,Ne).style.invert=t===void 0?!H(this,Ne).style.invert:t,this}width(t){if(t===void 0&&(t=1),typeof t!="number")throw new Error("Width must be a number");if(t<1||t>8)throw new Error("Width must be between 1 and 8");return H(this,Ne).style.width=t,this}height(t){if(t===void 0&&(t=1),typeof t!="number")throw new Error("Height must be a number");if(t<1||t>8)throw new Error("Height must be between 1 and 8");return H(this,Ne).style.height=t,this}size(t,r){return typeof t=="string"?this.font(t==="small"?"B":"A"):(r===void 0&&(r=t),this.width(t),this.height(r),this)}font(t){if(H(this,_t).embedded)throw new Error("Changing fonts is not supported in table cells or boxes");if(H(this,Ne).cursor>0)throw new Error("Changing fonts is not supported in the middle of a line");const r=t.match(/^[0-9]+x[0-9]+$/);return r&&(t=Object.entries(H(this,Dr).fonts).find(n=>n[1].size==r[0])[0]),t=t.toUpperCase(),H(this,Dr).fonts[t]===void 0?Yn(this,Ds,Sl).call(this,"This font is not supported by this printer","relaxed"):(H(this,Ne).add(H(this,dr).font(t)),H(this,$s).font=t,H(this,Ne).columns=t==="A"?H(this,_t).columns:H(this,_t).columns/H(this,Dr).fonts.A.columns*H(this,Dr).fonts[t].columns,this)}align(t){if(!["left","center","right"].includes(t))throw new Error("Unknown alignment");return H(this,Ne).align=t,this}table(t,r){H(this,Ne).flush();for(let n=0;n<r.length;n++){const i=[];let o=0;for(let s=0;s<t.length;s++){const a=new Yu(Object.assign({},H(this,_t),{width:t[s].width,embedded:!0}));a.codepage(H(this,Ls)),a.align(t[s].align),typeof r[n][s]=="string"&&a.text(r[n][s]),typeof r[n][s]=="function"&&r[n][s](a);const l=a.commands();o=Math.max(o,l.length),i[s]=l}for(let s=0;s<t.length;s++)if(!(i[s].length>=o))for(let a=i[s].length;a<o;a++){let l="top";t[s].verticalAlign!==void 0&&(l=t[s].verticalAlign);const d={commands:[{type:"space",size:t[s].width}],height:1};l=="bottom"?i[s].unshift(d):i[s].push(d)}for(let s=0;s<o;s++){for(let a=0;a<t.length;a++)t[a].marginLeft!==void 0&&H(this,Ne).space(t[a].marginLeft),H(this,Ne).add(i[a][s].commands,t[a].width),t[a].marginRight!==void 0&&H(this,Ne).space(t[a].marginRight);H(this,Ne).flush()}}return this}rule(t){return t=Object.assign({style:"single",width:H(this,_t).columns||10},t||{}),H(this,Ne).flush(),H(this,Ne).text((t.style==="double"?"â":"â").repeat(t.width),"cp437"),H(this,Ne).flush({forceNewline:!0}),this}box(t,r){if((t=Object.assign({style:"single",width:H(this,_t).columns,marginLeft:0,marginRight:0,paddingLeft:0,paddingRight:0},t||{})).width+t.marginLeft+t.marginRight>H(this,_t).columns)throw new Error("Box is too wide");let n;t.style=="single"?n=["â","â","â","â","â","â"]:t.style=="double"&&(n=["â","â","â","â","â","â"]);const i=new Yu(Object.assign({},H(this,_t),{width:t.width-(t.style=="none"?0:2)-t.paddingLeft-t.paddingRight,embedded:!0}));i.codepage(H(this,Ls)),i.align(t.align),typeof r=="function"&&r(i),typeof r=="string"&&i.text(r);const o=i.commands();H(this,Ne).flush(),t.style!="none"&&(H(this,Ne).space(t.marginLeft),H(this,Ne).text(n[0],"cp437"),H(this,Ne).text(n[4].repeat(t.width-2),"cp437"),H(this,Ne).text(n[1],"cp437"),H(this,Ne).space(t.marginRight),H(this,Ne).flush());for(let s=0;s<o.length;s++)H(this,Ne).space(t.marginLeft),t.style!="none"&&(H(this,Ne).style.height=o[s].height,H(this,Ne).text(n[5],"cp437"),H(this,Ne).style.height=1),H(this,Ne).space(t.paddingLeft),H(this,Ne).add(o[s].commands,t.width-(t.style=="none"?0:2)-t.paddingLeft-t.paddingRight),H(this,Ne).space(t.paddingRight),t.style!="none"&&(H(this,Ne).style.height=o[s].height,H(this,Ne).text(n[5],"cp437"),H(this,Ne).style.height=1),H(this,Ne).space(t.marginRight),H(this,Ne).flush();return t.style!="none"&&(H(this,Ne).space(t.marginLeft),H(this,Ne).text(n[2],"cp437"),H(this,Ne).text(n[4].repeat(t.width-2),"cp437"),H(this,Ne).text(n[3],"cp437"),H(this,Ne).space(t.marginRight),H(this,Ne).flush()),this}barcode(t,r,n){let i={height:60,width:2,text:!1};if(typeof n=="object"&&(i=Object.assign(i,n)),typeof n=="number"&&(i.height=n),H(this,_t).embedded)throw new Error("Barcodes are not supported in table cells or boxes");return H(this,Dr).barcodes.supported===!1?Yn(this,Ds,Sl).call(this,"Barcodes are not supported by this printer","relaxed"):typeof r!="string"||H(this,Dr).barcodes.symbologies.includes(r)?(H(this,Ne).flush({forceFlush:!0,ignoreAlignment:!0}),H(this,Ne).align!=="left"&&H(this,Ne).add(H(this,dr).align(H(this,Ne).align)),H(this,Ne).add(H(this,dr).barcode(t,r,i)),H(this,Ne).align!=="left"&&H(this,Ne).add(H(this,dr).align("left")),H(this,Ne).flush({forceFlush:!0,ignoreAlignment:!0}),this):Yn(this,Ds,Sl).call(this,`Symbology '${r}' not supported by this printer`,"relaxed")}qrcode(t,r,n,i){let o={model:2,size:6,errorlevel:"m"};if(typeof r=="object"&&(o=Object.assign(o,r)),typeof r=="number"&&(o.model=r),typeof n=="number"&&(o.size=n),typeof i=="string"&&(o.errorlevel=i),H(this,_t).embedded)throw new Error("QR codes are not supported in table cells or boxes");return H(this,Dr).qrcode.supported===!1?Yn(this,Ds,Sl).call(this,"QR codes are not supported by this printer","relaxed"):o.model&&!H(this,Dr).qrcode.models.includes(String(o.model))?Yn(this,Ds,Sl).call(this,"QR code model is not supported by this printer","relaxed"):(H(this,Ne).flush({forceFlush:!0,ignoreAlignment:!0}),H(this,Ne).align!=="left"&&H(this,Ne).add(H(this,dr).align(H(this,Ne).align)),H(this,Ne).add(H(this,dr).qrcode(t,o)),H(this,Ne).align!=="left"&&H(this,Ne).add(H(this,dr).align("left")),H(this,Ne).flush({forceFlush:!0,ignoreAlignment:!0}),this)}pdf417(t,r){if(r=Object.assign({width:3,height:3,columns:0,rows:0,errorlevel:1,truncated:!1},r||{}),H(this,_t).embedded)throw new Error("PDF417 codes are not supported in table cells or boxes");return H(this,Dr).pdf417.supported===!1?typeof H(this,Dr).pdf417.fallback=="object"?this.barcode(t,H(this,Dr).pdf417.fallback.symbology):Yn(this,Ds,Sl).call(this,"PDF417 codes are not supported by this printer","relaxed"):(H(this,Ne).flush({forceFlush:!0,ignoreAlignment:!0}),H(this,Ne).align!=="left"&&H(this,Ne).add(H(this,dr).align(H(this,Ne).align)),H(this,Ne).add(H(this,dr).pdf417(t,r)),H(this,Ne).align!=="left"&&H(this,Ne).add(H(this,dr).align("left")),H(this,Ne).flush({forceFlush:!0,ignoreAlignment:!0}),this)}image(t,r,n,i,o){if(H(this,_t).embedded)throw new Error("Images are not supported in table cells or boxes");if(r%8!=0)throw new Error("Width must be a multiple of 8");if(n%8!=0)throw new Error("Height must be a multiple of 8");i===void 0&&(i="threshold"),o===void 0&&(o=128);const s=t.constructor.name;let a,l;if(s.endsWith("Element")&&(a="element"),s=="ImageData"&&(a="imagedata"),s=="Canvas"&&t.getContext!==void 0&&(a="node-canvas"),s=="Image"&&(a="node-canvas-image"),s=="Image"&&t.frames!==void 0&&(a="node-read-image"),s=="Object"&&t.data&&t.info&&(a="node-sharp"),s=="View3duint8"&&t.data&&t.shape&&(a="ndarray"),s=="Object"&&t.data&&t.width&&t.height&&(a="object"),!a)throw new Error("Could not determine the type of image input");if(a=="element"){const d=document.createElement("canvas");d.width=r,d.height=n;const u=d.getContext("2d");u.drawImage(t,0,0,r,n),l=u.getImageData(0,0,r,n)}if(a=="node-canvas"&&(l=t.getContext("2d").getImageData(0,0,t.width,t.height)),a=="node-canvas-image"){if(typeof H(this,_t).createCanvas!="function")throw new Error("Canvas is not supported in this environment, specify a createCanvas function in the options");const d=H(this,_t).createCanvas(r,n).getContext("2d");d.drawImage(t,0,0,r,n),l=d.getImageData(0,0,r,n)}if(a=="node-read-image"&&(l=new Vp(t.width,t.height),l.data.set(t.frames[0].data)),a=="node-sharp"&&(l=new Vp(t.info.width,t.info.height),l.data.set(t.data)),a=="ndarray"&&(l=new Vp(t.shape[0],t.shape[1]),l.data.set(t.data)),a=="object"&&(l=new Vp(t.width,t.height),l.data.set(t.data)),a=="imagedata"&&(l=t),!l)throw new Error("Image could not be loaded");if(r===l.width&&n===l.height||(l=Tne(l,r,n,"bilinear-interpolation")),r!==l.width||n!==l.height)throw new Error("Image could not be resized");switch(l=xne.flatten(l,[255,255,255]),i){case"threshold":l=Bp.threshold(l,o);break;case"bayer":l=Bp.bayer(l,o);break;case"floydsteinberg":l=Bp.floydsteinberg(l);break;case"atkinson":l=Bp.atkinson(l)}return H(this,Ne).flush({forceFlush:!0,ignoreAlignment:!0}),H(this,Ne).align!=="left"&&H(this,Ne).add(H(this,dr).align(H(this,Ne).align)),H(this,Ne).add(H(this,dr).image(l,r,n,H(this,_t).imageMode)),H(this,Ne).align!=="left"&&H(this,Ne).add(H(this,dr).align("left")),H(this,Ne).flush({forceFlush:!0,ignoreAlignment:!0}),this}cut(t){if(H(this,_t).embedded)throw new Error("Cut is not supported in table cells or boxes");for(let r=0;r<H(this,_t).feedBeforeCut;r++)H(this,Ne).flush({forceNewline:!0});return H(this,Ne).flush({forceFlush:!0,ignoreAlignment:!0}),H(this,Ne).add(H(this,dr).cut(t)),H(this,Ne).flush({forceFlush:!0,ignoreAlignment:!0}),this}pulse(t,r,n){if(H(this,_t).embedded)throw new Error("Pulse is not supported in table cells or boxes");return H(this,Ne).flush({forceFlush:!0,ignoreAlignment:!0}),H(this,Ne).add(H(this,dr).pulse(t,r,n)),H(this,Ne).flush({forceFlush:!0,ignoreAlignment:!0}),this}raw(t){return H(this,Ne).raw(t),this}commands(){H(this,_t).autoFlush&&!H(this,_t).embedded&&H(this,Ne).add(H(this,dr).flush());const t=[],r=H(this,Ne).fetch({forceFlush:!0,ignoreAlignment:!0});for(r.length&&H(this,Oa).push(r);H(this,Oa).length;){const n=H(this,Oa).shift(),i=n.filter(o=>o.type==="style"&&o.property==="size").map(o=>o.value.height).reduce((o,s)=>Math.max(o,s),1);H(this,_t).debug&&console.log("|"+n.filter(o=>o.type==="text").map(o=>o.value).join("")+"|",i),t.push({commands:n,height:i})}return H(this,_t).debug&&console.log("commands",t),Yn(this,kf,xy).call(this),t}encode(t){const r=this.commands();if(t==="commands")return r;const n=[];for(const s of r){const a=[];for(const l of s.commands)l.type==="text"?a.push(...Yn(this,Pm,pI).call(this,l.value,l.codepage)):l.type==="style"?a.push(Object.assign(l,{payload:Yn(this,Im,fI).call(this,l.property,l.value)})):(l.value||l.payload)&&a.push(l);n.push(a)}if(t==="lines")return n;let i=[],o=null;for(const s of n){for(const a of s)i.push(...a.payload),o=a;H(this,_t).newline===` 136\r`&&i.push(10,13),H(this,_t).newline===` 137`&&i.push(10)}return o&&o.type==="pulse"&&(i=i.slice(0,0-H(this,_t).newline.length)),Uint8Array.from(i)}static get printerModels(){return Object.entries(B2).map(t=>({id:t[0],name:t[1].vendor+" "+t[1].model}))}get columns(){return H(this,Ne).columns}get language(){return H(this,_t).language}get printerCapabilities(){return H(this,Dr)}},_t=new WeakMap,Oa=new WeakMap,dr=new WeakMap,Ne=new WeakMap,Dr=new WeakMap,Zi=new WeakMap,Cu=new WeakMap,Ls=new WeakMap,$s=new WeakMap,kf=new WeakSet,xy=function(){Qt(this,Oa,[]),Qt(this,Ls,H(this,_t).language=="esc-pos"?"cp437":"star/standard"),H(this,$s).codepage=0,H(this,$s).font="A"},Im=new WeakSet,fI=function(t,r){return t==="bold"?H(this,dr).bold(r):t==="underline"?H(this,dr).underline(r):t==="italic"?H(this,dr).italic(r):t==="invert"?H(this,dr).invert(r):t==="size"?H(this,dr).size(r.width,r.height):void 0},Pm=new WeakSet,pI=function(t,r){if(r===null)return[{type:"text",payload:[...is.encode(t,"ascii")]}];if(r!=="auto"){const o=is.encode(t,r);return H(this,$s).codepage!=H(this,Zi)[r]?(H(this,$s).codepage=H(this,Zi)[r],[{type:"codepage",payload:H(this,dr).codepage(H(this,Zi)[r])},{type:"text",payload:[...o]}]):[{type:"text",payload:[...o]}]}const n=is.autoEncode(t,H(this,Cu)),i=[];for(const o of n)H(this,$s).codepage=H(this,Zi)[o.codepage],i.push({type:"codepage",payload:H(this,dr).codepage(H(this,Zi)[o.codepage])}
137,{type:"text",payload:[...o.bytes]});return i},Ds=new WeakSet,Sl=function(t,r){if(r==="strict"||H(this,_t).errors==="strict")throw new Error(t);return console.warn(t),this},Yu);const vg=Kr("Preferences",{web:()=>X(()=>import("./web-DYxq1Poh.js"),__vite__mapDeps([13,1,2,3,4,5,6])).then(e=>new e.PreferencesWeb)});function tn(e){if(!e)return e;const t={á:"a",à :"a",â:"a",ã:"a",é:"e",è:"e",ê:"e",Ã:"i",ì:"i",î:"i",ó:"o",ò:"o",ô:"o",õ:"o",ú:"u",ù:"u",û:"u",ç:"c",Ã:"A",Ã:"A",Ã:"A",Ã:"A",Ã:"E",Ã:"E",Ã:"E",Ã:"I",Ã:"I",Ã:"I",Ã:"O",Ã:"O",Ã:"O",Ã:"O",Ã:"U",Ã:"U",Ã:"U",Ã:"C"};return e.replace(/[áà âãéèêÃìîóòôõúùûçÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃ]/g,r=>t[r]||r)}function H1(e){if(!e)return e;const t={...e};return t.nome_destinatario&&(t.nome_destinatario=tn(t.nome_destinatario)),t.nome&&(t.nome=tn(t.nome)),t.logradouro&&(t.logradouro=tn(t.logradouro)),t.complemento&&(t.complemento=tn(t.complemento)),t.bairro&&(t.bairro=tn(t.bairro)),t.localidade&&(t.localidade=tn(t.localidade)),t}const One={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-4
1376-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:48|5[0-3579]|[6-9])|7(?:20|32|8)|[89]","(?:31|4)6|51|6(?:485|5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:241|349)0\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|[34]\\d\\d)|91(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79]))))\\d{3}|(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8])|8(?:55|6[0-8]|[78]\\d|9[02-9]))\\d{6}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|2[23]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","(?:[025-7]\\d|44)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[024-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","(?:01\\d|8)\\d{7}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["0"]]]],BL:["590","00","(?:590\\d|7090)\\d{5}|(?:69|[89]\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80\\d{7}"],["8[129]\\d{7}"]
vendor: 9,237 bytes, line 137
137,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","8001\\d{5}|(?:[2-467]\\d|50)\\d{6}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[235]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","[1-467]\\d{9,10}|55[0-46-9]\\d{8}|[34]\\d{7}|55\\d{7,8}|(?:5[0-46-9]|[89]\\d)\\d{7,9}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37|86)","300|4(?:0(?:0|20)|370|864)"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[178]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-6]|7[246]|8[2-4]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|[78]"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","[2-9]\\d{9}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|5[07]|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|3[23]|44|66|77|88)|6(?:22|33))[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["5"],"0$1"]],"0"],CF:["236","00","8776\\d{4}|(?:[27]\\d|61)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-8]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["60|809"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9(?:10|[2-9])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-8]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]","(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4}
vendor: 4,511 bytes, line 137
137)","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["46"]],["(\\d{3})(\\d{7})","$1 $2",["6|90"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|9[14]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9,10,11,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|3[13])"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8}
vendor: 6,622 bytes, line 137
137)","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,0,[["528[89]\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[016-8]\\d|2[0-8]|5[0-5]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],ET:["251","00","(?:11|[2-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,"0|180020",0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-5])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|5[01]))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","
1377093\\d{5}|(?:[56]94|[89]\\d\\d)\\d{6}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]|80[6-9]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0|180020","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","(?:590\\d|7090)\\d{5}|(?:69|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80\\d{7}"],["8[129]\\d{7}"]
vendor: 15,374 bytes, line 137
137,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","[2-69]\\d{8}|80\\d{5,7}|[1-79]\\d{7}|6\\d{6}",[7,8,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","[2-589]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13,14,15,16,17],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0|180020","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|8(?:28[235-7]|3))|73179|807(?:1|9[1-3])|(?:1552|6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689])\\d|8(?:[14-6]\\d|2[0-79]))|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["16|[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["18[06]","18[06]0"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,11}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11,12],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[03]"]]],0,0,0,0,0,0,[["0(?:669[0-79]\\d{1,6}|831\\d{2,8})|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[2356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0|180020","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|427|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[47]"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]","3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[25-9]"],"0$1"]],"0",0,"(000[2569]\\d{4,6})$|(?:(?:003768)0?)|0","$1"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[36]0|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","
1378\\d{13}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["3"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-6]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[2457]\\d|33|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(0-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"0 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(0-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(0-$1)",1]],"0",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["20"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["20"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|78|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2679]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{4})(\\d{5})","$1-$2",["892"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8(?:0[0-7]|9)"],"0$1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[5-8]"],"0$1"]],"0",0,0,0,0,"[5-8]"],MC:["377","00","(?:[3489]|[67]\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[67]"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","(?:590\\d|7090)\\d{5}|(?:69|[89]\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80\\d{7}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|452|678|86","[12]|452|6788|86"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","(?:596\\d|7091)\\d{5}|(?:69|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|8(?:0[6-9]|[36])"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],MX:["52","0[09]","[2-9]\\d{9}",[10],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"]]],0,0,0,0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[0467]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","(?:20|9\\d)\\d{8}|[78]\\d{9,13}",[10,11,12,13,14],[["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:222|444|(?:55|8\\d)\\d|666|777|999)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[24-9]"]]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}
137(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[78]\\d{8}|[2-9]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[2-9
vendor: 19,956 bytes, line 137
137]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","[36-8]\\d{5,8}|4\\d{6,8}|59\\d{6}|9\\d{5,10}|(?:2\\d|5[0-8])\\d{6,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["3[289]|4[246-8]|61|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[136]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","709\\d{6}|(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"],"0$1"]],"0",0,0,0,0,0,[["26(?:2\\d\\d|3(?:0\\d|1[0-6]))\\d{4}"],["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[0-3]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-6]|76(?:2[278]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"[3489]",0,"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],SA:["966","00","(?:[15]\\d|800|92)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","[6-9]\\d{6}|[1-6]\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","(?:[2489]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10,12],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["(?:2|90)4|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[348]|64|79|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[0-35-9]|7[67]|9[2-9]"]]],"0"],SR:["597","00","(?:[2-5]|[6-8]\\d|90)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-9]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[25-7]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[25-7]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-359]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-4]|5[1-3]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[59]"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|30|[689]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[236-9]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","(?:[0-57-9]\\d|66)\\d{7}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3(?:[1245]|3[12])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["\\d"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","(?:[1-6]\\d|71)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["[67]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-579]|61)","5(?:[0-579]|61[06])","5(?:[0-579]|61[06]1)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["(?:274[27]|(?:472|983)[2-47-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[013-79]|3[0-24679]|4[167]|5[0-3]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-247]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|2\\d{3,4}|(?:[49]\\d|80)\\d{5}",[4,5,6,7,8,9,10,11,12,13],[["(\\d{4,5})","$1",["21"]],["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","00","(?:20|33|[5-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"]]]],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11,12],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[47-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}",[8,9,10,11,12],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2|39"],"0$1"],["(\\d{2})(\\d{7,10})","$1 $2",["3"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","7093\\d{5}|(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,0,[["269(?:0[0-467]|15|5[0-4]|6\\d|[78]0)\\d{4}"],["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|[579]\\d|63)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[579]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[235-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"],0,0,0,0,0,0,["2\\d{8}",[9]]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|5[12]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|5(?:0\\d{3}|2[0-2]))\\d{7}",[7,8,9,10,12]],0,0,0,["348[57]\\d{7}",[11]],0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function
vendor: 8,372 bytes, line 137
137jne(e,t){var r=Array.prototype.slice.call(t);return r.push(One),e.apply(this,r)}function D8(e,t){e=e.split("-"),t=t.split("-");for(var r=e[0].split("."),n=t[0].split("."),i=0;i<3;i++){var o=Number(r[i]),s=Number(n[i]);if(o>s)return 1;if(s>o)return-1;if(!isNaN(o)&&isNaN(s))return 1;if(isNaN(o)&&!isNaN(s))return-1}return e[1]&&t[1]?e[1]>t[1]?1:e[1]<t[1]?-1:0:!e[1]&&t[1]?1:e[1]&&!t[1]?-1:0}var Lne={}.constructor;function vu(e){return e!=null&&e.constructor===Lne}function Bu(e){"@babel/helpers - typeof";return Bu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bu(e)}function yg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function M8(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$ne(n.key),n)}}function _g(e,t,r){return t&&M8(e.prototype,t),r&&M8(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function $ne(e){var t=Dne(e,"string");return Bu(t)=="symbol"?t:t+""}function Dne(e,t){if(Bu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Bu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Mne="1.2.0",Nne="1.7.35",N8=" ext. ",Fne=/^\d+$/,Gn=function(){function e(t){yg(this,e),mI(t),this.metadata=t,gI.call(this,t)}return _g(e,[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter(function(r){return r!=="001"})}},{key:"getCountryMetadata",value:function(r){return this.metadata.countries[r]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(r){return this.getCountryMetadata(r)!==void 0}},{key:"hasCallingCode",value:function(r){if(this.getCountryCodesForCallingCode(r))return!0;if(this.nonGeographic()){if(this.nonGeographic()[r])return!0}else{var n=this.countryCallingCodes()[r];if(n&&n.length===1&&n[0]==="001")return!0}}},{key:"isNonGeographicCallingCode",value:function(r){return this.nonGeographic()?!!this.nonGeographic()[r]:!this.getCountryCodesForCallingCode(r)}},{key:"country",value:function(r){return this.selectNumberingPlan(r)}},{key:"selectNumberingPlan",value:function(r,n){if(r&&Fne.test(r)&&(n=r,r=null),r&&r!=="001"){if(!this.hasCountry(r))throw new Error("Unknown country: ".concat(r));this.numberingPlan=new F8(this.getCountryMetadata(r),this)}else if(n){if(!this.hasCallingCode(n))throw new Error("Unknown calling code: ".concat(n));this.numberingPlan=new F8(this.getNumberingPlanMetadata(n),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(r){var n=this.countryCallingCodes()[r];if(n)return n.length===1&&n[0].length===3?void 0:n}},{key:"getCountryCodeForCallingCode",value:function(r){var n=this.getCountryCodesForCallingCode(r);if(n)return n[0]}},{key:"getNumberingPlanMetadata",value:function(r){var n=this.getCountryCodeForCallingCode(r);if(n)return this.getCountryMetadata(n);if(this.nonGeographic()){var i=this.nonGeographic()[r];if(i)return i}else{var o=this.countryCallingCodes()[r];if(o&&o.length===1&&o[0]==="001")return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(r){return this.numberingPlan.type(r)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(r){return this.selectNumberingPlan(r)}},{key:"hasSelectedNumberingPlan",value:function(){return this.numberingPlan!==void 0}}])}(),F8=function(){function e(t,r){yg(this,e),this.globalMetadataObject=r,this.metadata=t,gI.call(this,r.metadata)}return _g(e,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"IDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(r){return r[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var r=this,n=this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[];return n.map(function(i){return new Une(i,r)})}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(r){return r[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return this.types()&&this.types().length===0?!1:!!this.types()}},{key:"type",value:function(r){if(this.hasTypes()&&U8(this.types(),r))return new Vne(U8(this.types(),r),this)}},{key:"ext",value:function(){return this.v1||this.v2?N8:this.metadata[13]||N8}}])}(),Une=function(){function e(t,r){yg(this,e),this._format=t,this.metadata=r}return _g(e,[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!!(this.nationalPrefixFormattingRule()&&!Bne.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}])}(),Bne=/^\(?\$1\)?$/,Vne=function(){function e(t,r){yg(this,e),this.type=t,this.metadata=r}return _g(e,[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.t
137ype[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}])}();function U8(e,t){switch(t){case"FIXED_LINE":return e[0];case"MOBILE":return e[1];case"TOLL_FREE":return e[2];case"PREMIUM_RATE":return e[3];case"PERSONAL_NUMBER":return e[4];case"VOICEMAIL":return e[5];case"UAN":return e[6];case"PAGER":return e[7];case"VOIP":return e[8];case"SHARED_COST":return e[9]}}function mI(e){if(!e)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!vu(e)||!vu(e.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(vu(e)?"an object of shape: { "+Object.keys(e).join(", ")+" }":"a "+Hne(e)+": "+e,"."))}var Hne=function(t){return Bu(t)};function e3(e,t){if(t=new Gn(t),t.hasCountry(e))return t.selectNumberingPlan(e).countryCallingCode();throw new Error("Unknown country: ".concat(e))}function gI(e){var t=e.version;typeof t=="number"?(this.v1=t===1,this.v2=t===2,this.v3=t===3,this.v4=t===4):t?D8(t,Mne)===-1?this.v2=!0:D8(t,Nne)===-1?this.v3=!0:this.v4=!0:this.v1=!0}function zne(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=Wne(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 138In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wne(e,t){if(e){if(typeof e=="string")return B8(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?B8(e,t):void 0}}function B8(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function qne(e,t){for(var r=e.slice(),n=zne(t),i;!(i=n()).done;){var o=i.value;e.indexOf(o)<0&&r.push(o)}return r.sort(function(s,a){return s-a})}function t3(e,t,r){return vI(e,t,void 0,r)}function vI(e,t,r,n){t&&(n=new Gn(n.metadata),n.selectNumberingPlan(t));var i=n.type(r),o=i&&i.possibleLengths()||n.possibleLengths();if(!o)return"IS_POSSIBLE";if(r==="FIXED_LINE_OR_MOBILE"){if(!n.type("FIXED_LINE"))return vI(e,t,"MOBILE",n);var s=n.type("MOBILE");s&&(o=qne(o,s.possibleLengths()))}else if(r&&!i)return"INVALID_LENGTH";var a=e.length,l=o[0];return l===a?"IS_POSSIBLE":l>a?"TOO_SHORT":o[o.length-1]<a?"TOO_LONG":o.indexOf(a,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}function Gne(e,t,r){if(t===void 0&&(t={}),r=new Gn(r),t.v2){if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(e.countryCallingCode)}else{if(!e.phone)return!1;if(e.country){if(!r.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));r.selectNumberingPlan(e.country)}else{if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(e.countryCallingCode)}}if(r.possibleLengths())return yI(e.phone||e.nationalNumber,e.country,r);if(e.countryCallingCode&&r.isNonGeographicCallingCode(e.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}function yI(e,t,r){switch(t3(e,t,r)){case"IS_POSSIBLE":return!0;default:return!1}}function Qs(e,t){return e=e||"",new RegExp("^(?:"+t+")$").test(e)}function Kne(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=Yne(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 139In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yne(e,t){if(e){if(typeof e=="string")return V8(e,t);var r={}.toString.call(e).slice(8,-1);
vendor: 20,797 bytes, lines 139-141
139return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?V8(e,t):void 0}}function V8(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var Zne=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function r3(e,t,r){if(t=t||{},!(!e.country&&!e.countryCallingCode)){r=new Gn(r),r.selectNumberingPlan(e.country,e.countryCallingCode);var n=t.v2?e.nationalNumber:e.phone;if(Qs(n,r.nationalNumberPattern())){if(V2(n,"FIXED_LINE",r))return r.type("MOBILE")&&r.type("MOBILE").pattern()===""||!r.type("MOBILE")||V2(n,"MOBILE",r)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE";for(var i=Kne(Zne),o;!(o=i()).done;){var s=o.value;if(V2(n,s,r))return s}}}}function V2(e,t,r){var n=r.type(t);return!n||!n.pattern()||n.possibleLengths()&&n.possibleLengths().indexOf(e.length)<0?!1:Qs(e,n.pattern())}function Xne(e,t,r){if(t=t||{},r=new Gn(r),r.selectNumberingPlan(e.country,e.countryCallingCode),r.hasTypes())return r3(e,t,r.metadata)!==void 0;var n=t.v2?e.nationalNumber:e.phone;return Qs(n,r.nationalNumberPattern())}function Jne(e,t,r){var n=new Gn(r),i=n.getCountryCodesForCallingCode(e);return i?i.filter(function(o){return Qne(t,o,r)}):[]}function Qne(e,t,r){var n=new Gn(r);return n.selectNumberingPlan(t),n.numberingPlan.possibleLengths().indexOf(e.length)>=0}var n3=2,eie=17,tie=3,Po="0-9ï¼-ï¼Ù -Ù©Û°-Û¹",rie="-â-ââã¼ï¼",nie="ï¼/",iie="ï¼.",oie="  Âââ ã",sie="()ï¼ï¼ï¼»ï¼½\\[\\]",aie="~ââ¼ï½",z1="".concat(rie).concat(nie).concat(iie).concat(oie).concat(sie).concat(aie),i3="+ï¼",lie=new RegExp("(["+Po+"])");function cie(e,t,r,n){if(t){var i=new Gn(n);i.selectNumberingPlan(t,r);var o=new RegExp(i.IDDPrefix());if(e.search(o)===0){e=e.slice(e.match(o)[0].length);var s=e.match(lie);if(!(s&&s[1]!=null&&s[1].length>0&&s[1]==="0"))return e}}}function uie(e,t){if(e&&t.numberingPlan.nationalPrefixForParsing()){var r=new RegExp("^(?:"+t.numberingPlan.nationalPrefixForParsing()+")"),n=r.exec(e);if(n){var i,o,s=n.length-1,a=s>0&&n[s];if(t.nationalPrefixTransformRule()&&a)i=e.replace(r,t.nationalPrefixTransformRule()),s>1&&(o=n[1]);else{var l=n[0];i=e.slice(l.length),a&&(o=n[1])}var d;if(a){var u=e.indexOf(n[1]),h=e.slice(0,u);h===t.numberingPlan.nationalPrefix()&&(d=t.numberingPlan.nationalPrefix())}else d=n[0];return{nationalNumber:i,nationalPrefix:d,carrierCode:o}}}return{nationalNumber:e}}function die(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=hie(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 140In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hie(e,t){if(e){if(typeof e=="string")return H8(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?H8(e,t):void 0}}function H8(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function fie(e,t){var r=t.countries,n=t.metadata;n=new Gn(n);for(var i=die(r),o;!(o=i()).done;){var s=o.value;if(n.selectNumberingPlan(s),n.leadingDigits()){if(e&&e.search(n.leadingDigits())===0)return s}else if(r3({phone:e,country:s},void 0,n.metadata))return s}}var pie=!1;function _I(e,t){var r=t.nationalNumber,n=t.metadata;if(pie&&n.isNonGeographicCallingCode(e))return"001";var i=n.getCountryCodesForCallingCode(e);if(i)return i.length===1?i[0]:fie(r,{countries:i,metadata:n.metadata})}function wy(e,t,r){var n=uie(e,r),i=n.carrierCode,o=n.nationalNumber;if(o!==e){if(!mie(e,o,r))return{nationalNumber:e};if(r.numberingPlan.possibleLengths()&&(t||(t=_I(r.numberingPlan.callingCode(),{nationalNumber:o,metadata:r})),!gie(o,t,r)))return{nationalNumber:e}}return{nationalNumber:o,carrierCode:i}}function mie(e,t,r){return!(Qs(e,r.nationalNumberPattern())&&!Qs(t,r.nationalNumberPattern()))}function gie(e,t,r){switch(t3(e,t,r)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}function vie(e,t,r,n,i){var o=t||r?e3(t||r,i):n;if(e.indexOf(o)===0){i=new Gn(i),i.selectNumberingPlan(t||r,o);var s=e.slice(o.length),a=wy(s,t,i),l=a.nationalNumber,d=wy(e,t,i),u=d.nationalNumber;if(!Qs(u,i.nationalNumberPattern())&&Qs(l,i.nationalNumberPattern())||t3(u,t,i)==="TOO_LONG")return{countryCallingCode:o,number:s}}return{number:e}}function bI(e,t,r,n,i){if(!e)return{};var o;if(e[0]!=="+"){var s=cie(e,t||r,n,i);if(s&&s!==e)o=!0,e="+"+s;else{if(t||r||n){var a=vie(e,t,r,n,i),l=a.countryCallingCode,d=a.number;if(l)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:l,number:d}}return{number:e}}}if(e[1]==="0")return{};i=new Gn(i);for(var u=2;u-1<=tie&&u<=e.length;){var h=e.slice(1,u);if(i.hasCallingCode(h))return i.selectNumberingPlan(h),{countryCallingCodeSource:o?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:h,number:e.slice(u)};u++}return{}}function yie(e){return e.replace(new RegExp("[".concat(z1,"]+"),"g")," ").trim()}var _ie=/(\$\d)/;function bie(e,t,r){var n=r.useInternationalFormat,i=r.withNationalPrefix;r.carrierCode,r.metadata;var o=e.replace(new RegExp(t.pattern()),n?t.internationalFormat():i&&t.nationalPrefixFormattingRule()?t.format().replace(_ie,t.nationalPrefixFormattingRule()):t.format());return n?yie(o):o}var xie=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function wie(e,t,r){var n=new Gn(r);if(n.selectNumberingPlan(e,t),n.defaultIDDPrefix())return n.defaultIDDPrefix();if(xie.test(n.IDDPrefix()))return n.IDDPrefix()}var Eie=";ext=",Uc=function(t){return"([".concat(Po,"]{1,").concat(t,"})")};function xI(e){var t="20",r="15",n="9",i="6",o="[  \\t,]*",s="[:\\.ï¼]?[  \\t,-]*",a="#?",l="(?:e?xt(?:ensi(?:oÌ?|ó))?n?|ï½ ?ï½ï½ï½?|доб|anexo)",d="(?:[xï½#ï¼~ï½]|int|ï½ï½ï½)",u="[- ]+",h="[  \\t]*",f="(?:,{2}|;)",p=Eie+Uc(t),m=o+l+s+Uc(t)+a,g=o+d+s+Uc(n)+a,y=u+Uc(i)+"#",b=h+f+s+Uc(r)+a,E=h+"(?:,)+"+s+Uc(n)+a;return p+"|"+m+"|"+g+"|"+y+"|"+b+"|"+E}var Sie="["+Po+"]{"+n3+"}",Cie="["+i3+"]{0,1}(?:["+z1+"]*["+Po+"]){3,}["+z1+Po+"]*",Tie=new RegExp("^["+i3+"]{0,1}(?:["+z1+"]*["+Po+"]){1,2}$","i"),Aie=Cie+"(?:"+xI()+")?",kie=new RegExp("^"+Sie+"$|^"+Aie+"$","i");function Rie(e){return e.length>=n3&&kie.test(e)}function Iie(e){return Tie.test(e)}function Pie(e){var t=e.number,r=e.ext;if(!t)return"";if(t[0]!=="+")throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(t).concat(r?";ext="+r:"")}var z8={formatExtension:function(t,r,n){return"".concat(t).concat(n.ext()).concat(r)}};function Oie(e,t,r,n){if(r?r=$ie({},z8,r):r=z8,n=new Gn(n),e.country&&e.country!=="001"){if(!n.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));n.selectNumberingPlan(e.country)}else if(e.countryCallingCode)n.selectNumberingPlan(e.countryCallingCode);else return e.phone||"";var i=n.countryCallingCode(),o=r.v2?e.nationalNumber:e.phone,s;switch(t){case"NATIONAL":return o?(s=W1(o,e.carrierCode,"NATIONAL",n,r),H2(s,e.ext,n,r.formatExtension)):"";case"INTERNATIONAL":return o?(s=W1(o,null,"INTERNATIONAL",n,r),s="+".concat(i," ").concat(s),H2(s,e.ext,n,r.formatExtension)):"+".concat(i);case"E.164":return"+".concat(i).concat(o);case"RFC3966":return Pie({number:"+".concat(i).concat(o),ext:e.ext});case"IDD":if(!r.fromCountry)return;var a=Lie(o,e.carrierCode,i,r.fromCountry,n);return a?H2(a,e.ext,n,r.formatExtension):void 0;default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(t,'"'))}}function W1(e,t,r,n,i){var o=jie(n.formats(),e);return o?bie(e,o,{useInternationalFormat:r==="INTERNATIONAL",withNationalPrefix:!(o.nationalPrefixIsOptionalWhenFormattingInNationalFormat()&&i&&i.nationalPrefix===!1),carrierCode:t,metadata:n}):e}function jie(e,t){return Die(e,function(r){if(r.leadingDigitsPatterns().length>0){var n=r.leadingDigitsPatterns()[r.leadingDigitsPatterns().length-1];if(t.search(n)!==0)return!1}return Qs(t,r.pattern())})}function H2(e,t,r,n){return t?n(e,t,r):e}function Lie(e,t,r,n,i){var o=e3(n,i.metadata);if(o===r){var s=W1(e,t,"NATIONAL",i);return r==="1"?r+" "+s:s}var a=wie(n,void 0,i.metadata);if(a)return"".concat(a," ").concat(r," ").concat(W1(e,null,"INTERNATIONAL",i))}function $ie(){for(var e=1,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];for(;e<r.length;){if(r[e])for(var i in r[e])r[0][i]=r[e][i];e++}return r[0]}function Die(e,t){for(var r=0;r<e.length;){if(t(e[r]))return e[r];r++}}function sf(e){"@babel/helpers - typeof";return sf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sf(e)}function W8(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function q8(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?W8(Object(r),!0).forEach(function(n){Mie(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):W8(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Mie(e,t,r){return(t=wI(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function G8(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,wI(n.key),n)}}function Fie(e,t,r){return t&&G8(e.prototype,t),r&&G8(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function wI(e){var t=Uie(e,"string");return sf(t)=="symbol"?t:t+""}function Uie(e,t){if(sf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(sf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Bie=function(){function e(t,r,n){if(Nie(this,e),!t)throw new TypeError("First argument is required");if(typeof t!="string")throw new TypeError("First argument must be a string");if(t[0]==="+"&&!r)throw new TypeError("`metadata` argument not passed");if(vu(r)&&vu(r.countries)){n=r;var i=t;if(!zie.test(i))throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var o=bI(i,void 0,void 0,void 0,n),s=o.countryCallingCode,a=o.number;if(r=a,t=s,!r)throw new Error("Invalid `number` argument passed: too short")}if(!r)throw new TypeError("`nationalNumber` argument is required");if(typeof r!="string")throw new TypeError("`nationalNumber` argument must be a string");mI(n);var l=Hie(t,n),d=l.country,u=l.countryCallingCode;this.country=d,this.countryCallingCode=u,this.nationalNumber=r,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return n}}return Fie(e,[{key:"setExt",value:function(r){this.ext=r}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:Jne(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return Gne(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return Xne(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){var r=new Gn(this.getMetadata());return r.isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(r){return this.number===r.number&&this.ext===r.ext}},{key:"getType",value:function(){return r3(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(r,n){return Oie(this,r,n?q8(q8({},n),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(r){return this.format("NATIONAL",r)}},{key:"formatInternational",value:function(r){return this.format("INTERNATIONAL",r)}},{key:"getURI",value:function(r){return this.format("RFC3966",r)}}])}(),Vie=function(t){return/^[A-Z]{2}$/.test(t)};function Hie(e,t){var r,n,i=new Gn(t);return Vie(e)?(r=e,i.selectNumberingPlan(r),n=i.countryCallingCode()):n=e,{country:r,countryCallingCode:n}}var zie=/^\+\d+$/;function Vu(e){"@babel/helpers - typeof";return Vu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vu(e)}function K8(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,qie(n.key),n)}}function Wie(e,t,r){return t&&K8(e.prototype,t),r&&K8(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function qie(e){var t=Gie(e,"string");return Vu(t)=="symbol"?t:t+""}function Gie(e,t){if(Vu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Vu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Kie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yie(e,t,r){return t=lf(t),Zie(e,o3()?Reflect.construct(t,r||[],lf(e).constructor):t.apply(e,r))}function Zie(e,t){if(t&&(Vu(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xie(e)}function Xie(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Jie(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&af(e,t)}function Ey(e){var t=typeof Map=="function"?new Map:void 0;return Ey=function(n){if(n===null||!eoe(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(n))return t.get(n);t.set(n,i)}function i(){return Qie(n,arguments,lf(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),af(i,n)},Ey(e)}function Qie(e,t,r){if(o3())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var i=new(e.bind.apply(e,n));return r&&af(i,r.prototype),i}function o3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(o3=function(){return!!e})()}function eoe(e){try{return Function.toString.call(e).indexOf("[native code]")!==-1}catch{return typeof e=="function"}}function af(e,t){return af=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},af(e,t)}function lf(e){return lf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},lf(e)}var ka=function(e){function t(r){var n;return Kie(this,t),n=Yie(this,t,[r]),Object.setPrototypeOf(n,t.prototype),n.name=n.constructor.name,n}return Jie(t,e),Wie(t)}(Ey(Error)),Y8=new RegExp("(?:"+xI()+")$","i");function toe(e){var t=e.search(Y8);if(t<0)return{};for(var r=e.slice(0,t),n=e.match(Y8),i=1;i<n.length;){if(n[i])return{number:r,ext:n[i]};i++}}var roe={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","ï¼":"0","ï¼":"1","ï¼":"2","ï¼":"3","ï¼":"4","ï¼":"5","ï¼":"6","ï¼":"7","ï¼":"8","ï¼":"9","Ù ":"0","Ù¡":"1","Ù¢":"2","Ù£":"3","Ù¤":"4","Ù¥":"5","Ù¦":"6","Ù§":"7","Ù¨":"8","Ù©":"9","Û°":"0","Û±":"1","Û²":"2","Û³":"3","Û´":"4","Ûµ":"5","Û¶":"6","Û·":"7","Û¸":"8","Û¹":"9"};function noe(e){return roe[e]}function ioe(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=ooe(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 141In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ooe(e,t){if(e){if(typeof e=="string")return Z8(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Z8(e,t):void 0}}function Z8(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function X8(e){for(var t="",r=ioe(e.split("")),n;!(n=r()).done;){var i=n.value;t+=soe(i,t)||""}return t}function soe(e,t,r){if(e==="+"){if(t){typeof r=="function"&&r("end");return}return"+"}return noe(e)}var EI="+",aoe="[\\-\\.\\(\\)]?",J8="(["+Po+"]|"+aoe+")",loe="^\\"+EI+J8+"*["+Po+"]"+J8+"*$",coe=new RegExp(loe,"g"),Sy=Po,uoe="["+Sy+"]+((\\-)*["+Sy+"])*",doe="a-zA-Z",hoe="["+doe+"]+((\\-)*["+Sy+"])*",foe="^("+uoe+"\\.)*"+hoe+"\\.?$",poe=new RegExp(foe,"g"),Q8="tel:",Cy=";phone-context=",moe=";isub=";function goe(e){var t=e.indexOf(Cy);if(t<0)return null;var r=t+Cy.length;if(r>=e.length)return"";var n=e.indexOf(";",r);return n>=0?e.substring(r,n):e.substring(r)}function voe(e){return e===null?!0:e.length===0?!1:coe.test(e)||poe.test(e)}function yoe(e,t){var r=t.extractFormattedPhoneNumber,n=goe(e);if(!voe(n))throw new ka("NOT_A_NUMBER");var i;if(n===null)i=r(e)||"";else{i="",n.charAt(0)===EI&&(i+=n);var o=e.indexOf(Q8),s;o>=0?s=o+Q8.length:s=0;var a=e.indexOf(Cy);i+=e.substring(s,a)}var l=i.indexOf(moe);if(l>0&&(i=i.substring(0,l)),i!=="")return i}var _oe=250,boe=new RegExp("["+i3+Po+"]"),xoe=new RegExp("[^"+Po+"#]+$");function woe(e,t,r){if(t=t||{},r=new Gn(r),t.defaultCountry&&!r.hasCountry(t.defaultCountry))throw t.v2?new ka("INVALID_COUNTRY"):new Error("Unknown country: ".concat(t.defaultCountry));var n=Soe(e,t.v2,t.extract),i=n.number,o=n.ext,s=n.error;if(!i){if(t.v2)throw s==="TOO_SHORT"?new ka("TOO_SHORT"):new ka("NOT_A_NUMBER");return{}}var a=Toe(i,t.defaultCountry,t.defaultCallingCode,r),l=a.country,d=a.nationalNumber,u=a.countryCallingCode,h=a.countryCallingCodeSource,f=a.carrierCode;if(!r.hasSelectedNumberingPlan()){if(t.v2)throw new ka("INVALID_COUNTRY");return{}}if(!d||d.length<n3){if(t.v2)throw new ka("TOO_SHORT");return{}}if(d.length>eie){if(t.v2)throw new ka("TOO_LONG");return{}}if(t.v2){var p=new Bie(u,d,r.metadata);return l&&(p.country=l),f&&(p.carrierCode=f),o&&(p.ext=o),p.__countryCallingCodeSource=h,p}var m=(t.extended?r.hasSelectedNumberingPlan():l)?Qs(d,r.nationalNumberPattern()):!1;return t.extended?{country:l,countryCallingCode:u,carrierCode:f,valid:m,possible:m?!0:!!(t.extended===!0&&r.possibleLengths()&&yI(d,l,r)),phone:d,ext:o}:m?Coe(l,d,o):{}}function Eoe(e,t,r){if(e){if(e.length>_oe){if(r)throw new ka("TOO_LONG");return}if(t===!1)return e;var n=e.search(boe);if(!(n<0))return e.slice(n).replace(xoe,"")}}function Soe(e,t,r){var n=yoe(e,{extractFormattedPhoneNumber:function(s){return Eoe(s,r,t)}});if(!n)return{};if(!Rie(n))return Iie(n)?{error:"TOO_SHORT"}:{};var i=toe(n);return i.ext?i:{number:n}}function Coe(e,t,r){var n={country:e,phone:t};return r&&(n.ext=r),n}function Toe(e,t,r,n){var i=bI(X8(e),void 0,t,r,n.metadata),o=i.countryCallingCodeSource,s=i.countryCallingCode,a=i.number,l;if(s)n.selectNumberingPlan(s);else if(a&&(t||r))n.selectNumberingPlan(t,r),t&&(l=t),s=r||e3(t,n.metadata);else return{};if(!a)return{countryCallingCodeSource:o,countryCallingCode:s};var d=wy(X8(a),l,n),u=d.nationalNumber,h=d.carrierCode,f=_I(s,{nationalNumber:u,metadata:n});return f&&(l=f,f==="001"||n.selectNumberingPlan(l)),{country:l,countryCallingCode:s,countryCallingCodeSource:o,nationalNumber:u,carrierCode:h}}function cf(e){"@babel/helpers - typeof";return cf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cf(e)}function eE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function tE(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?eE(Object(r),!0).forEach(function(n){Aoe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eE(Object(r)).forEac
141h(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Aoe(e,t,r){return(t=koe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function koe(e){var t=Roe(e,"string");return cf(t)=="symbol"?t:t+""}function Roe(e,t){if(cf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(cf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ioe(e,t,r){return woe(e,tE(tE({},t),{},{v2:!0}),r)}function uf(e){"@babel/helpers - typeof";return uf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uf(e)}function rE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Poe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rE(Object(r),!0).forEach(function(n){Ooe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ooe(e,t,r){return(t=joe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function joe(e){var t=Loe(e,"string");return uf(t)=="symbol"?t:t+""}function Loe(e,t){if(uf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(uf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $oe(e,t){return Foe(e)||Noe(e,t)||Moe(e,t)||Doe()}function Doe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 142In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Moe(e,t){if(e){if(typeof e=="string")return nE(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?nE(e,t):void 0}}function nE(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Noe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,s,a=[],l=!0,d=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(u){d=!0,i=u}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(d)throw i}}return a}}function Foe(e){if(Array.isArray(e))return e}function Uoe(e){var t=Array.prototype.slice.call(e),r=$oe(t,4),n=r[0],i=r[1],o=r[2],s=r[3],a,l,d;if(typeof n=="string")a=n;else throw new TypeError("A text for parsing must be a string.");if(!i||typeof i=="string")s?(l=o,d=s):(l=void 0,d=o),i&&(l=Poe({defaultCountry:i},l));else if(vu(i))o?(l=i,d=o):d=i;else throw new Error("Invalid second argument: ".concat(i));return{text:a,options:l,metadata:d}}function Boe(){var e=Uoe(arguments),t=e.text,r=e.options,n=e.metadata;return Ioe(t,r,n)}function SI(){return jne(Boe,arguments)}const Hu=e=>{if(!e)return"";try{let t=e;!e.startsWith("+")&&/^\d+$/.test(e)&&(t=`+${e}`);const r=SI(t);return!r||!r.isValid()?e:r.country==="BR"?r.formatNational():r.formatInternational()}catch{return e}},q1=e=>{if(!e)return"";const t=e.replace(/\D/g,"");return t.length!==8?e:t.replace(/(\d{5})(\d{3})/,"$1-$2")},ys=e=>{const t=typeof e=="number"?e:Number(e);if(!Number.isFinite(t))throw new Error(`toCents: valor monetário inválido (${String(e)})`);return Math.round(t*100)},Voe=e=>e==null?0:ys(e),bg=e=>e===0?0:e/100,F7e=e=>bg(ys(e)),CI=e=>bg(e.reduce((t,r)=>t+Voe(r),0)),Hoe=(e,t)=>{if(e==null||t===null||t===void 0)return!1;try{return ys(e)>=ys(t)}catch{return!1}},TI=(e,t)=>bg(Math.max(0,ys(e)-ys(t))),U7e=(e,t)=>bg(ys(e)-ys(t)),AI="bluetooth_printer",kI="bluetooth_permission_granted",B7e=async()=>
142{if(!qe.isNativePlatform())return!0;const{value:e}=await vg.get({key:kI});return e==="true"},V7e=async()=>{await vg.set({key:kI,value:"true"})},zoe=32,Woe=48,RI=(e="58mm")=>e==="80mm"?Woe:zoe,II=e=>"-".repeat(e),qoe=async e=>{const t={lastConnectedDevice:e,lastConnectedAt:Date.now()};await vg.set({key:AI,value:JSON.stringify(t)})},Goe=async()=>{const{value:e}=await vg.get({key:AI});if(!e)return null;try{return JSON.parse(e).lastConnectedDevice}catch(t){return console.error("Error parsing saved printer preferences",t),null}},hi=e=>e.toLocaleString("pt-BR",{minimumFractionDigits:2,maximumFractionDigits:2}),Koe=e=>{const t=e.getDate().toString().padStart(2,"0"),r=(e.getMonth()+1).toString().padStart(2,"0"),n=e.getFullYear(),i=e.getHours().toString().padStart(2,"0"),o=e.getMinutes().toString().padStart(2,"0");return`${t}/${r}/${n} ${i}:${o}`},iE=e=>{const t=H1(e);let r=`${t.logradouro}, ${t.numero}`;return t.complemento&&(r+=` - ${t.complemento}`),t.bairro&&(r+=` - ${t.bairro}`),r+=` - ${t.localidade} - ${t.uf}`,t.cep&&(r+=` - CEP: ${q1(t.cep)}`),r},Yoe=async e=>{const t=[{service:"18f0",characteristic:"2af1",writeWithResponse:!0},{service:"ff00",characteristic:"ff01",writeWithResponse:!0},{service:"ffe0",characteristic:"ffe1",writeWithResponse:!1},{service:"000018f0-0000-1000-8000-00805f9b34fb",characteristic:"00002af1-0000-1000-8000-00805f9b34fb",writeWithResponse:!0}];for(const r of t)try{const n=new Uint8Array([16,4,1]);return await Jr.write(e,r.service,r.characteristic,yh(Array.from(n))),console.log(`Found working service: ${r.service}, characteristic: ${r.characteristic}`),{serviceId:r.service,characteristicId:r.characteristic,writeWithResponse:r.writeWithResponse}}catch{console.log(`Testing pair failed: ${r.service}/${r.characteristic}`)}try{const r=await Jr.getServices(e);for(const n of r)for(const i of n.characteristics)if(i.properties.write||i.properties.writeWithoutResponse)try{const o=new Qb().initialize().encode();return i.properties.write?(await Jr.write(e,n.uuid,i.uuid,yh(Array.from(o))),{serviceId:n.uuid,characteristicId:i.uuid,writeWithResponse:!0}):(await Jr.writeWithoutResponse(e,n.uuid,i.uuid,yh(Array.from(o))),{serviceId:n.uuid,characteristicId:i.uuid,writeWithResponse:!1})}catch{console.log(`Failed to write to characteristic: ${i.uuid}`)}}catch(r){console.error("Error discovering services:",r)}return null},oE=async(e,t)=>{const r=e.getCachedCharacteristic(t);if(r)return console.log(`Using cached characteristic for ${t}`),r;const n=await Yoe(t);return n&&e.cacheCharacteristic(t,n),n},Zoe=({order:e,storeName:t,storeAddress:r,hideLogo:n=!1,paperSize:i="58mm"})=>{const o=RI(i),s=II(o),a=new Qb({columns:o});a.initialize();const l=tn(t);if(n||a.align("center").pulse().bold(!0).width(2).text(l).width(1).bold(!1).newline().newline(),a.align("center").bold(!0).text(`Pedido #${e.numero_pedido||e.pedido_id}`).bold(!1).newline().newline(),a.align("center").bold(!0).text("DESTINATARIO").bold(!1).newline().text(s).newline(),e.endereco_entrega){const d=H1(e.endereco_entrega);a.align("left").bold(!0).text(d.nome_destinatario||"").bold(!1).newline(),a.text(`${d.logradouro}, ${d.numero}`).newline(),d.complemento&&a.text(d.complemento).newline(),a.text(d.bairro).newline(),a.text(`${d.localidade} - ${d.uf}`).newline(),a.text(q1(d.cep)).newline(),a.newline().align("center").barcode(d.cep.replace(/[^0-9]/g,""),"ean8",50).newline()}if(r){const d=H1(r);a.newline().align("center").bold(!0).text("REMETENTE").bold(!1).newline().text(s).newline().align("left"),a.text(l).newline(),a.text(`${d.logradouro}, ${d.numero}`).newline(),d.complemento&&a.text(d.complemento).newline(),a.text(d.bairro).newline(),a.text(`${d.localidade} - ${d.uf}`).newline(),a.text(q1(d.cep)).newline()}return(e.observacoes_cliente||e.observacoes)&&(a.newline().align("center").bold(!0).text("OBSERVACOES").bold(!1).newline().text(s).newline().align("left"),e.observacoes_cliente&&a.bold(!0).text("Obs. Cliente:").bold(!1).newline().text(tn(e.observacoes_cliente)).newline(),e.observacoes&&(e.observacoes_cliente&&a.newline(),a.bold(!0).text("Obs. Vendedor:").bold(!1).newline().text(tn(e.observacoes)).newline())),a.newline().cut("partial"),a.encode()},Xoe=({order:e,storeName:t,storeUrl:r,paymentData:n,customerAddress:i,paperSize:o="58mm"})=>{var E,S,k,A;const s=RI(o),a=II(s),l=new Qb({columns:s});l.initialize();const d=tn(t),u=e.cliente?tn(e.cliente.nome):"";l.align("center").bold(!0).pulse().width(2).text(d).newline().newline();const h=`PEDIDO #${e.numero_pedido||e.pedido_id}`;l.bold(!0).width(2).text(h).width(1).bold(!1).newline().newline();const f=new Date(e.data_pedido);if(l.align("left").text(a).newline().text(`Data: ${Koe(f)}`).newline(),l.text(`Cliente: ${u}`).newline(),(E=e.cliente)!=null&&E.telefone){const w=Hu(e.cliente.telefone);l.text(`Tel: ${w}`).newline()}if(((S=e.frete_pedido)==null?void 0:S.tipo_frete)==="retirada"&&i&&l.text(`Endereco: ${iE(i)}`).newline(),e.frete_pedido){const _={frete_gratis:"Frete grátis",frete_distancia:"Frete por distância",frete_personalizado:"Frete personalizado",correios:"Correios",melhor_envio:"Melhor Envio",superfrete:"SuperFrete",uber:"Uber",a_combinar:"A combinar",retirada:"Retirada no local"}[e.frete_pedido.tipo_frete]||e.frete_pedido.tipo_frete;l.text(`Entrega: ${_}`).newline(),e.frete_pedido.rastreio_codigo&&l.text(`Cod.Rastr.: ${tn(e.frete_pedido.rastreio_codigo)}`).newline()}if(e.endereco_entrega&&((k=e.frete_pedido)==null?void 0:k.tipo_frete)!=="retirada"){const w=H1(e.endereco_entrega);w.nome_destinatario&&w.nome_destinatario!==u&&l.text(`A/C: ${w.nome_destinatario}`).newline(),l.text(`Endereco: ${iE(e.endereco_entrega)}`).newline()}l.text(a).newline(),l.text("COD | DESC").newline().text("QTD x PRECO UN | PRECO TOT").newline().text(a).newline(),e.itens_pedido.forEac
142h(w=>{var j,q;const _=((j=w.produto_variacao)==null?void 0:j.codigo_produto)||((q=w.produto)==null?void 0:q.sku)||"";let x=w.produto.nome?tn(w.produto.nome):"";if(w.produto_variacao){const W=w.produto_variacao.produto_variacao_valor.map(ne=>`${tn(ne.atributo_valor.atributo.nome)}: ${tn(ne.atributo_valor.valor)}`).join(", ");W&&(x+=` (${W})`)}const C=`${_&&_+" "}${x}`;if(C.length<=s)l.text(C).newline();else{let W=C,ne=!0;for(;W.length>0;){const ae=ne?s:s-2,re=W.substring(0,ae);l.text(ne?re:" "+re).newline(),W=W.substring(ae),ne=!1}}(w.combo_componentes??[]).forEach(W=>{var re,_e;const ne=tn(((re=W.produto)==null?void 0:re.nome)??""),ae=(_e=W.produto_variacao)!=null&&_e.nome?` (${tn(W.produto_variacao.nome)})`:"";l.text(` ${W.quantidade}x ${ne}${ae}`.substring(0,s)).newline()});const P=w.quantidade*w.preco_snapshot,I=`${w.quantidade}x ${hi(w.preco_snapshot)}`,O=`${hi(P)}`,M=s-I.length-O.length-2,U=" ".repeat(Math.max(1,M)),$=`${I}${U}${O}`;l.align("right").text($).align("left").newline()}),l.newline().text(a).newline();const p=(w,_)=>{const x=s-w.length-_.length,C=" ".repeat(Math.max(1,x));return`${w}${C}${_}`};l.text(p("Subtotal:",`R$ ${hi(e.subtotal)}`)).newline(),e.frete_pedido&&e.frete_pedido.valor_frete>0&&l.text(p("Frete:",`R$ ${hi(e.frete_pedido.valor_frete)}`)).newline(),e.taxa_de_venda>0&&l.text(p("Taxa de venda:",`R$ ${hi(e.taxa_de_venda)}`)).newline(),e.valor_desconto>0&&l.text(p("Desconto:",`-R$ ${hi(e.valor_desconto)}`)).newline(),l.text(a).newline();const m=e.itens_pedido.reduce((w,_)=>w+_.quantidade,0);l.text(p("Qtd. Total:",`${m}`)).newline();const g=e.subtotal+(((A=e.frete_pedido)==null?void 0:A.valor_frete)||0)+(e.taxa_de_venda||0)-(e.valor_desconto||0);if(l.bold(!0).text(p("TOTAL:",`R$ ${hi(g)}`)).bold(!1).newline().newline(),n&&n.parcelas&&n.parcelas.length>0){const w=[];let _=0;n.parcelas.forEach(x=>{x.pagamentos&&x.pagamentos.length>0&&x.pagamentos.forEach(C=>{var I;if(C.status==="pago"||!C.status&&x.status_parcela==="paga"){const O=new Date(C.data_pagamento);w.push({method:tn(((I=C.forma_pagamento)==null?void 0:I.nome)||"Sem método"),amount:C.valor,date:`${O.getDate().toString().padStart(2,"0")}/${(O.getMonth()+1).toString().padStart(2,"0")}`,installmentNumber:x.numero_parcela}),_+=C.valor}})}),l.text(a).newline().align("center").bold(!0).text("PAGAMENTO").bold(!1).newline().text(a).newline().align("left"),w.length>0&&(w.forEach(x=>{const C=`${x.method} (${x.date}):`,P=`R$ ${hi(x.amount)}`,I=s-C.length-P.length,O=" ".repeat(Math.max(1,I));l.text(`${C}${O}${P}`).newline()}),l.text(a).newline()),l.text(p("Total pago:",`R$ ${hi(_)}`)).newline(),g-_>0&&l.text(p("Pendente:",`R$ ${hi(g-_)}`)).newline(),n.parcelas&&n.parcelas.length>0&&(e.condicao_pagamento==="parcelado"||e.condicao_pagamento==="fiado")&&(l.newline().text(a).newline().align("center").bold(!0),e.condicao_pagamento==="parcelado"?l.text(`PARCELAS (${n.parcelas.length}x)`):e.condicao_pagamento==="fiado"?l.text("PAGAMENTO A PRAZO"):l.text("CONDICAO DE PAGAMENTO"),l.bold(!1).newline().text(a).newline().align("left"),n.parcelas.forEach(x=>{const C=CI((x.pagamentos??[]).filter(()=>e.condicao_pagamento==="a_vista"?x.status_parcela==="paga":!0).map(j=>j.valor)),P=TI(x.valor_original,C),I=new Date(x.data_vencimento),O=`${I.getDate().toString().padStart(2,"0")}/${(I.getMonth()+1).toString().padStart(2,"0")}`;let D;e.condicao_pagamento==="fiado"?D=`${O}:`:D=`${x.numero_parcela}ª ${O}:`;let M;ys(C)>0&&ys(P)>0?M=`R$ ${hi(C)}/${hi(x.valor_original)} (parcial)`:Hoe(C,x.valor_original)?M=`R$ ${hi(x.valor_original)} (pago)`:M=`R$ ${hi(x.valor_original)} (pendente)`;const U=s-D.length-M.length,$=" ".repeat(Math.max(1,U));l.text(`${D}${$}${M}`).newline()})),l.newline()}(e.observacoes_cliente||e.observacoes)&&(l.newline().text(a).newline().align("center").bold(!0).text("OBSERVACOES").bold(!1).newline().text(a).newline().align("left"),e.observacoes_cliente&&l.bold(!0).text("Obs. Cliente:").bold(!1).newline().text(tn(e.observacoes_cliente)).newline(),e.observacoes&&(e.observacoes_cliente&&l.newline(),l.bold(!0).text("Obs. Vendedor:").bold(!1).newline().text(tn(e.observacoes)).newline())),r&&l.newline().text(a).newline().align("center").text("Visite nossa loja online:").newline().text(r).newline();const b={new:"NOVO",pending_payment:"AGUARDANDO PAGAMENTO",paid:"APROVADO",processing:"PREPARAÃÃO",shipped:"ENVIADO",delivered:"ENTREGUE",canceled:"CANCELADO",returned:"DEVOLVIDO"}[e.status_pedido]||e.status_pedido.toUpperCase();return l.align("center").text(`Status: ${b}`).newline(),l.cut("partial"),l.encode()};class Joe{constructor(){ze(this,"initialized",!1);ze(this,"lastInitError",null);ze(this,"currentDevice",null);ze(this,"isConnected",!1);ze(this,"connectionListeners",new Map);ze(this,"characteristicCache",new Map);ze(this,"scanCallback",null);ze(this,"disconnectCallbacks",new Map);ze(this,"CACHE_TTL",5*60*1e3)}async initialize(t=!1){if(this.initialized)return console.log("BLE already initialized."),!0;try{if(console.log("Initializing BluetoothLE Client..."),await Jr.initialize({androidNeverForLocation:!0}
142),this.initialized=!0,this.lastInitError=null,console.log("BLE Client initialization complete."),qe.isNativePlatform())if(t)console.log("Skipping auto-connect to last device (native).");else try{const r=await Goe();r?(console.log("Found last used device (native), attempting to connect:",r.name),await this.connectToDevice(r).catch(n=>{console.warn("Silent auto-reconnect to last device failed (native):",r.name,n.message||n)})):console.log("No last used device found (native).")}catch(r){console.warn("Failed to attempt auto-reconnect to last device (native):",r.message||r)}else console.log("Web platform: Auto-connect to last device is not standard. Connection is user-initiated via browser dialog.");return!0}catch(r){console.error("Failed to initialize Bluetooth Client:",r.message||r);const n=String(r.message||r).toLowerCase();let i=`Erro ao inicializar Bluetooth: ${n}`;return n.includes("bluetooth adapter not available")||n.includes("bluetooth is not available")?i="Adaptador Bluetooth não disponÃvel ou desligado.":n.includes("user cancelled")||n.includes("permission denied")||n.includes("chooser")?i="Permissão para Bluetooth não concedida ou seleção cancelada.":n.includes("location services disabled")&&qe.isNativePlatform()&&(i="Serviço de localização desativado. Necessário para buscar dispositivos Bluetooth no Android."),this.lastInitError=i,this.notifyListeners({isConnected:!1,device:null,error:i}),this.initialized=!1,!1}}async checkBluetoothAvailability(){const t=qe.isNativePlatform();try{return!this.initialized&&!await this.initialize(!0)?{available:!1,reason:this.lastInitError||"Falha na inicialização do Bluetooth. Verifique se está ligado e as permissões concedidas."}:t&&typeof Jr.isEnabled=="function"&&!await Jr.isEnabled()?{available:!1,reason:"Bluetooth está desligado. Por favor, ative-o nas configurações do dispositivo."}:{available:!0}}catch(r){console.error(`Bluetooth not available check (${t?"native":"web"}):`,r.message||r);const n=String(r.message||r).toLowerCase();let i="Erro desconhecido ao verificar Bluetooth.";return n.includes("bluetooth adapter not available")||n.includes("bluetooth is not available")?i="Adaptador Bluetooth não está disponÃvel ou está desligado.":t&&(n.includes("bluetooth is not enabled")||n.includes("powered off"))?i="Bluetooth está desligado. Por favor, ative-o nas configurações.":t&&(n.includes("location is not enabled")||n.includes("location services disabled"))?i="Serviço de localização precisa estar ativado para usar Bluetooth (Android).":n.includes("user cancelled")||n.includes("permission denied")||n.includes("chooser")?i="Permissão para Bluetooth não concedida ou operação cancelada pelo usuário.":i=`Falha ao acessar Bluetooth: ${n}`,{available:!1,reason:i}}}async stopScan(){if(qe.isNativePlatform())try{await Jr.stopLEScan(),console.log("Native BLE scan stopped.")}catch{}}async requestAndConnectDeviceWeb(){if(qe.isNativePlatform())throw new Error("requestAndConnectDeviceWeb is only for web platform.");if(!this.initialized&&!await this.initialize(!0))throw new Error("Falha ao inicializar Bluetooth antes de solicitar dispositivo.");try{console.log("Requesting device via browser's Bluetooth dialog...");const t=await Jr.requestDevice({services:["000018f0-0000-1000-8000-00805f9b34fb"],optionalServices:["00001101-0000-1000-8000-00805f9b34fb","e7810a71-73ae-499d-8c15-faa9aef0c3f2","49535343-fe7d-4ae5-8fa9-9fafd205e455"]});if(!t||!t.deviceId)throw new Error("Nenhuma impressora selecionada ou dispositivo inválido retornado.");const r={deviceId:t.deviceId,name:t.name||"Impressora web"};return console.log("Device selected via browser:",r.name,`(ID: ${r.deviceId})`),await this.connectToDevice(r),r}catch(t){console.error("Error requesting or connecting to device on web:",t.message||t);const r=String(t.message||t).toLowerCase();throw r.includes("no device selected")||r.includes("cancelled")||r.includes("chooser")||r.includes("user canceled")?new Error("Seleção de impressora cancelada pelo usuário."):r.includes("bluetooth adapter not available")||r.includes("not supported")?new Error("Adaptador Bluetooth não disponÃvel ou Web Bluetooth não suportado neste navegador."):r.includes("getservicediscoveryinfo characteristic not found")?new Error("Falha ao descobrir serviços da impressora após seleção."):new Error(`Falha ao solicitar/conectar impressora via web: ${r}`)}}async scanForPrintersNative(t=8e3){if(!qe.isNativePlatform())throw new Error("scanForPrintersNative is only for native platforms.");if(!this.initialized&&!await this.initialize(!0))throw new Error("Falha ao inicializar Bluetooth antes de escanear (native).");try{await this.stopScan();const r=new Map;return this.scanCallback=n=>{if(n.device&&(n.device.name||n.localName)){const i=n.device.name||n.localName||"Dispositivo desconhecido",o=r.get(n.device.deviceId),s={deviceId:n.device.deviceId,name:i,rssi:n.rssi||(o==null?void 0:o.rssi)||-100};r.set(n.device.deviceId,s)}},console.log("Requesting native BLE scan..."),await Jr.requestLEScan({services:[],allowDuplicates:!0,scanMode:2},this.scanCallback),new Promise((n,i)=>{setTimeout(async()=>{try{await this.stopScan(),this.scanCallback=null;const o=Array.from(r.values()).sort((s,a)=>(a.rssi||-100)-(s.rssi||-100));console.log(`Native scan finished. Found ${o.length} devices with names.`),r.clear(),n(o)}catch(o){console.error("Error stopping scan:",o),i(o)}},t)})}catch(r){throw this.scanCallback=null,console.error("Error scanning for printers (native):",r.message||r),new Error(`Erro ao buscar impressoras (native): ${String(r.message||r)}`)}}async connectToDevice(t){if(!this.initialized&&!await this.initialize(!0))throw new Error("Bluetooth não inicializado, não é possÃvel conectar.");if(this.isConnected&&this.currentDevice&&this.currentDevice.deviceId!==t.deviceId)console.log(`Switching device. Disconnecting from previous: ${this.currentDevice.name}`),await this.disconnect().catch(r=>console.warn("Error disconnecting previous device during switch:",r.message||r));else if(this.isConnected&&this.currentDevice&&this.currentDevice.deviceId===t.deviceId){if(console.log(`Already connected to ${t.name}. Validating connection...`),await this.validateConnection()){console.log(`Validation successful for ${t.name}. No new connection needed.`),this.notifyListeners({isConnected:!0,device:t,error:null});return}console.log(`Validation failed for ${t.name}
142. Attempting to reconnect.`),await this.disconnect().catch(n=>console.warn("Error disconnecting before reconnect attempt:",n.message||n))}this.currentDevice=t,this.notifyListeners({isConnected:!1,device:t,error:null});try{console.log(`Connecting to ${t.name} (ID: ${t.deviceId})...`);const r=()=>{const i=t.deviceId;console.log(`Device ${i} disconnected (onDisconnect callback).`),this.currentDevice&&this.currentDevice.deviceId===i&&(this.isConnected=!1,this.notifyListeners({isConnected:!1,device:this.currentDevice,error:"Impressora desconectada."})),this.disconnectCallbacks.delete(i)};this.disconnectCallbacks.set(t.deviceId,r),await Jr.connect(t.deviceId,r),console.log(`Successfully initiated GATT connection to ${t.name}.`);const n=await oE(this,t.deviceId);if(!n)throw console.warn(`Could not find a writable characteristic for ${t.name} after connection. Disconnecting.`),await Jr.disconnect(t.deviceId).catch(()=>{}),new Error("Não foi possÃvel encontrar uma caracterÃstica para comunicação com a impressora.");console.log(`Writable characteristic found for ${t.name}: ${JSON.stringify(n)}. Connection established.`),this.isConnected=!0,await qoe(t),this.notifyListeners({isConnected:!0,device:t,error:null})}catch(r){if(console.error(`Error connecting to printer ${t.name}:`,r.message||r),this.currentDevice&&this.currentDevice.deviceId===t.deviceId)try{await Jr.disconnect(t.deviceId)}catch{}this.isConnected=!1;const n=`Erro ao conectar à impressora ${t.name}: ${String(r.message||r)}`;throw this.notifyListeners({isConnected:!1,device:this.currentDevice,error:n}),new Error(n)}}async disconnect(){if(!this.currentDevice){console.log("No current device to disconnect.");return}const t=this.currentDevice;console.log(`Attempting to disconnect from ${t.name}...`);try{await Jr.disconnect(t.deviceId),console.log(`Successfully disconnected from ${t.name}.`)}catch(r){console.warn(`Error during explicit disconnect from ${t.name}:`,r.message||r)}finally{this.currentDevice&&this.currentDevice.deviceId===t.deviceId&&(this.isConnected=!1,this.notifyListeners({isConnected:!1,device:this.currentDevice,error:null}))}}async printData(t){if(!this.currentDevice||!this.isConnected){const n="Impressora não conectada ou nenhuma impressora ativa.";throw console.error(n),this.notifyListeners({isConnected:!1,device:this.currentDevice,error:n}),new Error(n)}if(!await this.validateConnection())throw new Error("Impressora desconectada ou não responde. Por favor, reconecte.");try{const n=await oE(this,this.currentDevice.deviceId);if(!n){this.isConnected=!1;const a="Não foi possÃvel encontrar uma caracterÃstica para impressão.";throw this.notifyListeners({isConnected:!1,device:this.currentDevice,error:a}),new Error(a)}const i=n.writeWithResponse?qe.isNativePlatform()?64:20:qe.isNativePlatform()?240:64;console.log(`Printing data to ${this.currentDevice.name}. Total size: ${t.length} bytes. Chunk size: ${i}. Method: ${n.writeWithResponse?"write":"writeWithoutResponse"}`);let o=0;const s=t.length;for(;o<s;){const a=Math.min(i,s-o),l=new Uint8Array(a);for(let u=0;u<a;u++)l[u]=t[o+u];const d=yh(Array.from(l));n.writeWithResponse?await Jr.write(this.currentDevice.deviceId,n.serviceId,n.characteristicId,d):await Jr.writeWithoutResponse(this.currentDevice.deviceId,n.serviceId,n.characteristicId,d),o+=a,o<s&&await new Promise(u=>setTimeout(u,n.writeWithResponse?75:40))}return console.log("Print data successfully sent to printer."),!0}catch(n){console.error("Error during printData operation:",n.message||n);const i=String(n.message||n).toLowerCase();throw(i.includes("not connected")||i.includes("disconnected")||i.includes("gatt server is disconnected"))&&(this.isConnected=!1,this.notifyListeners({isConnected:!1,device:this.currentDevice,error:"Conexão com impressora perdida durante a impressão."})),new Error(`Erro ao enviar dados para impressão: ${String(n.message||n)}`)}}async printOrder({order:t,storeName:r,storeUrl:n,paymentData:i,customerAddress:o,paperSize:s}){try{const a=Xoe({order:t,storeName:r,storeUrl:n,paymentData:i,customerAddress:o,paperSize:s});return await this.printData(a)}catch(a){throw console.error("Error printing order:",a),a}}async printShippingLabel({order:t,storeName:r,storeAddress:n,hideLogo:i,paperSize:o}){try{const s=Zoe({order:t,storeName:r,storeAddress:n,hideLogo:i,paperSize:o});return await this.printData(s)}catch(s){throw console.error("Error printing shipping label:",s),s}}async validateConnection(){if(!this.currentDevice)return!1;try{return await Jr.getServices(this.currentDevice.deviceId),this.isConnected||(console.log(`ValidateConnection: Connection to ${this.currentDevice.name} re-validated. Updating state.`),this.isConnected=!0,this.notifyListeners({isConnected:!0,device:this.currentDevice,error:null})),!0}catch(t){return console.warn(`ValidateConnection: Failed for ${this.currentDevice.name}. Device likely disconnected. Error:`,t.message||t),this.isConnected&&(this.isConnected=!1,this.notifyListeners({isConnected:!1,device:this.currentDevice,error:"Conexão perdida (validação falhou)."})),!1}}isDeviceConnected(){return this.isConnected&&!!this.currentDevice}getCurrentDevice(){return this.currentDevice}subscribeToConnectionStatus(t){const r=Symbol("listener");return this.connectionListeners.set(r,t),t({isConnected:this.isConnected,device:this.currentDevice,error:null}),()=>{this.connectionListeners.delete(r)}}
142notifyListeners(t){this.connectionListeners.forEach(r=>{r(t)})}cacheCharacteristic(t,r){this.characteristicCache.set(t,{...r,timestamp:Date.now()})}getCachedCharacteristic(t){const r=this.characteristicCache.get(t);return r?Date.now()-r.timestamp>this.CACHE_TTL?(this.characteristicCache.delete(t),null):{serviceId:r.serviceId,characteristicId:r.characteristicId,writeWithResponse:r.writeWithResponse}:null}async cleanup(){console.log("BluetoothPrinterService: Performing cleanup."),await this.stopScan(),this.scanCallback=null,this.currentDevice&&await this.disconnect(),this.disconnectCallbacks.clear(),this.connectionListeners.clear(),this.characteristicCache.clear(),this.initialized=!1,console.log("BluetoothPrinterService cleanup finished.")}async requestEnableBluetooth(){if(!qe.isNativePlatform())return console.log("requestEnableBluetooth is only supported on native platforms"),!1;try{return typeof Jr.requestEnable=="function"?(await Jr.requestEnable(),await Jr.isEnabled()):(console.warn("BleClient.requestEnable is not available in this version of the plugin"),!1)}catch(t){return console.error("Error requesting to enable Bluetooth:",t.message||t),!1}}}const z2=new Joe,Qoe=()=>(v.useEffect(()=>{if(!qe.isNativePlatform())return;const e=async r=>{if(console.log("App state changed:",r.isActive?"active":"background"),!r.isActive)try{(z2.getCurrentDevice()||z2.isDeviceConnected())&&(console.log("App going to background - cleaning up Bluetooth connections"),await z2.cleanup())}catch(n){console.error("Error cleaning up Bluetooth on app background:",n)}},t=sc.addListener("appStateChange",e);return()=>{t.then(r=>r.remove())}},[]),null);var PI=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),sE;(function(e){e.UNKNOWN_ERROR="0",e.PURCHASE_CANCELLED_ERROR="1",e.STORE_PROBLEM_ERROR="2",e.PURCHASE_NOT_ALLOWED_ERROR="3",e.PURCHASE_INVALID_ERROR="4",e.PRODUCT_NOT_AVAILABLE_FOR_PURCHASE_ERROR="5",e.PRODUCT_ALREADY_PURCHASED_ERROR="6",e.RECEIPT_ALREADY_IN_USE_ERROR="7",e.INVALID_RECEIPT_ERROR="8",e.MISSING_RECEIPT_FILE_ERROR="9",e.NETWORK_ERROR="10",e.INVALID_CREDENTIALS_ERROR="11",e.UNEXPECTED_BACKEND_RESPONSE_ERROR="12",e.RECEIPT_IN_USE_BY_OTHER_SUBSCRIBER_ERROR="13",e.INVALID_APP_USER_ID_ERROR="14",e.OPERATION_ALREADY_IN_PROGRESS_ERROR="15",e.UNKNOWN_BACKEND_ERROR="16",e.INVALID_APPLE_SUBSCRIPTION_KEY_ERROR="17",e.INELIGIBLE_ERROR="18",e.INSUFFICIENT_PERMISSIONS_ERROR="19",e.PAYMENT_PENDING_ERROR="20",e.INVALID_SUBSCRIBER_ATTRIBUTES_ERROR="21",e.LOG_OUT_ANONYMOUS_USER_ERROR="22",e.CONFIGURATION_ERROR="23",e.UNSUPPORTED_ERROR="24",e.EMPTY_SUBSCRIBER_ATTRIBUTES_ERROR="25",e.PRODUCT_DISCOUNT_MISSING_IDENTIFIER_ERROR="26",e.PRODUCT_DISCOUNT_MISSING_SUBSCRIPTION_GROUP_IDENTIFIER_ERROR="28",e.CUSTOMER_INFO_ERROR="29",e.SYSTEM_INFO_ERROR="30",e.BEGIN_REFUND_REQUEST_ERROR="31",e.PRODUCT_REQUEST_TIMED_OUT_ERROR="32",e.API_ENDPOINT_BLOCKED="33",e.INVALID_PROMOTIONAL_OFFER_ERROR="34",e.OFFLINE_CONNECTION_ERROR="35",e.TEST_STORE_SIMULATED_PURCHASE_ERROR="42"})(sE||(sE={}));(function(e){PI(t,e);function t(){var r=e.call(this,"There is no singleton instance. Make sure you configure Purchases before trying to get the default instance. More info here: https://errors.rev.cat/configuring-sdk")||this;return Object.setPrototypeOf(r,t.prototype),r}return t})(Error);(function(e){PI(t,e);function t(){var r=e.call(this,"This method is not available in the current platform.")||this;return Object.setPrototypeOf(r,t.prototype),r}return t})(Error);var aE;(function(e){e.UNKNOWN="UNKNOWN",e.CUSTOM="CUSTOM",e.LIFETIME="LIFETIME",e.ANNUAL="ANNUAL",e.SIX_MONTH="SIX_MONTH",e.THREE_MONTH="THREE_MONTH",e.TWO_MONTH="TWO_MONTH",e.MONTHLY="MONTHLY",e.WEEKLY="WEEKLY"})(aE||(aE={}));var lE;(function(e){e[e.INTRO_ELIGIBILITY_STATUS_UNKNOWN=0]="INTRO_ELIGIBILITY_STATUS_UNKNOWN",e[e.INTRO_ELIGIBILITY_STATUS_INELIGIBLE=1]="INTRO_ELIGIBILITY_STATUS_INELIGIBLE",e[e.INTRO_ELIGIBILITY_STATUS_ELIGIBLE=2]="INTRO_ELIGIBILITY_STATUS_ELIGIBLE",e[e.INTRO_ELIGIBILITY_STATUS_NO_INTRO_OFFER_EXISTS=3]="INTRO_ELIGIBILITY_STATUS_NO_INTRO_OFFER_EXISTS"})(lE||(lE={}));var cE;(function(e){e.NON_SUBSCRIPTION="NON_SUBSCRIPTION",e.SUBSCRIPTION="SUBSCRIPTION",e.UNKNOWN="UNKNOWN"})(cE||(cE={}));var uE;(function(e){e.CONSUMABLE="CONSUMABLE",e.NON_CONSUMABLE="NON_CONSUMABLE",e.NON_RENEWABLE_SUBSCRIPTION="NON_RENEWABLE_SUBSCRIPTION",e.AUTO_RENEWABLE_SUBSCRIPTION="AUTO_RENEWABLE_SUBSCRIPTION",e.PREPAID_SUBSCRIPTION="PREPAID_SUBSCRIPTION",e.UNKNOWN="UNKNOWN"})(uE||(uE={}));var dE;(function(e){e[e.UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY=0]="UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY",e[e.IMMEDIATE_WITH_TIME_PRORATION=1]="IM
142MEDIATE_WITH_TIME_PRORATION",e[e.IMMEDIATE_AND_CHARGE_PRORATED_PRICE=2]="IMMEDIATE_AND_CHARGE_PRORATED_PRICE",e[e.IMMEDIATE_WITHOUT_PRORATION=3]="IMMEDIATE_WITHOUT_PRORATION",e[e.DEFERRED=6]="DEFERRED",e[e.IMMEDIATE_AND_CHARGE_FULL_PRICE=5]="IMMEDIATE_AND_CHARGE_FULL_PRICE"})(dE||(dE={}));var hE;(function(e){e[e.INFINITE_RECURRING=1]="INFINITE_RECURRING",e[e.FINITE_RECURRING=2]="FINITE_RECURRING",e[e.NON_RECURRING=3]="NON_RECURRING"})(hE||(hE={}));var fE;(function(e){e.FREE_TRIAL="FREE_TRIAL",e.SINGLE_PAYMENT="SINGLE_PAYMENT",e.DISCOUNTED_RECURRING_PAYMENT="DISCOUNTED_RECURRING_PAYMENT"})(fE||(fE={}));var pE;(function(e){e.DAY="DAY",e.WEEK="WEEK",e.MONTH="MONTH",e.YEAR="YEAR",e.UNKNOWN="UNKNOWN"})(pE||(pE={}));var mE;(function(e){e.INAPP="inapp",e.SUBS="subs"})(mE||(mE={}));var gE;(function(e){e[e.SUBSCRIPTIONS=0]="SUBSCRIPTIONS",e[e.SUBSCRIPTIONS_UPDATE=1]="SUBSCRIPTIONS_UPDATE",e[e.IN_APP_ITEMS_ON_VR=2]="IN_APP_ITEMS_ON_VR",e[e.SUBSCRIPTIONS_ON_VR=3]="SUBSCRIPTIONS_ON_VR",e[e.PRICE_CHANGE_CONFIRMATION=4]="PRICE_CHANGE_CONFIRMATION"})(gE||(gE={}));var vE;(function(e){e[e.SUCCESS=0]="SUCCESS",e[e.USER_CANCELLED=1]="USER_CANCELLED",e[e.ERROR=2]="ERROR"})(vE||(vE={}));var yE;(function(e){e.VERBOSE="VERBOSE",e.DEBUG="DEBUG",e.INFO="INFO",e.WARN="WARN",e.ERROR="ERROR"})(yE||(yE={}));var _E;(function(e){e[e.BILLING_ISSUE=0]="BILLING_ISSUE",e[e.PRICE_INCREASE_CONSENT=1]="PRICE_INCREASE_CONSENT",e[e.GENERIC=2]="GENERIC",e[e.WIN_BACK_OFFER=3]="WIN_BACK_OFFER"})(_E||(_E={}));var bE;(function(e){e.DISABLED="DISABLED",e.INFORMATIONAL="INFORMATIONAL"})(bE||(bE={}));var xE;(function(e){e.NOT_REQUESTED="NOT_REQUESTED",e.VERIFIED="VERIFIED",e.FAILED="FAILED",e.VERIFIED_ON_DEVICE="VERIFIED_ON_DEVICE"})(xE||(xE={}));var wE;(function(e){e.NOT_PRESENTED="NOT_PRESENTED",e.ERROR="ERROR",e.CANCELLED="CANCELLED",e.PURCHASED="PURCHASED",e.RESTORED="RESTORED"})(wE||(wE={}));var EE;(function(e){e.STOREKIT_1="STOREKIT_1",e.STOREKIT_2="STOREKIT_2",e.DEFAULT="DEFAULT"})(EE||(EE={}));var SE;(function(e){e.MY_APP="MY_APP",e.REVENUECAT="REVENUECAT"})(SE||(SE={}));var CE;(function(e){e.SUCCESS="SUCCESS",e.ERROR="ERROR",e.PURCHASE_BELONGS_TO_OTHER_USER="PURCHASE_BELONGS_TO_OTHER_USER",e.INVALID_TOKEN="INVALID_TOKEN",e.EXPIRED="EXPIRED"})(CE||(CE={}));const j0=Kr("Purchases",{web:()=>X(()=>import("./web-4LvmVH2w.js"),__vite__mapDeps([14,1,2,3,4,5,6])).then(e=>new e.PurchasesWeb)}),ese=()=>{const{user:e}=ot();v.useEffect(()=>{const t=async()=>{var r;if(e!=null&&e.id)try{await j0.logIn({appUserID:e.id}),await j0.setAttributes({$displayName:((r=e.user_metadata)==null?void 0:r.nome)||"",$email:e.email||e.new_email||"",$phoneNumber:e.phone||e.new_phone||""})}catch(n){console.error("Error identifying user in RevenueCat:",n)}};return qe.isNativePlatform()&&t(),()=>{e!=null&&e.id||j0.logOut().catch(console.error)}},[e])};async function OI(e){try{const{error:t}=await Te.auth.updateUser({data:e});if(t)throw t;return{success:!0}}catch(t){throw console.error("Error updating user metadata:",t),t}}async function Hp(e){console.log("Saving phone to auth via API:",e);try{const t=await Io.post("/user/update/phone",{phone:e});return console.log("Phone update response:",t.data),{success:!0,data:t.data}}catch(t){throw console.error("Error updating phone via API:",t),t}}function tse(){return $o(),v.useState(0),v.useState(!1),v.useState(!1),null}function H7e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M11.03 3.97a.75.75 0 0 1 0 1.06l-6.22 6.22H21a.75.75 0 0 1 0 1.5H4.81l6.22 6.22a.75.75 0 1 1-1.06 1.06l-7.5-7.5a.75.75 0 0 1 0-1.06l7.5-7.5a.75.75 0 0 1 1.06 0Z",clipRule:"evenodd"},child:[]}]})(e)}function rse(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M15.75 2.25H21a.75.75 0 0 1 .75.75v5.25a.75.75 0 0 1-1.5 0V4.81L8.03 17.03a.75.75 0 0 1-1.06-1.06L19.19 3.75h-3.44a.75.75 0 0 1 0-1.5Zm-10.5 4.5a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h10.5a1.5 1.5 0 0 0 1.5-1.5V10.5a.75.75 0 0 1 1.5 0v8.25a3 3 0 0 1-3 3H5.25a3 3 0 0 1-3-3V8.25a3 3 0 0 1 3-3h8.25a.75.75 0 0 1 0 1.5H5.25Z",clipRule:"evenodd"},child:[]}]})(e)}function nse(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"
142currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M5.25 9a6.75 6.75 0 0 1 13.5 0v.75c0 2.123.8 4.057 2.118 5.52a.75.75 0 0 1-.297 1.206c-1.544.57-3.16.99-4.831 1.243a3.75 3.75 0 1 1-7.48 0 24.585 24.585 0 0 1-4.831-1.244.75.75 0 0 1-.298-1.205A8.217 8.217 0 0 0 5.25 9.75V9Zm4.502 8.9a2.25 2.25 0 1 0 4.496 0 25.057 25.057 0 0 1-4.496 0Z",clipRule:"evenodd"},child:[]}]})(e)}function jI(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M4.913 2.658c2.075-.27 4.19-.408 6.337-.408 2.147 0 4.262.139 6.337.408 1.922.25 3.291 1.861 3.405 3.727a4.403 4.403 0 0 0-1.032-.211 50.89 50.89 0 0 0-8.42 0c-2.358.196-4.04 2.19-4.04 4.434v4.286a4.47 4.47 0 0 0 2.433 3.984L7.28 21.53A.75.75 0 0 1 6 21v-4.03a48.527 48.527 0 0 1-1.087-.128C2.905 16.58 1.5 14.833 1.5 12.862V6.638c0-1.97 1.405-3.718 3.413-3.979Z"},child:[]},{tag:"path",attr:{d:"M15.75 7.5c-1.376 0-2.739.057-4.086.169C10.124 7.797 9 9.103 9 10.609v4.285c0 1.507 1.128 2.814 2.67 2.94 1.243.102 2.5.157 3.768.165l2.782 2.781a.75.75 0 0 0 1.28-.53v-2.39l.33-.026c1.542-.125 2.67-1.433 2.67-2.94v-4.286c0-1.505-1.125-2.811-2.664-2.94A49.392 49.392 0 0 0 15.75 7.5Z"},child:[]}]})(e)}function ise(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"},child:[]}]})(e)}function ose(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 0 1-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 0 1 1.06-1.06l7.5 7.5Z",clipRule:"evenodd"},child:[]}]})(e)}function LI(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003ZM12 8.25a.75.75 0 0 1 .75.75v3.75a.75.75 0 0 1-1.5 0V9a.75.75 0 0 1 .75-.75Zm0 8.25a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z",clipRule:"evenodd"},child:[]}]})(e)}function z7e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M10.5 3.75a6.75 6.75 0 1 0 0 13.5 6.75 6.75 0 0 0 0-13.5ZM2.25 10.5a8.25 8.25 0 1 1 14.59 5.28l4.69 4.69a.75.75 0 1 1-1.06 1.06l-4.69-4.69A8.25 8.25 0 0 1 2.25 10.5Z",clipRule:"evenodd"},child:[]}]})(e)}function W7e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.006 5.404.434c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.434 2.082-5.005Z",clipRule:"evenodd"},child:[]}]})(e)}function sse(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M8.25 6.75a3.75 3.75 0 1 1 7.5 0 3.75 3.75 0 0 1-7.5 0ZM15.75 9.75a3 3 0 1 1 6 0 3 3 0 0 1-6 0ZM2.25 9.75a3 3 0 1 1 6 0 3 3 0 0 1-6 0ZM6.31 15.117A6.745 6.745 0 0 1 12 12a6.745 6.745 0 0 1 6.709 7.498.75.75 0 0 1-.372.568A12.696 12.696 0 0 1 12 21.75c-2.305 0-4.47-.612-6.337-1.
142684a.75.75 0 0 1-.372-.568 6.787 6.787 0 0 1 1.019-4.38Z",clipRule:"evenodd"},child:[]},{tag:"path",attr:{d:"M5.082 14.254a8.287 8.287 0 0 0-1.308 5.135 9.687 9.687 0 0 1-1.764-.44l-.115-.04a.563.563 0 0 1-.373-.487l-.01-.121a3.75 3.75 0 0 1 3.57-4.047ZM20.226 19.389a8.287 8.287 0 0 0-1.308-5.135 3.75 3.75 0 0 1 3.57 4.047l-.01.121a.563.563 0 0 1-.373.486l-.115.04c-.567.2-1.156.349-1.764.441Z"},child:[]}]})(e)}function q7e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"},child:[]}]})(e)}function ase(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 6h9.75M10.5 6a1.5 1.5 0 1 1-3 0m3 0a1.5 1.5 0 1 0-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-9.75 0h9.75"},child:[]}]})(e)}function G7e(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"},child:[]}]})(e)}function K7e(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 13.5 12 21m0 0-7.5-7.5M12 21V3"},child:[]}]})(e)}function Y7e(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 12c0-1.232-.046-2.453-.138-3.662a4.006 4.006 0 0 0-3.7-3.7 48.678 48.678 0 0 0-7.324 0 4.006 4.006 0 0 0-3.7 3.7c-.017.22-.032.441-.046.662M19.5 12l3-3m-3 3-3-3m-12 3c0 1.232.046 2.453.138 3.662a4.006 4.006 0 0 0 3.7 3.7 48.656 48.656 0 0 0 7.324 0 4.006 4.006 0 0 0 3.7-3.7c.017-.22.032-.441.046-.662M4.5 12l3 3m-3-3-3 3"},child:[]}]})(e)}function Z7e(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"},child:[]}]})(e)}function lse(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0 0 13.5 3h-6a2.25 2.25 0 0 0-2.25 2.25v13.5A2.25 2.25 0 0 0 7.5 21h6a2.25 2.25 0 0 0 2.25-2.25V15m3 0 3-3m0 0-3-3m3 3H9"},child:[]}]})(e)}function X7e(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"},child:[]}]})(e)}function J7e(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"},child:[]}]})(e)}function Q7e(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 18 9 11.25l4.306 4.306a11.95 11.95 0 0 1 5.814-5.518l2.74-1.22m0 0-5.94-2.281m5.94 2.28-2.28 5.941"},child:[]}]})(e)}function eSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"},child:[]}]})(e)}function tSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 10.5 12 3m0 0 7.5 7.5M12 3v18"},child:[]}]})(e)}function rSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7.5 7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5"},child:[]}]})(e)}function nSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 12a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Zm0 0c0 1.657 1.007 3 2.25 3S21 13.657 21 12a9 9 0 1 0-2.636 6.364M16.5 12V8.25"},child:[]}]})(e)}function cse(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 18.75a60.07 60.07 0 0 1 15.797 2.101c.727.198 1.453-.342 1.453-1.096V18.75M3.75 4.5v.75A.75.75 0 0 1 3 6h-.75m0 0v-.375c0-.621.504-1.125 1.125-1.125H20.25M2.25 6v9m18-10.5v.75c0 .414.336.75.75.75h.75m-1.5-1.5h.375c.621 0 1.125.504 1.125 1.125v9.75c0 .621-.504 1.125-1.125 1.125h-.375m1.5-1.5H21a.75.75 0 0 0-.75.75v.75m0 0H3.75m0 0h-.375a1.125 1.125 0 0 1-1.125-1.125V15m1.5 1.5v-.75A.75.75 0 0 0 3 15h-.75M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm3 0h.008v.008H18V10.5Zm-12 0h.008v.008H6V10.5Z"},child:[]}]})(e)}function iSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25H12"},child:[]}]})(e)}function oSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"},child:[]}]})(e)}function use(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0"},child:[]}]})(e)}function sSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6.042A8.967 8.967 0 0 0 6 3.75c-1.052 0-2.062.18-3 .512v14.25A8.987 8.987 0 0 1 6 18c2.305 0 4.408.867 6 2.292m0-14.25a8.966 8.966 0 0 1 6-2.292c1.052 0 2.062.18 3 .512v14.25A8.987 8.987 0 0 0 18 18a8.967 8.967 0 0 0-6 2.292m0-14.25v14.25"},child:[]}]})(e)}function aSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 21h19.5m-18-18v18m10.5-18v18m6-13.5V21M6.75 6.75h.75m-.75 3h.75m-.75 3h.75m3-6h.75m-.75 3h.75m-.75 3h.75M6.75 21v-3.375c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21M3 3h12m-.75 4.5H2
1421m-3.75 3.75h.008v.008h-.008v-.008Zm0 3h.008v.008h-.008v-.008Zm0 3h.008v.008h-.008v-.008Z"},child:[]}]})(e)}function lSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 21v-7.5a.75.75 0 0 1 .75-.75h3a.75.75 0 0 1 .75.75V21m-4.5 0H2.36m11.14 0H18m0 0h3.64m-1.39 0V9.349M3.75 21V9.349m0 0a3.001 3.001 0 0 0 3.75-.615A2.993 2.993 0 0 0 9.75 9.75c.896 0 1.7-.393 2.25-1.016a2.993 2.993 0 0 0 2.25 1.016c.896 0 1.7-.393 2.25-1.015a3.001 3.001 0 0 0 3.75.614m-16.5 0a3.004 3.004 0 0 1-.621-4.72l1.189-1.19A1.5 1.5 0 0 1 5.378 3h13.243a1.5 1.5 0 0 1 1.06.44l1.19 1.189a3 3 0 0 1-.621 4.72M6.75 18h3.75a.75.75 0 0 0 .75-.75V13.5a.75.75 0 0 0-.75-.75H6.75a.75.75 0 0 0-.75.75v3.75c0 .414.336.75.75.75Z"},child:[]}]})(e)}function cSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 15.75V18m-7.5-6.75h.008v.008H8.25v-.008Zm0 2.25h.008v.008H8.25V13.5Zm0 2.25h.008v.008H8.25v-.008Zm0 2.25h.008v.008H8.25V18Zm2.498-6.75h.007v.008h-.007v-.008Zm0 2.25h.007v.008h-.007V13.5Zm0 2.25h.007v.008h-.007v-.008Zm0 2.25h.007v.008h-.007V18Zm2.504-6.75h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V13.5Zm0 2.25h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V18Zm2.498-6.75h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V13.5ZM8.25 6h7.5v2.25h-7.5V6ZM12 2.25c-1.892 0-3.758.11-5.593.322C5.307 2.7 4.5 3.65 4.5 4.757V19.5a2.25 2.25 0 0 0 2.25 2.25h10.5a2.25 2.25 0 0 0 2.25-2.25V4.757c0-1.108-.806-2.057-1.907-2.185A48.507 48.507 0 0 0 12 2.25Z"},child:[]}]})(e)}function uSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5m-9-6h.008v.008H12v-.008ZM12 15h.008v.008H12V15Zm0 2.25h.008v.008H12v-.008ZM9.75 15h.008v.008H9.75V15Zm0 2.25h.008v.008H9.75v-.008ZM7.5 15h.008v.008H7.5V15Zm0 2.25h.008v.008H7.5v-.008Zm6.75-4.5h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V15Zm0 2.25h.008v.008h-.008v-.008Zm2.25-4.5h.008v.008H16.5v-.008Zm0 2.25h.008v.008H16.5V15Z"},child:[]}]})(e)}function dSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.827 6.175A2.31 2.31 0 0 1 5.186 7.23c-.38.054-.757.112-1.134.175C2.999 7.58 2.25 8.507 2.25 9.574V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9.574c0-1.067-.75-1.994-1.802-2.169a47.865 47.865 0 0 0-1.134-.175 2.31 2.31 0 0 1-1.64-1.055l-.822-1.316a2.192 2.192 0 0 0-1.736-1.039 48.774 48.774 0 0 0-5.232 0 2.192 2.192 0 0 0-1.736 1.039l-.821 1.316Z"},child:[]},{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 12.75a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0ZM18.75 10.5h.008v.008h-.008V10.5Z"},child:[]}]})(e)}function $I(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 0 1 3 19.875v-6.75ZM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V8.625ZM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V4.125Z"},child:[]}]})(e)}function DI(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 0 1-.825-.242m9.345-8.334a2.126 2.126 0 0 0-.476-.
142095 48.64 48.64 0 0 0-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0 0 11.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"},child:[]}]})(e)}function MI(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 0 1-1.043 3.296 3.745 3.745 0 0 1-3.296 1.043A3.745 3.745 0 0 1 12 21c-1.268 0-2.39-.63-3.068-1.593a3.746 3.746 0 0 1-3.296-1.043 3.745 3.745 0 0 1-1.043-3.296A3.745 3.745 0 0 1 3 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 0 1 1.043-3.296 3.746 3.746 0 0 1 3.296-1.043A3.746 3.746 0 0 1 12 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 0 1 3.296 1.043 3.746 3.746 0 0 1 1.043 3.296A3.745 3.745 0 0 1 21 12Z"},child:[]}]})(e)}function hSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"},child:[]}]})(e)}function dse(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"},child:[]}]})(e)}function fSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},child:[]}]})(e)}function pSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5 8.25 12l7.5-7.5"},child:[]}]})(e)}function mSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"},child:[]}]})(e)}function gSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"},child:[]}]})(e)}function vSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"},child:[]}]})(e)}function ySe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25ZM6.75 12h.008v.008H6.75V12Zm0 3h.008v.008H6.75V15Zm0 3h.008v.008H6.75V18Z"},child:[]}]})(e)}function TE(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 7.5V6.108c0-1.135.845-2.098 1.976-2.192.373-.03.748-.057 1.123-.08M15.75 18H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08M15.75 18.75v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5A3.375 3.375 0 0 0 6.375 7.5H5.25m11.9-3.664A2.251 2.251 0 0 0 15 2.25h-1.5a2.251 2.251 0 0 0-2.15 1.586m5.8 0c.065.21.1.433.1.664v.75h-6V4.5c0-.231.035-.454.1-.664M6.75 7.5H4.875c-.621 0-1.125.504-1.125 1.125v12c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V16.5a9 9 0 0 0-9-9Z"},child:[]}]})(e)}function _Se(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"},child:[]}]})(e)}function bSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9.75v6.75m0 0-3-3m3 3 3-3m-8.25 6a4.5 4.5 0 0 1-1.41-8.775 5.25 5.25 0 0 1 10.233-2.33 3 3 0 0 1 3.758 3.848A3.752 3.752 0 0 1 18 19.5H6.75Z"},child:[]}]})(e)}function hse(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.
142074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"},child:[]},{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"},child:[]}]})(e)}function xSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25"},child:[]}]})(e)}function Pl(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 8.25h19.5M2.25 9h19.5m-16.5 5.25h6m-6 2.25h3m-3.75 3h15a2.25 2.25 0 0 0 2.25-2.25V6.75A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25v10.5A2.25 2.25 0 0 0 4.5 19.5Z"},child:[]}]})(e)}function wSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 7.5-9-5.25L3 7.5m18 0-9 5.25m9-5.25v9l-9 5.25M3 7.5l9 5.25M3 7.5v9l9 5.25m0-9v9"},child:[]}]})(e)}function ESe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 1.5H8.25A2.25 2.25 0 0 0 6 3.75v16.5a2.25 2.25 0 0 0 2.25 2.25h7.5A2.25 2.25 0 0 0 18 20.25V3.75a2.25 2.25 0 0 0-2.25-2.25H13.5m-3 0V3h3V1.5m-3 0h3m-3 18.75h3"},child:[]}]})(e)}function AE(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m6.75 12-3-3m0 0-3 3m3-3v6m-1.5-15H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"},child:[]}]})(e)}function fse(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"},child:[]}]})(e)}function SSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 12.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 18.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5Z"},child:[]}]})(e)}function pse(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0v.243a2.25 2.25 0 0 1-1.07 1.916l-7.5 4.615a2.25 2.25 0 0 1-2.36 0L3.32 8.91a2.25 2.25 0 0 1-1.07-1.916V6.75"},child:[]}]})(e)}function CSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m9-.75
142a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"},child:[]}]})(e)}function TSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"},child:[]}]})(e)}function ASe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"},child:[]}]})(e)}function kSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"},child:[]},{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"},child:[]}]})(e)}function RSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h1.5C5.496 19.5 6 18.996 6 18.375m-3.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-1.5A1.125 1.125 0 0 1 18 18.375M20.625 4.5H3.375m17.25 0c.621 0 1.125.504 1.125 1.125M20.625 4.5h-1.5C18.504 4.5 18 5.004 18 5.625m3.75 0v1.5c0 .621-.504 1.125-1.125 1.125M3.375 4.5c-.621 0-1.125.504-1.125 1.125M3.375 4.5h1.5C5.496 4.5 6 5.004 6 5.625m-3.75 0v1.5c0 .621.504 1.125 1.125 1.125m0 0h1.5m-1.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m1.5-3.75C5.496 8.25 6 7.746 6 7.125v-1.5M4.875 8.25C5.496 8.25 6 8.754 6 9.375v1.5m0-5.25v5.25m0-5.25C6 5.004 6.504 4.5 7.125 4.5h9.75c.621 0 1.125.504 1.125 1.125m1.125 2.625h1.5m-1.5 0A1.125 1.125 0 0 1 18 7.125v-1.5m1.125 2.625c-.621 0-1.125.504-1.125 1.125v1.5m2.625-2.625c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125M18 5.625v5.25M7.125 12h9.75m-9.75 0A1.125 1.125 0 0 1 6 10.875M7.125 12C6.504 12 6 12.504 6 13.125m0-2.25C6 11.496 5.496 12 4.875 12M18 10.875c0 .621-.504 1.125-1.125 1.125M18 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m-12 5.25v-5.25m0 5.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125m-12 0v-1.5c0-.621-.504-1.125-1.125-1.125M18 18.375v-5.25m0 5.25v-1.5c0-.621.504-1.125 1.125-1.125M18 13.125v1.5c0 .621.504 1.125 1.125 1.125M18 13.125c0-.621.504-1.125 1.125-1.125M6 13.125v1.5c0 .621-.504 1.125-1.125 1.125M6 13.125C6 12.504 5.496 12 4.875 12m-1.5 0h1.5m-1.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M19.125 12h1.5m0 0c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h1.5m14.25 0h1.5"},child:[]}]})(e)}function s3(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 9.776c.112-.017.227-.026.344-.026h15.812c.117 0 .232.009.344.026m-16.5 0a2.25 2.25 0 0 0-1.883 2.542l.857 6a2.25 2.25 0 0 0 2.227 1.932H19.05a2.25 2.25 0 0 0 2.227-1.932l.857-6a2.25 2.25 0 0 0-1.883-2.542m-16.5 0V6A2.25 2.25 0 0 1 6 3.75h3.879a1.5 1.5 0 0 1 1.06.44l2.122 2.12a1.5 1.5 0 0 0 1.06.44H18A2.25 2.25 0 0 1 20.25 9v.776"},child:[]}]})(e)}function ISe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32
1420 0 1 12 3Z"},child:[]}]})(e)}function mse(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 11.25v8.25a1.5 1.5 0 0 1-1.5 1.5H5.25a1.5 1.5 0 0 1-1.5-1.5v-8.25M12 4.875A2.625 2.625 0 1 0 9.375 7.5H12m0-2.625V7.5m0-2.625A2.625 2.625 0 1 1 14.625 7.5H12m0 0V21m-8.625-9.75h18c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125h-18c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"},child:[]}]})(e)}function a3(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418"},child:[]}]})(e)}function PSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.05 4.575a1.575 1.575 0 1 0-3.15 0v3m3.15-3v-1.5a1.575 1.575 0 0 1 3.15 0v1.5m-3.15 0 .075 5.925m3.075.75V4.575m0 0a1.575 1.575 0 0 1 3.15 0V15M6.9 7.575a1.575 1.575 0 1 0-3.15 0v8.175a6.75 6.75 0 0 0 6.75 6.75h2.018a5.25 5.25 0 0 0 3.712-1.538l1.732-1.732a5.25 5.25 0 0 0 1.538-3.712l.003-2.024a.668.668 0 0 1 .198-.471 1.575 1.575 0 1 0-2.228-2.228 3.818 3.818 0 0 0-1.12 2.687M6.9 7.575V12m6.27 4.318A4.49 4.49 0 0 1 16.35 15m.002 0h-.002"},child:[]}]})(e)}function OSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 8.25c0-2.485-2.099-4.5-4.688-4.5-1.935 0-3.597 1.126-4.312 2.733-.715-1.607-2.377-2.733-4.313-2.733C5.1 3.75 3 5.765 3 8.25c0 7.22 9 12 9 12s9-4.78 9-12Z"},child:[]}]})(e)}function jSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"},child:[]}]})(e)}function LSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"},child:[]}]})(e)}function $Se(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.712 4.33a9.027 9.027 0 0 1 1.652 1.306c.51.51.944 1.064 1.306 1.652M16.712 4.33l-3.448 4.138m3.448-4.138a9.014 9.014 0 0 0-9.424 0M19.67 7.288l-4.138 3.448m4.138-3.448a9.014 9.014 0 0 1 0 9.424m-4.138-5.976a3.736 3.736 0 0 0-.88-1.388 3.737 3.737 0 0 0-1.388-.88m2.268 2.268a3.765 3.765 0 0 1 0 2.528m-2.268-4.796a3.765 3.765 0 0 0-2.528 0m4.796 4.796c-.181.506-.475.982-.88 1.388a3.736 3.736 0 0 1-1.388.88m2.268-2.268 4.138 3.448m0 0a9.027 9.027 0 0 1-1.306 1.652c-.51.51-1.064.944-1.652 1.306m0 0-3.448-4.138m3.448 4.138a9.014 9.014 0 0 1-9.424 0m5.976-4.138a3.765 3.765 0 0 1-2.528 0m0 0a3.736 3.736 0 0 1-1.388-.88 3.737 3.737 0 0 1-.88-1.388m2.268 2.268L7.288 19.67m0 0a9.024 9.024 0 0 1-1.652-1.306 9.027 9.027 0 0 1-1.306-1.652m0 0 4.138-3.448M4.33 16.712a9.014 9.014 0 0 1 0-9.424m4.138 5.976a3.765 3.765 0 0 1 0-2.528m0 0c.181-.506.475-.982.88-1.388a3.736 3.736 0 0 1 1.388-.88m-2.268 2.268L4.33 7.288m6.406 1.18L7.288 4.33m0 0a9.024 9.024 0 0 0-1.652 1.306A9.025 9.025 0 0 0 4.33 7.288"},child:[]}]})(e)}function DSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18v-5.25m0 0a6.01 6.01 0 0 0 1.5-.189m-1.5.189a6.01 6.01 0 0 1-1.5-.189m3.75 7.478a12.06 12.06 0 0 1-4.5 0m3.75 2.383a14.406 14.406 0 0 1-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 1 0-7.517 0c.85.493 1.509 1.333 1.509 2.316V18"},child:[]}]})(e)}function MSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"},child:[]}]})(e)}function NSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z"},child:[]}]})(e)}function FSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"},child:[]}]})(e)}function USe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"},child:[]},{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1 1 15 0Z"},child:[]}]})(e)}function BSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.34 15.84c-.688-.06-1.386-.09-2.09-.09H7.5a4.5 4.5 0 1 1 0-9h.75c.704 0 1.402-.03 2.09-.09m0 9.18c.253.962.584 1.892.985 2.783.247.55.06 1.21-.463 1.511l-.657.38c-.551.318-1.26.117-1.527-.461a20.845 20.845 0 0 1-1.44-4.282m3.102.069a18.03 18.03 0 0 1-.59-4.59c0-1.586.205-3.124.59-4.59m0 9.18a23.848 23.848 0 0 1 8.835 2.535M10.34 6.66a23.847 23.847 0 0 0 8.835-2.535m0 0A23.74 23.74 0 0 0 18.795 3m.38 1.125a23.91 23.91 0 0 1 1.014 5.395m-1.014 8.855c-.118.38-.245.754-.38 1.125m.38-1.125a23.91 23.91 0 0 0 1.014-5.395m0-3.46c.495.413.811 1.035.811 1.73 0 .695-.316 1.317-.811 1.73m0-3.46a24.347 24.347 0 0 1 0 3.46"},child:[]}]})(e)}function gse(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.53 16.122a3 3 0 0 0-5.78 1.128 2.25 2.25 0 0 1-2.4 2.245 4.5 4.5 0 0 0 8.4-2.245c0-.399-.078-.78-.22-1.128Zm0 0a15.998 15.998 0 0 0 3.388-1.62m-5.043-.025a15.994 15.994 0 0 1 1.622-3.395m3.42 3.42a15.995 15.995 0 0 0 4.764-4.648l3.876-5.814a1.151 1.151 0 0 0-1.597-1.597L14.146 6.32a15.996 15.996 0 0 0-4.649 4.763m3.42 3.42a6.776 6.776 0 0 0-3.42-3.42"},child:[]}]})(e)}function VSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"},child:[]}]})(e)}function W2(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"},child:[]}]})(e)}function HSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"},child:[]},{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.91 11.672a.375.375 0 0 1 0 .656l-5.603 3.113a.375.375 0 0 1-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112Z"},child:[]}]})(e)}function zSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 5.
142653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 0 1 0 1.972l-11.54 6.347a1.125 1.125 0 0 1-1.667-.986V5.653Z"},child:[]}]})(e)}function WSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"},child:[]}]})(e)}function qSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.72 13.829c-.24.03-.48.062-.72.096m.72-.096a42.415 42.415 0 0 1 10.56 0m-10.56 0L6.34 18m10.94-4.171c.24.03.48.062.72.096m-.72-.096L17.66 18m0 0 .229 2.523a1.125 1.125 0 0 1-1.12 1.227H7.231c-.662 0-1.18-.568-1.12-1.227L6.34 18m11.318 0h1.091A2.25 2.25 0 0 0 21 15.75V9.456c0-1.081-.768-2.015-1.837-2.175a48.055 48.055 0 0 0-1.913-.247M6.34 18H5.25A2.25 2.25 0 0 1 3 15.75V9.456c0-1.081.768-2.015 1.837-2.175a48.041 48.041 0 0 1 1.913-.247m10.5 0a48.536 48.536 0 0 0-10.5 0m10.5 0V3.375c0-.621-.504-1.125-1.125-1.125h-8.25c-.621 0-1.125.504-1.125 1.125v3.659M18 10.5h.008v.008H18V10.5Zm-3 0h.008v.008H15V10.5Z"},child:[]}]})(e)}function GSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 4.875c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5A1.125 1.125 0 0 1 3.75 9.375v-4.5ZM3.75 14.625c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5a1.125 1.125 0 0 1-1.125-1.125v-4.5ZM13.5 4.875c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5A1.125 1.125 0 0 1 13.5 9.375v-4.5Z"},child:[]},{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 6.75h.75v.75h-.75v-.75ZM6.75 16.5h.75v.75h-.75v-.75ZM16.5 6.75h.75v.75h-.75v-.75ZM13.5 13.5h.75v.75h-.75v-.75ZM13.5 19.5h.75v.75h-.75v-.75ZM19.5 13.5h.75v.75h-.75v-.75ZM19.5 19.5h.75v.75h-.75v-.75ZM16.5 16.5h.75v.75h-.75v-.75Z"},child:[]}]})(e)}function KSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"m9 14.25 6-6m4.5-3.493V21.75l-3.75-1.5-3.75 1.5-3.75-1.5-3.75 1.5V4.757c0-1.108.806-2.057 1.907-2.185a48.507 48.507 0 0 1 11.186 0c1.1.128 1.907 1.077 1.907 2.185ZM9.75 9h.008v.008H9.75V9Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm4.125 4.5h.008v.008h-.008V13.5Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"},child:[]}]})(e)}function YSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 7.125C2.25 6.504 2.754 6 3.375 6h6c.621 0 1.125.504 1.125 1.125v3.75c0 .621-.504 1.125-1.125 1.125h-6a1.125 1.125 0 0 1-1.125-1.125v-3.75ZM14.25 8.625c0-.621.504-1.125 1.125-1.125h5.25c.621 0 1.125.504 1.125 1.125v8.25c0 .621-.504 1.125-1.125 1.125h-5.25a1.125 1.125 0 0 1-1.125-1.125v-8.25ZM3.75 16.125c0-.621.504-1.125 1.125-1.125h5.25c.621 0 1.125.504 1.125 1.125v2.25c0 .621-.504 1.125-1.125 1.125h-5.25a1.125 1.125 0 0 1-1.125-1.125v-2.25Z"},child:[]}]})(e)}function ZSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v17.25m0 0c-1.472 0-2.882.265-4.185.75M12 20.25c1.472 0 2.882.265 4.185.75M18.75 4.97A48.416 48.416 0 0 0 12 4.5c-2.291 0-4.545.16-6.75.47m13.5 0c1.01.143 2.01.317 3 .52m-3-.52 2.62 10.726c.122.499-.106 1.028-.589 1.202a5.988 5.988 0 0 1-2.031.352 5.988 5.988 0 0 1-2.031-.352c-.483-.174-.711-.703-.59-1.202L18.75 4.971Zm-16.5.52c.99-.203 1.99-.377 3-.52m0 0 2.62 10.726c.122.499-.106 1.028-.589 1.202a5.989 5.989 0 0 1-2.031.352 5.989 5.989 0 0 1-2.031-.352c-.483-.174-.711-.703-.59
142-1.202L5.25 4.971Z"},child:[]}]})(e)}function XSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"},child:[]}]})(e)}function JSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 10.5V6a3.75 3.75 0 1 0-7.5 0v4.5m11.356-1.993 1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 0 1-1.12-1.243l1.264-12A1.125 1.125 0 0 1 5.513 7.5h12.974c.576 0 1.059.435 1.119 1.007ZM8.625 10.5a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm7.5 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"},child:[]}]})(e)}function QSe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 3h1.386c.51 0 .955.343 1.087.835l.383 1.437M7.5 14.25a3 3 0 0 0-3 3h15.75m-12.75-3h11.218c1.121-2.3 2.1-4.684 2.924-7.138a60.114 60.114 0 0 0-16.536-1.84M7.5 14.25 5.106 5.272M6 20.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Zm12.75 0a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z"},child:[]}]})(e)}function Ol(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"},child:[]}]})(e)}function eCe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 8.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v8.25A2.25 2.25 0 0 0 6 16.5h2.25m8.25-8.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-7.5A2.25 2.25 0 0 1 8.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 0 0-2.25 2.25v6"},child:[]}]})(e)}function tCe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18v-2.25Z"},child:[]}]})(e)}function vse(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.48 3.499a.562.562 0 0 1 1.04 0l2.125 5.111a.563.563 0 0 0 .475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 0 0-.182.557l1.285 5.385a.562.562 0 0 1-.84.61l-4.725-2.885a.562.562 0 0 0-.586 0L6.982 20.54a.562.562 0 0 1-.84-.61l1.285-5.386a.562.562 0 0 0-.182-.557l-4.204-3.602a.562.562 0 0 1 .321-.988l5.518-.442a.563.563 0 0 0 .475-.345L11.48 3.5Z"},child:[]}]})(e)}function rCe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.098 19.902a3.75 3.75 0 0 0 5.304 0l6.401-6.402M6.75 21A3.75 3.75 0 0 1 3 17.25V4.125C3 3.504 3.504 3 4.125 3h5.25c.621 0 1.125.504 1.125 1.125v4.072M6.75 21a3.75 3.75 0 0 0 3.75-3.75V8.197M6.75 21h13.125c.621 0 1.125-.504 1.125-1.125v-5.25c0-.621-.504-1.125-1.125-1.125h-4.072M10.5 8.197l2.88-2.88c.438-.439 1.15-.439 1.59 0l3.712 3.713c.44.44.44 1.152 0 1.59l-2.879 2.88M6.75 17.25h.008v.008H6.75v-.008Z"},child:[]}]})(e)}function G1(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0 1 12 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.
142621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5"},child:[]}]})(e)}function l3(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.568 3H5.25A2.25 2.25 0 0 0 3 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 0 0 5.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 0 0 9.568 3Z"},child:[]},{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6h.008v.008H6V6Z"},child:[]}]})(e)}function nCe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"},child:[]}]})(e)}function yse(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 18.75a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m3 0h6m-9 0H3.375a1.125 1.125 0 0 1-1.125-1.125V14.25m17.25 4.5a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m3 0h1.125c.621 0 1.129-.504 1.09-1.124a17.902 17.902 0 0 0-3.213-9.193 2.056 2.056 0 0 0-1.58-.86H14.25M16.5 18.75h-2.25m0-11.177v-.958c0-.568-.422-1.048-.987-1.106a48.554 48.554 0 0 0-10.026 0 1.106 1.106 0 0 0-.987 1.106v7.635m12-6.677v6.677m0 4.5v-4.5m0 0h-12"},child:[]}]})(e)}function c3(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 18.72a9.094 9.094 0 0 0 3.741-.479 3 3 0 0 0-4.682-2.72m.94 3.198.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0 1 12 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 0 1 6 18.719m12 0a5.971 5.971 0 0 0-.941-3.197m0 0A5.995 5.995 0 0 0 12 12.75a5.995 5.995 0 0 0-5.058 2.772m0 0a3 3 0 0 0-4.681 2.72 8.986 8.986 0 0 0 3.74.477m.94-3.197a5.971 5.971 0 0 0-.94 3.197M15 6.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm6 3a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Zm-13.5 0a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Z"},child:[]}]})(e)}function iCe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"m15.75 10.5 4.72-4.72a.75.75 0 0 1 1.28.53v11.38a.75.75 0 0 1-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25h-9A2.25 2.25 0 0 0 2.25 7.5v9a2.25 2.25 0 0 0 2.25 2.25Z"},child:[]}]})(e)}function oCe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 4.5v15m6-15v15m-10.875 0h15.75c.621 0 1.125-.504 1.125-1.125V5.625c0-.621-.504-1.125-1.125-1.125H4.125C3.504 4.5 3 5.004 3 5.625v12.75c0 .621.504 1.125 1.125 1.125Z"},child:[]}]})(e)}function sCe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18
14218 6M6 6l12 12"},child:[]}]})(e)}function aCe(e){return ee({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M9.293 2.293a1 1 0 0 1 1.414 0l7 7A1 1 0 0 1 17 11h-1v6a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-6H3a1 1 0 0 1-.707-1.707l7-7Z",clipRule:"evenodd"},child:[]}]})(e)}function NI(){const e=qe.getPlatform();if(e==="ios"){if(typeof navigator>"u")return"celular";const t=navigator.userAgent;return/iPad/.test(t)||navigator.maxTouchPoints>1&&/Mac/.test(t)?"tablet":"celular"}if(e==="android")return typeof window>"u"?"celular":Math.min(window.innerWidth,window.innerHeight)>=600?"tablet":"celular";if(e==="web"){const t=FI();return t==="mac"?"Mac":"computador"}return"dispositivo"}function FI(){if(typeof navigator>"u")return"unknown";const e=navigator.userAgentData;if(e!=null&&e.platform){const r=e.platform.toLowerCase();if(r.includes("mac"))return"mac";if(r.includes("win"))return"windows";if(r.includes("linux"))return"linux"}const t=navigator.userAgent;return/Macintosh|MacIntel|Mac_PowerPC|Mac OS X/i.test(t)?"mac":/Windows/i.test(t)?"windows":/Linux|X11/i.test(t)?"linux":"unknown"}function UI(){return Et({queryKey:["clock-skew"],queryFn:async()=>{const e=new URLSearchParams({clientTime:String(Date.now()),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||"",platform:qe.getPlatform()}),t=await fetch(`https://catalogo.stoqui.com.br/api/clock-skew?${e}`);if(!t.ok)throw new Error(`clock-skew check failed: ${t.status}`);return await t.json()},staleTime:30*1e3,gcTime:30*60*1e3,refetchOnWindowFocus:!0,retry:!1})}function _se(){const e=At(),t=sn(),r=v.useMemo(NI,[]),{data:n}=UI();return!((n==null?void 0:n.isOk)===!1)||t.pathname==="/clock-skew"?null:c.jsx(F,{component:"button",type:"button",role:"alert","aria-label":"Configurações de data e hora incorretas. Toque para corrigir.",onClick:()=>e("/clock-skew"),sx:{position:"fixed",top:"calc(var(--safe-area-inset-top, 0px) + 12px)",left:12,right:12,zIndex:2147483647,bgcolor:"#DC2626",color:"#FFFFFF",cursor:"pointer",px:2,py:1.75,borderRadius:2,border:"none",textAlign:"left",font:"inherit",WebkitTapHighlightColor:"transparent","&:focus-visible":{outline:"2px solid #FFFFFF",outlineOffset:2}},children:c.jsxs(me,{direction:"row",alignItems:"flex-start",spacing:1.5,children:[c.jsx(LI,{size:24,style:{flexShrink:0,marginTop:2},"aria-hidden":!0}),c.jsxs(me,{spacing:.5,sx:{flex:1},children:[c.jsxs(V,{sx:{fontSize:15,fontWeight:600,lineHeight:1.4,color:"inherit"},children:["As configurações de data e hora do seu ",r," estão incorretas. Isso pode impedir o login e o uso do app."]}),c.jsx(V,{sx:{fontSize:13,fontWeight:500,lineHeight:1.4,opacity:.92,color:"inherit"},children:"Toque para corrigir"})]}),c.jsx(ose,{size:22,style:{flexShrink:0,marginTop:2},"aria-hidden":!0})]})})}const bse=()=>{const e=sn();return v.useEffect(()=>{const t=e.pathname;$V(t)},[e]),null},xse=111,wse=24,Ese={android:"https://play.google.com/store/apps/details?id=br.com.stoqui",ios:"https://apps.apple.com/br/app/stoqui-cat%C3%A1logo-e-vendas/id6755399008"},Sse=()=>{const[e,t]=v.useState(!1),[r,n]=v.useState("");v.useEffect(()=>{(async()=>{const a=qe.getPlatform();if(a!=="android"&&a!=="ios")return;const l=a==="android"?xse:wse;try{const d=await sc.getInfo(),u=parseInt(d.build);u<l&&(n(a),t(!0),pe("minimum_version_dialog_shown",{platform:a,current_version:u,minimum_version:l,version_difference:l-u}))}catch(d){console.error("Error checking app version:",d)}})()},[]);const i=()=>{pe("minimum_version_update_clicked",{platform:r}),window.open(Ese[r],"_blank")},o=r==="ios"?"App Store":"Google Play";return c.jsxs(Fr,{open:e,disableEscapeKeyDown:!0,onClose:()=>{},children:[c.jsx(zr,{children:"Nova versão disponÃvel"}),c.jsx(Er,{children:c.jsxs(vi,{children:["Uma nova versão do Stoqui está disponÃvel na ",o,". Para continuar usando, atualize para a versão mais recente."]})}),c.jsx(nn,{children:c.jsx(De,{onClick:i,color:"primary",children:"Atualizar"})})]})};/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:BI,setPrototypeOf:kE,isFrozen:Cse,getPrototypeOf:Tse,getOwnPropertyDescriptor:Ase}=Object;let{freeze:oi,seal:so,create:VI}
142=Object,{apply:Ty,construct:Ay}=typeof Reflect<"u"&&Reflect;oi||(oi=function(t){return t});so||(so=function(t){return t});Ty||(Ty=function(t,r,n){return t.apply(r,n)});Ay||(Ay=function(t,r){return new t(...r)});const zp=si(Array.prototype.forEach),kse=si(Array.prototype.lastIndexOf),RE=si(Array.prototype.pop),Ld=si(Array.prototype.push),Rse=si(Array.prototype.splice),L0=si(String.prototype.toLowerCase),q2=si(String.prototype.toString),IE=si(String.prototype.match),$d=si(String.prototype.replace),Ise=si(String.prototype.indexOf),Pse=si(String.prototype.trim),mo=si(Object.prototype.hasOwnProperty),Zn=si(RegExp.prototype.test),Dd=Ose(TypeError);function si(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return Ty(e,t,n)}}function Ose(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Ay(e,r)}}function Bt(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:L0;kE&&kE(e,null);let n=t.length;for(;n--;){let i=t[n];if(typeof i=="string"){const o=r(i);o!==i&&(Cse(t)||(t[n]=o),i=o)}e[i]=!0}return e}function jse(e){for(let t=0;t<e.length;t++)mo(e,t)||(e[t]=null);return e}function As(e){const t=VI(null);for(const[r,n]of BI(e))mo(e,r)&&(Array.isArray(n)?t[r]=jse(n):n&&typeof n=="object"&&n.constructor===Object?t[r]=As(n):t[r]=n);return t}function Md(e,t){for(;e!==null;){const n=Ase(e,t);if(n){if(n.get)return si(n.get);if(typeof n.value=="function")return si(n.value)}e=Tse(e)}function r(){return null}return r}const PE=oi(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),G2=oi(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),K2=oi(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Lse=oi(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Y2=oi(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),$se=oi(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),OE=oi(["#text"]),jE=oi(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","
142spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Z2=oi(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),LE=oi(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Wp=oi(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Dse=so(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Mse=so(/<%[\w\W]*|[\w\W]*%>/gm),Nse=so(/\$\{[\w\W]*/gm),Fse=so(/^data-[\-\w.\u00B7-\uFFFF]+$/),Use=so(/^aria-[\-\w]+$/),HI=so(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Bse=so(/^(?:\w+script|data):/i),Vse=so(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),zI=so(/^html$/i),Hse=so(/^[a-z][.\w]*(-[.\w]+)+$/i);var $E=Object.freeze({__proto__:null,ARIA_ATTR:Use,ATTR_WHITESPACE:Vse,CUSTOM_ELEMENT:Hse,DATA_ATTR:Fse,DOCTYPE_NAME:zI,ERB_EXPR:Mse,IS_ALLOWED_URI:HI,IS_SCRIPT_OR_DATA:Bse,MUSTACHE_EXPR:Dse,TMPLIT_EXPR:Nse});const Nd={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},zse=function(){return typeof window>"u"?null:window},Wse=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;
142const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const o="dompurify"+(n?"#"+n:"");try{return t.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},DE=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function WI(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:zse();const t=Be=>WI(Be);if(t.version="3.2.6",t.removed=[],!e||!e.document||e.document.nodeType!==Nd.document||!e.Element)return t.isSupported=!1,t;let{document:r}=e;const n=r,i=n.currentScript,{DocumentFragment:o,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:d,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:f,trustedTypes:p}=e,m=l.prototype,g=Md(m,"cloneNode"),y=Md(m,"remove"),b=Md(m,"nextSibling"),E=Md(m,"childNodes"),S=Md(m,"parentNode");if(typeof s=="function"){const Be=r.createElement("template");Be.content&&Be.content.ownerDocument&&(r=Be.content.ownerDocument)}let k,A="";const{implementation:w,createNodeIterator:_,createDocumentFragment:x,getElementsByTagName:C}=r,{importNode:P}=n;let I=DE();t.isSupported=typeof BI=="function"&&typeof S=="function"&&w&&w.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:O,ERB_EXPR:D,TMPLIT_EXPR:M,DATA_ATTR:U,ARIA_ATTR:$,IS_SCRIPT_OR_DATA:j,ATTR_WHITESPACE:q,CUSTOM_ELEMENT:W}=$E;let{IS_ALLOWED_URI:ne}=$E,ae=null;const re=Bt({},[...PE,...G2,...K2,...Y2,...OE]);let _e=null;const be=Bt({},[...jE,...Z2,...LE,...Wp]);let J=Object.seal(VI(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),xe=null,Ze=null,$e=!0,Le=!0,Fe=!1,ft=!0,Ge=!1,Se=!0,je=!1,Ce=!1,Pe=!1,Ue=!1,z=!1,Q=!1,ie=!0,te=!1;const he="user-content-";let ve=!0,Re=!1,He={},dt=null;const N=Bt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let T=null;const R=Bt({},["audio","video","img","source","image","track"]);let B=null;const G=Bt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),le="http://www.w3.org/1998/Math/MathML",ce="http://www.w3.org/2000/svg",Ke="http://www.w3.org/1999/xhtml";let xt=Ke,vt=!1,Rt=null;const yt=Bt({},[le,ce,Ke],q2);let Me=Bt({},["mi","mo","mn","ms","mtext"]),it=Bt({},["annotation-xml"]);const tr=Bt({},["title","style","font","a","script"]);let lt=null;const Ct=["application/xhtml+xml","text/html"],Zt="text/html";let pt=null,ur=null;const Ut=r.createElement("form"),lr=function(Y){return Y instanceof RegExp||Y instanceof Function},Ln=function(){let Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ur&&ur===Y)){if((!Y||typeof Y!="object")&&(Y={}),Y=As(Y),lt=Ct.indexOf(Y.PARSER_MEDIA_TYPE)===-1?Zt:Y.PARSER_MEDIA_TYPE,pt=lt==="application/xhtml+xml"?q2:L0,ae=mo(Y,"ALLOWED_TAGS")?Bt({},Y.ALLOWED_TAGS,pt):re,_e=mo(Y,"ALLOWED_ATTR")?Bt({},Y.ALLOWED_ATTR,pt):be,Rt=mo(Y,"ALLOWED_NAMESPACES")?Bt({},Y.ALLOWED_NAMESPACES,q2):yt,B=mo(Y,"ADD_URI_SAFE_ATTR")?Bt(As(G),Y.ADD_URI_SAFE_ATTR,pt):G,T=mo(Y,"ADD_DATA_URI_TAGS")?Bt(As(R),Y.ADD_DATA_URI_TAGS,pt):R,dt=mo(Y,"FORBID_CONTENTS")?Bt({},Y.FORBID_CONTENTS,pt):N,xe=mo(Y,"FORBID_TAGS")?Bt({},Y.FORBID_TAGS,pt):As({}),Ze=mo(Y,"FORBID_ATTR")?Bt({},Y.FORBID_ATTR,pt):As({}),He=mo(Y,"USE_PROFILES")?Y.USE_PROFILES:!1,$e=Y.ALLOW_ARIA_ATTR!==!1,Le=Y.ALLOW_DATA_ATTR!==!1,Fe=Y.ALLOW_UNKNOWN_PROTOCOLS||!1,ft=Y.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ge=Y.SAFE_FOR_TEMPLATES||!1,Se=Y.SAFE_FOR_XML!==!1,je=Y.WHOLE_DOCUMENT||!1,Ue=Y.RETURN_DOM||!1,z=Y.RETURN_DOM_FRAGMENT||!1,Q=Y.RETURN_TRUSTED_TYPE||!1,Pe=Y.FORCE_BODY||!1,ie=Y.SANITIZE_DOM!==!1,te=Y.SANITIZE_NAMED_PROPS||!1,ve=Y.KEEP_CONTENT!==!1,Re=Y.IN_PLACE||!1,ne=Y.ALLOWED_URI_REGEXP||HI,xt=Y.NAMESPACE||Ke,Me=Y.MATHML_TEXT_INTEGRATION_POINTS||Me,it=Y.HTML_INTEGRATION_POINTS||it,J=Y.CUSTOM_ELEMENT_HANDLING||{},Y.CUSTOM_ELEMENT_HANDLING&&lr(Y.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(J.tagNameCheck=Y.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Y.CUSTOM_ELEMENT_HANDLING&&lr(Y.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(J.attributeNameCheck=Y.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Y.CUSTOM_ELEMENT_HANDLING&&typeof Y.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(J.allowCustomizedBuiltInElements=Y.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ge&&(Le=!1),z&&(Ue=!0),He&&(ae=Bt({},OE),_e=[],He.html===!0&&(Bt(ae,PE),Bt(_e,jE)),He.svg===!0&&(Bt(ae,G2),Bt(_e,Z2),Bt(_e,Wp)),He.svgFilters===!0&&(Bt(ae,K2),Bt(_e,Z2),Bt(_e,Wp)),He.mathMl===!0&&(Bt(ae,Y2),Bt(_e,LE),Bt(_e,Wp))),Y.ADD_TAGS&&(ae===re&&(ae=As(ae)),Bt(ae,Y.ADD_TAGS,pt)),Y.ADD_ATTR&&(_e===be&&(_e=As(_e)),Bt(_e,Y.ADD_ATTR,pt)),Y.ADD_URI_SAFE_ATTR&&Bt(B,Y.ADD_URI_SAFE_ATTR,pt),Y.FORBID_CONTENTS&&(dt===N&&(dt=As(dt)),Bt(dt,Y.FORBID_CONTENTS,pt)),ve&&(ae["#text"]=!0),je&&Bt(ae,["html","head","body"]),ae.table&&(Bt(ae,["tbody"]),delete xe.tbody),Y.TRUSTED_TYPES_POLICY){if(typeof Y.TRUSTED_TYPES_POLICY.createHTML!="function")throw Dd('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Y.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Dd('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');k=Y.TRUSTED_TYPES_POLICY,A=k.createHTML("")}else k===void 0&&(k=Wse(p,i)),k!==null&&typeof A=="string"&&(A=k.createHTML(""));oi&&oi(Y),ur=Y}},yr=Bt({},[...G2,...K2,...Lse]),Z=Bt({},[...Y2,...$se]),se=function(Y){let ke=S(Y);(!ke||!ke.tagName)&&(ke={namespaceURI:xt,tagName:"template"});const et=L0(Y.tagName),Gt=L0(ke.tagName);return Rt[Y.namespaceURI]?Y.namespaceURI===ce?ke.namespaceURI===Ke?et==="svg":ke.namespaceURI===le?et==="svg"&&(Gt==="annotation-xml"||Me[Gt]):!!yr[et]:Y.namespaceURI===le?ke.namespaceURI===Ke?et==="math":ke.namespaceURI===ce?et==="math"&&it[Gt]:!!Z[et]:Y.namespaceURI===Ke?ke.namespaceURI===ce&&!it[Gt]||ke.namespaceURI===le&&!Me[Gt]?!1:!Z[et]&&(tr[et]||!yr[et]):!!(lt==="application/xhtml+xml"&&Rt[Y.namespaceURI]):!1},de=function(Y){Ld(t.removed,{element:Y});try{S(Y).removeChild(Y)}catch{y(Y)}},Ae=function(Y,ke){try{Ld(t.removed,{attribute:ke.getAttributeNode(Y),from:ke})}catch{Ld(t.removed,{attribute:null,from:ke})}if(ke.removeAttribute(Y),Y==="is")if(Ue||z)try{de(ke)}catch{}else try{ke.setAttribute(Y,"")}catch{}},Ve=function(Y){let ke=null,et=null;if(Pe)Y="<remove></remove>"+Y;else{const rr=IE(Y,/^[\r\n\t ]+/);et=rr&&rr[0]}lt==="application/xhtml+xml"&&xt===Ke&&(Y='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Y+"</body></html>");const Gt=k?k.createHTML(Y):Y;if(xt===Ke)try{ke=new f().parseFromString(Gt,lt)}catch{}if(!ke||!ke.documentElement){ke=w.createDocument(xt,"template",null);try{ke.documentElement.innerHTML=vt?A:Gt}catch{}}const gr=ke.body||ke.documentElement;return Y&&et&&gr.insertBefore(r.createTextNode(et),gr.childNodes[0]||null),xt===Ke?C.call(ke,je?"html":"body")[0]:je?ke.documentElement:gr},Je=function(Y){return _.call(Y.ownerDocument||Y,Y,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},at=function(Y){return Y instanceof h&&(typeof Y.nodeName!="string"||typeof Y.textContent!="string"||typeof Y.removeChild!="function"||!(Y.attributes instanceof u)||typeof Y.removeAttribute!="function"||typeof Y.
142setAttribute!="function"||typeof Y.namespaceURI!="string"||typeof Y.insertBefore!="function"||typeof Y.hasChildNodes!="function")},Qe=function(Y){return typeof a=="function"&&Y instanceof a};function Xe(Be,Y,ke){zp(Be,et=>{et.call(t,Y,ke,ur)})}const ue=function(Y){let ke=null;if(Xe(I.beforeSanitizeElements,Y,null),at(Y))return de(Y),!0;const et=pt(Y.nodeName);if(Xe(I.uponSanitizeElement,Y,{tagName:et,allowedTags:ae}),Se&&Y.hasChildNodes()&&!Qe(Y.firstElementChild)&&Zn(/<[/\w!]/g,Y.innerHTML)&&Zn(/<[/\w!]/g,Y.textContent)||Y.nodeType===Nd.progressingInstruction||Se&&Y.nodeType===Nd.comment&&Zn(/<[/\w]/g,Y.data))return de(Y),!0;if(!ae[et]||xe[et]){if(!xe[et]&&Oe(et)&&(J.tagNameCheck instanceof RegExp&&Zn(J.tagNameCheck,et)||J.tagNameCheck instanceof Function&&J.tagNameCheck(et)))return!1;if(ve&&!dt[et]){const Gt=S(Y)||Y.parentNode,gr=E(Y)||Y.childNodes;if(gr&&Gt){const rr=gr.length;for(let Yr=rr-1;Yr>=0;--Yr){const wn=g(gr[Yr],!0);wn.__removalCount=(Y.__removalCount||0)+1,Gt.insertBefore(wn,b(Y))}}}return de(Y),!0}return Y instanceof l&&!se(Y)||(et==="noscript"||et==="noembed"||et==="noframes")&&Zn(/<\/no(script|embed|frames)/i,Y.innerHTML)?(de(Y),!0):(Ge&&Y.nodeType===Nd.text&&(ke=Y.textContent,zp([O,D,M],Gt=>{ke=$d(ke,Gt," ")}),Y.textContent!==ke&&(Ld(t.removed,{element:Y.cloneNode()}),Y.textContent=ke)),Xe(I.afterSanitizeElements,Y,null),!1)},ye=function(Y,ke,et){if(ie&&(ke==="id"||ke==="name")&&(et in r||et in Ut))return!1;if(!(Le&&!Ze[ke]&&Zn(U,ke))){if(!($e&&Zn($,ke))){if(!_e[ke]||Ze[ke]){if(!(Oe(Y)&&(J.tagNameCheck instanceof RegExp&&Zn(J.tagNameCheck,Y)||J.tagNameCheck instanceof Function&&J.tagNameCheck(Y))&&(J.attributeNameCheck instanceof RegExp&&Zn(J.attributeNameCheck,ke)||J.attributeNameCheck instanceof Function&&J.attributeNameCheck(ke))||ke==="is"&&J.allowCustomizedBuiltInElements&&(J.tagNameCheck instanceof RegExp&&Zn(J.tagNameCheck,et)||J.tagNameCheck instanceof Function&&J.tagNameCheck(et))))return!1}else if(!B[ke]){if(!Zn(ne,$d(et,q,""))){if(!((ke==="src"||ke==="xlink:href"||ke==="href")&&Y!=="script"&&Ise(et,"data:")===0&&T[Y])){if(!(Fe&&!Zn(j,$d(et,q,"")))){if(et)return!1}}}}}}return!0},Oe=function(Y){return Y!=="annotation-xml"&&IE(Y,W)},ct=function(Y){Xe(I.beforeSanitizeAttributes,Y,null);const{attributes:ke}=Y;if(!ke||at(Y))return;const et={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:_e,forceKeepAttr:void 0};let Gt=ke.length;for(;Gt--;){const gr=ke[Gt],{name:rr,namespaceURI:Yr,value:wn}=gr,Kn=pt(rr),Fo=wn;let kr=rr==="value"?Fo:Pse(Fo);if(et.attrName=Kn,et.attrValue=kr,et.keepAttr=!0,et.forceKeepAttr=void 0,Xe(I.uponSanitizeAttribute,Y,et),kr=et.attrValue,te&&(Kn==="id"||Kn==="name")&&(Ae(rr,Y),kr=he+kr),Se&&Zn(/((--!?|])>)|<\/(style|title)/i,kr)){Ae(rr,Y);continue}if(et.forceKeepAttr)continue;if(!et.keepAttr){Ae(rr,Y);continue}if(!ft&&Zn(/\/>/i,kr)){Ae(rr,Y);continue}Ge&&zp([O,D,M],_r=>{kr=$d(kr,_r," ")});const $t=pt(Y.nodeName);if(!ye($t,Kn,kr)){Ae(rr,Y);continue}if(k&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!Yr)switch(p.getAttributeType($t,Kn)){case"TrustedHTML":{kr=k.createHTML(kr);break}case"TrustedScriptURL":{kr=k.createScriptURL(kr);break}}if(kr!==Fo)try{Yr?Y.setAttributeNS(Yr,rr,kr):Y.setAttribute(rr,kr),at(Y)?de(Y):RE(t.removed)}catch{Ae(rr,Y)}}Xe(I.afterSanitizeAttributes,Y,null)},Ot=function Be(Y){let ke=null;const et=Je(Y);for(Xe(I.beforeSanitizeShadowDOM,Y,null);ke=et.nextNode();)Xe(I.uponSanitizeShadowNode,ke,null),ue(ke),ct(ke),ke.content instanceof o&&Be(ke.content);Xe(I.afterSanitizeShadowDOM,Y,null)};return t.sanitize=function(Be){let Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ke=null,et=null,Gt=null,gr=null;if(vt=!Be,vt&&(Be="<!-->"),typeof Be!="string"&&!Qe(Be))if(typeof Be.toString=="function"){if(Be=Be.toString(),typeof Be!="string")throw Dd("dirty is not a string, aborting")}else throw Dd("toString is not a function");if(!t.isSupported)return Be;if(Ce||Ln(Y),t.removed=[],typeof Be=="string"&&(Re=!1),Re){if(Be.nodeName){const wn=pt(Be.nodeName);if(!ae[wn]||xe[wn])throw Dd("root node is forbidden and cannot be sanitized in-place")}}else if(Be instanceof a)ke=Ve("<!---->"),et=ke.ownerDocument.importNode(Be,!0),et.nodeType===Nd.element&&et.nodeName==="BODY"||et.nodeName==="HTML"?ke=et:ke.appendChild(et);else{if(!Ue&&!Ge&&!je&&Be.indexOf("<")===-1)return k&&Q?k.createHTML(Be):Be;if(ke=Ve(Be),!ke)return Ue?null:Q?A:""}ke&&Pe&&de(ke.firstChild);const rr=Je(Re?Be:ke);for(;Gt=rr.nextNode();)ue(Gt),ct(Gt),Gt.content instanceof o&&Ot(Gt.content);if(Re)return Be;if(Ue){if(z)for(gr=x.call(ke.ownerDocument);ke.firstChild;)gr.appendChild(ke.firstChild);else gr=ke;return(_e.shadowroot||_e.shadowrootmode)&&(gr=P.call(n,gr,!0)),gr}let Yr=je?ke.outerHTML:ke.innerHTML;return je&&ae["!doctype"]&&ke.ownerDocument&&ke.ownerDocument.doctype&&ke.ownerDocument.doctype.name&&Zn(zI,ke.ownerDocument.doctype.name)&&(Yr="<!DOCTYPE "+ke.ownerDocument.doctype.name+`> 143`+Yr),Ge&&zp([O,D,M],wn=>{Yr=$d(Yr,wn," ")}),k&&Q?k.createHTML(Yr):Yr},t.setConfig=function(){let Be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ln(Be),Ce=!0},t.clearConfig=function(){ur=null,Ce=!1},t.isValidAttribute=function(Be,Y,ke){ur||Ln({});const et=pt(Be),Gt=pt(Y);return ye(et,Gt,ke)},t.addHook=function(Be,Y){typeof Y=="function"&&Ld(I[Be],Y)},t.removeHook=function(Be,Y){if(Y!==void 0){const ke=kse(I[Be],Y);return ke===-1?void 0:Rse(I[Be],ke,1)[0]}return RE(I[Be])},t.removeHooks=function(Be){I[Be]=[]},t.removeAllHooks=function(){I=DE()},t}var u3=WI();const qI=e=>!e||typeof e!="string"?"":u3.sanitize(e,{ALLOWED_TAGS:["p","strong","b","em","i","ul","li"],ALLOWED_ATTR:[],ALLOW_UNKNOWN_PROTOCOLS:!1,FORBID_ATTR:["style","class","id","data-*"],KEEP_CONTENT:!0,RETURN_DOM:!1,RETURN_DOM_FRAGMENT:!1}),lCe=e=>e?e.replace(/<[^>]*>?/g,"").length:0,GI=e=>{let t=e,r;do r=t,t=t.replace(/<p>\s*<\/p>$/,"").replace(/<p><br(?:\s[^>]*)?\s*><\/p>$/,n=>n.includes('class="ProseMirror-trailingBreak"')?n:"").trim();while(t!==r);return t},cCe=e=>{if(!e||typeof e!="string")return"";const t=u3.sanitize(e,{ALLOWED_TAGS:["p","strong","b","em","i","ul","li","br"],ALLOWED_ATTR:["class"],ALLOW_UNKNOWN_PROTOCOLS:!1,FORBID_ATTR:["style","id","data-*"],KEEP_CONTENT:!0,RETURN_DOM:!1,RETURN_DOM_FRAGMENT:!1});return GI(t)},uCe=e=>{if(!e||typeof e!="string")return"";const t=u3.sanitize(e,{ALLOWED_TAGS:["p","strong","b","em","i","ul","ol","li","h1","h2","h3","h4","h5","h6","br"],ALLOWED_ATTR:["class"],ALLOW_UNKNOWN_PROTOCOLS:!1,FORBID_ATTR:["style","id","data-*"],KEEP_CONTENT:!0,RETURN_DOM:!1,RETURN_DOM_FRAGMENT:!1});return GI(t)},dCe=e=>!e||typeof e!="string"?"":e.split(/\r?\n/).map(t=>t.trim()).filter(t=>t.length>0).map(t=>`<p>${t}</p>`).join(""),qse=async e=>{const{data:t,error:r}=await Te.from("catalogo_web").select("*, combinar_entrega_modo, retirada_modo, checkout_whatsapp_habilitado, banner_desktop_link, banner_mobile_link, mostrar_codigo_produto_card, modo_chat").eq("user_id",e).single();if(r){if(r.code==="PGRST116")return null;throw new Error(r.message)}return t&&t.texto_rodape&&(t.texto_rodape=qI(t.texto_rodape)),t},lo=()=>{const{user:e}=ot(),t=e==null?void 0:e.id;return Et({queryKey:["webCatalog"],queryFn:()=>qse(t),enabled:!!t})}
143,Gse=async e=>{if(!e)throw new Error("User is not authenticated");const{count:t,error:r}=await Te.from("produto").select("*",{count:"exact",head:!0}).eq("user_id",e).is("deletado_em",null);if(r)throw new Error(r.message);return t||0},xg=()=>{const{user:e}=ot(),t=e==null?void 0:e.id;return Et({queryKey:["productsCount"],queryFn:()=>Gse(t),enabled:!!t})},wg=Kr("Airbridge"),Gf=()=>qe.isNativePlatform()&&qe.isPluginAvailable("Airbridge"),d3=Gf,KI={SIGNUP:"airbridge.user.signup",SUBSCRIBE:"airbridge.subscribe"},ky={FIRST_PRODUCT_CREATED:"first_product_created",FIRST_ORDER:"first_order",PAYWALL_VIEWED:"paywall_viewed",SUBSCRIPTION_RENEWAL:"subscription_renewal",SUBSCRIPTION_UPGRADE:"subscription_upgrade"},Sa={ACTION:"action",LABEL:"label",VALUE:"value",CURRENCY:"currency",TRANSACTION_ID:"transactionID",PRODUCTS:"products",PRODUCT_ID:"productID",PRODUCT_PRICE:"price"},Kse=async()=>{if(!Gf())return null;try{const e=await wg.getDeviceInfo();return e!=null&&e.deviceUUID?e:null}catch(e){return console.error("Error getting Airbridge device info:",e),null}},Yse=async(e,t)=>{if(Gf())try{await wg.setUser({userId:e,email:(t==null?void 0:t.email)||void 0,phone:(t==null?void 0:t.phone)||void 0})}catch(r){console.error("Error setting Airbridge user:",r)}},Zse=async()=>{if(Gf())try{await wg.clearUser()}catch(e){console.error("Error clearing Airbridge user:",e)}},df=async(e,t)=>{if(Gf())try{await wg.trackEvent({category:e,semanticAttributes:(t==null?void 0:t.semanticAttributes)||{},customAttributes:(t==null?void 0:t.customAttributes)||{}})}catch(r){console.error(`Error sending event ${e} to Airbridge:`,r)}},Xse=async e=>{if(!e)throw new Error("User is not authenticated.");const{data:t,error:r}=await Te.from("user_tags").select("*").eq("user_id",e).maybeSingle();if(r){if(r.code==="PGRST116")return null;throw console.error("Error fetching user tags:",r),r}return t},al=()=>{var y;const{user:e}=ot(),t=e==null?void 0:e.id,r=ao(),n=Et({queryKey:["userTags",t],queryFn:()=>Xse(t),enabled:!!t,retry:(b,E)=>E&&typeof E.code<"u"&&E.code==="PGRST116"?!1:b<3}),i=jn({mutationFn:async({set:b,remove:E})=>{if(!t)throw new Error("User is not authenticated.");const{data:S,error:k}=await Te.rpc("merge_user_tags",{p_tags:b??{},p_remove:E??null});if(k)throw console.error("Error updating user tags:",k),k;return Array.isArray(S)?S[0]:S},onMutate:async({set:b,remove:E})=>{if(!t)return;await r.cancelQueries({queryKey:["userTags",t]});const S=r.getQueryData(["userTags",t]);return r.setQueryData(["userTags",t],k=>{const A={...(k==null?void 0:k.tags)||{},...b||{}};return(E||[]).forEach(w=>delete A[w]),k?{...k,tags:A,atualizado_em:new Date().toISOString()}:{id:0,user_id:t,tags:A,criado_em:new Date().toISOString(),atualizado_em:new Date().toISOString()}}),{previousTags:S}},onError:(b,E,S)=>{t&&(S==null?void 0:S.previousTags)!==void 0&&r.setQueryData(["userTags",t],S.previousTags),console.error("Failed to update user tags:",b.message)},onSettled:b=>{const E=(b==null?void 0:b.user_id)||t;E&&r.invalidateQueries({queryKey:["userTags",E]})}}),o=((y=n.data)==null?void 0:y.tags)||{},s=b=>!!o[b],a=b=>o[b],l=v.useCallback((b,E=!0)=>{i.mutate({set:{[b]:E}})},[i]),d=v.useCallback(b=>{l(b,!0)},[l]),u=v.useCallback(b=>{i.mutate({remove:[b]})},[i]),h=v.useCallback((b,E=!0)=>{var S;if(E)i.mutate({set:b});
143else{const k=((S=r.getQueryData(["userTags",t]))==null?void 0:S.tags)||{},A=Object.keys(k).filter(w=>!(w in b));i.mutate({set:b,remove:A})}},[i,r,t]),f=v.useCallback(b=>{i.mutate({remove:b})},[i]),p=v.useCallback(()=>{var E;const b=((E=r.getQueryData(["userTags",t]))==null?void 0:E.tags)||{};i.mutate({remove:Object.keys(b)})},[i,r,t]),m=v.useCallback(b=>{var k;const E=r.getQueryData(["userTags",t]),S=(k=E==null?void 0:E.tags)==null?void 0:k[b];l(b,!S)},[l,r,t]),g=v.useCallback((b,E=1)=>{var A;const S=r.getQueryData(["userTags",t]),k=typeof((A=S==null?void 0:S.tags)==null?void 0:A[b])=="number"?S.tags[b]:0;l(b,k+E)},[l,r,t]);return{tags:o,isLoading:n.isLoading,isError:n.isError,error:n.error,hasTag:s,getTag:a,setTag:l,addTag:d,removeTag:u,setTags:h,removeTags:f,clearTags:p,toggleTag:m,incrementTag:g,isUpdating:i.isPending,updateError:i.error}},YI=new Date("2026-09-08T00:00:00Z"),Jse=()=>{const{user:e}=ot(),{getTag:t,setTags:r,isLoading:n}=al(),i=v.useRef(!1);v.useEffect(()=>{i.current||!e||n||d3()&&(i.current=!0,(async()=>{const o=await Kse();if(!o)return;const s=qe.getPlatform(),a={airbridge_device_uuid:o.deviceUUID,airbridge_platform:s,airbridge_os_version:o.osVersion,airbridge_app_version:o.appVersion};Object.keys(a).some(d=>t(d)!==a[d])&&r(a)})())},[e,n,t,r])},Qse=async e=>{const{count:t,error:r}=await Te.from("pedido").select("*",{count:"exact",head:!0}).eq("vendedor_id",e).is("deletado_em",null);if(r)throw new Error(r.message);return(t||0)>0},eae=()=>{const{user:e}=ot(),{hasTag:t,addTag:r,isLoading:n}=al(),{data:i}=xg(),o=!!e&&d3()&&new Date(e.created_at)>=YI,s=!e||!!localStorage.getItem(`ab_first_order_${e.id}`)||t("airbridge_first_order_tracked"),{data:a}=Et({queryKey:["hasAnyOrder",e==null?void 0:e.id],queryFn:()=>Qse(e.id),enabled:o&&!n&&!s,staleTime:5*60*1e3});v.useEffect(()=>{if(!o||n||!i||i<1)return;const l=`ab_first_product_${e.id}`;if(!localStorage.getItem(l)){if(t("airbridge_first_product_tracked")){localStorage.setItem(l,"1");return}localStorage.setItem(l,"1"),df(ky.FIRST_PRODUCT_CREATED),r("airbridge_first_product_tracked")}},[o,n,i,e,t,r]),v.useEffect(()=>{if(!o||n||!a)return;const l=`ab_first_order_${e.id}`;if(!localStorage.getItem(l)){if(t("airbridge_first_order_tracked")){localStorage.setItem(l,"1");return}localStorage.setItem(l,"1"),df(ky.FIRST_ORDER),r("airbridge_first_order_tracked")}},[o,n,a,e,t,r])},hCe=e=>{const{user:t}=ot(),{hasTag:r,addTag:n,isLoading:i}=al();v.useEffect(()=>{if(!e||!t||i||!d3()||new Date(t.created_at)<YI)return;const o=`ab_paywall_viewed_${t.id}`;if(!localStorage.getItem(o)){if(r("airbridge_paywall_viewed_tracked")){localStorage.setItem(o,"1");return}localStorage.setItem(o,"1"),df(ky.PAYWALL_VIEWED),n("airbridge_paywall_viewed_tracked")}},[e,t,i,r,n])},tae=Kr("ODM"),rae=async e=>{if(qe.getPlatform()==="ios"&&!(!e.phoneNumber&&!e.emailAddress))try{await tae.initiate(e)}catch(t){console.error("Error initiating on-device conversion measurement:",t)}},h3=v.createContext({});function f3(e){const t=v.useRef(null);return t.current===null&&(t.current=e()),t.current}const p3=typeof window<"u",ZI=p3?v.useLayoutEffect:v.useEffect,Eg=v.createContext(null);function m3(e,t){e.indexOf(t)===-1&&e.push(t)}function g3(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}const ea=(e,t,r)=>r>t?t:r<e?e:r;let v3=()=>{};const ta={},XI=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function JI(e){return typeof e=="object"&&e!==null}const QI=e=>/^0[^.\s]+$/u.test(e);function y3(e){let t;return()=>(t===void 0&&(t=e()),t)}const ro=e=>e,nae=(e,t)=>r=>t(e(r)),Kf=(...e)=>e.reduce(nae),hf=(e,t,r)=>{const n=t-e;return n===0?1:(r-e)/n};class _3{constructor(){this.subscriptions=[]}add(t){return m3(this.subscriptions,t),()=>g3(this.subscriptions,t)}notify(t,r,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,r,n);else for(let o=0;o<i;o++){const s=this.subscriptions[o];s&&s(t,r,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const us=e=>e*1e3,ds=e=>e/1e3;function eP(e,t){return t?e*(1e3/t):0}const tP=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,iae=1e-7,oae=12;function sae(e,t,r,n,i){let o,s,a=0;do s=t+(r-t)/2,o=tP(s,n,i)-e,o>0?r=s:t=s;while(Math.abs(o)>iae&&++a<oae);return s}function Yf(e,t,r,n){if(e===t&&r===n)return ro;const i=o=>sae(o,0,1,e,r);return o=>o===0||o===1?o:tP(i(o),t,n)}const rP=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,nP=e=>t=>1-e(1-t),iP=Yf(.33,1.53,.69,.99),b3=nP(iP),oP=rP(b3),sP=e=>(e*=2)<1?.5*b3(e):.5*(2-Math.pow(2,-10*(e-1))),x3=e=>1-Math.sin(Math.acos(e)),aP=nP(x3),lP=rP(x3),aae=Yf(.42,0,1,1),lae=Yf(0,0,.58,1),cP=Yf(.42,0,.58,1),cae=e=>Array.isArray(e)&&typeof e[0]!="number",uP=e=>Array.isArray(e)&&typeof e[0]=="number",uae={linear:ro,easeIn:aae,easeInOut:cP,easeOut:lae,circIn:x3,circInOut:lP,circOut:aP,backIn:b3,backInOut:oP,backOut:iP,anticipate:sP},dae=e=>typeof e=="string",ME=e=>{if(uP(e)){v3(e.length===4);const[t,r,n,i]=e;return Yf(t,r,n,i)}else if(dae(e))return uae[e];return e},qp=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],NE={value:null,addProjectionMetrics:null};function hae(e,t){let r=new Set,n=new Set,i=!1,o=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function d(h){s.has(h)&&(u.schedule(h),e()),l++,h(a)}const u={schedule:(h,f=!1,p=!1)=>{const g=p&&i?r:n;return f&&s.add(h),g.has(h)||g.add(h),h},cancel:h=>{n.delete(h),s.delete(h)},process:h=>{if(a=h,i){o=!0;return}i=!0,[r,n]=[n,r],r.forEach(d),t&&NE.value&&NE.value.frameloop[t].push(l),l=0,r.clear(),i=!1,o&&(o=!1,u.process(h))}};return u}const fae=40;function dP(e,t){let r=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>r=!0,s=qp.reduce((S,k)=>(S[k]=hae(o,t?k:void 0),S),{}),{setup:a,read:l,resolveKeyframes:d,preUpdate:u,update:h,preRender:f,render:p,postRender:m}=s,g=()=>{const S=ta.useManualTiming?i.timestamp:performance.now();r=!1,ta.useManualTiming||(i.delta=n?1e3/60:Math.max(Math.min(S-i.timestamp,fae),1)),i.timestamp=S,i.isProcessing=!0,a.process(i),l.process(i),d.process(i),u.process(i),h.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,r&&t&&(n=!1,e(g))},y=()=>{r=!0,n=!0,i.isProcessing||e(g)};return{schedule:qp.reduce((S,k)=>{const A=s[k];return S[k]=(w,_=!1,x=!1)=>(r||y(),A.schedule(w,_,x)),S},{}),cancel:S=>{for(let k=0;k<qp.length;k++)s[qp[k]].cancel(S)},state:i,steps:s}}const{schedule:jr,cancel:Ya,state:Rn,steps:X2}=dP(typeof requestAnimationFrame<"u"?requestAnimationFrame:ro,!0);let $0;function pae(){$0=void 0}const Si={now:()=>($0===void 0&&Si.set(Rn.isProcessing||ta.useManualTiming?Rn.timestamp:performance.now()),$0),set:e=>{$0=e,queueMicrotask(pae)}},hP=e=>t=>typeof t=="string"&&t.startsWith(e),w3=hP("--"),mae=hP("var(--"),E3=e=>mae(e)?gae.test(e.split("/*")[0].trim()):!1,gae=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,fd={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ff={...fd,transform:e=>ea(0,1,e)},Gp={...fd,default:1},_h=e=>Math.round(e*1e5)/1e5,S3=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function vae(e){return e==null}const yae=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,C3=(e,t)=>r=>!!(typeof r=="string"&&yae.test(r)&&r.startsWith(e)||t&&!vae(r)&&Object.prototype.hasOwnProperty.call(r,t)),fP=(e,t,r)=>n=>
vendor: 4,086 bytes, line 143
143{if(typeof n!="string")return n;const[i,o,s,a]=n.match(S3);return{[e]:parseFloat(i),[t]:parseFloat(o),[r]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},_ae=e=>ea(0,255,e),J2={...fd,transform:e=>Math.round(_ae(e))},Nl={test:C3("rgb","red"),parse:fP("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+J2.transform(e)+", "+J2.transform(t)+", "+J2.transform(r)+", "+_h(ff.transform(n))+")"};function bae(e){let t="",r="",n="",i="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),i=e.substring(4,5),t+=t,r+=r,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const Ry={test:C3("#"),parse:bae,transform:Nl.transform},Zf=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ca=Zf("deg"),hs=Zf("%"),Tt=Zf("px"),xae=Zf("vh"),wae=Zf("vw"),FE={...hs,parse:e=>hs.parse(e)/100,transform:e=>hs.transform(e*100)},iu={test:C3("hsl","hue"),parse:fP("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+hs.transform(_h(t))+", "+hs.transform(_h(r))+", "+_h(ff.transform(n))+")"},rn={test:e=>Nl.test(e)||Ry.test(e)||iu.test(e),parse:e=>Nl.test(e)?Nl.parse(e):iu.test(e)?iu.parse(e):Ry.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Nl.transform(e):iu.transform(e),getAnimatableNone:e=>{const t=rn.parse(e);return t.alpha=0,rn.transform(t)}},Eae=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Sae(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match(S3))==null?void 0:t.length)||0)+(((r=e.match(Eae))==null?void 0:r.length)||0)>0}const pP="number",mP="color",Cae="var",Tae="var(",UE="${}",Aae=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function pf(e){const t=e.toString(),r=[],n={color:[],number:[],var:[]},i=[];let o=0;const a=t.replace(Aae,l=>(rn.test(l)?(n.color.push(o),i.push(mP),r.push(rn.parse(l))):l.startsWith(Tae)?(n.var.push(o),i.push(Cae),r.push(l)):(n.number.push(o),i.push(pP),r.push(parseFloat(l))),++o,UE)).split(UE);return{values:r,split:a,indexes:n,types:i}}function gP(e){return pf(e).values}function vP(e){const{split:t,types:r}=pf(e),n=t.length;return i=>{let o="";for(let s=0;s<n;s++)if(o+=t[s],i[s]!==void 0){const a=r[s];a===pP?o+=_h(i[s]):a===mP?o+=rn.transform(i[s]):o+=i[s]}return o}}const kae=e=>typeof e=="number"?0:rn.test(e)?rn.getAnimatableNone(e):e;function Rae(e){const t=gP(e);return vP(e)(t.map(kae))}const Za={test:Sae,parse:gP,createTransformer:vP,getAnimatableNone:Rae};function Q2(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function Iae({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let i=0,o=0,s=0;if(!t)i=o=s=r;else{const a=r<.5?r*(1+t):r+t-r*t,l=2*r-a;i=Q2(l,a,e+1/3),o=Q2(l,a,e),s=Q2(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:n}}function K1(e,t){return r=>r>0?t:e}const Pr=(e,t,r)=>e+(t-e)*r,ev=(e,t,r)=>{const n=e*e,i=r*(t*t-n)+n;return i<0?0:Math.sqrt(i)},Pae=[Ry,Nl,iu],Oae=e=>Pae.find(t=>t.test(e));function BE(e){const t=Oae(e);if(!t)return!1;let r=t.parse(e);return t===iu&&(r=Iae(r)),r}const VE=(e,t)=>{const r=BE(e),n=BE(t);if(!r||!n)return K1(e,t);const i={...r};return o=>(i.red=ev(r.red,n.red,o),i.green=ev(r.green,n.green,o),i.blue=ev(r.blue,n.blue,o),i.alpha=Pr(r.alpha,n.alpha,o),Nl.transform(i))},Iy=new Set(["none","hidden"]);function jae(e,t){return Iy.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function Lae(e,t){return r=>Pr(e,t,r)}function T3(e){return typeof e=="number"?Lae:typeof e=="string"?E3(e)?K1:rn.test(e)?VE:Mae:Array.isArray(e)?yP:typeof e=="object"?rn.test(e)?VE:$ae:K1}function yP(e,t){const r=[...e],n=r.length,i=e.map((o,s)=>
143T3(o)(o,t[s]));return o=>{for(let s=0;s<n;s++)r[s]=i[s](o);return r}}function $ae(e,t){const r={...e,...t},n={};for(const i in r)e[i]!==void 0&&t[i]!==void 0&&(n[i]=T3(e[i])(e[i],t[i]));return i=>{for(const o in n)r[o]=n[o](i);return r}}function Dae(e,t){const r=[],n={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const o=t.types[i],s=e.indexes[o][n[o]],a=e.values[s]??0;r[i]=a,n[o]++}return r}const Mae=(e,t)=>{const r=Za.createTransformer(t),n=pf(e),i=pf(t);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?Iy.has(e)&&!i.values.length||Iy.has(t)&&!n.values.length?jae(e,t):Kf(yP(Dae(n,i),i.values),r):K1(e,t)};function _P(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?Pr(e,t,r):T3(e)(e,t)}const Nae=e=>{const t=({timestamp:r})=>e(r);return{start:(r=!0)=>jr.update(t,r),stop:()=>Ya(t),now:()=>Rn.isProcessing?Rn.timestamp:Si.now()}},bP=(e,t,r=10)=>{let n="";const i=Math.max(Math.round(t/r),2);for(let o=0;o<i;o++)n+=Math.round(e(o/(i-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},Y1=2e4;function A3(e){let t=0;const r=50;let n=e.next(t);for(;!n.done&&t<Y1;)t+=r,n=e.next(t);return t>=Y1?1/0:t}function Fae(e,t=100,r){const n=r({...e,keyframes:[0,t]}),i=Math.min(A3(n),Y1);return{type:"keyframes",ease:o=>n.next(i*o).value/t,duration:ds(i)}}const Uae=5;function xP(e,t,r){const n=Math.max(t-Uae,0);return eP(r-e(n),t-n)}const Nr={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},tv=.001;function Bae({duration:e=Nr.duration,bounce:t=Nr.bounce,velocity:r=Nr.velocity,mass:n=Nr.mass}){let i,o,s=1-t;s=ea(Nr.minDamping,Nr.maxDamping,s),e=ea(Nr.minDuration,Nr.maxDuration,ds(e)),s<1?(i=d=>{const u=d*s,h=u*e,f=u-r,p=Py(d,s),m=Math.exp(-h);return tv-f/p*m},o=d=>{const h=d*s*e,f=h*r+r,p=Math.pow(s,2)*Math.pow(d,2)*e,m=Math.exp(-h),g=Py(Math.pow(d,2),s);return(-i(d)+tv>0?-1:1)*((f-p)*m)/g}):(i=d=>{const u=Math.exp(-d*e),h=(d-r)*e+1;return-tv+u*h},o=d=>{const u=Math.exp(-d*e),h=(r-d)*(e*e);return u*h});const a=5/e,l=Hae(i,o,a);if(e=us(e),isNaN(l))return{stiffness:Nr.stiffness,damping:Nr.damping,duration:e};{const d=Math.pow(l,2)*n;return{stiffness:d,damping:s*2*Math.sqrt(n*d),duration:e}}}const Vae=12;function Hae(e,t,r){let n=r;for(let i=1;i<Vae;i++)n=n-e(n)/t(n);return n}function Py(e,t){return e*Math.sqrt(1-t*t)}const zae=["duration","bounce"],Wae=["stiffness","damping","mass"];function HE(e,t){return t.some(r=>e[r]!==void 0)}function qae(e){let t={velocity:Nr.velocity,stiffness:Nr.stiffness,damping:Nr.damping,mass:Nr.mass,isResolvedFromDuration:!1,...e};if(!HE(e,Wae)&&HE(e,zae))if(e.visualDuration){const r=e.visualDuration,n=2*Math.PI/(r*1.2),i=n*n,o=2*ea(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Nr.mass,stiffness:i,damping:o}}else{const r=Bae(e);t={...t,...r,mass:Nr.mass},t.isResolvedFromDuration=!0}return t}function Z1(e=Nr.visualDuration,t=Nr.bounce){const r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:i}=r;const o=r.keyframes[0],s=r.keyframes[r.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:d,mass:u,duration:h,velocity:f,isResolvedFromDuration:p}=qae({...r,velocity:-ds(r.velocity||0)}),m=f||0,g=d/(2*Math.sqrt(l*u)),y=s-o,b=ds(Math.sqrt(l/u)),E=Math.abs(y)<5;n||(n=E?Nr.restSpeed.granular:Nr.restSpeed.default),i||(i=E?Nr.restDelta.granular:Nr.restDelta.default);let S;if(g<1){const A=Py(b,g);S=w=>{const _=Math.exp(-g*b*w);return s-_*((m+g*b*y)/A*Math.sin(A*w)+y*Math.cos(A*w))}}else if(g===1)S=A=>s-Math.exp(-b*A)*(y+(m+b*y)*A);else{const A=b*Math.sqrt(g*g-1);S=w=>{const _=Math.exp(-g*b*w),x=Math.min(A*w,300);return s-_*((m+g*b*y)*Math.sinh(x)+A*y*Math.cosh(x))/A}}const k={calculatedDuration:p&&h||null,next:A=>{const w=S(A);if(p)a.done=A>=h;else{let _=A===0?m:0;g<1&&(_=A===0?us(m):xP(S,A,w));const x=Math.abs(_)<=n,C=Math.abs(s-w)<=i;a.done=x&&C}return a.value=a.done?s:w,a},toString:()=>{const A=Math.min(A3(k),Y1),w=bP(_=>k.next(A*_).value,A,30);return A+"ms "+w},toTransition:()=>{}};return k}Z1.applyToOptions=e=>{const t=Fae(e,100,Z1);return e.ease=t.ease,e.duration=us(t.duration),e.type="keyframes",e};
143function Oy({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:l,restDelta:d=.5,restSpeed:u}){const h=e[0],f={done:!1,value:h},p=x=>a!==void 0&&x<a||l!==void 0&&x>l,m=x=>a===void 0?l:l===void 0||Math.abs(a-x)<Math.abs(l-x)?a:l;let g=r*t;const y=h+g,b=s===void 0?y:s(y);b!==y&&(g=b-h);const E=x=>-g*Math.exp(-x/n),S=x=>b+E(x),k=x=>{const C=E(x),P=S(x);f.done=Math.abs(C)<=d,f.value=f.done?b:P};let A,w;const _=x=>{p(f.value)&&(A=x,w=Z1({keyframes:[f.value,m(f.value)],velocity:xP(S,x,f.value),damping:i,stiffness:o,restDelta:d,restSpeed:u}))};return _(0),{calculatedDuration:null,next:x=>{let C=!1;return!w&&A===void 0&&(C=!0,k(x),_(x)),A!==void 0&&x>=A?w.next(x-A):(!C&&k(x),f)}}}function Gae(e,t,r){const n=[],i=r||ta.mix||_P,o=e.length-1;for(let s=0;s<o;s++){let a=i(e[s],e[s+1]);if(t){const l=Array.isArray(t)?t[s]||ro:t;a=Kf(l,a)}n.push(a)}return n}function Kae(e,t,{clamp:r=!0,ease:n,mixer:i}={}){const o=e.length;if(v3(o===t.length),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Gae(t,n,i),l=a.length,d=u=>{if(s&&u<e[0])return t[0];let h=0;if(l>1)for(;h<e.length-2&&!(u<e[h+1]);h++);const f=hf(e[h],e[h+1],u);return a[h](f)};return r?u=>d(ea(e[0],e[o-1],u)):d}function Yae(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const i=hf(0,t,n);e.push(Pr(r,1,i))}}function Zae(e){const t=[0];return Yae(t,e.length-1),t}function Xae(e,t){return e.map(r=>r*t)}function Jae(e,t){return e.map(()=>t||cP).splice(0,e.length-1)}function bh({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){const i=cae(n)?n.map(ME):ME(n),o={done:!1,value:t[0]},s=Xae(r&&r.length===t.length?r:Zae(t),e),a=Kae(s,t,{ease:Array.isArray(i)?i:Jae(t,i)});return{calculatedDuration:e,next:l=>(o.value=a(l),o.done=l>=e,o)}}const Qae=e=>e!==null;function k3(e,{repeat:t,repeatType:r="loop"},n,i=1){const o=e.filter(Qae),a=i<0||t&&r!=="loop"&&t%2===1?0:o.length-1;return!a||n===void 0?o[a]:n}const ele={decay:Oy,inertia:Oy,tween:bh,keyframes:bh,spring:Z1};function wP(e){typeof e.type=="string"&&(e.type=ele[e.type])}class R3{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,r){return this.finished.then(t,r)}}const tle=e=>e/100;class I3 extends R3{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var n,i;const{motionValue:r}=this.options;r&&r.updatedAt!==Si.now()&&this.tick(Si.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(n=this.options).onStop)==null||i.call(n))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;wP(t);const{type:r=bh,repeat:n=0,repeatDelay:i=0,repeatType:o,velocity:s=0}=t;let{keyframes:a}=t;const l=r||bh;l!==bh&&typeof a[0]!="number"&&(this.mixKeyframes=Kf(tle,_P(a[0],a[1])),a=[0,100]);const d=l({...t,keyframes:a});o==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-s})),d.calculatedDuration===null&&(d.calculatedDuration=A3(d));const{calculatedDuration:u}=d;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=d}updateTime(t){const r=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(t,r=!1){const{generator:n,totalDuration:i,mixKeyframes:o,mirroredGenerator:s,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return n.next(0);const{delay:d=0,keyframes:u,repeat:h,repeatType:f,repeatDelay:p,type:m,onUpdate:g,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),r?this.currentTime=t:this.updateTime(t);const b=this.currentTime-d*(this.playbackSpeed>=0?1:-1),E=this.playbackSpeed>=0?b<0:b>i;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let S=this.currentTime,k=n;if(h){const x=Math.min(this.currentTime,i)/a;let C=Math.floor(x),P=x%1;!P&&x>=1&&(P=1),P===1&&C--,C=Math.min(C,h+1),!!(C%2)&&(f==="reverse"?(P=1-P,p&&(P-=p/a)):f==="mirror"&&(k=s)),S=ea(0,1,P)*a}const A=E?{done:!1,value:u[0]}:k.next(S);o&&(A.value=o(A.value));let{done:w}=A;!E&&l!==null&&(w=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&w);return _&&m!==Oy&&(A.value=k3(u,this.options,y,this.speed)),g&&g(A.value),_&&this.finish(),A}
143then(t,r){return this.finished.then(t,r)}get duration(){return ds(this.calculatedDuration)}get time(){return ds(this.currentTime)}set time(t){var r;t=us(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(r=this.driver)==null||r.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Si.now());const r=this.playbackSpeed!==t;this.playbackSpeed=t,r&&(this.time=ds(this.currentTime))}play(){var i,o;if(this.isStopped)return;const{driver:t=Nae,startTime:r}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),(o=(i=this.options).onPlay)==null||o.call(i);const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=r??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Si.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,r;this.notifyFinished(),this.teardown(),this.state="finished",(r=(t=this.options).onComplete)==null||r.call(t)}cancel(){var t,r;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(r=(t=this.options).onCancel)==null||r.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var r;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(r=this.driver)==null||r.stop(),t.observe(this)}}function rle(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Fl=e=>e*180/Math.PI,jy=e=>{const t=Fl(Math.atan2(e[1],e[0]));return Ly(t)},nle={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:jy,rotateZ:jy,skewX:e=>Fl(Math.atan(e[1])),skewY:e=>Fl(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Ly=e=>(e=e%360,e<0&&(e+=360),e),zE=jy,WE=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),qE=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),ile={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:WE,scaleY:qE,scale:e=>(WE(e)+qE(e))/2,rotateX:e=>Ly(Fl(Math.atan2(e[6],e[5]))),rotateY:e=>Ly(Fl(Math.atan2(-e[2],e[0]))),rotateZ:zE,rotate:zE,skewX:e=>Fl(Math.atan(e[4])),skewY:e=>Fl(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function $y(e){return e.includes("scale")?1:0}function Dy(e,t){if(!e||e==="none")return $y(t);const r=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(r)n=ile,i=r;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=nle,i=a}if(!i)return $y(t);const o=n[t],s=i[1].split(",").map(sle);return typeof o=="function"?o(s):s[o]}const ole=(e,t)=>{const{transform:r="none"}=getComputedStyle(e);return Dy(r,t)};function sle(e){return parseFloat(e.trim())}const pd=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],md=new Set(pd),GE=e=>e===fd||e===Tt,ale=new Set(["x","y","z"]),lle=pd.filter(e=>!ale.has(e));function cle(e){const t=[];return lle.forEach(r=>{const n=e.getValue(r);n!==void 0&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}const Yl={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Dy(t,"x"),y:(e,{transform:t})=>Dy(t,"y")};Yl.translateX=Yl.x;Yl.translateY=Yl.y;const Zl=new Set;let My=!1,Ny=!1,Fy=!1;function EP(){if(Ny){const e=Array.from(Zl).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),r=new Map;t.forEach(n=>{const i=cle(n);i.length&&(r.set(n,i),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>
143{n.render();const i=r.get(n);i&&i.forEach(([o,s])=>{var a;(a=n.getValue(o))==null||a.set(s)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}Ny=!1,My=!1,Zl.forEach(e=>e.complete(Fy)),Zl.clear()}function SP(){Zl.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ny=!0)})}function ule(){Fy=!0,SP(),EP(),Fy=!1}class P3{constructor(t,r,n,i,o,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=n,this.motionValue=i,this.element=o,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(Zl.add(this),My||(My=!0,jr.read(SP),jr.resolveKeyframes(EP))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:r,element:n,motionValue:i}=this;if(t[0]===null){const o=i==null?void 0:i.get(),s=t[t.length-1];if(o!==void 0)t[0]=o;else if(n&&r){const a=n.readValue(r,s);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=s),i&&o===void 0&&i.set(t[0])}rle(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Zl.delete(this)}cancel(){this.state==="scheduled"&&(Zl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const dle=e=>e.startsWith("--");function hle(e,t,r){dle(t)?e.style.setProperty(t,r):e.style[t]=r}const fle=y3(()=>window.ScrollTimeline!==void 0),ple={};function mle(e,t){const r=y3(e);return()=>ple[t]??r()}const CP=mle(()=>{try{document.createElement("div").animate({opacity:0}
143,{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),rh=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,KE={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:rh([0,.65,.55,1]),circOut:rh([.55,0,1,.45]),backIn:rh([.31,.01,.66,-.59]),backOut:rh([.33,1.53,.69,.99])};function TP(e,t){if(e)return typeof e=="function"?CP()?bP(e,t):"ease-out":uP(e)?rh(e):Array.isArray(e)?e.map(r=>TP(r,t)||KE.easeOut):KE[e]}function gle(e,t,r,{delay:n=0,duration:i=300,repeat:o=0,repeatType:s="loop",ease:a="easeOut",times:l}={},d=void 0){const u={[t]:r};l&&(u.offset=l);const h=TP(a,i);Array.isArray(h)&&(u.easing=h);const f={delay:n,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:s==="reverse"?"alternate":"normal"};return d&&(f.pseudoElement=d),e.animate(u,f)}function AP(e){return typeof e=="function"&&"applyToOptions"in e}function vle({type:e,...t}){return AP(e)&&CP()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class yle extends R3{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:r,name:n,keyframes:i,pseudoElement:o,allowFlatten:s=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!o,this.allowFlatten=s,this.options=t,v3(typeof t.type!="string");const d=vle(t);this.animation=gle(r,n,i,d,o),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const u=k3(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):hle(r,n,u),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,r;(r=(t=this.animation).finish)==null||r.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,r;this.isPseudoElement||(r=(t=this.animation).commitStyles)==null||r.call(t)}get duration(){var r,n;const t=((n=(r=this.animation.effect)==null?void 0:r.getComputedTiming)==null?void 0:n.call(r).duration)||0;return ds(Number(t))}get time(){return ds(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=us(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:r}){var n;return this.allowFlatten&&((n=this.animation.effect)==null||n.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&fle()?(this.animation.timeline=t,ro):r(this)}}const kP={anticipate:sP,backInOut:oP,circInOut:lP};function _le(e){return e in kP}function ble(e){typeof e.ease=="string"&&_le(e.ease)&&(e.ease=kP[e.ease])}const YE=10;class xle extends yle{constructor(t){ble(t),wP(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:r,onUpdate:n,onComplete:i,element:o,...s}=this.options;if(!r)return;if(t!==void 0){r.set(t);return}const a=new I3({...s,autoplay:!1}),l=us(this.finishedTime??this.time);r.setWithVelocity(a.sample(l-YE).value,a.sample(l).value,YE),a.stop()}}const ZE=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Za.test(e)||e==="0")&&!e.startsWith("url("));function wle(e){const t=e[0];if(e.length===1)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}function Ele(e,t,r,n){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],s=ZE(i,t),a=ZE(o,t);return!s||!a?!1:wle(e)||(r==="spring"||AP(r))&&n}function O3(e){return JI(e)&&"offsetHeight"in e}const Sle=new Set(["opacity","clipPath","filter","transform"]),Cle=y3(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Tle(e){var d;const{motionValue:t,name:r,repeatDelay:n,repeatType:i,damping:o,type:s}=e;if(!O3((d=t==null?void 0:t.owner)==null?void 0:d.current))return!1;const{onUpdate:a,transformTemplate:l}=t.owner.getProps();return Cle()&&r&&Sle.has(r)&&(r!=="transform"||!l)&&!a&&!n&&i!=="mirror"&&o!==0&&s!=="inertia"}const Ale=40;class kle extends R3{constructor({autoplay:t=!0,delay:r=0,type:n="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:s="loop",keyframes:a,name:l,motionValue:d,element:u,...h}){var m;super(),this.stop=()=>{var g,y;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(y=this.keyframeResolver)==null||y.cancel()},this.createdAt=Si.now();
143const f={autoplay:t,delay:r,type:n,repeat:i,repeatDelay:o,repeatType:s,name:l,motionValue:d,element:u,...h},p=(u==null?void 0:u.KeyframeResolver)||P3;this.keyframeResolver=new p(a,(g,y,b)=>this.onKeyframesResolved(g,y,f,!b),l,d,u),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(t,r,n,i){this.keyframeResolver=void 0;const{name:o,type:s,velocity:a,delay:l,isHandoff:d,onUpdate:u}=n;this.resolvedAt=Si.now(),Ele(t,o,s,a)||((ta.instantAnimations||!l)&&(u==null||u(k3(t,n,r))),t[0]=t[t.length-1],n.duration=0,n.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Ale?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...n,keyframes:t},p=!d&&Tle(f)?new xle({...f,element:f.motionValue.owner.current}):new I3(f);p.finished.then(()=>this.notifyFinished()).catch(ro),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(t,r){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),ule()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const Rle=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ile(e){const t=Rle.exec(e);if(!t)return[,];const[,r,n,i]=t;return[`--${r??n}`,i]}function RP(e,t,r=1){const[n,i]=Ile(e);if(!n)return;const o=window.getComputedStyle(t).getPropertyValue(n);if(o){const s=o.trim();return XI(s)?parseFloat(s):s}return E3(i)?RP(i,t,r+1):i}function j3(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const IP=new Set(["width","height","top","left","right","bottom",...pd]),Ple={test:e=>e==="auto",parse:e=>e},PP=e=>t=>t.test(e),OP=[fd,Tt,hs,Ca,wae,xae,Ple],XE=e=>OP.find(PP(e));function Ole(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||QI(e):!0}const jle=new Set(["brightness","contrast","saturate","opacity"]);function Lle(e){const[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=r.match(S3)||[];if(!n)return e;const i=r.replace(n,"");let o=jle.has(t)?1:0;return n!==r&&(o*=100),t+"("+o+i+")"}const $le=/\b([a-z-]*)\(.*?\)/gu,Uy={...Za,getAnimatableNone:e=>{const t=e.match($le);return t?t.map(Lle).join(" "):e}},JE={...fd,transform:Math.round},Dle={rotate:Ca,rotateX:Ca,rotateY:Ca,rotateZ:Ca,scale:Gp,scaleX:Gp,scaleY:Gp,scaleZ:Gp,skew:Ca,skewX:Ca,skewY:Ca,distance:Tt,translateX:Tt,translateY:Tt,translateZ:Tt,x:Tt,y:Tt,z:Tt,perspective:Tt,transformPerspective:Tt,opacity:ff,originX:FE,originY:FE,originZ:Tt},L3={borderWidth:Tt,borderTopWidth:Tt,borderRightWidth:Tt,borderBottomWidth:Tt,borderLeftWidth:Tt,borderRadius:Tt,radius:Tt,borderTopLeftRadius:Tt,borderTopRightRadius:Tt,borderBottomRightRadius:Tt,borderBottomLeftRadius:Tt,width:Tt,maxWidth:Tt,height:Tt,maxHeight:Tt,top:Tt,right:Tt,bottom:Tt,left:Tt,padding:Tt,paddingTop:Tt,paddingRight:Tt,paddingBottom:Tt,paddingLeft:Tt,margin:Tt,marginTop:Tt,marginRight:Tt,marginBottom:Tt,marginLeft:Tt,backgroundPositionX:Tt,backgroundPositionY:Tt,...Dle,zIndex:JE,fillOpacity:ff,strokeOpacity:ff,numOctaves:JE},Mle={...L3,color:rn,backgroundColor:rn,outlineColor:rn,fill:rn,stroke:rn,borderColor:rn,borderTopColor:rn,borderRightColor:rn,borderBottomColor:rn,borderLeftColor:rn,filter:Uy,WebkitFilter:Uy},jP=e=>Mle[e];function LP(e,t){let r=jP(e);return r!==Uy&&(r=Za),r.getAnimatableNone?r.getAnimatableNone(t):void 0}const Nle=new Set(["auto","none","0"]);function Fle(e,t,r){let n=0,i;for(;n<e.length&&!i;){const o=e[n];
143typeof o=="string"&&!Nle.has(o)&&pf(o).values.length&&(i=e[n]),n++}if(i&&r)for(const o of t)e[o]=LP(r,i)}class Ule extends P3{constructor(t,r,n,i,o){super(t,r,n,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:r,name:n}=this;if(!r||!r.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let d=t[l];if(typeof d=="string"&&(d=d.trim(),E3(d))){const u=RP(d,r.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!IP.has(n)||t.length!==2)return;const[i,o]=t,s=XE(i),a=XE(o);if(s!==a)if(GE(s)&&GE(a))for(let l=0;l<t.length;l++){const d=t[l];typeof d=="string"&&(t[l]=parseFloat(d))}else Yl[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:r}=this,n=[];for(let i=0;i<t.length;i++)(t[i]===null||Ole(t[i]))&&n.push(i);n.length&&Fle(t,n,r)}measureInitialState(){const{element:t,unresolvedKeyframes:r,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Yl[n](t.measureViewportBox(),window.getComputedStyle(t.current)),r[0]=this.measuredOrigin;const i=r[r.length-1];i!==void 0&&t.getValue(n,i).jump(i,!1)}measureEndState(){var a;const{element:t,name:r,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(r);i&&i.jump(this.measuredOrigin,!1);const o=n.length-1,s=n[o];n[o]=Yl[r](t.measureViewportBox(),window.getComputedStyle(t.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEac
143h(([l,d])=>{t.getValue(l).set(d)}),this.resolveNoneKeyframes()}}function Ble(e,t,r){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let n=document;t&&(n=t.current);const i=(r==null?void 0:r[e])??n.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}const $P=(e,t)=>t&&typeof e=="number"?t.transform(e):e,QE=30,Vle=e=>!isNaN(parseFloat(e)),e9={current:void 0};class Hle{constructor(t,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(n,i=!0)=>{var s,a;const o=Si.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const l of this.dependents)l.dirty();i&&((a=this.events.renderRequest)==null||a.notify(this.current))},this.hasAnimated=!1,this.setCurrent(t),this.owner=r.owner}setCurrent(t){this.current=t,this.updatedAt=Si.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Vle(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,r){this.events[t]||(this.events[t]=new _3);const n=this.events[t].add(r);return t==="change"?()=>{n(),jr.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t,r=!0){!r||!this.passiveEffect?this.updateAndNotify(t,r):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,r=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return e9.current&&e9.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=Si.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>QE)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,QE);return eP(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(t){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=t(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,r;(t=this.dependents)==null||t.clear(),(r=this.events.destroy)==null||r.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function zu(e,t){return new Hle(e,t)}const{schedule:$3,cancel:fCe}=dP(queueMicrotask,!1),go={x:!1,y:!1};function DP(){return go.x||go.y}function zle(e){return e==="x"||e==="y"?go[e]?null:(go[e]=!0,()=>{go[e]=!1}):go.x||go.y?null:(go.x=go.y=!0,()=>{go.x=go.y=!1})}function MP(e,t){const r=Ble(e),n=new AbortController,i={passive:!0,...t,signal:n.signal};return[r,i,()=>n.abort()]}function t9(e){return!(e.pointerType==="touch"||DP())}function Wle(e,t,r={}){const[n,i,o]=MP(e,r),s=a=>{if(!t9(a))return;const{target:l}=a,d=t(l,a);if(typeof d!="function"||!l)return;const u=h=>{t9(h)&&(d(h),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,i)};return n.forEach(a=>{a.addEventListener("pointerenter",s,i)}),o}const NP=(e,t)=>t?e===t?!0:NP(e,t.parentElement):!1,D3=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,qle=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Gle(e){return qle.has(e.tagName)||e.tabIndex!==-1}const D0=new WeakSet;function r9(e){return t=>{t.key==="Enter"&&e(t)}}function rv(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Kle=(e,t)=>
143{const r=e.currentTarget;if(!r)return;const n=r9(()=>{if(D0.has(r))return;rv(r,"down");const i=r9(()=>{rv(r,"up")}),o=()=>rv(r,"cancel");r.addEventListener("keyup",i,t),r.addEventListener("blur",o,t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)};function n9(e){return D3(e)&&!DP()}function Yle(e,t,r={}){const[n,i,o]=MP(e,r),s=a=>{const l=a.currentTarget;if(!n9(a))return;D0.add(l);const d=t(l,a),u=(p,m)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),D0.has(l)&&D0.delete(l),n9(p)&&typeof d=="function"&&d(p,{success:m})},h=p=>{u(p,l===window||l===document||r.useGlobalTarget||NP(l,p.target))},f=p=>{u(p,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return n.forEach(a=>{(r.useGlobalTarget?window:a).addEventListener("pointerdown",s,i),O3(a)&&(a.addEventListener("focus",d=>Kle(d,i)),!Gle(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function FP(e){return JI(e)&&"ownerSVGElement"in e}function Zle(e){return FP(e)&&e.tagName==="svg"}const Vn=e=>!!(e&&e.getVelocity),Xle=[...OP,rn,Za],Jle=e=>Xle.find(PP(e)),M3=v.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class Qle extends v.Component{getSnapshotBeforeUpdate(t){const r=this.props.childRef.current;if(r&&t.isPresent&&!this.props.isPresent){const n=r.offsetParent,i=O3(n)&&n.offsetWidth||0,o=this.props.sizeRef.current;o.height=r.offsetHeight||0,o.width=r.offsetWidth||0,o.top=r.offsetTop,o.left=r.offsetLeft,o.right=i-o.width-o.left}return null}componentDidUpdate(){}render(){return this.props.children}}function ece({children:e,isPresent:t,anchorX:r}){const n=v.useId(),i=v.useRef(null),o=v.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:s}=v.useContext(M3);return v.useInsertionEffect(()=>{const{width:a,height:l,top:d,left:u,right:h}=o.current;if(t||!i.current||!a||!l)return;const f=r==="left"?`left: ${u}`:`right: ${h}`;i.current.dataset.motionPopId=n;const p=document.createElement("style");return s&&(p.nonce=s),document.head.appendChild(p),p.sheet&&p.sheet.insertRule(` 144 [data-motion-pop-id="${n}"] { 145 position: absolute !important; 146 width: ${a}px !important; 147 height: ${l}px !important; 148 ${f}px !important; 149 top: ${d}px !important; 150 } 151 `),()=>{document.head.contains(p)&&document.head.removeChild(p)}},[t]),c.jsx(Qle,{isPresent:t,childRef:i,sizeRef:o,children:v.cloneElement(e,{ref:i})})}const tce=({children:e,initial:t,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:o,mode:s,anchorX:a})=>{const l=f3(rce),d=v.useId();let u=!0,h=v.useMemo(()=>(u=!1,{id:d,initial:t,isPresent:r,custom:i,onExitComplete:f=>{l.set(f,!0);for(const p of l.values())if(!p)return;n&&n()},register:f=>(l.set(f,!1),()=>l.delete(f))}),[r,l,n]);return o&&u&&(h={...h}),v.useMemo(()=>{l.forEach((f,p)=>l.set(p,!1))},[r]),v.useEffect(()=>{!r&&!l.size&&n&&n()},[r]),s==="popLayout"&&(e=c.jsx(ece,{isPresent:r,anchorX:a,children:e})),c.jsx(Eg.Provider,{value:h,children:e})};function rce(){return new Map}function UP(e=!0){const t=v.useContext(Eg);if(t===null)return[!0,null];const{isPresent:r,onExitComplete:n,register:i}=t,o=v.useId();v.useEffect(()=>{if(e)return i(o)},[e]);const s=v.useCallback(()=>e&&n&&n(o),[o,n,e]);return!r&&n?[!1,s]:[!0]}const Kp=e=>e.key||"";function i9(e){const t=[];return v.Children.forEach(e,r=>{v.isValidElement(r)&&t.push(r)}),t}const Ws=({children:e,custom:t,initial:r=!0,onExitComplete:n,presenceAffectsLayout:i=!0,mode:o="sync",propagate:s=!1,anchorX:a="left"})=>{const[l,d]=UP(s),u=v.useMemo(()=>i9(e),[e]),h=s&&!l?[]:u.map(Kp),f=v.useRef(!0),p=v.useRef(u),m=f3(()=>new Map),[g,y]=v.useState(u),[b,E]=v.useState(u);ZI(()=>{f.current=!1,p.current=u;for(let A=0;A<b.length;A++){const w=Kp(b[A]);h.includes(w)?m.delete(w):m.get(w)!==!0&&m.set(w,!1)}},[b,h.length,h.join("-")]);const S=[];if(u!==g){let A=[...u];for(let w=0;w<b.length;w++){const _=b[w],x=Kp(_);h.includes(x)||(A.splice(w,0,_),S.push(_))}return o==="wait"&&S.length&&(A=S),E(i9(A)),y(u),null}const{forceRender:k}=v.useContext(h3);return c.jsx(c.Fragment,{children:b.map(A=>{const w=Kp(A),_=s&&!l?!1:u===b||h.includes(w),x=()=>
vendor: 4,504 bytes, line 151
151{if(m.has(w))m.set(w,!0);else return;let C=!0;m.forEach(P=>{P||(C=!1)}),C&&(k==null||k(),E(p.current),s&&(d==null||d()),n&&n())};return c.jsx(tce,{isPresent:_,initial:!f.current||r?void 0:!1,custom:t,presenceAffectsLayout:i,mode:o,onExitComplete:_?void 0:x,anchorX:a,children:A},w)})})},BP=v.createContext({strict:!1}),o9={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Wu={};for(const e in o9)Wu[e]={isEnabled:t=>o9[e].some(r=>!!t[r])};function nce(e){for(const t in e)Wu[t]={...Wu[t],...e[t]}}const ice=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function X1(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||ice.has(e)}let VP=e=>!X1(e);function oce(e){typeof e=="function"&&(VP=t=>t.startsWith("on")?!X1(t):e(t))}try{oce(require("@emotion/is-prop-valid").default)}catch{}function sce(e,t,r){const n={};for(const i in e)i==="values"&&typeof e.values=="object"||(VP(i)||r===!0&&X1(i)||!t&&!X1(i)||e.draggable&&i.startsWith("onDrag"))&&(n[i]=e[i]);return n}function ace(e){if(typeof Proxy>"u")return e;const t=new Map,r=(...n)=>e(...n);return new Proxy(r,{get:(n,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const Sg=v.createContext({});function Cg(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function mf(e){return typeof e=="string"||Array.isArray(e)}const N3=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],F3=["initial",...N3];function Tg(e){return Cg(e.animate)||F3.some(t=>mf(e[t]))}function HP(e){return!!(Tg(e)||e.variants)}function lce(e,t){if(Tg(e)){const{initial:r,animate:n}=e;return{initial:r===!1||mf(r)?r:void 0,animate:mf(n)?n:void 0}}return e.inherit!==!1?t:{}}function cce(e){const{initial:t,animate:r}=lce(e,v.useContext(Sg));return v.useMemo(()=>({initial:t,animate:r}),[s9(t),s9(r)])}function s9(e){return Array.isArray(e)?e.join(" "):e}const uce=Symbol.for("motionComponentSymbol");function ou(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function dce(e,t,r){return v.useCallback(n=>{n&&e.onMount&&e.onMount(n),t&&(n?t.mount(n):t.unmount()),r&&(typeof r=="function"?r(n):ou(r)&&(r.current=n))},[t])}const U3=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),hce="framerAppearId",zP="data-"+U3(hce),WP=v.createContext({});function fce(e,t,r,n,i){var g,y;const{visualElement:o}=v.useContext(Sg),s=v.useContext(BP),a=v.useContext(Eg),l=v.useContext(M3).reducedMotion,d=v.useRef(null);n=n||s.renderer,!d.current&&n&&(d.current=n(e,{visualState:t,parent:o,props:r,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const u=d.current,h=v.useContext(WP);u&&!u.projection&&i&&(u.type==="html"||u.type==="svg")&&pce(d.current,r,i,h);const f=v.useRef(!1);v.useInsertionEffect(()=>{u&&f.current&&u.update(r,a)});const p=r[zP],m=v.useRef(!!p&&!((g=window.MotionHandoffIsComplete)!=null&&g.call(window,p))&&((y=window.MotionHasOptimisedAnimation)==null?void 0:y.call(window,p)));return ZI(()=>{u&&(f.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),$3.render(u.render),m.current&&u.animationState&&u.animationState.animateChanges())}),v.useEffect(()=>{u&&(!m.current&&u.animationState&&u.animationState.animateChanges(),m.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)==null||b.call(window,p)}),m.current=!1))}),u}function pce(e,t,r,n){const{layoutId:i,layout:o,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:d,layoutCrossfade:u}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:qP(e.parent)),e.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!s||a&&ou(a),visualElement:e,animationType:typeof o=="str
151ing"?o:"both",initialPromotionConfig:n,crossfade:u,layoutScroll:l,layoutRoot:d})}function qP(e){if(e)return e.options.allowProjection!==!1?e.projection:qP(e.parent)}function mce({preloadedFeatures:e,createVisualElement:t,useRender:r,useVisualState:n,Component:i}){e&&nce(e);function o(a,l){let d;const u={...v.useContext(M3),...a,layoutId:gce(a)},{isStatic:h}=u,f=cce(a),p=n(a,h);if(!h&&p3){vce();const m=yce(u);d=m.MeasureLayout,f.visualElement=fce(i,p,u,t,m.ProjectionNode)}return c.jsxs(Sg.Provider,{value:f,children:[d&&f.visualElement?c.jsx(d,{visualElement:f.visualElement,...u}):null,r(i,a,dce(p,f.visualElement,l),p,h,f.visualElement)]})}o.displayName=`motion.${typeof i=="string"?i:`create(${i.displayName??i.name??""})`}`;const s=v.forwardRef(o);return s[uce]=i,s}function gce({layoutId:e}){const t=v.useContext(h3).id;return t&&e!==void 0?t+"-"+e:e}function vce(e,t){v.useContext(BP).strict}function yce(e){const{drag:t,layout:r}=Wu;if(!t&&!r)return{};const n={...t,...r};return{MeasureLayout:t!=null&&t.isEnabled(e)||r!=null&&r.isEnabled(e)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}const gf={};function _ce(e){for(const t in e)gf[t]=e[t],w3(t)&&(gf[t].isCSSVariable=!0)}function GP(e,{layout:t,layoutId:r}){return md.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!gf[e]||e==="opacity")}const bce={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},xce=pd.length;function wce(e,t,r){let n="",i=!0;for(let o=0;o<xce;o++){const s=pd[o],a=e[s];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(s.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||r){const d=$P(a,L3[s]);if(!l){i=!1;const u=bce[s]||s;n+=`${u}(${d}) `}r&&(t[s]=d)}}return n=n.trim(),r?n=r(t,i?"":n):i&&(n="none"),n}function B3(e,t,r){const{style:n,vars:i,transformOrigin:o}=e;let s=!1,a=!1;for(const l in t){const d=t[l];if(md.has(l)){s=!0;continue}else if(w3(l)){i[l]=d;continue}else{const u=$P(d,L3[l]);l.startsWith("origin")?(a=!0,o[l]=u):n[l]=u}}if(t.transform||(s||r?n.transform=wce(t,e.transform,r):n.transform&&(n.transform="none")),a){const{originX:l="50%",originY:d="50%",originZ:u=0}=o;n.transformOrigin=`${l} ${d} ${u}`}}const V3=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function KP(e,t,r){for(const n in t)!Vn(t[n])&&!GP(n,r)&&(e[n]=t[n])}function Ece({transformTemplate:e},t){return v.useMemo(()=>{const r=V3();return B3(r,t,e),Object.assign({},r.vars,r.style)},[t])}function Sce(e,t){const r=e.style||{},n={};return KP(n,r,e),Object.assign(n,Ece(e,t)),n}function Cce(e,t){const r={},n=Sce(e,t);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r}const Tce={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ace={offset:"strokeDashoffset",array:"strokeDasharray"};function kce(e,t,r=1,n=0,i=!0){e.pathLength=1;const o=i?Tce:Ace;e[o.offset]=Tt.transform(-n);const s=Tt.transform(t),a=Tt.transform(r);e[o.array]=`${s} ${a}`}function YP(e,{attrX:t,attrY:r,attrScale:n,pathLength:i,pathSpacing:o=1,pathOffset:s=0,...a},l,d,u){if(B3(e,a,d),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:f}=e;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete h.transformBox),t!==void 0&&(h.x=t),r!==void 0&&(h.y=r),n!==void 0&&(h.scale=n),i!==void 0&&kce(h,i,o,s,!1)}const ZP=()=>({...V3(),attrs:{}}),XP=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Rce(e,t,r,n){const i=v.useMemo(()=>{const o=ZP();return YP(o,t,XP(n),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};KP(o,e.style,e),i.style={...o,...i.style}}return i}const Ice=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function H3(e){return typeof e!="string"||e.includes("-")?!1:!!(Ice.indexOf(e)>-1||/[A-Z]/u.test(e))}function Pce(e=!1){return(r,n,i,{latestValues:o},s)=>{const l=(H3(r)?Rce:Cce)(n,o,s,r),d=sce(n,typeof r=="string",e),u=r!==v.Fragment?{...d,...l,ref:i}:{},{children:h}=n,f=v.useMemo(()=>Vn(h)?h.get():h,[h]);return v.createElement(r,{...u,children:f})}}function a9(e){const t=[{},{}];
151return e==null||e.values.forEach((r,n)=>{t[0][n]=r.get(),t[1][n]=r.getVelocity()}),t}function z3(e,t,r,n){if(typeof t=="function"){const[i,o]=a9(n);t=t(r!==void 0?r:e.custom,i,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,o]=a9(n);t=t(r!==void 0?r:e.custom,i,o)}return t}function M0(e){return Vn(e)?e.get():e}function Oce({scrapeMotionValuesFromProps:e,createRenderState:t},r,n,i){return{latestValues:jce(r,n,i,e),renderState:t()}}const JP=e=>(t,r)=>{const n=v.useContext(Sg),i=v.useContext(Eg),o=()=>Oce(e,t,n,i);return r?o():f3(o)};function jce(e,t,r,n){const i={},o=n(e,{});for(const f in o)i[f]=M0(o[f]);let{initial:s,animate:a}=e;const l=Tg(e),d=HP(e);t&&d&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let u=r?r.initial===!1:!1;u=u||s===!1;const h=u?a:s;if(h&&typeof h!="boolean"&&!Cg(h)){const f=Array.isArray(h)?h:[h];for(let p=0;p<f.length;p++){const m=z3(e,f[p]);if(m){const{transitionEnd:g,transition:y,...b}=m;for(const E in b){let S=b[E];if(Array.isArray(S)){const k=u?S.length-1:0;S=S[k]}S!==null&&(i[E]=S)}for(const E in g)i[E]=g[E]}}}return i}function W3(e,t,r){var o;const{style:n}=e,i={};for(const s in n)(Vn(n[s])||t.style&&Vn(t.style[s])||GP(s,e)||((o=r==null?void 0:r.getValue(s))==null?void 0:o.liveStyle)!==void 0)&&(i[s]=n[s]);return i}const Lce={useVisualState:JP({scrapeMotionValuesFromProps:W3,createRenderState:V3})};function QP(e,t,r){const n=W3(e,t,r);for(const i in e)if(Vn(e[i])||Vn(t[i])){const o=pd.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[o]=e[i]}return n}const $ce={useVisualState:JP({scrapeMotionValuesFromProps:QP,createRenderState:ZP})};function Dce(e,t){return function(n,{forwardMotionProps:i}={forwardMotionProps:!1}){const s={...H3(n)?$ce:Lce,preloadedFeatures:e,useRender:Pce(i),createVisualElement:t,Component:n};return mce(s)}}function vf(e,t,r){const n=e.getProps();return z3(n,t,r!==void 0?r:n.custom,e)}const By=e=>Array.isArray(e);function Mce(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,zu(r))}function Nce(e){return By(e)?e[e.length-1]||0:e}function Fce(e,t){const r=vf(e,t);let{transitionEnd:n={},transition:i={},...o}=r||{};o={...o,...n};for(const s in o){const a=Nce(o[s]);Mce(e,s,a)}}function Uce(e){return!!(Vn(e)&&e.add)}function Vy(e,t){const r=e.getValue("willChange");if(Uce(r))return r.add(t);if(!r&&ta.WillChange){const n=new ta.WillChange("auto");e.addValue("willChange",n),n.add(t)}}function eO(e){return e.props[zP]}const Bce=e=>e!==null;function Vce(e,{repeat:t,repeatType:r="loop"},n){const i=e.filter(Bce),o=t&&r!=="loop"&&t%2===1?0:i.length-1;return!o||n===void 0?i[o]:n}const Hce={type:"spring",stiffness:500,damping:25,restSpeed:10},zce=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Wce={type:"keyframes",duration:.8},qce={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Gce=(e,{keyframes:t})=>t.length>2?Wce:md.has(e)?e.startsWith("scale")?zce(t[1]):Hce:qce;function Kce({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:o,repeatType:s,repeatDelay:a,from:l,elapsed:d,...u}){return!!Object.keys(u).length}const q3=(e,t,r,n={},i,o)=>s=>{const a=j3(n,e)||{},l=a.delay||n.delay||0;let{elapsed:d=0}=n;d=d-us(l);const u={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-d,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:i};Kce(a)||Object.assign(u,Gce(e,u)),u.duration&&(u.duration=us(u.duration)),u.repeatDelay&&(u.repeatDelay=us(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(h=!0)),(ta.instantAnimations||ta.skipAnimations)&&(h=!0,u.duration=0,u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!o&&t.get()!==void 0){const f=Vce(u.keyframes,a);if(f!==void 0){jr.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new I3(u):new kle(u)};function Yce({protectedKeys:e,needsAnimating:t},r){const n=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,n}function tO(e,t,{delay:r=0,transitionOverride:n,type:i}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:s,...a}=t;n&&(o=n);const l=[],d=i&&e.animationState&&e.animationState.getState()[i];for(const u in a){const h=e.getValue(u,e.latestValues[u]??null),f=a[u];if(f===void 0||d&&Yce(d,u))continue;const p={delay:r,...j3(o||{},u)},m=h.get();if(m!==void 0&&!h.isAnimating&&!Array.isArray(f)&&f===m&&!p.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const b=eO(e);if(b){const E=window.MotionHandoffAnimation(b,u,jr);E!==null&&(p.startTime=E,g=!0)}}Vy(e,u),h.start(q3(u,h,f,e.shouldReduceMotion&&IP.has(u)?{type:!1}:p,e,g));const y=h.animation;y&&l.push(y)}return s&&Promise.all(l).then(()=>{jr.update(()=>{s&&Fce(e,s)})}),l}function Hy(e,t,r={}){var l;const n=vf(e,t,r.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(i=r.transitionOverride);const o=n?()=>Promise.all(tO(e,n,r)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:u=0,staggerChildren:h,staggerDirection:f}=i;return Zce(e,t,u+d,h,f,r)}:()=>Promise.resolve(),{when:a}=i;if(a){const[d,u]=a==="beforeChildren"?[o,s]:[s,o];return d().then(()=>u())}else return Promise.all([o(),s(r.delay)])}function Zce(e,t,r=0,n=0,i=1,o){const s=[],a=(e.variantChildren.size-1)*n,l=i===1?(d=0)=>d*n:(d=0)=>a-d*n;return Array.from(e.variantChildren).sort(Xce).forEach((d,u)=>{d.notify("AnimationStart",t),s.push(Hy(d,t,{...o,delay:r+l(u)}).then(()=>d.notify("AnimationComplete",t)))}),Promise.all(s)}function Xce(e,t){return e.sortNodePosition(t)}
vendor: 33,254 bytes, line 151
151function Jce(e,t,r={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){const i=t.map(o=>Hy(e,o,r));n=Promise.all(i)}else if(typeof t=="string")n=Hy(e,t,r);else{const i=typeof t=="function"?vf(e,t,r.custom):t;n=Promise.all(tO(e,i,r))}return n.then(()=>{e.notify("AnimationComplete",t)})}function rO(e,t){if(!Array.isArray(t))return!1;const r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}const Qce=F3.length;function nO(e){if(!e)return;if(!e.isControllingVariants){const r=e.parent?nO(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}const t={};for(let r=0;r<Qce;r++){const n=F3[r],i=e.props[n];(mf(i)||i===!1)&&(t[n]=i)}return t}const eue=[...N3].reverse(),tue=N3.length;function rue(e){return t=>Promise.all(t.map(({animation:r,options:n})=>Jce(e,r,n)))}function nue(e){let t=rue(e),r=l9(),n=!0;const i=l=>(d,u)=>{var f;const h=vf(e,u,l==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(h){const{transition:p,transitionEnd:m,...g}=h;d={...d,...g,...m}}return d};function o(l){t=l(e)}function s(l){const{props:d}=e,u=nO(e.parent)||{},h=[],f=new Set;let p={},m=1/0;for(let y=0;y<tue;y++){const b=eue[y],E=r[b],S=d[b]!==void 0?d[b]:u[b],k=mf(S),A=b===l?E.isActive:null;A===!1&&(m=y);let w=S===u[b]&&S!==d[b]&&k;if(w&&n&&e.manuallyAnimateOnMount&&(w=!1),E.protectedKeys={...p},!E.isActive&&A===null||!S&&!E.prevProp||Cg(S)||typeof S=="boolean")continue;const _=iue(E.prevProp,S);let x=_||b===l&&E.isActive&&!w&&k||y>m&&k,C=!1;const P=Array.isArray(S)?S:[S];let I=P.reduce(i(b),{});A===!1&&(I={});const{prevResolvedValues:O={}}=E,D={...O,...I},M=j=>{x=!0,f.has(j)&&(C=!0,f.delete(j)),E.needsAnimating[j]=!0;const q=e.getValue(j);q&&(q.liveStyle=!1)};for(const j in D){const q=I[j],W=O[j];if(p.hasOwnProperty(j))continue;let ne=!1;By(q)&&By(W)?ne=!rO(q,W):ne=q!==W,ne?q!=null?M(j):f.add(j):q!==void 0&&f.has(j)?M(j):E.protectedKeys[j]=!0}E.prevProp=S,E.prevResolvedValues=I,E.isActive&&(p={...p,...I}),n&&e.blockInitialAnimation&&(x=!1),x&&(!(w&&_)||C)&&h.push(...P.map(j=>({animation:j,options:{type:b}})))}if(f.size){const y={};if(typeof d.initial!="boolean"){const b=vf(e,Array.isArray(d.initial)?d.initial[0]:d.initial);b&&b.transition&&(y.transition=b.transition)}f.forEach(b=>{const E=e.getBaseTarget(b),S=e.getValue(b);S&&(S.liveStyle=!0),y[b]=E??null}),h.push({animation:y})}let g=!!h.length;return n&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(g=!1),n=!1,g?t(h):Promise.resolve()}function a(l,d){var h;if(r[l].isActive===d)return Promise.resolve();(h=e.variantChildren)==null||h.forEach(f=>{var p;return(p=f.animationState)==null?void 0:p.setActive(l,d)}),r[l].isActive=d;const u=s(l);for(const f in r)r[f].protectedKeys={};return u}return{animateChanges:s,setActive:a,setAnimateFunction:o,getState:()=>r,reset:()=>{r=l9(),n=!0}}}function iue(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!rO(t,e):!1}function gl(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function l9(){return{animate:gl(!0),whileInView:gl(),whileHover:gl(),whileTap:gl(),whileDrag:gl(),whileFocus:gl(),exit:gl()}}class ll{constructor(t){this.isMounted=!1,this.node=t}update(){}}class oue extends ll{constructor(t){super(t),t.animationState||(t.animationState=nue(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Cg(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:r}=this.node.prevProps||{};t!==r&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let sue=0;class aue extends ll{constructor(){super(...arguments),this.id=sue++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:r}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const i=this.node.animationState.setActive("exit",!t);r&&!t&&i.then(()=>{r(this.id)})}mount(){const{register:t,onExitComplete:r}=this.node.presenceContext||{};r&&r(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const lue={animation:{Feature:oue},exit:{Feature:aue}};function yf(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}function Xf(e){return{point:{x:e.pageX,y:e.pageY}}}const cue=e=>t=>D3(t)&&e(t,Xf(t));function xh(e,t,r,n){return yf(e,t,cue(r),n)}function iO({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function uue({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function due(e,t){if(!t)return e;const r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}const oO=1e-4,hue=1-oO,fue=1+oO,sO=.01,pue=0-sO,mue=0+sO;function ti(e){return e.max-e.min}function gue(e,t,r){return Math.abs(e-t)<=r}function c9(e,t,r,n=.5){e.origin=n,e.originPoint=Pr(t.min,t.max,e.origin),e.scale=ti(r)/ti(t),e.translate=Pr(r.min,r.max,e.origin)-e.originPoint,(e.scale>=hue&&e.scale<=fue||isNaN(e.scale))&&(e.scale=1),(e.translate>=pue&&e.translate<=mue||isNaN(e.translate))&&(e.translate=0)}function wh(e,t,r,n){c9(e.x,t.x,r.x,n?n.originX:void 0),c9(e.y,t.y,r.y,n?n.originY:void 0)}function u9(e,t,r){e.min=r.min+t.min,e.max=e.min+ti(t)}function vue(e,t,r){u9(e.x,t.x,r.x),u9(e.y,t.y,r.y)}function d9(e,t,r){e.min=t.min-r.min,e.max=e.min+ti(t)}function Eh(e,t,r){d9(e.x,t.x,r.x),d9(e.y,t.y,r.y)}const h9=()=>({translate:0,scale:1,origin:0,originPoint:0}),su=()=>({x:h9(),y:h9()}),f9=()=>({min:0,max:0}),Br=()=>({x:f9(),y:f9()});function Ki(e){return[e("x"),e("y")]}function nv(e){return e===void 0||e===1}function zy({scale:e,scaleX:t,scaleY:r}){return!nv(e)||!nv(t)||!nv(r)}function Cl(e){return zy(e)||aO(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function aO(e){return p9(e.x)||p9(e.y)}function p9(e){return e&&e!=="0%"}function J1(e,t,r){const n=e-r,i=t*n;return r+i}function m9(e,t,r,n,i){return i!==void 0&&(e=J1(e,i,n)),J1(e,r,n)+t}function Wy(e,t=0,r=1,n,i){e.min=m9(e.min,t,r,n,i),e.max=m9(e.max,t,r,n,i)}function lO(e,{x:t,y:r}){Wy(e.x,t.translate,t.scale,t.originPoint),Wy(e.y,r.translate,r.scale,r.originPoint)}const g9=.999999999999,v9=1.0000000000001;function yue(e,t,r,n=!1){const i=r.length;if(!i)return;t.x=t.y=1;let o,s;for(let a=0;a<i;a++){o=r[a],s=o.projectionDelta;const{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(n&&o.options.layoutScroll&&o.scroll&&o!==o.root&&lu(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,lO(e,s)),n&&Cl(o.latestValues)&&lu(e,o.latestValues))}t.x<v9&&t.x>g9&&(t.x=1),t.y<v9&&t.y>g9&&(t.y=1)}function au(e,t){e.min=e.min+t,e.max=e.max+t}function y9(e,t,r,n,i=.5){const o=Pr(e.min,e.max,i);Wy(e,t,r,o,n)}function lu(e,t){y9(e.x,t.x,t.scaleX,t.scale,t.originX),y9(e.y,t.y,t.scaleY,t.scale,t.originY)}function cO(e,t){return iO(due(e.getBoundingClientRect(),t))}function _ue(e,t,r){const n=cO(e,r),{scroll:i}=t;return i&&(au(n.x,i.offset.x),au(n.y,i.offset.y)),n}const uO=({current:e})=>e?e.ownerDocument.defaultView:null,_9=(e,t)=>Math.abs(e-t);function bue(e,t){const r=_9(e.x,t.x),n=_9(e.y,t.y);return Math.sqrt(r**2+n**2)}class dO{constructor(t,r,{transformPagePoint:n,contextWindow:i,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=ov(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=bue(h.offset,{x:0,y:0})>=3;if(!f&&!p)return;const{point:m}=h,{timestamp:g}=Rn;this.history.push({...m,timestamp:g});const{onStart:y,onMove:b}=this.handlers;f||(y&&y(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),b&&b(this.lastMoveEvent,h)},this.handlePointerMove=(h,f)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=iv(f,this.transformPagePoint),jr.update(this.updatePoint,!0)},this.handlePointerUp=(h,f)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=ov(h.type==="pointercancel"?this.lastMoveEventInfo:iv(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(h,y),m&&m(h,y)},!D3(t))return;this.dragSnapToOrigin=o,this.handlers=r,this.transformPagePoint=n,this.contextWindow=i||window;const s=Xf(t),a=iv(s,this.transformPagePoint),{point:l}=a,{timestamp:d}=Rn;this.history=[{...l,timestamp:d}];const{onSessionStart:u}=r;u&&u(t,ov(a,this.history)),this.removeListeners=Kf(xh(this.contextWindow,"pointermove",this.handlePointerMove),xh(this.contextWindow,"pointerup",this.handlePointerUp),xh(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Ya(this.updatePoint)}}function iv(e,t){return t?{point:t(e.point)}:e}function b9(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ov({point:e},t){return{point:e,delta:b9(e,hO(t)),offset:b9(e,xue(t)),velocity:wue(t,.1)}}function xue(e){return e[0]}function hO(e){return e[e.length-1]}function wue(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null;const i=hO(e);for(;r>=0&&(n=e[r],!(i.timestamp-n.timestamp>us(t)));)r--;if(!n)return{x:0,y:0};const o=ds(i.timestamp-n.timestamp);if(o===0)return{x:0,y:0};const s={x:(i.x-n.x)/o,y:(i.y-n.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Eue(e,{min:t,max:r},n){return t!==void 0&&e<t?e=n?Pr(t,e,n.min):Math.max(e,t):r!==void 0&&e>r&&(e=n?Pr(r,e,n.max):Math.min(e,r)),e}function x9(e,t,r){return{min:t!==void 0?e.min+t:void 0,max:r!==void 0?e.max+r-(e.max-e.min):void 0}}function Sue(e,{top:t,left:r,bottom:n,right:i}){return{x:x9(e.x,r,i),y:x9(e.y,t,n)}}function w9(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,n]=[n,r]),{min:r,max:n}}function Cue(e,t){return{x:w9(e.x,t.x),y:w9(e.y,t.y)}}function Tue(e,t){let r=.5;const n=ti(e),i=ti(t);return i>n?r=hf(t.min,t.max-n,e.min):n>i&&(r=hf(e.min,e.max-i,t.min)),ea(0,1,r)}function Aue(e,t){const r={};return t.min!==void 0&&(r.min=t.min-e.min),t.max!==void 0&&(r.max=t.max-e.min),r}const qy=.35;function kue(e=qy){return e===!1?e=0:e===!0&&(e=qy),{x:E9(e,"left","right"),y:E9(e,"top","bottom")}}function E9(e,t,r){return{min:S9(e,t),max:S9(e,r)}}function S9(e,t){return typeof e=="number"?e:e[t]||0}const Rue=new WeakMap;class Iue{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Br(),this.visualElement=t}start(t,{snapToCursor:r=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&n.isPresent===!1)return;const i=u=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor(Xf(u).point)},o=(u,h)=>{const{drag:f,dragPropagation:p,onDragStart:m}=this.getProps();if(f&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=zle(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ki(y=>{let b=this.getAxisMotionValue(y).get()||0;if(hs.test(b)){const{projection:E}=this.visualElement;if(E&&E.layout){const S=E.layout.layoutBox[y];S&&(b=ti(S)*(parseFloat(b)/100))}}this.originPoint[y]=b}),m&&jr.postRender(()=>m(u,h)),Vy(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},s=(u,h)=>{const{dragPropagation:f,dragDirectionLock:p,onDirectionLock:m,onDrag:g}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:y}=h;if(p&&this.currentDirection===null){this.currentDirection=Pue(y),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",h.point,y),this.updateAxis("y",h.point,y),this.visualElement.render(),g&&g(u,h)},a=(u,h)=>this.stop(u,h),l=()=>Ki(u=>{var h;return this.getAnimationState(u)==="paused"&&((h=this.getAxisMotionValue(u).animation)==null?void 0:h.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new dO(t,{onSessionStart:i,onStart:o,onMove:s,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,contextWindow:uO(this.visualElement)})}stop(t,r){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=r;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&jr.postRender(()=>o(t,r))}cancel(){this.isDragging=!1;const{projection:t,animationState:r}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(t,r,n){const{drag:i}=this.getProps();if(!n||!Yp(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(s=Eue(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){var o;const{dragConstraints:t,dragElastic:r}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,i=this.constraints;t&&ou(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=Sue(n.layoutBox,t):this.constraints=!1,this.elastic=kue(r),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Ki(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=Aue(n.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!ou(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=_ue(n,i.root,this.visualElement.getTransformPagePoint());let s=Cue(i.layout.layoutBox,o);if(r){const a=r(uue(s));this.hasMutatedConstraints=!!a,a&&(s=iO(a))}return s}startAnimation(t){const{drag:r,dragMomentum:n,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},d=Ki(u=>{if(!Yp(u,r,this.currentDirection))return;let h=l&&l[u]||{};s&&(h={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,m={type:"inertia",velocity:n?t[u]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...o,...h};return this.startAxisValueAnimation(u,m)});return Promise.all(d).then(a)}startAxisValueAnimation(t,r){const n=this.getAxisMotionValue(t);return Vy(this.visualElement,t),n.start(q3(t,n,0,r,this.visualElement,!1))}stopAnimation(){Ki(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ki(t=>{var r;return(r=this.getAxisMotionValue(t).animation)==null?void 0:r.pause()})}getAnimationState(t){var r;return(r=this.getAxisMotionValue(t).animation)==null?void 0:r.state}getAxisMotionValue(t){const r=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),i=n[r];return i||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Ki(r=>{const{drag:n}=this.getProps();if(!Yp(r,n,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(r);if(i&&i.layout){const{min:s,max:a}=i.layout.layoutBox[r];o.set(t[r]-Pr(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!ou(r)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ki(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const l=a.get();i[s]=Tue({min:l,max:l},this.constraints[s])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Ki(s=>{if(!Yp(s,t,null))return;const a=this.getAxisMotionValue(s),{min:l,max:d}=this.constraints[s];a.set(Pr(l,d,i[s]))})}addListeners(){if(!this.visualElement.current)return;Rue.set(this.visualElement,this);const t=this.visualElement.current,r=xh(t,"pointerdown",l=>{const{drag:d,dragListener:u=!0}=this.getProps();d&&u&&this.start(l)}),n=()=>{const{dragConstraints:l}=this.getProps();ou(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",n);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),jr.read(n);const s=yf(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:d})=>{this.isDragging&&d&&(Ki(u=>{const h=this.getAxisMotionValue(u);h&&(this.originPoint[u]+=l[u].translate,h.set(h.get()+l[u].translate))}),this.visualElement.render())});return()=>{s(),r(),o(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=qy,dragMomentum:a=!0}=t;return{...t,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:a}}}function Yp(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function Pue(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}class Oue extends ll{constructor(t){super(t),this.removeGroupControls=ro,this.removeListeners=ro,this.controls=new Iue(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ro}unmount(){this.removeGroupControls(),this.removeListeners()}}const C9=e=>(t,r)=>{e&&jr.postRender(()=>e(t,r))};class jue extends ll{constructor(){super(...arguments),this.removePointerDownListener=ro}onPointerDown(t){this.session=new dO(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:uO(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:r,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:C9(t),onStart:C9(r),onMove:n,onEnd:(o,s)=>{delete this.session,i&&jr.postRender(()=>i(o,s))}}}mount(){this.removePointerDownListener=xh(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const N0={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function T9(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Fd={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Tt.test(e))e=parseFloat(e);else return e;const r=T9(e,t.target.x),n=T9(e,t.target.y);return`${r}% ${n}%`}},Lue={correct:(e,{treeScale:t,projectionDelta:r})=>{const n=e,i=Za.parse(e);if(i.length>5)return n;const o=Za.createTransformer(e),s=typeof i[0]!="number"?1:0,a=r.x.scale*t.x,l=r.y.scale*t.y;i[0+s]/=a,i[1+s]/=l;const d=Pr(a,l,.5);return typeof i[2+s]=="number"&&(i[2+s]/=d),typeof i[3+s]=="number"&&(i[3+s]/=d),o(i)}};class $ue extends v.Component{componentDidMount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:o}=t;_ce(Due),o&&(r.group&&r.group.add(o),n&&n.register&&i&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),N0.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:r,visualElement:n,drag:i,isPresent:o}=this.props,{projection:s}=n;return s&&(s.isPresent=o,i||t.layoutDependency!==r||r===void 0||t.isPresent!==o?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||jr.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),$3.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function fO(e){const[t,r]=UP(),n=v.useContext(h3);return c.jsx($ue,{...e,layoutGroup:n,switchLayoutGroup:v.useContext(WP),isPresent:t,safeToRemove:r})}const Due={borderRadius:{...Fd,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Fd,borderTopRightRadius:Fd,borderBottomLeftRadius:Fd,borderBottomRightRadius:Fd,boxShadow:Lue};function Mue(e,t,r){const n=Vn(e)?e:zu(e);return n.start(q3("",n,t,r)),n.animation}const Nue=(e,t)=>e.depth-t.depth;class Fue{constructor(){this.children=[],this.isDirty=!1}add(t){m3(this.children,t),this.isDirty=!0}remove(t){g3(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Nue),this.isDirty=!1,this.children.forEach(t)}}function Uue(e,t){const r=Si.now(),n=({timestamp:i})=>{const o=i-r;o>=t&&(Ya(n),e(o-t))};return jr.setup(n,!0),()=>Ya(n)}const pO=["TopLeft","TopRight","BottomLeft","BottomRight"],Bue=pO.length,A9=e=>typeof e=="string"?parseFloat(e):e,k9=e=>typeof e=="number"||Tt.test(e);function Vue(e,t,r,n,i,o){i?(e.opacity=Pr(0,r.opacity??1,Hue(n)),e.opacityExit=Pr(t.opacity??1,0,zue(n))):o&&(e.opacity=Pr(t.opacity??1,r.opacity??1,n));for(let s=0;s<Bue;s++){const a=`border${pO[s]}Radius`;let l=R9(t,a),d=R9(r,a);if(l===void 0&&d===void 0)continue;l||(l=0),d||(d=0),l===0||d===0||k9(l)===k9(d)?(e[a]=Math.max(Pr(A9(l),A9(d),n),0),(hs.test(d)||hs.test(l))&&(e[a]+="%")):e[a]=d}(t.rotate||r.rotate)&&(e.rotate=Pr(t.rotate||0,r.rotate||0,n))}function R9(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Hue=mO(0,.5,aP),zue=mO(.5,.95,ro);function mO(e,t,r){return n=>n<e?0:n>t?1:r(hf(e,t,n))}function I9(e,t){e.min=t.min,e.max=t.max}function Hi(e,t){I9(e.x,t.x),I9(e.y,t.y)}function P9(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function O9(e,t,r,n,i){return e-=t,e=J1(e,1/r,n),i!==void 0&&(e=J1(e,1/i,n)),e}function Wue(e,t=0,r=1,n=.5,i,o=e,s=e){if(hs.test(t)&&(t=parseFloat(t),t=Pr(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=Pr(o.min,o.max,n);e===o&&(a-=t),e.min=O9(e.min,t,r,a,i),e.max=O9(e.max,t,r,a,i)}function j9(e,t,[r,n,i],o,s){Wue(e,t[r],t[n],t[i],t.scale,o,s)}const que=["x","scaleX","originX"],Gue=["y","scaleY","originY"];function L9(e,t,r,n){j9(e.x,t,que,r?r.x:void 0,n?n.x:void 0),j9(e.y,t,Gue,r?r.y:void 0,n?n.y:void 0)}function $9(e){return e.translate===0&&e.scale===1}function gO(e){return $9(e.x)&&$9(e.y)}function D9(e,t){return e.min===t.min&&e.max===t.max}function Kue(e,t){return D9(e.x,t.x)&&D9(e.y,t.y)}function M9(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function vO(e,t){return M9(e.x,t.x)&&M9(e.y,t.y)}function N9(e){return ti(e.x)/ti(e.y)}function F9(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Yue{constructor(){this.members=[]}add(t){m3(this.members,t),t.scheduleRender()}remove(t){if(g3(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(t){const r=this.members.findIndex(i=>t===i);if(r===0)return!1;let n;for(let i=r;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){n=o;break}}return n?(this.promote(n),!0):!1}promote(t,r){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,r&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:r,resumingFrom:n}=t;r.onExitComplete&&r.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Zue(e,t,r){let n="";const i=e.x.translate/t.x,o=e.y.translate/t.y,s=(r==null?void 0:r.z)||0;if((i||o||s)&&(n=`translate3d(${i}px, ${o}px, ${s}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){const{transformPerspective:d,rotate:u,rotateX:h,rotateY:f,skewX:p,skewY:m}=r;d&&(n=`perspective(${d}px) ${n}`),u&&(n+=`rotate(${u}deg) `),h&&(n+=`rotateX(${h}deg) `),f&&(n+=`rotateY(${f}deg) `),p&&(n+=`skewX(${p}deg) `),m&&(n+=`skewY(${m}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(n+=`scale(${a}, ${l})`),n||"none"}const sv=["","X","Y","Z"],Xue={visibility:"hidden"},Jue=1e3;let Que=0;function av(e,t,r,n){const{latestValues:i}=t;i[e]&&(r[e]=i[e],t.setStaticValue(e,0),n&&(n[e]=0))}function yO(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const r=eO(t);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:i,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",jr,!(i||o))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&yO(n)}function _O({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(s={},a=t==null?void 0:t()){this.id=Que++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(rde),this.nodes.forEach(ade),this.nodes.forEach(lde),this.nodes.forEach(nde)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Fue)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new _3),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const l=this.eventHandlers.get(s);l&&l.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=FP(s)&&!Zle(s),this.instance=s;const{layoutId:a,layout:l,visualElement:d}=this.options;if(d&&!d.current&&d.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u;const h=()=>this.root.updateBlockedByResize=!1;e(s,()=>{this.root.updateBlockedByResize=!0,u&&u(),u=Uue(h,250),N0.hasAnimatedSinceResize&&(N0.hasAnimatedSinceResize=!1,this.nodes.forEach(B9))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&d&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||d.getDefaultTransition()||fde,{onLayoutAnimationStart:g,onLayoutAnimationComplete:y}=d.getProps(),b=!this.targetLayout||!vO(this.targetLayout,p),E=!h&&f;if(this.options.layoutRoot||this.resumeFrom||E||h&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const S={...j3(m,"layout"),onPlay:g,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S),this.setAnimationOrigin(u,E)}else h||B9(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ya(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(cde),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&yO(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const h=this.path[u];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(U9);return}this.isUpdating||this.nodes.forEach(ode),this.isUpdating=!1,this.nodes.forEach(sde),this.nodes.forEach(ede),this.nodes.forEach(tde),this.clearAllSnapshots();const a=Si.now();Rn.delta=ea(0,1e3/60,a-Rn.timestamp),Rn.timestamp=a,Rn.isProcessing=!0,X2.update.process(Rn),X2.preRender.process(Rn),X2.render.process(Rn),Rn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,$3.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ide),this.sharedNodes.forEach(ude)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,jr.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){jr.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ti(this.snapshot.measuredBox.x)&&!ti(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Br(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a&&this.instance){const l=n(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!gO(this.projectionDelta),l=this.getTransformTemplate(),d=l?l(this.latestValues,""):void 0,u=d!==this.prevTransformTemplateValue;s&&this.instance&&(a||Cl(this.latestValues)||u)&&(i(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return s&&(l=this.removeTransform(l)),pde(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:s}=this.options;if(!s)return Br();const a=s.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(mde))){const{scroll:u}=this.root;u&&(au(a.x,u.offset.x),au(a.y,u.offset.y))}return a}removeElementScroll(s){var l;const a=Br();if(Hi(a,s),(l=this.scroll)!=null&&l.wasRoot)return a;for(let d=0;d<this.path.length;d++){const u=this.path[d],{scroll:h,options:f}=u;u!==this.root&&h&&f.layoutScroll&&(h.wasRoot&&Hi(a,s),au(a.x,h.offset.x),au(a.y,h.offset.y))}return a}applyTransform(s,a=!1){const l=Br();Hi(l,s);for(let d=0;d<this.path.length;d++){const u=this.path[d];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&lu(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Cl(u.latestValues)&&lu(l,u.latestValues)}return Cl(this.latestValues)&&lu(l,this.latestValues),l}removeTransform(s){const a=Br();Hi(a,s);for(let l=0;l<this.path.length;l++){const d=this.path[l];if(!d.instance||!Cl(d.latestValues))continue;zy(d.latestValues)&&d.updateSnapshot();
151const u=Br(),h=d.measurePageBox();Hi(u,h),L9(a,d.latestValues,d.snapshot?d.snapshot.layoutBox:void 0,u)}return Cl(this.latestValues)&&L9(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Rn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var f;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(s||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:h}=this.options;if(!(!this.layout||!(u||h))){if(this.resolvedRelativeTargetAt=Rn.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Br(),this.relativeTargetOrigin=Br(),Eh(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),Hi(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Br(),this.targetWithTransforms=Br()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),vue(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Hi(this.target,this.layout.layoutBox),lO(this.target,this.targetDelta)):Hi(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Br(),this.relativeTargetOrigin=Br(),Eh(this.relativeTargetOrigin,this.target,p.target),Hi(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||zy(this.parent.latestValues)||aO(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var m;const s=this.getLead(),a=!!this.resumingFrom||this!==s;let l=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Rn.timestamp&&(l=!1),l)return;const{layout:d,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||u))return;Hi(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;yue(this.layoutCorrected,this.treeScale,this.path,a),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=Br());const{target:p}=s;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(P9(this.prevProjectionDelta.x,this.projectionDelta.x),P9(this.prevProjectionDelta.y,this.projectionDelta.y)),wh(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!F9(this.projectionDelta.x,this.prevProjectionDelta.x)||!F9(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),s){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=su(),this.projectionDelta=su(),this.projectionDeltaWithTransform=su()}setAnimationOrigin(s,a=!1){const l=this.snapshot,d=l?l.latestValues:{},u={...this.latestValues},h=su();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=Br(),p=l?l.source:void 0,m=this.layout?this.layout.source:void 0,g=p!==m,y=this.getStack(),b=!y||y.members.length<=1,E=!!(g&&!b&&this.options.crossfade===!0&&!this.path.some(hde));this.animationProgress=0;let S;this.mixTargetDelta=k=>{const A=k/1e3;V9(h.x,s.x,A),V9(h.y,s.y,A),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Eh(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),dde(this.relativeTarget,this.relativeTargetOrigin,f,A),S&&Kue(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=Br()),Hi(S,this.relativeTarget)),g&&(this.animationValues=u,Vue(u,d,this.latestValues,A,E,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=A},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){var a,l,d;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(d=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||d.stop(),this.pendingAnimation&&(Ya(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=jr.update(()=>{N0.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=zu(0)),this.currentAnimation=Mue(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:u=>
vendor: 19,299 bytes, line 151
151{this.mixTargetDelta(u),s.onUpdate&&s.onUpdate(u)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Jue),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:l,layout:d,latestValues:u}=s;if(!(!a||!l||!d)){if(this!==s&&this.layout&&d&&bO(this.options.animationType,this.layout.layoutBox,d.layoutBox)){l=this.target||Br();const h=ti(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+h;const f=ti(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}Hi(a,l),lu(a,u),wh(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new Yue),this.sharedNodes.get(s).add(a);const d=a.options.initialPromotionConfig;a.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:l}={}){const d=this.getStack();d&&d.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const d={};l.z&&av("z",s,d,this.animationValues);for(let u=0;u<sv.length;u++)av(`rotate${sv[u]}`,s,d,this.animationValues),av(`skew${sv[u]}`,s,d,this.animationValues);s.render();for(const u in d)s.setStaticValue(u,d[u]),this.animationValues&&(this.animationValues[u]=d[u]);s.scheduleRender()}getProjectionStyles(s){if(!this.instance||this.isSVG)return;if(!this.isVisible)return Xue;const a={visibility:""},l=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=M0(s==null?void 0:s.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none",a;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const p={};return this.options.layoutId&&(p.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,p.pointerEvents=M0(s==null?void 0:s.pointerEvents)||""),this.hasProjected&&!Cl(this.latestValues)&&(p.transform=l?l({},""):"none",this.hasProjected=!1),p}const u=d.animationValues||d.latestValues;this.applyTransformsToTarget(),a.transform=Zue(this.projectionDeltaWithTransform,this.treeScale,u),l&&(a.transform=l(u,a.transform));const{x:h,y:f}=this.projectionDelta;a.transformOrigin=`${h.origin*100}% ${f.origin*100}% 0`,d.animationValues?a.opacity=d===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:a.opacity=d===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const p in gf){if(u[p]===void 0)continue;const{correct:m,applyTo:g,isCSSVariable:y}=gf[p],b=a.transform==="none"?u[p]:m(u[p],d);if(g){const E=g.length;for(let S=0;S<E;S++)a[g[S]]=b}else y?this.options.visualElement.renderState.vars[p]=b:a[p]=b}return this.options.layoutId&&(a.pointerEvents=d===this?M0(s==null?void 0:s.pointerEvents)||"":"none"),a}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var a;return(a=s.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(U9),this.root.sharedNodes.clear()}}}function ede(e){e.updateLayout()}function tde(e){var r;const t=((r=e.resumeFrom)==null?void 0:r.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=e.layout,{animationType:o}=e.options,s=t.source!==e.layout.source;o==="size"?Ki(h=>{const f=s?t.measuredBox[h]:t.layoutBox[h],p=ti(f);f.min=n[h].min,f.max=f.min+p}):bO(o,t.layoutBox,n)&&Ki(h=>{const f=s?t.measuredBox[h]:t.layoutBox[h],p=ti(n[h]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[h].max=e.relativeTarget[h].min+p)});const a=su();wh(a,n,t.layoutBox);const l=su();s?wh(l,e.applyTransform(i,!0),t.measuredBox):wh(l,n,t.layoutBox);const d=!gO(a);let u=!1;if(!e.resumeFrom){const h=e.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:p}=h;if(f&&p){const m=Br();Eh(m,t.layoutBox,f.layoutBox);const g=Br();Eh(g,n,p.layoutBox),vO(m,g)||(u=!0),h.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=m,e.relativeParent=h)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:d,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function rde(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function nde(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ide(e){e.clearSnapshot()}function U9(e){e.clearMeasurements()}function ode(e){e.isLayoutDirty=!1}function sde(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function B9(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ade(e){e.resolveTargetDelta()}function lde(e){e.calcProjection()}function cde(e){e.resetSkewAndRotation()}function ude(e){e.removeLeadSnapshot()}function V9(e,t,r){e.translate=Pr(t.translate,0,r),e.scale=Pr(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function H9(e,t,r,n){e.min=Pr(t.min,r.min,n),e.max=Pr(t.max,r.max,n)}function dde(e,t,r,n){H9(e.x,t.x,r.x,n),H9(e.y,t.y,r.y,n)}function hde(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const fde={duration:.45,ease:[.4,0,.1,1]},z9=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),W9=z9("applewebkit/")&&!z9("chrome/")?Math.round:ro;function q9(e){e.min=W9(e.min),e.max=W9(e.max)}function pde(e){q9(e.x),q9(e.y)}function bO(e,t,r){return e==="position"||e==="preserve-aspect"&&!gue(N9(t),N9(r),.2)}function mde(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const gde=_O({attachResizeListener:(e,t)=>yf(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),lv={current:void 0},xO=_O({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!lv.current){const e=new gde({});e.mount(window),e.setOptions({layoutScroll:!0}),lv.current=e}return lv.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),vde={pan:{Feature:jue},drag:{Feature:Oue,ProjectionNode:xO,MeasureLayout:fO}};function G9(e,t,r){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",r==="Start");const i="onHover"+r,o=n[i];o&&jr.postRender(()=>o(t,Xf(t)))}class yde extends ll{mount(){const{current:t}=this.node;t&&(this.unmount=Wle(t,(r,n)=>(G9(this.node,n,"Start"),i=>G9(this.node,i,"End"))))}unmount(){}}class _de extends ll{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Kf(yf(this.node.current,"focus",()=>this.onFocus()),yf(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function K9(e,t,r){const{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",r==="Start");const i="onTap"+(r==="End"?"":r),o=n[i];o&&jr.postRender(()=>o(t,Xf(t)))}class bde extends ll{mount(){const{current:t}=this.node;t&&(this.unmount=Yle(t,(r,n)=>(K9(this.node,n,"Start"),(i,{success:o})=>K9(this.node,i,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Gy=new WeakMap,cv=new WeakMap,xde=e=>{const t=Gy.get(e.target);t&&t(e)},wde=e=>{e.forEach(xde)};function Ede({root:e,...t}){const r=e||document;cv.has(r)||cv.set(r,{});const n=cv.get(r),i=JSON.stringify(t);return n[i]||(n[i]=new IntersectionObserver(wde,{root:e,...t})),n[i]}function Sde(e,t,r){const n=Ede(t);return Gy.set(e,r),n.observe(e),()=>{Gy.delete(e),n.unobserve(e)}}const Cde={some:0,all:1};class Tde extends ll{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:r,margin:n,amount:i="some",once:o}=t,s={root:r?r.current:void 0,rootMargin:n,threshold:typeof i=="number"?i:Cde[i]},a=l=>{const{isIntersecting:d}=l;if(this.isInView===d||(this.isInView=d,o&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:u,onViewportLeave:h}=this.node.getProps(),f=d?u:h;f&&f(l)};return Sde(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:r}=this.node;["amount","margin","root"].some(Ade(t,r))&&this.startObserver()}unmount(){}}function Ade({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}const kde={inView:{Feature:Tde},tap:{Feature:bde},focus:{Feature:_de},hover:{Feature:yde}},Rde={layout:{ProjectionNode:xO,MeasureLayout:fO}},Ky={current:null},wO={current:!1};function Ide(){if(wO.current=!0,!!p3)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Ky.current=e.matches;e.addListener(t),t()}else Ky.current=!1}const Pde=new WeakMap;function Ode(e,t,r){for(const n in t){const i=t[n],o=r[n];if(Vn(i))e.addValue(n,i);else if(Vn(o))e.addValue(n,zu(i,{owner:e}));else if(o!==i)if(e.hasValue(n)){const s=e.getValue(n);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(n);e.addValue(n,zu(s!==void 0?s:i,{owner:e}))}}for(const n in r)t[n]===void 0&&e.removeValue(n);return t}const Y9=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class jde{scrapeMotionValuesFromProps(t,r,n){return{}}constructor({parent:t,props:r,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:o,visualState:s},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=P3,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=Si.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,jr.render(this.render,!1,!0))};const{latestValues:l,renderState:d}=s;this.latestValues=l,this.baseTarget={...l},this.initialValues=r.initial?{...l}:{},this.renderState=d,this.parent=t,this.props=r,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=Tg(r),this.isVariantNode=HP(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...h}=this.scrapeMotionValuesFromProps(r,{},this);for(const f in h){const p=h[f];l[f]!==void 0&&Vn(p)&&p.set(l[f],!1)}}mount(t){this.current=t,Pde.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,n)=>this.bindToMotionValue(n,r)),wO.current||Ide(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Ky.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Ya(this.notifyUpdate),Ya(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const r=this.features[t];r&&(r.unmount(),r.isMounted=!1)}this.current=null}bindToMotionValue(t,r){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=md.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=r.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&jr.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),o=r.on("renderRequest",this.scheduleRender);let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{i(),o(),s&&s(),r.owner&&r.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Wu){const r=Wu[t];if(!r)continue;const{isEnabled:n,Feature:i}=r;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Br()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,r){this.latestValues[t]=r}update(t,r){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;n<Y9.length;n++){const i=Y9[n];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,s=t[o];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=Ode(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(t),()=>r.variantChildren.delete(t)}addValue(t,r){const n=this.values.get(t);r!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,r),this.values.set(t,r),this.latestValues[t]=r.get())}removeValue(t){this.values.delete(t);const r=this.valueSubscriptions.get(t);r&&(r(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,r){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return n===void 0&&r!==void 0&&(n=zu(r===null?void 0:r,{owner:this}),this.addValue(t,n)),n}readValue(t,r){let n=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return n!=null&&(typeof n=="string"&&(XI(n)||QI(n))?n=parseFloat(n):!Jle(n)&&Za.test(r)&&(n=LP(t,r)),this.setBaseTarget(t,Vn(n)?n.get():n)),Vn(n)?n.get():n}setBaseTarget(t,r){this.baseTarget[t]=r}getBaseTarget(t){var o;const{initial:r}=this.props;let n;if(typeof r=="string"||typeof r=="object"){const s=z3(this.props,r,(o=this.presenceContext)==null?void 0:o.custom);s&&(n=s[t])}if(r&&n!==void 0)return n;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Vn(i)?i:this.initialValues[t]!==void 0&&n===void 0?void 0:this.baseTarget[t]}on(t,r){return this.events[t]||(this.events[t]=new _3),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}}class EO extends jde{constructor(){super(...arguments),this.KeyframeResolver=Ule}sortInstanceNodePosition(t,r){return t.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(t,r){return t.style?t.style[r]:void 0}removeValueFromRenderState(t,{vars:r,style:n}){delete r[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Vn(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}function SO(e,{style:t,vars:r},n,i){Object.assign(e.style,t,i&&i.getProjectionStyles(n));for(const o in r)e.style.setProperty(o,r[o])}function Lde(e){return window.getComputedStyle(e)}class $de extends EO{constructor(){super(...arguments),this.type="html",this.renderInstance=SO}readValueFromInstance(t,r){var n;if(md.has(r))return(n=this.projection)!=null&&n.isProjecting?$y(r):ole(t,r);{const i=Lde(t),o=(w3(r)?i.getPropertyValue(r):i[r])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:r}){return cO(t,r)}build(t,r,n){B3(t,r,n.transformTemplate)}scrapeMotionValuesFromProps(t,r,n){return W3(t,r,n)}}const CO=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Dde(e,t,r,n){SO(e,t,void 0,n);for(const i in t.attrs)e.setAttribute(CO.has(i)?i:U3(i),t.attrs[i])}class Mde extends EO{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Br}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(md.has(r)){const n=jP(r);return n&&n.default||0}return r=CO.has(r)?r:U3(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,n){return QP(t,r,n)}
151build(t,r,n){YP(t,r,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,r,n,i){Dde(t,r,n,i)}mount(t){this.isSVGTag=XP(t.tagName),super.mount(t)}}const Nde=(e,t)=>H3(e)?new Mde(t):new $de(t,{allowProjection:e!==v.Fragment}),Fde=Dce({...lue,...kde,...vde,...Rde},Nde),rt=ace(Fde);function ki({children:e}){const t=Ee.Children.toArray(e),r=t[0],n=t[1],i=t[2];return c.jsxs(rt.div,{initial:{opacity:0,x:50},animate:{opacity:1,x:0},exit:{opacity:0,x:-50},transition:{type:"spring",stiffness:300,damping:30},style:{flex:1,display:"flex",flexDirection:"column",height:"100%",width:"100%"},children:[c.jsx(F,{sx:{mb:3,flexShrink:0},children:r}),c.jsx(F,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",pb:2,pr:1,pt:1,mr:-1,"&::-webkit-scrollbar":{width:"4px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:o=>o.palette.divider,borderRadius:"4px"},scrollbarWidth:"thin",scrollbarColor:o=>`${o.palette.divider} transparent`},children:n}),i&&c.jsxs(c.Fragment,{children:[c.jsx(Om,{sx:{mx:-2,flexShrink:0}}),c.jsx(F,{sx:{mt:2,backgroundColor:"background.default",flexShrink:0},children:i})]})]})}function TO(e){const t=[...e];for(let r=t.length-1;r>0;r--){const n=Math.floor(Math.random()*(r+1));[t[r],t[n]]=[t[n],t[r]]}return t}function AO(e,t){const r=new Set(t),n=e.filter(o=>!r.has(o)),i=e.filter(o=>r.has(o));return[...TO(n),...i]}const Ude=["Vendo no presencial","Vendo com site próprio","Vendo nas redes sociais","Vendo em marketplaces","Vendo em feiras","Vendo por WhatsApp","Vendo por catálogo","Tenho representantes de vendas ou vendedores na rua","Ainda não faço vendas","Outros"],Bde=["Outros"];function Vde({onNext:e,selected:t=[],currentStep:r,totalSteps:n,isOptional:i=!1}){const o=v.useMemo(()=>AO(Ude,Bde),[]),[s,a]=v.useState(t);v.useEffect(()=>{t&&t.length>0&&a(t)},[t]);const l=h=>{a(f=>f.includes(h)?f.filter(p=>p!==h):[...f,h])},d=()=>{e(s)},u=()=>i&&s.length===0?"Pular":"Continuar";return c.jsxs(ki,{currentStep:r,totalSteps:n,children:[c.jsxs(F,{children:[c.jsx(V,{variant:"h5",fontWeight:600,gutterBottom:!0,children:"Como você vende hoje?"}),c.jsx(V,{variant:"body1",color:"text.secondary",children:"Selecione todas as opções que se aplicam"})]}),c.jsx(me,{spacing:2,children:o.map(h=>{const f=s.includes(h);return c.jsx(rt.div,{whileTap:{scale:.98},onClick:()=>l(h),children:c.jsxs(F,{sx:{display:"flex",alignItems:"center",p:3,borderRadius:2,border:"2px solid",borderColor:f?"primary.main":"divider",backgroundColor:f?"primary.50":"background.paper",cursor:"pointer",transition:"all 0.2s"},children:[c.jsx(F,{sx:{mr:2,display:"flex"},children:f?c.jsx(ps,{color:"primary"}):c.jsx(YD,{sx:{color:"text.secondary"}})}),c.jsx(V,{variant:"body1",sx:{color:f?"primary.main":"text.primary",fontWeight:f?600:500},children:h})]})},h)})}),c.jsx(De,{fullWidth:!0,variant:"contained",size:"large",onClick:d,sx:{borderRadius:2,py:1.5,mt:0},children:u()})]})}const Hde=["Roupas, Calçados e Acessórios","Beleza, Cosméticos e Higiene Pessoal","Alimentação","Artesanato","Joias, Relógios e Acessórios","Moda Ãntima e Sexshop","Informática e Eletrônicos","Variedades, Presentes, Decorações e Utilidades","Bebidas","Produtos Digitais","Autopeças e Automotivo","Bazar, Livros, Papelaria e Gráfica","Mercadinho, Mercearia, Hortifruti e Padaria","Materiais de Construção","Produtos de Limpeza e Higiene","Móveis e Eletrodomésticos","Suplementos, Produtos Naturais e Vitaminas","Petshop","Cama, Mesa e Banho","Arte e Design","Artigos Esportivos","Tabacaria, Conveniência e Bomboniere","Sorvetes e AçaÃ","Flores e Plantas","Brindes","Brinquedos e Infantil","Outros"],zde=Hde;function Wde({onNext:e,selected:t=""}){const[r,n]=v.useState(t||null),[i,o]=v.useState(!!t),[s,a]=v.useState(!1);v.useEffect(()=>{t&&(n(t),o(!0))},[t]);const l=u=>{r!==u&&(n(u),o(!0),s||(a(!0),setTimeout(()=>e(u),800)))},d=()=>{!s&&r&&e(r)};return c.jsxs(ki,{children:[c.jsxs(F,{children:[c.jsx(V,{variant:"h5",fontWeight:600,gutterBottom:!0,children:"Qual seu segmento?"}),c.jsx(V,{variant:"body1",color:"text.secondary",children:"Escolha a opção que melhor descreve seu negócio"})]}),c.jsx(me,{spacing:2,children:zde.map(u=>{const f=r===u&&i;return c.jsx(rt.div,{whileTap:{scale:.98},onClick:()=>l(u),children:c.jsxs(F,{sx:{display:"flex",alignItems:"center",p:3,borderRadius:2,border:"2px s
151olid",borderColor:f?"primary.main":"divider",backgroundColor:f?"primary.50":"background.paper",cursor:s?"default":"pointer",transition:"all 0.2s",position:"relative",overflow:"hidden"},children:[c.jsx(Ws,{children:f&&c.jsxs(c.Fragment,{children:[c.jsx(rt.div,{initial:{scale:0},animate:{scale:30},exit:{scale:0},transition:{duration:.5},style:{position:"absolute",right:-10,top:-10,width:20,height:20,borderRadius:"50%",backgroundColor:"var(--mui-palette-primary-main)",opacity:.15}}),c.jsx(rt.div,{initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{delay:.2},style:{position:"absolute",right:16,display:"flex",alignItems:"center"},children:c.jsx(ps,{color:"primary"})})]})}),c.jsx(V,{variant:"body1",sx:{color:f?"primary.main":"text.primary",fontWeight:f?600:500,zIndex:1},children:u})]})},u)})}),c.jsx(De,{fullWidth:!0,variant:"contained",size:"large",onClick:d,disabled:s||!r,sx:{borderRadius:2,py:1.5,mt:0},children:"Continuar"})]})}const qde=["Autônomo (CPF)","MEI","Abrindo uma empresa","Micro ou pequena empresa"];function Gde({onNext:e,selected:t="",isOptional:r=!1}){const n=v.useMemo(()=>TO(qde),[]),[i,o]=v.useState(t||null),[s,a]=v.useState(!!t),[l,d]=v.useState(!1);v.useEffect(()=>{t&&(o(t),a(!0))},[t]);const u=p=>{i!==p&&(o(p),a(!0),l||(d(!0),setTimeout(()=>e(p),800)))},h=()=>r&&!i?"Pular":"Continuar",f=()=>{l||e(i||"")};return c.jsxs(ki,{children:[c.jsxs(F,{children:[c.jsx(V,{variant:"h5",fontWeight:600,gutterBottom:!0,children:"Qual seu perfil de negócio?"}),c.jsx(V,{variant:"body1",color:"text.secondary",children:"Essa informação nos ajuda a personalizar sua experiência"})]}),c.jsx(me,{spacing:2,children:n.map(p=>{const g=i===p&&s;return c.jsx(rt.div,{whileTap:{scale:.98},onClick:()=>u(p),children:c.jsxs(F,{sx:{display:"flex",alignItems:"center",p:3,borderRadius:2,border:"2px solid",borderColor:g?"primary.main":"divider",backgroundColor:g?"primary.50":"background.paper",cursor:l?"default":"pointer",transition:"all 0.2s",position:"relative",overflow:"hidden"},children:[c.jsx(Ws,{children:g&&c.jsxs(c.Fragment,{children:[c.jsx(rt.div,{initial:{scale:0},animate:{scale:30},exit:{scale:0},transition:{duration:.5},style:{position:"absolute",right:-10,top:-10,width:20,height:20,borderRadius:"50%",backgroundColor:"var(--mui-palette-primary-main)",opacity:.15}}),c.jsx(rt.div,{initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{delay:.2},style:{position:"absolute",right:16,display:"flex",alignItems:"center"},children:c.jsx(ps,{color:"primary"})})]})}),c.jsx(V,{variant:"body1",sx:{color:g?"primary.main":"text.primary",fontWeight:g?600:500,zIndex:1},children:p})]})},p)})}),c.jsx(De,{fullWidth:!0,variant:"contained",size:"large",onClick:f,disabled:l,sx:{borderRadius:2,py:1.5,mt:0},children:h()})]})}const Kde=["Organizar as vendas, o estoque e os clientes da minha loja","Registrar as vendas que faço no balcão ou na rua","Criar um catálogo pra receber pedidos pelo WhatsApp","Criar minha loja online e vender pela internet","Ainda estou montando meu negócio"],Yde=["Ainda estou montando meu negócio"];function Zde({onNext:e,selected:t="",isOptional:r=!1}){const n=v.useMemo(()=>AO(Kde,Yde),[]),[i,o]=v.useState(t||null),[s,a]=v.useState(!!t),[l,d]=v.useState(!1);v.useEffect(()=>{t&&(o(t),a(!0))},[t]);const u=p=>{i!==p&&(o(p),a(!0),l||(d(!0),setTimeout(()=>e(p),800)))},h=()=>r&&!i?"Pular":"Continuar",f=()=>{l||e(i||"")};return c.jsxs(ki,{children:[c.jsxs(F,{children:[c.jsx(V,{variant:"h5",fontWeight:600,gutterBottom:!0,children:"O que você quer fazer primeiro no Stoqui?"}),c.jsx(V,{variant:"body1",color:"text.secondary",children:"Escolha a opção que mais combina com você agora"})]}),c.jsx(me,{spacing:2,children:n.map(p=>{const g=i===p&&s;return c.jsx(rt.div,{whileTap:{scale:.98},onClick:()=>u(p),children:c.jsxs(F,{sx:{display:"flex",alignItems:"center",p:3,borderRadius:2,border:"2px solid",borderColor:g?"primary.main":"divider",backgroundColor:g?"primary.50":"background.paper",cursor:l?"default":"pointer",transition:"all 0.2s",position:"relative",overflow:"hidden"},children:[c.jsx(Ws,{children:g&&c.jsxs(c.Fragment,{children:[c.jsx(rt.div,{initial:{scale:0},animate:{scale:30},exit:{scale:0},transition:{duration:.5},style:{position:"absolute",right:-10,top:-10,width:20,height:20,borderRadius:"50%",backgroundColor:"var(--mui-palette-primary-main)",opacity:.15}}),c.jsx(rt.div,{initial:{scale:0,opacity:0}
151,animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{delay:.2},style:{position:"absolute",right:16,display:"flex",alignItems:"center"},children:c.jsx(ps,{color:"primary"})})]})}),c.jsx(V,{variant:"body1",sx:{color:g?"primary.main":"text.primary",fontWeight:g?600:500,zIndex:1},children:p})]})},p)})}),c.jsx(De,{fullWidth:!0,variant:"contained",size:"large",onClick:f,disabled:l,sx:{borderRadius:2,py:1.5,mt:0},children:h()})]})}var Jf=e=>e.type==="checkbox",cu=e=>e instanceof Date,Xn=e=>e==null;const kO=e=>typeof e=="object";var fn=e=>!Xn(e)&&!Array.isArray(e)&&kO(e)&&!cu(e),RO=e=>fn(e)&&e.target?Jf(e.target)?e.target.checked:e.target.value:e,Xde=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,IO=(e,t)=>e.has(Xde(t)),Jde=e=>{const t=e.constructor&&e.constructor.prototype;return fn(t)&&t.hasOwnProperty("isPrototypeOf")},G3=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function dn(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(G3&&(e instanceof Blob||e instanceof FileList))&&(r||fn(e)))if(t=r?[]:{},!r&&!Jde(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=dn(e[n]));else return e;return t}var gd=e=>Array.isArray(e)?e.filter(Boolean):[],wr=e=>e===void 0,We=(e,t,r)=>{if(!t||!fn(e))return r;const n=gd(t.split(/[,[\].]+?/)).reduce((i,o)=>Xn(i)?i:i[o],e);return wr(n)||n===e?wr(e[t])?r:e[t]:n},So=e=>typeof e=="boolean";const Q1={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Qi={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Es={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Qde=Ee.createContext(null),Ag=()=>Ee.useContext(Qde);var PO=(e,t,r,n=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const s=o;return t._proxyFormState[s]!==Qi.all&&(t._proxyFormState[s]=!n||Qi.all),r&&(r[s]=!0),e[s]}});return i},_i=e=>fn(e)&&!Object.keys(e).length,OO=(e,t,r,n)=>{r(e);const{name:i,...o}=e;return _i(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(s=>t[s]===(!n||Qi.all))},Mi=e=>Array.isArray(e)?e:[e],jO=(e,t,r)=>!e||!t||e===t||Mi(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n)));function kg(e){const t=Ee.useRef(e);t.current=e,Ee.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function ehe(e){const t=Ag(),{control:r=t.control,disabled:n,name:i,exact:o}=e||{},[s,a]=Ee.useState(r._formState),l=Ee.useRef(!0),d=Ee.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=Ee.useRef(i);return u.current=i,kg({disabled:n,next:h=>l.current&&jO(u.current,h.name,o)&&OO(h,d.current,r._updateFormState)&&a({...r._formState,...h}),subject:r._subjects.state}),Ee.useEffect(()=>(l.current=!0,d.current.isValid&&r._updateValid(!0),()=>{l.current=!1}),[r]),PO(s,r,d.current,!1)}var os=e=>typeof e=="string",LO=(e,t,r,n,i)=>os(e)?(n&&t.watch.add(e),We(r,e,i)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),We(r,o))):(n&&(t.watchAll=!0),r);function the(e){const t=Ag(),{control:r=t.control,name:n,defaultValue:i,disabled:o,exact:s}=e||{},a=Ee.useRef(n);a.current=n,kg({disabled:o,subject:r._subjects.values,next:u=>{jO(a.current,u.name,s)&&d(dn(LO(a.current,r._names,u.values||r._formValues,!1,i)))}});const[l,d]=Ee.useState(r._getWatch(n,i));return Ee.useEffect(()=>r._removeUnmounted()),l}var K3=e=>/^\w*$/.test(e),$O=e=>gd(e.replace(/["|']|\]/g,"").split(/\.|\[/)),or=(e,t,r)=>{let n=-1;const i=K3(t)?[t]:$O(t),o=i.length,s=o-1;for(;++n<o;){const a=i[n];let l=r;if(n!==s){const d=e[a];
151l=fn(d)||Array.isArray(d)?d:isNaN(+i[n+1])?{}:[]}e[a]=l,e=e[a]}return e};function rhe(e){const t=Ag(),{name:r,disabled:n,control:i=t.control,shouldUnregister:o}=e,s=IO(i._names.array,r),a=the({control:i,name:r,defaultValue:We(i._formValues,r,We(i._defaultValues,r,e.defaultValue)),exact:!0}),l=ehe({control:i,name:r}),d=Ee.useRef(i.register(r,{...e.rules,value:a,...So(e.disabled)?{disabled:e.disabled}:{}}));return Ee.useEffect(()=>{const u=i._options.shouldUnregister||o,h=(f,p)=>{const m=We(i._fields,f);m&&(m._f.mount=p)};if(h(r,!0),u){const f=dn(We(i._options.defaultValues,r));or(i._defaultValues,r,f),wr(We(i._formValues,r))&&or(i._formValues,r,f)}return()=>{(s?u&&!i._state.action:u)?i.unregister(r):h(r,!1)}},[r,i,s,o]),Ee.useEffect(()=>{We(i._fields,r)&&i._updateDisabledField({disabled:n,fields:i._fields,name:r,value:We(i._fields,r)._f.value})},[n,r,i]),{field:{name:r,value:a,...So(n)||l.disabled?{disabled:l.disabled||n}:{},onChange:Ee.useCallback(u=>d.current.onChange({target:{value:RO(u),name:r},type:Q1.CHANGE}),[r]),onBlur:Ee.useCallback(()=>d.current.onBlur({target:{value:We(i._formValues,r),name:r},type:Q1.BLUR}),[r,i]),ref:u=>{const h=We(i._fields,r);h&&u&&(h._f.ref={focus:()=>u.focus(),select:()=>u.select(),setCustomValidity:f=>u.setCustomValidity(f),reportValidity:()=>u.reportValidity()})}},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!We(l.errors,r)},isDirty:{enumerable:!0,get:()=>!!We(l.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!We(l.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!We(l.validatingFields,r)},error:{enumerable:!0,get:()=>We(l.errors,r)}})}}const ss=e=>e.render(rhe(e));var DO=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{},ya=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=(Math.random()*16+e)%16|0;return(t=="x"?r:r&3|8).toString(16)})},uv=(e,t,r={})=>r.shouldFocus||wr(r.shouldFocus)?r.focusName||`${e}.${wr(r.focusIndex)?t:r.focusIndex}.`:"",Sh=e=>({isOnSubmit:!e||e===Qi.onSubmit,isOnBlur:e===Qi.onBlur,isOnChange:e===Qi.onChange,isOnAll:e===Qi.all,isOnTouch:e===Qi.onTouched}),Yy=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const yu=(e,t,r,n)=>{for(const i of r||Object.keys(e)){const o=We(e,i);if(o){const{_f:s,...a}=o;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],i)&&!n)break;if(s.ref&&t(s.ref,s.name)&&!n)break;yu(a,t)}else fn(a)&&yu(a,t)}}};var MO=(e,t,r)=>{const n=gd(We(e,r));return or(n,"root",t[r]),or(e,r,n),e},Y3=e=>e.type==="file",Ma=e=>typeof e=="function",em=e=>{if(!G3)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},F0=e=>os(e),Z3=e=>e.type==="radio",tm=e=>e instanceof RegExp;const Z9={value:!1,isValid:!1},X9={value:!0,isValid:!0};var NO=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!wr(e[0].attributes.value)?wr(e[0].value)||e[0].value===""?X9:{value:e[0].value,isValid:!0}:X9:Z9}return Z9};const J9={isValid:!1,value:null};var FO=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,J9):J9;function Q9(e,t,r="validate"){if(F0(e)||Array.isArray(e)&&e.every(F0)||So(e)&&!e)return{type:r,message:F0(e)?e:"",ref:t}}var Bc=e=>fn(e)&&!tm(e)?e:{value:e,message:""},Zy=async(e,t,r,n,i)=>{const{ref:o,refs:s,required:a,maxLength:l,minLength:d,min:u,max:h,pattern:f,validate:p,name:m,valueAsNumber:g,mount:y,disabled:b}=e._f,E=We(t,m);if(!y||b)return{};const S=s?s[0]:o,k=O=>{n&&S.reportValidity&&(S.setCustomValidity(So(O)?"":O||""),S.reportValidity())},A={},w=Z3(o),_=Jf(o),x=w||_,C=(g||Y3(o))&&wr(o.value)&&wr(E)||em(o)&&o.value===""||E===""||Array.isArray(E)&&!E.length,P=DO.bind(null,m,r,A),I=(O,D,M,U=Es.maxLength,$=Es.minLength)=>{const j=O?D:M;A[m]={type:O?U:$,message:j,ref:o,...P(O?U:$,j)}};if(i?!Array.isArray(E)||!E.length:a&&(!x&&(C||Xn(E))||So(E)&&!E||_&&!NO(s).isValid||w&&!FO(s).isValid)){const{value:O,message:D}=F0(a)?{value:!!a,message:a}:Bc(a);if(O&&(A[m]={type:Es.required,message:D,ref:S,...P(Es.required,D)},!r))return k(D),A}if(!C&&(!Xn(u)||!Xn(h))){let O,D;const M=Bc(h),U=Bc(u);if(!Xn(E)&&!isNaN(E)){const $=o.valueAsNumber||E&&+E;Xn(M.value)||(O=$>M.value),Xn(U.value)||(D=$<U.value)}else{const $=o.valueAsDate||new Date(E),j=ne=>new Date(new Date().toDateString()+" "+ne),q=o.type=="time",W=o.type=="week";os(M.value)&&E&&(O=q?j(E)>j(M.value):W?E>M.value:$>new Date(M.value)),os(U.value)&&E&&(D=q?j(E)<j(U.value):W?E<U.value:$<new Date(U.value))}if((O||D)&&(I(!!O,M.message,U.message,Es.max,Es.min),!r))return k(A[m].message),A}if((l||d)&&!C&&(os(E)||i&&Array.isArray(E))){const O=Bc(l),D=Bc(d),M=!Xn(O.value)&&E.length>+O.value,U=!Xn(D.value)&&E.length<+D.value;if((M||U)&&(I(M,O.message,D.message),!r))return k(A[m].message),A}if(f&&!C&&os(E)){const{value:O,message:D}=Bc(f);if(tm(O)&&!E.match(O)&&(A[m]={type:Es.pattern,message:D,ref:o,...P(Es.pattern,D)},!r))return k(D),A}
151if(p){if(Ma(p)){const O=await p(E,t),D=Q9(O,S);if(D&&(A[m]={...D,...P(Es.validate,D.message)},!r))return k(D.message),A}else if(fn(p)){let O={};for(const D in p){if(!_i(O)&&!r)break;const M=Q9(await p[D](E,t),S,D);M&&(O={...M,...P(D,M.message)},k(M.message),r&&(A[m]=O))}if(!_i(O)&&(A[m]={ref:S,...O},!r))return A}}return k(!0),A},dv=(e,t)=>[...e,...Mi(t)],hv=e=>Array.isArray(e)?e.map(()=>{}):void 0;function fv(e,t,r){return[...e.slice(0,t),...Mi(r),...e.slice(t)]}var pv=(e,t,r)=>Array.isArray(e)?(wr(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(t,1)[0]),e):[],mv=(e,t)=>[...Mi(t),...Mi(e)];function nhe(e,t){let r=0;const n=[...e];for(const i of t)n.splice(i-r,1),r++;return gd(n).length?n:[]}var gv=(e,t)=>wr(t)?[]:nhe(e,Mi(t).sort((r,n)=>r-n)),vv=(e,t,r)=>{[e[t],e[r]]=[e[r],e[t]]};function ihe(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=wr(e)?n++:e[t[n++]];return e}function ohe(e){for(const t in e)if(e.hasOwnProperty(t)&&!wr(e[t]))return!1;return!0}function Xr(e,t){const r=Array.isArray(t)?t:K3(t)?[t]:$O(t),n=r.length===1?e:ihe(e,r),i=r.length-1,o=r[i];return n&&delete n[o],i!==0&&(fn(n)&&_i(n)||Array.isArray(n)&&ohe(n))&&Xr(e,r.slice(0,-1)),e}var e7=(e,t,r)=>(e[t]=r,e);function mCe(e){const t=Ag(),{control:r=t.control,name:n,keyName:i="id",shouldUnregister:o}=e,[s,a]=Ee.useState(r._getFieldArray(n)),l=Ee.useRef(r._getFieldArray(n).map(ya)),d=Ee.useRef(s),u=Ee.useRef(n),h=Ee.useRef(!1);u.current=n,d.current=s,r._names.array.add(n),e.rules&&r.register(n,e.rules),kg({next:({values:A,name:w})=>{if(w===u.current||!w){const _=We(A,u.current);Array.isArray(_)&&(a(_),l.current=_.map(ya))}},subject:r._subjects.array});const f=Ee.useCallback(A=>{h.current=!0,r._updateFieldArray(n,A)},[r,n]),p=(A,w)=>{const _=Mi(dn(A)),x=dv(r._getFieldArray(n),_);r._names.focus=uv(n,x.length-1,w),l.current=dv(l.current,_.map(ya)),f(x),a(x),r._updateFieldArray(n,x,dv,{argA:hv(A)})},m=(A,w)=>{const _=Mi(dn(A)),x=mv(r._getFieldArray(n),_);r._names.focus=uv(n,0,w),l.current=mv(l.current,_.map(ya)),f(x),a(x),r._updateFieldArray(n,x,mv,{argA:hv(A)})},g=A=>{const w=gv(r._getFieldArray(n),A);l.current=gv(l.current,A),f(w),a(w),r._updateFieldArray(n,w,gv,{argA:A})},y=(A,w,_)=>{const x=Mi(dn(w)),C=fv(r._getFieldArray(n),A,x);r._names.focus=uv(n,A,_),l.current=fv(l.current,A,x.map(ya)),f(C),a(C),r._updateFieldArray(n,C,fv,{argA:A,argB:hv(w)})},b=(A,w)=>{const _=r._getFieldArray(n);vv(_,A,w),vv(l.current,A,w),f(_),a(_),r._updateFieldArray(n,_,vv,{argA:A,argB:w},!1)},E=(A,w)=>{const _=r._getFieldArray(n);pv(_,A,w),pv(l.current,A,w),f(_),a(_),r._updateFieldArray(n,_,pv,{argA:A,argB:w},!1)},S=(A,w)=>{const _=dn(w),x=e7(r._getFieldArray(n),A,_);l.current=[...x].map((C,P)=>!C||P===A?ya():l.current[P]),f(x),a([...x]),r._updateFieldArray(n,x,e7,{argA:A,argB:_},!0,!1)},k=A=>{const w=Mi(dn(A));l.current=w.map(ya),f([...w]),a([...w]),r._updateFieldArray(n,[...w],_=>_,{},!0,!1)};return Ee.useEffect(()=>{if(r._state.action=!1,Yy(n,r._names)&&r._subjects.state.next({...r._formState}),h.current&&(!Sh(r._options.mode).isOnSubmit||r._formState.isSubmitted))if(r._options.resolver)r._executeSchema([n]).then(A=>{const w=We(A.errors,n),_=We(r._formState.errors,n);(_?!w&&_.type||w&&(_.type!==w.type||_.message!==w.message):w&&w.type)&&(w?or(r._formState.errors,n,w):Xr(r._formState.errors,n),r._subjects.state.next({errors:r._formState.errors}))});else{const A=We(r._fields,n);A&&A._f&&!(Sh(r._options.reValidateMode).isOnSubmit&&Sh(r._options.mode).isOnSubmit)&&Zy(A,r._formValues,r._options.criteriaMode===Qi.all,r._options.shouldUseNativeValidation,!0).then(w=>!_i(w)&&r._subjects.state.next({errors:MO(r._formState.errors,w,n)}))}r._subjects.values.next({name:n,values:{...r._formValues}}),r._names.focus&&yu(r._fields,(A,w)=>{if(r._names.focus&&w.startsWith(r._names.focus)&&A.focus)return A.focus(),1}),r._names.focus="",r._updateValid(),h.current=!1},[s,n,r]),Ee.useEffect(()=>(!We(r._formValues,n)&&r._updateFieldArray(n),()=>{(r._options.shouldUnregister||o)&&r.unregister(n)}),[n,r,i,o]),{swap:Ee.useCallback(b,[f,n,r]),move:Ee.useCallback(E,[f,n,r]),prepend:Ee.useCallback(m,[f,n,r]),append:Ee.useCallback(p,[f,n,r]),remove:Ee.useCallback(g,[f,n,r]),insert:Ee.useCallback(y,[f,n,r]),update:Ee.useCallback(S,[f,n,r]),replace:Ee.useCallback(k,[f,n,r]),fields:Ee.useMemo(()=>s.map((A,w)=>({...A,[i]:l.current[w]||ya()})),[s,i])}}var yv=()=>{let e=[];return{get observers(){return e},next:i=>{for(const o of e)o.next&&o.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(o=>o!==i)}}),unsubscribe:()=>{e=[]}}},rm=e=>Xn(e)||!kO(e);function Ul(e,t){if(rm(e)||rm(t))return e===t;if(cu(e)&&cu(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const i of r){const o=e[i];if(!n.includes(i))return!1;if(i!=="ref"){const s=t[i];if(cu(o)&&cu(s)||fn(o)&&fn(s)||Array.isArray(o)&&Array.isArray(s)?!Ul(o,s):o!==s)return!1}}return!0}var UO=e=>e.type==="select-multiple",she=e=>Z3(e)||Jf(e),_v=e=>em(e)&&e.isConnected,BO=e=>{for(const t in e)if(Ma(e[t]))return!0;return!1};function nm(e,t={}){const r=Array.isArray(e);if(fn(e)||r)for(const n in e)Array.isArray(e[n])||fn(e[n])&&!BO(e[n])?(t[n]=Array.isArray(e[n])?[]:{}
vendor: 14,164 bytes, line 151
151,nm(e[n],t[n])):Xn(e[n])||(t[n]=!0);return t}function VO(e,t,r){const n=Array.isArray(e);if(fn(e)||n)for(const i in e)Array.isArray(e[i])||fn(e[i])&&!BO(e[i])?wr(t)||rm(r[i])?r[i]=Array.isArray(e[i])?nm(e[i],[]):{...nm(e[i])}:VO(e[i],Xn(t)?{}:t[i],r[i]):r[i]=!Ul(e[i],t[i]);return r}var Zp=(e,t)=>VO(e,t,nm(t)),HO=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>wr(e)?e:t?e===""?NaN:e&&+e:r&&os(e)?new Date(e):n?n(e):e;function bv(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return Y3(t)?t.files:Z3(t)?FO(e.refs).value:UO(t)?[...t.selectedOptions].map(({value:r})=>r):Jf(t)?NO(e.refs).value:HO(wr(t.value)?e.ref.value:t.value,e)}var ahe=(e,t,r,n)=>{const i={};for(const o of e){const s=We(t,o);s&&or(i,o,s._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}},Ud=e=>wr(e)?e:tm(e)?e.source:fn(e)?tm(e.value)?e.value.source:e.value:e,lhe=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function t7(e,t,r){const n=We(e,r);if(n||K3(r))return{error:n,name:r};const i=r.split(".");for(;i.length;){const o=i.join("."),s=We(t,o),a=We(e,o);if(s&&!Array.isArray(s)&&r!==o)return{name:r};if(a&&a.type)return{name:o,error:a};i.pop()}return{name:r}}var che=(e,t,r,n,i)=>i.isOnAll?!1:!r&&i.isOnTouch?!(t||e):(r?n.isOnBlur:i.isOnBlur)?!e:(r?n.isOnChange:i.isOnChange)?e:!0,uhe=(e,t)=>!gd(We(e,t)).length&&Xr(e,t);const dhe={mode:Qi.onSubmit,reValidateMode:Qi.onChange,shouldFocusError:!0};function hhe(e={}){let t={...dhe,...e},r={submitCount:0,isDirty:!1,isLoading:Ma(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},i=fn(t.defaultValues)||fn(t.values)?dn(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:dn(i),s={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},l,d=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},h={values:yv(),array:yv(),state:yv()},f=Sh(t.mode),p=Sh(t.reValidateMode),m=t.criteriaMode===Qi.all,g=z=>Q=>{clearTimeout(d),d=setTimeout(z,Q)},y=async z=>{if(u.isValid||z){const Q=t.resolver?_i((await x()).errors):await P(n,!0);Q!==r.isValid&&h.state.next({isValid:Q})}},b=(z,Q)=>{(u.isValidating||u.validatingFields)&&((z||Array.from(a.mount)).forEach(ie=>{ie&&(Q?or(r.validatingFields,ie,Q):Xr(r.validatingFields,ie))}),h.state.next({validatingFields:r.validatingFields,isValidating:!_i(r.validatingFields)}))},E=(z,Q=[],ie,te,he=!0,ve=!0)=>{if(te&&ie){if(s.action=!0,ve&&Array.isArray(We(n,z))){const Re=ie(We(n,z),te.argA,te.argB);he&&or(n,z,Re)}if(ve&&Array.isArray(We(r.errors,z))){const Re=ie(We(r.errors,z),te.argA,te.argB);he&&or(r.errors,z,Re),uhe(r.errors,z)}if(u.touchedFields&&ve&&Array.isArray(We(r.touchedFields,z))){const Re=ie(We(r.touchedFields,z),te.argA,te.argB);he&&or(r.touchedFields,z,Re)}u.dirtyFields&&(r.dirtyFields=Zp(i,o)),h.state.next({name:z,isDirty:O(z,Q),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else or(o,z,Q)},S=(z,Q)=>{or(r.errors,z,Q),h.state.next({errors:r.errors})},k=z=>{r.errors=z,h.state.next({errors:r.errors,isValid:!1})},A=(z,Q,ie,te)=>{const he=We(n,z);if(he){const ve=We(o,z,wr(ie)?We(i,z):ie);wr(ve)||te&&te.defaultChecked||Q?or(o,z,Q?ve:bv(he._f)):U(z,ve),s.mount&&y()}},w=(z,Q,ie,te,he)=>{let ve=!1,Re=!1;const He={name:z},dt=!!(We(n,z)&&We(n,z)._f.disabled);if(!ie||te){u.isDirty&&(Re=r.isDirty,r.isDirty=He.isDirty=O(),ve=Re!==He.isDirty);const N=dt||Ul(We(i,z),Q);Re=!!(!dt&&We(r.dirtyFields,z)),N||dt?Xr(r.dirtyFields,z):or(r.dirtyFields,z,!0),He.dirtyFields=r.dirtyFields,ve=ve||u.dirtyFields&&Re!==!N}if(ie){const N=We(r.touchedFields,z);N||(or(r.touchedFields,z,ie),He.touchedFields=r.touchedFields,ve=ve||u.touchedFields&&N!==ie)}return ve&&he&&h.state.next(He),ve?He:{}},_=(z,Q,ie,te)=>{const he=We(r.errors,z),ve=u.isValid&&So(Q)&&r.isValid!==Q;if(e.delayError&&ie?(l=g(()=>S(z,ie)),l(e.delayError)):(clearTimeout(d),l=null,ie?or(r.errors,z,ie):Xr(r.errors,z)),(ie?!Ul(he,ie):he)||!_i(te)||ve){const Re={...te,...ve&&So(Q)?{isValid:Q}:{},errors:r.errors,name:z};r={...r,...Re},h.state.next(Re)}},x=async z=>{b(z,!0);const Q=await t.resolver(o,t.context,ahe(z||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return b(z),Q},C=async z=>{const{errors:Q}=await x(z);if(z)for(const ie of z){const te=We(Q,ie);te?or(r.errors,ie,te):Xr(r.errors,ie)}else r.errors=Q;return Q},P=async(z,Q,ie={valid:!0})=>{for(const te in z){const he=z[te];if(he){const{_f:ve,...Re}=he;if(ve){const He=a.array.has(ve.name);b([te],!0);const dt=await Zy(he,o,m,t.shouldUseNativeValidation&&!Q,He);if(b([te]),dt[ve.name]&&(ie.valid=!1,Q))break;!Q&&(We(dt,ve.name)?He?MO(r.errors,dt,ve.name):or(r.errors,ve.name,dt[ve.name]):Xr(r.errors,ve.name))}Re&&await P(Re,Q,ie)}}return ie.valid},I=()=>{for(const z of a.unMount){const Q=We(n,z);Q&&(Q._f.refs?Q._f.refs.every(ie=>!_v(ie)):!_v(Q._f.ref))&&xe(z)}a.unMount=new Set},O=(z,Q)=>(z&&Q&&or(o,z,Q),!Ul(ae(),i)),D=(z,Q,ie)=>LO(z,a,{...s.mount?o:wr(Q)?i:os(z)?{[z]:Q}:Q},ie,Q),M=z=>gd(We(s.mount?o:i,z,e.shouldUnregister?We(i,z,[]):[])),U=(z,Q,ie={})=>{const te=We(n,z);let he=Q;if(te){const ve=te._f;ve&&(!ve.disabled&&or(o,z,HO(Q,ve)),he=em(ve.ref)&&Xn(Q)?"":Q,UO(ve.ref)?[...ve.ref.options].forEach(Re=>Re.selected=he.includes(Re.value)):ve.refs?Jf(ve.ref)?ve.refs.length>1?ve.refs.forEach(Re=>(!Re.defaultChecked||!Re.disabled)&&(Re.checked=Array.isArray(he)?!!he.find(He=>He===Re.value):he===Re.value)):ve.refs[0]&&(ve.refs[0].checked=!!he):ve.refs.forEach(Re=>Re.checked=Re.value===he):Y3(ve.ref)?ve.ref.value="":(ve.ref.value=he,ve.ref.type||h.values.next({name:z,values:{...o}})))}(ie.shouldDirty||ie.shouldTouch)&&w(z,he,ie.shouldTouch,ie.shouldDirty,!0),ie.shouldValidate&&ne(z)},$=(z,Q,ie)=>{for(const te in Q){const he=Q[te],ve=`${z}.${te}`,Re=We(n,ve);(a.array.has(z)||!rm(he)||Re&&!Re._f)&&!cu(he)?$(ve,he,ie):U(ve,he,ie)}},j=(z,Q,ie={})=>{const te=We(n,z),he=a.array.has(z),ve=dn(Q);or(o,z,ve),he?(h.array.next({name:z,values:{...o}}),(u.isDirty||u.dirtyFields)&&ie.shouldDirty&&h.state.next({name:z,dirtyFields:Zp(i,o),isDirty:O(z,ve)})):te&&!te._f&&!Xn(ve)?$(z,ve,ie):U(z,ve,ie),Yy(z,a)&&h.state.next({...r}),h.values.next({name:s.mount?z:void 0,values:{...o}})},q=async z=>{const Q=z.target;let ie=Q.name,te=!0;const he=We(n,ie),ve=()=>Q.type?bv(he._f):RO(z),Re=He=>{te=Number.isNaN(He)||He===We(o,ie,He)};if(he){let He,dt;const N=ve(),T=z.type===Q1.BLUR||z.type===Q1.FOCUS_OUT,R=!lhe(he._f)&&!t.resolver&&!We(r.errors,ie)&&!he._f.deps||che(T,We(r.touchedFields,ie),r.isSubmitted,p,f),B=Yy(ie,a,T);or(o,ie,N),T?(he._f.onBlur&&he._f.onBlur(z),l&&l(0)):he._f.onChange&&he._f.onChange(z);const G=w(ie,N,T,!1),le=!_i(G)||B;if(!T&&h.values.next({name:ie,type:z.type,values:{...o}}),R)return u.isValid&&y(),le&&h.state.next({name:ie,...B?{}:G});if(!T&&B&&h.state.next({...r}),t.resolver){const{errors:ce}=await x([ie]);if(Re(N),te){const Ke=t7(r.errors,n,ie),xt=t7(ce,n,Ke.name||ie);He=xt.error,ie=xt.name,dt=_i(ce)}}else b([ie],!0),He=(await Zy(he,o,m,t.shouldUseNativeValidation))[ie],b([ie]),Re(N),te&&(He?dt=!1:u.isValid&&(dt=await P(n,!0)));te&&(he._f.deps&&ne(he._f.deps),_(ie,dt,He,G))}},W=(z,Q)=>{if(We(r.errors,Q)&&z.focus)return z.focus(),1},ne=async(z,Q={})=>{let ie,te;const he=Mi(z);if(t.resolver){const ve=await C(wr(z)?z:he);ie=_i(ve),te=z?!he.some(Re=>We(ve,Re)):ie}else z?(te=(await Promise.all(he.map(async ve=>{const Re=We(n,ve);return await P(Re&&Re._f?{[ve]:Re}:Re)}))).every(Boolean),!(!te&&!r.isValid)&&y()):te=ie=await P(n);return h.state.next({...!os(z)||u.isValid&&ie!==r.isValid?{}:{name:z},...t.resolver||!z?{isValid:ie}:{},errors:r.errors}),Q.shouldFocus&&!te&&yu(n,W,z?he:a.mount),te},ae=z=>{const Q={...i,...s.mount?o:{}};return wr(z)?Q:os(z)?We(Q,z):z.map(ie=>We(Q,ie))},re=(z,Q)=>({invalid:!!We((Q||r).errors,z),isDirty:!!We((Q||r).dirtyFields,z),isTouched:!!We((Q||r).touchedFields,z),isValidating:!!We((Q||r).validatingFields,z),error:We((Q||r).errors,z)}),_e=z=>{z&&Mi(z).forEach(Q=>Xr(r.errors,Q)),h.state.next({errors:z?r.errors:{}})},be=(z,Q,ie)=>{const te=(We(n,z,{_f:{}})._f||{}).ref;or(r.errors,z,{...Q,ref:te}),h.state.next({name:z,errors:r.errors,isValid:!1}),ie&&ie.shouldFocus&&te&&te.focus&&te.focus()},J=(z,Q)=>Ma(z)?h.values.subscribe({next:ie=>z(D(void 0,Q),ie)}):D(z,Q,!0),xe=(z,Q={})=>{for(const ie of z?Mi(z):a.mount)a.mount.delete(ie),a.array.delete(ie),Q.keepValue||(Xr(n,ie),Xr(o,ie)),!Q.keepError&&Xr(r.errors,ie),!Q.keepDirty&&Xr(r.dirtyFields,ie),!Q.keepTouched&&Xr(r.touchedFields,ie),!Q.keepIsValidating&&Xr(r.validatingFields,ie),!t.shouldUnregister&&!Q.keepDefaultValue&&Xr(i,ie);h.values.next({values:{...o}}),h.state.next({...r,...Q.keepDirty?{isDirty:O()}:{}}),!Q.keepIsValid&&y()},Ze=({disabled:z,name:Q,field:ie,fields:te,value:he})=>{if(So(z)){const ve=z?void 0:wr(he)?bv(ie?ie._f:We(te,Q)._f):he;or(o,Q,ve),w(Q,ve,!1,!1,!0)}},$e=(z,Q={})=>{let ie=We(n,z);const te=So(Q.disabled);return or(n,z,{...ie||{},_f:{...ie&&ie._f?ie._f:{ref:{name:z}},name:z,mount:!0,...Q}}),a.mount.add(z),ie?Ze({field:ie,disabled:Q.disabled,name:z,value:Q.value}):A(z,!0,Q.value),{...te?{disabled:Q.disabled}:{},...t.progressive?{required:!!Q.required,min:Ud(Q.min),max:Ud(Q.max),minLength:Ud(Q.minLength),maxLength:Ud(Q.maxLength),pattern:Ud(Q.pattern)}:{},name:z,onChange:q,onBlur:q,ref:he=>{if(he){$e(z,Q),ie=We(n,z);const ve=wr(he.value)&&he.querySelectorAll&&he.querySelectorAll("input,select,textarea")[0]||he,Re=she(ve),He=ie._f.refs||[];if(Re?He.find(dt=>dt===ve):ve===ie._f.ref)return;or(n,z,{_f:{...ie._f,...Re?{refs:[...He.filter(_v),ve,...Array.isArray(We(i,z))?[{}]:[]],ref:{type:ve.type,name:z}}:{ref:ve}}}),A(z,!1,void 0,ve)}else ie=We(n,z,{}),ie._f&&(ie._f.mount=!1),(t.shouldUnregister||Q.shouldUnregister)&&!(IO(a.array,z)&&s.action)&&a.unMount.add(z)}}},Le=()=>t.shouldFocusError&&yu(n,W,a.mount),Fe=z=>{So(z)&&(h.state.next({disabled:z}),yu(n,(Q,ie)=>{let te=z;const he=We(n,ie);he&&So(he._f.disabled)&&(te||(te=he._f.disabled)),Q.disabled=te},0,!1))},ft=(z,Q)=>async ie=>{let te;ie&&(ie.preventDefault&&ie.preventDefault(),ie.persist&&ie.persist());let he=dn(o);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:ve,values:Re}=await x();r.errors=ve,he=Re}else await P(n);if(Xr(r.errors,"root"),_i(r.errors)){h.state.next({errors:{}});try{await z(he,ie)}catch(ve){te=ve}}else Q&&await Q({...r.errors},ie),Le(),setTimeout(Le);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:_i(r.errors)&&!te,submitCount:r.submitCount+1,errors:r.errors}),te)throw te},Ge=(z,Q={})=>{We(n,z)&&(wr(Q.defaultValue)?j(z,dn(We(i,z))):(j(z,Q.defaultValue),or(i,z,dn(Q.defaultValue))),Q.keepTouched||Xr(r.touchedFields,z),Q.keepDirty||(Xr(r.dirtyFields,z),r.isDirty=Q.defaultValue?O(z,dn(We(i,z))):O()),Q.keepError||(Xr(r.errors,z),u.isValid&&y()),h.state.next({...r}))},Se=(z,Q={})=>{const ie=z?dn(z):i,te=dn(ie),he=_i(z),ve=he?i:te;if(Q.keepDefaultValues||(i=ie),!Q.keepValues){if(Q.keepDirtyValues)for(const Re of a.mount)We(r.dirtyFields,Re)?or(ve,Re,We(o,Re)):j(Re,We(ve,Re));else{if(G3&&wr(z))for(const Re of a.mount){const He=We(n,Re);if(He&&He._f){const dt=Array.isArray(He._f.refs)?He._f.refs[0]:He._f.ref;if(em(dt)){const N=dt.closest("form");if(N){N.reset();break}}}}n={}}o=e.shouldUnregister?Q.keepDefaultValues?dn(i):{}:dn(ve),h.array.next({values:{...ve}}),h.values.next({values:{...ve}})}a={mount:Q.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!u.isValid||!!Q.keepIsValid||!!Q.keepDirtyValues,s.watch=!!e.shouldUnregister,h.state.next({submitCount:Q.keepSubmitCount?r.submitCount:0,isDirty:he?!1:Q.keepDirty?r.isDirty:!!(Q.keepDefaultValues&&!Ul(z,i)),isSubmitted:Q.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:he?[]:Q.keepDirtyValues?Q.keepDefaultValues&&o?Zp(i,o):r.dirtyFields:Q.keepDefaultValues&&z?Zp(i,z):{},touchedFields:Q.keepTouched?r.touchedFields:{},errors:Q.keepErrors?r.errors:{},isSubmitSuccessful:Q.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},je=(z,Q)=>Se(Ma(z)?z(o):z,Q);return{control:{register:$e,unregister:xe,getFieldState:re,handleSubmit:ft,setError:be,_executeSchema:x,_getWatch:D,_getDirty:O,_updateValid:y,_removeUnmounted:I,_updateFieldArray:E,_updateDisabledField:Ze,_getFieldArray:M,_reset:Se,_resetDefaultValues:()=>Ma(t.defaultValues)&&t.defaultValues().then(z=>{je(z,t.resetOptions),h.state.next({isLoading:!1})}),_updateFormState:z=>{r={...r,...z}},_disableForm:Fe,_subjects:h,_proxyFormState:u,_setErrors:k,get _fields(){return n},get _formValues(){return o},get _state(){return s},set _state(z){s=z},get _defaultValues(){return i},get _names(){return a},set _names(z){a=z},get _formState(){return r},set _formState(z){r=z},get _options(){return t},set _options(z){t={...t,...z}}},trigger:ne,register:$e,handleSubmit:ft,watch:J,setValue:j,getValues:ae,reset:je,resetField:Ge,clearErrors:_e,unregister:xe,setError:be,setFocus:(z,Q={})=>{const ie=We(n,z),te=ie&&ie._f;if(te){const he=te.refs?te.refs[0]:te.ref;he.focus&&(he.focus(),Q.shouldSelect&&he.select())}},getFieldState:re}}function cl(e={}){const t=Ee.useRef(),r=Ee.useRef(),[n,i]=Ee.useState({isDirty:!1,isValidating:!1,isLoading:Ma(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Ma(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...hhe(e),formState:n});const o=t.current.control;return o._options=e,kg({subject:o._subjects.state,next:s=>{OO(s,o._proxyFormState,o._updateFormState,!0)&&i({...o._formState})}}),Ee.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),Ee.useEffect(()=>{if(o._proxyFormState.isDirty){const s=o._getDirty();s!==n.isDirty&&o._subjects.state.next({isDirty:s})}},[o,n.isDirty]),Ee.useEffect(()=>{e.values&&!Ul(e.values,r.current)?(o._reset(e.values,o._options.resetOptions),r.current=e.values,i(s=>({...s}))):o._resetDefaultValues()},[e.values,o]),Ee.useEffect(()=>{e.errors&&o._setErrors(e.errors)},[e.errors,o]),Ee.useEffect(()=>
151{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),Ee.useEffect(()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[e.shouldUnregister,o]),t.current.formState=PO(n,o),t.current}function Ec(e){this._maxSize=e,this.clear()}Ec.prototype.clear=function(){this._size=0,this._values=Object.create(null)};Ec.prototype.get=function(e){return this._values[e]};Ec.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var fhe=/[^.^\]^[]+|(?=\[\]|\.\.)/g,zO=/^\d+$/,phe=/^\d/,mhe=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,ghe=/^\s*(['"]?)(.*?)(\1)\s*$/,X3=512,r7=new Ec(X3),n7=new Ec(X3),i7=new Ec(X3),Xl={Cache:Ec,split:Xy,normalizePath:xv,setter:function(e){var t=xv(e);return n7.get(e)||n7.set(e,function(n,i){for(var o=0,s=t.length,a=n;o<s-1;){var l=t[o];if(l==="__proto__"||l==="constructor"||l==="prototype")return n;a=a[t[o++]]}a[t[o]]=i})},getter:function(e,t){var r=xv(e);return i7.get(e)||i7.set(e,function(i){for(var o=0,s=r.length;o<s;)if(i!=null||!t)i=i[r[o++]];else return;return i})},join:function(e){return e.reduce(function(t,r){return t+(J3(r)||zO.test(r)?"["+r+"]":(t?".":"")+r)},"")},forEach:function(e,t,r){vhe(Array.isArray(e)?e:Xy(e),t,r)}};function xv(e){return r7.get(e)||r7.set(e,Xy(e).map(function(t){return t.replace(ghe,"$2")}))}function Xy(e){return e.match(fhe)||[""]}function vhe(e,t,r){var n=e.length,i,o,s,a;for(o=0;o<n;o++)i=e[o],i&&(bhe(i)&&(i='"'+i+'"'),a=J3(i),s=!a&&/^\d+$/.test(i),t.call(r,i,a,s,o,e))}function J3(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function yhe(e){return e.match(phe)&&!e.match(zO)}function _he(e){return mhe.test(e)}function bhe(e){return!J3(e)&&(yhe(e)||_he(e))}const xhe=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['â](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['â](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['â](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['â](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,Rg=e=>e.match(xhe)||[],Ig=e=>e[0].toUpperCase()+e.slice(1),Q3=(e,t)=>Rg(e).join(t).toLowerCase(),WO=e=>Rg(e).reduce((t,r)=>`${t}${t?r[0].toUpperCase()+r.slice(1).toLowerCase():r.toLowerCase()}`,""),whe=e=>Ig(WO(e)),Ehe=e=>Q3(e,"_"),She=e=>Q3(e,"-"),Che=e=>Ig(Q3(e," ")),The=e=>Rg(e).map(Ig).join(" ");var wv={words:Rg,upperFirst:Ig,camelCase:WO,pascalCase:whe,snakeCase:Ehe,kebabCase:She,sentenceCase:Che,titleCase:The},ex={exports:{}};ex.exports=function(e){return qO(Ahe(e),e)};ex.exports.array=qO;function qO(e,t){var r=e.length,n=new Array(r),i={},o=r,s=khe(t),a=Rhe(e);for(t.forEach(function(d){if(!a.has(d[0])||!a.has(d[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});o--;)i[o]||l(e[o],o,new Set);return n;function l(d,u,h){if(h.has(d)){var f;try{f=", node was:"+JSON.stringify(d)}catch{f=""}throw new Error("Cyclic dependency"+f)}if(!a.has(d))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(d));if(!i[u]){i[u]=!0;var p=s.get(d)||new Set;if(p=Array.from(p),u=p.length){h.add(d);do{var m=p[--u];l(m,a.get(m),h)}while(u);
151h.delete(d)}n[--r]=d}}}function Ahe(e){for(var t=new Set,r=0,n=e.length;r<n;r++){var i=e[r];t.add(i[0]),t.add(i[1])}return Array.from(t)}function khe(e){for(var t=new Map,r=0,n=e.length;r<n;r++){var i=e[r];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}function Rhe(e){for(var t=new Map,r=0,n=e.length;r<n;r++)t.set(e[r],r);return t}var Ihe=ex.exports;const Phe=NC(Ihe),Ohe=Object.prototype.toString,jhe=Error.prototype.toString,Lhe=RegExp.prototype.toString,$he=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Dhe=/^Symbol\((.*)\)(.*)$/;function Mhe(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function o7(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const r=typeof e;if(r==="number")return Mhe(e);if(r==="string")return t?`"${e}"`:e;if(r==="function")return"[Function "+(e.name||"anonymous")+"]";if(r==="symbol")return $he.call(e).replace(Dhe,"Symbol($1)");const n=Ohe.call(e).slice(8,-1);return n==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):n==="Error"||e instanceof Error?"["+jhe.call(e)+"]":n==="RegExp"?Lhe.call(e):null}function qs(e,t){let r=o7(e,t);return r!==null?r:JSON.stringify(e,function(n,i){let o=o7(this[n],t);return o!==null?o:i},2)}function GO(e){return e==null?[]:[].concat(e)}let KO,YO,ZO,Nhe=/\$\{\s*(\w+)\s*\}/g;KO=Symbol.toStringTag;class s7{constructor(t,r,n,i){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[KO]="Error",this.name="ValidationError",this.value=r,this.path=n,this.type=i,this.errors=[],this.inner=[],GO(t).forEach(o=>{if(xi.isError(o)){this.errors.push(...o.errors);const s=o.inner.length?o.inner:[o];this.inner.push(...s)}else this.errors.push(o)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}YO=Symbol.hasInstance;ZO=Symbol.toStringTag;class xi extends Error{static formatError(t,r){const n=r.label||r.path||"this";return n!==r.path&&(r=Object.assign({},r,{path:n})),typeof t=="string"?t.replace(Nhe,(i,o)=>qs(r[o])):typeof t=="function"?t(r):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,r,n,i,o){const s=new s7(t,r,n,i);if(o)return s;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[ZO]="Error",this.name=s.name,this.message=s.message,this.type=s.type,this.value=s.value,this.path=s.path,this.errors=s.errors,this.inner=s.inner,Error.captureStackTrace&&Error.captureStackTrace(this,xi)}static[YO](t){return s7[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let qo={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:r,originalValue:n})=>{const i=n!=null&&n!==r?` (cast from the value \`${qs(n,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${qs(r,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${qs(r,!0)}\``+i}},mi={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Ta={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Jy={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Qy={isValue:"${path} field must be ${value}"},e_={noUnknown:"${path} field has unspecified keys: ${unknown}"},U0={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},Fhe={notType:e=>{const{path:t,value:r,spec:n}=e,i=n.types.length;if(Array.isArray(r)){if(r.length<i)return`${t} tuple value has too few items, expected a length of ${i} but got ${r.length} for value: \`${qs(r,!0)}\``;if(r.length>i)return`${t} tuple value has too many items, expected a length of ${i} but got ${r.length} for value: \`${qs(r,!0)}\``}return xi.formatError(qo.notType,e)}};Object.assign(Object.create(null),{mixed:qo,string:mi,number:Ta,date:Jy,object:e_,array:U0,boolean:Qy,tuple:Fhe});const Pg=e=>e&&e.__isYupSchema__;class im{static fromOptions(t,r){if(!r.then&&!r.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:i,otherwise:o}=r,s=typeof n=="function"?n:(...a)=>a.every(l=>l===n);return new im(t,(a,l)=>{var d;let u=s(...a)?i:o;return(d=u==null?void 0:u(l))!=null?d:l})}constructor(t,r){this.fn=void 0,this.refs=t,this.refs=t,this.fn=r}resolve(t,r){let n=this.refs.map(o=>o.getValue(r==null?void 0:r.value,r==null?void 0:r.parent,r==null?void 0:r.context)),i=this.fn(n,t,r);if(i===void 0||i===t)return t;if(!Pg(i))throw new TypeError("conditions must return a schema object");return i.resolve(r)}}const Xp={context:"$",value:"."};function gCe(e,t){return new ul(e,t)}class ul{constructor(t,r={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Xp.context,this.isValue=this.key[0]===Xp.value,this.isSibling=!this.isContext&&!this.isValue;let n=this.isContext?Xp.context:this.isValue?Xp.value:"";this.path=this.key.slice(n.length),this.getter=this.path&&Xl.getter(this.path,!0),this.map=r.map}getValue(t,r,n){let i=this.isContext?n:this.isValue?t:r;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(t,r){return this.getValue(t,r==null?void 0:r.parent,r==null?void 0:r.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}ul.prototype.__isYupRef=!0;const To=e=>e==null;function Vc(e){function t({value:r,path:n="",options:i,originalValue:o,schema:s},a,l){const{name:d,test:u,params:h,message:f,skipAbsent:p}=e;let{parent:m,context:g,abortEarly:y=s.spec.abortEarly,disableStackTrace:b=s.spec.disableStackTrace}=i;function E(I){return ul.isRef(I)?I.getValue(r,m,g):I}function S(I={}){const O=Object.assign({value:r,originalValue:o,label:s.spec.label,path:I.path||n,spec:s.spec,disableStackTrace:I.disableStackTrace||b},h,I.params);for(const M of Object.keys(O))O[M]=E(O[M]);const D=new xi(xi.formatError(I.message||f,O),r,O.path,I.type||d,O.disableStackTrace);return D.params=O,D}const k=y?a:l;let A={path:n,parent:m,type:d,from:i.from,createError:S,resolve:E,options:i,originalValue:o,schema:s};const w=I=>
151{xi.isError(I)?k(I):I?l(null):k(S())},_=I=>{xi.isError(I)?k(I):a(I)};if(p&&To(r))return w(!0);let C;try{var P;if(C=u.call(A,r,A),typeof((P=C)==null?void 0:P.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${A.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(C).then(w,_)}}catch(I){_(I);return}w(C)}return t.OPTIONS=e,t}function Uhe(e,t,r,n=r){let i,o,s;return t?(Xl.forEach(t,(a,l,d)=>{let u=l?a.slice(1,a.length-1):a;e=e.resolve({context:n,parent:i,value:r});let h=e.type==="tuple",f=d?parseInt(u,10):0;if(e.innerType||h){if(h&&!d)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${s}" must contain an index to the tuple element, e.g. "${s}[0]"`);if(r&&f>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${a}, in the path: ${t}. because there is no value at that index. `);i=r,r=r&&r[f],e=h?e.spec.types[f]:e.innerType}if(!d){if(!e.fields||!e.fields[u])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${s} which is a type: "${e.type}")`);i=r,r=r&&r[u],e=e.fields[u]}o=u,s=l?"["+a+"]":"."+a}),{schema:e,parent:i,parentPath:o}):{parent:i,parentPath:t,schema:e}}class om extends Set{describe(){const t=[];for(const r of this.values())t.push(ul.isRef(r)?r.describe():r);return t}resolveAll(t){let r=[];for(const n of this.values())r.push(t(n));return r}clone(){return new om(this.values())}merge(t,r){const n=this.clone();return t.forEach(i=>n.add(i)),r.forEach(i=>n.delete(i)),n}}function uu(e,t=new Map){if(Pg(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let r;if(e instanceof Date)r=new Date(e.getTime()),t.set(e,r);else if(e instanceof RegExp)r=new RegExp(e),t.set(e,r);else if(Array.isArray(e)){r=new Array(e.length),t.set(e,r);for(let n=0;n<e.length;n++)r[n]=uu(e[n],t)}else if(e instanceof Map){r=new Map,t.set(e,r);for(const[n,i]of e.entries())r.set(n,uu(i,t))}else if(e instanceof Set){r=new Set,t.set(e,r);for(const n of e)r.add(uu(n,t))}else if(e instanceof Object){r={},t.set(e,r);for(const[n,i]of Object.entries(e))r[n]=uu(i,t)}else throw Error(`Unable to clone ${e}`);return r}class Ti{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new om,this._blacklist=new om,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(qo.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(r=>{r.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const r=Object.create(Object.getPrototypeOf(this));return r.type=this.type,r._typeCheck=this._typeCheck,r._whitelist=this._whitelist.clone(),r._blacklist=this._blacklist.clone(),r.internalTests=Object.assign({},this.internalTests),r.exclusiveTests=Object.assign({},this.exclusiveTests),r.deps=[...this.deps],r.conditions=[...this.conditions],r.tests=[...this.tests],r.transforms=[...this.transforms],r.spec=uu(Object.assign({},this.spec,t)),r}label(t){let r=this.clone();return r.spec.label=t,r}meta(...t){if(t.length===0)return this.spec.meta;let r=this.clone();return r.spec.meta=Object.assign(r.spec.meta||{},t[0]),r}withMutation(t){let r=this._mutate;this._mutate=!0;let n=t(this);return this._mutate=r,n}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let r=this,n=t.clone();const i=Object.assign({},r.spec,n.spec);return n.spec=i,n.internalTests=Object.assign({},r.internalTests,n.internalTests),n._whitelist=r._whitelist.merge(t._whitelist,t._blacklist),n._blacklist=r._blacklist.merge(t._blacklist,t._whitelist),n.tests=r.tests,n.exclusiveTests=r.exclusiveTests,n.withMutation(o=>
151{t.tests.forEach(s=>{o.test(s.OPTIONS)})}),n.transforms=[...r.transforms,...n.transforms],n}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let r=this;if(r.conditions.length){let n=r.conditions;r=r.clone(),r.conditions=[],r=n.reduce((i,o)=>o.resolve(i,t),r),r=r.resolve(t)}return r}resolveOptions(t){var r,n,i,o;return Object.assign({},t,{from:t.from||[],strict:(r=t.strict)!=null?r:this.spec.strict,abortEarly:(n=t.abortEarly)!=null?n:this.spec.abortEarly,recursive:(i=t.recursive)!=null?i:this.spec.recursive,disableStackTrace:(o=t.disableStackTrace)!=null?o:this.spec.disableStackTrace})}cast(t,r={}){let n=this.resolve(Object.assign({value:t},r)),i=r.assert==="ignore-optionality",o=n._cast(t,r);if(r.assert!==!1&&!n.isType(o)){if(i&&To(o))return o;let s=qs(t),a=qs(o);throw new TypeError(`The value of ${r.path||"field"} could not be cast to a value that satisfies the schema type: "${n.type}". 152 153attempted value: ${s} 154`+(a!==s?`result of cast: ${a}`:""))}return o}_cast(t,r){let n=t===void 0?t:this.transforms.reduce((i,o)=>o.call(this,i,t,this),t);return n===void 0&&(n=this.getDefault(r)),n}_validate(t,r={},n,i){let{path:o,originalValue:s=t,strict:a=this.spec.strict}=r,l=t;a||(l=this._cast(l,Object.assign({assert:!1},r)));let d=[];for(let u of Object.values(this.internalTests))u&&d.push(u);this.runTests({path:o,value:l,originalValue:s,options:r,tests:d},n,u=>{if(u.length)return i(u,l);this.runTests({path:o,value:l,originalValue:s,options:r,tests:this.tests},n,i)})}runTests(t,r,n){let i=!1,{tests:o,value:s,originalValue:a,path:l,options:d}=t,u=g=>{i||(i=!0,r(g,s))},h=g=>{i||(i=!0,n(g,s))},f=o.length,p=[];if(!f)return h([]);let m={value:s,originalValue:a,path:l,options:d,schema:this};for(let g=0;g<o.length;g++){const y=o[g];y(m,u,function(E){E&&(Array.isArray(E)?p.push(...E):p.push(E)),--f<=0&&h(p)})}}asNestedTest({key:t,index:r,parent:n,parentPath:i,originalParent:o,options:s}){const a=t??r;if(a==null)throw TypeError("Must include `key` or `index` for nested validations");const l=typeof a=="number";let d=n[a];const u=Object.assign({},s,{strict:!0,parent:n,value:d,originalValue:o[a],key:void 0,[l?"index":"key"]:a,path:l||a.includes(".")?`${i||""}[${l?a:`"${a}"`}]`:(i?`${i}.`:"")+t});return(h,f,p)=>this.resolve(u)._validate(d,u,f,p)}validate(t,r){var n;let i=this.resolve(Object.assign({},r,{value:t})),o=(n=r==null?void 0:r.disableStackTrace)!=null?n:i.spec.disableStackTrace;return new Promise((s,a)=>i._validate(t,r,(l,d)=>{xi.isError(l)&&(l.value=d),a(l)},(l,d)=>{l.length?a(new xi(l,d,void 0,void 0,o)):s(d)}))}validateSync(t,r){var n;let i=this.resolve(Object.assign({},r,{value:t})),o,s=(n=r==null?void 0:r.disableStackTrace)!=null?n:i.spec.disableStackTrace;return i._validate(t,Object.assign({},r,{sync:!0}),(a,l)=>{throw xi.isError(a)&&(a.value=l),a},(a,l)=>{if(a.length)throw new xi(a,t,void 0,void 0,s);o=l}),o}isValid(t,r){return this.validate(t,r).then(()=>!0,n=>{if(xi.isError(n))return!1;throw n})}isValidSync(t,r){try{return this.validateSync(t,r),!0}catch(n){if(xi.isError(n))return!1;throw n}}_getDefault(t){let r=this.spec.default;return r==null?r:typeof r=="function"?r.call(this,t):uu(r)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,r){const n=this.clone({nullable:t});return n.internalTests.nullable=Vc({message:r,name:"nullable",test(i){return i===null?this.schema.spec.nullable:!0}}),n}optionality(t,r){const n=this.clone({optional:t});return n.internalTests.optionality=Vc({message:r,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),n}optional(){return this.optionality(!0)}defined(t=qo.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=qo.notNull){return this.nullability(!1,t)}required(t=qo.required){return this.clone().withMutation(r=>r.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let r=this.clone();return r.transforms.push(t),r}test(...t){let r;if(t.length===1?typeof t[0]=="function"?r={test:t[0]}:r=t[0]:t.length===2?r={name:t[0],test:t[1]}:r={name:t[0],message:t[1],test:t[2]},r.message===void 0&&(r.message=qo.default),typeof r.test!="function")throw new TypeError("`test` is a required parameters");let n=this.clone(),i=Vc(r),o=r.exclusive||r.name&&n.exclusiveTests[r.name]===!0;if(r.exclusive&&!r.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return r.name&&(n.exclusiveTests[r.name]=!!r.exclusive),n.tests=n.tests.filter(s=>!(s.OPTIONS.name===r.name&&(o||s.OPTIONS.test===i.OPTIONS.test))),n.tests.push(i),n}when(t,r){!Array.isArray(t)&&typeof t!="string"&&(r=t,t=".");let n=this.clone(),i=GO(t).map(o=>new ul(o));
154return i.forEach(o=>{o.isSibling&&n.deps.push(o.key)}),n.conditions.push(typeof r=="function"?new im(i,r):im.fromOptions(i,r)),n}typeError(t){let r=this.clone();return r.internalTests.typeError=Vc({message:t,name:"typeError",skipAbsent:!0,test(n){return this.schema._typeCheck(n)?!0:this.createError({params:{type:this.schema.type}})}}),r}oneOf(t,r=qo.oneOf){let n=this.clone();return t.forEach(i=>{n._whitelist.add(i),n._blacklist.delete(i)}),n.internalTests.whiteList=Vc({message:r,name:"oneOf",skipAbsent:!0,test(i){let o=this.schema._whitelist,s=o.resolveAll(this.resolve);return s.includes(i)?!0:this.createError({params:{values:Array.from(o).join(", "),resolved:s}})}}),n}notOneOf(t,r=qo.notOneOf){let n=this.clone();return t.forEach(i=>{n._blacklist.add(i),n._whitelist.delete(i)}),n.internalTests.blacklist=Vc({message:r,name:"notOneOf",test(i){let o=this.schema._blacklist,s=o.resolveAll(this.resolve);return s.includes(i)?this.createError({params:{values:Array.from(o).join(", "),resolved:s}}):!0}}),n}strip(t=!0){let r=this.clone();return r.spec.strip=t,r}describe(t){const r=(t?this.resolve(t):this).clone(),{label:n,meta:i,optional:o,nullable:s}=r.spec;return{meta:i,label:n,optional:o,nullable:s,default:r.getDefault(t),type:r.type,oneOf:r._whitelist.describe(),notOneOf:r._blacklist.describe(),tests:r.tests.map(l
154=>({name:l.OPTIONS.name,params:l.OPTIONS.params})).filter((l,d,u)=>u.findIndex(h=>h.name===l.name)===d)}}}Ti.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])Ti.prototype[`${e}At`]=function(t,r,n={}){const{parent:i,parentPath:o,schema:s}=Uhe(this,t,r,n.context);return s[e](i&&i[o],Object.assign({},n,{parent:i,path:t}))};for(const e of["equals","is"])Ti.prototype[e]=Ti.prototype.oneOf;for(const e of["not","nope"])Ti.prototype[e]=Ti.prototype.notOneOf;const Bhe=()=>!0;function Vhe(e){return new XO(e)}class XO extends Ti{constructor(t){super(typeof t=="function"?{type:"mixed",check:t}:Object.assign({type:"mixed",check:Bhe},t))}}Vhe.prototype=XO.prototype;function t_(){return new JO}class JO extends Ti{constructor(){super({type:"boolean",check(t){return t instanceof Boolean&&(t=t.valueOf()),typeof t=="boolean"}}),this.withMutation(()=>{this.transform((t,r,n)=>{if(n.spec.coerce&&!n.isType(t)){if(/^(true|1)$/i.test(String(t)))return!0;if(/^(false|0)$/i.test(String(t)))return!1}return t})})}isTrue(t=Qy.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(r){return To(r)||r===!0}})}isFalse(t=Qy.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(r){return To(r)||r===!1}})}default(t){return super.default(t)}defined(t){return super.defined(t)}optional(){return super.optional()}required(t){return super.required(t)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(t){return super.nonNullable(t)}strip(t){return super.strip(t)}}t_.prototype=JO.prototype;const Hhe=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function zhe(e){const t=r_(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let r=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(r=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(r=0-r)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+r,t.second,t.millisecond)}function r_(e){var t,r;const n=Hhe.exec(e);return n?{year:Ss(n[1]),month:Ss(n[2],1)-1,day:Ss(n[3],1),hour:Ss(n[4]),minute:Ss(n[5]),second:Ss(n[6]),millisecond:n[7]?Ss(n[7].substring(0,3)):0,precision:(t=(r=n[7])==null?void 0:r.length)!=null?t:void 0,z:n[8]||void 0,plusMinus:n[9]||void 0,hourOffset:Ss(n[10]),minuteOffset:Ss(n[11])}:null}function Ss(e,t=0){return Number(e)||t}let Whe=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,qhe=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,Ghe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Khe="^\\d{4}-\\d{2}-\\d{2}",Yhe="\\d{2}:\\d{2}:\\d{2}",Zhe="(([+-]\\d{2}(:?\\d{2})?)|Z)",Xhe=new RegExp(`${Khe}T${Yhe}(\\.\\d+)?${Zhe}$`),Jhe=e=>To(e)||e===e.trim(),Qhe={}.toString();function no(){return new QO}class QO extends Ti{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,r,n)=>{if(!n.spec.coerce||n.isType(t)||Array.isArray(t))return t;const i=t!=null&&t.toString?t.toString():t;return i===Qhe?t:i})})}required(t){return super.required(t).withMutation(r=>r.test({message:t||qo.required,name:"required",skipAbsent:!0,test:n=>!!n.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(r=>r.OPTIONS.name!=="required"),t))}length(t,r=mi.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(n){return n.length===this.resolve(t)}})}min(t,r=mi.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(n){return n.length>=this.resolve(t)}})}max(t,r=mi.max){return this.test({name:"max",exclusive:!0,message:r,params:{max:t},skipAbsent:!0,test(n){return n.length<=this.resolve(t)}})}matches(t,r){let n=!1,i,o;return r&&(typeof r=="object"?{excludeEmptyString:n=!1,message:i,name:o}=r:i=r),this.test({name:o||"matches",message:i||mi.matches,params:{regex:t},skipAbsent:!0,test:s=>s===""&&n||s.search(t)!==-1})}email(t=mi.email){return this.matches(Whe,{name:"email",message:t,excludeEmptyString:!0})}url(t=mi.url){return this.matches(qhe,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=mi.uuid){return this.matches(Ghe,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let r="",n,i;return t&&(typeof t=="object"?{message:r="",allowOffset:n=!1,precision:i=void 0}=t:r=t),this.matches(Xhe,{name:"datetime",message:r||mi.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:r||mi.datetime_offset,params:{allowOffset:n},skipAbsent:!0,test:o=>{if(!o||n)return!0;const s=r_(o);return s?!!s.z:!1}}).test({name:"datetime_precision",message:r||mi.datetime_precision,params:{precision:i},skipAbsent:!0,test:o=>{if(!o||i==null)return!0;const s=r_(o);return s?s.precision===i:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=mi.trim){return this.transform(r=>r!=null?r.trim():r).test({message:t,name:"trim",test:Jhe})}lowercase(t=mi.lowercase){return this.transform(r=>To(r)?r:r.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>To(r)||r===r.toLowerCase()})}uppercase(t=mi.uppercase){return this.transform(r=>To(r)?r:r.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>To(r)||r===r.toUpperCase()})}}no.prototype=QO.prototype;let efe=e=>e!=+e;function tfe(){return new ej}class ej extends Ti{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!efe(t)}}),this.withMutation(()=>{this.transform((t,r,n)=>{if(!n.spec.coerce)return t;let i=t;if(typeof i=="string"){if(i=i.replace(/\s/g,""),i==="")return NaN;i=+i}return n.isType(i)||i===null?i:parseFloat(i)})})}min(t,r=Ta.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(n){return n>=this.resolve(t)}})}max(t,r=Ta.max){return this.test({message:r,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(n){return n<=this.resolve(t)}})}lessThan(t,r=Ta.lessThan){return this.test({message:r,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(n){return n<this.resolve(t)}})}moreThan(t,r=Ta.moreThan){return this.test({message:r,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(n){return n>this.resolve(t)}})}positive(t=Ta.positive){return this.moreThan(0,t)}negative(t=Ta.negative){return this.lessThan(0,t)}integer(t=Ta.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:r=>Number.isInteger(r)})}truncate(){return this.transform(t=>To(t)?t:t|0)}round(t){var r;let n=["ceil","floor","round","trunc"];if(t=((r=t)==null?void 0:r.toLowerCase())||"round",t==="trunc")return this.truncate();if(n.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for roun
154d() are: "+n.join(", "));return this.transform(i=>To(i)?i:Math[t](i))}}tfe.prototype=ej.prototype;let tj=new Date(""),rfe=e=>Object.prototype.toString.call(e)==="[object Date]";function rj(){return new Qf}class Qf extends Ti{constructor(){super({type:"date",check(t){return rfe(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,r,n)=>!n.spec.coerce||n.isType(t)||t===null?t:(t=zhe(t),isNaN(t)?Qf.INVALID_DATE:new Date(t)))})}prepareParam(t,r){let n;if(ul.isRef(t))n=t;else{let i=this.cast(t);if(!this._typeCheck(i))throw new TypeError(`\`${r}\` must be a Date or a value that can be \`cast()\` to a Date`);n=i}return n}min(t,r=Jy.min){let n=this.prepareParam(t,"min");return this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(i){return i>=this.resolve(n)}})}max(t,r=Jy.max){let n=this.prepareParam(t,"max");return this.test({message:r,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(i){return i<=this.resolve(n)}})}}Qf.INVALID_DATE=tj;rj.prototype=Qf.prototype;rj.INVALID_DATE=tj;function nfe(e,t=[]){let r=[],n=new Set,i=new Set(t.map(([s,a])=>`${s}-${a}
154`));function o(s,a){let l=Xl.split(s)[0];n.add(l),i.has(`${a}-${l}`)||r.push([a,l])}for(const s of Object.keys(e)){let a=e[s];n.add(s),ul.isRef(a)&&a.isSibling?o(a.path,s):Pg(a)&&"deps"in a&&a.deps.forEach(l=>o(l,s))}return Phe.array(Array.from(n),r).reverse()}function a7(e,t){let r=1/0;return e.some((n,i)=>{var o;if((o=t.path)!=null&&o.includes(n))return r=i,!0}),r}function nj(e){return(t,r)=>a7(e,t)-a7(e,r)}const ij=(e,t,r)=>{if(typeof e!="string")return e;let n=e;try{n=JSON.parse(e)}catch{}return r.isType(n)?n:e};function B0(e){if("fields"in e){const t={};for(const[r,n]of Object.entries(e.fields))t[r]=B0(n);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=B0(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(B0)}):"optional"in e?e.optional():e}const ife=(e,t)=>{const r=[...Xl.normalizePath(t)];if(r.length===1)return r[0]in e;let n=r.pop(),i=Xl.getter(Xl.join(r),!0)(e);return!!(i&&n in i)};let l7=e=>Object.prototype.toString.call(e)==="[object Object]";function ofe(e,t){let r=Object.keys(e.fields);return Object.keys(t).filter(n=>r.indexOf(n)===-1)}const sfe=nj([]);function ca(e){return new oj(e)}class oj extends Ti{constructor(t){super({type:"object",check(r){return l7(r)||typeof r=="function"}}),this.fields=Object.create(null),this._sortErrors=sfe,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,r={}){var n;let i=super._cast(t,r);if(i===void 0)return this.getDefault(r);if(!this._typeCheck(i))return i;let o=this.fields,s=(n=r.stripUnknown)!=null?n:this.spec.noUnknown,a=[].concat(this._nodes,Object.keys(i).filter(h=>!this._nodes.includes(h))),l={},d=Object.assign({},r,{parent:l,__validating:r.__validating||!1}),u=!1;for(const h of a){let f=o[h],p=h in i;if(f){let m,g=i[h];d.path=(r.path?`${r.path}.`:"")+h,f=f.resolve({value:g,context:r.context,parent:l});let y=f instanceof Ti?f.spec:void 0,b=y==null?void 0:y.strict;if(y!=null&&y.strip){u=u||h in i;continue}m=!r.__validating||!b?f.cast(i[h],d):i[h],m!==void 0&&(l[h]=m)}else p&&!s&&(l[h]=i[h]);(p!==h in l||l[h]!==i[h])&&(u=!0)}return u?l:i}_validate(t,r={},n,i){let{from:o=[],originalValue:s=t,recursive:a=this.spec.recursive}=r;r.from=[{schema:this,value:s},...o],r.__validating=!0,r.originalValue=s,super._validate(t,r,n,(l,d)=>{if(!a||!l7(d)){i(l,d);return}s=s||d;let u=[];for(let h of this._nodes){let f=this.fields[h];!f||ul.isRef(f)||u.push(f.asNestedTest({options:r,key:h,parent:d,parentPath:r.path,originalParent:s}))}this.runTests({tests:u,value:d,originalValue:s,options:r},n,h=>{i(h.sort(this._sortErrors).concat(l),d)})})}clone(t){const r=super.clone(t);return r.fields=Object.assign({},this.fields),r._nodes=this._nodes,r._excludedEdges=this._excludedEdges,r._sortErrors=this._sortErrors,r}concat(t){let r=super.concat(t),n=r.fields;for(let[i,o]of Object.entries(this.fields)){const s=n[i];n[i]=s===void 0?o:s}return r.withMutation(i=>i.setFields(n,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let r={};return this._nodes.forEach(n=>{var i;const o=this.fields[n];let s=t;(i=s)!=null&&i.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[n]})),r[n]=o&&"getDefault"in o?o.getDefault(s):void 0}),r}setFields(t,r){let n=this.clone();return n.fields=t,n._nodes=nfe(t,r),n._sortErrors=nj(Object.keys(t)),r&&(n._excludedEdges=r),n}shape(t,r=[]){return this.clone().withMutation(n=>{let i=n._excludedEdges;return r.length&&(Array.isArray(r[0])||(r=[r]),i=[...n._excludedEdges,...r]),n.setFields(Object.assign(n.fields,t),i)})}partial(){const t={};for(const[r,n]of Object.entries(this.fields))t[r]="optional"in n&&n.optional instanceof Function?n.optional():n;return this.setFields(t)}deepPartial(){return B0(this)}pick(t){const r={};for(const n of t)this.fields[n]&&(r[n]=this.fields[n]);return this.setFields(r,this._excludedEdges.filter(([n,i])=>t.includes(n)&&t.includes(i)))}omit(t){const r=[];for(const n of Object.keys(this.fields))t.includes(n)||r.push(n);return this.pick(r)}from(t,r,n){let i=Xl.getter(t,!0);return this.transform(o=>{if(!o)return o;let s=o;return ife(o,t)&&(s=Object.assign({},o),n||delete s[t],s[r]=i(o)),s})}json(){return this.transform(ij)}noUnknown(t=!0,r=e_.noUnknown){typeof t!="boolean"&&(r=t,t=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:r,test(i){if(i==null)return!0;const o=ofe(this.schema,i);return!t||o.length===0||this.createError({params:{unknown:o.join(", ")}})}});return n.spec.noUnknown=t,n}unknown(t=!0,r=e_.noUnknown){return this.noUnknown(!t,r)}transformKeys(t){return this.transform(r=>{if(!r)return r;const n={};for(const i of Object.keys(r))n[t(i)]=r[i];return n})}camelCase(){return this.transformKeys(wv.camelCase)}snakeCase(){return this.transformKeys(wv.snakeCase)}constantCase(){return this.transformKeys(t=>wv.snakeCase(t).toUpperCase())}describe(t){const r=(t?this.resolve(t):this).clone(),n=super.describe(t);n.fields={};for(const[o,s]of Object.entries(r.fields)){var i;let a=t;
154(i=a)!=null&&i.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[o]})),n.fields[o]=s.describe(a)}return n}}ca.prototype=oj.prototype;function afe(e){return new sj(e)}class sj extends Ti{constructor(t){super({type:"array",spec:{types:t},check(r){return Array.isArray(r)}}),this.innerType=void 0,this.innerType=t}_cast(t,r){const n=super._cast(t,r);if(!this._typeCheck(n)||!this.innerType)return n;let i=!1;const o=n.map((s,a)=>{const l=this.innerType.cast(s,Object.assign({},r,{path:`${r.path||""}[${a}]`}));return l!==s&&(i=!0),l});return i?o:n}_validate(t,r={},n,i){var o;let s=this.innerType,a=(o=r.recursive)!=null?o:this.spec.recursive;r.originalValue!=null&&r.originalValue,super._validate(t,r,n,(l,d)=>{var u;if(!a||!s||!this._typeCheck(d)){i(l,d);return}let h=new Array(d.length);for(let p=0;p<d.length;p++){var f;h[p]=s.asNestedTest({options:r,index:p,parent:d,parentPath:r.path,originalParent:(f=r.originalValue)!=null?f:t})}this.runTests({value:d,tests:h,originalValue:(u=r.originalValue)!=null?u:t,options:r},n,p=>i(p.concat(l),d))})}clone(t){const r=super.clone(t);return r.innerType=this.innerType,r}json(){return this.transform(ij)}concat(t){let r=super.concat(t);return r.innerType=this.innerType,t.innerType&&(r.innerType=r.innerType?r.innerType.concat(t.innerType):t.innerType),r}of(t){let r=this.clone();if(!Pg(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+qs(t));return r.innerType=t,r.spec=Object.assign({},r.spec,{types:t}),r}length(t,r=U0.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(n){return n.length===this.resolve(t)}})}min(t,r){return r=r||U0.min,this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(n){return n.length>=this.resolve(t)}})}max(t,r){return r=r||U0.max,this.test({message:r,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(n){return n.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,r)=>this._typeCheck(t)?t:r==null?[]:[].concat(r))}compact(t){let r=t?(n,i,o)=>!t(n,i,o):n=>!!n;return this.transform(n=>n!=null?n.filter(r):n)}describe(t){const r=(t?this.resolve(t):this).clone(),n=super.describe(t);if(r.innerType){var i;let o=t;(i=o)!=null&&i.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[0]})),n.innerType=r.innerType.describe(o)}return n}}afe.prototype=sj.prototype;var c7=function(e,t,r){if(e&&"reportValidity"in e){var n=We(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},aj=function(e,t){var r=function(i){var o=t.fields[i];o&&o.ref&&"reportValidity"in o.ref?c7(o.ref,i,e):o.refs&&o.refs.forEach(function(s){return c7(s,i,e)})};for(var n in t.fields)r(n)},lfe=function(e,t){t.shouldUseNativeValidation&&aj(e,t);var r={};for(var n in e){var i=We(t.fields,n),o=Object.assign(e[n]||{},{ref:i&&i.ref});if(cfe(t.names||Object.keys(e),n)){var s=Object.assign({},We(r,n));or(s,"root",o),or(r,n,s)}else or(r,n,o)}return r},cfe=function(e,t){return e.some(function(r){return r.startsWith(t+".")})};function dl(e,t,r){return t===void 0&&(t={}),r===void 0&&(r={}),function(n,i,o){try{return Promise.resolve(function(s,a){try{var l=(t.context,Promise.resolve(e[r.mode==="sync"?"validateSync":"validate"](n,Object.assign({abortEarly:!1},t,{context:i}))).then(function(d){return o.shouldUseNativeValidation&&aj({},o),{values:r.raw?n:d,errors:{}}}))}catch(d){return a(d)}return l&&l.then?l.then(void 0,a):l}(0,function(s){if(!s.inner)throw s;return{values:{},errors:lfe((a=s,l=!o.shouldUseNativeValidation&&o.criteriaMode==="all",(a.inner||[]).reduce(function(d,u){if(d[u.path]||(d[u.path]={message:u.message,type:u.type}),l){var h=d[u.path].types,f=h&&h[u.type];d[u.path]=DO(u.path,l,d,u.type,f?[].concat(f,u.message):u.message)}return d},{})),o)};var a,l}))}catch(s){return Promise.reject(s)}}}var Xa=[["Afghanistan","af","93"],["Albania","al","355"],["Algeria","dz","213"],["Andorra","ad","376"],["Angola","ao","244"],["Antigua and Barbuda","ag","1268"],["Argentina","ar","54","(..) ........",0],["Armenia","am","374",".. ......"],["Aruba","aw","297"],["Australia","au","61",{default:". .... ....","/^4/":"... ... ...","/^5(?!50)/":"... ... ...","/^1(3|8)00/":".... ... ...","/^13/":".. .. ..","/^180/":"... ...."}
154,0,[]],["Austria","at","43"],["Azerbaijan","az","994","(..) ... .. .."],["Bahamas","bs","1242"],["Bahrain","bh","973"],["Bangladesh","bd","880"],["Barbados","bb","1246"],["Belarus","by","375","(..) ... .. .."],["Belgium","be","32","... .. .. .."],["Belize","bz","501"],["Benin","bj","229"],["Bhutan","bt","975"],["Bolivia","bo","591"],["Bosnia and Herzegovina","ba","387"],["Botswana","bw","267"],["Brazil","br","55","(..) .....-...."],["British Indian Ocean Territory","io","246"],["Brunei","bn","673"],["Bulgaria","bg","359"],["Burkina Faso","bf","226"],["Burundi","bi","257"],["Cambodia","kh","855"],["Cameroon","cm","237"],["Canada","ca","1","(...) ...-....",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde","cv","238"],["Caribbean Netherlands","bq","599","",1],["Cayman Islands","ky","1","... ... ....",4,["345"]],["Central African Republic","cf","236"],["Chad","td","235"],["Chile","cl","56"],["China","cn","86","... .... ...."],["Colombia","co","57","... ... ...."],["Comoros","km","269"],["Congo","cd","243"],["Congo","cg","242"],["Costa Rica","cr","506","....-...."],["Côte d'Ivoire","ci","225",".. .. .. .. .."],["Croatia","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599","",0],["Cyprus","cy","357",".. ......"],["Czech Republic","cz","420","... ... ..."],["Denmark","dk","45",".. .. .. .."],["Djibouti","dj","253",".. .. ...."],["Dominica","dm","1767"],["Dominican Republic","do","1","(...) ...-....",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt","eg","20"],["El Salvador","sv","503","....-...."],["Equatorial Guinea","gq","240"],["Eritrea","er","291"],["Estonia","ee","372",".... ......"],["Ethiopia","et","251",".. ... ...."],["Fiji","fj","679"],["Finland","fi","358",".. ... .. .."],["France","fr","33",". .. .. .. .."],["French Guiana","gf","594"],["French Polynesia","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia","ge","995"],["Germany","de","49","... ........."],["Ghana","gh","233"],["Greece","gr","30"],["Greenland","gl","299",".. .. .."],["Grenada","gd","1473"],["Guadeloupe","gp","590","",0],["Guam","gu","1671"],["Guatemala","gt","502","....-...."],["Guinea","gn","224"],["Guinea-Bissau","gw","245"],["Guyana","gy","592"],["Haiti","ht","509","....-...."],["Honduras","hn","504"],["Hong Kong","hk","852",".... ...."],["Hungary","hu","36"],["Iceland","is","354","... ...."],["India","in","91",".....-....."],["Indonesia","id","62"],["Iran","ir","98","... ... ...."],["Iraq","iq","964"],["Ireland","ie","353",".. ......."],["Israel","il","972","... ... ...."],["Italy","it","39","... .......",0],["Jamaica","jm","1876"],["Japan","jp","81",".. .... ...."],["Jordan","jo","962"],["Kazakhstan","kz","7","... ...-..-..",0],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait","kw","965"],["Kyrgyzstan","kg","996","... ... ..."],["Laos","la","856"],["Latvia","lv","371",".. ... ..."],["Lebanon","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya","ly","218"],["Liechtenstein","li","423"],["Lithuania","lt","370"],["Luxembourg","lu","352"],["Macau","mo","853"],["Macedonia","mk","389"],["Madagascar","mg","261"],["Malawi","mw","265"],["Malaysia","my","60","..-....-...."],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania","mr","222"],["Mauritius","mu","230"],["Mayotte","yt","262","",1,["269","639"]],["Mexico","mx","52","... ... ....",0],["Micronesia","fm","691"],["Moldova","md","373","(..) ..-..-.."],["Monaco","mc","377"],["Mongolia","mn","976"],["Montenegro","me","382"],["Morocco","ma","212"],["Mozambique","mz","258"],["Myanmar","mm","95"],["Namibia","na","264"],["Nauru","nr","674"],["Nepal","np","977"],["Netherlands","nl","31",{"/^06/":"(.). .........","/^6/":". .........","/^0(10|13|14|15|20|23|24|26|30|33|35|36|38|40|43|44|45|46|50|53|55|58|70|71|72|73|74|75|76|77|78|79|82|84|85|87|88|91)/":"(.).. ........","/^(10|13|14|15|20|23|24|26|30|33|35|36|38|40|43|44|45|46|50|53|55|58|70|71|72|73|74|75|76|77|78|79|82|84|85|87|88|91)/":".. ........","/^0/":"(.)... .......",default:"... ......."}],["New Caledonia","nc","687"],["New Zealand","nz","64","...-...-...."],["Nicaragua","ni","505"],["Niger","ne","227"],["Nigeria","ng","234"],["North Korea","kp","850"],["Norway","no","47","... .. ..."],["Oman","om","968"],["Pakistan","pk","92","...-......."],["Palau","pw","680"],["Palestine","ps","970"],["Panama","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru","pe","51"],["Philippines","ph","63","... ... ...."],["Poland","pl","48","...-...-..."],["Portugal","pt","351"],["Puerto Rico","pr","1","(...) ...-....",3,["787","939"]],["Qatar","qa","974"],["Réunion","re","262","",0],["Romania","ro","40"],["Russia","ru","7","(...) ...-..-..",1],["Rwanda","rw","250"],["Saint Kitts and Nevis","kn","1869"],["Saint Lucia","lc","1758"],["Saint Vincent and the Grenadines","vc","1784"],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé and PrÃncipe","st","239"],["Saudi Arabia","sa","966"],["Senegal","sn","221"],["Serbia","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65","....-...."],["Slovakia","sk","421"],["Slovenia","si","386"],["Solomon Islands","sb","677"],["S
154omalia","so","252"],["South Africa","za","27"],["South Korea","kr","82","... .... ...."],["South Sudan","ss","211"],["Spain","es","34","... ... ..."],["Sri Lanka","lk","94"],["Sudan","sd","249"],["Suriname","sr","597"],["Swaziland","sz","268"],["Sweden","se","46","... ... ..."],["Switzerland","ch","41",".. ... .. .."],["Syria","sy","963"],["Taiwan","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tonga","to","676"],["Trinidad and Tobago","tt","1868"],["Tunisia","tn","216"],["Turkey","tr","90","... ... .. .."],["Turkmenistan","tm","993"],["Tuvalu","tv","688"],["Uganda","ug","256"],["Ukraine","ua","380","(..) ... .. .."],["United Arab Emirates","ae","971"],["United Kingdom","gb","44",".... ......"],["United States","us","1","(...) ...-....",0],["Uruguay","uy","598"],["Uzbekistan","uz","998",".. ... .. .."],["Vanuatu","vu","678"],["Vatican City","va","39",".. .... ....",1],["Venezuela","ve","58"],["Vietnam","vn","84"],["Yemen","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"]],ufe="react-international-phone-",lj=(...e)=>e.filter(t=>!!t).join(" ").trim(),dfe=(...e)=>lj(...e).split(" ").map(t=>`${ufe}${t}`).join(" "),Nn=({addPrefix:e,rawClassNames:t})=>lj(dfe(...e),...t),hfe=({value:e,mask:t,maskSymbol:r,offset:n=0,trimNonMaskCharsLeftover:i=!1})=>{if(e.length<n)return e;let o=e.slice(0,n),s=e.slice(n),a=o,l=0;for(let d of t.split("")){if(l>=s.length){if(!i&&d!==r){a+=d;continue}break}d===r?(a+=s[l],l+=1):a+=d}return a},Xc=e=>e?/^\d+$/.test(e):!1,Og=e=>e.replace(/\D/g,""),ffe=(e,t)=>{let r=e.style.display;r!=="block"&&(e.style.display="block");let n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),o=i.top-n.top,s=n.bottom-i.bottom;o>=0&&s>=0||(Math.abs(o)<Math.abs(s)?e.scrollTop+=o:e.scrollTop-=s),e.style.display=r},pfe=()=>typeof window>"u"?!1:window.navigator.userAgent.toLowerCase().includes("macintosh"),mfe=(e,t)=>{let r=t.disableDialCodeAndPrefix?!1:t.forceDialCode,n=t.disableDialCodeAndPrefix?!1:t.insertDialCodeOnEmpty,i=e,o=d=>t.trimNonDigitsEnd?d.trim():d;if(!i)return n&&!i.length||r?o(`${t.prefix}${t.dialCode}${t.charAfterDialCode}`):o(i);if(i=Og(i),i===t.dialCode&&!t.disableDialCodeAndPrefix)return o(`${t.prefix}${t.dialCode}${t.charAfterDialCode}`);if(t.dialCode.startsWith(i)&&!t.disableDialCodeAndPrefix)return o(r?`${t.prefix}${t.dialCode}${t.charAfterDialCode}`:`${t.prefix}${i}`);if(!i.startsWith(t.dialCode)&&!t.disableDialCodeAndPrefix){if(r)return o(`${t.prefix}${t.dialCode}${t.charAfterDialCode}`);if(i.length<t.dialCode.length)return o(`${t.prefix}${i}`)}let s=()=>{let d=t.dialCode.length,u=i.slice(0,d),h=i.slice(d);return{phoneLeftSide:u,phoneRightSide:h}},{phoneLeftSide:a,phoneRightSide:l}=s();return a=`${t.prefix}${a}${t.charAfterDialCode}`,l=hfe({value:l,mask:t.mask,maskSymbol:t.maskChar,trimNonMaskCharsLeftover:t.trimNonDigitsEnd||t.disableDialCodeAndPrefix&&l.length===0}),t.disableDialCodeAndPrefix&&(a=""),o(`${a}${l}`)},gfe=({phoneBeforeInput:e,phoneAfterInput:t,phoneAfterFormatted:r,cursorPositionAfterInput:n,leftOffset:i=0,deletion:o})=>{if(n<i)return i;if(!e)return r.length;let s=null;for(let u=n-1;u>=0;u-=1)if(Xc(t[u])){s=u;break}if(s===null){for(let u=0;u<t.length;u+=1)if(Xc(r[u]))return u;return t.length}let a=0;for(let u=0;u<s;u+=1)Xc(t[u])&&(a+=1);let l=0,d=0;for(let u=0;u<r.length&&(l+=1,Xc(r[u])&&(d+=1),!(d>=a+1));u+=1);if(o!=="backward")for(;!Xc(r[l])&&l<r.length;)l+=1;return l},V0=({phone:e,prefix:t})=>e?`${t}${Og(e)}`:"";function n_({value:e,country:t,insertDialCodeOnEmpty:r,trimNonDigitsEnd:n,countries:i,prefix:o,charAfterDialCode:s,forceDialCode:a,disableDialCodeAndPrefix:l,defaultMask:d,countryGuessingEnabled:u,disableFormatting:h}){let f=e;l&&(f=f.startsWith(`${o}`)?f:`${o}${t.dialCode}${f}`);let p=u?Cfe({phone:f,countries:i,currentCountryIso2:t==null?void 0:t.iso2}):void 0,m=(p==null?void 0:p.country)??t,g=mfe(f,{prefix:o,mask:Efe({phone:f,country:m,defaultMask:d,disableFormatting:h}),maskChar:cj,dialCode:m.dialCode,trimNonDigitsEnd:n,charAfterDialCode:s,forceDialCode:a,insertDialCodeOnEmpty:r,disableDialCodeAndPrefix:l}),y=u&&!(p!=null&&p.fullDialCodeMatch)?t:m;return{phone:V0({phone:l?`${y.dialCode}${g}`:g,prefix:o}),inputValue:g,country:y}}var vfe=e=>{if((e==null?void 0:e.toLocaleLowerCase().includes("delete"))??!1)return e!=null&&e.toLocaleLowerCase().includes("forward")?"forward":"backward"},yfe=(e,{country:t,insertDialCodeOnEmpty:r,phoneBeforeInput:n,prefix:i,charAfterDialCode:o,forceDialCode:s,disableDialCodeAndPrefix:a,countryGuessingEnabled:l,defaultMask:d,disableFormatting:u,countries:h})=>{let f=e.nativeEvent,p=f.inputType,m=vfe(p),g=!!(p!=null&&p.startsWith("insertFrom")),y=p==="insertText",b=(f==null?void 0:f.data)||void 0,E=e.target.value,S=e.target.selectionStart??0;if(p!=null&&p.includes("history"))return{inputValue:n,phone:V0({phone:n,prefix:i}),cursorPosition:n.length,country:t};if(y&&!Xc(b)&&E!==i)return{inputValue:n,phone:V0({phone:a?`${t.dialCode}${n}`:n,prefix:i}),cursorPosition:S-((b==null?void 0:b.length)??0),country:t};if(s&&!E.startsWith(`${i}${t.dialCode}`)&&!g){let x=E?n:`${i}${t.dialCode}${o}`;return{inputValue:x,phone:V0({phone:x,prefix:i}),cursorPosition:i.length+t.dialCode.length+o.length,country:t}}let{phone:k,inputValue:A,country:w}=n_({value:E,country:t,trimNonDigitsEnd:m==="backward",insertDialCodeOnEmpty:r,countryGuessingEnabled:l,countries:h,prefix:i,charAfterDialCode:o,forceDialCode:s,disableDialCodeAndPrefix:a,disableFormatting:u,defaultMask:d}),_=gfe({cursorPositionAfterInput:S,phoneBeforeInput:n,phoneAfterInput:E,phoneAfterFormatted:A,leftOffset:s?i.length+t.dialCode.length+o.length:0,deletion:m});
154return{phone:k,inputValue:A,cursorPosition:_,country:w}},_fe=(e,t)=>{let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let i of r)if(e[i]!==t[i])return!1;return!0},bfe=()=>{let e=v.useRef(),t=v.useRef(Date.now());return{check:()=>{let r=Date.now(),n=e.current?r-t.current:void 0;return e.current=t.current,t.current=r,n}}},xfe={size:20,overrideLastItemDebounceMS:-1};function wfe(e,t){let{size:r,overrideLastItemDebounceMS:n,onChange:i}={...xfe,...t},[o,s]=v.useState(e),[a,l]=v.useState([o]),[d,u]=v.useState(0),h=bfe();return[o,(f,p)=>{if(typeof f=="object"&&typeof o=="object"&&_fe(f,o)||f===o)return;let m=n>0,g=h.check(),y=m&&g!==void 0?g>n:!0;if((p==null?void 0:p.overrideLastItem)!==void 0?p.overrideLastItem:!y)l(b=>[...b.slice(0,d),f]);else{let b=a.length>=r;l(E=>[...E.slice(b?1:0,d+1),f]),b||u(E=>E+1)}s(f),i==null||i(f)},()=>{if(d<=0)return{success:!1};let f=a[d-1];return s(f),u(p=>p-1),i==null||i(f),{success:!0,value:f}},()=>{if(d+1>=a.length)return{success:!1};let f=a[d+1];return s(f),u(p=>p+1),i==null||i(f),{success:!0,value:f}}]}var cj=".",zi={defaultCountry:"us",value:"",prefix:"+",defaultMask:"............",charAfterDialCode:" ",historySaveDebounceMS:200,disableCountryGuess:!1,disableDialCodePrefill:!1,forceDialCode:!1,disableDialCodeAndPrefix:!1,disableFormatting:!1,countries:Xa,preferredCountries:[]},uj=({defaultCountry:e=zi.defaultCountry,value:t=zi.value,countries:r=zi.countries,prefix:n=zi.prefix,defaultMask:i=zi.defaultMask,charAfterDialCode:o=zi.charAfterDialCode,historySaveDebounceMS:s=zi.historySaveDebounceMS,disableCountryGuess:a=zi.disableCountryGuess,disableDialCodePrefill:l=zi.disableDialCodePrefill,forceDialCode:d=zi.forceDialCode,disableDialCodeAndPrefix:u=zi.disableDialCodeAndPrefix,disableFormatting:h=zi.disableFormatting,onChange:f,inputRef:p})=>{let m={countries:r,prefix:n,charAfterDialCode:o,forceDialCode:u?!1:d,disableDialCodeAndPrefix:u,defaultMask:i,countryGuessingEnabled:!a,disableFormatting:h},g=v.useRef(null),y=p||g,b=M=>{Promise.resolve().then(()=>{var U;typeof window>"u"||y.current!==(document==null?void 0:document.activeElement)||((U=y.current)==null||U.setSelectionRange(M,M))})},[{phone:E,inputValue:S,country:k},A,w,_]=wfe(()=>{let M=du({value:e,field:"iso2",countries:r});M||console.error(`[react-international-phone]: can not find a country with "${e}" iso2 code`);let U=M||du({value:"us",field:"iso2",countries:r}),{phone:$,inputValue:j,country:q}=n_({value:t,country:U,insertDialCodeOnEmpty:!l,...m});return b(j.length),{phone:$,inputValue:j,country:q.iso2}},{overrideLastItemDebounceMS:s,onChange:({inputValue:M,phone:U,country:$})=>{if(!f)return;let j=x($);f({phone:U,inputValue:M,country:j})}}),x=v.useCallback(M=>du({value:M,field:"iso2",countries:r}),[r]),C=v.useMemo(()=>x(k),[k,x]);v.useEffect(()=>{let M=y.current;if(!M)return;let U=$=>{if(!$.key)return;let j=$.ctrlKey,q=$.metaKey,W=$.shiftKey;if($.key.toLowerCase()==="z"){if(pfe()){if(!q)return}else if(!j)return;W?_():w()}};return M.addEventListener("keydown",U),()=>{M.removeEventListener("keydown",U)}},[y,w,_]);let P=M=>{M.preventDefault();let{phone:U,inputValue:$,country:j,cursorPosition:q}=yfe(M,{country:C,phoneBeforeInput:S,insertDialCodeOnEmpty:!1,...m});return A({inputValue:$,phone:U,country:j.iso2}),b(q),t},I=(M,U={focusOnInput:!1})=>{let $=du({value:M,field:"iso2",countries:r});if(!$){console.error(`[react-international-phone]: can not find a country with "${M}" iso2 code`);return}let j=u?"":`${n}${$.dialCode}${o}`;A({inputValue:j,phone:`${n}${$.dialCode}`,country:$.iso2}),U.focusOnInput&&Promise.resolve().then(()=>{var q;(q=y.current)==null||q.focus()})},[O,D]=v.useState(!1);return v.useEffect(()=>{if(!O){D(!0),t!==E&&(f==null||f({inputValue:S,phone:E,country:C}));return}if(t===E)return;let{phone:M,inputValue:U,country:$}=n_({value:t,country:C,insertDialCodeOnEmpty:!l,...m});A({phone:M,inputValue:U,country:$.iso2})},[t]),{phone:E,inputValue:S,country:C,setCountry:I,handlePhoneValueChange:P,inputRef:y}},Efe=({phone:e,country:t,defaultMask:r="............",disableFormatting:n=!1})=>{let i=t.format,o=a=>n?a.replace(new RegExp(`[^${cj}]`,"g"),""):a;if(!i)return o(r);if(typeof i=="string")return o(i);if(!i.default)return console.error(`[react-international-phone]: default mask for ${t.iso2} is not provided`),o(r);let s=Object.keys(i).find(a=>{if(a==="default")return!1;if(!(a.charAt(0)==="/"&&a.charAt(a.length-1)==="/"))return console.error(`[react-international-phone]: format regex "${a}" for ${t.iso2}
154 is not valid`),!1;let l=new RegExp(a.substring(1,a.length-1)),d=e.replace(t.dialCode,"");return l.test(Og(d))});return o(s?i[s]:i.default)},wo=e=>{let[t,r,n,i,o,s]=e;return{name:t,iso2:r,dialCode:n,format:i,priority:o,areaCodes:s}},Sfe=e=>`Field "${e}" is not supported`,du=({field:e,value:t,countries:r=Xa})=>{if(["priority"].includes(e))throw new Error(Sfe(e));let n=r.find(i=>{let o=wo(i);return t===o[e]});if(n)return wo(n)},Cfe=({phone:e,countries:t=Xa,currentCountryIso2:r})=>{var a;let n={country:void 0,fullDialCodeMatch:!1};if(!e)return n;let i=Og(e);if(!i)return n;let o=n,s=({country:l,fullDialCodeMatch:d})=>{var f,p;let u=l.dialCode===((f=o.country)==null?void 0:f.dialCode),h=(l.priority??0)<(((p=o.country)==null?void 0:p.priority)??0);(!u||h)&&(o={country:l,fullDialCodeMatch:d})};for(let l of t){let d=wo(l),{dialCode:u,areaCodes:h}=d;if(i.startsWith(u)){let f=o.country?Number(u)>=Number(o.country.dialCode):!0;if(h){let p=i.substring(u.length);for(let m of h)if(p.startsWith(m))return{country:d,fullDialCodeMatch:!0}}(f||u===i||!o.fullDialCodeMatch)&&s({country:d,fullDialCodeMatch:!0})}o.fullDialCodeMatch||i.length<u.length&&u.startsWith(i)&&(!o.country||Number(u)<=Number(o.country.dialCode))&&s({country:d,fullDialCodeMatch:!1})}if(r){let l=du({value:r,field:"iso2",countries:t});if(!l)return o;let d=l?(u=>{if(!(u!=null&&u.areaCodes))return!1;let h=i.substring(u.dialCode.length);return u.areaCodes.some(f=>f.startsWith(h))})(l):!1;o&&((a=o.country)==null?void 0:a.dialCode)===l.dialCode&&o.country!==l&&o.fullDialCodeMatch&&(!l.areaCodes||d)&&(o={country:l,fullDialCodeMatch:!0})}return o},Tfe=(e,t)=>{let r=parseInt(e,16);return Number(r+t).toString(16)},Afe="abcdefghijklmnopqrstuvwxyz",kfe="1f1e6",u7=Afe.split("").reduce((e,t,r)=>({...e,[t]:Tfe(kfe,r)}),{}),Rfe=e=>[u7[e[0]],u7[e[1]]].join("-"),Ch=({iso2:e,size:t,src:r,protocol:n="https",disableLazyLoading:i,className:o,style:s,...a})=>{if(!e)return Ee.createElement("img",{className:Nn({addPrefix:["flag-emoji"],rawClassNames:[o]}),width:t,height:t,...a});let l=()=>{if(r)return r;let d=Rfe(e);return`${n}://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/svg/${d}.svg`};return Ee.createElement("img",{className:Nn({addPrefix:["flag-emoji"],rawClassNames:[o]}),src:l(),width:t,height:t,draggable:!1,"data-country":e,loading:i?void 0:"lazy",style:{width:t,height:t,...s},alt:"",...a})},Ife=1e3,Pfe=({show:e,dialCodePrefix:t="+",selectedCountry:r,countries:n=Xa,preferredCountries:i=[],flags:o,onSelect:s,onClose:a,...l})=>{let d=v.useRef(null),u=v.useRef(),h=v.useMemo(()=>{if(!i||!i.length)return n;let w=[],_=[...n];for(let x of i){let C=_.findIndex(P=>wo(P).iso2===x);if(C!==-1){let P=_.splice(C,1)[0];w.push(P)}}return w.concat(_)},[n,i]),f=v.useRef({updatedAt:void 0,value:""}),p=w=>{let _=f.current.updatedAt&&new Date().getTime()-f.current.updatedAt.getTime()>Ife;f.current={value:_?w:`${f.current.value}${w}`,updatedAt:new Date};let x=h.findIndex(C=>wo(C).name.toLowerCase().startsWith(f.current.value));x!==-1&&y(x)},m=v.useCallback(w=>h.findIndex(_=>wo(_).iso2===w),[h]),[g,y]=v.useState(m(r)),b=()=>{u.current!==r&&y(m(r))},E=v.useCallback(w=>{y(m(w.iso2)),s==null||s(w)},[s,m]),S=w=>{let _=h.length-1,x=C=>w==="prev"?C-1:w==="next"?C+1:w==="last"?_:0;y(C=>{let P=x(C);return P<0?0:P>_?_:P})},k=w=>{if(w.stopPropagation(),w.key==="Enter"){w.preventDefault();let _=wo(h[g]);E(_);return}if(w.key==="Escape"){a==null||a();return}if(w.key==="ArrowUp"){w.preventDefault(),S("prev");return}if(w.key==="ArrowDown"){w.preventDefault(),S("next");return}if(w.key==="PageUp"){w.preventDefault(),S("first");return}if(w.key==="PageDown"){w.preventDefault(),S("last");return}w.key===" "&&w.preventDefault(),w.key.length===1&&!w.altKey&&!w.ctrlKey&&!w.metaKey&&p(w.key.toLocaleLowerCase())},A=v.useCallback(()=>{if(!d.current||g===void 0)return;let w=wo(h[g]).iso2;if(w===u.current)return;let _=d.current.querySelector(`[data-country="${w}"]`);_&&(ffe(d.current,_),u.current=w)},[g,h]);return v.useEffect(()=>{A()},[g,A]),v.useEffect(()=>{d.current&&(e?d.current.focus():b())},[e]),v.useEffect(()=>{b()},[r]),Ee.createElement("ul",{ref:d,role:"listbox",className:Nn({addPrefix:["country-selector-dropdown"],rawClassNames:[l.className]}),style:{display:e?"block":"none",...l.style},onKeyDown:k,onBlur:a,tabIndex:-1,"aria-activedescendant":`react-international-phone__${wo(h[g]).iso2}-option`},h.map((w,_)=>{let x=wo(w),C=x.iso2===r,P=_===g,I=i.includes(x.iso2),O=_===i.length-1,D=o==null?void 0:o.find(M=>M.iso2===x.iso2);return Ee.createElement(Ee.Fragment,{key:x.iso2},Ee.createElement("li",{"data-country":x.iso2,role:"option","aria-selected":C,"aria-label":`${x.name} ${t}${x.dialCode}`,id:`react-international-phone__${x.iso2}-option`,className:Nn({addPrefix:["country-selector-dropdown__list-item",I&&"country-selector-dropdown__list-item--preferred",C&&"country-selector-dropdown__list-item--selected",P&&"country-selector-dropdown__list-item--focused"],rawClassNames:[l.listItemClassName]}),onClick:()=>E(x),style:l.listItemStyle,title:x.name},Ee.createElement(Ch,{iso2:x.iso2,src:D==null?void 0:D.src,className:Nn({addPrefix:["country-selector-dropdown__list-item-flag-emoji"],rawClassNames:[l.listItemFlagClassName]}),style:l.listItemFlagStyle}),Ee.createElement("span",{className:Nn({addPrefix:["country-selector-dropdown__list-item-country-name"],rawClassNames:[l.listItemCountryNameClassName]}),style:l.listItemCountryNameStyle},x.name),Ee.createElement("span",{className:Nn({addPrefix:["country-selector-dropdown__list-item-dial-code"],rawClassNames:[l.listItemDialCodeClassName]}),style:l.listItemDialCodeStyle},t,x.dialCode)),O?Ee.createElement("hr",{className:Nn({addPrefix:["country-selector-dropdown__preferred-list-divider"],rawClassNames:[l.preferredListDividerClassName]}),style:l.preferredListDividerStyle}):null)}))},Ofe=({selectedCountry:e,onSelect:t,disabled:r,hideDropdown:n,countries:i=Xa,preferredCountries:o=[],flags:s,renderButtonWrapper:a,...l})=>{let[d,u]=v.useState(!1),h=v.useMemo(()=>
154{if(e)return du({value:e,field:"iso2",countries:i})},[i,e]),f=v.useRef(null),p=g=>{g.key&&["ArrowUp","ArrowDown"].includes(g.key)&&(g.preventDefault(),u(!0))},m=()=>{var b;let g={title:h==null?void 0:h.name,onClick:()=>u(E=>!E),onMouseDown:E=>E.preventDefault(),onKeyDown:p,disabled:n||r,role:"combobox","aria-label":"Country selector","aria-haspopup":"listbox","aria-expanded":d},y=Ee.createElement("div",{className:Nn({addPrefix:["country-selector-button__button-content"],rawClassNames:[l.buttonContentWrapperClassName]}),style:l.buttonContentWrapperStyle},Ee.createElement(Ch,{iso2:e,src:(b=s==null?void 0:s.find(E=>E.iso2===e))==null?void 0:b.src,className:Nn({addPrefix:["country-selector-button__flag-emoji",r&&"country-selector-button__flag-emoji--disabled"],rawClassNames:[l.flagClassName]}),style:{visibility:e?"visible":"hidden",...l.flagStyle}}),!n&&Ee.createElement("div",{className:Nn({addPrefix:["country-selector-button__dropdown-arrow",r&&"country-selector-button__dropdown-arrow--disabled",d&&"country-selector-button__dropdown-arrow--active"],rawClassNames:[l.dropdownArrowClassName]}),style:l.dropdownArrowStyle}));return a?a({children:y,rootProps:g}):Ee.createElement("button",{...g,type:"button",className:Nn({addPrefix:["country-selector-button",d&&"country-selector-button--active",r&&"country-selector-button--disabled",n&&"country-selector-button--hide-dropdown"],rawClassNames:[l.buttonClassName]}),"data-country":e,style:l.buttonStyle},y)};return Ee.createElement("div",{className:Nn({addPrefix:["country-selector"],rawClassNames:[l.className]}),style:l.style,ref:f},m(),Ee.createElement(Pfe,{show:d,countries:i,preferredCountries:o,flags:s,onSelect:g=>{u(!1),t==null||t(g)},selectedCountry:e,onClose:()=>{u(!1)},...l.dropdownStyleProps}))},jfe=({dialCode:e,prefix:t,disabled:r,style:n,className:i})=>Ee.createElement("div",{className:Nn({addPrefix:["dial-code-preview",r&&"dial-code-preview--disabled"],rawClassNames:[i]}),style:n},`${t}${e}`);v.forwardRef(({value:e,onChange:t,countries:r=Xa,preferredCountries:n=[],hideDropdown:i,showDisabledDialCodeAndPrefix:o,disableFocusAfterCountrySelect:s,flags:a,style:l,className:d,inputStyle:u,inputClassName:h,countrySelectorStyleProps:f,dialCodePreviewStyleProps:p,inputProps:m,placeholder:g,disabled:y,name:b,onFocus:E,onBlur:S,required:k,autoFocus:A,...w},_)=>{let{phone:x,inputValue:C,inputRef:P,country:I,setCountry:O,handlePhoneValueChange:D}=uj({value:e,countries:r,...w,onChange:U=>{t==null||t(U.phone,{country:U.country,inputValue:U.inputValue})}}),M=w.disableDialCodeAndPrefix&&o&&(I==null?void 0:I.dialCode);return v.useImperativeHandle(_,()=>P.current?Object.assign(P.current,{setCountry:O,state:{phone:x,inputValue:C,country:I}}):null,[P,O,x,C,I]),Ee.createElement("div",{ref:_,className:Nn({addPrefix:["input-container"],rawClassNames:[d]}),style:l},Ee.createElement(Ofe,{onSelect:U=>O(U.iso2,{focusOnInput:!s}),flags:a,selectedCountry:I.iso2,countries:r,preferredCountries:n,disabled:y,hideDropdown:i,...f}),M&&Ee.createElement(jfe,{dialCode:I.dialCode,prefix:w.prefix??"+",disabled:y,...p}),Ee.createElement("input",{onChange:D,value:C,type:"tel",ref:P,className:Nn({addPrefix:["input",y&&"input--disabled"],rawClassNames:[h]}),placeholder:g,disabled:y,style:u,name:b,onFocus:E,onBlur:S,autoFocus:A,required:k,...m}))});const Lfe=e=>{if(!e)return;const t=typeof e=="string"?e:e.default;return t?t.replace(/\./g,"9"):void 0},dj=({value:e,onChange:t,lockPrefix:r=!1,...n})=>{const i=Ee.useMemo(()=>e?e.startsWith("+")?e:`+${e}`:"",[e]),{inputValue:o,handlePhoneValueChange:s,inputRef:a,country:l,setCountry:d}=uj({defaultCountry:"br",value:i,countries:Xa,disableDialCodeAndPrefix:r,onChange:h=>{const f=h.phone.startsWith("+")?h.phone.substring(1):h.phone.replace(/\D/g,"");if(f===h.country.dialCode){t("");return}t(f)}}),u=Lfe(l.format);return c.jsx(Ci,{variant:"outlined",label:"Telefone",color:"primary",placeholder:u??"Telefone",value:o,onChange:s,type:"tel",inputRef:a,InputProps:{startAdornment:c.jsx(Us,{position:"start",style:{marginRight:"2px",marginLeft:"-8px"},children:c.jsx(X0,{MenuProps:{style:{height:"300px",width:"360px",top:"10px",left:"-34px"},transformOrigin:{vertical:"top",horizontal:"left"}},sx:{width:"max-content",fieldset:{display:"none"},...r?{}
154:{'&.Mui-focused:has(div[aria-expanded="false"])':{fieldset:{display:"block"}}},".MuiSelect-select":{padding:"8px",paddingRight:"24px !important",display:"flex",alignItems:"center"},svg:{right:0}},value:l.iso2,onChange:h=>d(h.target.value),renderValue:h=>r?c.jsxs(F,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:"6px",font:"inherit",color:"text.primary"},children:[c.jsx(Ch,{iso2:h,style:{display:"flex"}}),c.jsxs("span",{children:["+",l.dialCode]})]}):c.jsx(Ch,{iso2:h,style:{display:"flex"}}),children:Xa.map(h=>{const f=wo(h);return c.jsxs(Mt,{value:f.iso2,children:[c.jsx(Ch,{iso2:f.iso2,style:{marginRight:"8px"}}),c.jsx(V,{marginRight:"8px",children:f.name}),c.jsxs(V,{color:"gray",children:["+",f.dialCode]})]},f.iso2)})})})},...n})},hj=e=>{const r=`+${e.replace(/\D/g,"")}`;try{return SI(r).isValid()}catch{return!1}},vCe=e=>e.replace(/\D/g,""),yCe=e=>{let t=e.replace(/\D/g,"");return(t.startsWith("015")||t.startsWith("021"))&&(t=t.slice(3)),t=t.replace(/^0+/,""),!t.startsWith("55")&&(t.length===10||t.length===11)&&(t="55"+t),t},$fe=ca().shape({phone:no().required("O número de telefone é obrigatório").test("is-valid-phone","Número de telefone inválido",e=>hj(e||""))});function Dfe({onNext:e,initialValue:t=""}){const[r,n]=v.useState(!1),[i,o]=v.useState(null),{control:s,handleSubmit:a,reset:l,formState:{errors:d}}=cl({resolver:dl($fe),defaultValues:{phone:t}});v.useEffect(()=>{t&&l({phone:t})},[t,l]);const u=h=>{n(!0),o(null);const f=h.phone;pe(fe.REGISTRATION.STEP_PHONE,{phoneProvided:!0,phone:f,phoneDigits:f.length,isEdit:!!t,savedToLocalStorage:!0,timestamp:new Date().toISOString()}),e(f),n(!1)};return c.jsxs(ki,{children:[c.jsxs(F,{children:[c.jsx(V,{variant:"h5",fontWeight:600,gutterBottom:!0,children:"Qual seu número de telefone?"}),c.jsx(V,{variant:"body1",color:"text.secondary",gutterBottom:!0,children:"Este número será usado para comunicação sobre seus pedidos."})]}),c.jsx(me,{spacing:3,children:c.jsx(rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},children:c.jsx(ss,{name:"phone",control:s,render:({field:{ref:h,value:f,onChange:p,onBlur:m}})=>{var g;return c.jsx(dj,{inputRef:h,value:f||"",onChange:p,onBlur:m,disabled:r,lockPrefix:!0,autoFocus:!0,fullWidth:!0,label:"Número de telefone",error:!!d.phone||!!i,helperText:((g=d.phone)==null?void 0:g.message)||i,sx:{".MuiOutlinedInput-root":{borderRadius:2},".MuiOutlinedInput-input":{borderRadius:2}}})}})})}),c.jsx(De,{fullWidth:!0,variant:"contained",size:"large",onClick:a(u),disabled:r,sx:{borderRadius:2,py:1.5},children:r?c.jsxs(c.Fragment,{children:[c.jsx(bn,{size:20,sx:{mr:1}}),"Salvando..."]}):"Continuar"})]})}const fj="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20%3e%3cpath%20d='M19.6%2010.2271C19.6%209.51804%2019.5364%208.83624%2019.4182%208.18164H10V12.0498H15.3818C15.15%2013.2998%2014.4455%2014.3589%2013.3864%2015.068V17.5771H16.6182C18.5091%2015.8362%2019.6%2013.2725%2019.6%2010.2271Z'%20fill='%234285F4'%20/%3e%3cpath%20d='M9.99988%2020.0004C12.6999%2020.0004%2014.9635%2019.1049%2016.618%2017.5777L13.3862%2015.0686C12.4908%2015.6686%2011.3453%2016.0231%209.99988%2016.0231C7.39528%2016.0231%205.19078%2014.264%204.40438%2011.9004H1.06348V14.4913C2.70898%2017.7595%206.09078%2020.0004%209.99988%2020.0004Z'%20fill='%2334A853'%20/%3e%3cpath%20d='M4.4045%2011.8997C4.2045%2011.2997%204.0909%2010.6588%204.0909%209.99969C4.0909%209.34059%204.2045%208.69969%204.4045%208.09969V5.50879H1.0636C0.3864%206.85879%200%208.38609%200%209.99969C0%2011.6133%200.3864%2013.1406%201.0636%2014.4906L4.4045%2011.8997Z'%20fill='%23FBBC04'%20/%3e%3cpath%20d='M9.99988%203.9773C11.468%203.9773%2012.7862%204.4818%2013.8226%205.4727L16.6908%202.6045C14.959%200.9909%2012.6953%200%209.99988%200C6.09078%200%202.70898%202.2409%201.06348%205.5091L4.40438%208.1C5.19078%205.7364%207.39528%203.9773%209.99988%203.9773Z'%20fill='%23E94235'%20/%3e%3c/svg%3e",co=()=>Et({staleTime:1e3*60*60*2,queryKey:["public-vars"],queryFn:async()=>{const{data:e,error:t}=await Te.from("app_public_vars").select("*");if(t)throw t;return(e==null?void 0:e.reduce((n,i)=>
154(n[i.key]=i.value,n),{}))||{}}}),Mfe=ca().shape({email:no().required("E-mail é obrigatório").email("E-mail inválido")});function Nfe({onNext:e,phone:t}){const[r,n]=v.useState(null),[i,o]=v.useState(!1),[s,a]=v.useState(null),{data:l}=co(),d=qe.getPlatform()==="ios",u=(l==null?void 0:l.ENABLE_GOOGLE_LOGIN)==="true"&&!d,h=(l==null?void 0:l.ENABLE_MAGIC_LINK_LOGIN)==="true",{control:f,handleSubmit:p,formState:{errors:m}}=cl({resolver:dl(Mfe),defaultValues:{email:""}}),g=S=>{n(S),a(null),pe(fe.REGISTRATION.AUTH_METHOD_SELECTED,{method:S,phone:t.replace(/\d(?=\d{4})/g,"*"),timestamp:new Date().toISOString()})},y=()=>{o(!0),pe(fe.REGISTRATION.SMS_AUTH_SELECTED,{phone:t.replace(/\d(?=\d{4})/g,"*"),timestamp:new Date().toISOString()}),e("sms")},b=async()=>{o(!0),a(null);try{pe(fe.REGISTRATION.GOOGLE_AUTH_SELECTED,{phone:t.replace(/\d(?=\d{4})/g,"*"),timestamp:new Date().toISOString()});const{signInWithGoogle:S}=await X(()=>Promise.resolve().then(()=>$A),void 0),A=await S("https://app.stoqui.com.br/auth/register?step=7&google_verified=true");A.user&&A.user.email?(pe(fe.REGISTRATION.GOOGLE_AUTH_SUCCESS,{email:A.user.email,phone:t.replace(/\d(?=\d{4})/g,"*"),timestamp:new Date().toISOString()}),e("google",{email:A.user.email})):pe(fe.REGISTRATION.GOOGLE_AUTH_SUCCESS,{phone:t.replace(/\d(?=\d{4})/g,"*"),platform:"web",timestamp:new Date().toISOString()})}catch(S){if(S.message&&S.message.toLowerCase().includes("cancelled by user")){o(!1);return}pe(fe.REGISTRATION.GOOGLE_AUTH_ERROR,{error:S.message||"Unknown error",phone:t.replace(/\d(?=\d{4})/g,"*"),timestamp:new Date().toISOString()}),a(`Erro ao conectar com Google: ${S.message}`),o(!1)}},E=async S=>{o(!0),a(null);try{const w=`https://app.stoqui.com.br/auth/register?step=${new URL(window.location.href).searchParams.get("step")||"7"}&email_verified=true`,{error:_}=await Te.auth.signInWithOtp({email:S.email,options:{shouldCreateUser:!0,emailRedirectTo:w}});_?(pe(fe.REGISTRATION.EMAIL_AUTH_ERROR,{error:_.message,errorCode:_.code||"unknown",email:S.email,phone:t.replace(/\d(?=\d{4})/g,"*"),timestamp:new Date().toISOString()}),a(`Erro ao enviar link: ${_.message}`),o(!1)):(pe(fe.REGISTRATION.EMAIL_AUTH_SENT,{email:S.email,phone:t.replace(/\d(?=\d{4})/g,"*"),timestamp:new Date().toISOString()}),e("email",{email:S.email}))}catch{pe(fe.REGISTRATION.EMAIL_AUTH_ERROR,{error:"Unexpected error",email:S.email,phone:t.replace(/\d(?=\d{4})/g,"*"),timestamp:new Date().toISOString()}),a("Ocorreu um erro ao enviar o link de confirmação"),o(!1)}};return c.jsxs(ki,{children:[c.jsxs(F,{children:[c.jsx(V,{variant:"h5",fontWeight:600,gutterBottom:!0,children:"Como você gostaria de confirmar sua conta?"}),c.jsxs(V,{variant:"body1",color:"text.secondary",gutterBottom:!0,children:["Registramos seu telefone ",Hu(t),". Agora escolha como prefere receber sua confirmação:"]})]}),c.jsxs(me,{spacing:3,children:[s&&c.jsx(rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:c.jsx(J0,{error:!0,children:s})}),!r&&c.jsxs(c.Fragment,{children:[u&&c.jsx(rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},children:c.jsx(sh,{sx:{cursor:i?"not-allowed":"pointer",transition:"all 0.2s ease-in-out",opacity:i?.6:1,"&:hover":i?{}:{transform:"translateY(-2px)",boxShadow:3},pointerEvents:i?"none":"auto"},onClick:i?void 0:b,children:c.jsxs(v0,{sx:{display:"flex",alignItems:"center",gap:2,py:3},children:[i?c.jsx(bn,{size:32}):c.jsx("img",{src:fj,alt:"Google",style:{width:32,height:32}}),c.jsxs(F,{sx:{flex:1},children:[c.jsx(V,{variant:"h6",fontWeight:600,children:"Continuar com Google"}),c.jsx(V,{variant:"body2",color:"text.secondary",children:i?"Aguarde enquanto redirecionamos você...":"Use sua conta Google para entrar rapidamente"})]})]})})}),h&&c.jsx(rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:u?.2:.1},children:c.jsx(sh,{sx:{cursor:i?"not-allowed":"pointer",transition:"all 0.2s ease-in-out",opacity:i?.4:1,"&:hover":i?{}:{transform:"translateY(-2px)",boxShadow:3},pointerEvents:i?"none":"auto"},onClick:i?void 0:()=>g("email"),children:c.jsxs(v0,{sx:{display:"flex",alignItems:"center",gap:2,py:3},children:[c.jsx(I_,{color:"primary",sx:{fontSize:32}}),c.jsxs(F,{sx:{flex:1},children:[c.jsx(V,{variant:"h6",fontWeight:600,children:"Link por e-mail"}),c.jsx(V,{variant:"body2",color:"text.secondary",children:"Receba um link no seu e-mail para entrar na sua conta"})]})]})})}),c.jsx(rt.div,{initial:{opacity:0,y:20}
154,animate:{opacity:1,y:0},transition:{delay:u&&h?.3:u||h?.2:.1},children:c.jsx(sh,{sx:{cursor:i?"not-allowed":"pointer",transition:"all 0.2s ease-in-out",opacity:i?.4:1,"&:hover":i?{}:{transform:"translateY(-2px)",boxShadow:3},pointerEvents:i?"none":"auto"},onClick:i?void 0:()=>g("sms"),children:c.jsxs(v0,{sx:{display:"flex",alignItems:"center",gap:2,py:3},children:[c.jsx(Rf,{color:"primary",sx:{fontSize:32}}),c.jsxs(F,{sx:{flex:1},children:[c.jsx(V,{variant:"h6",fontWeight:600,children:"Código por WhatsApp"}),c.jsx(V,{variant:"body2",color:"text.secondary",children:"Receba um código de verificação no seu WhatsApp"})]})]})})})]}),r==="email"&&c.jsx(rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},children:c.jsxs(me,{spacing:2,children:[c.jsx(V,{variant:"h6",fontWeight:600,children:"Digite seu e-mail"}),c.jsx(ss,{name:"email",control:f,render:({field:S})=>{var k;return c.jsx(Ci,{...S,fullWidth:!0,autoFocus:!0,variant:"outlined",label:"E-mail",error:!!m.email,helperText:(k=m.email)==null?void 0:k.message,placeholder:"[email protected]",type:"email",autoComplete:"email",sx:{".MuiOutlinedInput-root":{borderRadius:2},".MuiOutlinedInput-input":{borderRadius:2}}})}}),s&&c.jsx(J0,{error:!0,children:s}),c.jsxs(F,{sx:{display:"flex",gap:2},children:[c.jsx(De,{variant:"outlined",onClick:()=>n(null),disabled:i,sx:{flex:1},children:"Voltar"}),c.jsx(De,{variant:"contained",onClick:p(E),disabled:i,sx:{flex:2},children:i?"Enviando...":"Enviar link"})]})]})}),r==="sms"&&c.jsx(rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},children:c.jsxs(me,{spacing:2,children:[c.jsx(V,{variant:"h6",fontWeight:600,children:"Confirmar número de telefone"}),c.jsxs(V,{variant:"body2",color:"text.secondary",children:["Enviaremos um código de verificação por WhatsApp para"," ",Hu(t)]}),c.jsxs(F,{sx:{display:"flex",gap:2},children:[c.jsx(De,{variant:"outlined",onClick:()=>n(null),disabled:i,sx:{flex:1},children:"Voltar"}),c.jsx(De,{variant:"contained",onClick:y,disabled:i,sx:{flex:2},children:i?"Enviando...":"Enviar código"})]})]})})]})]})}const Ffe=ni(Ci)` 155 input { 156 text-align: center; 157 } 158`,Ufe={TextFieldStyled:Ffe},Bfe=e=>c.jsx(Ufe.TextFieldStyled,{...e}),Bd={left:"ArrowLeft",right:"ArrowRight",backspace:"Backspace",home:"Home",end:"End"};function Vfe(e,t){return e<=0?[]:Array.from({length:e},t)}function Hfe(e,t,r){return e.map((n,i)=>t===i?r:n)}function d7(e){return e.join("")}function h7(e,t){return[...e,t]}function zfe(e,t,r){return e.reduce((n,i,o)=>{const{characters:s,restArrayMerged:a}=n;if(o<r)return{restArrayMerged:a,characters:h7(s,i)};const[l,...d]=a;return{restArrayMerged:d,characters:h7(s,l||"")}},{restArrayMerged:t,characters:[]}).characters}function Wfe(e){return e.split("")}function f7(e){const t=Ee.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return Ee.useInsertionEffect(()=>{t.current=e}),Ee.useCallback((...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}const qfe=()=>!0,pj=Ee.forwardRef((e,t)=>{const{value:r="",length:n=4,autoFocus:i=!1,onChange:o,TextFieldsProps:s,onComplete:a,validateChar:l=qfe,className:d,onBlur:u,...h}=e,f=Ee.useRef(r),p=f7(a),m=f7(I=>{const O=I.slice(0,n);return{isCompleted:O.length===n,finalValue:O}});Ee.useEffect(()=>{const{isCompleted:I,finalValue:O}=m(f.current);I&&p(O)},[n,p,m]);const g=Vfe(n,(I,O)=>({character:r[O]||"",inputRef:Ee.createRef()})),y=I=>g.findIndex(({inputRef:O})=>O.current===I),b=()=>g.map(({character:I})=>I),E=(I,O)=>{const D=Hfe(b(),I,O);return d7(D)},S=I=>{var O,D;(D=(O=g[I])==null?void 0:O.inputRef.current)==null||D.focus()},k=I=>{var O,D;(D=(O=g[I])==null?void 0:O.inputRef.current)==null||D.select()},A=I=>{I+1!==n&&(g[I+1].character?k(I+1):S(I+1))},w=(I,O)=>typeof l!="function"?!0:l(I,O),_=I=>{const O=y(I.target);if(O===0&&I.target.value.length>1){const{finalValue:q,isCompleted:W}=m(I.target.value);o==null||o(q),W&&(a==null||a(q)),k(q.length-1);return}const D=I.target.value[0]||"";let M=D;M&&!w(M,O)&&(M="");const U=E(O,M);o==null||o(U);const{isCompleted:$,finalValue:j}=m(U);$&&(a==null||a(j)),M!==""?U.length-1<O?k(U.length):A(O):D===""&&U.length<=O&&k(O-1)},x=I=>{const O=I.target,D=O.selectionStart,M=O.selectionEnd,U=y(O),$=D===0&&M===0;if(O.value===I.key)I.preventDefault(),A(U);else if(Bd.backspace===I.key){if(!O.value)I.preventDefault(),k(U-1);else if($){I.preventDefault();const j=E(U,"");o==null||o(j),j.length<=U&&k(U-1)}}else Bd.left===I.key?(I.preventDefault(),k(U-1)):Bd.right===I.key?(I.preventDefault(),k(U+1)):Bd.home===I.key?(I.preventDefault(),k(0)):Bd.end===I.key&&(I.preventDefault(),k(g.length-1))},C=I=>{const O=I.clipboardData.getData("text/plain"),D=I.target,M=g.findIndex(({character:ne,inputRef:ae})=>
158ne===""||ae.current===D),U=b(),$=zfe(U,Wfe(O),M).map((ne,ae)=>w(ne,ae)?ne:""),j=d7($);o==null||o(j);const{isCompleted:q,finalValue:W}=m(j);q?(a==null||a(W),k(n-1)):k(j.length)},P=I=>{if(!g.some(({inputRef:O})=>O.current===I.relatedTarget)){const{isCompleted:O,finalValue:D}=m(r);u==null||u(D,O)}};return c.jsx(F,{display:"flex",gap:"20px",alignItems:"center",ref:t,className:`MuiOtpInput-Box ${d||""}`,...h,children:g.map(({character:I,inputRef:O},D)=>{const{onPaste:M,onFocus:U,onKeyDown:$,className:j,onBlur:q,...W}=typeof s=="function"?s(D)||{}:s||{};return c.jsx(Bfe,{autoFocus:i?D===0:!1,autoComplete:"one-time-code",value:I,inputRef:O,className:`MuiOtpInput-TextField MuiOtpInput-TextField-${D+1} ${j||""}`,onPaste:ne=>{ne.preventDefault(),C(ne),M==null||M(ne)},onFocus:ne=>{ne.preventDefault(),ne.target.select(),U==null||U(ne)},onChange:_,onKeyDown:ne=>{x(ne),$==null||$(ne)},onBlur:ne=>{q==null||q(ne),P(ne)},...W},D)})})}),Gfe=ca().shape({otp:no().required("Código obrigatório").length(6,"O código deve ter 6 dÃgitos")});function Kfe({onNext:e,phone:t,autoSendSms:r=!0}){const[n,i]=v.useState(null),[o,s]=v.useState(!1),[a,l]=v.useState(61),[d,u]=v.useState(!1),h=v.useRef(!1),f=v.useRef(0),{control:p,getValues:m,reset:g}=cl({resolver:dl(Gfe),defaultValues:{otp:""}});v.useEffect(()=>{r&&y()},[r]),v.useEffect(()=>{const A=a>0&&setInterval(()=>l(w=>w-1),1e3);return()=>{A&&clearInterval(A)}},[a]);const y=async()=>{try{i(null),u(!0);const{error:A}=await Te.auth.signInWithOtp({phone:t,options:{channel:"whatsapp"}});A?(pe(fe.REGISTRATION.PHONE_ERROR,{error:A.message,errorCode:A.code||"unknown",phone:t,isResend:!0}),i(`Erro ao enviar código: ${A.message}`)):l(61)}catch{pe(fe.REGISTRATION.PHONE_ERROR,{error:"Unexpected error",phone:t}),i("Ocorreu um erro ao enviar o código")}finally{u(!1)}},b=async A=>{if(h.current)return;const w=Date.now();if(!(w-f.current<1500)){f.current=w,h.current=!0,s(!0),i(null);try{const{error:_}=await Te.auth.verifyOtp({phone:t,token:A,type:"sms"});_?(pe(fe.REGISTRATION.OTP_ERROR,{error:_.message||"Código inválido",errorCode:_.code||"unknown",phone:t,otpLength:A.length}),i("Código inválido. Tente novamente."),g({otp:""})):e(!0)}catch{i("Ocorreu um erro ao verificar o código")}finally{s(!1),setTimeout(()=>{h.current=!1},1e3)}}},E=()=>{a===0&&(pe(fe.REGISTRATION.OTP_RESEND,{phone:t.replace(/\d(?=\d{4})/g,"*"),attempt:d?1:0,timestamp:new Date().toISOString()}),y())},S=()=>{const A=m("otp");(A==null?void 0:A.length)===6&&b(A)},k=(A,w)=>{w(A),(A==null?void 0:A.length)===6&&b(A)};return c.jsxs(ki,{children:[c.jsxs(F,{children:[c.jsx(V,{variant:"h5",fontWeight:600,gutterBottom:!0,children:"Digite o código enviado para o seu WhatsApp"}),c.jsxs(V,{variant:"body1",color:"text.secondary",gutterBottom:!0,children:["Enviamos uma mensagem por WhatsApp para"," ",t.replace(/(\d{2})(\d{2})(\d{5})(\d{4})/,"+$1 ($2) $3-$4"),". Digite o código abaixo para confirmar."]})]}),c.jsx(me,{spacing:3,children:c.jsx(rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},children:c.jsxs(F,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:2,padding:3},children:[c.jsx(ss,{name:"otp",control:p,render:({field:A})=>c.jsx(pj,{value:A.value,onChange:w=>k(w,A.onChange),length:6,sx:{gap:.5,flexShrink:0},autoFocus:!0,TextFieldsProps:{autoComplete:"one-time-code",autoCapitalize:"none",type:"tel",inputMode:"numeric",error:!!n,disabled:o}})}),n&&c.jsx(J0,{error:!0,sx:{mt:1},children:n}),c.jsx(F,{sx:{display:"flex",justifyContent:"center",mt:2},children:c.jsx(V,{variant:"body2",color:"text.secondary",children:a>0?`Reenviar código em ${a}s`:c.jsx(De,{variant:"text",onClick:E,disabled:d,sx:{textTransform:"none",fontWeight:400},children:d?"Enviando...":"Reenviar código"})})})]})})}),c.jsx(De,{fullWidth:!0,variant:"contained",size:"large",onClick:S,disabled:o,sx:{borderRadius:2,py:1.5},children:o?"Verificando...":"Verificar código"})]})}function Yfe({email:e,phone:t}){const[r,n]=v.useState(!1),[i,o]=v.useState(!1),[s,a]=v.useState(61);v.useEffect(()=>{const d=s>0&&setInterval(()=>a(u=>u-1),1e3);return()=>{d&&clearInterval(d)}},[s]),v.useEffect(()=>{const{data:{subscription:d}}=Te.auth.onAuthStateChange(async(u,h)=>{u==="SIGNED_IN"&&h&&(n(!0),pe(fe.REGISTRATION.EMAIL_VERIFIED,{email:e,ph
158one:t.replace(/\d(?=\d{4})/g,"*"),timestamp:new Date().toISOString()}))});return()=>d.unsubscribe()},[e,t]);const l=async()=>{if(!(s>0)){o(!0);try{const h=`https://app.stoqui.com.br/auth/register?step=${new URL(window.location.href).searchParams.get("step")||"7"}&email_verified=true`,{error:f}=await Te.auth.signInWithOtp({email:e,options:{shouldCreateUser:!0,emailRedirectTo:h}});f?pe(fe.REGISTRATION.EMAIL_RESEND_ERROR,{error:f.message,errorCode:f.code||"unknown",email:e,phone:t.replace(/\d(?=\d{4})/g,"*"),timestamp:new Date().toISOString()}):(pe(fe.REGISTRATION.EMAIL_RESEND,{email:e,phone:t.replace(/\d(?=\d{4})/g,"*"),timestamp:new Date().toISOString()}),a(61))}catch{pe(fe.REGISTRATION.EMAIL_RESEND_ERROR,{error:"Unexpected error",email:e,phone:t.replace(/\d(?=\d{4})/g,"*"),timestamp:new Date().toISOString()})}finally{o(!1)}}};return c.jsxs(ki,{children:[c.jsxs(F,{sx:{textAlign:"center"},children:[c.jsx(rt.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:.1},children:r?c.jsx(ps,{sx:{fontSize:80,color:"success.main",mb:2}}):c.jsx(I_,{sx:{fontSize:80,color:"primary.main",mb:2}})}),c.jsx(V,{variant:"h5",fontWeight:600,gutterBottom:!0,children:r?"E-mail confirmado!":"Verifique seu e-mail"}),c.jsx(V,{variant:"body1",color:"text.secondary",gutterBottom:!0,children:r?"Sua conta foi verificada com sucesso. Redirecionando...":`Enviamos um link de confirmação para ${e}. Clique no link para continuar.`})]}),!r&&c.jsx(me,{spacing:3,children:c.jsx(rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.3},children:c.jsxs(F,{sx:{textAlign:"center"},children:[c.jsx(V,{variant:"body2",color:"text.secondary",gutterBottom:!0,children:"Não recebeu o e-mail? Verifique sua caixa de spam ou"}),s>0?c.jsxs(V,{variant:"body2",color:"text.secondary",children:["Reenviar em ",s,"s"]}):c.jsx(De,{variant:"text",onClick:l,disabled:i,sx:{textTransform:"none",fontWeight:600},children:i?c.jsxs(c.Fragment,{children:[c.jsx(bn,{size:16,sx:{mr:1}}),"Enviando..."]}):"Reenviar link"})]})})}),r&&c.jsx(rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.5},children:c.jsx(F,{sx:{display:"flex",justifyContent:"center"},children:c.jsx(bn,{size:24})})})]})}var mj={exports:{}};function Zfe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Ev=Zfe(v),Xfe=Ns;function Jfe(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var i=r[n],o=Object.getOwnPropertyDescriptor(t,i);o&&o.configurable&&e[i]===void 0&&Object.defineProperty(e,i,o)}return e}function i_(){return(i_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function Qfe(e,t){e.prototype=Object.create(t.prototype),Jfe(e.prototype.constructor=e,t)}function epe(e,t){if(e==null)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],0<=t.indexOf(r)||(i[r]=e[r]);return i}function Hc(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var tpe=function(e,t,r,n,i,o,s,a){if(!e){var l;if(t===void 0)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var d=[r,n,i,o,s,a],u=0;(l=new Error(t.replace(/%s/g,function(){return d[u++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}},p7=tpe;function m7(e,t,r){if("selectionStart"in e&&"selectionEnd"in e)e.selectionStart=t,e.selectionEnd=r;else{var n=e.createTextRange();n.collapse(!0),n.moveStart("character",t),n.moveEnd("character",r-t),n.select()}}function rpe(e){var t=0,r=0;if("selectionStart"in e&&"selectionEnd"in e)t=e.selectionStart,r=e.selectionEnd;else{var n=document.selection.createRange();n.parentElement()===e&&(t=-n.moveStart("character",-e.value.length),r=-n.moveEnd("character",-e.value.length))}return{start:t,end:r,length:r-t}}var npe={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},ipe="_";function g7(e,t,r){var n="",i="",o=null,s=[];if(t===void 0&&(t=ipe),r==null&&(r=npe),!e||typeof e!="string")return{maskChar:t,formatChars:r,mask:null,prefix:null,lastEditablePosition:null,permanents:[]};var a=!1;return e.split("").forEach(function(l){a=!a&&l==="\\"||(a||!r[l]?(s.push(n.length),n.length===s.length-1&&(i+=l)):o=n.length+1,n+=l,!1)}),{maskChar:t,formatChars:r,prefix:i,mask:n,lastEditablePosition:o,permanents:s}}function Bi(e,t){return e.permanents.indexOf(t)!==-1}function jg(e,t,r){var n=e.mask,i=e.formatChars;if(!r)return!1;if(Bi(e,t))return n[t]===r;var o=i[n[t]];return new RegExp(o).test(r)}function v7(e,t){return t.split("").every(function(r,n){return Bi(e,n)||!jg(e,n,r)})}function nh(e,t){var r=e.maskChar,n=e.prefix;if(!r){for(;t.length>n.length&&Bi(e,t.length-1);)t=t.slice(0,t.length-1);return t.length}for(var i=n.length,o=t.length;o>=n.length;o--){var s=t[o];if(!Bi(e,o)&&jg(e,o,s)){i=o+1;break}}return i}function gj(e,t){return nh(e,t)===e.mask.length}function Ms(e,t){var r=e.maskChar,n=e.mask,i=e.prefix;if(!r){for((t=o_(e,"",t,0)).length<i.length&&(t=i);t.length<n.length&&Bi(e,t.length);)t+=n[t.length];return t}if(t)return o_(e,Ms(e,""),t,0);for(var o=0;o<n.length;o++)Bi(e,o)?t+=n[o]:t+=r;return t}function ope(e,t,r,n){var i=r+n,o=e.maskChar,s=e.mask,a=e.prefix,l=t.split("");
158if(o)return l.map(function(u,h){return h<r||i<=h?u:Bi(e,h)?s[h]:o}).join("");for(var d=i;d<l.length;d++)Bi(e,d)&&(l[d]="");return r=Math.max(a.length,r),l.splice(r,i-r),t=l.join(""),Ms(e,t)}function o_(e,t,r,n){var i=e.mask,o=e.maskChar,s=e.prefix,a=r.split(""),l=gj(e,t);return!o&&n>t.length&&(t+=i.slice(t.length,n)),a.every(function(d){for(;p=d,Bi(e,f=n)&&p!==i[f];){if(n>=t.length&&(t+=i[n]),u=d,h=n,o&&Bi(e,h)&&u===o)return!0;if(++n>=i.length)return!1}var u,h,f,p;return!jg(e,n,d)&&d!==o||(n<t.length?t=o||l||n<s.length?t.slice(0,n)+d+t.slice(n+1):(t=t.slice(0,n)+d+t.slice(n),Ms(e,t)):o||(t+=d),++n<i.length)}),t}function spe(e,t,r,n){var i=e.mask,o=e.maskChar,s=r.split(""),a=n;return s.every(function(l){for(;u=l,Bi(e,d=n)&&u!==i[d];)if(++n>=i.length)return!1;var d,u;return(jg(e,n,l)||l===o)&&n++,n<i.length}),n-a}function ape(e,t){for(var r=t;0<=r;--r)if(!Bi(e,r))return r;return null}function Th(e,t){for(var r=e.mask,n=t;n<r.length;++n)if(!Bi(e,n))return n;return null}function Sv(e){return e||e===0?e+"":""}function lpe(e,t,r,n,i){var o=e.mask,s=e.prefix,a=e.lastEditablePosition,l=t,d="",u=0,h=0,f=Math.min(i.start,r.start);return r.end>i.start?h=(u=spe(e,n,d=l.slice(i.start,r.end),f))?i.length:0:l.length<n.length&&(h=n.length-l.length),l=n,h&&(h===1&&!i.length&&(f=i.start===r.start?Th(e,r.start):ape(e,r.start)),l=ope(e,l,f,h)),l=o_(e,l,d,f),(f+=u)>=o.length?f=o.length:f<s.length&&!u?f=s.length:f>=s.length&&f<a&&u&&(f=Th(e,f)),d||(d=null),{value:l=Ms(e,l),enteredString:d,selection:{start:f,end:f}}}function cpe(){var e=new RegExp("windows","i"),t=new RegExp("phone","i"),r=navigator.userAgent;return e.test(r)&&t.test(r)}function fi(e){return typeof e=="function"}function upe(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame}function vj(){return window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame}function y7(e){return(vj()?upe():function(){return setTimeout(e,1e3/60)})(e)}function Cv(e){(vj()||clearTimeout)(e)}var dpe=function(e){function t(n){var i=e.call(this,n)||this;i.focused=!1,i.mounted=!1,i.previousSelection=null,i.selectionDeferId=null,i.saveSelectionLoopDeferId=null,i.saveSelectionLoop=function(){i.previousSelection=i.getSelection(),i.saveSelectionLoopDeferId=y7(i.saveSelectionLoop)},i.runSaveSelectionLoop=function(){i.saveSelectionLoopDeferId===null&&i.saveSelectionLoop()},i.stopSaveSelectionLoop=function(){i.saveSelectionLoopDeferId!==null&&(Cv(i.saveSelectionLoopDeferId),i.saveSelectionLoopDeferId=null,i.previousSelection=null)},i.getInputDOMNode=function(){if(!i.mounted)return null;var m=Xfe.findDOMNode(Hc(Hc(i))),g=typeof window<"u"&&m instanceof window.Element;if(m&&!g)return null;if(m.nodeName!=="INPUT"&&(m=m.querySelector("input")),!m)throw new Error("react-input-mask: inputComponent doesn't contain input node");return m},i.getInputValue=function(){var m=i.getInputDOMNode();return m?m.value:null},i.setInputValue=function(m){var g=i.getInputDOMNode();g&&(i.value=m,g.value=m)},i.setCursorToEnd=function(){var m=nh(i.maskOptions,i.value),g=Th(i.maskOptions,m);g!==null&&i.setCursorPosition(g)},i.setSelection=function(m,g,y){y===void 0&&(y={});var b=i.getInputDOMNode(),E=i.isFocused();b&&E&&(y.deferred||m7(b,m,g),i.selectionDeferId!==null&&Cv(i.selectionDeferId),i.selectionDeferId=y7(function(){i.selectionDeferId=null,m7(b,m,g)}),i.previousSelection={start:m,end:g,length:Math.abs(g-m)})},i.getSelection=function(){return rpe(i.getInputDOMNode())},i.getCursorPosition=function(){return i.getSelection().start},i.setCursorPosition=function(m){i.setSelection(m,m)},i.isFocused=function(){return i.focused},i.getBeforeMaskedValueChangeConfig=function(){var m=i.maskOptions,g=m.mask,y=m.maskChar,b=m.permanents,E=m.formatChars;return{mask:g,maskChar:y,permanents:b,alwaysShowMask:!!i.props.alwaysShowMask,formatChars:E}},i.isInputAutofilled=function(m,g,y,b){var E=i.getInputDOMNode();try{if(E.matches(":-webkit-autofill"))return!0}catch{}return!i.focused||b.end<y.length&&g.end===m.length},i.onChange=function(m){var g=Hc(Hc(i)).beforePasteState,y=Hc(Hc(i)).previousSelection,b=i.props.beforeMaskedValueChange,E=i.getInputValue(),S=i.value,k=i.getSelection();i.isInputAutofilled(E,k,S,y)&&(S=Ms(i.maskOptions,""),y={start:0,end:0,length:0}),g&&(y=g.selection,S=g.value,k={start:y.start+E.length,end:y.start+E.length,length:0},E=S.slice(0,y.start)+E+S.slice(y.end),i.beforePasteState=null);var A=lpe(i.maskOptions,E,k,S,y),w=A.enteredString,_=A.selection,x=A.value;if(fi(b)){var C=b({value:x,selection:_},{value:S,selection:y},w,i.getBeforeMaskedValueChangeConfig());x=C.value,_=C.selection}i.setInputValue(x),fi(i.props.onChange)&&i.props.onChange(m),i.isWindowsPhoneBrowser?i.setSelection(_.start,_.end,{deferred:!0}
158):i.setSelection(_.start,_.end)},i.onFocus=function(m){var g=i.props.beforeMaskedValueChange,y=i.maskOptions,b=y.mask,E=y.prefix;if(i.focused=!0,i.mounted=!0,b){if(i.value)nh(i.maskOptions,i.value)<i.maskOptions.mask.length&&i.setCursorToEnd();else{var S=Ms(i.maskOptions,E),k=Ms(i.maskOptions,S),A=nh(i.maskOptions,k),w=Th(i.maskOptions,A),_={start:w,end:w};if(fi(g)){var x=g({value:k,selection:_},{value:i.value,selection:null},null,i.getBeforeMaskedValueChangeConfig());k=x.value,_=x.selection}var C=k!==i.getInputValue();C&&i.setInputValue(k),C&&fi(i.props.onChange)&&i.props.onChange(m),i.setSelection(_.start,_.end)}i.runSaveSelectionLoop()}fi(i.props.onFocus)&&i.props.onFocus(m)},i.onBlur=function(m){var g=i.props.beforeMaskedValueChange,y=i.maskOptions.mask;if(i.stopSaveSelectionLoop(),i.focused=!1,y&&!i.props.alwaysShowMask&&v7(i.maskOptions,i.value)){var b="";fi(g)&&(b=g({value:b,selection:null},{value:i.value,selection:i.previousSelection},null,i.getBeforeMaskedValueChangeConfig()).value);var E=b!==i.getInputValue();E&&i.setInputValue(b),E&&fi(i.props.onChange)&&i.props.onChange(m)}fi(i.props.onBlur)&&i.props.onBlur(m)},i.onMouseDown=function(m){if(!i.focused&&document.addEventListener){i.mouseDownX=m.clientX,i.mouseDownY=m.clientY,i.mouseDownTime=new Date().getTime();var g=function y(b){if(document.removeEventListener("mouseup",y),i.focused){var E=Math.abs(b.clientX-i.mouseDownX),S=Math.abs(b.clientY-i.mouseDownY),k=Math.max(E,S),A=new Date().getTime()-i.mouseDownTime;(k<=10&&A<=200||k<=5&&A<=300)&&i.setCursorToEnd()}};document.addEventListener("mouseup",g)}fi(i.props.onMouseDown)&&i.props.onMouseDown(m)},i.onPaste=function(m){fi(i.props.onPaste)&&i.props.onPaste(m),m.defaultPrevented||(i.beforePasteState={value:i.getInputValue(),selection:i.getSelection()},i.setInputValue(""))},i.handleRef=function(m){i.props.children==null&&fi(i.props.inputRef)&&i.props.inputRef(m)};var o=n.mask,s=n.maskChar,a=n.formatChars,l=n.alwaysShowMask,d=n.beforeMaskedValueChange,u=n.defaultValue,h=n.value;i.maskOptions=g7(o,s,a),u==null&&(u=""),h==null&&(h=u);var f=Sv(h);if(i.maskOptions.mask&&(l||f)&&(f=Ms(i.maskOptions,f),fi(d))){var p=n.value;n.value==null&&(p=u),f=d({value:f,selection:null},{value:p=Sv(p),selection:null},null,i.getBeforeMaskedValueChangeConfig()).value}return i.value=f,i}Qfe(t,e);var r=t.prototype;return r.componentDidMount=function(){this.mounted=!0,this.getInputDOMNode()&&(this.isWindowsPhoneBrowser=cpe(),this.maskOptions.mask&&this.getInputValue()!==this.value&&this.setInputValue(this.value))},r.componentDidUpdate=function(){var n=this.previousSelection,i=this.props,o=i.beforeMaskedValueChange,s=i.alwaysShowMask,a=i.mask,l=i.maskChar,d=i.formatChars,u=this.maskOptions,h=s||this.isFocused(),f=this.props.value!=null,p=f?Sv(this.props.value):this.value,m=n?n.start:null;if(this.maskOptions=g7(a,l,d),this.maskOptions.mask){!u.mask&&this.isFocused()&&this.runSaveSelectionLoop();var g=this.maskOptions.mask&&this.maskOptions.mask!==u.mask;if(u.mask||f||(p=this.getInputValue()),(g||this.maskOptions.mask&&(p||h))&&(p=Ms(this.maskOptions,p)),g){var y=nh(this.maskOptions,p);(m===null||y<m)&&(m=gj(this.maskOptions,p)?y:Th(this.maskOptions,y))}!this.maskOptions.mask||!v7(this.maskOptions,p)||h||f&&this.props.value||(p="");var b={start:m,end:m};if(fi(o)){var E=o({value:p,selection:b},{value:this.value,selection:this.previousSelection},null,this.getBeforeMaskedValueChangeConfig());p=E.value,b=E.selection}this.value=p;var S=this.getInputValue()!==this.value;S?(this.setInputValue(this.value),this.forceUpdate()):g&&this.forceUpdate();var k=!1;b.start!=null&&b.end!=null&&(k=!n||n.start!==b.start||n.end!==b.end),(k||S)&&this.setSelection(b.start,b.end)}else u.mask&&(this.stopSaveSelectionLoop(),this.forceUpdate())},r.componentWillUnmount=function(){this.mounted=!1,this.selectionDeferId!==null&&Cv(this.selectionDeferId),this.stopSaveSelectionLoop()},r.render=function(){var n,i=this.props,o=(i.mask,i.alwaysShowMask,i.maskChar,i.formatChars,i.inputRef,i.beforeMaskedValueChange,i.children),s=epe(i,["mask","alwaysShowMask","maskChar","formatChars","inputRef","beforeMaskedValueChange","children"]);if(o){fi(o)||p7(!1);
158var a=["onChange","onPaste","onMouseDown","onFocus","onBlur","value","disabled","readOnly"],l=i_({},s);a.forEach(function(u){return delete l[u]}),n=o(l),a.filter(function(u){return n.props[u]!=null&&n.props[u]!==s[u]}).length&&p7(!1)}else n=Ev.createElement("input",i_({ref:this.handleRef},s));var d={onFocus:this.onFocus,onBlur:this.onBlur};return this.maskOptions.mask&&(s.disabled||s.readOnly||(d.onChange=this.onChange,d.onPaste=this.onPaste,d.onMouseDown=this.onMouseDown),s.value!=null&&(d.value=this.value)),n=Ev.cloneElement(n,d)},t}(Ev.Component),hpe=dpe;mj.exports=hpe;var fpe=mj.exports;const ppe=NC(fpe);/*! 159 * cpf-cnpj-validator v1.0.3 160 * (c) 2020-present Carvalho, Vinicius Luiz <[email protected]> 161 * Released under the MIT License. 162 */const mpe=["00000000000","11111111111","22222222222","33333333333","44444444444","55555555555","66666666666","77777777777","88888888888","99999999999","12345678909"],gpe=/[.-]/g,vpe=/[^\d]/g,_f=e=>{const t=e.split("").map(o=>parseInt(o,10)),r=t.length+1,i=t.map((o,s)=>o*(r-s)).reduce((o,s)=>o+s)%11;return i<2?0:11-i},tx=(e,t)=>{const r=t?gpe:vpe;return(e||"").replace(r,"")},yj=e=>tx(e).replace(/^(\d{3})(\d{3})(\d{3})(\d{2})$/,"$1.$2.$3-$4"),ype=(e,t)=>{const r=tx(e,t);if(!r||r.length!==11||mpe.includes(r))return!1;let n=r.substr(0,9);return n+=_f(n),n+=_f(n),n.substr(-2)===r.substr(-2)},_pe=e=>{let t="";for(let r=0;r<9;r+=1)t+=Math.floor(Math.random()*9);return t+=_f(t),t+=_f(t),e?yj(t):t};var bpe={verifierDigit:_f,strip:tx,format:yj,isValid:ype,generate:_pe};const xpe=["00000000000000","11111111111111","22222222222222","33333333333333","44444444444444","55555555555555","66666666666666","77777777777777","88888888888888","99999999999999"],wpe=/[-\\/.]/g,Epe=/[^\d]/g,bf=e=>{let t=2;const i=e.split("").reduce((o,s)=>[parseInt(s,10)].concat(o),[]).reduce((o,s)=>(o+=s*t,t=t===9?2:t+1,o),0)%11;return i<2?0:11-i},rx=(e,t)=>{const r=t?wpe:Epe;return(e||"").replace(r,"")},_j=e=>rx(e).replace(/^(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})$/,"$1.$2.$3/$4-$5"),Spe=(e,t)=>{const r=rx(e,t);if(!r||r.length!==14||xpe.includes(r))return!1;let n=r.substr(0,12);return n+=bf(n),n+=bf(n),n.substr(-2)===r.substr(-2)},Cpe=e=>{let t="";for(let r=0;r<12;r+=1)t+=Math.floor(Math.random()*9);return t+=bf(t),t+=bf(t),e?_j(t):t};var Tpe={verifierDigit:bf,strip:rx,format:_j,isValid:Spe,generate:Cpe};const Ape=async e=>(await Io.post("/affiliate/apply-code",e)).data,kpe=()=>jn({mutationFn:Ape}),bj=Kr("CapacitorReferrer",{web:()=>X(()=>import("./web-BDxgWXJd.js"),__vite__mapDeps([15,1,2,3,4,5,6])).then(e=>new e.CapacitorReferrerWeb)}),Rpe=e=>ca().shape({email:no().email("E-mail inválido").nullable(),document:no().test("is-valid-document","CPF ou CNPJ inválido",t=>{if(!t)return!0;const r=t.replace(/\D/g,"");if(r.length==11)return bpe.isValid(r);if(r.length===14)return Tpe.isValid(r)}).nullable(),affiliateCode:no().nullable(),acceptedTerms:e?t_().nullable():t_().oneOf([!0],"Você precisa aceitar os termos para continuar").required("Você precisa aceitar os termos para continuar")});function Ipe({onNext:e,initialValues:t={},emailDisabled:r=!1,documentDisabled:n=!1,hideTerms:i=!1}){const{user:o}=ot(),{data:s}=co(),[a,l]=v.useState(null),[d,u]=v.useState(!1),h=v.useRef(null),{mutate:f}=kpe(),{control:p,handleSubmit:m,reset:g,setValue:y,getValues:b,formState:{errors:E}}=cl({resolver:dl(Rpe(i)),defaultValues:{email:t.email||"",document:t.document||"",affiliateCode:t.affiliateCode||"",acceptedTerms:!!i}}),S=_=>!(/[:&=]/.test(_)||_.length>12||/[a-z]/.test(_)),k=async()=>{if(!qe.isNativePlatform()||qe.getPlatform()!=="android")return null;try{const _=await bj.getReferrerDetails();return console.log("Referrer details retrieved:",_),_}catch(_){return console.log("Could not retrieve referrer details:",_),null}};v.useEffect(()=>{(async()=>{var x,C;if(o!=null&&o.id)try{let P=null;if(qe.isNativePlatform()){const{data:I}=await Te.auth.getUser();let O=(C=(x=I==null?void 0:I.user)==null?void 0:x.user_metadata)==null?void 0:C.referrer;if(O||(O=await k()),O){if(O.ref)P=O.ref;else if(O.referrerUrl)try{const M=new URL(O.referrerUrl).searchParams.get("ref");M&&(P=M)}catch{console.log("referrerUrl is not a URL, treating as affiliate code directly"),P=O.referrerUrl}}}else{const I=localStorage.getItem("affiliate_code");I&&(P=I)}P&&S(P)?(l(P),y("affiliateCode",P.toUpperCase())):P&&console.log("Invalid affiliate code format, not applying:",P)}catch(P){console.error("Error checking referrer:",P)}})()},[o==null?void 0:o.id,y]),v.useEffect(()=>{if(t){const _=b("affiliateCode"),x=b("acceptedTerms");g({...t,affiliateCode:a||_||t.affiliateCode,acceptedTerms:x})}},[t,g,a,b]);const A=_=>{_.acceptedTerms&&h.current&&h.current.scrollIntoView({behavior:"smooth",block:"center"})},w=_=>{var I,O;(I=_.affiliateCode)!=null&&I.trim()&&f({codigo_afiliado:_.affiliateCode.trim().toUpperCase()},{onSuccess:()=>{console.log("Affiliate code applied successfully")},onError:D=>{console.error("Failed to apply affiliate code:",D)}});const{acceptedTerms:x,...C}=_,P={...C,document:_.document?_.document.replace(/\D/g,""):void 0,email:_.email||void 0,affiliateCode:((O=_.affiliateCode)==null?void 0:O.trim().toUpperCase())||void 0};e(P)};return c.jsxs(ki,{children:[c.jsxs(F,{children:[c.jsx(V,{variant:"h5",fontWeight:600,gutterBottom:!0,children:"Suas informações"}),c.jsx(V,{variant:"body1",color:"text.secondary",children:"Compartilhe seus dados para melhorarmos sua experiência. Suas informações ficam seguras conosco."})]}),c.jsx(me,{spacing:2.5,children:c.jsx(rt.div,{initial:{opacity:0,y:20}
162,animate:{opacity:1,y:0},transition:{delay:.2},children:c.jsxs(me,{spacing:2.5,children:[c.jsx(ss,{name:"email",control:p,render:({field:_})=>{var x;return c.jsx(Ci,{..._,fullWidth:!0,variant:"outlined",label:"E-mail (opcional)",error:!!E.email,helperText:r?"E-mail já confirmado":(x=E.email)==null?void 0:x.message,placeholder:"[email protected]",disabled:r})}}),c.jsx(ss,{name:"document",control:p,render:({field:_})=>c.jsx(ppe,{mask:(_.value||"").length>14?"99.999.999/9999-99":"999.999.999-999",maskChar:null,value:_.value||"",onChange:_.onChange,onBlur:_.onBlur,disabled:n,children:x=>{var C;return c.jsx(Ci,{...x,fullWidth:!0,variant:"outlined",inputMode:"numeric",type:"tel",autoComplete:"off",label:"CPF/CNPJ (opcional)",error:!!E.document,helperText:n?"Informação importada do Asaas":(C=E.document)==null?void 0:C.message,placeholder:"Digite apenas números",disabled:n})}})}),c.jsx(ss,{name:"affiliateCode",control:p,render:({field:_})=>c.jsx(Ci,{..._,fullWidth:!0,variant:"outlined",label:"Código de indicação (opcional)",disabled:!!a,helperText:a?"Código detectado automaticamente":"",sx:{".MuiOutlinedInput-input":{textTransform:"uppercase"}},onChange:x=>{_.onChange(x.target.value.toUpperCase())},InputProps:{endAdornment:c.jsx(Us,{position:"end",children:a?c.jsx(mr,{onClick:x=>{x.preventDefault(),x.stopPropagation(),l(null)},edge:"end",size:"small",sx:{pointerEvents:"auto","&:hover":{backgroundColor:"action.hover"}},children:c.jsx(ZD,{fontSize:"small"})}):c.jsx(OC,{title:"Se alguém te passou um código de indicação, você pode inserir aqui para vincular sua conta. Quem te indicou receberá benefÃcios quando você se tornar um cliente ativo.",open:d,onClose:()=>u(!1),disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,arrow:!0,PopperProps:{sx:{"& .MuiTooltip-tooltip":{maxWidth:300,fontSize:"0.875rem"}}},children:c.jsx(mr,{onClick:()=>u(!d),edge:"end",size:"small",children:c.jsx(XD,{fontSize:"small"})})})})}})}),!i&&c.jsx(ss,{name:"acceptedTerms",control:p,render:({field:_})=>c.jsxs(F,{ref:h,component:rt.div,animate:E.acceptedTerms?{x:[0,-6,6,-6,6,0],transition:{duration:.4}}:{},onClick:()=>_.onChange(!_.value),sx:{display:"flex",alignItems:"flex-start",gap:1,p:2,borderRadius:3,backgroundColor:E.acceptedTerms?gt("#FF3355",.06):"white",border:"2px solid",borderColor:E.acceptedTerms?"error.main":"#e5e7eb",cursor:"pointer",transition:"all 0.2s ease","&:hover":{borderColor:E.acceptedTerms?"error.main":"#d1d5db"}},children:[c.jsx(pc,{checked:!!_.value,onChange:_.onChange,onClick:x=>x.stopPropagation(),color:E.acceptedTerms?"error":"primary",sx:{p:0,mt:"2px"}}),c.jsxs(F,{sx:{flex:1},children:[c.jsxs(V,{variant:"body2",color:E.acceptedTerms?"error.main":"text.primary",sx:{lineHeight:1.6,fontWeight:500},children:["Li e aceito os"," ",c.jsx(V,{component:"a",href:(s==null?void 0:s.TERMS_OF_USE_URL)||"#",target:"_blank",rel:"noopener noreferrer",variant:"body2",onClick:x=>x.stopPropagation(),sx:{color:"primary.main",textDecoration:"none",fontWeight:600,"&:hover":{textDecoration:"underline"}},children:"Termos de Uso"})," ","e a"," ",c.jsx(V,{component:"a",href:(s==null?void 0:s.PRIVACY_POLICY_URL)||"#",target:"_blank",rel:"noopener noreferrer",variant:"body2",onClick:x=>x.stopPropagation(),sx:{color:"primary.main",textDecoration:"none",fontWeight:600,"&:hover":{textDecoration:"underline"}},children:"PolÃtica de Privacidade"})]}),E.acceptedTerms&&c.jsx(V,{variant:"caption",color:"error.main",sx:{display:"block",mt:.75,fontWeight:600},children:E.acceptedTerms.message})]})]})})]})})}),c.jsx(De,{fullWidth:!0,variant:"contained",size:"large",onClick:m(w,A),sx:{borderRadius:3,py:1.75,fontSize:"1rem"},children:"Continuar"})]})}function Ppe({onNext:e,initialValue:t=""}){const[r,n]=v.useState(t),i=50;v.useEffect(()=>{t&&n(t)},[t]);const o=()=>{const l=r.trim();l&&l.length<=i&&e(l)},s=l=>{const d=r.trim();l.key==="Enter"&&d&&d.length<=i&&o()},a=r.trim()&&r.trim().length<=i;return c.jsxs(ki,{children:[c.jsxs(F,{children:[c.jsx(V,{variant:"h5",fontWeight:600,gutterBottom:!0,children:"Escolha um nome para a sua loja"}),c.jsx(V,{variant:"body1",color:"text.secondary",gutterBottom:!0,children:"Informe seu nome, o nome da sua loja ou o nome do seu negócio. Você pode alterar isso depois."})]}),c.jsx(rt.div,{initial:{opacity:0,y:20}
162,animate:{opacity:1,y:0},transition:{delay:.2},children:c.jsx(Ci,{fullWidth:!0,variant:"outlined",placeholder:"Ex. Maria Perfumes",value:r,onChange:l=>n(l.target.value.slice(0,i)),onKeyPress:s,autoFocus:!t,inputProps:{maxLength:i},error:r.trim().length>i,sx:{".MuiOutlinedInput-root":{borderRadius:2},".MuiOutlinedInput-input":{borderRadius:2}}})}),c.jsx(De,{fullWidth:!0,variant:"contained",size:"large",onClick:o,disabled:!a,sx:{borderRadius:2,py:1.5},children:"Continuar"})]})}const Ope=async e=>{const{data:t,error:r}=await Te.from("catalogo_web").select("slug_loja").eq("slug_loja",e);if(r)throw new Error(r.message);return t.length===0},jpe=e=>Et({queryKey:["validateCatalogSlug",e],queryFn:()=>Ope(e),enabled:!!e,retry:!1,staleTime:1e4,refetchOnWindowFocus:!1}),_7=["produto","produtos","loja","lojas","admin","administrador","dashboard","painel","configuracoes","configurações","settings","perfil","meu-perfil","minha-conta","conta","login","logout","cadastro","register","registrar","ajuda","suporte","help","support","termos","privacidade","politica-de-privacidade","politica-de-entrega","politica-de-troca","faq","sobre-nos","sobre-a-loja","contato","contacto","contact","blog","noticias","news","ofertas","promocoes","promotions","vendas","sales","carrinho","checkout","pagamento","payment","pedido","pedidos","order","orders","administracao","configuração","configuracao","ssl","cdn","api","apis","webhook","webhooks","status","uptime","legal","compliance","comercial","business","enterprise","corporate","partner","partners","afiliado","afiliados","affiliate","affiliates","promo","promos","vendedor","promocao","brasil","versi","stoqui","shop","vendas","venda","mercado","market","mercado-livre","mercadolivre","ml","amazon","ebay","etsy","aliexpress","shopify","woocommerce","magento","bigcommerce","wix","squarespace","weebly","jimdo","prestaShop","opencart","drupal","joomla","tictail","gumroad","selz","3dcart","volusion","bigcartel","vendr","kyte","ecwid","shift4shop","apple","google","facebook","instagram","tiktok","pinterest","twitter","linkedin","snapchat","whatsapp","telegram","youtube","twitch","discord","reddit","magalu","www","mail","email","ftp","smtp","pop","imap","dns","http","https","tcp","udp","ip","localhost","database","db","mysql","postgres","mongodb","redis","cache","backup","logs","log","analytics","metrics","monitoring","health","ping","test","tests","testing","dev","development","staging","production","prod","beta","alpha","demo","preview","sandbox","root","system","config","tmp","temp","var","lib","bin","usr","etc","home","public","private","secure","security","auth","oauth","token","session","cookie","cors","proxy","gateway","load-balancer","firewall","catalogo","catalog","categoria","categorias","category","categories","marca","marcas","brand","brands","fornecedor","fornecedores","supplier","suppliers","estoque","stock","inventory","inventario","almoxarifado","warehouse","deposito","distribuicao","distribution","logistica","logistics","entrega","delivery","frete","shipping","transporte","transport","cupom","cupons","coupon","coupons","desconto","descontos","discount","discounts","cashback","reembolso","refund","devolucao","troca","exchange","garantia","warranty","pos-venda","pos-vendas","after-sales","atendimento","customer-service","sac","ouvidoria","reclamacoes","complaints","feedback","avaliacoes","reviews","rating","ratings","comentarios","comments","testemunhos","testimonials","americanas","submarino","casas-bahia","extra","ponto-frio","ricardo-eletro","fast-shop","carrefour","walmart","b2w","via-varejo","centauro","netshoes","dafiti","kabum","buscape","zoom","bondfaro","pelando","promobit","tudocelular","terabyte","pichau","natura","avon","boticario","sephora","riachuelo","cea","renner","zara","hm","nike","adidas","samsung","lg","sony","microsoft","netflix","spotify","uber","ifood","rappi","99","pix","boleto","cartao","credito","debito","financiamento","parcelamento","juros","taxa","tarifa","cobranca","fatura","invoice","billing","subscription","assinatura","plano","plan","premium","pro","plus","basic","basico","gratuito","free","trial","teste","banco","bradesco","itau","santander","bb","caixa","nubank","inter","original","c6","next","pagbank","picpay","mercadopago","paypal","pagseguro","cielo","rede","stone","getnet","visa","mastercard","elo","amex","diners","hipercard","governo","government","federal","estadual","municipal","prefeitura","receita","receita-federal","anvisa","inmetro","procon","tjsp","tjrj","stf","stj","tst","cdc","cpf","cnpj","rg","cnh","certidao","cartorio","tabeliao","juridico","advogado","advocacia","escritorio","tribunal","processo","acao","sentenca","acordao","lei","decreto","portaria","resolucao","instrucao-normativa","oficial","original","autentico","authentic","genuine","legitimo","verified","verificado","certificado","certified","aprovado","approved","autorizado","authorized","licenciado","licensed","registrado","registered","trademark","copyright","patente","patent","exclusivo","exclusive","unico","unique","primeiro","first","melhor","best","top","numero-um","number-one","lider","leader","especialista","expert","professional","profissional","master","mestre","guru","authority","autoridade","shopping","center","centro","mall","outlet","atacado","varejo","retail","wholesale","fabrica","factory","industria","industry","importadora","exportadora","distribuidora","representante","concessionaria","franquia","franchise","holding","grupo","group","corporacao","corporation","ltda","sa","eireli","mei","epp","cooperativa","associacao","sindicato","federacao","confederacao","conselho","instituto","fundacao","ong","oscip","revenda","distribuicao","distribuidor","representacao","representante-comercial","atacadista","varejista","varejo","comerciante","lojista","franqueado","franqueadora","www","net","com","herbalife","nutrilite","avon","jequiti","omnilife","tupperware","mary-kay","coty","oriflame","forever-living","polishop","marykay","boticario","natura","natural","amway","amwaybrasil","amway-brazil","amway-brasil","herbalifebrasil","hinode","hinodecosmeticos","hinode-group","grupohinode","boulevard","boulevard-monde","boulevardmonde","forever-living","foreverliving","forever-brasil","jeunesse","jeunesse-global","jeunesselife","younique","younique-brasil","nu-skin","nuskin","
162nuskin-brasil","isagenix","isagenix-brasil","doterra","doterra-brasil","young-living","youngliving","youngliving-brasil","norwex","norwex-brasil","modere","modere-brasil","melaleuca","melaleuca-brasil","primerica","primerica-brasil","farmasi","farmasi-brasil","monat","monat-brasil","advocare","advocare-brasil","rodan-fields","rodanfields","mmn","marketing-multinivel","marketing-de-rede","venda-direta","vendas-diretas","rede-de-marketing","multinivel","multi-nivel","network-marketing","distribuidora-independente","consultor-independente","consultora-independente","empreendedor-digital","rendimento-passivo","renda-passiva","liberdade-financeira","trabalhe-em-casa","trabalhe-de-casa","oportunidade-de-negocio","seja-seu-proprio-chefe","ganhar-dinheiro-online","recrutamento","downline","upline","patrocinador","patrocinadora","equipe-de-vendas","comissao","bonus-de-vendas","plano-de-carreira","qualificacao-mensal","meta-de-vendas","incentivos","premiacao","reconhecimento","eventos-de-treinamento","capacitacao","mentoria","coaching-de-vendas","desenvolvimento-pessoal","mude-sua-vida","transforme-sua-vida","conquiste-seus-sonhos","realize-seus-sonhos","independencia-financeira","liberdade-de-tempo","extra-renda","renda-extra","trabalho-flexivel","horario-flexivel","seja-dono-do-seu-tempo","construa-sua-rede","forme-sua-equipe","multiplique-sua-renda","bitcoin","criptomoeda","cryptocurrency","investimento","investimentos","forex","trading","trader","day-trade","swing-trade","bolsa-valores","b3","bovespa","acao","acoes","fii","fundos-imobiliarios","tesouro-direto","cdb","lci","lca","debentures","precatorios","emprestimo","financiamento","credito","consorcio"];function b7(e){return!e||typeof e!="string"?"":e.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,80).replace(/-+$/,"")}const _Ce={nenhum:"Nenhum link",inicio:"Página inicial",categoria:"Uma categoria",produto:"Um produto",pagina:"Uma página da loja",produtos:"Todos os produtos",promocoes:"Promoções",externo:"Outro site"},bCe=["nenhum","inicio","categoria","produto","pagina","produtos","promocoes","externo"],xj=new Set(["produtos","promocoes","categoria","produto","pagina","conta","auth","checkout","sobre","link-pagamento","api","feed.xml","sitemap.xml","local-inventory.xml"]);function Lpe(e){return e.replace(/^https?:\/\//i,"").split("/")[0].toLowerCase()}function $pe(e,t){if(typeof e!="string")return{tipo:"nenhum"};let r=e.trim();if(!r)return{tipo:"nenhum"};if(/^https?:\/\//i.test(r))try{const s=new URL(r);if((Array.isArray(t)?t:[t]).filter(l=>!!l).map(Lpe).includes(s.hostname.toLowerCase()))r=s.pathname;else return{tipo:"externo",url:r}}catch{return{tipo:"externo",url:r}}if(!/^\/(?![/\\])/.test(r))return{tipo:"externo",url:r};const n=r.split("?")[0].split("#")[0].split("/").filter(Boolean);if(n.length===0)return{tipo:"inicio"};const[i,o]=n;if(i==="produtos"&&n.length===1)return{tipo:"produtos"};if(i==="promocoes"&&n.length===1)return{tipo:"promocoes"};if(i==="categoria"&&o){const s=parseInt(o,10);if(Number.isInteger(s)&&s>0)return{tipo:"categoria",id:s}}if(i==="produto"&&o){const s=parseInt(o,10);if(Number.isInteger(s)&&s>0)return{tipo:"produto",id:s}}return n.length===1&&!xj.has(i)?{tipo:"pagina",slug:i}:{tipo:"externo",url:e.trim()}}function xCe(e,t={}){switch(e.tipo){case"nenhum":return null;case"inicio":return"/";case"categoria":{const r=b7(t.categoryName||"");return r?`/categoria/${e.id}-${r}`:`/categoria/${e.id}`}case"produto":{const r=b7(t.productName||"");return r?`/produto/${e.id}-${r}`:`/produto/${e.id}`}case"pagina":return e.slug?`/${e.slug}`:null;case"produtos":return"/produtos";case"promocoes":return"/promocoes";case"externo":{const r=e.url.trim();return r?/^https?:\/\//i.test(r)?r:`https://${r}`:null}}}function Dpe(e){switch(e.tipo){case"categoria":case"produto":return e.id>0;case"pagina":return e.slug.length>0;case"externo":return Mpe(e.url);default:return!0}}function Mpe(e){const t=e.trim();if(!t||/\s/.test(t))return!1;try{const r=new URL(/^https?:\/\//i.test(t)?t:`https://${t}`);return(r.protocol==="http:"||r.protocol==="https:")&&r.hostname.includes(".")}catch{return!1}}function wCe(e){return e==null||e.trim()===""?!0:Dpe($pe(e))}function s_(e){if(!e||e.length<3)return{isValid:!1,reason:"too_short",message:"O link deve ter pelo menos 3 caracteres"};const t=e.toLowerCase().trim();if(_7.includes(t))return{isValid:!1,reason:"forbidden_word",message:"Este link não pode ser usado. Escolha um link mais especÃfico para sua loja."};if(/^\d+$/.test(t))return{isValid:!1,reason:"numeric_only",message:"O link não pode conter apenas números"};for(const r of _7)if(new RegExp(`^${r}\\d+$`,"i").test(t))return{isValid:!1,reason:"forbidden_word",message:"Este nome é muito genérico e não pode ser usado. Escolha um nome mais especÃfico para sua loja."};return{isValid:!0}}function Jp(e){if(!e)return"";let t=e.trim().toLowerCase();t=t.replace(/^https?:\/\/|^https?/i,""),t=t.replace(/^www\./i,"");const r=/(\.com\.br|\.com|\.br)$/i;return r.test(t)&&(t=t.replace(r,"")),t=t.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,50).replace(/-+$/g,""),t.endsWith("combr")&&(t=t.
162slice(0,-5),t=t.replace(/-+$/g,"")),t}function Npe(e){return[/^https?:\/\//i,/^https?/i,/\.(com|com\.br|br)$/i].some(r=>r.test(e.trim()))}function x7(e){return/^https?:\/\/|^https?/i.test(e.trim())}function Fpe(e){return/\.(com|com\.br|br)$/i.test(e.trim())}function ECe(e){if(!e)return"";const t=e.trim().toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,50).replace(/-+$/g,"");return xj.has(t)?`${t}-pagina`:t}function Upe({onNext:e,storeName:t,initialValue:r=""}){const[n,i]=v.useState(r||""),[o,s]=v.useState(Jp(r)||""),[a,l]=v.useState("invalid"),[d,u]=v.useState(null),[h,f]=v.useState(!!r),[p,m]=v.useState(!1),[g,y]=v.useState(!1),{data:b,refetch:E,isLoading:S}=jpe(o);v.useEffect(()=>{if(!r&&t&&!n){const x=Jp(t);i(x),s(x);const C=setTimeout(()=>{f(!0)},600);return()=>clearTimeout(C)}},[t,r]),v.useEffect(()=>{const x=Npe(n),C=x7(n),P=Jp(n);y(C),P!==o&&s(P),x&&m(!0)},[n]),v.useEffect(()=>{if(!o){l("invalid"),u("Obrigatório");return}if(o.length<3){l("invalid"),u("O link deve ter pelo menos 3 caracteres");return}if(!s_(o).isValid){l("invalid"),u("Link não permitido");return}l("loading"),u(null);const C=setTimeout(()=>{E()},500);return()=>clearTimeout(C)},[o,E]),v.useEffect(()=>{if(!(o.length<3||!s_(o).isValid)){if(S){l("loading");return}if(b===void 0){l("error"),u("Erro ao verificar disponibilidade");return}b===!0?(l("valid"),u(null)):(l("invalid"),u("Este link já está em uso"))}},[o,b,S]);const k=x=>{i(x);const C=Jp(x);x&&C!==x&&(l("invalid"),x7(x)?u("URLs não devem começar com 'http' ou 'https'"):Fpe(x)?u("URLs não devem terminar com '.com', '.br', etc."):u("O link contém caracteres não permitidos")),!h&&x.length>0&&f(!0)},A=()=>{i(o),d==="O link contém caracteres não permitidos"&&(u(null),o?o.length<3?(l("invalid"),u("O link deve ter pelo menos 3 caracteres")):E():(l("invalid"),u("Obrigatório")))},w=()=>{a==="valid"&&e(o.trim())},_=a!=="valid";return c.jsxs(ki,{children:[c.jsxs(F,{children:[c.jsx(V,{variant:"h5",fontWeight:600,gutterBottom:!0,children:"Personalize o link da sua loja"}),c.jsx(V,{variant:"body1",color:"text.secondary",gutterBottom:!0,children:"Escolha como será o link para acessar sua loja. Você poderá alterá-lo depois."})]}),c.jsx(me,{spacing:3,children:c.jsxs(rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},children:[c.jsx(Ci,{fullWidth:!0,variant:"outlined",placeholder:"Minha loja incrÃvel",autoFocus:!r,value:n,onChange:x=>k(x.target.value),onBlur:A,error:!!d||a==="error",helperText:d,InputProps:{startAdornment:c.jsx(Us,{position:"start",sx:{backgroundColor:"background.paper",borderRadius:"inherit",padding:"0 8px"},children:c.jsx(JD,{color:"primary"})}),endAdornment:a==="loading"&&c.jsx(Us,{position:"end",children:c.jsx(bn,{size:20,color:"primary"})})},sx:{".MuiOutlinedInput-root":{borderRadius:2},".MuiOutlinedInput-input":{borderRadius:2}}}),p&&c.jsx(rt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.3},children:c.jsxs(F,{sx:{p:2,mt:1,mb:1,borderRadius:2,display:"flex",alignItems:"flex-start",gap:1.5,borderWidth:1,borderStyle:"solid",borderColor:x=>gt(x.palette.primary.main,.3),backgroundColor:x=>gt(x.palette.primary.main,.05)},children:[g?c.jsx(QD,{color:"primary",sx:{mt:.3}}):c.jsx(eM,{color:"primary",sx:{mt:.3}}),c.jsxs(F,{children:[c.jsx(V,{variant:"body2",fontWeight:500,color:"primary.main",gutterBottom:!0,children:g?"Não inclua 'http://' ou 'https://'":"Digite apenas a parte final do link"}),c.jsxs(V,{variant:"body2",color:"text.secondary",children:["Você está criando apenas o identificador que aparecerá no inÃcio da URL da sua loja.",c.jsx("br",{}),c.jsxs(F,{component:"span",sx:{fontWeight:600,fontStyle:"italic"},children:["https://",c.jsx(F,{component:"span",sx:{color:"primary.main"},children:"seu-identificador"}),".stoqui.shop"]})]})]})]})}),c.jsx(Ws,{children:h&&c.jsx(rt.div,{initial:{opacity:0,y:20,height:0},animate:{opacity:1,y:0,height:"auto"},exit:{opacity:0,y:20,height:0},transition:{type:"spring",damping:25,stiffness:300},style:{marginTop:16},children:c.jsxs(F,{sx:{p:2,borderRadius:2,borderColor:x=>a==="invalid"||a==="error"?gt(x.palette.error.main,.5):a==="valid"?gt(x.palette.success.main,.5):gt(x.palette.primary.main,.2),borderWidth:2,borderStyle:"solid",backgroundColor:x=>a==="invalid"||a==="error"?gt(x.palette.error.main,.05):a==="valid"?gt(x.palette.success.main,.05):gt(x.palette.primary.main,.05),position:"relative",overflow:"hidden"},children:[a==="valid"&&c.jsxs(F,{sx:{position:"absolute",right:16,top:16,display:"flex",alignItems:"center",gap:1,color:"success.main",fontWeight:500,fontSize:"0.875rem"},children:[c.jsx(io,{sx:{fontSize:18}}),c.jsx(V,{variant:"body2",fontWeight:500,children:"DisponÃvel"})]}),(a==="invalid"||a==="error")&&d&&o.length>=3&&c.jsxs(F,{sx:{position:"absolute",right:16,top:16,display:"flex",alignItems:"center",gap:1,color:"error.main",fontWeight:500,fontSize:"0.875rem"},children:[c.jsx(tM,{sx:{fontSize:18}}),c.jsx(V,{variant:"body2",fontWeight:500,children:"IndisponÃvel"})]}),c.jsx(V,{variant:"body2",sx:{color:"text.secondary",mb:.5},children:"Sua loja estará disponÃvel em:"}),c.jsxs(V,{variant:"body1",sx:{fontWeight:500,wordBreak:"break-all"},children:[c.jsx(rt.span,{animate:{color:a==="invalid"||a==="error"?"#d32f2f":"#1976d2"},style:{display:"inline-block",fontWeight:600},children:o}),".stoqui.shop"]})]})})})]})}),c.jsx(rt.div,{initial:{opacity:0,y:20}
162,animate:{opacity:1,y:0},transition:{delay:.4},children:c.jsxs(De,{fullWidth:!0,variant:"contained",size:"large",onClick:w,disabled:_,sx:{borderRadius:2,py:1.5,position:"relative",overflow:"hidden"},children:[a==="valid"&&c.jsx(rt.div,{initial:{scale:0,x:"-50%",y:"-50%"},animate:{scale:50},transition:{duration:.5},style:{position:"absolute",left:"50%",top:"50%",width:20,height:20,borderRadius:"50%",backgroundColor:"rgba(255, 255, 255, 0.2)",zIndex:-1}}),a==="loading"?"Verificando...":"Continuar"]})})]})}const Bpe="linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(135deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(135deg, transparent 75%, #ccc 75%) /*! @noflip */",Vpe="linear-gradient(to top, #000000, transparent), linear-gradient(to right, #ffffff, transparent) /*! @noflip */",Hpe={Button:ni(De)(()=>({backgroundSize:"8px 8px",backgroundPosition:"0 0, 4px 0, 4px -4px, 0px 4px",transition:"none",boxShadow:"0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08)",border:0,borderRadius:4,width:"24px",aspectRatio:"1 / 1",height:"24px",minWidth:0}))},zpe=e=>{const{bgColor:t,className:r,disablePopover:n,isBgColorValid:i,...o}=e;return c.jsx(Hpe.Button,{disableTouchRipple:!0,style:{backgroundColor:i?t:void 0,backgroundImage:i?void 0:Bpe,cursor:n?"default":void 0},className:`MuiColorInput-Button ${r||""}`,...o})},Wpe={Container:ni("div")(()=>({width:300,padding:8}))},qpe=({children:e,className:t,position:r="start",...n})=>c.jsx(ID,{className:`MuiColorInput-Popover ${t||""}`,anchorOrigin:{vertical:"bottom",horizontal:r==="start"?"left":"right"},transformOrigin:{vertical:"top",horizontal:r==="start"?"left":"right"},...n,children:c.jsx(Wpe.Container,{children:e})}),Gpe={Slider:ni(jC,{shouldForwardProp:e=>e!=="$rgbaFrom"&&e!=="$rgbaTo"})(()=>({height:8,"& .MuiSlider-rail":{opacity:1,background:"linear-gradient(to right, rgba(var(--rgb-r), var(--rgb-g), var(--rgb-b), 0) 0%, rgba(var(--rgb-r), var(--rgb-g), var(--rgb-b), 1) 100%)"},"& .MuiSlider-track":{color:"transparent",border:0},"& .MuiSlider-thumb":{backgroundColor:"#ffffff",border:"3px solid currentColor"}}))},Kpe=e=>{const{rgbColor:t,style:r,className:n,...i}=e,o={"--rgb-r":t.r,"--rgb-g":t.g,"--rgb-b":t.b,...r};return c.jsx(Gpe.Slider,{className:`MuiColorInput-AlphaSlider ${n||""}`,style:o,...i})},Qp={up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight"},Ype={ArrowUp:{type:"hsvV",value:1},ArrowDown:{type:"hsvV",value:-1},ArrowLeft:{type:"hsvS",value:-1},ArrowRight:{type:"hsvS",value:1}};function Zpe(e){return e===Qp.up||e===Qp.down||e===Qp.left||e===Qp.right}function sm(e,t,r){return Math.max(t,Math.min(e,r))}function w7(e){return typeof e=="number"}function E7(e,t,r){const n=e.toLocaleString("en",{useGrouping:!1,minimumFractionDigits:t,maximumFractionDigits:r});return Number(n)}function Xpe(e,t,r){const n=e.getBoundingClientRect(),i=t-n.left,o=r-n.top;return{x:sm(i/n.width,0,1),y:sm(1-o/n.height,0,1)}}function Jpe(e){const t=Ee.useRef();return t.current=e,Ee.useCallback((...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}const S7={Space:ni("div")(()=>({width:"100%",height:"180px",boxSizing:"border-box",outline:0,position:"relative",backgroundImage:Vpe})),Thumb:ni("div")(()=>({position:"absolute",border:"3px solid #ffffff",borderRadius:"50%",width:"20px",height:"20px",marginLeft:"-10px /*! @noflip */",marginBottom:"-10px /*! @noflip */",outline:0,boxSizing:"border-box",willChange:"left, bottom",transition:"box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms","&:hover":{boxShadow:"0px 0px 0px 4px rgba(255 255 255 / 0.16)"},"&.MuiColorInput-Thumb-active":{boxShadow:"0px 0px 0px 8px rgba(255 255 255 / 0.16)"},"@media (hover: none)":{boxShadow:"none"}}))},Qpe=e=>{const{hsv:t,onChange:r,currentHue:n}=e,i=Ee.useRef(!1),o=Ee.useRef(null),[s,a]=Ee.useState(!1),l=Jpe((g,y)=>{if(!o.current)return;const{x:b,y:E}=Xpe(o.current,g,y);r({s:b,v:E}),o.current&&document.activeElement!==o.current&&o.current.focus()}),d=Ee.useCallback(()=>{i.current&&(i.current=!1,a(!1))},[]),u=Ee.useCallback(g=>{i.current&&l(g.clientX,g.clientY)},[]);Ee.useEffect(()=>(document.addEventListener("pointermove",u,!1),document.addEventListener("pointerup",d,!1),()=>{document.removeEventListener("pointermove",u,!1),document.removeEventListener("pointerup",d,!1)}),[d,u]);const h=g=>{g.preventDefault(),i.current=!0,l(g.clientX,g.clientY),a(!0)},f=g=>{if(Zpe(g.key)){g.preventDefault();const{type:y,value:b}=Ype[g.key],E=g.shiftKey?10:1,S=y==="hsvS"?t.s:t.v,k=sm(S+b*E*.01,0,1);a(!0),r({s:y==="hsvS"?k:t.s,v:y==="hsvV"?k:t.v})}},p=t.s*100,m=t.v*100;return c.jsx(S7.Space,{onPointerDown:h,ref:o,className:"MuiColorInput-ColorSpace",style:{backgroundColor:`hsl(${n} 100% 50%)`,touchAction:"none"},role:"slider","aria-valuetext":`Saturation ${E7(p,0,0)}%, Brightness ${E7(m,0,0)}%`,onKeyDown:f,tabIndex:0,children:c.jsx(S7.Thumb,{"aria-label":"Color space thumb",className:s?"Mu
162iColorInput-Thumb-active":"",style:{left:`${p}%`,bottom:`${m}%`}})})},e0e={Slider:ni(jC)(()=>({height:8,"& .MuiSlider-rail":{opacity:1,background:"linear-gradient(to right, rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%) /*! @noflip */"},"& .MuiSlider-track":{color:"transparent",border:0},"& .MuiSlider-thumb":{backgroundColor:"#ffffff",border:"3px solid currentColor"}}))},t0e=e=>{const{className:t,...r}=e;return c.jsx(e0e.Slider,{className:`MuiColorInput-HueSlider ${t||""}`,...r})};function r0e(e){return typeof e=="string"}function On(e,t){n0e(e)&&(e="100%");const r=i0e(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function e0(e){return Math.min(1,Math.max(0,e))}function n0e(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function i0e(e){return typeof e=="string"&&e.indexOf("%")!==-1}function wj(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function t0(e){return Number(e)<=1?`${Number(e)*100}%`:e}function Bl(e){return e.length===1?"0"+e:String(e)}function o0e(e,t,r){return{r:On(e,255)*255,g:On(t,255)*255,b:On(r,255)*255}}function C7(e,t,r){e=On(e,255),t=On(t,255),r=On(r,255);const n=Math.max(e,t,r),i=Math.min(e,t,r);let o=0,s=0;const a=(n+i)/2;if(n===i)s=0,o=0;else{const l=n-i;switch(s=a>.5?l/(2-n-i):l/(n+i),n){case e:o=(t-r)/l+(t<r?6:0);break;case t:o=(r-e)/l+2;break;case r:o=(e-t)/l+4;break}o/=6}return{h:o,s,l:a}}function Tv(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*(6*r):r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function s0e(e,t,r){let n,i,o;if(e=On(e,360),t=On(t,100),r=On(r,100),t===0)i=r,o=r,n=r;else{const s=r<.5?r*(1+t):r+t-r*t,a=2*r-s;n=Tv(a,s,e+1/3),i=Tv(a,s,e),o=Tv(a,s,e-1/3)}return{r:n*255,g:i*255,b:o*255}}function T7(e,t,r){e=On(e,255),t=On(t,255),r=On(r,255);const n=Math.max(e,t,r),i=Math.min(e,t,r);let o=0;const s=n,a=n-i,l=n===0?0:a/n;if(n===i)o=0;else{switch(n){case e:o=(t-r)/a+(t<r?6:0);break;case t:o=(r-e)/a+2;break;case r:o=(e-t)/a+4;break}o/=6}return{h:o,s:l,v:s}}function a0e(e,t,r){e=On(e,360)*6,t=On(t,100),r=On(r,100);const n=Math.floor(e),i=e-n,o=r*(1-t),s=r*(1-i*t),a=r*(1-(1-i)*t),l=n%6,d=[r,s,o,o,a,r][l],u=[a,r,r,s,o,o][l],h=[o,o,a,r,r,s][l];return{r:d*255,g:u*255,b:h*255}}function A7(e,t,r,n){const i=[Bl(Math.round(e).toString(16)),Bl(Math.round(t).toString(16)),Bl(Math.round(r).toString(16))];return n&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function l0e(e,t,r,n,i){const o=[Bl(Math.round(e).toString(16)),Bl(Math.round(t).toString(16)),Bl(Math.round(r).toString(16)),Bl(c0e(n))];return i&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))&&o[3].startsWith(o[3].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function c0e(e){return Math.round(parseFloat(e)*255).toString(16)}function k7(e){return Ii(e)/255}function Ii(e){return parseInt(e,16)}function u0e(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}const a_={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",s
162almon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function d0e(e){let t={r:0,g:0,b:0},r=1,n=null,i=null,o=null,s=!1,a=!1;return typeof e=="string"&&(e=p0e(e)),typeof e=="object"&&(Cs(e.r)&&Cs(e.g)&&Cs(e.b)?(t=o0e(e.r,e.g,e.b),s=!0,a=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Cs(e.h)&&Cs(e.s)&&Cs(e.v)?(n=t0(e.s),i=t0(e.v),t=a0e(e.h,n,i),s=!0,a="hsv"):Cs(e.h)&&Cs(e.s)&&Cs(e.l)&&(n=t0(e.s),o=t0(e.l),t=s0e(e.h,n,o),s=!0,a="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(r=e.a)),r=wj(r),{ok:s,format:e.format||a,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}const h0e="[-\\+]?\\d+%?",f0e="[-\\+]?\\d*\\.\\d+%?",Na="(?:"+f0e+")|(?:"+h0e+")",Av="[\\s|\\(]+("+Na+")[,|\\s]+("+Na+")[,|\\s]+("+Na+")\\s*\\)?",kv="[\\s|\\(]+("+Na+")[,|\\s]+("+Na+")[,|\\s]+("+Na+")[,|\\s]+("+Na+")\\s*\\)?",fo={CSS_UNIT:new RegExp(Na),rgb:new RegExp("rgb"+Av),rgba:new RegExp("rgba"+kv),hsl:new RegExp("hsl"+Av),hsla:new RegExp("hsla"+kv),hsv:new RegExp("hsv"+Av),hsva:new RegExp("hsva"
162+kv),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function p0e(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;let t=!1;if(a_[e])e=a_[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};let r=fo.rgb.exec(e);return r?{r:r[1],g:r[2],b:r[3]}:(r=fo.rgba.exec(e),r?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=fo.hsl.exec(e),r?{h:r[1],s:r[2],l:r[3]}:(r=fo.hsla.exec(e),r?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=fo.hsv.exec(e),r?{h:r[1],s:r[2],v:r[3]}:(r=fo.hsva.exec(e),r?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=fo.hex8.exec(e),r?{r:Ii(r[1]),g:Ii(r[2]),b:Ii(r[3]),a:k7(r[4]),format:t?"name":"hex8"}:(r=fo.hex6.exec(e),r?{r:Ii(r[1]),g:Ii(r[2]),b:Ii(r[3]),format:t?"name":"hex"}:(r=fo.hex4.exec(e),r?{r:Ii(r[1]+r[1]),g:Ii(r[2]+r[2]),b:Ii(r[3]+r[3]),a:k7(r[4]+r[4]),format:t?"name":"hex8"}:(r=fo.hex3.exec(e),r?{r:Ii(r[1]+r[1]),g:Ii(r[2]+r[2]),b:Ii(r[3]+r[3]),format:t?"name":"hex"}:!1)))))))))}function Cs(e){return!!fo.CSS_UNIT.exec(String(e))}class vr{constructor(t="",r={}){if(t instanceof vr)return t;typeof t=="number"&&(t=u0e(t)),this.originalInput=t;const n=d0e(t);this.originalInput=t,this.r=n.r,this.g=n.g,this.b=n.b,this.a=n.a,this.roundA=Math.round(100*this.a)/100,this.format=r.format??n.format,this.gradientType=r.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=n.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){const t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3}getLuminance(){const t=this.toRgb();let r,n,i;const o=t.r/255,s=t.g/255,a=t.b/255;return o<=.03928?r=o/12.92:r=Math.pow((o+.055)/1.055,2.4),s<=.03928?n=s/12.92:n=Math.pow((s+.055)/1.055,2.4),a<=.03928?i=a/12.92:i=Math.pow((a+.055)/1.055,2.4),.2126*r+.7152*n+.0722*i}getAlpha(){return this.a}setAlpha(t){return this.a=wj(t),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){const{s:t}=this.toHsl();return t===0}toHsv(){const t=T7(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}}toHsvString(){const t=T7(this.r,this.g,this.b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.v*100);return this.a===1?`hsv(${r}, ${n}%, ${i}%)`:`hsva(${r}, ${n}%, ${i}%, ${this.roundA})`}toHsl(){const t=C7(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}}toHslString(){const t=C7(this.r,this.g,this.b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.l*100);return this.a===1?`hsl(${r}, ${n}%, ${i}%)`:`hsla(${r}, ${n}%, ${i}%, ${this.roundA})`}toHex(t=!1){return A7(this.r,this.g,this.b,t)}toHexString(t=!1){return"#"+this.toHex(t)}toHex8(t=!1){return l0e(this.r,this.g,this.b,this.a,t)}toHex8String(t=!1){return"#"+this.toHex8(t)}toHexShortString(t=!1){return this.a===1?this.toHexString(t):this.toHex8String(t)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){const t=Math.round(this.r),r=Math.round(this.g),n=Math.round(this.b);return this.a===1?`rgb(${t}, ${r}, ${n})`:`rgba(${t}, ${r}, ${n}, ${this.roundA})`}toPercentageRgb(){const t=r=>`${Math.round(On(r,255)*100)}%`;return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}}toPercentageRgbString(){const t=r=>Math.round(On(r,255)*100);return this.a===1?`rgb(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%)`:`rgba(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%, ${this.roundA})`}toName(){if(this.a===0)return"transparent";if(this.a<1)return!1;const t="#"+A7(this.r,this.g,this.b,!1);for(const[r,n]of Object.entries(a_))if(t===n)return r;return!1}toString(t){const r=!!t;t=t??this.format;let n=!1;const i=this.a<1&&this.a>=0;return!r&&i&&(t.startsWith("hex")||t==="name")?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(n=this.toRgbString()),t==="prgb"&&(n=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(n=this.toHexString()),t==="hex3"&&(n=this.toHexString(!0)),t==="hex4"&&(n=this.toHex8String(!0)),t==="hex8"&&(n=this.toHex8String()),t==="name"&&(n=this.toName()),t==="hsl"&&(n=this.toHslString()),t==="hsv"&&(n=this.toHsvString()),n||this.toHexString())}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new vr(this.toString())}lighten(t=10){const r=this.toHsl();return r.l+=t/100,r.l=e0(r.l),new vr(r)}brighten(t=10){const r=this.toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),new vr(r)}darken(t=10){const r=this.toHsl();return r.l-=t/100,r.l=e0(r.l),new vr(r)}tint(t=10){return this.mix("white",t)}shade(t=10){return this.mix("black",t)}desaturate(t=10){const r=this.toHsl();return r.s-=t/100,r.s=e0(r.s),new vr(r)}saturate(t=10){const r=this.toHsl();return r.s+=t/100,r.s=e0(r.s),new vr(r)}greyscale(){return this.desaturate(100)}spin(t){const r=this.toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,new vr(r)}mix(t,r=50){const n=this.toRgb(),i=new vr(t).toRgb(),o=r/100,s={r:(i.r-n.r)*o+n.r,g:(i.g-n.g)*o+n.g,b:(i.b-n.b)*o+n.b,a:(i.a-n.a)
162*o+n.a};return new vr(s)}analogous(t=6,r=30){const n=this.toHsl(),i=360/r,o=[this];for(n.h=(n.h-(i*t>>1)+720)%360;--t;)n.h=(n.h+i)%360,o.push(new vr(n));return o}complement(){const t=this.toHsl();return t.h=(t.h+180)%360,new vr(t)}monochromatic(t=6){const r=this.toHsv(),{h:n}=r,{s:i}=r;let{v:o}=r;const s=[],a=1/t;for(;t--;)s.push(new vr({h:n,s:i,v:o})),o=(o+a)%1;return s}splitcomplement(){const t=this.toHsl(),{h:r}=t;return[this,new vr({h:(r+72)%360,s:t.s,l:t.l}),new vr({h:(r+216)%360,s:t.s,l:t.l})]}onBackground(t){const r=this.toRgb(),n=new vr(t).toRgb(),i=r.a+n.a*(1-r.a);return new vr({r:(r.r*r.a+n.r*n.a*(1-r.a))/i,g:(r.g*r.a+n.g*n.a*(1-r.a))/i,b:(r.b*r.a+n.b*n.a*(1-r.a))/i,a:i})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(t){const r=this.toHsl(),{h:n}=r,i=[this],o=360/t;for(let s=1;s<t;s++)i.push(new vr({h:(n+s*o)%360,s:r.s,l:r.l}));return i}equals(t){return this.toRgbString()===new vr(t).toRgbString()}}function _u(e,t){return e.toString(t)}function R7(e,t,r){return new vr(e,r)}function m0e(e){return r0e(e)?e:new vr(e).toString()}const g0e=e=>{const{currentColor:t,format:r,onChange:n,isAlphaHidden:i}=e,[o,s]=Ee.useState(t.toHsv()),a=(u,h)=>{if(!w7(h))return;const f=sm(360*h/100,0,359);s(m=>({...m,h:f}));const p=new vr({...o,a:t.toHsv().a,h:f});n==null||n(_u(p,r))},l=(u,h)=>{if(!w7(h))return;const f=t.clone().setAlpha(h);n==null||n(_u(f,r))},d=({s:u,v:h})=>{const f=new vr({h:o.h,a:t.toHsv().a,s:u,v:h});s(p=>({...p,s:u,v:h})),n==null||n(_u(f,r))};return c.jsxs(F,{className:"MuiColorInput-PopoverBody",children:[c.jsx(Qpe,{currentHue:o.h,hsv:o,onChange:d}),c.jsx(F,{mt:"10px",px:"3px",children:c.jsx(t0e,{min:0,max:100,step:1,onChange:a,"aria-label":"hue",value:o.h*100/360})}),i?null:c.jsx(F,{mt:"10px",px:"3px",children:c.jsx(Kpe,{min:0,max:1,step:.01,"aria-label":"alpha",rgbColor:t.toRgb(),onChange:l,value:t.getAlpha()})})]})},v0e=Ee.forwardRef((e,t)=>{const{className:r,...n}=e;return c.jsx(Ci,{className:`MuiColorInput-TextField ${r||""}`,ref:t,...n})}),y0e="black",_0e="rgb";function b0e(e){return typeof e=="object"&&!Array.isArray(e)&&e!==null}function I7(e,t){typeof t=="function"?t(e):t&&b0e(t)&&"current"in t&&(t.current=e)}const x0e=Ee.forwardRef((e,t)=>{const{value:r,format:n,onChange:i,adornmentPosition:o="start",PopoverProps:s,Adornment:a=zpe,fallbackValue:l,isAlphaHidden:d,disablePopover:u,...h}=e,{onBlur:f,InputProps:p,...m}=h,{onClose:g,...y}=s||{},b=l||y0e,E=m.disabled||(p==null?void 0:p.disabled)||!1,S=Ee.useRef(null),k=Ee.useRef(null),[A,w]=Ee.useState(null),_=n||_0e,x=R7(r,b,{format:_}),[C,P]=Ee.useState(r),[I,O]=Ee.useState(r),D=J=>{J.preventDefault(),J.stopPropagation(),!E&&!u&&w(S.current)},M=J=>{const xe=new vr(J);i==null||i(J,{hex:xe.isValid?xe.toHexString():"",hsv:xe.isValid?xe.toHsvString():"",hsl:xe.isValid?xe.toHslString():"",rgb:xe.isValid?xe.toRgbString():"",hex8:xe.isValid?xe.toHex8String():""})},U=J=>{const xe=J.target.value;if(P(xe),xe==="")O(""),M("");else{const Ze=new vr(xe),$e=_u(Ze,_);O($e),M($e)}},$=(...J)=>{g==null||g(...J),w(null),queueMicrotask(()=>{var xe;(xe=k.current)==null||xe.focus()})},j=J=>{f==null||f(J);const xe=new vr(C);if(xe.isValid)xe.format!==_&&P(_u(xe,_));else{if(C==="")return;const Ze=new vr(b),$e=_u(Ze,_);P($e),O($e),M($e)}};Ee.useEffect(()=>{if(r!==I){const J=R7(r).originalInput;O(J),P(J)}},[r,I,b]);const q=J=>{P(J),O(J),M(J)},W=J=>{S.current=J,t&&I7(J,t)},ne=J=>{k.current=J,k&&I7(J,k)},ae=!!A,re=ae?"color-popover":void 0,_e=c.jsx(Us,{position:o,children:c.jsx(a,{disabled:E,"aria-describedby":re,disablePopover:u||!1,component:u?"span":void 0,bgColor:x.toString(),isBgColorValid:!!(C!==""&&x.isValid),onClick:u?void 0:D})}),be=o==="start"?{startAdornment:_e}:{endAdornment:_e};return c.jsxs(c.Fragment,{children:[c.jsx(v0e,{ref:W,spellCheck:"false",type:"text",autoComplete:"off",onChange:U,value:m0e(C),onBlur:j,inputRef:ne,disabled:E,InputProps:{...be,...p},...m}),u?null:c.jsx(qpe,{id:re,open:ae,position:o,anchorEl:A,onClose:$,...y,children:c.jsx(g0e,{onChange:q,currentColor:x,format:_,isAlphaHidden:d})})]})}),w0e=["#212121","#424242","#455A64","#0B0B45","#3F51B5","#5E6638","#795548","#880E4F","#C30010","#FF4F00","#FF6F61","#FF9800","#FFC107","#CDDC39","#E75480","#9C27B0","#6546CF","#4CAF50","#8BC34A","#009688","#00BCD4","#2196F3"];function E0e({onNext:e,defaultColor:t=""}){const[r,n]=v.useState(t),i=v.useRef(null),o=u=>{n(u)},s=u=>{n(u)},a=()=>
162{if(i.current){const u=i.current.querySelector(".MuiColorInput-Button");u&&u.click()}},l=()=>{r&&e(r)},d=!!r;return c.jsxs(ki,{children:[c.jsxs(F,{children:[c.jsx(V,{variant:"h5",fontWeight:600,gutterBottom:!0,children:"Escolha a cor principal da sua loja"}),c.jsx(V,{variant:"body1",color:"text.secondary",gutterBottom:!0,children:"Esta cor será usada em elementos importantes da sua loja online"})]}),c.jsxs(me,{spacing:2.5,sx:{overflowY:"auto"},children:[c.jsx(rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},ref:i,children:c.jsxs(F,{sx:{mb:1},children:[c.jsx(V,{variant:"body2",fontWeight:500,gutterBottom:!0,children:"Cor selecionada:"}),c.jsx(x0e,{value:r,onChange:s,format:"hex",fullWidth:!0,sx:{".MuiOutlinedInput-root":{borderRadius:2},".MuiOutlinedInput-input":{borderRadius:2}}})]})}),c.jsxs(rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},children:[c.jsx(V,{variant:"body2",fontWeight:500,gutterBottom:!0,children:"Escolha uma cor:"}),c.jsxs(F,{sx:{display:"grid",gridTemplateColumns:"repeat(6, 1fr)",gap:1,padding:.5},children:[w0e.map(u=>c.jsx(rt.div,{whileTap:{scale:.9},onClick:()=>o(u),children:c.jsx(F,{sx:{height:36,borderRadius:1,backgroundColor:u,cursor:"pointer",position:"relative",boxSizing:"border-box","&::after":r===u?{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,borderRadius:"inherit",border:"2px solid white",boxShadow:`0px 0px 0px 2px ${u}`,pointerEvents:"none"}:{}}})},u)),c.jsx(rt.div,{whileTap:{scale:.9},onClick:a,children:c.jsx(F,{sx:{height:36,borderRadius:1,backgroundColor:"#f5f5f5",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",border:"1px dashed #bdbdbd",transition:"all 0.2s"},children:c.jsx(FC,{sx:{fontSize:18,color:"#757575"}})})})]})]})]}),c.jsx(De,{fullWidth:!0,variant:"contained",size:"large",onClick:l,disabled:!d,sx:{borderRadius:2,py:1.5},children:"Continuar"})]})}const S0e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Lg=(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+=S0e[r[e]&63];return t};function C0e(e,t){return t.forEach(function(r){r&&typeof r!="string"&&!Array.isArray(r)&&Object.keys(r).forEach(function(n){if(n!=="default"&&!(n in e)){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}})}),Object.freeze(e)}function Ej(e,t){return new Promise(function(r,n){let i;return T0e(e).then(function(o){try{return i=o,r(new Blob([t.slice(0,2),i,t.slice(2)],{type:"image/jpeg"}))}catch(s){return n(s)}},n)})}const T0e=e=>new Promise((t,r)=>{const n=new FileReader;n.addEventListener("load",({target:{result:i}})=>{const o=new DataView(i);let s=0;if(o.getUint16(s)!==65496)return r("not a valid JPEG");for(s+=2;;){const a=o.getUint16(s);if(a===65498)break;const l=o.getUint16(s+2);if(a===65505&&o.getUint32(s+4)===1165519206){const d=s+10;let u;switch(o.getUint16(d)){case 18761:u=!0;break;case 19789:u=!1;break;default:return r("TIFF header contains invalid endian")}if(o.getUint16(d+2,u)!==42)return r("TIFF header contains invalid version");const h=o.getUint32(d+4,u),f=d+h+2+12*o.getUint16(d+h,u);for(let p=d+h+2;p<f;p+=12)if(o.getUint16(p,u)==274){if(o.getUint16(p+2,u)!==3)return r("Orientation data type is invalid");if(o.getUint32(p+4,u)!==1)return r("Orientation data count is invalid");o.setUint16(p+8,1,u);break}return t(i.slice(s,s+2+l))}s+=2+l}return t(new Blob)}),n.readAsArrayBuffer(e)});var am={},A0e={get exports(){return am},set exports(e){am=e}};(function(e){var t,r,n={};A0e.exports=n,n.parse=function(i,o){for(var s=n.bin.readUshort,a=n.bin.readUint,l=0,d={},u=new Uint8Array(i),h=u.length-4;a(u,h)!=101010256;)h--;l=h,l+=4;var f=s(u,l+=4);s(u,l+=2);var p=a(u,l+=2),m=a(u,l+=4);l+=4,l=m;for(var g=0;g<f;g++){a(u,l),l+=4,l+=4,l+=4,a(u,l+=4),p=a(u,l+=4);var y=a(u,l+=4),b=s(u,l+=4),E=s(u,l+2),S=s(u,l+4);l+=6;var k=a(u,l+=8);l+=4,l+=b+E+S,n._readLocal(u,k,d,p,y,o)}return d},n._readLocal=function(i,o,s,a,l,d){var u=n.bin.readUshort,h=n.bin.readUint;h(i,o),u(i,o+=4),u(i,o+=2);var f=u(i,o+=2);h(i,o+=2),h(i,o+=4),o+=4;var p=u(i,o+=8),m=u(i,o+=2);o+=2;var g=n.bin.readUTF8(i,o,p);if(o+=p,o+=m,d)s[g]={size:l,csize:a};else{var y=new Uint8Array(i.buffer,o);if(f==0)s[g]=new Uint8Array(y.buffer.slice(o,o+a));else{if(f!=8)throw"unknown compression method: "+f;var b=new Uint8Array(l);n.inflateRaw(y,b),s[g]=b}}},n.inflateRaw=function(i,o){return n.F.inflate(i,o)},n.inflate=function(i,o){return i[0],i[1],n.inflateRaw(new Uint8Array(i.buffer,i.byteOffset+2,i.length-6),o)},n.deflate=function(i,o){o==null&&(o={level:6});var s=0,a=new Uint8Array(50+Math.floor(1.1*i.length));a[s]=120,a[s+1]=156,s+=2,s=n.F.deflateRaw(i,a,s,o.level);var l=n.adler(i,0,i.length);return a[s+0]=l>>>24&255,a[s+1]=l>>>16&255,a[s+2]=l>>>8&255,a[s+3]=l>>>0&255,new Uint8Array(a.buffer,0,s+4)},n.deflateRaw=function(i,o){o==null&&(o={level:6});var s=new Uint8Array(50+Math.floor(1.1*i.length)),a=n.F.deflateRaw(i,s,a,o.level);return new Uint8Array(s.buffer,0,a)},n.encode=function(i,o){o==null&&(o=!1);var s=0,a=n.bin.writeUint,l=n.bin.writeUshort,d={};for(var u in i){var h=!n._noNeed(u)&&!o,f=i[u],p=n.crc.crc(f,0,f.length);d[u]={cpr:h,usize:f.length,crc:p,file:h?n.deflateRaw(f):f}}for(var u in d)s+=d[u].file.length+30+46+2*n.bin.sizeUTF8(u);s+=22;var m=new Uint8Array(s),g=0,y=[];for(var u in d){var b=d[u];y.push(g),g=n._writeHeader(m,g,u,b,0)}var E=0,S=g;for(var u in d)b=d[u],y.push(g),g=n._writeHeader(m,g,u,b,1,y[E++]);var k=g-S;return a(m,g,101010256),g+=4,l(m,g+=4,E),l(m,g+=2,E),a(m,g+=2,k),a(m,g+=4,S),g+=4,g+=2,m.buffer},n._noNeed=function(i){var o=i.split(".").pop().toLowerCase();return"png,jpg,jpeg,zip".indexOf(o)!=-1},n._writeHeader=function(i,o,s,a,l,d){var u=n.bin.writeUint,h=n.bin.writeUshort,f=a.file;return u(i,o,l==0?67324752:33639248),o+=4,l==1&&(o+=2),h(i,o,20),h(i,o+=2,0),h(i,o+=2,a.cpr?8:0),u(i,o+=2,0),u(i,o+=4,a.crc),u(i,o+=4,f.length),u(i,o+=4,a.usize),h(i,o+=4,n.bin.sizeUTF8(s)),h(i,o+=2,0),o+=2,l==1&&(o+=2,o+=2,u(i,o+=6,d),o+=4),o+=n.bin.writeUTF8(i,o,s),l==0&&(i.set(f,o),o+=f.length),o},n.crc={table:function(){for(var i=new Uint32Array(256),o=0;o<256;o++){for(var s=o,a=0;a<8;a++)1&s?s=3988292384^s>>>1:s>>>=1;i[o]=s}return i}(),update:function(i,o,s,a){for(var l=0;l<a;l++)i=n.crc.table[255&(i^o[s+l])]^i>>>8;return i},crc:function(i,o,s){return 4294967295^n.crc.update(4294967295,i,o,s)}},n.adler=function(i,o,s){for(var a=1,l=0,d=o,u=o+s;d<u;){for(var h=Math.min(d+5552,u);d<h;)l+=a+=i[d++];a%=65521,l%=65521}return l<<16|a},n.bin={readUshort:function(i,o){return i[o]|i[o+1]<<8},writeUshort:function(i,o,s){i[o]=255&s,i[o+1]=s>>8&255},readUint:function(i,o){return 16777216*i[o+3]+(i[o+2]<<16|i[o+1]<<8|i[o])},writeUint:function(i,o,s){i[o]=255&s,i[o+1]=s>>8&255,i[o+2]=s>>16&255,i[o+3]=s>>24&255},readASCII:function(i,o,s){for(var a="",l=0;l<s;l++)a+=String.fromCharCode(i[o+l]);return a},writeASCII:function(i,o,s){for(var a=0;a<s.length;a++)i[o+a]=s.charCodeAt(a)},pad:function(i){return i.length<2?"0"+i:i},readUTF8:function(i,o,s){for(var a,l="",d=0;d<s;d++)l+="%"+n.bin.pad(i[o+d].toString(16));try{a=decodeURIComponent(l)}catch{return n.bin.readASCII(i,o,s)}return a},writeUTF8:function(i,o,s){for(var a=s.length,l=0,d=0;d<a;d++){var u=s.charCodeAt(d);if(!(4294967168&u))i[o+l]=u,l++;else if(!(4294965248&u))i[o+l]=192|u>>6,i[o+l+1]=128|u>>0&63,l+=2;else if(!(4294901760&u))i[o+l]=224|u>>12,i[o+l+1]=128|u>>6&63,i[o+l+2]=128|u>>0&63,l+=3;else{if(4292870144&u)throw"e";i[o+l]=240|u>>18,i[o+l+1]=128|u>>12&63,i[o+l+2]=128|u>>6&63,i[o+l+3]=128|u>>0&63,l+=4}}return l},sizeUTF8:function(i){for(var o=i.length,s=0,a=0;a<o;a++){var l=i.charCodeAt(a);if(!(4294967168&l))s++;else if(!(4294965248&l))s+=2;else if(!(4294901760&l))s+=3;else{if(4292870144&l)throw"e";s+=4}}return s}},n.F={},n.F.deflateRaw=function(i,o,s,a){var l=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][a],d=n.F.U,u=n.F._goodIndex;n.F._hash;var h=n.F._putsE,f=0,p=s<<3,m=0,g=i.length;if(a==0){for(;f<g;)h(o,p,f+(I=Math.min(65535,g-f))==g?1:0),p=n.F._copyExact(i,f,I,o,p+8),f+=I;return p>>>3}var y=d.lits,b=d.strt,E=d.prev,S=0,k=0,A=0,w=0,_=0,x=0;for(g>2&&(b[x=n.F._hash(i,0)]=0),f=0;f<g;
162f++){if(_=x,f+1<g-2){x=n.F._hash(i,f+1);var C=f+1&32767;E[C]=b[x],b[x]=C}if(m<=f){(S>14e3||k>26697)&&g-f>100&&(m<f&&(y[S]=f-m,S+=2,m=f),p=n.F._writeBlock(f==g-1||m==g?1:0,y,S,w,i,A,f-A,o,p),S=k=w=0,A=f);var P=0;f<g-2&&(P=n.F._bestMatch(i,f,E,_,Math.min(l[2],g-f),l[3]));var I=P>>>16,O=65535&P;if(P!=0){O=65535&P;var D=u(I=P>>>16,d.of0);d.lhst[257+D]++;var M=u(O,d.df0);d.dhst[M]++,w+=d.exb[D]+d.dxb[M],y[S]=I<<23|f-m,y[S+1]=O<<16|D<<8|M,S+=2,m=f+I}else d.lhst[i[f]]++;k++}}for(A==f&&i.length!=0||(m<f&&(y[S]=f-m,S+=2,m=f),p=n.F._writeBlock(1,y,S,w,i,A,f-A,o,p),S=0,k=0,S=k=w=0,A=f);7&p;)p++;return p>>>3},n.F._bestMatch=function(i,o,s,a,l,d){var u=32767&o,h=s[u],f=u-h+32768&32767;if(h==u||a!=n.F._hash(i,o-f))return 0;for(var p=0,m=0,g=Math.min(32767,o);f<=g&&--d!=0&&h!=u;){if(p==0||i[o+p]==i[o+p-f]){var y=n.F._howLong(i,o,f);if(y>p){if(m=f,(p=y)>=l)break;f+2<y&&(y=f+2);for(var b=0,E=0;E<y-2;E++){var S=o-f+E+32768&32767,k=S-s[S]+32768&32767;k>b&&(b=k,h=S)}}}f+=(u=h)-(h=s[u])+32768&32767}return p<<16|m},n.F._howLong=function(i,o,s){if(i[o]!=i[o-s]||i[o+1]!=i[o+1-s]||i[o+2]!=i[o+2-s])return 0;var a=o,l=Math.min(i.length,o+258);for(o+=3;o<l&&i[o]==i[o-s];)o++;return o-a},n.F._hash=function(i,o){return(i[o]<<8|i[o+1])+(i[o+2]<<4)&65535},n.saved=0,n.F._writeBlock=function(i,o,s,a,l,d,u,h,f){var p,m,g,y,b,E,S,k,A,w=n.F.U,_=n.F._putsF,x=n.F._putsE;w.lhst[256]++,m=(p=n.F.getTrees())[0],g=p[1],y=p[2],b=p[3],E=p[4],S=p[5],k=p[6],A=p[7];var C=32+(f+3&7?8-(f+3&7):0)+(u<<3),P=a+n.F.contSize(w.fltree,w.lhst)+n.F.contSize(w.fdtree,w.dhst),I=a+n.F.contSize(w.ltree,w.lhst)+n.F.contSize(w.dtree,w.dhst);I+=14+3*S+n.F.contSize(w.itree,w.ihst)+(2*w.ihst[16]+3*w.ihst[17]+7*w.ihst[18]);for(var O=0;O<286;O++)w.lhst[O]=0;for(O=0;O<30;O++)w.dhst[O]=0;for(O=0;O<19;O++)w.ihst[O]=0;var D=C<P&&C<I?0:P<I?1:2;if(_(h,f,i),_(h,f+1,D),f+=3,D==0){for(;7&f;)f++;f=n.F._copyExact(l,d,u,h,f)}else{var M,U;if(D==1&&(M=w.fltree,U=w.fdtree),D==2){n.F.makeCodes(w.ltree,m),n.F.revCodes(w.ltree,m),n.F.makeCodes(w.dtree,g),n.F.revCodes(w.dtree,g),n.F.makeCodes(w.itree,y),n.F.revCodes(w.itree,y),M=w.ltree,U=w.dtree,x(h,f,b-257),x(h,f+=5,E-1),x(h,f+=5,S-4),f+=4;for(var $=0;$<S;$++)x(h,f+3*$,w.itree[1+(w.ordr[$]<<1)]);f+=3*S,f=n.F._codeTiny(k,w.itree,h,f),f=n.F._codeTiny(A,w.itree,h,f)}for(var j=d,q=0;q<s;q+=2){for(var W=o[q],ne=W>>>23,ae=j+(8388607&W);j<ae;)f=n.F._writeLit(l[j++],M,h,f);if(ne!=0){var re=o[q+1],_e=re>>16,be=re>>8&255,J=255&re;x(h,f=n.F._writeLit(257+be,M,h,f),ne-w.of0[be]),f+=w.exb[be],_(h,f=n.F._writeLit(J,U,h,f),_e-w.df0[J]),f+=w.dxb[J],j+=ne}}f=n.F._writeLit(256,M,h,f)}return f},n.F._copyExact=function(i,o,s,a,l){var d=l>>>3;return a[d]=s,a[d+1]=s>>>8,a[d+2]=255-a[d],a[d+3]=255-a[d+1],d+=4,a.set(new Uint8Array(i.buffer,o,s),d),l+(s+4<<3)},n.F.getTrees=function(){for(var i=n.F.U,o=n.F._hufTree(i.lhst,i.ltree,15),s=n.F._hufTree(i.dhst,i.dtree,15),a=[],l=n.F._lenCodes(i.ltree,a),d=[],u=n.F._lenCodes(i.dtree,d),h=0;h<a.length;h+=2)i.ihst[a[h]]++;for(h=0;h<d.length;h+=2)i.ihst[d[h]]++;for(var f=n.F._hufTree(i.ihst,i.itree,7),p=19;p>4&&i.itree[1+(i.ordr[p-1]<<1)]==0;)p--;return[o,s,f,l,u,p,a,d]},n.F.getSecond=function(i){for(var o=[],s=0;s<i.length;s+=2)o.push(i[s+1]);return o},n.F.nonZero=function(i){for(var o="",s=0;s<i.length;s+=2)i[s+1]!=0&&(o+=(s>>1)+",");return o},n.F.contSize=function(i,o){for(var s=0,a=0;a<o.length;a++)s+=o[a]*i[1+(a<<1)];return s},n.F._codeTiny=function(i,o,s,a){for(var l=0;l<i.length;l+=2){var d=i[l],u=i[l+1];a=n.F._writeLit(d,o,s,a);var h=d==16?2:d==17?3:7;d>15&&(n.F._putsE(s,a,u,h),a+=h)}return a},n.F._lenCodes=function(i,o){for(var s=i.length;s!=2&&i[s-1]==0;)s-=2;for(var a=0;a<s;a+=2){var l=i[a+1],d=a+3<s?i[a+3]:-1,u=a+5<s?i[a+5]:-1,h=a==0?-1:i[a-1];if(l==0&&d==l&&u==l){for(var f=a+5;f+2<s&&i[f+2]==l;)f+=2;(p=Math.min(f+1-a>>>1,138))<11?o.push(17,p-3):o.push(18,p-11),a+=2*p-2}else if(l==h&&d==l&&u==l){for(f=a+5;f+2<s&&i[f+2]==l;)f+=2;var p=Math.min(f+1-a>>>1,6);o.push(16,p-3),a+=2*p-2}else o.push(l,0)}return s>>>1},n.F._hufTree=function(i,o,s){var a=[],l=i.length,d=o.length,u=0;for(u=0;u<d;u+=2)o[u]=0,o[u+1]=0;for(u=0;u<l;u++)i[u]!=0&&a.push({lit:u,f:i[u]});var h=a.length,f=a.slice(0);if(h==0)return 0;if(h==1){var p=a[0].lit;return f=p==0?1:0,o[1+(p<<1)]=1,o[1+(f<<1)]=1,1}a.sort(function(k,A){return k.f-A.f});var m=a[0],g=a[1],y=0,b=1,E=2;
162for(a[0]={lit:-1,f:m.f+g.f,l:m,r:g,d:0};b!=h-1;)m=y!=b&&(E==h||a[y].f<a[E].f)?a[y++]:a[E++],g=y!=b&&(E==h||a[y].f<a[E].f)?a[y++]:a[E++],a[b++]={lit:-1,f:m.f+g.f,l:m,r:g};var S=n.F.setDepth(a[b-1],0);for(S>s&&(n.F.restrictDepth(f,s,S),S=s),u=0;u<h;u++)o[1+(f[u].lit<<1)]=f[u].d;return S},n.F.setDepth=function(i,o){return i.lit!=-1?(i.d=o,o):Math.max(n.F.setDepth(i.l,o+1),n.F.setDepth(i.r,o+1))},n.F.restrictDepth=function(i,o,s){var a=0,l=1<<s-o,d=0;for(i.sort(function(h,f){return f.d==h.d?h.f-f.f:f.d-h.d}),a=0;a<i.length&&i[a].d>o;a++){var u=i[a].d;i[a].d=o,d+=l-(1<<s-u)}for(d>>>=s-o;d>0;)(u=i[a].d)<o?(i[a].d++,d-=1<<o-u-1):a++;for(;a>=0;a--)i[a].d==o&&d<0&&(i[a].d--,d++);d!=0&&console.log("debt left")},n.F._goodIndex=function(i,o){var s=0;return o[16|s]<=i&&(s|=16),o[8|s]<=i&&(s|=8),o[4|s]<=i&&(s|=4),o[2|s]<=i&&(s|=2),o[1|s]<=i&&(s|=1),s},n.F._writeLit=function(i,o,s,a){return n.F._putsF(s,a,o[i<<1]),a+o[1+(i<<1)]},n.F.inflate=function(i,o){var s=Uint8Array;if(i[0]==3&&i[1]==0)return o||new s(0);var a=n.F,l=a._bitsF,d=a._bitsE,u=a._decodeTiny,h=a.makeCodes,f=a.codes2map,p=a._get17,m=a.U,g=o==null;g&&(o=new s(i.length>>>2<<3));for(var y,b,E=0,S=0,k=0,A=0,w=0,_=0,x=0,C=0,P=0;E==0;)if(E=l(i,P,1),S=l(i,P+1,2),P+=3,S!=0){if(g&&(o=n.F._check(o,C+(1<<17))),S==1&&(y=m.flmap,b=m.fdmap,_=511,x=31),S==2){k=d(i,P,5)+257,A=d(i,P+5,5)+1,w=d(i,P+10,4)+4,P+=14;for(var I=0;I<38;I+=2)m.itree[I]=0,m.itree[I+1]=0;var O=1;for(I=0;I<w;I++){var D=d(i,P+3*I,3);m.itree[1+(m.ordr[I]<<1)]=D,D>O&&(O=D)}P+=3*w,h(m.itree,O),f(m.itree,O,m.imap),y=m.lmap,b=m.dmap,P=u(m.imap,(1<<O)-1,k+A,i,P,m.ttree);var M=a._copyOut(m.ttree,0,k,m.ltree);_=(1<<M)-1;var U=a._copyOut(m.ttree,k,A,m.dtree);x=(1<<U)-1,h(m.ltree,M),f(m.ltree,M,y),h(m.dtree,U),f(m.dtree,U,b)}for(;;){var $=y[p(i,P)&_];P+=15&$;var j=$>>>4;if(!(j>>>8))o[C++]=j;else{if(j==256)break;var q=C+j-254;if(j>264){var W=m.ldef[j-257];q=C+(W>>>3)+d(i,P,7&W),P+=7&W}var ne=b[p(i,P)&x];P+=15≠var ae=ne>>>4,re=m.ddef[ae],_e=(re>>>4)+l(i,P,15&re);for(P+=15&re,g&&(o=n.F._check(o,C+(1<<17)));C<q;)o[C]=o[C++-_e],o[C]=o[C++-_e],o[C]=o[C++-_e],o[C]=o[C++-_e];C=q}}}else{7&P&&(P+=8-(7&P));var be=4+(P>>>3),J=i[be-4]|i[be-3]<<8;g&&(o=n.F._check(o,C+J)),o.set(new s(i.buffer,i.byteOffset+be,J),C),P=be+J<<3,C+=J}return o.length==C?o:o.slice(0,C)},n.F._check=function(i,o){var s=i.length;if(o<=s)return i;var a=new Uint8Array(Math.max(s<<1,o));return a.set(i,0),a},n.F._decodeTiny=function(i,o,s,a,l,d){for(var u=n.F._bitsE,h=n.F._get17,f=0;f<s;){var p=i[h(a,l)&o];l+=15&p;var m=p>>>4;if(m<=15)d[f]=m,f++;else{var g=0,y=0;m==16?(y=3+u(a,l,2),l+=2,g=d[f-1]):m==17?(y=3+u(a,l,3),l+=3):m==18&&(y=11+u(a,l,7),l+=7);for(var b=f+y;f<b;)d[f]=g,f++}}return l},n.F._copyOut=function(i,o,s,a){for(var l=0,d=0,u=a.length>>>1;d<s;){var h=i[d+o];a[d<<1]=0,a[1+(d<<1)]=h,h>l&&(l=h),d++}for(;d<u;)a[d<<1]=0,a[1+(d<<1)]=0,d++;return l},n.F.makeCodes=function(i,o){for(var s,a,l,d,u=n.F.U,h=i.length,f=u.bl_count,p=0;p<=o;p++)f[p]=0;for(p=1;p<h;p+=2)f[i[p]]++;var m=u.next_code;for(s=0,f[0]=0,a=1;a<=o;a++)s=s+f[a-1]<<1,m[a]=s;for(l=0;l<h;l+=2)(d=i[l+1])!=0&&(i[l]=m[d],m[d]++)},n.F.codes2map=function(i,o,s){for(var a=i.length,l=n.F.U.rev15,d=0;d<a;d+=2)if(i[d+1]!=0)for(var u=d>>1,h=i[d+1],f=u<<4|h,p=o-h,m=i[d]<<p,g=m+(1<<p);m!=g;)s[l[m]>>>15-o]=f,m++},n.F.revCodes=function(i,o){for(var s=n.F.U.rev15,a=15-o,l=0;l<i.length;l+=2){var d=i[l]<<o-i[l+1];i[l]=s[d]>>>a}},n.F._putsE=function(i,o,s){s<<=7&o;var a=o>>>3;i[a]|=s,i[a+1]|=s>>>8},n.F._putsF=function(i,o,s){s<<=7&o;var a=o>>>3;i[a]|=s,i[a+1]|=s>>>8,i[a+2]|=s>>>16},n.F._bitsE=function(i,o,s){return(i[o>>>3]|i[1+(o>>>3)]<<8)>>>(7&o)&(1<<s)-1},n.F._bitsF=function(i,o,s){return(i[o>>>3]|i[1+(o>>>3)]<<8|i[2+(o>>>3)]<<16)>>>(7&o)&(1<<s)-1},n.F._get17=function(i,o){return(i[o>>>3]|i[1+(o>>>3)]<<8|i[2+(o>>>3)]<<16)>>>(7&o)},n.F._get25=function(i,o){return(i[o>>>3]|i[1+(o>>>3)]<<8|i[2+(o>>>3)]<<16|i[3+(o>>>3)]<<24)>>>(7&o)},n.F.U=(t=Uint16Array,r=Uint32Array,{next_code:new t(16),bl_count:new t(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new t(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new r(32),flmap:new t(512),fltree:[],fdmap:new t(32),fdtree:[],lmap:new t(32768),ltree:[],ttree:[],dmap:new t(32768),dtree:[],imap:new t(512),itree:[],rev15:new t(32768),lhst:new r(286),dhst:new r(30),ihst:new r(19),lits:new r(15e3),strt:new t(65536),prev:new t(32768)}),function(){for(var i=n.F.U,o=0;o<32768;o++){var s=o;s=(4278255360&(s=(4042322160&(s=(3435973836&(s=(2863311530&s)>>>1|(1431655765&s)<<1))>>>2|(858993459&s)<<2))>>>4|(252645135&s)<<4))>>>8|(16711935&s)<<8,i.rev15[o]=(s>>>16|s<<16)>>>17}function a(l,d,u){for(;d--!=0;)l.push(0,u)}for(o=0;o<32;o++)i.ldef[o]=i.of0[o]<<3|i.exb[o],i.ddef[o]=i.df0[o]<<4|i.dxb[o];a(i.fltree,144,8),a(i.fltree,112,9),a(i.fltree,24,7),a(i.fltree,8,8),n.F.makeCodes(i.fltree,9),n.F.codes2map(i.fltree,9,i.flmap),n.F.revCodes(i.fltree,9),a(i.fdtree,32,5),n.F.makeCodes(i.fdtree,5),n.F.codes2map(i.fdtree,5,i.fdmap),n.F.revCodes(i.fdtree,5),a(i.itree,19,0),a(i.ltree,286,0),a(i.dtree,30,0),a(i.ttree,320,0)}()})();var k0e=C0e({__proto__:null,default:am},[am]);const po=function(){var e={nextZero(u,h){for(;u[h]!=0;)h++;return h},readUshort:(u,h)=>u[h]<<8|u[h+1],writeUshort(u,h,f){u[h]=f>>8&255,u[h+1]=255&f},readUint:(u,h)=>16777216*u[h]+(u[h+1]<<16|u[h+2]<<8|u[h+3]),writeUint(u,h,f){u[h]=f>>24&255,u[h+1]=f>>16&255,u[h+2]=f>>8&255,u[h+3]=255&f},readASCII(u,h,f){let p="";for(let m=0;m<f;m++)p+=String.fromCharCode(u[h+m]);return p},writeASCII(u,h,f){for(let p=0;p<f.length;p++)u[h+p]=f.charCodeAt(p)},readBytes(u,h,f){const p=[];for(let m=0;m<f;m++)p.push(u[h+m]);return p},pad:u=>u.length<2?`0${u}`:u,readUTF8(u,h,f){let p,m="";for(let g=0;g<f;g++)m+=`%${e.pad(u[h+g].toString(16))}`;try{p=decodeURIComponent(m)}catch{return e.readASCII(u,h,f)}return p}};function t(u,h,f,p){const m=h*f,g=o(p),y=Math.ceil(h*g/8),b=new Uint8Array(4*m),E=new Uint32Array(b.buffer),{ctype:S}=p,{depth:k}=p,A=e.readUshort;if(S==6){const W=m<<2;if(k==8)for(var w=0;w<W;w+=4)b[w]=u[w],b[w+1]=u[w+1],b[w+2]=u[w+2],b[w+3]=u[w+3];if(k==16)for(w=0;w<W;w++)b[w]=u[w<<1]}else if(S==2){const W=p.tabs.tRNS;if(W==null){if(k==8)for(w=0;w<m;w++){var _=3*w;E[w]=255<<24|u[_+2]<<16|u[_+1]<<8|u[_]}if(k==16)for(w=0;w<m;w++)_=6*w,E[w]=255<<24|u[_+4]<<16|u[_+2]<<8|u[_]}else{var x=W[0];const ne=W[1],ae=W[2];if(k==8)for(w=0;w<m;w++){var C=w<<2;_=3*w,E[w]=255<<24|u[_+2]<<16|u[_+1]<<8|u[_],u[_]==x&&u[_+1]==ne&&u[_+2]==ae&&(b[C+3]=0)}if(k==16)for(w=0;w<m;w++)C=w<<2,_=6*w,E[w]=255<<24|u[_+4]<<16|u[_+2]<<8|u[_],A(u,_)==x&&A(u,_+2)==ne&&A(u,_+4)==ae&&(b[C+3]=0)}}else if(S==3){const W=p.tabs.PLTE,ne=p.tabs.tRNS,ae=ne?ne.length:0;if(k==1)for(var P=0;P<f;P++){var I=P*y,O=P*h;for(w=0;w<h;w++){C=O+w<<2;var D=3*(M=u[I+(w>>3)]>>7-((7&w)<<0)&1);b[C]=W[D],b[C+1]=W[D+1],b[C+2]=W[D+2],b[C+3]=M<ae?ne[M]:255}}if(k==2)for(P=0;P<f;P++)for(I=P*y,O=P*h,w=0;w<h;w++)C=O+w<<2,D=3*(M=u[I+(w>>2)]>>6-((3&w)<<1)&3),b[C]=W[D],b[C+1]=W[D+1],b[C+2]=W[D+2],b[C+3]=M<ae?ne[M]:255;if(k==4)for(P=0;P<f;P++)for(I=P*y,O=P*h,w=0;w<h;w++)C=O+w<<2,D=3*(M=u[I+(w>>1)]>>4-((1&w)<<2)&15),b[C]=W[D],b[C+1]=W[D+1],b[C+2]=W[D+2],b[C+3]=M<ae?ne[M]:255;if(k==8)for(w=0;w<m;w++){var M;C=w<<2,D=3*(M=u[w]),b[C]=W[D],b[C+1]=W[D+1],b[C+2]=W[D+2],b[C+3]=M<ae?ne[M]:255}}else if(S==4){if(k==8)for(w=0;w<m;w++){C=w<<2;var U=u[$=w<<1];b[C]=U,b[C+1]=U,b[C+2]=U,b[C+3]=u[$+1]}if(k==16)for(w=0;w<m;w++){var $;C=w<<2,U=u[$=w<<2],b[C]=U,b[C+1]=U,b[C+2]=U,b[C+3]=u[$+2]}}else if(S==0)for(x=p.tabs.tRNS?p.tabs.tRNS:-1,P=0;P<f;P++){const W=P*y,ne=P*h;if(k==1)for(var j=0;j<h;j++){var q=(U=255*(u[W+(j>>>3)]>>>7-(7&j)&1))==255*x?0:255;E[ne+j]=q<<24|U<<16|U<<8|U}else if(k==2)for(j=0;j<h;j++)q=(U=85*(u[W+(j>>>2)]>>>6-((3&j)<<1)&3))==85*x?0:255,E[ne+j]=q<<24|U<<16|U<<8|U;else if(k==4)for(j=0;j<h;j++)q=(U=17*(u[W+(j>>>1)]>>>4-((1&j)<<2)&15))==17*x?0:255,E[ne+j]=q<<24|U<<16|U<<8|U;else if(k==8)for(j=0;j<h;j++)q=(U=u[W+j])==x?0:255,E[ne+j]=q<<24|U<<16|U<<8|U;else if(k==16)for(j=0;j<h;j++)U=u[W+(j<<1)],q=A(u,W+(j<<1))==x?0:255,E[ne+j]=q<<24|U<<16|U<<8|U}return b}function r(u,h,f,p){const m=o(u),g=Math.ceil(f*m/8),y=new Uint8Array((g+1+u.interlace)*p);return h=u.tabs.CgBI?i(h,y):n(h,y),u.interlace==0?h=s(h,u,0,f,p):u.interlace==1&&(h=function(E,S){const k=S.width,A=S.height,w=o(S),_=w>>3,x=Math.ceil(k*w/8),C=new Uint8Array(A*x);let P=0;const I=[0,0,4,0,2,0,1],O=[0,4,0,2,0,1,0],D=[8,8,8,4,4,2,2],M=[8,8,4,4,2,2,1];let U=0;for(;U<7;){const j=D[U],q=M[U];let W=0,ne=0,ae=I[U];for(;ae<A;)ae+=j,ne++;let re=O[U];for(;re<k;)re+=q,W++;const _e=Math.ceil(W*w/8);s(E,S,P,W,ne);let be=0,J=I[U];for(;J<A;
162){let xe=O[U],Ze=P+be*_e<<3;for(;xe<k;){var $;if(w==1&&($=($=E[Ze>>3])>>7-(7&Ze)&1,C[J*x+(xe>>3)]|=$<<7-((7&xe)<<0)),w==2&&($=($=E[Ze>>3])>>6-(7&Ze)&3,C[J*x+(xe>>2)]|=$<<6-((3&xe)<<1)),w==4&&($=($=E[Ze>>3])>>4-(7&Ze)&15,C[J*x+(xe>>1)]|=$<<4-((1&xe)<<2)),w>=8){const $e=J*x+xe*_;for(let Le=0;Le<_;Le++)C[$e+Le]=E[(Ze>>3)+Le]}Ze+=w,xe+=q}be++,J+=j}W*ne!=0&&(P+=ne*(1+_e)),U+=1}return C}(h,u)),h}function n(u,h){return i(new Uint8Array(u.buffer,2,u.length-6),h)}var i=function(){const u={H:{}};return u.H.N=function(h,f){const p=Uint8Array;let m,g,y=0,b=0,E=0,S=0,k=0,A=0,w=0,_=0,x=0;if(h[0]==3&&h[1]==0)return f||new p(0);const C=u.H,P=C.b,I=C.e,O=C.R,D=C.n,M=C.A,U=C.Z,$=C.m,j=f==null;for(j&&(f=new p(h.length>>>2<<5));y==0;)if(y=P(h,x,1),b=P(h,x+1,2),x+=3,b!=0){if(j&&(f=u.H.W(f,_+(1<<17))),b==1&&(m=$.J,g=$.h,A=511,w=31),b==2){E=I(h,x,5)+257,S=I(h,x+5,5)+1,k=I(h,x+10,4)+4,x+=14;let W=1;for(var q=0;q<38;q+=2)$.Q[q]=0,$.Q[q+1]=0;for(q=0;q<k;q++){const re=I(h,x+3*q,3);$.Q[1+($.X[q]<<1)]=re,re>W&&(W=re)}x+=3*k,D($.Q,W),M($.Q,W,$.u),m=$.w,g=$.d,x=O($.u,(1<<W)-1,E+S,h,x,$.v);const ne=C.V($.v,0,E,$.C);A=(1<<ne)-1;const ae=C.V($.v,E,S,$.D);w=(1<<ae)-1,D($.C,ne),M($.C,ne,m),D($.D,ae),M($.D,ae,g)}for(;;){const W=m[U(h,x)&A];x+=15&W;const ne=W>>>4;if(!(ne>>>8))f[_++]=ne;else{if(ne==256)break;{let ae=_+ne-254;if(ne>264){const xe=$.q[ne-257];ae=_+(xe>>>3)+I(h,x,7&xe),x+=7&xe}const re=g[U(h,x)&w];x+=15&re;const _e=re>>>4,be=$.c[_e],J=(be>>>4)+P(h,x,15&be);for(x+=15&be;_<ae;)f[_]=f[_++-J],f[_]=f[_++-J],f[_]=f[_++-J],f[_]=f[_++-J];_=ae}}}}else{7&x&&(x+=8-(7&x));const W=4+(x>>>3),ne=h[W-4]|h[W-3]<<8;j&&(f=u.H.W(f,_+ne)),f.set(new p(h.buffer,h.byteOffset+W,ne),_),x=W+ne<<3,_+=ne}return f.length==_?f:f.slice(0,_)},u.H.W=function(h,f){const p=h.length;if(f<=p)return h;const m=new Uint8Array(p<<1);return m.set(h,0),m},u.H.R=function(h,f,p,m,g,y){const b=u.H.e,E=u.H.Z;let S=0;for(;S<p;){const k=h[E(m,g)&f];g+=15&k;const A=k>>>4;if(A<=15)y[S]=A,S++;else{let w=0,_=0;A==16?(_=3+b(m,g,2),g+=2,w=y[S-1]):A==17?(_=3+b(m,g,3),g+=3):A==18&&(_=11+b(m,g,7),g+=7);const x=S+_;for(;S<x;)y[S]=w,S++}}return g},u.H.V=function(h,f,p,m){let g=0,y=0;const b=m.length>>>1;for(;y<p;){const E=h[y+f];m[y<<1]=0,m[1+(y<<1)]=E,E>g&&(g=E),y++}for(;y<b;)m[y<<1]=0,m[1+(y<<1)]=0,y++;return g},u.H.n=function(h,f){const p=u.H.m,m=h.length;let g,y,b,E;const S=p.j;for(var k=0;k<=f;k++)S[k]=0;for(k=1;k<m;k+=2)S[h[k]]++;const A=p.K;for(g=0,S[0]=0,y=1;y<=f;y++)g=g+S[y-1]<<1,A[y]=g;for(b=0;b<m;b+=2)E=h[b+1],E!=0&&(h[b]=A[E],A[E]++)},u.H.A=function(h,f,p){const m=h.length,g=u.H.m.r;for(let y=0;y<m;y+=2)if(h[y+1]!=0){const b=y>>1,E=h[y+1],S=b<<4|E,k=f-E;let A=h[y]<<k;const w=A+(1<<k);for(;A!=w;)p[g[A]>>>15-f]=S,A++}},u.H.l=function(h,f){const p=u.H.m.r,m=15-f;for(let g=0;g<h.length;g+=2){const y=h[g]<<f-h[g+1];h[g]=p[y]>>>m}},u.H.M=function(h,f,p){p<<=7&f;const m=f>>>3;h[m]|=p,h[m+1]|=p>>>8},u.H.I=function(h,f,p){p<<=7&f;const m=f>>>3;h[m]|=p,h[m+1]|=p>>>8,h[m+2]|=p>>>16},u.H.e=function(h,f,p){return(h[f>>>3]|h[1+(f>>>3)]<<8)>>>(7&f)&(1<<p)-1},u.H.b=function(h,f,p){return(h[f>>>3]|h[1+(f>>>3)]<<8|h[2+(f>>>3)]<<16)>>>(7&f)&(1<<p)-1},u.H.Z=function(h,f){return(h[f>>>3]|h[1+(f>>>3)]<<8|h[2+(f>>>3)]<<16)>>>(7&f)},u.H.i=function(h,f){return(h[f>>>3]|h[1+(f>>>3)]<<8|h[2+(f>>>3)]<<16|h[3+(f>>>3)]<<24)>>>(7&f)},u.H.m=function(){const h=Uint16Array,f=Uint32Array;return{K:new h(16),j:new h(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new h(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new f(32),J:new h(512),_:[],h:new h(32),$:[],w:new h(32768),C:[],v:[],d:new h(32768),D:[],u:new h(512),Q:[],r:new h(32768),s:new f(286),Y:new f(30),a:new f(19),t:new f(15e3),k:new h(65536),g:new h(32768)}}(),function(){const h=u.H.m;for(var f=0;f<32768;f++){let m=f;m=(2863311530&m)>>>1|(1431655765&m)<<1,m=(3435973836&m)>>>2|(858993459&m)<<2,m=(4042322160&m)>>>4|(252645135&m)<<4,m=(4278255360&m)>>>8|(16711935&m)<<8,h.r[f]=(m>>>16|m<<16)>>>17}function p(m,g,y){for(;g--!=0;)m.push(0,y)}for(f=0;f<32;f++)h.q[f]=h.S[f]<<3|h.T[f],h.c[f]=h.p[f]<<4|h.z[f];p(h._,144,8),p(h._,112,9),p(h._,24,7),p(h._,8,8),u.H.n(h._,9),u.H.A(h._,9,h.J),u.H.l(h._,9),p(h.$,32,5),u.H.n(h.$,5),u.H.A(h.$,5,h.h),u.H.l(h.$,5),p(h.Q,19,0),p(h.C,286,0),p(h.D,30,0),p(h.v,320,0)}(),u.H.N}();function o(u){return[1,null,3,1,2,null,4][u.ctype]*u.depth}function s(u,h,f,p,m){let g=o(h);const y=Math.ceil(p*g/8);let b,E;g=Math.ceil(g/8);let S=u[f],k=0;if(S>1&&(u[f]=[0,0,1][S-2]),S==3)for(k=g;k<y;k++)u[k+1]=u[k+1]+(u[k+1-g]>>>1)&255;for(let A=0;A<m;A++)if(b=f+A*y,E=b+A+1,S=u[E-1],k=0,S==0)for(;k<y;k++)u[b+k]=u[E+k];else if(S==1){for(;k<g;k++)u[b+k]=u[E+k];for(;k<y;k++)u[b+k]=u[E+k]+u[b+k-g]}else if(S==2)for(;k<y;k++)u[b+k]=u[E+k]+u[b+k-y];else if(S==3){for(;k<g;k++)u[b+k]=u[E+k]+(u[b+k-y]>>>1);for(;k<y;k++)u[b+k]=u[E+k]+(u[b+k-y]+u[b+k-g]>>>1)}else{for(;k<g;k++)u[b+k]=u[E+k]+a(0,u[b+k-y],0);for(;k<y;k++)u[b+k]=u[E+k]+a(u[b+k-g],u[b+k-y],u[b+k-g-y])}return u}function a(u,h,f){const p=u+h-f,m=p-u,g=p-h,y=p-f;return m*m<=g*g&&m*m<=y*y?u:g*g<=y*y?h:f}function l(u,h,f){f.width=e.readUint(u,h),h+=4,f.height=e.readUint(u,h),h+=4,f.depth=u[h],h++,f.ctype=u[h],h++,f.compress=u[h],h++,f.filter=u[h],h++,f.interlace=u[h],h++}function d(u,h,f,p,m,g,y,b,E){const S=Math.min(h,m),k=Math.min(f,g);let A=0,w=0;for(let U=0;U<k;U++)for(let $=0;$<S;$++)if(y>=0&&b>=0?(A=U*h+$<<2,w=(b+U)*m+y+$<<2):(A=(-b+U)*h-y+$<<2,w=U*m+$<<2),E==0)p[w]=u[A],p[w+1]=u[A+1],p[w+2]=u[A+2],p[w+3]=u[A+3];else if(E==1){var _=u[A+3]*.00392156862745098,x=u[A]*_,C=u[A+1]*_,P=u[A+2]*_,I=p[w+3]*(1/255),O=p[w]*I,D=p[w+1]*I,M=p[w+2]*I;const j=1-_,q=_+I*j,W=q==0?0:1/q;p[w+3]=255*q,p[w+0]=(x+O*j)*W,p[w+1]=(C+D*j)*W,p[w+2]=(P+M*j)*W}else if(E==2)_=u[A+3],x=u[A],C=u[A+1],P=u[A+2],I=p[w+3],O=p[w],D=p[w+1],M=p[w+2],_==I&&x==O&&C==D&&P==M?(p[w]=0,p[w+1]=0,p[w+2]=0,p[w+3]=0):(p[w]=x,p[w+1]=C,p[w+2]=P,p[w+3]=_);else if(E==3){if(_=u[A+3],x=u[A],C=u[A+1],P=u[A+2],I=p[w+3],O=p[w],D=p[w+1],M=p[w+2],_==I&&x==O&&C==D&&P==M)continue;if(_<220&&I>20)return!1}return!0}return{decode:function(h){const f=new Uint8Array(h);let p=8;const m=e,g=m.readUshort,y=m.readUint,b={tabs:{},frames:[]},E=new Uint8Array(f.length);let S,k=0,A=0;const w=[137,80,78,71,13,10,26,10];for(var _=0;_<8;_++)if(f[_]!=w[_])throw"The input is not a PNG file!";for(;p<f.length;){const U=m.readUint(f,p);p+=4;const $=m.readASCII(f,p,4);if(p+=4,$=="IHDR")l(f,p,b);else if($=="iCCP"){for(var x=p;f[x]!=0;)x++;m.readASCII(f,p,x-p),f[x+1];const j=f.slice(x+2,p+U);let q=null;try{q=n(j)}catch{q=i(j)}b.tabs[$]=q}else if($=="CgBI")b.tabs[$]=f.slice(p,p+4);else if($=="IDAT"){for(_=0;_<U;_++)E[k+_]=f[p+_];k+=U}else if($=="acTL")b.tabs[$]={num_frames:y(f,p),num_plays:y(f,p+4)},S=new Uint8Array(f.length);else if($=="fcTL"){A!=0&&((M=b.frames[b.frames.length-1]).data=r(b,S.slice(0,A),M.rect.width,M.rect.height),A=0);const j={x:y(f,p+12),y:y(f,p+16),width:y(f,p+4),height:y(f,p+8)};let q=g(f,p+22);q=g(f,p+20)/(q==0?100:q);
162const W={rect:j,delay:Math.round(1e3*q),dispose:f[p+24],blend:f[p+25]};b.frames.push(W)}else if($=="fdAT"){for(_=0;_<U-4;_++)S[A+_]=f[p+_+4];A+=U-4}else if($=="pHYs")b.tabs[$]=[m.readUint(f,p),m.readUint(f,p+4),f[p+8]];else if($=="cHRM")for(b.tabs[$]=[],_=0;_<8;_++)b.tabs[$].push(m.readUint(f,p+4*_));else if($=="tEXt"||$=="zTXt"){b.tabs[$]==null&&(b.tabs[$]={});var C=m.nextZero(f,p),P=m.readASCII(f,p,C-p),I=p+U-C-1;if($=="tEXt")D=m.readASCII(f,C+1,I);else{var O=n(f.slice(C+2,C+2+I));D=m.readUTF8(O,0,O.length)}b.tabs[$][P]=D}else if($=="iTXt"){b.tabs[$]==null&&(b.tabs[$]={}),C=0,x=p,C=m.nextZero(f,x),P=m.readASCII(f,x,C-x);const j=f[x=C+1];var D;f[x+1],x+=2,C=m.nextZero(f,x),m.readASCII(f,x,C-x),x=C+1,C=m.nextZero(f,x),m.readUTF8(f,x,C-x),I=U-((x=C+1)-p),j==0?D=m.readUTF8(f,x,I):(O=n(f.slice(x,x+I)),D=m.readUTF8(O,0,O.length)),b.tabs[$][P]=D}else if($=="PLTE")b.tabs[$]=m.readBytes(f,p,U);else if($=="hIST"){const j=b.tabs.PLTE.length/3;for(b.tabs[$]=[],_=0;_<j;_++)b.tabs[$].push(g(f,p+2*_))}else if($=="tRNS")b.ctype==3?b.tabs[$]=m.readBytes(f,p,U):b.ctype==0?b.tabs[$]=g(f,p):b.ctype==2&&(b.tabs[$]=[g(f,p),g(f,p+2),g(f,p+4)]);else if($=="gAMA")b.tabs[$]=m.readUint(f,p)/1e5;else if($=="sRGB")b.tabs[$]=f[p];else if($=="bKGD")b.ctype==0||b.ctype==4?b.tabs[$]=[g(f,p)]:b.ctype==2||b.ctype==6?b.tabs[$]=[g(f,p),g(f,p+2),g(f,p+4)]:b.ctype==3&&(b.tabs[$]=f[p]);else if($=="IEND")break;p+=U,m.readUint(f,p),p+=4}var M;return A!=0&&((M=b.frames[b.frames.length-1]).data=r(b,S.slice(0,A),M.rect.width,M.rect.height)),b.data=r(b,E,b.width,b.height),delete b.compress,delete b.interlace,delete b.filter,b},toRGBA8:function(h){const f=h.width,p=h.height;if(h.tabs.acTL==null)return[t(h.data,f,p,h).buffer];const m=[];h.frames[0].data==null&&(h.frames[0].data=h.data);const g=f*p*4,y=new Uint8Array(g),b=new Uint8Array(g),E=new Uint8Array(g);for(let k=0;k<h.frames.length;k++){const A=h.frames[k],w=A.rect.x,_=A.rect.y,x=A.rect.width,C=A.rect.height,P=t(A.data,x,C,h);if(k!=0)for(var S=0;S<g;S++)E[S]=y[S];if(A.blend==0?d(P,x,C,y,f,p,w,_,0):A.blend==1&&d(P,x,C,y,f,p,w,_,1),m.push(y.buffer.slice(0)),A.dispose!=0){if(A.dispose==1)d(b,x,C,y,f,p,w,_,0);else if(A.dispose==2)for(S=0;S<g;S++)y[S]=E[S]}}return m},_paeth:a,_copyTile:d,_bin:e}}();(function(){const{_copyTile:e}=po,{_bin:t}=po,r=po._paeth;var n={table:function(){const x=new Uint32Array(256);for(let C=0;C<256;C++){let P=C;for(let I=0;I<8;I++)1&P?P=3988292384^P>>>1:P>>>=1;x[C]=P}return x}(),update(x,C,P,I){for(let O=0;O<I;O++)x=n.table[255&(x^C[P+O])]^x>>>8;return x},crc:(x,C,P)=>4294967295^n.update(4294967295,x,C,P)};function i(x,C,P,I){C[P]+=x[0]*I>>4,C[P+1]+=x[1]*I>>4,C[P+2]+=x[2]*I>>4,C[P+3]+=x[3]*I>>4}function o(x){return Math.max(0,Math.min(255,x))}function s(x,C){const P=x[0]-C[0],I=x[1]-C[1],O=x[2]-C[2],D=x[3]-C[3];return P*P+I*I+O*O+D*D}function a(x,C,P,I,O,D,M){M==null&&(M=1);const U=I.length,$=[];for(var j=0;j<U;j++){const J=I[j];$.push([J>>>0&255,J>>>8&255,J>>>16&255,J>>>24&255])}for(j=0;j<U;j++){let J=4294967295;for(var q=0,W=0;W<U;W++){var ne=s($[j],$[W]);W!=j&&ne<J&&(J=ne,q=W)}}const ae=new Uint32Array(O.buffer),re=new Int16Array(C*P*4),_e=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(j=0;j<_e.length;j++)_e[j]=255*((_e[j]+.5)/16-.5);for(let J=0;J<P;J++)for(let xe=0;xe<C;xe++){var be;j=4*(J*C+xe),M!=2?be=[o(x[j]+re[j]),o(x[j+1]+re[j+1]),o(x[j+2]+re[j+2]),o(x[j+3]+re[j+3])]:(ne=_e[4*(3&J)+(3&xe)],be=[o(x[j]+ne),o(x[j+1]+ne),o(x[j+2]+ne),o(x[j+3]+ne)]),q=0;let Ze=16777215;for(W=0;W<U;W++){const Fe=s(be,$[W]);Fe<Ze&&(Ze=Fe,q=W)}const $e=$[q],Le=[be[0]-$e[0],be[1]-$e[1],be[2]-$e[2],be[3]-$e[3]];M==1&&(xe!=C-1&&i(Le,re,j+4,7),J!=P-1&&(xe!=0&&i(Le,re,j+4*C-4,3),i(Le,re,j+4*C,5),xe!=C-1&&i(Le,re,j+4*C+4,1))),D[j>>2]=q,ae[j>>2]=I[q]}}function l(x,C,P,I,O){O==null&&(O={});const{crc:D}=n,M=t.writeUint,U=t.writeUshort,$=t.writeASCII;let j=8;const q=x.frames.length>1;let W,ne=!1,ae=33+(q?20:0);if(O.sRGB!=null&&(ae+=13),O.pHYs!=null&&(ae+=21),O.iCCP!=null&&(W=pako.deflate(O.iCCP),ae+=21+W.length+4),x.ctype==3){for(var re=x.plte.length,_e=0;_e<re;_e++)x.plte[_e]>>>24!=255&&(ne=!0);ae+=8+3*re+4+(ne?8+1*re+4:0)}for(var be=0;be<x.frames.length;be++)q&&(ae+=38),ae+=($e=x.frames[be]).cimg.length+12,be!=0&&(ae+=4);ae+=12;const J=new Uint8Array(ae),xe=[137,80,78,71,13,10,26,10];for(_e=0;_e<8;_e++)J[_e]=xe[_e];if(M(J,j,13),j+=4,$(J,j,"IHDR"),j+=4,M(J,j,C),j+=4,M(J,j,P),j+=4,J[j]=x.depth,j++,J[j]=x.ctype,j++,J[j]=0,j++,J[j]=0,j++,J[j]=0,j++,M(J,j,D(J,j-17,17)),j+=4,O.sRGB!=null&&(M(J,j,1),j+=4,$(J,j,"sRGB"),j+=4,J[j]=O.sRGB,j++,M(J,j,D(J,j-5,5)),j+=4),O.iCCP!=null){const Le=13+W.length;M(J,j,Le),j+=4,$(J,j,"iCCP"),j+=4,$(J,j,"ICC profile"),j+=11,j+=2,J.set(W,j),j+=W.length,M(J,j,D(J,j-(Le+4),Le+4)),j+=4}if(O.pHYs!=null&&(M(J,j,9),j+=4,$(J,j,"pHYs"),j+=4,M(J,j,O.pHYs[0]),j+=4,M(J,j,O.pHYs[1]),j+=4,J[j]=O.pHYs[2],j++,M(J,j,D(J,j-13,13)),j+=4),q&&(M(J,j,8),j+=4,$(J,j,"acTL"),j+=4,M(J,j,x.frames.length),j+=4,M(J,j,O.loop!=null?O.loop:0),j+=4,M(J,j,D(J,j-12,12)),j+=4),x.ctype==3){for(M(J,j,3*(re=x.plte.length)),j+=4,$(J,j,"PLTE"),j+=4,_e=0;_e<re;_e++){const Le=3*_e,Fe=x.plte[_e],ft=255&Fe,Ge=Fe>>>8&255,Se=Fe>>>16&255;J[j+Le+0]=ft,J[j+Le+1]=Ge,J[j+Le+2]=Se}if(j+=3*re,M(J,j,D(J,j-3*re-4,3*re+4)),j+=4,ne){for(M(J,j,re),j+=4,$(J,j,"tRNS"),j+=4,_e=0;_e<re;
162_e++)J[j+_e]=x.plte[_e]>>>24&255;j+=re,M(J,j,D(J,j-re-4,re+4)),j+=4}}let Ze=0;for(be=0;be<x.frames.length;be++){var $e=x.frames[be];q&&(M(J,j,26),j+=4,$(J,j,"fcTL"),j+=4,M(J,j,Ze++),j+=4,M(J,j,$e.rect.width),j+=4,M(J,j,$e.rect.height),j+=4,M(J,j,$e.rect.x),j+=4,M(J,j,$e.rect.y),j+=4,U(J,j,I[be]),j+=2,U(J,j,1e3),j+=2,J[j]=$e.dispose,j++,J[j]=$e.blend,j++,M(J,j,D(J,j-30,30)),j+=4);const Le=$e.cimg;M(J,j,(re=Le.length)+(be==0?0:4)),j+=4;const Fe=j;$(J,j,be==0?"IDAT":"fdAT"),j+=4,be!=0&&(M(J,j,Ze++),j+=4),J.set(Le,j),j+=re,M(J,j,D(J,Fe,j-Fe)),j+=4}return M(J,j,0),j+=4,$(J,j,"IEND"),j+=4,M(J,j,D(J,j-4,4)),j+=4,J.buffer}function d(x,C,P){for(let I=0;I<x.frames.length;I++){const O=x.frames[I];O.rect.width;const D=O.rect.height,M=new Uint8Array(D*O.bpl+D);O.cimg=p(O.img,D,O.bpp,O.bpl,M,C,P)}}function u(x,C,P,I,O){const D=O[0],M=O[1],U=O[2],$=O[3],j=O[4],q=O[5];let W=6,ne=8,ae=255;for(var re=0;re<x.length;re++){const Pe=new Uint8Array(x[re]);for(var _e=Pe.length,be=0;be<_e;be+=4)ae&=Pe[be+3]}const J=ae!=255,xe=function(Ue,z,Q,ie,te,he){const ve=[];for(var Re=0;Re<Ue.length;Re++){const B=new Uint8Array(Ue[Re]),G=new Uint32Array(B.buffer);var He;let le=0,ce=0,Ke=z,xt=Q,vt=ie?1:0;if(Re!=0){const Rt=he||ie||Re==1||ve[Re-2].dispose!=0?1:2;let yt=0,Me=1e9;for(let it=0;it<Rt;it++){var dt=new Uint8Array(Ue[Re-1-it]);const tr=new Uint32Array(Ue[Re-1-it]);let lt=z,Ct=Q,Zt=-1,pt=-1;for(let Ut=0;Ut<Q;Ut++)for(let lr=0;lr<z;lr++)G[T=Ut*z+lr]!=tr[T]&&(lr<lt&&(lt=lr),lr>Zt&&(Zt=lr),Ut<Ct&&(Ct=Ut),Ut>pt&&(pt=Ut));Zt==-1&&(lt=Ct=Zt=pt=0),te&&((1<)==1&<--,(1&Ct)==1&&Ct--);const ur=(Zt-lt+1)*(pt-Ct+1);ur<Me&&(Me=ur,yt=it,le=lt,ce=Ct,Ke=Zt-lt+1,xt=pt-Ct+1)}dt=new Uint8Array(Ue[Re-1-yt]),yt==1&&(ve[Re-1].dispose=2),He=new Uint8Array(Ke*xt*4),e(dt,z,Q,He,Ke,xt,-le,-ce,0),vt=e(B,z,Q,He,Ke,xt,-le,-ce,3)?1:0,vt==1?f(B,z,Q,He,{x:le,y:ce,width:Ke,height:xt}):e(B,z,Q,He,Ke,xt,-le,-ce,0)}else He=B.slice(0);ve.push({rect:{x:le,y:ce,width:Ke,height:xt},img:He,blend:vt,dispose:0})}if(ie)for(Re=0;Re<ve.length;Re++){if((R=ve[Re]).blend==1)continue;const B=R.rect,G=ve[Re-1].rect,le=Math.min(B.x,G.x),ce=Math.min(B.y,G.y),Ke={x:le,y:ce,width:Math.max(B.x+B.width,G.x+G.width)-le,height:Math.max(B.y+B.height,G.y+G.height)-ce};ve[Re-1].dispose=1,Re-1!=0&&h(Ue,z,Q,ve,Re-1,Ke,te),h(Ue,z,Q,ve,Re,Ke,te)}let N=0;if(Ue.length!=1)for(var T=0;T<ve.length;T++){var R;N+=(R=ve[T]).rect.width*R.rect.height}return ve}(x,C,P,D,M,U),Ze={},$e=[],Le=[];if(I!=0){const Pe=[];for(be=0;be<xe.length;be++)Pe.push(xe[be].img.buffer);const Ue=function(te){let he=0;for(var ve=0;ve<te.length;ve++)he+=te[ve].byteLength;const Re=new Uint8Array(he);let He=0;for(ve=0;ve<te.length;ve++){const dt=new Uint8Array(te[ve]),N=dt.length;for(let T=0;T<N;T+=4){let R=dt[T],B=dt[T+1],G=dt[T+2];const le=dt[T+3];le==0&&(R=B=G=0),Re[He+T]=R,Re[He+T+1]=B,Re[He+T+2]=G,Re[He+T+3]=le}He+=N}return Re.buffer}(Pe),z=g(Ue,I);for(be=0;be<z.plte.length;be++)$e.push(z.plte[be].est.rgba);let Q=0;for(be=0;be<xe.length;be++){const ie=(ft=xe[be]).img.length;var Fe=new Uint8Array(z.inds.buffer,Q>>2,ie>>2);Le.push(Fe);const te=new Uint8Array(z.abuf,Q,ie);q&&a(ft.img,ft.rect.width,ft.rect.height,$e,te,Fe),ft.img.set(te),Q+=ie}}else for(re=0;re<xe.length;re++){var ft=xe[re];const Pe=new Uint32Array(ft.img.buffer);var Ge=ft.rect.width;for(_e=Pe.length,Fe=new Uint8Array(_e),Le.push(Fe),be=0;be<_e;be++){const Ue=Pe[be];if(be!=0&&Ue==Pe[be-1])Fe[be]=Fe[be-1];else if(be>Ge&&Ue==Pe[be-Ge])Fe[be]=Fe[be-Ge];else{let z=Ze[Ue];if(z==null&&(Ze[Ue]=z=$e.length,$e.push(Ue),$e.length>=300))break;Fe[be]=z}}}const Se=$e.length;for(Se<=256&&j==0&&(ne=Se<=2?1:Se<=4?2:Se<=16?4:8,ne=Math.max(ne,$)),re=0;re<xe.length;re++){(ft=xe[re]).rect.x,ft.rect.y,Ge=ft.rect.width;const Pe=ft.rect.height;let Ue=ft.img;new Uint32Array(Ue.buffer);let z=4*Ge,Q=4;if(Se<=256&&j==0){z=Math.ceil(ne*Ge/8);var je=new Uint8Array(z*Pe);const ie=Le[re];for(let te=0;te<Pe;te++){be=te*z;const he=te*Ge;if(ne==8)for(var Ce=0;Ce<Ge;Ce++)je[be+Ce]=ie[he+Ce];else if(ne==4)for(Ce=0;Ce<Ge;Ce++)je[be+(Ce>>1)]|=ie[he+Ce]<<4-4*(1&Ce);else if(ne==2)for(Ce=0;Ce<Ge;Ce++)je[be+(Ce>>2)]|=ie[he+Ce]<<6-2*(3&Ce);else if(ne==1)for(Ce=0;Ce<Ge;Ce++)je[be+(Ce>>3)]|=ie[he+Ce]<<7-1*(7&Ce)}Ue=je,W=3,Q=1}else if(J==0&&xe.length==1){je=new Uint8Array(Ge*Pe*3);const ie=Ge*Pe;for(be=0;be<ie;be++){const te=3*be,he=4*be;je[te]=Ue[he],je[te+1]=Ue[he+1],je[te+2]=Ue[he+2]}Ue=je,W=2,Q=3,z=3*Ge}ft.img=Ue,ft.bpl=z,ft.bpp=Q}return{ctype:W,depth:ne,plte:$e,frames:xe}}function h(x,C,P,I,O,D,M){const U=Uint8Array,$=Uint32Array,j=new U(x[O-1]),q=new $(x[O-1]),W=O+1<x.length?new U(x[O+1]):null,ne=new U(x[O]),ae=new $(ne.buffer);let re=C,_e=P,be=-1,J=-1;for(let Ze=0;Ze<D.height;Ze++)for(let $e=0;$e<D.width;$e++){const Le=D.x+$e,Fe=D.y+Ze,ft=Fe*C+Le,Ge=ae[ft];Ge==0||I[O-1].dispose==0&&q[ft]==Ge&&(W==null||W[4*ft+3]!=0)||(Le<re&&(re=Le),Le>be&&(be=Le),Fe<_e&&(_e=Fe),Fe>J&&(J=Fe))}be==-1&&(re=_e=be=J=0),M&&((1&re)==1&&re--,(1&_e)==1&&_e--),D={x:re,y:_e,width:be-re+1,height:J-_e+1};const xe=I[O];xe.rect=D,xe.blend=1,xe.img=new Uint8Array(D.width*D.height*4),I[O-1].dispose==0?(e(j,C,P,xe.img,D.width,D.height,-D.x,-D.y,0),f(ne,C,P,xe.img,D)):e(ne,C,P,xe.img,D.width,D.height,-D.x,-D.y,0)}function f(x,C,P,I,O){e(x,C,P,I,O.width,O.height,-O.x,-O.y,2)}function p(x,C,P,I,O,D,M){const U=[];let $,j=[0,1,2,3,4];D!=-1?j=[D]:(C*I>5e5||P==1)&&(j=[0]),M&&($={level:0});const q=k0e;for(var W=0;W<j.length;W++){for(let re=0;re<C;re++)m(O,x,re,I,P,j[W]);U.push(q.deflate(O,$))}let ne,ae=1e9;for(W=0;W<U.length;W++)U[W].length<ae&&(ne=W,ae=U[W].length);return U[ne]}function m(x,C,P,I,O,D){const M=P*I;let U=M+P;if(x[U]=D,U++,D==0)if(I<500)for(var $=0;$<I;$++)x[U+$]=C[M+$];else x.set(new Uint8Array(C.buffer,M,I),U);else if(D==1){for($=0;$<O;$++)x[U+$]=C[M+$];for($=O;$<I;$++)x[U+$]=C[M+$]-C[M+$-O]+256&255}else if(P==0){for($=0;$<O;$++)x[U+$]=C[M+$];if(D==2)for($=O;$<I;$++)x[U+$]=C[M+$];if(D==3)for($=O;$<I;$++)x[U+$]=C[M+$]-(C[M+$-O]>>1)+256&255;if(D==4)for($=O;$<I;$++)x[U+$]=C[M+$]-r(C[M+$-O],0,0)+256&255}else{if(D==2)for($=0;$<I;$++)x[U+$]=C[M+$]+256-C[M+$-I]&255;if(D==3){for($=0;$<O;$++)x[U+$]=C[M+$]+256-(C[M+$-I]>>1)&255;for($=O;$<I;$++)x[U+$]=C[M+$]+256-(C[M+$-I]+C[M+$-O]>>1)&255}if(D==4){for($=0;$<O;$++)x[U+$]=C[M+$]+256-r(0,C[M+$-I],0)&255;for($=O;$<I;$++)x[U+$]=C[M+$]+256-r(C[M+$-O],C[M+$-I],C[M+$-O-I])&255}}}
162function g(x,C){const P=new Uint8Array(x),I=P.slice(0),O=new Uint32Array(I.buffer),D=y(I,C),M=D[0],U=D[1],$=P.length,j=new Uint8Array($>>2);let q;if(P.length<2e7)for(var W=0;W<$;W+=4)q=b(M,ne=P[W]*(1/255),ae=P[W+1]*(1/255),re=P[W+2]*(1/255),_e=P[W+3]*(1/255)),j[W>>2]=q.ind,O[W>>2]=q.est.rgba;else for(W=0;W<$;W+=4){var ne=P[W]*.00392156862745098,ae=P[W+1]*(1/255),re=P[W+2]*(1/255),_e=P[W+3]*(1/255);for(q=M;q.left;)q=E(q.est,ne,ae,re,_e)<=0?q.left:q.right;j[W>>2]=q.ind,O[W>>2]=q.est.rgba}return{abuf:I.buffer,inds:j,plte:U}}function y(x,C,P){P==null&&(P=1e-4);const I=new Uint32Array(x.buffer),O={i0:0,i1:x.length,bst:null,est:null,tdst:0,left:null,right:null};O.bst=A(x,O.i0,O.i1),O.est=w(O.bst);const D=[O];for(;D.length<C;){let U=0,$=0;for(var M=0;M<D.length;M++)D[M].est.L>U&&(U=D[M].est.L,$=M);if(U<P)break;const j=D[$],q=S(x,I,j.i0,j.i1,j.est.e,j.est.eMq255);if(j.i0>=q||j.i1<=q){j.est.L=0;continue}const W={i0:j.i0,i1:q,bst:null,est:null,tdst:0,left:null,right:null};W.bst=A(x,W.i0,W.i1),W.est=w(W.bst);const ne={i0:q,i1:j.i1,bst:null,est:null,tdst:0,left:null,right:null};for(ne.bst={R:[],m:[],N:j.bst.N-W.bst.N},M=0;M<16;M++)ne.bst.R[M]=j.bst.R[M]-W.bst.R[M];for(M=0;M<4;M++)ne.bst.m[M]=j.bst.m[M]-W.bst.m[M];ne.est=w(ne.bst),j.left=W,j.right=ne,D[$]=W,D.push(ne)}for(D.sort((U,$)=>$.bst.N-U.bst.N),M=0;M<D.length;M++)D[M].ind=M;return[O,D]}function b(x,C,P,I,O){if(x.left==null)return x.tdst=function(W,ne,ae,re,_e){const be=ne-W[0],J=ae-W[1],xe=re-W[2],Ze=_e-W[3];return be*be+J*J+xe*xe+Ze*Ze}(x.est.q,C,P,I,O),x;const D=E(x.est,C,P,I,O);let M=x.left,U=x.right;D>0&&(M=x.right,U=x.left);const $=b(M,C,P,I,O);if($.tdst<=D*D)return $;const j=b(U,C,P,I,O);return j.tdst<$.tdst?j:$}function E(x,C,P,I,O){const{e:D}=x;return D[0]*C+D[1]*P+D[2]*I+D[3]*O-x.eMq}function S(x,C,P,I,O,D){for(I-=4;P<I;){for(;k(x,P,O)<=D;)P+=4;for(;k(x,I,O)>D;)I-=4;if(P>=I)break;const M=C[P>>2];C[P>>2]=C[I>>2],C[I>>2]=M,P+=4,I-=4}for(;k(x,P,O)>D;)P-=4;return P+4}function k(x,C,P){return x[C]*P[0]+x[C+1]*P[1]+x[C+2]*P[2]+x[C+3]*P[3]}function A(x,C,P){const I=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],O=[0,0,0,0],D=P-C>>2;for(let M=C;M<P;M+=4){const U=x[M]*.00392156862745098,$=x[M+1]*(1/255),j=x[M+2]*(1/255),q=x[M+3]*(1/255);O[0]+=U,O[1]+=$,O[2]+=j,O[3]+=q,I[0]+=U*U,I[1]+=U*$,I[2]+=U*j,I[3]+=U*q,I[5]+=$*$,I[6]+=$*j,I[7]+=$*q,I[10]+=j*j,I[11]+=j*q,I[15]+=q*q}return I[4]=I[1],I[8]=I[2],I[9]=I[6],I[12]=I[3],I[13]=I[7],I[14]=I[11],{R:I,m:O,N:D}}function w(x){const{R:C}=x,{m:P}=x,{N:I}=x,O=P[0],D=P[1],M=P[2],U=P[3],$=I==0?0:1/I,j=[C[0]-O*O*$,C[1]-O*D*$,C[2]-O*M*$,C[3]-O*U*$,C[4]-D*O*$,C[5]-D*D*$,C[6]-D*M*$,C[7]-D*U*$,C[8]-M*O*$,C[9]-M*D*$,C[10]-M*M*$,C[11]-M*U*$,C[12]-U*O*$,C[13]-U*D*$,C[14]-U*M*$,C[15]-U*U*$],q=j,W=_;let ne=[Math.random(),Math.random(),Math.random(),Math.random()],ae=0,re=0;if(I!=0)for(let be=0;be<16&&(ne=W.multVec(q,ne),re=Math.sqrt(W.dot(ne,ne)),ne=W.sml(1/re,ne),!(be!=0&&Math.abs(re-ae)<1e-9));be++)ae=re;const _e=[O*$,D*$,M*$,U*$];return{Cov:j,q:_e,e:ne,L:ae,eMq255:W.dot(W.sml(255,_e),ne),eMq:W.dot(ne,_e),rgba:(Math.round(255*_e[3])<<24|Math.round(255*_e[2])<<16|Math.round(255*_e[1])<<8|Math.round(255*_e[0])<<0)>>>0}}var _={multVec:(x,C)=>[x[0]*C[0]+x[1]*C[1]+x[2]*C[2]+x[3]*C[3],x[4]*C[0]+x[5]*C[1]+x[6]*C[2]+x[7]*C[3],x[8]*C[0]+x[9]*C[1]+x[10]*C[2]+x[11]*C[3],x[12]*C[0]+x[13]*C[1]+x[14]*C[2]+x[15]*C[3]],dot:(x,C)=>x[0]*C[0]+x[1]*C[1]+x[2]*C[2]+x[3]*C[3],sml:(x,C)=>[x*C[0],x*C[1],x*C[2],x*C[3]]};po.encode=function(C,P,I,O,D,M,U){O==null&&(O=0),U==null&&(U=!1);const $=u(C,P,I,O,[!1,!1,!1,0,U,!1]);return d($,-1),l($,P,I,D,M)},po.encodeLL=function(C,P,I,O,D,M,U,$){const j={ctype:0+(O==1?0:2)+(D==0?0:4),depth:M,frames:[]},q=(O+D)*M,W=q*P;for(let ne=0;ne<C.length;ne++)j.frames.push({rect:{x:0,y:0,width:P,height:I},img:new Uint8Array(C[ne]),blend:0,dispose:1,bpp:Math.ceil(q/8),bpl:Math.ceil(W/8)});return d(j,0,!0),l(j,P,I,U,$)},po.encode.compress=u,po.encode.dither=a,po.quantize=g,po.quantize.getKDtree=y,po.quantize.getNearest=b})();const Sj={toArrayBuffer(e,t){const r=e.width,n=e.height,i=r<<2,o=e.getContext("2d").getImageData(0,0,r,n),s=new Uint32Array(o.data.buffer),a=(32*r+31)/32<<2,l=a*n,d=122+l,u=new ArrayBuffer(d),h=new DataView(u),f=1<<20;let p,m,g,y,b=f,E=0,S=0,k=0;function A(x){h.setUint16(S,x,!0),S+=2}function w(x){h.setUint32(S,x,!0),S+=4}function _(x){S+=x}A(19778),w(d),_(4),w(122),w(108),w(r),w(-n>>>0),A(1),A(32),w(3),w(l),w(2835),w(2835),_(8),w(16711680),w(65280),w(255),w(4278190080),w(1466527264),function x(){for(;E<n&&b>0;){for(y=122+E*a,p=0;p<i;)b--,m=s[k++],g=m>>>24,h.setUint32(y+p,m<<8|g),p+=4;E++}k<s.length?(b=f,setTimeout(x,Sj._dly)):t(u)}()},toBlob(e,t){this.toArrayBuffer(e,r=>{t(new Blob([r],{type:"image/bmp"}))})},_dly:9};var wi={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},R0e={[wi.CHROME]:16384,[wi.FIREFOX]:11180,[wi.DESKTOP_SAFARI]:16384,[wi.IE]:8192,[wi.IOS]:4096,[wi.ETC]:8192};const nx=typeof window<"u",Cj=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,lm=nx&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),I0e=(nx||Cj)&&(lm&&lm.getOriginalSymbol(window,"File")||typeof File<"u"&&File),Tj=(nx||Cj)&&(lm&&lm.getOriginalSymbol(window,"FileReader")||typeof FileReader<"u"&&FileReader);function ix(e,t,r=Date.now()){return new Promise(n=>{const i=e.split(","),o=i[0].match(/:(.*?);/)[1],s=globalThis.atob(i[1]);let a=s.length;const l=new Uint8Array(a);for(;a--;)l[a]=s.charCodeAt(a);const d=new Blob([l],{type:o});d.name=t,d.lastModified=r,n(d)})}function Aj(e){return new Promise((t,r)=>{const n=new Tj;n.onload=()=>t(n.result),n.onerror=i=>r(i),n.readAsDataURL(e)})}function kj(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>t(n),n.onerror=i=>r(i),n.src=e})}
162function Vl(){if(Vl.cachedResult!==void 0)return Vl.cachedResult;let e=wi.ETC;const{userAgent:t}=navigator;return/Chrom(e|ium)/i.test(t)?e=wi.CHROME:/iP(ad|od|hone)/i.test(t)&&/WebKit/i.test(t)?e=wi.IOS:/Safari/i.test(t)?e=wi.DESKTOP_SAFARI:/Firefox/i.test(t)?e=wi.FIREFOX:(/MSIE/i.test(t)||document.documentMode)&&(e=wi.IE),Vl.cachedResult=e,Vl.cachedResult}function Rj(e,t){const r=Vl(),n=R0e[r];let i=e,o=t,s=i*o;const a=i>o?o/i:i/o;for(;s>n*n;){const l=(n+i)/2,d=(n+o)/2;l<d?(o=d,i=d*a):(o=l*a,i=l),s=i*o}return{width:i,height:o}}function $g(e,t){let r,n;try{if(r=new OffscreenCanvas(e,t),n=r.getContext("2d"),n===null)throw new Error("getContext of OffscreenCanvas returns null")}catch{r=document.createElement("canvas"),n=r.getContext("2d")}return r.width=e,r.height=t,[r,n]}function Ij(e,t){const{width:r,height:n}=Rj(e.width,e.height),[i,o]=$g(r,n);return t&&/jpe?g/.test(t)&&(o.fillStyle="white",o.fillRect(0,0,i.width,i.height)),o.drawImage(e,0,0,i.width,i.height),i}function H0(){return H0.cachedResult!==void 0||(H0.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&typeof document<"u"&&"ontouchend"in document),H0.cachedResult}function cm(e,t={}){return new Promise(function(r,n){let i,o;var s=function(){try{return o=Ij(i,t.fileType||e.type),r([i,o])}catch(l){return n(l)}},a=function(l){try{var d=function(u){try{throw u}catch(h){return n(h)}};try{let u;return Aj(e).then(function(h){try{return u=h,kj(u).then(function(f){try{return i=f,function(){try{return s()}catch(p){return n(p)}}()}catch(p){return d(p)}},d)}catch(f){return d(f)}},d)}catch(u){d(u)}}catch(u){return n(u)}};try{if(H0()||[wi.DESKTOP_SAFARI,wi.MOBILE_SAFARI].includes(Vl()))throw new Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(e).then(function(l){try{return i=l,s()}catch{return a()}},a)}catch{a()}})}function um(e,t,r,n,i=1){return new Promise(function(o,s){let a;if(t==="image/png"){let d,u,h;return d=e.getContext("2d"),{data:u}=d.getImageData(0,0,e.width,e.height),h=po.encode([u.buffer],e.width,e.height,4096*i),a=new Blob([h],{type:t}),a.name=r,a.lastModified=n,l.call(this)}{let d=function(){return l.call(this)};if(t==="image/bmp")return new Promise(u=>Sj.toBlob(e,u)).then((function(u){try{return a=u,a.name=r,a.lastModified=n,d.call(this)}catch(h){return s(h)}}).bind(this),s);{let u=function(){return d.call(this)};if(typeof OffscreenCanvas=="function"&&e instanceof OffscreenCanvas)return e.convertToBlob({type:t,quality:i}).then((function(h){try{return a=h,a.name=r,a.lastModified=n,u.call(this)}catch(f){return s(f)}}).bind(this),s);{let h;return h=e.toDataURL(t,i),ix(h,r,n).then((function(f){try{return a=f,u.call(this)}catch(p){return s(p)}}).bind(this),s)}}}function l(){return o(a)}})}function Yo(e){e.width=0,e.height=0}function hu(){return new Promise(function(e,t){let r,n,i,o;return hu.cachedResult!==void 0?e(hu.cachedResult):ix("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then(function(s){try{return r=s,cm(r).then(function(a){try{return n=a[1],um(n,r.type,r.name,r.lastModified).then(function(l){try{return i=l,Yo(n),cm(i).then(function(d){try{return o=d[0],hu.cachedResult=o.width===1&&o.height===2,e(hu.cachedResult)}catch(u){return t(u)}},t)}catch(d){return t(d)}},t)}catch(l){return t(l)}},t)}catch(a){return t(a)}},t)})}function Pj(e){return new Promise((t,r)=>{const n=new Tj;n.onload=i=>{const o=new DataView(i.target.result);if(o.getUint16(0,!1)!=65496)return t(-2);const s=o.byteLength;let a=2;for(;a<s;){if(o.getUint16(a+2,!1)<=8)return t(-1);const l=o.getUint16(a,!1);if(a+=2,l==65505){if(o.getUint32(a+=2,!1)!=1165519206)return t(-1);const d=o.getUint16(a+=6,!1)==18761;a+=o.getUint32(a+4,d);const u=o.getUint16(a,d);a+=2;for(let h=0;h<u;h++)if(o.getUint16(a+12*h,d)==274)return t(o.getUint16(a+12*h+8,d))}else{if((65280&l)!=65280)break;a+=o.getUint16(a,!1)}}return t(-1)},n.onerror=i=>r(i),n.readAsArrayBuffer(e)})}function Oj(e,t){const{width:r}=e,{height:n}=e,{maxWidthOrHeight:i}=t;let o,s=e;return isFinite(i)&&(r>i||n>i)&&([s,o]=$g(r,n),r>n?(s.width=i,s.height=n/r*i):(s.width=r/n*i,s.height=i),o.drawImage(e,0,0,s.width,s.height),Yo(e)),s}function jj(e,t){const{width:r}=e,{height:n}=e,[i,o]=$g(r,n);switch(t>4&&t<9?(i.width=n,i.height=r):(i.width=r,i.height=n),t){case 2:o.transform(-1,0,0,1,r,0);break;case 3:o.transform(-1,0,0,-1,r,n);break;case 4:o.transform(1,0,0,-1,0,n);break;case 5:o.transform(0,1,1,0,0,0);break;case 6:o.transform(0,1,-1,0,n,0);break;case 7:o.transform(0,-1,-1,0,n,r);break;case 8:o.transform(0,-1,1,0,0,r)}return o.drawImage(e,0,0,r,n),Yo(e),i}function P7(e,t,r=0){return new Promise(function(n,i){let o,s,a,l,d,u,h,f,p,m,g,y,b,E,S,k,A,w,_,x;function C(I=5){if(t.signal&&t.signal.aborted)throw t.signal.reason;o+=I,t.onProgress(Math.min(o,100))}function P(I){if(t.signal&&t.signal.aborted)throw t.signal.reason;o=Math.min(Math.max(I,o),100),t.onProgress(o)}return o=r,s=t.maxIteration||10,a=1024*t.maxSizeMB*1024,C(),cm(e,t).then((function(I){try{return[,l]=I,C(),d=Oj(l,t),C(),new Promise(function(O,D){var M;if(!(M=t.exifOrientation))return Pj(e).then((function($){try{return M=$,U.call(this)}catch(j){return D(j)}}).bind(this),D);function U(){return O(M)}return U.call(this)}).then((function(O){try{return u=O,C(),hu().then((function(D){try{return h=D?d:jj(d,u),C(),f=t.initialQuality||1,p=t.fileType||e.type,um(h,p,e.name,e.lastModified,f).then((function(M){try{{let $=function(){if(s--&&(S>a||S>b)){let q,W;return q=x?.95*_.width:_.width,W=x?.95*_.height:_.height,[A,w]=$g(q,W),w.drawImage(_,0,0,q,W),f*=p==="image/png"?.85:.95,um(A,p,e.name,e.lastModified,f).then(function(ne){try{return k=ne,Yo(_),_=A,S=k.size,P(Math.min(99,Math.floor((E-S)/(E-a)*100))),$}catch(ae){return i(ae)}},i)}return[1]},j=function(){return Yo(_),Yo(A),Yo(d),Yo(h),Yo(l),P(100),n(k)};if(m=M,C(),g=m.size>a,y=m.size>e.size,!g&&!y)return P(100),n(m);var U;return b=e.size,E=m.size,S=E,_=h,x=!t.alwaysKeepResolution&&g,(U=(function(q){for(;q;){if(q.then)return void q.then(U,i);try{if(q.pop){if(q.length)return q.pop()?j.call(this):q;q=$}else q=q.call(this)}catch(W){return i(W)}}}).bind(this))($)}}catch($){return i($)}}).bind(this),i)}catch(M){return i(M)}}).bind(this),i)}catch(D){return i(D)}}).bind(this),i)}catch(O){return i(O)}}).bind(this),i)})}const P0e=` 163let scriptImported = false 164self.addEventListener('message', async (e) => { 165 const { file, id, imageCompressionLibUrl, options } = e.data 166 options.onProgress = (progress) => self.postMessage({ progress, id }) 167 try { 168 if (!scriptImported) {
169 // console.log('[worker] importScripts', imageCompressionLibUrl) 170 self.importScripts(imageCompressionLibUrl) 171 scriptImported = true 172 } 173 // console.log('[worker] self', self) 174 const compressedFile = await imageCompression(file, options) 175 self.postMessage({ file: compressedFile, id }) 176 } catch (e) { 177 // console.error('[worker] error', e) 178 self.postMessage({ error: e.message + '\\n' + e.stack, id }) 179 } 180}) 181`;let Rv;function O0e(e,t){return new Promise((r,n)=>{Rv||(Rv=function(s){const a=[];return typeof s=="function"?a.push(`(${s})()`):a.push(s),URL.createObjectURL(new Blob(a))}(P0e));const i=new Worker(Rv);i.addEventListener("message",function(s){if(t.signal&&t.signal.aborted)i.terminate();else if(s.data.progress===void 0){if(s.data.error)return n(new Error(s.data.error)),void i.terminate();r(s.data.file),i.terminate()}else t.onProgress(s.data.progress)}),i.addEventListener("error",n),t.signal&&t.signal.addEventListener("abort",()=>{n(t.signal.reason),i.terminate()}),i.postMessage({file:e,imageCompressionLibUrl:t.libURL,options:{...t,onProgress:void 0,signal:void 0}})})}function An(e,t){return new Promise(function(r,n){let i,o,s,a,l,d;if(i={...t},s=0,{onProgress:a}=i,i.maxSizeMB=i.maxSizeMB||Number.POSITIVE_INFINITY,l=typeof i.useWebWorker!="boolean"||i.useWebWorker,delete i.useWebWorker,i.onProgress=p=>{s=p,typeof a=="function"&&a(s)},!(e instanceof Blob||e instanceof I0e))return n(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(e.type))return n(new Error("The file given is not an image"));if(d=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,!l||typeof Worker!="function"||d)return P7(e,i).then((function(p){try{return o=p,f.call(this)}catch(m){return n(m)}}).bind(this),n);var u=(function(){try{return f.call(this)}catch(p){return n(p)}}).bind(this),h=function(p){try{return P7(e,i).then(function(m){try{return o=m,u()}catch(g){return n(g)}},n)}catch(m){return n(m)}};try{return i.libURL=i.libURL||"https://cdn.jsdelivr.net/npm/[email protected]/dist/browser-image-compression.js",O0e(e,i).then(function(p){try{return o=p,u()}catch{return h()}},h)}catch{h()}function f(){try{o.name=e.name,o.lastModified=e.lastModified}catch{}try{i.preserveExif&&e.type==="image/jpeg"&&(!i.fileType||i.fileType&&i.fileType===e.type)&&(o=Ej(e,o))}catch{}return r(o)}})}An.getDataUrlFromFile=Aj,An.getFilefromDataUrl=ix,An.loadImage=kj,An.drawImageInCanvas=Ij,An.drawFileInCanvas=cm,An.canvasToFile=um,An.getExifOrientation=Pj,An.handleMaxWidthOrHeight=Oj,An.followExifOrientation=jj,An.cleanupCanvasMemory=Yo,An.isAutoOrientationInBrowser=hu,An.approximateBelowMaximumCanvasSizeOfBrowser=Rj,An.copyExifWithoutOrientation=Ej,An.getBrowserName=Vl,An.version="2.0.2";const r0="RAW_NO_PREVIEW",zo={IMAGE_WIDTH:256,IMAGE_LENGTH:257,COMPRESSION:259,PHOTOMETRIC_INTERPRETATION:262,STRIP_OFFSETS:273,STRIP_BYTE_COUNTS:279,SUB_IFDS:330,JPEG_INTERCHANGE_FORMAT:513,JPEG_INTERCHANGE_FORMAT_LENGTH:514},j0e=7,L0e=new Set([2,6]),$0e=new Set(Object.values(zo)),D0e={1:1,2:1,3:2,4:4,5:8,7:1,9:4,10:8,11:4,12:8,13:4},M0e=1024,N0e=16,F0e=16;async function bu(e,t,r){if(t<0||r<=0||t+r>e.size)return null;try{const n=await e.slice(t,t+r).arrayBuffer();return n.byteLength<r?null:new DataView(n)}catch{return null}}function O7(e,t,r,n){switch(r){case 1:case 7:return e.getUint8(t);case 3:return e.getUint16(t,n);case 4:case 9:return e.getUint32(t,n);default:return null}}async function j7(e,t,r){const n=await bu(e,t,2);if(!n)return null;const i=n.getUint16(0,r);if(i===0||i>512)return null;const o=await bu(e,t+2,i*12+4);if(!o)return null;const s=new Map;for(let a=0;a<i;a++){const l=a*12,d=o.getUint16(l,r),u=o.getUint16(l+2,r),h=o.getUint32(l+4,r);if(!$0e.has(d))continue;const f=D0e[u];if(!f)continue;const p=f*h,m=[],g=Math.min(h,32);if(p<=4)for(let y=0;y<g;y++){const b=O7(o,l+8+y*f,u,r);b!==null&&m.push(b)}else{const y=o.getUint32(l+8,r),b=await bu(e,y,g*f);if(b)for(let E=0;E<g;E++){const S=O7(b,E*f,u,r);S!==null&&m.push(S)}}m.length>0&&s.set(d,{type:u,count:h,values:m})}return{fields:s,next:o.getUint32(i*12,r)}}function L7(e){var s,a,l,d,u,h,f;if(((s=e.get(zo.COMPRESSION))==null?void 0:s.values[0])!==j0e)return null;const r=(a=e.get(zo.PHOTOMETRIC_INTERPRETATION))==null?void 0:a.values[0];if(r===void 0||!L0e.has(r))return null;const n=e.get(zo.STRIP_OFFSETS);
181if(n&&n.count!==1)return null;const i=(n==null?void 0:n.values[0])??((l=e.get(zo.JPEG_INTERCHANGE_FORMAT))==null?void 0:l.values[0]),o=((d=e.get(zo.STRIP_BYTE_COUNTS))==null?void 0:d.values[0])??((u=e.get(zo.JPEG_INTERCHANGE_FORMAT_LENGTH))==null?void 0:u.values[0]);return!i||!o?null:{width:((h=e.get(zo.IMAGE_WIDTH))==null?void 0:h.values[0])??0,height:((f=e.get(zo.IMAGE_LENGTH))==null?void 0:f.values[0])??0,offset:i,length:o}}async function U0e(e){var a;const t=await bu(e,0,8);if(!t)throw new Error(r0);const r=String.fromCharCode(t.getUint8(0),t.getUint8(1));if(r!=="II"&&r!=="MM")throw new Error(r0);const n=r==="II";if(t.getUint16(2,n)!==42)throw new Error(r0);const i=[];let o=t.getUint32(4,n);const s=new Set;for(let l=0;l<N0e&&o&&!s.has(o);l++){s.add(o);const d=await j7(e,o,n);if(!d)break;const u=L7(d.fields);u&&i.push(u);const h=((a=d.fields.get(zo.SUB_IFDS))==null?void 0:a.values)??[];for(const f of h.slice(0,F0e)){if(s.has(f))continue;s.add(f);const p=await j7(e,f,n);if(!p)continue;const m=L7(p.fields);m&&i.push(m)}o=d.next}i.sort((l,d)=>d.width*d.height-l.width*l.height);for(const l of i){if(Math.max(l.width,l.height)<M0e)continue;const d=e.slice(l.offset,l.offset+l.length),u=await bu(e,l.offset,2),h=await bu(e,l.offset+l.length-2,2),f=(u==null?void 0:u.getUint8(0))===255&&(u==null?void 0:u.getUint8(1))===216,p=(h==null?void 0:h.getUint8(0))===255&&(h==null?void 0:h.getUint8(1))===217;if(!(!f||!p))return new File([d],e.name.replace(/\.[^.]+$/,"")+".jpg",{type:"image/jpeg",lastModified:e.lastModified})}throw new Error(r0)}const B0e={jpeg:[255,216,255],png:[137,80,78,71,13,10,26,10],webp:[82,73,70,70,null,null,null,null,87,69,66,80],heic:[null,null,null,null,102,116,121,112,104,101,105,99],heif:[null,null,null,null,102,116,121,112,104,101,105,102],avif:[null,null,null,null,102,116,121,112,97,118,105,102],tiffBigEndian:[77,77,0,42],tiffLittleEndian:[73,73,42,0]},V0e=new Set(["tiffBigEndian","tiffLittleEndian"]),ox="raw";async function H0e(e){try{const t=await e.slice(0,12).arrayBuffer(),r=new Uint8Array(t);for(const[n,i]of Object.entries(B0e)){let o=!0;for(let s=0;s<i.length;s++)if(i[s]!==null&&r[s]!==i[s]){o=!1;break}if(o)return V0e.has(n)?ox:n}return null}catch(t){return console.warn("Error detecting file type:",t),null}}function z0e(e){if(e.type==="image/heic"||e.type==="image/heif")return!0;const t=e.name.toLowerCase();return t.endsWith(".heic")||t.endsWith(".heif")}function W0e(e,t,r){const n=["heic","heif","avif",ox];if(e&&n.includes(e)||t.includes("heic")||t.includes("heif")||t.includes("avif"))return!0;const i=r.toLowerCase();return n.some(o=>i.endsWith(`.${o}`))}function q0e(e,t,r){if(e&&["jpeg","png","webp"].includes(e)||t.startsWith("image/")&&(t.includes("jpeg")||t.includes("jpg")||t.includes("png")||t.includes("webp")))return!0;const i=r.toLowerCase();return i.endsWith(".jpg")||i.endsWith(".jpeg")||i.endsWith(".png")||i.endsWith(".webp")}function Lj(e,t,r){return new File([e],t,{type:r,lastModified:Date.now()})}async function G0e(e){return new Blob([await e.arrayBuffer()],{type:e.type})}async function K0e(e){try{const t=(await X(()=>import("./heic2any-CsPPvNuQ.js").then(o=>o.h),__vite__mapDeps([16,2]))).default,r=await t({blob:e,toType:"image/jpeg",quality:.95}),n=Array.isArray(r)?r[0]:r,i=new File([n],e.name.replace(/\.(heic|heif)$/i,".jpg"),{type:"image/jpeg"});return console.log("HEIC conversion success"),i}catch(t){throw pe(fe.PRODUCT.IMAGE_COMPRESSION_ERROR,{originalSize:e.size,originalFormat:e.type,error:t instanceof Error?t.message:"Unknown HEIC conversion error"}),console.warn("HEIC conversion failed:",t),new Error("Failed to convert HEIC/HEIF file. Please try a different image format.")}}let n0=null;function $7(){if(n0===null)try{n0=document.createElement("canvas").toDataURL("image/webp").startsWith("data:image/webp")}catch{n0=!1}return n0}const dm=5*1024*1024,$j=4.5,Y0e=Math.round($j*1024*1024),Z0e="IMAGE_TOO_LARGE";async function Dj(e,t){let r=null;try{const n=document.createElement("img");r=URL.createObjectURL(e);const i=r;await new Promise((h,f)=>{n.onload=()=>h(),n.onerror=()=>f(new Error("Failed to decode image")),n.src=i});
181const o=Math.min(1,t/Math.max(n.naturalWidth,n.naturalHeight)),s=Math.max(1,Math.round(n.naturalWidth*o)),a=Math.max(1,Math.round(n.naturalHeight*o)),l=document.createElement("canvas");l.width=s,l.height=a;const d=l.getContext("2d");if(!d)throw new Error("Could not get canvas context");d.fillStyle="#ffffff",d.fillRect(0,0,s,a),d.imageSmoothingEnabled=!0,d.imageSmoothingQuality="high",d.drawImage(n,0,0,s,a);const u=await new Promise(h=>{l.toBlob(h,"image/png")});if(X0e(l),!u)throw new Error("Canvas produced an empty blob");return Lj(u,e.name,"image/png")}catch(n){return console.warn("White flatten failed, using original file:",n),e}finally{r&&URL.revokeObjectURL(r)}}function X0e(e){e.width=0,e.height=0}async function Mj(e,t){const r=e.type==="image/png"?await Dj(e,t):e;try{const n=await An(r,{maxSizeMB:$j,maxWidthOrHeight:t,initialQuality:.9,useWebWorker:!1,fileType:"image/jpeg"});if(n&&n.size>0&&n.size<=dm)return n;throw new Error(`Still ${(n==null?void 0:n.size)??0} bytes after shrinking (limit ${dm})`)}catch(n){throw pe(fe.PRODUCT.IMAGE_COMPRESSION_ERROR,{originalSize:e.size,originalFormat:e.type,error:n instanceof Error?n.message:"Unknown shrink error",stage:"shrink_to_upload_limit"}),new Error(Z0e)}}const D7=10*1024;async function J0e(e,t){return!e||e.size===0?!1:t<D7?!0:e.size<D7?(console.warn(`Compressed file is suspiciously small: ${e.size} bytes (original: ${t} bytes)`),!1):!0}async function Nj(e,t=2560){const r=e.size,n=[];let i=e;if(!$7()&&e.type==="image/png"){if(e.size<=Y0e)return e;i=await Dj(e,t)}let o;try{o=await G0e(i)}catch(a){return console.error("Failed to read original file:",a),e}const s=[...$7()?[{name:"webp",options:{maxSizeMB:3,maxWidthOrHeight:t,initialQuality:.95,alwaysKeepResolution:!0,useWebWorker:!1,fileType:"image/webp"}}]:[],{name:"jpeg",options:{maxSizeMB:3,maxWidthOrHeight:t,initialQuality:.95,alwaysKeepResolution:!0,useWebWorker:!1,fileType:"image/jpeg"}}];for(const a of s)try{const l=Lj(o,i.name,i.type),d=await An(l,a.options);if(a.options.fileType&&d.type!==a.options.fileType)throw new Error(`Browser produced ${d.type} instead of ${a.options.fileType}`);if(!await J0e(d,r))throw pe(fe.PRODUCT.IMAGE_COMPRESSION_ERROR,{originalSize:r,compressedSize:(d==null?void 0:d.size)||0,originalFormat:e.type,compressedFormat:(d==null?void 0:d.type)||"unknown",attempt:a.name,error:"Compressed file is empty or suspiciously small (possible black image)"}),new Error("Compressed file is empty or suspiciously small (possible black image)");const h=r>0?(r-d.size)/r:0;return console.log(`Compression successful with ${a.name}:`,{originalSize:r,compressedSize:d.size,compressionRatio:(h*100).toFixed(1)+"%"}),d}catch(l){const d=l instanceof Error?l.message:"Unknown error";n.push(`${a.name}: ${d}`),console.warn(`Compression attempt '${a.name}' failed:`,d);continue}return pe(fe.PRODUCT.IMAGE_COMPRESSION_ERROR,{originalSize:r,originalFormat:e.type,error:"All compression attempts failed",attempts:s.map(a=>a.name),attemptErrors:n}),pe(fe.PRODUCT.IMAGE_COMPRESSION_SKIPPED,{originalSize:r,originalFormat:e.type,reason:"all_compression_attempts_failed"}),console.warn("All compression attempts failed, using original file:",n),e}function Q0e(e,t){return new Promise((r,n)=>{const i=setTimeout(()=>{n(new Error("Request timed out"))},t);e.then(o=>{clearTimeout(i),r(o)}).catch(o=>{clearTimeout(i),n(o)})})}async function e1e(e,t){const r=t.lastIndexOf("/"),n=r===-1?"":t.slice(0,r),i=t.slice(r+1);try{const{data:o,error:s}=await Te.storage.from(e).list(n,{limit:100,search:i});return s?!1:!!(o!=null&&o.some(a=>a.name===i))}catch{return!1}}async function xf(e,t,r,n){let o;for(let s=0;s<2;s++){let a;try{const l=await Q0e(Te.storage.from(e).upload(t,r,{contentType:n,cacheControl:"3600"}),9e4);if(!(l!=null&&l.error))return l;a=l.error}catch(l){a=l instanceof Error?l:new Error("Unknown error")}if(o=a,await e1e(e,t))return{data:{path:t},error:null};s<1&&(console.warn(`Upload attempt ${s+1} failed, retrying...`,a==null?void 0:a.message),await new Promise(l=>setTimeout(l,1e3)))}return{data:null,error:o}}async function Fj(e){const t=await H0e(e),r=q0e(t,e.type,e.name),n=W0e(t,e.type,e.name);if(!r&&!n)throw pe(fe.PRODUCT.IMAGE_COMPRESSION_ERROR,{originalSize:e.size,originalFormat:e.type,actualFormat:t,error:"Unsupported file format"}),new Error("Formato de arquivo não suportado. Por favor, use imagens PNG, JPG ou WebP.");t&&n&&r&&console.log(`File type mismatch detected, but it's a convert
181ible format: actual=${t}, reported=${e.type}, filename=${e.name}`);let i=e;if(t&&["heic","heif"].includes(t)||z0e(e))i=await K0e(e);else if(t===ox)try{i=await U0e(e)}catch{throw pe(fe.PRODUCT.IMAGE_COMPRESSION_ERROR,{originalSize:e.size,originalFormat:e.type,actualFormat:t,error:"Raw file has no usable embedded preview"}),new Error("Formato de arquivo não suportado. Por favor, use imagens PNG, JPG ou WebP.")}else(t==="avif"||e.type.includes("avif"))&&console.log("AVIF file detected, will convert during compression");return{processedFile:i,originalFile:e,actualType:t}}function SCe(e){const{user:t}=ot(),r=t==null?void 0:t.id,n=(e==null?void 0:e.maxSize)||2560,i=(e==null?void 0:e.bucketName)||"product_images";return jn({mutationFn:async o=>{var g;if(!r)throw new Error("User not authenticated");const{processedFile:s,originalFile:a}=await Fj(o);let l;try{const y=await Nj(s,n);!y||y.size===0?(console.warn("Compressed file is invalid, using processed file"),l=s):l=y}catch(y){console.warn("Compression failed entirely, using processed file:",y),l=s,pe(fe.PRODUCT.IMAGE_COMPRESSION_ERROR,{originalSize:s.size,originalFormat:s.type,error:y instanceof Error?y.message:"Unknown compression error"})}(!l||l.size===0)&&(console.warn("File to upload is invalid, using original file"),l=a),l.size>dm&&(l=await Mj(l,n));let d;l.type.includes("webp")?d="webp":l.type.includes("jpeg")||l.type.includes("jpg")?d="jpg":l.type.includes("png")?d="png":s!==a?d="jpg":d=((g=a.name.split(".").pop())==null?void 0:g.toLowerCase())||"jpg";const u=`${Lg(7)}.${d}`,h=`${r}/${u}`,f=await xf(i,h,l,l.type||"image/jpeg");if(f!=null&&f.error)throw pe(fe.PRODUCT.IMAGE_UPLOAD_ERROR,{originalSize:a.size,compressedSize:l.size,originalFormat:a.type,compressedFormat:l.type,error:f.error.message||"Unknown upload error",bucketName:i}),f.error;const{data:p}=Te.storage.from(i).getPublicUrl(h),m=p.publicUrl;if(!m){const y="Failed to get public URL for uploaded image";throw pe(fe.PRODUCT.IMAGE_UPLOAD_ERROR,{originalSize:a.size,compressedSize:l.size,originalFormat:a.type,compressedFormat:l.type,error:y,bucketN
181ame:i}),new Error(y)}return m},onError:o=>{console.error("Upload error:",o)},onSuccess:o=>{console.log("Upload successful:",o)}})}function CCe(){const{user:e}=ot(),t=e==null?void 0:e.id;return jn({mutationFn:async r=>{var d;if(!t)throw new Error("User not authenticated");const n=`${Lg(7)}.png`,i=`${t}/${n}`,o="logos",s=await xf(o,i,r,"image/png");if(s!=null&&s.error){if((d=s.error.message)!=null&&d.includes("does not exist")){const u=await xf("product_images",i,r,"image/png");if(u.error)throw pe(fe.PRODUCT.IMAGE_UPLOAD_ERROR,{originalSize:r.size,compressedSize:r.size,originalFormat:r.type,compressedFormat:r.type,error:u.error.message,bucketName:"product_images (fallback)",isFavicon:!0}),u.error;const{data:h}=Te.storage.from("product_images").getPublicUrl(i),f=h.publicUrl;if(!f){const p="Failed to get public URL for uploaded favicon";throw pe(fe.PRODUCT.IMAGE_UPLOAD_ERROR,{originalSize:r.size,compressedSize:r.size,originalFormat:r.type,compressedFormat:r.type,error:p,bucketName:"product_images (fallback)",isFavicon:!0}),new Error(p)}return f}throw pe(fe.PRODUCT.IMAGE_UPLOAD_ERROR,{originalSize:r.size,compressedSize:r.size,originalFormat:r.type,compressedFormat:r.type,error:s.error.message||"Unknown upload error",bucketName:o,isFavicon:!0}),s.error}const{data:a}=Te.storage.from(o).getPublicUrl(i),l=a.publicUrl;if(!l){const u="Failed to get public URL for uploaded favicon";throw pe(fe.PRODUCT.IMAGE_UPLOAD_ERROR,{originalSize:r.size,compressedSize:r.size,originalFormat:r.type,compressedFormat:r.type,error:u,bucketName:o,isFavicon:!0}),new Error(u)}return l},onError:r=>{console.error("Favicon upload error:",r)},onSuccess:r=>{console.log("Favicon upload successful:",r)}})}function t1e(){const{user:e}=ot(),t=e==null?void 0:e.id;return jn({mutationFn:async r=>{var p,m;if(!t)throw new Error("User not authenticated");const{processedFile:n,originalFile:i}=await Fj(r);let o;try{const g=await Nj(n,512);!g||g.size===0?(console.warn("Compressed logo file is invalid, using processed file"),o=n):o=g}catch(g){console.warn("Logo compression failed entirely, using processed file:",g),o=n,pe(fe.PRODUCT.IMAGE_COMPRESSION_ERROR,{originalSize:n.size,originalFormat:n.type,error:g instanceof Error?g.message:"Unknown compression error",isLogo:!0})}(!o||o.size===0)&&(console.warn("Logo file to upload is invalid, using original file"),o=i),o.size>dm&&(o=await Mj(o,512));let s;o.type.includes("webp")?s="webp":o.type.includes("jpeg")||o.type.includes("jpg")?s="jpg":o.type.includes("png")?s="png":n!==i?s="jpg":s=((p=i.name.split(".").pop())==null?void 0:p.toLowerCase())||"jpg";const a=`${Lg(7)}.${s}`,l=`${t}/${a}`,d="logos",u=await xf(d,l,o,o.type||"image/jpeg");if(u!=null&&u.error){if((m=u.error.message)!=null&&m.includes("does not exist")){const g=await xf("product_images",l,o,o.type||"image/jpeg");if(g.error)throw pe(fe.PRODUCT.IMAGE_UPLOAD_ERROR,{originalSize:i.size,compressedSize:o.size,originalFormat:i.type,compressedFormat:o.type,error:g.error.message,bucketName:"product_images (fallback)",isLogo:!0}),g.error;const{data:y}=Te.storage.from("product_images").getPublicUrl(l),b=y.publicUrl;if(!b){const E="Failed to get public URL for uploaded logo";throw pe(fe.PRODUCT.IMAGE_UPLOAD_ERROR,{originalSize:i.size,compressedSize:o.size,originalFormat:i.type,compressedFormat:o.type,error:E,bucketName:"product_images (fallback)",isLogo:!0}),new Error(E)}return b}throw pe(fe.PRODUCT.IMAGE_UPLOAD_ERROR,{originalSize:i.size,compressedSize:o.size,originalFormat:i.type,compressedFormat:o.type,error:u.error.message||"Unknown upload error",bucketName:d,isLogo:!0}),u.error}const{data:h}=Te.storage.from(d).getPublicUrl(l),f=h.publicUrl;if(!f){const g="Failed to get public URL for uploaded logo";throw pe(fe.PRODUCT.IMAGE_UPLOAD_ERROR,{originalSize:i.size,compressedSize:o.size,originalFormat:i.type,compressedFormat:o.type,error:g,bucketName:d,isLogo:!0}),new Error(g)}return f},onError:r=>{console.error("Logo upload error:",r)},onSuccess:r=>{console.log("Logo upload successful:",r)}})}const r1e=5*1024*1024;function n1e({onNext:e,initialLogo:t=""}){const[r,n]=v.useState(null),[i,o]=v.useState(t||null),[s,a]=v.useState(!1),[l,d]=v.useState(!1),[u,h]=v.useState(null),[f,p]=v.useState(null),m=t1e();v.useEffect(()=>{t&&!i&&o(t)},[t,i]);const g=async E=>{var k;const S=(k=E.target.files)==null?void 0:k[0];if(S){if(S.size>r1e){a(!0),pe(fe.REGISTRATION.LOGO_UPLOAD_ERROR,{errorMessage:"Logo file size exceeds 5MB limit",errorCode:"size_limit_exceeded",fileName:S.name,fileSize:S.size,fileType:S.type,stage:"selection",timestamp:new Date().toISOString()});return}a(!1),h(null),d(!0),n(S);try{const A=await m.mutateAsync(S);i&&i.startsWith("blob:")&&i!==t&&URL.revokeObjectURL(i),o(A),p(A)}catch(A){console.error("Logo upload failed:",A);const w=A instanceof Error?A.message:"Erro ao fazer upload do logo";if(h(w),w.includes("Formato de arquivo não suportado")){n(null);return}const _=S.type.toLowerCase();if(_.includes("jpeg")||_.includes("jpg")||_.includes("png")||_.includes("webp")){i&&i.startsWith("blob:")&&i!==t&&URL.revokeObjectURL(i);const x=URL.createObjectURL(S);o(x)}else n(null)}finally{d(!1)}}},y=()=>{n(null),a(!1),h(null),p(null),i&&i.startsWith("blob:")&&i!==t&&URL.revokeObjectURL(i),o(null)},b=()=>{s?(pe(fe.REGISTRATION.STEP_LOGO,{status:"skipped_due_to_size_error",timestamp:new Date().toISOString()}),e(null)):u?(pe(fe.REGISTRATION.STEP_LOGO,{status:"skipped_due_to_upload_error",error:u,timestamp:new Date().toISOString()}),e(null)):e(f?null:r,f||void 0)};return v.useEffect(()=>()=>{i&&i.startsWith("blob:")&&i!==t&&URL.revokeObjectURL(i)},[i,t]),c.jsxs(ki,{children:[c.jsxs(F,{children:[c.jsx(V,{variant:"h5",fontWeight:600,gutterBottom:!0,children:"Adicione o logotipo da sua loja"}),c.jsx(V,{variant:"body1",color:"text.secondary",gutterBottom:!0,children:"Este passo é opcional. Você poderá adicionar ou alterar o logotipo depois."})]}),c.jsx(me,{spacing:2.5,children:c.jsxs(rt.div,{initial:{opacity:0,y:20}
181,animate:{opacity:1,y:0},transition:{delay:.2},children:[s&&c.jsx(rt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},children:c.jsx(zn,{severity:"warning",sx:{mb:2},onClose:()=>a(!1),children:"A imagem excede o limite de 5MB. Escolha uma imagem menor ou continue sem logo. Você poderá adicionar ou alterar o logotipo depois."})}),u&&c.jsx(rt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},children:c.jsx(zn,{severity:"error",sx:{mb:2},onClose:()=>h(null),children:u})}),c.jsxs(F,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",p:3,border:"2px dashed",borderColor:s?"warning.main":"divider",borderRadius:2,bgcolor:"background.paper",height:160,position:"relative",overflow:"hidden",transition:"all 0.2s",cursor:l?"wait":"pointer"},children:[c.jsx("input",{type:"file",accept:"image/jpeg,image/jpg,image/png,image/webp,image/heic,image/heif,.jpg,.jpeg,.png,.webp,.heic,.heif",style:{display:"none"},id:"logo-upload",onChange:g,disabled:l}),c.jsx("label",{htmlFor:"logo-upload",style:{width:"100%",height:"100%",cursor:l?"wait":"pointer"},children:i&&!s?c.jsxs(F,{sx:{position:"relative",width:"100%",height:"100%"},children:[c.jsx(F,{component:"img",src:i,alt:"Logo Preview",sx:{width:"100%",height:"100%",objectFit:"contain",opacity:l?.5:1}}),l&&c.jsx(F,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},children:c.jsx(bn,{size:24})})]}):c.jsxs(F,{sx:{width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:1,color:"text.secondary"},children:[c.jsx(F,{sx:{width:48,height:48,borderRadius:"50%",bgcolor:"primary.50",display:"flex",alignItems:"center",justifyContent:"center"},children:c.jsx(rM,{sx:{color:"primary.main",fontSize:24}})}),c.jsx(V,{variant:"body2",fontWeight:500,children:"Clique para fazer upload do logo"}),c.jsx(V,{variant:"caption",color:"text.secondary",children:"Formato horizontal recomendado (300x100px), máximo 5MB"})]})})]}),r&&!s&&c.jsx(rt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},children:c.jsxs(F,{sx:{display:"flex",alignItems:"center",mt:2,p:2,borderRadius:2,bgcolor:"primary.50"},children:[c.jsxs(F,{sx:{flex:1},children:[c.jsx(V,{variant:"body2",fontWeight:500,noWrap:!0,children:r.name}),c.jsxs(V,{variant:"caption",color:"text.secondary",children:[(r.size/1024).toFixed(0)," KB"]})]}),c.jsx(De,{variant:"outlined",size:"small",onClick:y,sx:{borderColor:"primary.main",color:"primary.main"},children:"Remover"})]})}),i&&!r&&!s&&c.jsx(rt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},children:c.jsx(F,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",mt:2},children:c.jsx(De,{variant:"outlined",size:"small",onClick:y,sx:{borderColor:"primary.main",color:"primary.main"},children:"Remover logo"})})})]})}),c.jsx(De,{fullWidth:!0,variant:"contained",size:"large",onClick:b,disabled:l,sx:{borderRadius:2,py:1.5},children:l?"Processando...":r&&!s&&!u?"Continuar":s||u?"Continuar sem logo":i?"Continuar":"Continuar sem logo"})]})}var hm;(function(e){e.Accessibility="accessibility",e.Account="account",e.AirplaneMode="airplane_mode",e.Apn="apn",e.ApplicationDetails="application_details",e.ApplicationDevelopment="application_development",e.Application="application",e.AppNotification="app_notification",e.BatteryOptimization="battery_optimization",e.Bluetooth="bluetooth",e.Captioning="captioning",e.Cast="cast",e.DataRoaming="data_roaming",e.Date="date",e.Display="display",e.Dream="dream",e.Home="home",e.Keyboard="keyboard",e.KeyboardSubType="keyboard_subtype",e.Locale="locale",e.Location="location",e.ManageApplications="manage_applications",e.ManageAllApplications="manage_all_applications",e.MemoryCard="memory_card",e.Network="network",e.NfcSharing="nfcsharing",e.NfcPayment="nfc_payment",e.NfcSettings="nfc_settings",e.Print="print",e.Privacy="privacy",e.QuickLaunch="quick_launch",e.Search="search",e.Security="security",e.Settings="settings",e.ShowRegulatoryInfo="show_regulatory_info",e.Sound="sound",e.Storage="storage",e.Sync="sync",e.TextToSpeech="text_to_speech",e.Usage="usage",e.UserDictionary="user_dictionary",e.VoiceInput="voice_input",e.VPN="vpn",e.Wifi="wifi",e.WifiIp="wifi_ip",e.Wireless="wireless",e.ZenMode="zen_mode",e.ZenModePriority="zen_mode_priority",e.ZenModeBlockedEffects="zen_mode_blocked_effects"})(hm||(hm={}));var l_;(function(e){e.About="about",e.App="app",e.AppNotification="appNotification",e.AutoLock="autoLock",e.Bluetooth="bluetooth",e.DateTime="dateTime",e.FaceTime="facetime",e.General="general",e.Keyboard="keyboard",e.ICloud="iCloud",e.ICloudStorageBackup="iCloudStorageBackup",e.International="international",e.LocationServices="locationServices",e.Music="music",e.Notes="notes",e.Notifications="notifications",e.Phone="phone",e.Photos="photos",e.ManagedConfigurationList="managedConfigurationList",e.Reset="reset",e.Ringtone="r
181ingtone",e.Sounds="sounds",e.SoftwareUpdate="softwareUpdate",e.Store="store",e.Tracking="tracking",e.VPN="vpn",e.Wallpaper="wallpaper",e.WiFi="wifi",e.Tethering="tethering",e.DoNotDisturb="doNotDisturb",e.TouchIdPasscode="touchIdPasscode",e.ScreenTime="screenTime",e.Accessibility="accessibility"})(l_||(l_={}));const Uj=Kr("NativeSettings",{web:()=>X(()=>import("./web-Cr-1F3rV.js"),__vite__mapDeps([17,1,2,3,4,5,6])).then(e=>new e.NativeSettingsWeb)});function i1e(e,t,r){return new Promise(n=>{let i=!1;const o=a=>{i||(i=!0,clearTimeout(s),n(a))},s=setTimeout(()=>o(r),t);e.then(o,()=>o(r))})}const o1e=4e3;function s1e(e){const[t,r]=v.useState(!1);return v.useEffect(()=>{const n=setTimeout(()=>r(!0),e);return()=>clearTimeout(n)},[e]),t}const a1e=4e3,Iv=async()=>{if(!ph())return Z5(void 0);const{receive:e}=await Ps.checkPermissions();return Z5(e)},l1e=()=>{const{user:e}=ot(),[t,r]=v.useState(null),[n,i]=v.useState(!1),o=qe.isNativePlatform();v.useEffect(()=>{if(!o||n)return;(async()=>{try{const{granted:f}=await Iv();r(f)}catch{r(!1)}i(!0)})()},[o,n]),v.useEffect(()=>{if(!o)return;const h=sc.addListener("appStateChange",async f=>{if(f.isActive)try{const{granted:p}=await Iv();r(p)}catch{}});return()=>{h.then(f=>f.remove())}},[o]);const s=!o||n,a=t===!0,l=v.useCallback(async()=>{try{await Uj.open({optionAndroid:hm.AppNotification,optionIOS:l_.App})}catch{}},[]),d=v.useCallback(async()=>{if(!o)return!1;try{const h=await i1e(Iv(),o1e,null);if(h===null)return!1;if(!h.canRequest)return r(h.granted),h.granted?(pe(fe.ONESIGNAL.PERMISSION_GRANTED,{userId:e==null?void 0:e.id,source:"permission_hook"}),!0):(pe(fe.ONESIGNAL.PERMISSION_DENIED,{userId:e==null?void 0:e.id,source:"permission_hook"}),!1);const{receive:f}=await Ps.requestPermissions(),{granted:p}=Z5(f);return r(p),p?(pe(fe.ONESIGNAL.PERMISSION_GRANTED,{userId:e==null?void 0:e.id,source:"permission_hook"}),!0):(pe(fe.ONESIGNAL.PERMISSION_DENIED,{userId:e==null?void 0:e.id,source:"permission_hook"}),!1)}catch{return!1}},[o,e==null?void 0:e.id]),u=v.useCallback(()=>{pe(fe.ONESIGNAL.PERMISSION_SOFT_SKIP,{userId:e==null?void 0:e.id})},[e==null?void 0:e.id]);return{isGranted:a,isReady:s,requestFullPermission:d,skipPermission:u,openNotificationSettings:l}},c1e=4e3;function Bj(e){const t=l1e(),{requestFullPermission:r}=t,[n,i]=v.useState(!1),[o,s]=v.useState(!1),a=v.useRef(!1),l=v.useRef(null),d=v.useRef(e);v.useEffect(()=>{d.current=e},[e]),v.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]);const u=v.useCallback(async()=>{var f;if(a.current){s(!0);return}a.current=!0,i(!0);let h=!1;l.current=setTimeout(()=>{h||(i(!1),s(!0))},c1e);try{const p=await r();h=!0,(f=d.current)==null||f.call(d,p),p||s(!0)}finally{l.current&&clearTimeout(l.current),l.current=null,a.current=!1,i(!1)}},[r]);return{...t,enable:u,isEnabling:n,showSettingsDialog:o,setShowSettingsDialog:s}}function Vj({open:e,onClose:t,onOpenSettings:r}){return c.jsxs(Fr,{open:e,onClose:t,PaperProps:{sx:{borderRadius:2,maxWidth:"320px",margin:2}},children:[c.jsxs(zr,{sx:{pb:1,pt:3,px:3,display:"flex",alignItems:"center",gap:1},children:[c.jsx(P_,{sx:{color:"primary.main",fontSize:24}}),"Ativar notificações"]}),c.jsx(Er,{sx:{px:3,pt:1,pb:3},children:c.jsx(V,{variant:"body2",color:"text.secondary",children:"Para receber alertas de pedidos, mensagens e pagamentos, você precisa ativar as notificações nas configurações do seu dispositivo."})}),c.jsxs(nn,{sx:{px:3,pb:3,display:"flex",flexDirection:"column",gap:1},children:[c.jsx(De,{fullWidth:!0,variant:"contained",onClick:r,sx:{textTransform:"none",py:1,fontSize:"0.875rem",fontWeight:500},children:"Ir para configurações"}),c.jsx(De,{fullWidth:!0,color:"inherit",onClick:t,sx:{textTransform:"none",fontSize:"0.875rem"},children:"Agora não"})]})]})}const u1e=[{icon:nM,title:"Pedidos",description:"Saiba na hora quando receber novos pedidos"},{icon:iM,title:"Mensagens",description:"Nunca perca uma mensagem de cliente"},{icon:oM,title:"Pagamentos",description:"Receba confirmacoes de pagamento em tempo real"}];function d1e({onNext:e}){const{isGranted:t,isReady:r,skipPermission:n,openNotificationSettings:i,enable:o,isEnabling:s,showSettingsDialog:a,setShowSettingsDialog:l}=Bj(m=>{m&&e()}),u=!qe.isNativePlatform()||t;if(v.useEffect(()=>{r&&u&&e()},[r,u,e]),!r||u)return null;const h=()=>{n(),e()},f=()=>{l(!1),i(),e()},p=()=>{l(!1),e()};return c.jsxs(c.Fragment,{children:[c.jsxs(ki,{children:[c.jsxs(F,{children:[c.jsx(F,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:c.jsx(V,{variant:"h5",fontWeight:600,children:"Seja notificado das suas vendas!"})}),c.jsx(V,{variant:"body1",color:"text.secondary",children:"Receba alertas quando tiver novos pedidos, mensagens de clientes e atualizações de pagamento."})]}),c.jsxs(me,{spacing:3,children:[c.jsx(rt.div,{initial:{opacity:0,y:-20}
181,animate:{opacity:1,y:0},transition:{delay:.3,type:"spring",stiffness:300,damping:25},children:c.jsx(F,{sx:{borderRadius:"16px",p:2,bgcolor:"white",border:"1px solid",borderColor:"divider"},children:c.jsxs(F,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[c.jsx(F,{sx:{width:44,height:44,borderRadius:"12px",bgcolor:"primary.main",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:c.jsx(P_,{sx:{color:"white",fontSize:22}})}),c.jsxs(F,{sx:{flex:1,minWidth:0},children:[c.jsx(V,{variant:"body2",fontWeight:600,children:"Novo pedido recebido!"}),c.jsx(V,{variant:"body2",color:"text.secondary",children:"Joao Silva fez um pedido de R$ 149,90"})]}),c.jsx(V,{variant:"caption",color:"text.secondary",sx:{flexShrink:0,alignSelf:"flex-start"},children:"Agora"})]})})}),c.jsx(me,{spacing:2.5,children:u1e.map((m,g)=>c.jsx(rt.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:.5+g*.1},children:c.jsxs(F,{sx:{display:"flex",alignItems:"center",gap:2},children:[c.jsx(F,{sx:{width:40,height:40,borderRadius:"12px",bgcolor:"white",border:"1px solid",borderColor:"divider",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:c.jsx(m.icon,{sx:{color:"primary.main",fontSize:20}})}),c.jsxs(F,{children:[c.jsx(V,{variant:"body1",fontWeight:600,children:m.title}),c.jsx(V,{variant:"body2",color:"text.secondary",children:m.description})]})]})},m.title))})]}),c.jsxs(F,{children:[c.jsx(De,{fullWidth:!0,variant:"contained",size:"large",onClick:o,disabled:s,sx:{borderRadius:2,py:1.5},children:"Ativar notificações"}),c.jsx(De,{fullWidth:!0,size:"small",onClick:h,disabled:s,sx:{mt:1,color:"text.secondary"},children:"Agora não"})]})]}),c.jsx(Vj,{open:a,onClose:p,onOpenSettings:f})]})}const Hj=()=>{const e=ao();return jn({mutationFn:async t=>{pe(fe.REGISTRATION.QUIZ_ANSWERS_SUBMITTED,{data:JSON.stringify(t)});const{user_id:r,answers:n}=t,{error:i}=await Te.from("pesquisa_captacao").upsert({user_id:r,respostas:n},{onConflict:"user_id"});if(i)throw new Error(i.message)},onSuccess:()=>{e.invalidateQueries({queryKey:["quizAnswers"]}),pe(fe.REGISTRATION.QUIZ_ANSWERS_SAVED)},onError:()=>{pe(fe.REGISTRATION.QUIZ_ANSWERS_ERROR)}})},h1e=async e=>{const t={...e,habilitado:e.habilitado!==void 0?e.habilitado:!0,chat_requer_autenticacao:e.chat_requer_autenticacao!==void 0?e.chat_requer_autenticacao:!0,checkout_whatsapp_habilitado:e.checkout_whatsapp_habilitado!==void 0?e.checkout_whatsapp_habilitado:!1,whatsapp_contato:e.whatsapp_contato||"",banner_desktop_link:e.banner_desktop_link||null,banner_mobile_link:e.banner_mobile_link||null};t.texto_rodape&&(t.texto_rodape=qI(t.texto_rodape));try{const{data:r,error:n}=await Te.from("catalogo_web").upsert(t,{onConflict:"user_id"}).single();if(n)throw n.code==="23505"&&n.message.includes("slug_loja")?new Error("Link da loja já está em uso. Escolha outro."):new Error(`Erro ao criar catálogo web: ${n.message}`);return r}catch(r){throw pe(fe.REGISTRATION.ERROR,{errorMessage:r instanceof Error?r.message:"Unknown error",errorCode:r instanceof Error&&"code"in r?r.code:"unknown",stage:"createWebCatalog",timestamp:new Date().toISOString()}),r}},f1e=()=>{const e=ao();return jn({mutationFn:h1e,retry:3,retryDelay:t=>Math.min(1e3*2**t,3e4),onSuccess:()=>{e.invalidateQueries({queryKey:["webCatalog"]})},onError:t=>{console.error("Failed to create web catalog:",t)}})},p1e=async({file:e,userId:t})=>{var r,n;try{const i=`${t}/${Lg()}${e.name.slice(e.name.lastIndexOf("."))}`,{error:o}=await Te.storage.from("logos").upload(i,e,{upsert:!0});if(o)throw pe(fe.REGISTRATION.LOGO_UPLOAD_ERROR,{errorMessage:o.message,errorCode:o.name||"unknown",fileName:e.name,fileSize:e.size,fileType:e.type,stage:"upload_mutation",timestamp:new Date().toISOString()}),new Error(`Erro ao fazer upload do logo: ${o.message}`);const s=(n=(r=Te.storage.from("logos").getPublicUrl(i))==null?void 0:r.data)==null?void 0:n.publicUrl;if(!s)throw pe(fe.REGISTRATION.LOGO_UPLOAD_ERROR,{errorMessage:"Failed to get public URL",stage:"getPublicUrl_mutation",fileName:e.name,timestamp:new Date().toISOString()}),new Error("Erro ao obter URL do logo");return s}catch(i){throw pe(fe.REGISTRATION.LOGO_UPLOAD_ERROR,{errorMessage:i instanceof Error?i.message:"Unknown error",stage:"unexpected_mutation",fileName:e.name,timestamp:new Date().toISOString()}),i}},m1e=()=>jn({mutationFn:p1e,retry:2,retryDelay:e=>Math.min(1e3*2**e,1e4),onError:e=>{console.error("Logo upload failed:",e)}}),M7="staleChunkReloadAt",g1e=1e4;function zj(){if(typeof navigator<"u"&&navigator.onLine===!1)return!1;let e=0;try{e=Number(window.sessionStorage.getItem(M7))||0}catch{}if(Date.now()-e<g1e)return!1;try{window.sessionStorage.setItem(M7,String(Date.now()))}catch{}return window.location.reload(),!0}function oe(e){return RQ(TQ(),async()=>{try{return await e()}catch(t){if(zj())return new Promise(()=>{});throw t}})}function sx(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"
181currentColor"},child:[{tag:"path",attr:{d:"M21 8C22.1046 8 23 8.89543 23 10V14C23 15.1046 22.1046 16 21 16H19.9381C19.446 19.9463 16.0796 23 12 23V21C15.3137 21 18 18.3137 18 15V9C18 5.68629 15.3137 3 12 3C8.68629 3 6 5.68629 6 9V16H3C1.89543 16 1 15.1046 1 14V10C1 8.89543 1.89543 8 3 8H4.06189C4.55399 4.05369 7.92038 1 12 1C16.0796 1 19.446 4.05369 19.9381 8H21ZM7.75944 15.7849L8.81958 14.0887C9.74161 14.6662 10.8318 15 12 15C13.1682 15 14.2584 14.6662 15.1804 14.0887L16.2406 15.7849C15.0112 16.5549 13.5576 17 12 17C10.4424 17 8.98882 16.5549 7.75944 15.7849Z"},child:[]}]})(e)}function v1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12.001 9C10.3436 9 9.00098 10.3431 9.00098 12C9.00098 13.6573 10.3441 15 12.001 15C13.6583 15 15.001 13.6569 15.001 12C15.001 10.3427 13.6579 9 12.001 9ZM12.001 7C14.7614 7 17.001 9.2371 17.001 12C17.001 14.7605 14.7639 17 12.001 17C9.24051 17 7.00098 14.7629 7.00098 12C7.00098 9.23953 9.23808 7 12.001 7ZM18.501 6.74915C18.501 7.43926 17.9402 7.99917 17.251 7.99917C16.5609 7.99917 16.001 7.4384 16.001 6.74915C16.001 6.0599 16.5617 5.5 17.251 5.5C17.9393 5.49913 18.501 6.0599 18.501 6.74915ZM12.001 4C9.5265 4 9.12318 4.00655 7.97227 4.0578C7.18815 4.09461 6.66253 4.20007 6.17416 4.38967C5.74016 4.55799 5.42709 4.75898 5.09352 5.09255C4.75867 5.4274 4.55804 5.73963 4.3904 6.17383C4.20036 6.66332 4.09493 7.18811 4.05878 7.97115C4.00703 9.0752 4.00098 9.46105 4.00098 12C4.00098 14.4745 4.00753 14.8778 4.05877 16.0286C4.0956 16.8124 4.2012 17.3388 4.39034 17.826C4.5591 18.2606 4.7605 18.5744 5.09246 18.9064C5.42863 19.2421 5.74179 19.4434 6.17187 19.6094C6.66619 19.8005 7.19148 19.9061 7.97212 19.9422C9.07618 19.9939 9.46203 20 12.001 20C14.4755 20 14.8788 19.9934 16.0296 19.9422C16.8117 19.9055 17.3385 19.7996 17.827 19.6106C18.2604 19.4423 18.5752 19.2402 18.9074 18.9085C19.2436 18.5718 19.4445 18.2594 19.6107 17.8283C19.8013 17.3358 19.9071 16.8098 19.9432 16.0289C19.9949 14.9248 20.001 14.5389 20.001 12C20.001 9.52552 19.9944 9.12221 19.9432 7.97137C19.9064 7.18906 19.8005 6.66149 19.6113 6.17318C19.4434 5.74038 19.2417 5.42635 18.9084 5.09255C18.573 4.75715 18.2616 4.55693 17.8271 4.38942C17.338 4.19954 16.8124 4.09396 16.0298 4.05781C14.9258 4.00605 14.5399 4 12.001 4ZM12.001 2C14.7176 2 15.0568 2.01 16.1235 2.06C17.1876 2.10917 17.9135 2.2775 18.551 2.525C19.2101 2.77917 19.7668 3.1225 20.3226 3.67833C20.8776 4.23417 21.221 4.7925 21.476 5.45C21.7226 6.08667 21.891 6.81333 21.941 7.8775C21.9885 8.94417 22.001 9.28333 22.001 12C22.001 14.7167 21.991 15.0558 21.941 16.1225C21.8918 17.1867 21.7226 17.9125 21.476 18.55C21.2218 19.2092 20.8776 19.7658 20.3226 20.3217C19.7668 20.8767 19.2076 21.22 18.551 21.475C17.9135 21.7217 17.1876 21.89 16.1235 21.94C15.0568 21.9875 14.7176 22 12.001 22C9.28431 22 8.94514 21.99 7.87848 21.94C6.81431 21.8908 6.08931 21.7217 5.45098 21.475C4.79264 21.2208 4.23514 20.8767 3.67931 20.3217C3.12348 19.7658 2.78098 19.2067 2.52598 18.55C2.27848 17.9125 2.11098 17.1867 2.06098 16.1225C2.01348 15.0558 2.00098 14.7167 2.00098 12C2.00098 9.28333 2.01098 8.94417 2.06098 7.8775C2.11014 6.8125 2.27848 6.0875 2.52598 5.45C2.78014 4.79167 3.12348 4.23417 3.67931 3.67833C4.23514 3.1225 4.79348 2.78 5.45098 2.525C6.08848 2.2775 6.81348 2.11 7.87848 2.06C8.94514 2.0125 9.28431 2 12.001 2Z"},child:[]}]})(e)}function y1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M7.25361 18.4944L7.97834 18.917C9.18909 19.623 10.5651 20 12.001 20C16.4193 20 20.001 16.4183 20.001 12C20.001 7.58172 16.4193 4 12.001 4C7.5827 4 4.00098 7.58172 4.00098 12C4.00098 13.4363 4.37821 14.8128 5.08466 16.0238L5.50704 16.7478L4.85355 19.1494L7.25361 18.4944ZM2.00516 22L3.35712 17.0315C2.49494 15.5536 2.00098 13.8345 2.00098 12C2.00098 6.47715 6.47813 2 12.001 2C17.5238 2 22.001 6.47715 22.001 12C22.001 17.5228 17.5238 22 12.001 22C10.1671 22 8.44851 21.5064 6.97086 20.6447L2.00516 22ZM8.39232 7.30833C8.5262 7.29892 8.66053 7.29748 8.79459 7.30402C8.84875 7.30758 8.90265 7.31384 8.95659 7.32007C9.11585 7.33846 9.29098 7.43545 9.34986 7.56894C9.64818 8.24536 9.93764 8.92565 10.2182 9.60963C10.2801 9.76062 10.2428 9.95633 10.125 10.1457C10.0652 10.2428 9.97128 10.379 9.86248 10.5183C9.74939 10.663 9.50599 10.9291 9.50599 10.9291C9.50599 10.9291 9.40738 11.0473 9.44455 11.1944C9.45903 11.25 9.50521 11.331 9.54708 11.3991C9.57027 11.4368 9.5918 11.4705 9.60577 11.4938C9.86169 11.9211 10.2057 12.3543 10.6259 12.7616C10.7463 12.8783 10.8631 12.9974 10.9887 13.108C11.457 13.5209 11.9868 13.8583 12.559 14.1082L12.5641 14.1105C12.6486 14.1469 12.692 14.1668 12.8157 14.2193C12.8781 14.2457 12.9419 14.2685 13.0074 14.2858C13.0311 14.292 13.0554 14.2955 13.0798 14.2972C13.2415 14.3069 13.335 14.2032 13.3749 14.1555C14.0984 13.279 14.1646 13.2218 14.1696 13.2222V13.2238C14.2647 13.1236 14.4142 13.0888 14.5476 13.097C14.6085 13.1007 14.6691 13.1124 14.7245 13.1377C15.2563 13.3803 16.1258 13.7587 16.1258 13.7587L16.7073 14.0201C16.8047 14.0671 16.8936 14.1778 16.8979 14.2854C16.9005 14.3523 16.9077 14.4603 16.8838 14.6579C16.8525 14.9166 16.7738 15.2281 16.6956 15.3913C16.6406 15.50
18158 16.5694 15.6074 16.4866 15.6934C16.3743 15.81 16.2909 15.8808 16.1559 15.9814C16.0737 16.0426 16.0311 16.0714 16.0311 16.0714C15.8922 16.159 15.8139 16.2028 15.6484 16.2909C15.391 16.428 15.1066 16.5068 14.8153 16.5218C14.6296 16.5313 14.4444 16.5447 14.2589 16.5347C14.2507 16.5342 13.6907 16.4482 13.6907 16.4482C12.2688 16.0742 10.9538 15.3736 9.85034 14.402C9.62473 14.2034 9.4155 13.9885 9.20194 13.7759C8.31288 12.8908 7.63982 11.9364 7.23169 11.0336C7.03043 10.5884 6.90299 10.1116 6.90098 9.62098C6.89729 9.01405 7.09599 8.4232 7.46569 7.94186C7.53857 7.84697 7.60774 7.74855 7.72709 7.63586C7.85348 7.51651 7.93392 7.45244 8.02057 7.40811C8.13607 7.34902 8.26293 7.31742 8.39232 7.30833Z"},child:[]}]})(e)}function Wj(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M20.4668 8.69379L20.7134 8.12811C21.1529 7.11947 21.9445 6.31641 22.9323 5.87708L23.6919 5.53922C24.1027 5.35653 24.1027 4.75881 23.6919 4.57612L22.9748 4.25714C21.9616 3.80651 21.1558 2.97373 20.7238 1.93083L20.4706 1.31953C20.2942 0.893489 19.7058 0.893489 19.5293 1.31953L19.2761 1.93083C18.8442 2.97373 18.0384 3.80651 17.0252 4.25714L16.308 4.57612C15.8973 4.75881 15.8973 5.35653 16.308 5.53922L17.0677 5.87708C18.0555 6.31641 18.8471 7.11947 19.2866 8.12811L19.5331 8.69379C19.7136 9.10792 20.2864 9.10792 20.4668 8.69379ZM12 4C7.58172 4 4 7.58172 4 12C4 14.4636 5.11358 16.6671 6.86484 18.1346L14.2925 10.707C14.683 10.3164 15.3162 10.3164 15.7067 10.707L19.5761 14.5764C19.5773 14.5729 19.5785 14.5693 19.5797 14.5658C19.8522 13.7604 20 12.8975 20 12C20 11.6765 19.9809 11.3579 19.9437 11.0452L21.9298 10.8094C21.9762 11.2002 22 11.5975 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C12.8614 2 13.6987 2.10914 14.4983 2.31487L14 4.25179C13.3618 4.0876 12.6919 4 12 4ZM10.813 19.9125C11.2 19.9701 11.5962 19.9998 11.9996 19.9998C14.7613 19.9998 17.1992 18.6003 18.6379 16.4666L14.9996 12.8283L8.58927 19.2386L8.59334 19.2405C9.28476 19.5664 10.0304 19.7961 10.813 19.9125ZM11 10C11 11.1046 10.1046 12 9 12C7.89543 12 7 11.1046 7 10C7 8.89543 7.89543 8 9 8C10.1046 8 11 8.89543 11 10Z"},child:[]}]})(e)}const N7={quiz:{salesChannels:[],segment:"",businessType:"",firstGoal:""}
181,user:{phone:"",phoneVerified:!1,email:"",document:""},store:{name:"",slug:"",color:"#212121",logoFile:null,logoUrl:""},currentStep:1},Pv="stoqui_registration_flow",Dg=()=>{const[e,t]=v.useState(N7),[r,n]=v.useState(!1);v.useEffect(()=>{const m=localStorage.getItem(Pv);if(m)try{const g=JSON.parse(m),y=g.quiz.firstGoal||"";t({...g,quiz:{...g.quiz,firstGoal:y},store:{...g.store,logoFile:null}})}catch(g){console.error("Error parsing stored registration data:",g)}n(!0)},[]),v.useEffect(()=>{if(!r)return;const m={...e,store:{...e.store,logoUrl:e.store.logoUrl||""}};localStorage.setItem(Pv,JSON.stringify(m))},[e,r]);const i=()=>{localStorage.removeItem(Pv),t(N7)},o=(m=[],g="",y="",b="")=>{t(E=>({...E,quiz:{salesChannels:m||E.quiz.salesChannels,segment:g||E.quiz.segment,businessType:y||E.quiz.businessType,firstGoal:b||E.quiz.firstGoal}}))},s=(m="")=>{t(g=>({...g,quiz:{...g.quiz,firstGoal:m||g.quiz.firstGoal}}))},a=(m,g,y,b)=>{t(E=>({...E,user:{phone:m!==void 0?m:E.user.phone,phoneVerified:g!==void 0?g:E.user.phoneVerified,email:y!==void 0?y:E.user.email,document:b!==void 0?b:E.user.document}}))},l=m=>m.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,50).replace(/-+$/g,"");return{data:e,updateQuizAnswers:o,updateFirstGoal:s,updateUserInfo:a,updateStoreInfo:(m,g,y,b,E)=>{t(S=>{let k=S.store.logoUrl;E?(S.store.logoUrl.startsWith("blob:")&&URL.revokeObjectURL(S.store.logoUrl),k=E):b?(S.store.logoUrl.startsWith("blob:")&&URL.revokeObjectURL(S.store.logoUrl),k=URL.createObjectURL(b)):b===null&&(S.store.logoUrl.startsWith("blob:")&&URL.revokeObjectURL(S.store.logoUrl),k="");let A=g;return m!==void 0&&(g===void 0||g==="")?A=l(m):g!==void 0&&(A=l(g)),{...S,store:{name:m!==void 0?m:S.store.name,slug:A!==void 0?A:S.store.slug,color:y!==void 0?y:S.store.color,logoFile:b!==void 0?b:S.store.logoFile,logoUrl:k}}})},setCurrentStep:m=>{t(g=>({...g,currentStep:m}))},nextStep:()=>{t(m=>({...m,currentStep:m.currentStep+1}))},prevStep:()=>{t(m=>({...m,currentStep:Math.max(1,m.currentStep-1)}))},clearRegistrationData:i,getFormattedData:()=>{const m={sales_channels:e.quiz.salesChannels,segment:e.quiz.segment,business_type:e.quiz.businessType,first_goal:e.quiz.firstGoal},g={nome_loja:e.store.name,slug_loja:e.store.slug,cor_principal:e.store.color,logoFile:e.store.logoFile,habilitado:!0,chat_requer_autenticacao:!0},y={phone:e.user.phone,email:e.user.email||null,document:e.user.document||null};return{quizAnswers:m,webCatalogData:g,userData:y}}}},_1e=({error:e,onRetry:t})=>{const r=At(),{data:n}=co(),i=n==null?void 0:n.SUPPORT_URL,{clearRegistrationData:o}=Dg();v.useEffect(()=>{const l=()=>{window.history.replaceState(null,"","/")};return()=>{l()}},[]);const s=()=>{pe(fe.REGISTRATION.ERROR,{action:"close_error",error:e||"Unknown error",timestamp:new Date().toISOString()}),o(),r("/",{replace:!0})},a=()=>{pe(fe.REGISTRATION.ERROR,{action:"contact_support",error:e||"Unknown error",supportUrl:i||"undefined",timestamp:new Date().toISOString()}),i&&window.open(i,"_blank")};return c.jsxs(F,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",overflow:"auto",pt:"var(--safe-area-inset-top)",pb:"var(--safe-area-inset-bottom)",px:3,textAlign:"center"},children:[c.jsx(rt.div,{initial:{scale:.8,opacity:0}
181,animate:{scale:1,opacity:1},transition:{duration:.5},style:{marginBottom:32},children:c.jsx(F,{sx:{width:80,height:80,borderRadius:"50%",backgroundColor:"error.main",display:"flex",alignItems:"center",justifyContent:"center",mx:"auto"},children:c.jsx(sM,{sx:{fontSize:44,color:"white"}})})}),c.jsx(V,{variant:"h5",fontWeight:600,gutterBottom:!0,children:"Ops! Algo deu errado"}),c.jsx(V,{variant:"body1",color:"text.secondary",sx:{mb:3,maxWidth:320,mx:"auto"},children:"Não conseguimos finalizar o cadastro da sua loja. Vamos resolver isso juntos!"}),e&&c.jsx(F,{sx:{bgcolor:"error.light",color:"error.main",p:2,borderRadius:2,mb:4,maxWidth:360,width:"100%"},children:c.jsx(V,{variant:"body2",children:e})}),c.jsxs(rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},style:{width:"100%",maxWidth:360},children:[c.jsxs(me,{spacing:2,sx:{mb:3},children:[t&&c.jsx(De,{variant:"contained",size:"large",fullWidth:!0,startIcon:c.jsx(aM,{}),onClick:t,sx:{borderRadius:2,py:1.75,fontSize:"1rem"},children:"Tentar novamente"}),c.jsx(De,{variant:"contained",color:"primary",startIcon:c.jsx(sx,{}),size:"large",fullWidth:!0,onClick:a,sx:{borderRadius:2,py:1.75,fontSize:"1rem",bgcolor:"primary.light"},children:"Falar com suporte"})]}),c.jsx(De,{variant:"text",size:"large",fullWidth:!0,onClick:s,sx:{py:1.5,fontSize:"1rem"},children:"Voltar para o inÃcio"})]})]})};function F7(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z"},child:[]},{tag:"path",attr:{d:"m15 9-6 6"},child:[]},{tag:"path",attr:{d:"M9 9h.01"},child:[]},{tag:"path",attr:{d:"M15 15h.01"},child:[]}]})(e)}function TCe(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m7 7 10 10-5 5V2l5 5L7 17"},child:[]}]})(e)}function U7(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M8 2v4"},child:[]},{tag:"path",attr:{d:"M16 2v4"},child:[]},{tag:"rect",attr:{width:"18",height:"18",x:"3",y:"4",rx:"2"},child:[]},{tag:"path",attr:{d:"M3 10h18"},child:[]},{tag:"path",attr:{d:"M8 14h.01"},child:[]},{tag:"path",attr:{d:"M12 14h.01"},child:[]},{tag:"path",attr:{d:"M16 14h.01"},child:[]},{tag:"path",attr:{d:"M8 18h.01"},child:[]},{tag:"path",attr:{d:"M12 18h.01"},child:[]},{tag:"path",attr:{d:"M16 18h.01"},child:[]}]})(e)}function _a(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M13 17V9"},child:[]},{tag:"path",attr:{d:"M18 17V5"},child:[]},{tag:"path",attr:{d:"M3 3v16a2 2 0 0 0 2 2h16"},child:[]},{tag:"path",attr:{d:"M8 17v-3"},child:[]}]})(e)}function b1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"8",cy:"8",r:"6"},child:[]},{tag:"path",attr:{d:"M18.09 10.37A6 6 0 1 1 10.34 18"},child:[]},{tag:"path",attr:{d:"M7 6h1v4"},child:[]},{tag:"path",attr:{d:"m16.71 13.88.7.71-2.82 2.82"},child:[]}]})(e)}function x1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"20",height:"14",x:"2",y:"5",rx:"2"},child:[]},{tag:"line",attr:{x1:"2",x2:"22",y1:"10",y2:"10"},child:[]}]})(e)}function ACe(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M6 2v14a2 2 0 0 0 2 2h14"},child:[]},{tag:"path",attr:{d:"M18 22V8a2 2 0 0 0-2-2H2"},child:[]}]})(e)}function B7(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},child:[]},{tag:"polyline",attr:{points:"7 10 12 15 17 10"},child:[]},{tag:"line",attr:{x1:"12",x2:"12",y1:"15",y2:"3"},child:[]}]})(e)}function w1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"},child:[]},{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]}]})(e)}function E1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2 20a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8l-7 5V8l-7 5V4a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z"},child:[]},{tag:"path",attr:{d:"M17 18h1"},child:[]},{tag:"path",attr:{d:"M12 18h1"},child:[]},{tag:"path",attr:{d:"M7 18h1"},child:[]}]})(e)}function Aa(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"},child:[]},{tag:"path",attr:{d:"M14 2v4a2 2 0 0 0 2 2h4"},child:[]},{tag:"path",attr:{d:"M10 9H8"}
181,child:[]},{tag:"path",attr:{d:"M16 13H8"},child:[]},{tag:"path",attr:{d:"M16 17H8"},child:[]}]})(e)}function S1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"3",y:"8",width:"18",height:"4",rx:"1"},child:[]},{tag:"path",attr:{d:"M12 8v13"},child:[]},{tag:"path",attr:{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7"},child:[]},{tag:"path",attr:{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5"},child:[]}]})(e)}function C1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"path",attr:{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"},child:[]},{tag:"path",attr:{d:"M2 12h20"},child:[]}]})(e)}function T1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"4",x2:"20",y1:"9",y2:"9"},child:[]},{tag:"line",attr:{x1:"4",x2:"20",y1:"15",y2:"15"},child:[]},{tag:"line",attr:{x1:"10",x2:"8",y1:"3",y2:"21"},child:[]},{tag:"line",attr:{x1:"16",x2:"14",y1:"3",y2:"21"},child:[]}]})(e)}function kCe(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3"},child:[]}]})(e)}function A1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M16 5h6"},child:[]},{tag:"path",attr:{d:"M19 2v6"},child:[]},{tag:"path",attr:{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5"},child:[]},{tag:"path",attr:{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"},child:[]},{tag:"circle",attr:{cx:"9",cy:"9",r:"2"},child:[]}]})(e)}function k1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"},child:[]},{tag:"circle",attr:{cx:"9",cy:"9",r:"2"},child:[]},{tag:"path",attr:{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"},child:[]}]})(e)}function Ov(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M18 22H4a2 2 0 0 1-2-2V6"},child:[]},{tag:"path",attr:{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18"},child:[]},{tag:"circle",attr:{cx:"12",cy:"8",r:"2"},child:[]},{tag:"rect",attr:{width:"16",height:"16",x:"6",y:"2",rx:"2"},child:[]}]})(e)}function R1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 12c-2-2.67-4-4-6-4a4 4 0 1 0 0 8c2 0 4-1.33 6-4Zm0 0c2 2.67 4 4 6 4a4 4 0 0 0 0-8c-2 0-4 1.33-6 4Z"},child:[]}]})(e)}function I1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5"},child:[]},{tag:"path",attr:{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"},child:[]},{tag:"line",attr:{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5"},child:[]}]})(e)}function P1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z"},child:[]},{tag:"path",attr:{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65"},child:[]},{tag:"path",attr:{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65"},child:[]}]})(e)}function O1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"7",height:"7",x:"3",y:"3",rx:"1"},child:[]},{tag:"rect",attr:{width:"7",height:"7",x:"14",y:"3",rx:"1"},child:[]},{tag:"rect",attr:{width:"7",height:"7",x:"14",y:"14",rx:"1"},child:[]},{tag:"rect",attr:{width:"7",height:"7",x:"3",y:"14",rx:"1"},child:[]}]})(e)}function j1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"18",height:"7",x:"3",y:"3",rx:"1"},child:[]},{tag:"rect",attr:{width:"9",height:"7",x:"3",y:"14",rx:"1"},child:[]},{tag:"rect",attr:{width:"5",height:"7",x:"16",y:"14",rx:"1"},child:[]}]})(e)}function L1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M3 6h18"},child:[]},{tag:"path",attr:{d:"M7 12h10"},child:[]},{tag:"path",attr:{d:"M10 18h4"},child:[]}]})(e)}function $1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"20",height:"16",x:"2",y:"4",rx:"2"},child:[]},{tag:"path",attr:{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"},child:[]}]})(e)}function c_(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m3 11 18-5v12L3 14v-3z"}
181,child:[]},{tag:"path",attr:{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6"},child:[]}]})(e)}function D1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z"},child:[]}]})(e)}function M1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4"},child:[]},{tag:"path",attr:{d:"M2 6h4"},child:[]},{tag:"path",attr:{d:"M2 10h4"},child:[]},{tag:"path",attr:{d:"M2 14h4"},child:[]},{tag:"path",attr:{d:"M2 18h4"},child:[]},{tag:"path",attr:{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z"},child:[]}]})(e)}function Fs(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z"},child:[]},{tag:"path",attr:{d:"M12 22V12"},child:[]},{tag:"path",attr:{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7"},child:[]},{tag:"path",attr:{d:"m7.5 4.27 9 5.15"},child:[]}]})(e)}function N1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m14.622 17.897-10.68-2.913"},child:[]},{tag:"path",attr:{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z"},child:[]},{tag:"path",attr:{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15"},child:[]}]})(e)}function qj(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor"},child:[]},{tag:"circle",attr:{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor"},child:[]},{tag:"circle",attr:{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor"},child:[]},{tag:"circle",attr:{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor"},child:[]},{tag:"path",attr:{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z"},child:[]}]})(e)}function F1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M13 7 8.7 2.7a2.41 2.41 0 0 0-3.4 0L2.7 5.3a2.41 2.41 0 0 0 0 3.4L7 13"},child:[]},{tag:"path",attr:{d:"m8 6 2-2"},child:[]},{tag:"path",attr:{d:"m18 16 2-2"},child:[]},{tag:"path",attr:{d:"m17 11 4.3 4.3c.94.94.94 2.46 0 3.4l-2.6 2.6c-.94.94-2.46.94-3.4 0L11 17"},child:[]},{tag:"path",attr:{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"},child:[]},{tag:"path",attr:{d:"m15 5 4 4"},child:[]}]})(e)}function U1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"19",x2:"5",y1:"5",y2:"19"},child:[]},{tag:"circle",attr:{cx:"6.5",cy:"6.5",r:"2.5"},child:[]},{tag:"circle",attr:{cx:"17.5",cy:"17.5",r:"2.5"},child:[]}]})(e)}function B1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M19 5c-1.5 0-2.8 1.4-3 2-3.5-1.5-11-.3-11 5 0 1.8 0 3 2 4.5V20h4v-2h3v2h4v-4c1-.5 1.7-1 2-2h2v-4h-2c0-1-.5-1.5-1-2V5z"},child:[]},{tag:"path",attr:{d:"M2 9v1c0 1.1.9 2 2 2h1"},child:[]},{tag:"path",attr:{d:"M16 11h.01"},child:[]}]})(e)}function jv(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"},child:[]},{tag:"path",attr:{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6"},child:[]},{tag:"rect",attr:{x:"6",y:"14",width:"12",height:"8",rx:"1"},child:[]}]})(e)}function V1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z"},child:[]},{tag:"path",attr:{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8"},child:[]},{tag:"path",attr:{d:"M12 17.5v-11"},child:[]}]})(e)}function zc(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z"},child:[]},{tag:"path",attr:{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z"},child:[]},{tag:"path",attr:{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0"},child:[]},{tag:"path",attr:{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"},child:[]}]})(e)}function H1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M3 7V5a2 2 0 0 1 2-2h2"},child:[]},{tag:"path",attr:{d:"M17 3h2a2 2 0 0 1 2 2v2"},child:[]},{tag:"path",attr:{d:"M21 17v2a2 2 0 0 1-2 2h-2"},child:[]},{tag:"path",attr:{d:"M7 21H5a2 2 0 0 1-2-2v-2"},child:[]},{tag:"path",attr:{d:"M7 12h10"},child:[]}]})(e)}function RCe(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"},child:[]},{tag:"path",attr:{d:"m9 12 2 2 4-4"},child:[]}]})(e)}function z1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z"},child:[]},{tag:"path",attr:{d:"M3 6h18"},child:[]},{tag:"path",attr:{d:"M16 10a4 4 0 0 1-8 0"},child:[]}]})(e)}function V7(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"8",cy:"21",r:"1"},child:[]},{tag:"circle",attr:{cx:"19",cy:"21",r:"1"},child:[]},{tag:"path",attr:{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12"},child:[]}]})(e)}function H7(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"},child:[]},{tag:"path",attr:{d:"M20 3v4"},child:[]},{tag:"path",attr:{d:"M22 5h-4"},child:[]},{tag:"path",attr:{d:"M4 17v2"},child:[]},{tag:"path",attr:{d:"M5 18H3"}
181,child:[]}]})(e)}function z7(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z"},child:[]}]})(e)}function W7(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7"},child:[]},{tag:"path",attr:{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"},child:[]},{tag:"path",attr:{d:"M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4"},child:[]},{tag:"path",attr:{d:"M2 7h20"},child:[]},{tag:"path",attr:{d:"M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7"},child:[]}]})(e)}function W1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 3v18"},child:[]},{tag:"rect",attr:{width:"18",height:"18",x:"3",y:"3",rx:"2"},child:[]},{tag:"path",attr:{d:"M3 9h18"},child:[]},{tag:"path",attr:{d:"M3 15h18"},child:[]}]})(e)}function q7(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"},child:[]},{tag:"circle",attr:{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor"},child:[]}]})(e)}function ICe(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z"},child:[]},{tag:"path",attr:{d:"M13 5v2"},child:[]},{tag:"path",attr:{d:"M13 17v2"},child:[]},{tag:"path",attr:{d:"M13 11v2"},child:[]}]})(e)}function Vd(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2"},child:[]},{tag:"path",attr:{d:"M15 18H9"},child:[]},{tag:"path",attr:{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14"},child:[]},{tag:"circle",attr:{cx:"17",cy:"18",r:"2"},child:[]},{tag:"circle",attr:{cx:"7",cy:"18",r:"2"},child:[]}]})(e)}function G7(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"},child:[]},{tag:"circle",attr:{cx:"9",cy:"7",r:"4"},child:[]},{tag:"path",attr:{d:"M22 21v-2a4 4 0 0 0-3-3.87"},child:[]},{tag:"path",attr:{d:"M16 3.13a4 4 0 0 1 0 7.75"},child:[]}]})(e)}function q1e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"},child:[]},{tag:"rect",attr:{x:"2",y:"6",width:"14",height:"12",rx:"2"},child:[]}]})(e)}function Lv(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1"},child:[]},{tag:"path",attr:{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4"},child:[]}]})(e)}function $v(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"},child:[]}]})(e)}const G1e=({groupUrl:e,onJoin:t})=>e?c.jsx(rt.div,{initial:{opacity:0,y:20}
181,animate:{opacity:1,y:0},transition:{delay:.3},style:{width:"100%"},children:c.jsx(sh,{elevation:2,sx:{borderRadius:2,overflow:"hidden"},children:c.jsx(PD,{onClick:t,children:c.jsxs(F,{sx:{background:"linear-gradient(135deg, #25D366 0%, #128C7E 100%)",p:1.5,color:"white",display:"flex",alignItems:"center",gap:1.5},children:[c.jsx(F,{sx:{width:38,height:38,borderRadius:"50%",backgroundColor:"rgba(255, 255, 255, 0.2)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:c.jsx(Rf,{sx:{fontSize:22}})}),c.jsxs(F,{sx:{textAlign:"left"},children:[c.jsx(V,{variant:"body2",fontWeight:600,children:"Entre no grupo do WhatsApp"}),c.jsx(V,{variant:"caption",sx:{opacity:.9},children:"Fique por dentro de tudo!"})]})]})})})}):null,K1e=({storeName:e})=>{var p,m;const t=At(),{clearRegistrationData:r}=Dg(),{user:n}=ot(),{data:i}=co(),o=i==null?void 0:i.WHATSAPP_GROUP_URL,s=((p=n==null?void 0:n.user_metadata)==null?void 0:p.first_screen_experiment_group)||"home",a=((m=n==null?void 0:n.app_metadata)==null?void 0:m.provider)||"unknown";v.useEffect(()=>{pe(fe.REGISTRATION.SUCCESS,{timestamp:new Date().toISOString(),storeName:e,experimentGroup:s}),df(KI.SIGNUP,{semanticAttributes:{[Sa.ACTION]:a}})},[e,s,a]),v.useEffect(()=>{const g=()=>{window.history.replaceState(null,"","/")};return()=>{g()}},[]);const l=()=>{s==="home"?(pe(fe.REGISTRATION.COMPLETE,{action:"start_selling",experiment_group:s}),r(),t("/",{replace:!0})):(pe(fe.REGISTRATION.COMPLETE,{action:"create_product",experiment_group:s}),r(),t("/products/create?from=registration",{replace:!0}))},d=()=>{o&&(pe(fe.REGISTRATION.WHATSAPP_GROUP,{action:"join",storeName:e,whatsappGroupUrl:o}),window.history.replaceState(null,"","/"),r(),window.open(o,"_blank"),t("/",{replace:!0}))},u={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.1}}},h={hidden:{opacity:0,y:20},show:{opacity:1,y:0}},f=s==="home"?"Começar agora":"Cadastre um produto";return c.jsxs(F,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",overflow:"auto",pt:"var(--safe-area-inset-top)",pb:"var(--safe-area-inset-bottom)",px:3,textAlign:"center"},children:[c.jsx(rt.div,{initial:{scale:.8,opacity:0}
181,animate:{scale:1,opacity:1},transition:{duration:.5},style:{marginBottom:32},children:c.jsx(F,{sx:{width:80,height:80,borderRadius:"50%",backgroundColor:"success.main",display:"flex",alignItems:"center",justifyContent:"center",mx:"auto"},children:c.jsx(ps,{sx:{fontSize:44,color:"white"}})})}),c.jsxs(V,{variant:"h5",fontWeight:600,gutterBottom:!0,children:[e," está pronta!"]}),c.jsx(V,{variant:"body1",color:"text.secondary",sx:{mb:3,maxWidth:300,mx:"auto"},children:"Parabéns! Você deu o primeiro passo para crescer suas vendas."}),c.jsxs(rt.div,{variants:u,initial:"hidden",animate:"show",style:{width:"100%",maxWidth:360,margin:"0 auto"},children:[c.jsx(V,{variant:"subtitle1",fontWeight:600,sx:{mb:3,textAlign:"left"},children:"Próximos passos:"}),c.jsxs(me,{spacing:3.5,sx:{mb:6},children:[c.jsx(rt.div,{variants:h,children:c.jsxs(F,{onClick:()=>{r(),t("/products/create?from=registration",{replace:!0})},sx:{display:"flex",alignItems:"center",gap:2.5,cursor:"pointer","&:hover":{opacity:.8}},children:[c.jsx(F,{sx:{width:48,height:48,borderRadius:2,backgroundColor:"primary.50",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:c.jsx(Fs,{size:28,color:"inherit"})}),c.jsxs(F,{sx:{textAlign:"left"},children:[c.jsx(V,{variant:"body1",fontWeight:500,children:"Cadastre seus produtos"}),c.jsx(V,{variant:"body2",color:"text.secondary",children:"Adicione produtos com fotos e preços"})]})]})}),c.jsx(rt.div,{variants:h,children:c.jsxs(F,{onClick:()=>{r(),t("/",{replace:!0})},sx:{display:"flex",alignItems:"center",gap:2.5,cursor:"pointer","&:hover":{opacity:.8}},children:[c.jsx(F,{sx:{width:48,height:48,borderRadius:2,backgroundColor:"primary.50",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:c.jsx(lM,{sx:{color:"primary.main",fontSize:28}})}),c.jsxs(F,{sx:{textAlign:"left"},children:[c.jsx(V,{variant:"body1",fontWeight:500,children:"Compartilhe sua loja"}),c.jsx(V,{variant:"body2",color:"text.secondary",children:"Envie o link para seus clientes e receba pedidos"})]})]})})]}),c.jsx(F,{sx:{width:"100%",mb:2},children:c.jsx(G1e,{groupUrl:o||"",onJoin:d})}),c.jsx(rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4},children:c.jsx(De,{variant:"contained",size:"large",fullWidth:!0,onClick:l,sx:{borderRadius:2,py:1.75,fontSize:"1rem"},children:f})})]})]})},Y1e=e=>{const t=[1,0];if(!e)return t;try{const r=e.split(",").map(i=>parseFloat(i.trim())).filter(i=>!isNaN(i)&&i>=0);if(r.length!==2)return console.log("Invalid weights format, expected 2 values but got:",r.length),t;const n=r.reduce((i,o)=>i+o,0);return n===0?(console.log("All weights are zero, using default weights"),t):r.map(i=>i/n)}catch(r){return console.error("Error parsing first screen weights:",r),t}},Z1e=e=>{const t=Math.random();let r=0;for(let n=0;n<e.length;n++)if(r+=e[n],t<r)return n;return 0},K7=e=>{console.log("FIRST SCREEN WEIGHTS ARE: "+e);const t=Y1e(e),r=Z1e(t);let n;switch(r){case 0:n="home",fh(fe.EXPERIMENT.FIRST_SCREEN_HOME,{group:"home",weight:t[0],weights_string:e||"default",selection_method:"weighted"});break;case 1:n="create-product",fh(fe.EXPERIMENT.FIRST_SCREEN_CREATE_PRODUCT,{group:"create-product",weight:t[1],weights_string:e||"default",selection_method:"weighted"});break;default:n="home",fh(fe.EXPERIMENT.FIRST_SCREEN_HOME,{group:"home",weight:1,weights_string:e||"default",selection_method:"fallback"});break}return n},Y7=oe(()=>X(()=>import("./RegistrationLoading-DQfpBpB3.js"),__vite__mapDeps([18,1,2,3,4,5,6]))),X1e=({data:e})=>{const[t,r]=v.useState("loading"),[n,i]=v.useState(null),[o,s]=v.useState(0),[a,l]=v.useState({name:e.store.name,slug:e.store.slug,color:e.store.color,logoUrl:e.store.logoUrl||""}),d=Hj(),u=f1e(),h=m1e(),f=At(),{clearRegistrationData:p}=Dg(),{data:m}=co(),g=m==null?void 0:m.FIRST_SCREEN_EXPERIMENT_WEIGHTS;v.useEffect(()=>{(async()=>{var k,A;try{const{data:w}=await Te.auth.getUser(),_=(k=w==null?void 0:w.user)==null?void 0:k.id;if(!_)throw new Error("Usuário não autenticado");let x=e.store.logoUrl||"";if(x&&x.startsWith("http"))console.log("Using pre-uploaded logo URL:",x);else if(e.store.logoFile)try{x=await h.mutateAsync({file:e.store.logoFile,userId:_})}catch(I){console.error("Logo upload error (caught):",I),x=""}const C={},P=K7(g);C.first_screen_experiment_group=P,await b(e.user,e.store.name,C),await u.mutateAsync({nome_loja:e.store.name,slug_loja:e.store.slug,cor_principal:e.store.color,logo_url:x,user_id:_,habilitado:!0,chat_requer_autenticacao:!0,whatsapp_contato:((A=e.user)==null?void 0:A.phone)||""}),await d.mutateAsync({user_id:_,answers:{como_vende:e.quiz.salesChannels,segmento:e.quiz.segment,perfil_negocio:e.quiz.businessType,objetivo_inicial:e.quiz.firstGoal}}),l(I=>({...I,logoUrl:x||I.logoUrl})),r("success"),pe(fe.REGISTRATION.COMPLETE,{status:"success",userInfo:{phone:e.user.phone,phoneVerified:e.user.phoneVerified,hasEmail:!!e.user.email,hasDocument:!!e.user.document},storeInfo:{name:e.store.name,slug:e.store.slug,color:e.store.color,hasLogo:!!x},quizInfo:{salesChannels:e.quiz.salesChannels,segment:e.quiz.segment,businessType:e.quiz.businessType,firstGoal:e.quiz.firstGoal},firstScreenExperiment:{group:P},timestamp:new Date().toISOString()})}catch(w){console.error("Registration error:",w);const _=w instanceof Error?w.message:"Erro ao finalizar o registro";i(_),r("error"),pe(fe.REGISTRATION.ERROR,{errorMessage:_,errorCode:w instanceof Error&&"code"in w?w.code:"unknown",stage:"finalizing",retryAttempt:o,userInfo:{phone:e.user.phone,phoneVerified:e.user.phoneVerified,hasEmail:!!e.user.email,hasDocument:!!e.user.document},storeInfo:{name:e.store.name,slug:e.store.slug}})}})()},[e]);const y=async()=>
181{if(!qe.isNativePlatform()||qe.getPlatform()!=="android")return null;try{const S=await bj.getReferrerDetails();return console.log("Referrer details retrieved:",S),S}catch(S){return console.log("Could not retrieve referrer details:",S),null}},b=async(S,k,A)=>{var I,O,D,M;const{data:w}=await Te.auth.getUser(),_=(O=(I=w==null?void 0:w.user)==null?void 0:I.user_metadata)==null?void 0:O.referrer;let x=null;_||(x=await y());const C={nome:k,cpf_cnpj:S.document,email:S.email,...A};x&&!_&&(C.referrer=x);const P=cI();P&&!((M=(D=w==null?void 0:w.user)==null?void 0:D.user_metadata)!=null&&M.acquisition)&&(C.acquisition=P),console.log("Atualizando metadados do usuário:",C);try{const{error:U}=await Te.auth.updateUser({data:C});if(U&&console.error("Erro ao atualizar metadados:",U),S.email)try{console.log("Atualizando email do usuário:",S.email);const{error:$}=await Te.auth.updateUser({email:S.email});$&&console.error("Erro ao atualizar email:",$)}catch($){console.error("Exceção ao atualizar email:",$)}}catch(U){console.error("Erro geral ao atualizar usuário:",U)}},E=()=>{if(o>=1){p(),f("/",{replace:!0});return}s(k=>k+1),r("loading"),i(null),(async()=>{var k;try{const{data:A}=await Te.auth.getUser(),w=(k=A==null?void 0:A.user)==null?void 0:k.id;if(!w)throw new Error("Usuário não autenticado");let _=e.store.logoUrl||"";if(_&&_.startsWith("http"))console.log("Using pre-uploaded logo URL (retry):",_);else if(e.store.logoFile)try{_=await h.mutateAsync({file:e.store.logoFile,userId:w})}catch(P){console.error("Logo upload error (caught in retry):",P),_=""}const x={},C=K7(g);x.first_screen_experiment_group=C,await b(e.user,e.store.name,x),await u.mutateAsync({nome_loja:e.store.name,slug_loja:e.store.slug,cor_principal:e.store.color,logo_url:_,user_id:w,habilitado:!0,chat_requer_autenticacao:!0}),await d.mutateAsync({user_id:w,answers:{como_vende:e.quiz.salesChannels,segmento:e.quiz.segment,perfil_negocio:e.quiz.businessType,objetivo_inicial:e.quiz.firstGoal}}),l(P=>({...P,logoUrl:_||P.logoUrl})),r("success")}catch(A){console.error("Registration error:",A),i(A instanceof Error?A.message:"Erro ao finalizar o registro"),r("error"),pe(fe.REGISTRATION.ERROR,{errorMessage:A instanceof Error?A.message:"Erro ao finalizar o registro",errorCode:A instanceof Error&&"code"in A?A.code:"unknown",stage:"retry",retryAttempt:o,timestamp:new Date().toISOString()})}})()};switch(t){case"loading":return c.jsx(Ee.Suspense,{fallback:null,children:c.jsx(Y7,{})});case"error":return c.jsx(_1e,{error:n||void 0,onRetry:E});case"success":return c.jsx(K1e,{storeName:a.name,storeSlug:a.slug,storeColor:a.color,logoUrl:a.logoUrl});default:return c.jsx(Ee.Suspense,{fallback:null,children:c.jsx(Y7,{})})}};function J1e({currentStep:e,totalSteps:t}){const r=$o(),n=100*(1-Math.pow(1-e/(t+1),1.2));return c.jsx(OD,{variant:"determinate",value:n,sx:{height:2,backgroundColor:gt(r.palette.primary.main,.1),"& .MuiLinearProgress-bar":{backgroundColor:r.palette.primary.main,transition:"transform 0.5s ease-in-out"}}})}const Gj=()=>{const[e]=ws(),t=sn(),r=v.useRef(!1);return v.useEffect(()=>{(async()=>{if(r.current||t.pathname==="/auth/email-login")return;const i=e.get("token_hash"),o=e.get("type");if(!(!i||o!=="email")){r.current=!0;try{console.log("Silent email verification started..."),pe(fe.AUTH.MAGIC_LINK_LOGIN_START);const{data:s,error:a}=await Te.auth.verifyOtp({token_hash:i,type:"email"});if(a){console.error("Silent email verification error:",a),pe(fe.AUTH.MAGIC_LINK_LOGIN_SUCCESS,{error:a.message,errorCode:a.code});return}s.session&&(console.log("Silent email verification successful",s),pe(fe.AUTH.MAGIC_LINK_LOGIN_SUCCESS,{email:s.session.user.email}))}catch(s){console.error("Unexpected error during silent email verification:",s),pe(fe.AUTH.MAGIC_LINK_LOGIN_SUCCESS,{error:"Unexpected error"})}}})()},[e]),null},Ua="/assets/stoqui_logo-BMlXwYyw.svg",Ah="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xmlns:svgjs='http://svgjs.dev/svgjs'%20viewBox='0%200%20800%20800'%20opacity='0.72'%20%3e%3cdefs%3e%3cfilter%20id='bbblurry-filter'%20x='-100%25'%20y='-100%25'%20width='400%25'%20height='400%25'%20filterUnits='objectBoundingBox'%20primitiveUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%20%3e%3cfeGaussianBlur%20stdDeviation='130'%20x='0%25'%20y='0%25'%20width='100%25'%20height='100%25'%20in='SourceGraphic'%20edgeMode='none'%20result='blur'%20/%3e%3c/filter%3e%3c/defs%3e%3cg%20filter='url(%23bbblurry-filter)'%3e%3cellipse%20rx='123.5'%20ry='175'%20cx='647.0634545131504'%20cy='481.5537853141106'%2
1810fill='%238865fe'%20/%3e%3cellipse%20rx='123.5'%20ry='175'%20cx='347.33546503676166'%20cy='730.4678827255808'%20fill='%23c465f8'%20/%3e%3cellipse%20rx='123.5'%20ry='175'%20cx='688.9223568901341'%20cy='806.2969274071498'%20fill='%23f07838'%20/%3e%3cellipse%20rx='123.5'%20ry='175'%20cx='735.7348891652691'%20cy='433.2504350752106'%20fill='%23c465f8'%20/%3e%3cellipse%20rx='123.5'%20ry='175'%20cx='38.68774254284608'%20cy='712.361036210784'%20fill='%238865fe'%20/%3e%3c/g%3e%3c/svg%3e",Ho=13;function Q1e(){var Le,Fe,ft,Ge;const{data:e,updateQuizAnswers:t,updateFirstGoal:r,updateUserInfo:n,updateStoreInfo:i,setCurrentStep:o}=Dg(),s=$o(),a=tl(s.breakpoints.up("md")),l=At(),[d,u]=ws(),h=v.useRef(!1),[f,p]=v.useState(null),[m,g]=v.useState(""),[y,b]=v.useState(!1),[E,S]=v.useState(!1),k=()=>{const Se=d.get("step");if(Se){const je=parseInt(Se,10);return!isNaN(je)&&je>=1?je:1}return e.currentStep>0?e.currentStep:1},{session:A,user:w}=ot(),_=!!A,x=!!(w!=null&&w.phone||w!=null&&w.new_phone||(Le=w==null?void 0:w.user_metadata)!=null&&Le.phone_number),C=!!((Fe=w==null?void 0:w.user_metadata)!=null&&Fe.cpf_cnpj),P=Hj();v.useEffect(()=>{if(h.current)return;const Se=k();if(d.get("email_verified")==="true"){p("email"),b(!0),Te.auth.getUser().then(({data:z})=>{var Q;(Q=z==null?void 0:z.user)!=null&&Q.email&&g(z.user.email)});const Ue=8;u({step:Ue.toString()},{replace:!0}),o(Ue),h.current=!0;return}if(d.get("google_verified")==="true"){p("google"),S(!0),Te.auth.getUser().then(({data:z})=>{var Q;(Q=z==null?void 0:z.user)!=null&&Q.email&&g(z.user.email)});const Ue=8;u({step:Ue.toString()},{replace:!0}),o(Ue),h.current=!0;return}const Pe=d.get("step");(!Pe||parseInt(Pe,10)!==Se)&&u({step:Se.toString()},{replace:!0}),e.currentStep!==Se&&o(Se),Se===1&&pe(fe.REGISTRATION.START,{startingStep:Se,hasExistingData:e.store.name.length>0||e.user.phone.length>0,source:document.referrer||"direct",isAuthenticated:_}),C&&Se===3&&(u({step:"4"},{replace:!0}),o(4)),h.current=!0},[]),v.useEffect(()=>{y&&e.user.phone&&m&&(async()=>{try{const je=e.user.phone.startsWith("+")?e.user.phone:`+${e.user.phone}`;await Hp(je),n(e.user.phone,!0,m,e.user.document),pe(fe.REGISTRATION.EMAIL_VERIFIED,{email:m,phone:e.user.phone.replace(/\d(?=\d{4})/g,"*"),timestamp:new Date().toISOString()}),console.log("Email verification complete - phone saved to auth:",je),console.log("User data after email verification:",{phone:e.user.phone,email:m,verified:!0})}catch(je){console.error("Failed to save phone to auth:",je)}finally{b(!1)}})()},[y,e.user.phone,m,e.user.document,n]),v.useEffect(()=>{E&&e.user.phone&&m&&(async()=>{try{const je=e.user.phone.startsWith("+")?e.user.phone:`+${e.user.phone}`;await Hp(je),n(e.user.phone,!0,m,e.user.document),pe(fe.REGISTRATION.GOOGLE_VERIFIED,{email:m,phone:e.user.phone.replace(/\d(?=\d{4})/g,"*"),timestamp:new Date().toISOString()}),console.log("Google verification complete - phone saved to auth:",je),console.log("User data after Google verification:",{phone:e.user.phone,email:m,verified:!0})}catch(je){console.error("Failed to save phone to auth:",je)}finally{S(!1)}})()},[E,e.user.phone,m,e.user.document,n]);const I=k();v.useEffect(()=>{I===12&&!f&&Te.auth.getUser().then(({data:Se})=>{var je,Ce;(je=Se==null?void 0:Se.user)!=null&&je.email&&((Ce=Se.user.app_metadata)==null?void 0:Ce.provider)==="google"&&(console.log("Detected Google auth without search params:",Se.user.email),p("google"),g(Se.user.email),n(e.user.phone,e.user.phoneVerified,Se.user.email,e.user.document))})},[I,f,e.user.phone,e.user.phoneVerified,e.user.document,n]);const O=I<=Ho,D=async()=>{if(O)if(I>1){let Se=I-1;_&&I===8&&(Se=x?4:5),C&&Se===3&&(Se=2),u({step:Se.toString()},{replace:!0}),o(Se)}else if(_)try{await Te.auth.signOut(),l("/auth/onboarding",{replace:!0})}catch(Se){console.error("Error signing out:",Se),l("/auth/onboarding",{replace:!0})}else l("/")},M=()=>{let Se=I+1;C&&I===2?Se=4:_&&x&&I===5||_&&I===5?Se=8:_&&I===4&&(Se=x?8:5),u({step:Se.toString()},{replace:!0}),o(Se),U(Se)},U=Se=>{const je={currentStep:Se,totalSteps:Ho,progress:Math.round(Se/Ho*100),previousCompletedStep:I};switch(Se){case 2:pe(fe.REGISTRATION.STEP_SEGMENT,{...je,salesChannels:e.quiz.salesChannels});break;case 3:pe(fe.REGISTRATION.STEP_BUSINESS_TYPE,{...je,salesChannels:e.quiz.salesChannels,segment:e.quiz.segment});break;case 4:pe(fe.REGISTRATION.STEP_FIRST_GOAL,{...je,salesChannels:e.quiz.salesChannels,segment:e.quiz.segment,businessType:e.quiz.businessType});break;case 5:pe(fe.REGISTRATION.STEP_PHONE,{...je,quizComplete:!0,salesChannels:e.quiz.salesChannels,segment:e.quiz.segment,businessType:e.quiz.businessType,firstGoal:e.quiz.firstGoal});break;case 6:pe(fe.REGISTRATION.STEP_AUTH_OPTIONS,{...je,phone:e.user.phone.replace(/\d(?=\d{4})/g,"*")});break;case 7:pe(fe.REGISTRATION.STEP_VERIFICATION,{...je,phone:e.user.phone.replace(/\d(?=\d{4})/g,"*"),authMethod:f});break;case 8:pe(fe.REGISTRATION.STEP_STORE_NAME,{...je,phoneVerified:e.user.phoneVerified});break;case 9:pe(fe.REGISTRATION.STEP_STORE_SLUG,{...je,storeName:e.store.name});break;case 10:pe(fe.REGISTRATION.STEP_COLOR,{...je,storeSlug:e.store.slug});break;case 11:pe(fe.REGISTRATION.STEP_LOGO,{...je,storeColor:e.store.color});break;case 12:pe(fe.REGISTRATION.STEP_PERSONAL_INFO,{...je,hasLogo:!!e.store.logoFile});break;case 13:pe(fe.REGISTRATION.STEP_NOTIFICATION_PERMISSION,{...je,platform:qe.getPlatform()});break;case Ho+1:pe(fe.REGISTRATION.COMPLETE,{...je,user:{hasEmail:!!e.user.email,hasDocument:!!e.user.document,phone:e.user.phone.replace(/\d(?=\d{4})/g,"*")},store:{name:e.store.name,slug:e.store.slug,color:e.store.color,hasLogo:!!e.store.logoFile},quiz:{salesChannels:e.quiz.salesChannels,segment:e.quiz.segment,businessType:e.quiz.businessType,firstGoal:e.quiz.firstGoal}});break}},$=Se=>{pe(fe.REGISTRATION.STEP_SALES_CHANNELS,{channels:Se,channelCount:Se.length,isSkipped:Se.length===0,totalSteps:Ho,currentStep:1}),t(Se,e.quiz.segment,e.quiz.businessType,e.quiz.firstGoal),M()},j=Se=>{t(e.quiz.salesChannels,Se,e.quiz.businessType,e.quiz.firstGoal),M()},q=Se=>{t(e.quiz.salesChannels,e.quiz.segment,Se,e.quiz.firstGoal),M()},W=async Se=>{var je;if(r(Se),_&&((je=A==null?void 0:A.user)!=null&&je.id))try{await P.mutateAsync({user_id:A.user.id,answers:{como_vende:e.quiz.salesChannels,segmento:e.quiz.segment,perfil_negocio:e.quiz.businessType,objetivo_inicial:Se}}),console.log("Quiz answers saved successfully")}catch(Ce){console.error("Failed to save quiz answers:",Ce)}M()},ne=async Se=>{if(n(Se,e.user.phoneVerified,e.user.email,e.user.document),_)try{await Hp(Se.startsWith("+")?Se:`+${Se}`),console.log("Phone saved to user metadata:",Se)}catch(je){console.error("Failed to save phone to user metadata:",je)}M()},ae=(Se,je)=>{if(p(Se),je!=null&&je.email&&g(je.email),Se==="google"){S(!0);const Ce=8;u({step:Ce.toString()},{replace:!0}),o(Ce)}else M()},re=async Se=>{if(Se)try{const Ce=e.user.phone.startsWith("+")?e.user.phone:`+${e.user.phone}`;await Hp(Ce),pe(fe.REGISTRATION.PHONE_SAVED_TO_AUTH,{phone:e.user.phone.replace(/\d(?=\d{4})/g,"*"),authMethod:f,timestamp:new Date().toISOString()})}catch(Ce){console.error("Failed to save phone to auth:",Ce)}const je=f==="email"?m:e.user.email;n(e.user.phone,Se,je,e.user.document),M()},_e=Se=>{const je=f==="email"?e.user.email:Se.email;n(e.user.phone,e.user.phoneVerified,je,Se.document),M()},be=Se=>{i(Se,e.store.slug,e.store.color,e.store.logoFile),M()},J=Se=>{i(e.store.name,Se,e.store.color,e.store.logoFile),M()},xe=Se=>{i(e.store.name,e.store.slug,Se,e.store.logoFile),M()},Ze=(Se,je)=>{i(e.store.name,e.store.slug,e.store.color,Se,je),M()},$e=c.jsxs(F,{sx:{height:a?"100%":"calc(100vh - var(--safe-area-inset-bottom) - var(--safe-area-inset-top))",backgroundColor:"background.default",display:"flex",flexDirection:"column",flex:a?1:void 0,minWidth:0},children:[c.jsx(Gj,{}),O&&c.jsxs(F,{sx:{position:"sticky",top:0,backgroundColor:"background.default",zIndex:10},children:[c.jsxs(F,{sx:{display:"flex",alignItems:"center",px:1,py:1,gap:1},children:[c.jsx(mr,{onClick:D,size:"small",sx:{color:"text.secondary"},children:c.jsx(UC,{})}),c.jsx(F,{sx:{flex:1,display:"flex",alignItems:"center",px:1}})]}),I<=Ho&&c.jsx(J1e,{currentStep:I,totalSteps:Ho})]}),c.jsx(F,{sx:{flex:1,display:"flex",flexDirection:"column",px:O?2:0,pt:O?3:0,pb:O?2:0,minHeight:0,overflow:"hidden"},children:c.jsxs(Ws,{mode:"wait",children:[I===1&&c.jsx(Vde,{onNext:Se=>$(Se),selected:e.quiz.salesChannels,currentStep:I,totalSteps:Ho,isOptional:!0},"step1"),I===2&&c.jsx(Wde,{onNext:j,selected:e.quiz.segment},"step2"),I===3&&!C&&c.jsx(Gde,{onNext:q,selected:e.quiz.businessType,isOptional:!0},"step3"),I===4&&c.jsx(Zde,{onNext:W,selected:e.quiz.firstGoal,currentStep:I,totalSteps:Ho,isOptional:!0},"step4"),I===5&&(!_||!x)&&c.jsx(Dfe,{onNext:ne,initialValue:e.user.phone},"phone"),I===6&&!_&&c.jsx(Nfe,{onNext:ae,phone:e.user.phone},"authOptions"),I===7&&!_&&f==="sms"&&c.jsx(Kfe,{onNext:re,phone:e.user.phone,autoSendSms:!0},"verification"),I===7&&!_&&f==="email"&&c.jsx(Yfe,{email:m,phone:e.user.phone},"emailVerification"),I===7&&!_&&!f&&c.jsx(F,{sx:{p:2,textAlign:"center"},children:c.jsx(V,{children:"Carregando..."})}),I===8&&c.jsx(Ppe,{onNext:be,initialValue:e.store.name},"storeName"),I===9&&c.jsx(Upe,{onNext:J,storeName:e.store.name,initialValue:e.store.slug},"storeSlug"),I===10&&c.jsx(E0e,{onNext:xe,defaultColor:e.store.color},"storeColor"),I===11&&c.jsx(n1e,{onNext:Ze,initialLogo:e.store.logoUrl},"storeLogo"),I===12&&c.jsx(Ipe,{onNext:_e,initialValues:{email:C?w==null?void 0:w.email:f==="email"||f==="google"?m:e.user.email,document:C?(ft=w==null?void 0:w.user_metadata)==null?void 0:ft.cpf_cnpj:e.user.document},emailDisabled:C||f==="email"||f==="google",documentDisabled:C&&!!((Ge=w==null?void 0:w.user_metadata)!=null&&Ge.cpf_cnpj),hideTerms:C},"personalInfo"),I===13&&c.jsx(d1e,{onNext:()=>M()},"notificationPermission"),I>Ho&&c.jsx(X1e,{data:e},"finalizing")]})})]});return a?c.jsxs(F,{sx:{height:"100vh",display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:[c.jsx("img",{src:Ah,alt:"",style:{position:"fixed",top:0,left:0,width:"102%",height:"102%",objectFit:"cover",zIndex:-1}}),c.jsxs(F,{sx:{maxWidth:"900px",width:"100%",height:"min(90vh, 680px)",border:1,borderColor:"divider",borderRadius:3,overflow:"hidden",display:"flex",flexDirection:"row",backgroundColor:"background.default"},children:[c.jsxs(F,{sx:{width:"280px",flexShrink:0,backgroundColor:s.palette.primary.main,display:"flex",flexDirection:"column",justifyContent:"space-between",overflow:"hidden",position:"relative"},children:[c.jsx(F,{sx:{px:3,pt:3},children:c.jsx(F,{component:"img",src:Ua,alt:"Stoqui",sx:{height:"32px",width:"auto",filter:"brightness(0) invert(1)"}})}),c.jsx(F,{sx:{px:3,pb:4},children:`Organize 182suas 183vendas 184hoje`.split(` 185`).map((Se,je)=>c.jsx(V,{sx:{color:je===3?"rgba(255,255,255,0.4)":"white",fontSize:"2.8rem",fontWeight:800,lineHeight:1,letterSpacing:"-0.03em",textTransform:"lowercase"},children:Se},je))}),c.jsx(F,{sx:{position:"absolute",top:-40,right:-40,width:160,height:160,borderRadius:"50%",border:"3px solid rgba(255,255,255,0.15)"}})]}),$e]})]}):$e}const eme="data:image/png;
185base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAeGVYSWZNTQAqAAAACAAEARoABQAAAAEAAAA+ARsABQAAAAEAAABGASgAAwAAAAEAAgAAh2kABAAAAAEAAABOAAAAAAAAAEgAAAABAAAASAAAAAEAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAQKADAAQAAAABAAAAQAAAAAB13naHAAAACXBIWXMAAAsTAAALEwEAmpwYAAALUElEQVR4Ae1bfWwcRxV/s3t7thMntI5QWj6aEkpKcGo7LspngZri2M4HASGlavgDFVE+VP5AQFNSBGkKMZUqWhCtUiFKAVGCWlUN5Mt2nKQEFCcp/spHQ0Wo0pAmpUDaJI1z57vd4fdmvXveu93z7t65NJFHOe/szHtv3nvz3ps3MxuiiTKhgQkNUP3OudS4dws1dKy+4rXBMjb+aauSGcIKmr99KqX0A5SY8mEyh86SlmmivrZDV6QiGnfUkZXYQ/qkGsq+9TeqNOdrlDY+RnoSwl+AOvQaADxFtduuueIUMKd7upJNJGrIfIuUzCn94xpJ806S0pZXDhNpxhwyjE3KMq4ULbCVJ+QmJRvLyIVlFvRFQQ2d3GKoRuePVklkDW+lTOIOOtoEdV3GpXZPNRlZCJ9cTlYqX5BhDS1oFd4OBmSEZPYZqu2o8XZeRm/MO8vgK7ySOQ0FyGdJeA1AichKEMlWMhJbaO62GZeR2DarzDPzzjIUzjxkY5nls4gBooNEngU40ipLSCwimdxJddsXOM3v+Gdd53yiii7SwLuf8CwAywzZNdKtY/D3bIEbOFJaaXTpHyK9YgfixRec5nfsk3nUEx3w4VnEvPsWCM8yJ7QXBd2wvYKq9X4SidkkoYegInT0sNbkY6Sf/S71rjoXBPp/aedIn062Y2bvBpP4ZwazIRLozx6ja825Gh1fymraCgUEI3APE+SfZtxNVs0uWMOi4ghvYy/zMpzcrXhz+Cw2vC3rVtqxlIMgikW/ITnMUa8YGvqgWeVT+s1wi26a2/V9Wvh01RhI49e9cF+V4oF5IfCkeAOPRQubfzqtZAacrYBDLUcgHJaLiqKobicnE1JWkahYTylYQ/2OW9y+t6vS0LWYUkO7EOXXK16cBGes8VlGCVmVzKOnvLHjBrK0gyS0q4v6T/4AIgmC2TR871HSLj1IvSv+kw9S1vd53dMoQ2shxNfhthWw3PDkOY5J6w3SrHnU13qcEW0L4Bo3SOs+NI1lQwydK4oBWYF19VtkVe6DSd6BzrF8KYcfvoasdedqysgeNRZhzCjCq3EgG8s4Ijw3FTLa0LnFzpwiaNYRQgUXkJTWNjLNdXS4pdfpKulZt6sR8/IArHMZiLPFRSenwVI5vR9oWTEauTD0C5rEY8QqDmNaxTKo9laq7/oxXcy2j6w00UnaS/RaEvLbMPfJwet6CNIsE8uWV7wW0PDcVUSTjiLCvydSHMgjar/Cu2ytd1HW+hIdafmnL1hQ45zO91NCPIHA3IyZA5QVBBmuXfm/eZpoqJYGPvumg5SLAdwiku/C36kwYae/hCdoqFQ6uYQMrZPqt80KTay+exYZeqctPFbnUoXngW2Zpo7I6LLiVYCZ4HevVbigMSusBGHMhjVsxn7ifWNSYRhNblaZqVrXx8SIAiDIltHF8SqA6CJ6UoGbIxctYkXtJ5KzEcR+pVLvIPTr91TC/X6NWZpdkr/70bc3fGxOLKNbvAowTryBnjOjV0cXstQKz6ZedRtN1u8JJHV1eg1gPhm4gwtEDNOhRD1DtowuglcBvV/JoKcP5ucClLXCwUzoa6hu940FdLlNQjmBO7gCjGgNtkx9ZMvo4noVwM1C+2NZgo47xOgKAqNmTMHJ8zdHt6o6t2nJ6nEdW0jI5i2FCkhmdmLZeXlcrYDoc8SntE7hU2iBtsiZnUNgjCfPPss0VN2VD1mogANLzyMR+sm4KYCXNC05jfTsJ1xmkolbEfimlWf5danmKqwAKR+hl27B2b+3FCqA+yed+wUCUU/o3aGXZog3DCu0RS6gRaj7s+LCxK3w7o9lmXT+CT8S/qP2rLqEifoyycy/x8cSONGSH3QZEoQ6t5W5qJmHDFLeRSyTT/FXAAPyflkOfx61N+0TVB/suE32RcyUUejVYHLUaxmq9kk3Ul5zNQ22Hg2iGKwAxhhYxgERuyfrJHw0iEb0dvtElpMSp5Q3+VK8gmfmvb+12xnE71lcAYwx2PYXyqaXE2WPYw33oxGjDdm2kK+NQkS9TBm44hG8Ms/M+xhlbAUwgcPLDsOUvga/xUs5GFU0cmYp6Vj56DKP4FXxzMwXL+EUwDRMOotlqjyOKjnhtF5wWZN0EAHXfS2pwqfCzGvIEl4BCeL8IOimIeRwALP35adwedHvIhlaL84fTpXFxaRIEfMasoRXgMicxi4Rv/AovjzYd3I7qLc5d7Gi6hJXdD53lL5EAhqZN8UjeA1ZwkvTu2IIMWBfaUzC92XGRAB8spA/8aTqKyXG2Mrdh5Np8BquhFcA07PkU7EOJB1e+IhMmp1YmvY7Te5zoGe/6mOYuIXPJKX12yjo0RRQU9FNVubP8VJkNfvDSPgegJ36BNP7LSRD60Gf98xRZLBh1YVHdi8lTu6OghxNAc83ZXGbvAYzdSlyLFAMWpuQYR4IZHCw9SBC+O8iK5h9n3nSzHvz9/uBY410RFMAI/Uthflm7yWE2vAbGGYwjcgsNoyMW+ShtduwYVljOPBiZdbYvBUh7dMVdhQvan/Lz0im7sOyJUNtlpTvW4/TwJK/ewn5vNkwG9WRuk+3p4k3O8wD8zLY+qinL+RLPAUw8YG2HxGlebN0ivijqiC/5XXfSp2hbOJhRgtVMpcewdEYltyg1BsxQo2JsZkHxUsoygVA8RXApPrbNpGZXohd4+PgCEmSDzm1JaWH6Min/lUwelDDkZWAFQ/5L7k8hkhjNdpImQuLFA9BdEK0xwi3AVTrO5pI0zcjkk+Fw9tASvjsUUT++Qh+nuPoACq55rrOydDnfrjYnNzSC3aF4Ix0JQ00P58Djl/zmbLYxN4Nk/XevdmZ2S/p0BLfw4iiI9kK2+i1KiiWxxDWNUVxI3SWxwL4ezxDewHMzczNFnPB5CVvTOCr4gSW/1cg0GnM4H8hxAWy+JwcQYwszoF5xmtwND4dfdcBfgZwZwD2WvTlirIq8xXS0x8tx7cICKNlKAlxD9bumYUXGuwKWg1yBv7VubOp8iD0OZ8iqFsbVhZ+/GAXUnd52NnBfzyFsz2tcgaZEksxBV+yeJCCX9Rwwd0heuo7ajHznNqO45l+Ph/wXEFDiDeLsbQO5PdGeS8xBkiBoLQBlx1e4Xnd559axkrRMVsECwsP8ewRYBXCwHcMEkvx/SXJUAp3hP9gsRJnhc9hF5ejo/b71tOYBU4ObsJMwYd1XHo63sZuwYXN3KmzoNzGf0ZIKRcYhg+I1wH6EoBxwKl9xuMSrBjLvJ0Gm3m8WGVktBi46ivsYSxTRq17msMMyWwvXWUsIN43MEyVfC8OJz9AUrseglwHi5kO/66BYFgx8J0PSyxxHKQJmLQ4h7fX4favko6gacmXqar6JPUsQiDFTDcs3AtLWAx6NsN2QER2acyjgSYoKHqJr4CGzrUIRu25wAdSQrMQ2dtocElXdFZCYPCncULbAwWypm0Ezghl6ofU3/K9EBQKQOIp4KbumdgV/hWziU/qRqK0uoFJP4OPkFYVjFLOhoaOn5NWdVdO8SoEXCCRWUD9S1+MOlS8AKJnf4BlLyc8FnC4wXnMfqxZiMS0NPBh5PBrdoBlTEwA3zhLfQNeIk9odAU0dDbD72/33ONzhLbMn9KhNgSrcS6Dt72KsTbkgirGU1+gGCsRlD8ddfRoCrh5C9JQ+SAUjW3aiA+qQJT6Bz6bfTjq4LHhz53hy1tknggFbsGSTNRON/5h9JWb2xtUiaaAbOKrpE1pVMR4cOcnaV3cKBzEWNH2E3emyBLfUZPA12BKEZBfn/oRqqz6RlHcvE5ncc5rDngVAvl7hi8xbMWxIZgXe2jWhd/TQADOeDUfatlNczvW4X+GLHfzEMm5NecLE2VCAxMaCKmB/wH7/7uaVLWQvwAAAABJRU5ErkJggg==";function Kj(e){const t=new Uint8Array(e);return crypto.getRandomValues(t),btoa(String.fromCharCode(...t)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function tme(){return Kj(24)}function rme(e){const t=Math.floor(Date.now()/1e3),r=Kj(32),n=`${e}.${t}.${r}`;return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const nme=()=>{const[e]=ws(),t=At(),[r,n]=v.useState(null),[i,o]=v.useState(!0);return v.useEffect(()=>
185{const s=e.get("code");if(!s){const l=tme(),d=rme(l);sessionStorage.setItem("flapp_sso_state",d),sessionStorage.setItem("flapp_sso_nonce",l);const u="stoqui-client",h="https://authorization.asaas.com",f="https://app.stoqui.com.br/auth/sso";window.location.href=`${h}/oauth2/authorize?response_type=code&client_id=${u}&scope=openid&redirect_uri=${f}&state=${d}&nonce=${l}`;return}(async()=>{var h,f;const l=e.get("state"),d=sessionStorage.getItem("flapp_sso_state"),u=sessionStorage.getItem("flapp_sso_nonce");if(sessionStorage.removeItem("flapp_sso_state"),sessionStorage.removeItem("flapp_sso_nonce"),!l||l!==d){n("Sessão inválida. Tente novamente."),o(!1);return}try{const p=await Gr.post("https://catalogo.stoqui.com.br/api/flapp/sso/exchange",{code:s,nonce:u},{headers:{"Content-Type":"application/json"}}),{token_hash:m}=p.data;if(!m){n("Falha ao obter token de autenticação"),o(!1);return}const{data:g,error:y}=await Te.auth.verifyOtp({token_hash:m,type:"magiclink"});if(y){console.error("SSO verify error:",y),n(y.message||"Erro ao autenticar"),o(!1);return}g.session?t("/",{replace:!0}):(n("Não foi possÃvel criar a sessão"),o(!1))}catch(p){console.error("SSO error:",p);const m=((f=(h=p.response)==null?void 0:h.data)==null?void 0:f.error)||p.message||"Erro inesperado";n(m),o(!1)}})()},[e,t]),c.jsx(F,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"100dvh",px:3},children:i?c.jsxs(me,{spacing:3,alignItems:"center",children:[c.jsx(F,{component:"img",src:eme,alt:"Asaas",sx:{width:64,height:64,borderRadius:2}}),c.jsx(bn,{size:32}),c.jsx(V,{variant:"body1",color:"text.secondary",children:"Entrando com Asa
185as..."})]}):r?c.jsxs(me,{spacing:3,alignItems:"center",sx:{width:"100%",maxWidth:360},children:[c.jsx(zn,{severity:"error",sx:{width:"100%"},children:r}),c.jsx(De,{variant:"contained",fullWidth:!0,onClick:()=>t("/auth/phone-login"),children:"Voltar"})]}):null})},i0=320;function Mg(){const e=$o(),t=tl(e.breakpoints.up("md")),r=sn(),n=r.pathname==="/orders/new",i=r.pathname==="/clock-skew",o=n&&t||i;return{isDesktop:t,drawerWidth:i0,shouldHideDrawer:o,mainContentWidth:{xs:"100%",md:o?"100%":`calc(100% - ${i0}px)`},appBarWidth:{xs:"100%",md:o?"100%":`calc(100% - ${i0}px)`},appBarMarginLeft:{xs:0,md:o?0:t?`${i0}px`:0},contentPadding:{xs:{px:0,pt:0,pb:0},md:t&&!o?{px:6,pt:4,pb:2}:{px:0,pt:0,pb:0}}}}function Sc({title:e,children:t,navigateBack:r,useIcon:n,onBack:i,hideBottomBorder:o=!1,icon:s}){const{isDesktop:a,appBarWidth:l,appBarMarginLeft:d}=Mg(),u=At(),h=()=>{i?i():typeof r=="string"?u(r):typeof r=="function"?r():window.history.length>1?u(-1):u("/")};return c.jsx(jD,{component:"nav",elevation:0,sx:{position:"fixed",paddingTop:"var(--safe-area-inset-top)",width:l,ml:d},children:c.jsxs(jm,{sx:{borderBottom:"1px solid",borderColor:o?"transparent":"divider",height:a?"72px":void 0},children:[r&&c.jsx(mr,{edge:"start",color:"inherit","aria-label":"Voltar",onClick:h,children:c.jsx(UC,{})}),s&&c.jsx(F,{sx:{display:"flex",alignItems:"center",mr:1.5},children:c.jsx("img",{src:s,alt:"",style:{width:24,height:24}})}),e&&c.jsx(V,{variant:"h6",component:"div",sx:{flexGrow:1,display:"block",fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),n&&c.jsx(F,{sx:{minHeight:a?"0px":"48px",maxHeight:a?"0px":"48px",display:"flex",justifyContent:"center",alignItems:"center",marginRight:"auto",marginTop:"16px",marginBottom:"16px"},children:!a&&c.jsx("img",{src:Ua,alt:"logo",height:"36px"})}),c.jsx(F,{sx:{display:"flex",alignItems:"center"},children:t})]})})}const Z7={"America/Sao_Paulo":"BrasÃlia / São Paulo","America/Manaus":"Manaus","America/Belem":"Belém","America/Fortaleza":"Fortaleza","America/Recife":"Recife","America/Cuiaba":"Cuiabá","America/Campo_Grande":"Campo Grande","America/Rio_Branco":"Rio Branco","America/Noronha":"Fernando de Noronha","America/Bahia":"Salvador","America/Maceio":"Maceió","America/Boa_Vista":"Boa Vista","America/Porto_Velho":"Porto Velho","America/Eirunepe":"Eirunepé","America/Araguaina":"AraguaÃna","America/Santarem":"Santarém"};function Dv(e){if(!e)return"desconhecido";if(Z7[e])return Z7[e];const t=e.split("/").pop();return t?t.replace(/_/g," "):e}function ime(){const e=qe.getPlatform();return e==="ios"||e==="android"?e:"web"}async function ome(){try{await Uj.openAndroid({option:hm.Date})}catch{}}function sme(e,t,r){return e==="ios"?{title:`Como ajustar no seu ${r}`,steps:["Abra o app Ajustes",'Toque em "Geral"','Toque em "Data e Hora"','Ative "Definir Automaticamente"','Verifique se "Fuso Horário" mostra a sua cidade',"Volte para esta tela quando terminar"]}:e==="android"?{title:`Como ajustar no seu ${r}`,steps:["Abra o app Configurações",'Procure por "Sistema" ou "Geral"','Toque em "Data e hora"','Ative "Data e hora automáticas"','Ative "Fuso horário automático" também',"Volte para esta tela quando terminar"]}:t==="mac"?{title:"Como ajustar no Mac",steps:["Abra Ajustes do Sistema (no menu Apple)",'Vá em "Geral" e depois "Data e Hora"','Ative "Definir hora e data automaticamente"','Ative "Definir fuso horário automaticamente usando sua localização"',"Confirme com sua senha se for solicitado","Volte para esta tela quando terminar"]}:t==="windows"?{title:"Como ajustar no Windows",steps:["Abra Configurações (tecla Windows + I)",'Vá em "Hora e idioma" e depois "Data e hora"','Ative "Definir horário automaticamente"','Ative "Definir fuso horário automaticamente"','Clique em "Sincronizar agora" se aparecer essa opção',"Volte para esta tela quando terminar"]}:t==="linux"?{title:"Como ajustar no Linux",steps:["Abra as Configurações do sistema",'Vá em "Data e hora"',"Ative o ajuste automático de data e hora","Ative também o fuso horário automático","Volte para esta tela quando terminar"]}
185:{title:"Como ajustar no seu computador",steps:["Abra as configurações do sistema",'Procure por "Data e hora"',"Ative o ajuste automático de data, hora e fuso horário","Volte para esta tela quando terminar"]}}function ame(){const{data:e}=co(),{data:t,isSuccess:r,isError:n,isPending:i,isFetching:o,refetch:s}=UI(),a=At(),l=v.useMemo(ime,[]),d=v.useMemo(FI,[]),u=v.useMemo(NI,[]),h=v.useMemo(()=>Intl.DateTimeFormat().resolvedOptions().timeZone||null,[]),f=v.useMemo(()=>sme(l,d,u),[l,d,u]),p=()=>{const S=e==null?void 0:e.SUPPORT_URL;if(!S)return;const k=`Olá! Estou tentando usar o app Stoqui mas recebo um aviso de que a data e hora do meu ${u} estão incorretas. Pode me ajudar?`,A=S.includes("?")?"&":"?";window.open(`${S}${A}text=${encodeURIComponent(k)}`,"_blank")},m=()=>a("/",{replace:!0}),g=r&&t.isOk,y=!!(t!=null&&t.isTimezoneIssue),b=(t==null?void 0:t.ipTimezone)||null,E=!!(e!=null&&e.SUPPORT_URL);return c.jsxs(F,{sx:{minHeight:"100vh",bgcolor:"#F6F6FA",pb:4},children:[c.jsx(Lm,{}),c.jsx(Sc,{title:"Data e hora",navigateBack:!0}),c.jsxs(F,{sx:{pt:"var(--safe-area-inset-top, 0px)"},children:[c.jsx(jm,{}),i?c.jsx(me,{alignItems:"center",justifyContent:"center",sx:{py:10},children:c.jsx(bn,{})}):n?c.jsxs(me,{spacing:2.5,alignItems:"center",sx:{textAlign:"center",p:{xs:2.5,sm:4},pt:{xs:4,sm:6},maxWidth:480,mx:"auto"},children:[c.jsx(V,{variant:"h6",sx:{fontWeight:700},children:"Não conseguimos verificar agora"}),c.jsx(V,{variant:"body2",color:"text.secondary",children:"Verifique sua conexão com a internet e tente novamente."}),c.jsxs(me,{spacing:1.5,sx:{width:"100%"},children:[c.jsx(De,{variant:"contained",color:"primary",onClick:()=>s(),disabled:o,fullWidth:!0,size:"large",children:o?"Verificando...":"Tentar novamente"}),c.jsx(De,{variant:"text",color:"primary",onClick:m,fullWidth:!0,size:"large",children:"Voltar ao app"})]})]}):c.jsxs(me,{spacing:{xs:3,sm:4},sx:{p:{xs:2.5,sm:4},pt:{xs:2,sm:6},maxWidth:640,width:"100%",mx:"auto"},children:[c.jsxs(me,{spacing:{xs:2,sm:2.5},alignItems:"center",sx:{textAlign:"center"},children:[c.jsx(F,{sx:{width:{xs:72,sm:88},height:{xs:72,sm:88},borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:g?"#DCFCE7":"#FEE2E2",color:g?"#15803D":"#B91C1C"},children:g?c.jsx(ise,{size:48}):c.jsx(LI,{size:44})}),c.jsxs(me,{spacing:.75,sx:{maxWidth:440},children:[c.jsx(V,{sx:{fontWeight:700,fontSize:{xs:"1.25rem",sm:"1.5rem"},lineHeight:1.25,letterSpacing:"-0.01em"},children:g?"Data e hora corretas":y?"Fuso horário incorreto":"Data e hora incorretas"}),c.jsx(V,{color:"text.secondary",sx:{fontSize:{xs:"0.875rem",sm:"0.95rem"},lineHeight:1.55},children:g?"Tudo certo. Você já pode continuar usando o app normalmente.":y?`As configurações de fuso horário do seu ${u} não batem com a sua localização. Isso pode impedir o login e causar outros erros no app.`:`As configurações de data e hora do seu ${u} precisam de ajuste. Isso pode impedir o login e causar outros erros no app.`})]})]}),y&&c.jsx(F,{sx:{bgcolor:"#FFFFFF",borderRadius:2,p:2.5},children:c.jsxs(me,{spacing:1.5,children:[c.jsx(V,{variant:"subtitle2",sx:{fontWeight:700},children:"O que está errado"}),c.jsxs(V,{variant:"body2",color:"text.primary",children:["Seu ",u," está configurado com o fuso horário de"," ",c.jsx("strong",{children:Dv(h)}),", mas você parece estar no fuso horário de ",c.jsx("strong",{children:Dv(b)}),"."]}),c.jsxs(V,{variant:"body2",sx:{fontWeight:600,color:"text.primary"},children:["Mude o fuso horário para ",Dv(b),", ou ative o fuso horário automático nas configurações do seu ",u,"."]})]})}),!g&&c.jsxs(F,{sx:{bgcolor:"#FFFFFF",borderRadius:2,p:3},children:[c.jsx(V,{variant:"subtitle1",sx:{fontWeight:700,mb:2},children:f.title}),c.jsx(me,{spacing:2,children:f.steps.map((S,k)=>c.jsxs(me,{direction:"row",spacing:2,alignItems:"flex-start",children:[c.jsx(F,{sx:{flexShrink:0,width:28,height:28,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"#8865FE",color:"#FFFFFF",fontSize:14,fontWeight:700,lineHeight:1},children:k+1}),c.jsx(V,{variant:"body2",sx:{pt:.5,color:"text.primary",flex:1},children:S})]},k))})]}),c.jsxs(me,{spacing:1.5,children:[!g&&c.jsx(De,{variant:"contained",color:"primary",onClick:()=>s(),disabled:o,fullWidth:!0,size:"large",startIcon:o?c.jsx(bn,{size:18,color:"inherit"}):null,sx:{py:1.75,fontSize:"1rem"},children:o?"Verificando...":"Verificar novamente"}),!g&&l==="android"&&c.jsx(De,{variant:"text",color:"primary",onClick:ome,fullWidth:!0,size:"large",endIcon:c.jsx(rse,{size:18}),children:"Abrir configurações de data e hora"}),g&&c.jsx(De,{variant:"contained",color:"primary",onClick:m,fullWidth:!0,size:"large",sx:{py:1.75,fontSize:"1rem"},children:"Voltar ao app"}),!g&&E&&c.jsx(De,{variant:"text",color:"inherit",onClick:p,fullWidth:!0,size:"large",startIcon:c.jsx(jI,{size:18}),sx:{color:"text.secondary"},children:"Falar com o suporte"}),!g&&c.jsx(De,{variant:"text",color:"inherit",onClick:m,fullWidth:!0,size:"small",sx:{color:"text.secondary",mt:.5},children:"Voltar ao app sem corrigir"})]})]})]})]})}const lme=async e=>{const{data:t,error:r}=await Te.from("dominio_personalizado").select("*").eq("catalogo_web_id",e).order("criado_em",{ascending:!1});if(r)throw new Error(r.message);return t||[]},cme="206ed32b-275a-4587-81b0-42d1e623a4f1",ume=()=>{const{data:e}=lo(),t=(e==null?void 0:e.user_id)===cme,r=(e==null?void 0:e.plano)==="black"||t;return Et({queryKey:["domains"],queryFn:()=>
185{if(!(e!=null&&e.id))throw new Error("Web catalog not found");return lme(e.id)},enabled:!!(e!=null&&e.id)&&r})},dme="206ed32b-275a-4587-81b0-42d1e623a4f1",Ng=()=>{const{data:e,isLoading:t,error:r}=lo(),n=(e==null?void 0:e.user_id)===dme,i=(e==null?void 0:e.plano)==="black"||n,{data:o,isLoading:s,error:a}=ume();return v.useMemo(()=>{const d=t||i&&s,u=!!r||i&&!!a,h="stoqui.shop";if(d||u||!(e!=null&&e.slug_loja))return{storeUrl:e!=null&&e.slug_loja?`https://${e.slug_loja}.${h}`:`https://sualoja.${h}`,isLoading:d,isError:u,hasVerifiedDomain:!1};if(!i)return{storeUrl:`https://${e.slug_loja}.${h}`,isLoading:!1,isError:!1,hasVerifiedDomain:!1};const f=(o==null?void 0:o.filter(m=>m.status==="verificado"))||[];return f.length===0?{storeUrl:`https://${e.slug_loja}.${h}`,isLoading:!1,isError:!1,hasVerifiedDomain:!1}:{storeUrl:`https://${f.sort((m,g)=>new Date(g.criado_em).getTime()-new Date(m.criado_em).getTime())[0].dominio}`,isLoading:!1,isError:!1,hasVerifiedDomain:!0}},[o,e,i,s,t,a,r])};class hme extends sb{async write(t){if(typeof navigator>"u"||!navigator.clipboard)throw this.unavailable("Clipboard API not available in this browser");if(t.string!==void 0)await this.writeText(t.string);else if(t.url)await this.writeText(t.url);else if(t.image)if(typeof ClipboardItem<"u")try{const r=await(await fetch(t.image)).blob(),n=new ClipboardItem({[r.type]:r});await navigator.clipboard.write([n])}catch{throw new Error("Failed to write image")}else throw this.unavailable("Writing images to the clipboard is not supported in this browser");else throw new Error("Nothing to write")}async read(){if(typeof navigator>"u"||!navigator.clipboard)throw this.unavailable("Clipboard API not available in this browser");if(typeof ClipboardItem<"u")try{const t=await navigator.clipboard.read(),r=t[0].types[0],n=await t[0].getType(r);return{value:await this._getBlobData(n,r),type:r}}catch{return this.readText()}else return this.readText()}async readText(){if(typeof navigator>"u"||!navigator.clipboard||!navigator.clipboard.readText)throw this.unavailable("Reading from clipboard not supported in this browser");return{value:await navigator.clipboard.readText(),type:"text/plain"}}async writeText(t){if(typeof navigator>"u"||!navigator.clipboard||!navigator.clipboard.writeText)throw this.unavailable("Writting to clipboard not supported in this browser");await navigator.clipboard.writeText(t)}_getBlobData(t,r){return new Promise((n,i)=>{const o=new FileReader;r.includes("image")?o.readAsDataURL(t):o.readAsText(t),o.onloadend=()=>{const s=o.result;n(s)},o.onerror=s=>{i(s)}})}}const fme=Kr("Clipboard",{web:()=>new hme});function ax(e,t,r="operation"){return Promise.race([e,new Promise((n,i)=>setTimeout(()=>i(new Error(`${r} timed out after ${t}ms`)),t))])}function pme(e){const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select(),t.setSelectionRange(0,e.length);try{if(!document.execCommand("copy"))throw new Error("execCommand copy returned false")}finally{document.body.removeChild(t)}}const mme=async e=>{var t;if(qe.isNativePlatform())try{await ax(fme.write({string:e}),2e3,"clipboard");return}catch(r){console.error("Native clipboard write failed, falling back:",r)}try{if((t=navigator.clipboard)!=null&&t.writeText){await navigator.clipboard.writeText(e);return}}catch(r){console.error("navigator.clipboard failed, falling back:",r)}pme(e)};var Ja;(function(e){e.Heavy="HEAVY",e.Medium="MEDIUM",e.Light="LIGHT"})(Ja||(Ja={}));var u_;(function(e){e.Success="SUCCESS",e.Warning="WARNING",e.Error="ERROR"})(u_||(u_={}));const Yj=Kr("Haptics",{web:()=>X(()=>import("./web-DVdaWdCR.js"),__vite__mapDeps([19,1,2,3,4,5,6])).then(e=>new e.HapticsWeb)}),Li=async(e=Ja.Medium)=>{if(qe.isNativePlatform())try{await Yj.impact({style:e})}catch(t){console.warn("Haptics not available:",t)}},gme=async(e=u_.Success)=>{if(qe.isNativePlatform())try{await Yj.notification({type:e})}catch(t){console.warn("Haptics not available:",t)}};function vme({text:e,onCopySuccess:t,iconSize:r=20,successColor:n="#17A24A",duration:i=2e3,size:o="small",...s}){const[a,l]=v.useState(!1),d=async()=>
185{if(!a)try{await mme(e),gme(),l(!0),t==null||t(e),setTimeout(()=>{l(!1)},i)}catch(u){console.error("Failed to copy text:",u)}};return c.jsxs(mr,{size:o,onClick:d,sx:{position:"relative",...s.sx},...s,children:[c.jsx(TE,{size:r,style:{visibility:"hidden"}}),c.jsx(Ws,{mode:"wait",children:a?c.jsx(rt.div,{initial:{scale:.5,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.8,opacity:0},transition:{duration:.12},style:{position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:c.jsx(dse,{size:r,color:n})},"check"):c.jsx(rt.div,{initial:{scale:.5,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.8,opacity:0},transition:{duration:.12},style:{position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:c.jsx(TE,{size:r})},"copy")})]})}function PCe(e){return ee({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M2 5a2 2 0 012-2h7a2 2 0 012 2v4a2 2 0 01-2 2H9l-3 3v-3H4a2 2 0 01-2-2V5z"},child:[]},{tag:"path",attr:{d:"M15 7v2a4 4 0 01-4 4H9.828l-1.766 1.767c.28.149.599.233.938.233h2l3 3v-3h2a2 2 0 002-2V9a2 2 0 00-2-2h-1z"},child:[]}]})(e)}function yme(e){return ee({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"},child:[]}]})(e)}function _me(e){return ee({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"},child:[]}]})(e)}function bme(e){return ee({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z",clipRule:"evenodd"},child:[]}]})(e)}function xme(e){return ee({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"},child:[]}]})(e)}function wme(e){return ee({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M5 5a3 3 0 015-2.236A3 3 0 0114.83 6H16a2 2 0 110 4h-5V9a1 1 0 10-2 0v1H4a2 2 0 110-4h1.17C5.06 5.687 5 5.35 5 5zm4 1V5a1 1 0 10-1 1h1zm3 0a1 1 0 10-1-1v1h1z",clipRule:"evenodd"},child:[]},{tag:"path",attr:{d:"M9 11H3v5a2 2 0 002 2h4v-7zM11 18h4a2 2 0 002-2v-5h-6v7z"},child:[]}]})(e)}function Eme(e){return ee({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"},child:[]}]})(e)}function Sme(e){return ee({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"},child:[]}]})(e)}function Cme(e){return ee({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z",clipRule:"evenodd"},child:[]}]})(e)}function Tme(e){return ee({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M3 4a1 1 0 011-1h3a1 1 0 011 1v3a1 1 0 01-1 1H4a1 1 0 01-1-1V4zm2 2V5h1v1H5zM3 13a1 1 0 011-1h3a1 1 0 011 1v3a1 1 0 01-1 1H4a1 1 0 01-1-1v-3zm2 2v-1h1v1H5zM13 3a1 1 0 00-1 1v3a1 1 0 001 1h3a1 1 0 001-1V4a1 1 0 00-1-1h-3zm1 2v1h1V5h-1z",clipRule:"evenodd"},child:[]},{tag:"path",attr:{d:"M11 4a1 1 0 10-2 0v1a1 1 0 002 0V4zM10 7a1 1 0 011 1v1h2a1 1 0 110 2h-3a1 1 0 01-1-1V8a1 1 0 011-1zM16 9a1 1 0 100 2 1 1 0 000-2zM9 13a1 1 0 011-1h1a1 1 0 110 2v2a1 1 0 11-2 0v-3zM7 11a1 1 0 100-2H4a1 1 0 100 2h3zM17 13a1 1 0 01-1 1h-2a1 1 0 110-2h2a1 1 0 011 1zM16 17a1 1 0 100-2h-3a1 1 0 100 2h3z"},child:[]}]})(e)}function Zj(e){return ee({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M3 1a1 1 0 000 2h1.22l.305 1.222a.997.997 0 00.01.042l1.358 5.43-.893.892C3.74 11.846 4.632 14 6.414 14H15a1 1 0 000-2H6.414l1-1H14a1 1 0 00.894-.553l3-6A1 1 0 0017 3H6.28l-.31-1.243A1 1 0 005 1H3zM16 16.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zM6.5 18a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"},child:[]}]})(e)}function Ame(e){return ee({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M5 2a1 1 0 011 1v1h1a1 1 0 010 2H6v1a1 1 0 01-2 0V6H3a1 1 0 010-2h1V3a1 1 0 011-1zm0 10a1 1 0 011 1v1h1a1 1 0 110 2H6v1a1 1 0 11-2 0v-1H3a1 1 0 110-2h1v-1a1 1 0 011-1zM12 2a1 1 0 01.967.744L14.146 7.2 17.5 9.134a1 1 0 010 1.732l-3.354 1.935-1.18 4.455a1 1 0 01-1.933 0L9.854 12.8 6.5 10.866a1 1 0 010-1.732l3.354-1.935 1.18-4.455A1 1 0 0112 2z",clipRule:"evenodd"},child:[]}]})(e)}function kme(e){return ee({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"},child:[]}]})(e)}function Rme(e){return ee({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"},child:[]}]})(e)}function Ime(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 8h2a2 2 0 012 2v6a2 2 0 01-2 2h-2v4l-4-4H9a1.994 1.994 0 01-1.414-.586m0 0L11 14h4a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2v4l.586-.586z"},child:[]}]})(e)}function OCe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"},child:[]}]})(e)}function jCe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"},child:[]}]})(e)}function LCe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"},child:[]}]})(e)}function Pme(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},child:[]}]})(e)}function $Ce(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 13h6m-3-3v6m5 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"},child:[]}]})(e)}function DCe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"},child:[]}]})(e)}function MCe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},child:[]}]})(e)}function NCe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},child:[]}]})(e)}function FCe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"},child:[]}]})(e)}function Xj(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"},child:[]}]})(e)}function UCe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},child:[]}]})(e)}function BCe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"},child:[]}]})(e)}function VCe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"},child:[]}]})(e)}function Ome(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"},child:[]}]})(e)}function HCe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"},child:[]}]})(e)}function jme(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"},child:[]}]})(e)}function zCe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},child:[]}]})(e)}function WCe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},child:[]}]})(e)}function X7(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.3
18516m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"},child:[]}]})(e)}function qCe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"},child:[]}]})(e)}function GCe(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z"},child:[]}]})(e)}function Fg(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z"},child:[]}]})(e)}function Lme(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"},child:[]}]})(e)}function Jj(e){return ee({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M9 17a2 2 0 11-4 0 2 2 0 014 0zM19 17a2 2 0 11-4 0 2 2 0 014 0z"},child:[]},{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16V6a1 1 0 00-1-1H4a1 1 0 00-1 1v10a1 1 0 001 1h1m8-1a1 1 0 01-1 1H9m4-1V8a1 1 0 011-1h2.586a1 1 0 01.707.293l3.414 3.414a1 1 0 01.293.707V16a1 1 0 01-1 1h-1m-6-1a1 1 0 001 1h1M5 17a2 2 0 104 0m-4 0a2 2 0 114 0m6 0a2 2 0 104 0m-4 0a2 2 0 114 0"},child:[]}]})(e)}var lx={},Mv={};const $me=HD(LD);var J7;function Wt(){return J7||(J7=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=$me}(Mv)),Mv}var Dme=zt;Object.defineProperty(lx,"__esModule",{value:!0});var Qj=lx.default=void 0,Mme=Dme(Wt()),Nme=c;Qj=lx.default=(0,Mme.default)((0,Nme.jsx)("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning");const dc=Kr("Share",{web:()=>X(()=>import("./web-DhY6ReaQ.js"),__vite__mapDeps([20,1,2,3,4,5,6])).then(e=>new e.ShareWeb)});var Ni;(function(e){e.Documents="DOCUMENTS",e.Data="DATA",e.Library="LIBRARY",e.Cache="CACHE",e.External="EXTERNAL",e.ExternalStorage="EXTERNAL_STORAGE"})(Ni||(Ni={}));var Q7;(function(e){e.UTF8="utf8",e.ASCII="ascii",e.UTF16="utf16"})(Q7||(Q7={}));const Ao=Kr("Filesystem",{web:()=>X(()=>import("./web-Ctc8iQ7q.js"),__vite__mapDeps([21,1,2,3,4,5,6])).then(e=>new e.FilesystemWeb)}),eL=8e3;let Nv=!1;async function tL(e){if(!Nv){Nv=!0;try{await e()}finally{Nv=!1}}}function fm(e){const t=e;return(t==null?void 0:t.name)==="AbortError"||(t==null?void 0:t.message)==="Share canceled"}function rL(e,t,r){pe(fe.SHARE.FAILED,{kind:e,title:r,platform:qe.getPlatform(),hasNavigatorShare:typeof navigator<"u"&&!!navigator.share,error:(t==null?void 0:t.message)??String(t)})}async function nL({url:e,text:t,title:r}){const n={...e?{url:e}:{},...t?{text:t}:{},title:r};let i;if(qe.isNativePlatform())try{await ax(dc.share({...n,dialogTitle:r}),eL,"share");return}catch(o){if(fm(o))return;i=o,console.error("Native share failed, trying web share:",o)}if(typeof navigator<"u"&&navigator.share)try{await navigator.share(n);return}catch(o){if(fm(o))return;i=o,console.error("Web share failed:",o)}rL("link",i,r)}async function Fme({dataUrl:e,fileName:t,text:r,url:n,title:i}){var s;if(!e){await nL({url:n,text:r,title:i});return}let o;if(qe.isNativePlatform())try{const a=e.split(",")[1],l=await Ao.writeFile({path:t,data:a,directory:Ni.Cache});await ax(dc.share({files:[l.uri],text:r,title:i,dialogTitle:i}),eL,"share");return}catch(a){if(fm(a))return;o=a,console.error("Native image share failed, trying web share:",a)}try{const l=await(await fetch(e)).blob(),d=new File([l],t,{type:"image/png"});if(typeof navigator<"u"&&navigator.share&&((s=navigator.canShare)!=null&&s.call(navigator,{files:[d]}))){await navigator.share({files:[d],text:r,title:i});return}const u=document.createElement("a");u.download=t,u.href=e,u.click();return}catch(a){if(fm(a))return;o=a,console.error("Web image share failed:",a)}rL("image",o,i)}function Ume(e){return tL(()=>nL(e))}function Bme(e){return tL(()=>Fme(e))}function eS(){const[e,t]=v.useState(!1),r=v.useRef(!1),n=v.useCallback(async i=>{if(!r.current){r.current=!0,t(!0);try{await i()}finally{r.current=!1,t(!1)}}},[]);return{isSharing:e,runShare:n}}var ep={},iL={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Vme=iL;function oL(e){this.mode=Vme.MODE_8BIT_BYTE,this.data=e}oL.prototype={getLength:function(e){return this.data.length},write:function(e){for(var t=0;t<this.data.length;t++)e.put(this.data.charCodeAt(t),8)}};var Hme=oL,sL={L:1,M:0,Q:3,H:2},o0=sL;function ts(e,t){this.totalCount=e,this.dataCount=t}ts.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37
185],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];ts.getRSBlocks=function(e,t){var r=ts.getRsBlockTable(e,t);if(r==null)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var n=r.length/3,i=new Array,o=0;o<n;o++)for(var s=r[o*3+0],a=r[o*3+1],l=r[o*3+2],d=0;d<s;d++)i.push(new ts(a,l));return i};ts.getRsBlockTable=function(e,t){switch(t){case o0.L:return ts.RS_BLOCK_TABLE[(e-1)*4+0];case o0.M:return ts.RS_BLOCK_TABLE[(e-1)*4+1];case o0.Q:return ts.RS_BLOCK_TABLE[(e-1)*4+2];case o0.H:return ts.RS_BLOCK_TABLE[(e-1)*4+3];default:return}};var zme=ts;function aL(){this.buffer=new Array,this.length=0}aL.prototype={get:function(e){var t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(var r=0;r<t;r++)this.putBit((e>>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var Wme=aL,Co={glog:function(e){if(e<1)throw new Error("glog("+e+")");return Co.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return Co.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var In=0;In<8;In++)Co.EXP_TABLE[In]=1<<In;for(var In=8;In<256;In++)Co.EXP_TABLE[In]=Co.EXP_TABLE[In-4]^Co.EXP_TABLE[In-5]^Co.EXP_TABLE[In-6]^Co.EXP_TABLE[In-8];for(var In=0;In<255;In++)Co.LOG_TABLE[Co.EXP_TABLE[In]]=In;var lL=Co,vl=lL;function z0(e,t){if(e.length==null)throw new Error(e.length+"/"+t);for(var r=0;r<e.length&&e[r]==0;)r++;this.num=new Array(e.length-r+t);for(var n=0;n<e.length-r;n++)this.num[n]=e[n+r]}z0.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<e.getLength();n++)t[r+n]^=vl.gexp(vl.glog(this.get(r))+vl.glog(e.get(n)));return new z0(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=vl.glog(this.get(0))-vl.glog(e.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<e.getLength();n++)r[n]^=vl.gexp(vl.glog(e.get(n))+t);return new z0(r,0).mod(e)}};var cL=z0,Wi=iL,tS=cL,qme=lL,ba={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Cn={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;
185Cn.getBCHDigit(t)-Cn.getBCHDigit(Cn.G15)>=0;)t^=Cn.G15<<Cn.getBCHDigit(t)-Cn.getBCHDigit(Cn.G15);return(e<<10|t)^Cn.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;Cn.getBCHDigit(t)-Cn.getBCHDigit(Cn.G18)>=0;)t^=Cn.G18<<Cn.getBCHDigit(t)-Cn.getBCHDigit(Cn.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return Cn.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case ba.PATTERN000:return(t+r)%2==0;case ba.PATTERN001:return t%2==0;case ba.PATTERN010:return r%3==0;case ba.PATTERN011:return(t+r)%3==0;case ba.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case ba.PATTERN101:return t*r%2+t*r%3==0;case ba.PATTERN110:return(t*r%2+t*r%3)%2==0;case ba.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new tS([1],0),r=0;r<e;r++)t=t.multiply(new tS([1,qme.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case Wi.MODE_NUMBER:return 10;case Wi.MODE_ALPHA_NUM:return 9;case Wi.MODE_8BIT_BYTE:return 8;case Wi.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case Wi.MODE_NUMBER:return 12;case Wi.MODE_ALPHA_NUM:return 11;case Wi.MODE_8BIT_BYTE:return 16;case Wi.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else if(t<41)switch(e){case Wi.MODE_NUMBER:return 14;case Wi.MODE_ALPHA_NUM:return 13;case Wi.MODE_8BIT_BYTE:return 16;case Wi.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}else throw new Error("type:"+t)},getLostPoint:function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n++)for(var i=0;i<t;i++){for(var o=0,s=e.isDark(n,i),a=-1;a<=1;a++)if(!(n+a<0||t<=n+a))for(var l=-1;l<=1;l++)i+l<0||t<=i+l||a==0&&l==0||s==e.isDark(n+a,i+l)&&o++;o>5&&(r+=3+o-5)}for(var n=0;n<t-1;n++)for(var i=0;i<t-1;i++){var d=0;e.isDark(n,i)&&d++,e.isDark(n+1,i)&&d++,e.isDark(n,i+1)&&d++,e.isDark(n+1,i+1)&&d++,(d==0||d==4)&&(r+=3)}for(var n=0;n<t;n++)for(var i=0;i<t-6;i++)e.isDark(n,i)&&!e.isDark(n,i+1)&&e.isDark(n,i+2)&&e.isDark(n,i+3)&&e.isDark(n,i+4)&&!e.isDark(n,i+5)&&e.isDark(n,i+6)&&(r+=40);for(var i=0;i<t;i++)for(var n=0;n<t-6;n++)e.isDark(n,i)&&!e.isDark(n+1,i)&&e.isDark(n+2,i)&&e.isDark(n+3,i)&&e.isDark(n+4,i)&&!e.isDark(n+5,i)&&e.isDark(n+6,i)&&(r+=40);for(var u=0,i=0;i<t;i++)for(var n=0;n<t;n++)e.isDark(n,i)&&u++;var h=Math.abs(100*u/t/t-50)/5;return r+=h*10,r}},Gme=Cn,Kme=Hme,uL=zme,dL=Wme,hl=Gme,Yme=cL;function as(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var Vi=as.prototype;
185Vi.addData=function(e){var t=new Kme(e);this.dataList.push(t),this.dataCache=null};Vi.isDark=function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]};Vi.getModuleCount=function(){return this.moduleCount};Vi.make=function(){if(this.typeNumber<1){var e=1;for(e=1;e<40;e++){for(var t=uL.getRSBlocks(e,this.errorCorrectLevel),r=new dL,n=0,i=0;i<t.length;i++)n+=t[i].dataCount;for(var i=0;i<this.dataList.length;i++){var o=this.dataList[i];r.put(o.mode,4),r.put(o.getLength(),hl.getLengthInBits(o.mode,e)),o.write(r)}if(r.getLengthInBits()<=n*8)break}this.typeNumber=e}this.makeImpl(!1,this.getBestMaskPattern())};Vi.makeImpl=function(e,t){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=as.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)};Vi.setupPositionProbePattern=function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)};Vi.getBestMaskPattern=function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=hl.getLostPoint(this);(r==0||e>n)&&(e=n,t=r)}return t};Vi.createMovieClip=function(e,t,r){var n=e.createEmptyMovieClip(t,r),i=1;this.make();for(var o=0;o<this.modules.length;o++)for(var s=o*i,a=0;a<this.modules[o].length;a++){var l=a*i,d=this.modules[o][a];d&&(n.beginFill(0,100),n.moveTo(l,s),n.lineTo(l+i,s),n.lineTo(l+i,s+i),n.lineTo(l,s+i),n.endFill())}return n};Vi.setupTimingPattern=function(){for(var e=8;e<this.moduleCount-8;e++)this.modules[e][6]==null&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)};Vi.setupPositionAdjustPattern=function(){for(var e=hl.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var r=0;r<e.length;r++){var n=e[t],i=e[r];if(this.modules[n][i]==null)for(var o=-2;o<=2;o++)for(var s=-2;s<=2;s++)o==-2||o==2||s==-2||s==2||o==0&&s==0?this.modules[n+o][i+s]=!0:this.modules[n+o][i+s]=!1}};Vi.setupTypeNumber=function(e){for(var t=hl.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}};Vi.setupTypeInfo=function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=hl.getBCHTypeInfo(r),i=0;i<15;i++){var o=!e&&(n>>i&1)==1;i<6?this.modules[i][8]=o:i<8?this.modules[i+1][8]=o:this.modules[this.moduleCount-15+i][8]=o}for(var i=0;i<15;i++){var o=!e&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=o:i<9?this.modules[8][15-i-1+1]=o:this.modules[8][15-i-1]=o}this.modules[this.moduleCount-8][8]=!e};Vi.mapData=function(e,t){for(var r=-1,n=this.moduleCount-1,i=7,o=0,s=this.moduleCount-1;s>0;s-=2)for(s==6&&s--;;){for(var a=0;a<2;a++)if(this.modules[n][s-a]==null){var l=!1;o<e.length&&(l=(e[o]>>>i&1)==1);var d=hl.getMask(t,n,s-a);d&&(l=!l),this.modules[n][s-a]=l,i--,i==-1&&(o++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}};as.PAD0=236;as.PAD1=17;as.createData=function(e,t,r){for(var n=uL.getRSBlocks(e,t),i=new dL,o=0;o<r.length;o++){var s=r[o];i.put(s.mode,4),i.put(s.getLength(),hl.getLengthInBits(s.mode,e)),s.write(i)}for(var a=0,o=0;o<n.length;o++)a+=n[o].dataCount;if(i.getLengthInBits()>a*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+a*8+")");for(i.getLengthInBits()+4<=a*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=a*8||(i.put(as.PAD0,8),i.getLengthInBits()>=a*8));)i.put(as.PAD1,8);return as.createBytes(i,n)};as.createBytes=function(e,t){for(var r=0,n=0,i=0,o=new Array(t.length),s=new Array(t.length),a=0;a<t.length;a++){var l=t[a].dataCount,d=t[a].totalCount-l;n=Math.max(n,l),i=Math.max(i,d),o[a]=new Array(l);for(var u=0;u<o[a].length;u++)o[a][u]=255&e.buffer[u+r];r+=l;var h=hl.getErrorCorrectPolynomial(d),f=new Yme(o[a],h.getLength()-1),p=f.mod(h);s[a]=new Array(h.getLength()-1);for(var u=0;u<s[a].length;u++){var m=u+p.getLength()-s[a].length;s[a][u]=m>=0?p.get(m):0}}for(var g=0,u=0;u<t.length;u++)g+=t[u].totalCount;for(var y=new Array(g),b=0,u=0;u<n;u++)for(var a=0;a<t.length;a++)u<o[a].length&&(y[b++]=o[a][u]);for(var u=0;u<i;u++)for(var a=0;a<t.length;a++)u<s[a].length&&(y[b++]=s[a][u]);return y};var Zme=as,cx={};Object.defineProperty(cx,"__esModule",{value:!0});var Xme=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
185for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jme=LC,qi=fL(Jme),hL=v,s0=fL(hL);function fL(e){return e&&e.__esModule?e:{default:e}}function Qme(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}var ege={bgColor:qi.default.oneOfType([qi.default.object,qi.default.string]).isRequired,bgD:qi.default.string.isRequired,fgColor:qi.default.oneOfType([qi.default.object,qi.default.string]).isRequired,fgD:qi.default.string.isRequired,size:qi.default.number.isRequired,title:qi.default.string,viewBoxSize:qi.default.number.isRequired,xmlns:qi.default.string},tge={title:void 0,xmlns:"http://www.w3.org/2000/svg"},Ug=(0,hL.forwardRef)(function(e,t){var r=e.bgColor,n=e.bgD,i=e.fgD,o=e.fgColor,s=e.size,a=e.title,l=e.viewBoxSize,d=Qme(e,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize"]);return s0.default.createElement("svg",Xme({},d,{height:s,ref:t,viewBox:"0 0 "+l+" "+l,width:s}),a?s0.default.createElement("title",null,a):null,s0.default.createElement("path",{d:n,fill:r}),s0.default.createElement("path",{d:i,fill:o}))});Ug.displayName="QRCodeSvg";Ug.propTypes=ege;Ug.defaultProps=tge;cx.default=Ug;Object.defineProperty(ep,"__esModule",{value:!0});var pL=ep.QRCode=void 0,rge=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nge=Zme,ige=tp(nge),oge=sL,sge=tp(oge),age=LC,Ts=tp(age),mL=v,lge=tp(mL),cge=cx,uge=tp(cge);function tp(e){return e&&e.__esModule?e:{default:e}}function dge(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}var hge={bgColor:Ts.default.oneOfType([Ts.default.object,Ts.default.string]),fgColor:Ts.default.oneOfType([Ts.default.object,Ts.default.string]),level:Ts.default.string,size:Ts.default.number,value:Ts.default.string.isRequired},fge={bgColor:"#FFFFFF",fgColor:"#000000",level:"L",size:256},rp=(0,mL.forwardRef)(function(e,t){var r=e.bgColor,n=e.fgColor,i=e.level,o=e.size,s=e.value,a=dge(e,["bgColor","fgColor","level","size","value"]),l=new ige.default(-1,sge.default[i]);l.addData(s),l.make();var d=l.modules;return lge.default.createElement(uge.default,rge({},a,{bgColor:r,bgD:d.map(function(u,h){return u.map(function(f,p){return f?"":"M "+p+" "+h+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:n,fgD:d.map(function(u,h){return u.map(function(f,p){return f?"M "+p+" "+h+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:t,size:o,viewBoxSize:d.length}))});pL=ep.QRCode=rp;rp.displayName="QRCode";rp.propTypes=hge;rp.defaultProps=fge;var gL=ep.default=rp;const KCe=PM({__proto__:null,get QRCode(){return pL},default:gL},[ep]),rS=()=>new Promise(e=>{var s;const t=(s=document.getElementById("qr-code-container"))==null?void 0:s.querySelector("svg");if(!t)return e(null);const r=new XMLSerializer().serializeToString(t),n=document.createElement("canvas");n.width=360,n.height=360;const i=n.getContext("2d");if(!i)return e(null);const o=new Image;o.onload=()=>{i.fillStyle="white",i.fillRect(0,0,360,360),i.drawImage(o,0,0,360,360),e(n.toDataURL("image/png"))},o.onerror=()=>e(null),o.src="data:image/svg+xml;base64,"+btoa(r)}),nS=()=>{const{data:e,isLoading:t}=lo(),{storeUrl:r,isLoading:n}=Ng(),[i,o]=v.useState(!1),s=!!(e!=null&&e.slug_loja),a=At(),{isSharing:l,runShare:d}=eS(),{isSharing:u,runShare:h}=eS(),f=t||n,p=r,g=!v.useMemo(()=>e!=null&&e.slug_loja?s_(e.slug_loja):{isValid:!0},[e==null?void 0:e.slug_loja]).isValid,y=()=>{a("/profile/web-catalog")},b=()=>d(()=>Ume({url:p,title:"Compartilhar loja"}));return f?c.jsxs(F,{sx:{borderRadius:"14px",bgcolor:"primary.main",p:2.5},children:[c.jsx(Lt,{variant:"text",width:"70%",height:22,sx:{bgcolor:"rgba(255,255,255,0.15)"}}),c.jsx(Lt,{variant:"rounded",width:"100%",height:48,sx:{mt:1.5,bgcolor:"rgba(255,255,255,0.1)"}})]}):s?c.jsxs(c.Fragment,{children:[c.jsxs(F,{sx:{borderRadius:"14px",bgcolor:"primary.main",p:2.5},children:[c.jsx(V,{sx:{fontSize:"0.9rem",fontWeight:700,color:"white",lineHeight:1.25,mb:.25},children:"Compartilhe com seus clientes"}),c.jsx(V,{sx:{fontSize:"0.75rem",fontWeight:500,color:"rgba(255,255,255,0.6)",mb:1.25},children:"Esse é o link da sua loja"}),c.jsxs(F,{sx:{display:"flex",alignItems:"center",gap:.5,p:1,pl:1.5,borderRadius:"10px",bgcolor:"rgba(0,0,0,0.15)",mb:1.5},children:[g&&c.jsx(Qj,{sx:{color:"rgba(255,255,255,0.8)",fontSize:16,flexShrink:0}}),c.jsx(V,{component:"a",href:p,target:"_blank",rel:"noopener noreferrer",sx:{flex:1,fontSize:"0.85rem",fontWeight:600,color:"white",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textDecoration:"none"},children:p}),c.jsx(vme,{text:p,sx:{color:"rgba(255,255,255,0.7)"}})]}),c.jsxs(me,{direction:"row",spacing:1,children:[c.jsx(De,{onClick:b,disabled:l,startIcon:c.jsx(X7,{size:18}),sx:{flex:1,bgcolor:"white",color:"primary.main",fontWeight:600,fontSize:"0.8rem",py:1,borderRadius:"10px",textTransform:"none","&:hover":{bgcolor:"rgba(255,255,255,0.9)"},"&:active":{transform:"scale(0.97)"}},children:"Compartilhar"}),c.jsx(De,{onClick:()=>o(!0),startIcon:c.jsx(Tme,{size:18}),sx:{flex:1,bgcolor:"rgba(255,255,255,0.15)",color:"white",fontWeight:600,fontSize:"0.8rem",py:1,borderRadius:"10px",textTransform:"none","&:hover":{bgcolor:"rgba(255,255,255,0.22)"},"&:active":{transform:"scale(0.97)"}},children:"QR Code"})]}),g&&c.jsxs(zn,{severity:"error",variant:"filled",sx:{mt:2},action:c.jsx(De,{color:"inherit",size:"small",onClick:y,sx:{fontWeight:600},children:"Alterar"}),children:[c.jsx(Q0,{children:"Link inválido"}),"Por favor escolha um link mais especÃfico para sua loja."]})]}),c.jsxs(Fr,{open:i,onClose:()=>o(!1),children:[c.jsx(zr,{children:"QR Code da sua loja"}),c.jsxs(Er,{children:[c.jsx(V,{variant:"body2",color:"text.secondary",sx:{mb:3},children:"Escaneie o código para acessar a loja"}
185),c.jsx(F,{id:"qr-code-container",sx:{display:"flex",justifyContent:"center",mb:2},children:c.jsx(gL,{value:p,size:180})}),c.jsx(V,{sx:{fontSize:"0.75rem",fontWeight:600,color:"primary.main",wordBreak:"break-all",textAlign:"center"},children:p})]}),c.jsxs(nn,{children:[!qe.isNativePlatform()&&c.jsx(De,{onClick:async()=>{const E=await rS();if(!E)return;const S=document.createElement("a");S.download="qrcode-loja.png",S.href=E,S.click()},startIcon:c.jsx(bme,{size:20}),children:"Salvar"}),c.jsx(De,{onClick:()=>h(async()=>{const E=await rS();E&&await Bme({dataUrl:E,fileName:`qrcode-loja-${Date.now()}.png`,text:p,url:p,title:"QR Code da minha loja"})}),disabled:u,variant:"contained",startIcon:c.jsx(X7,{size:16}),children:"Compartilhar"})]})]})]}):c.jsxs(F,{sx:{borderRadius:"14px",bgcolor:"primary.main",p:2.5,cursor:"pointer",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)","&:active":{transform:"scale(0.97)"}},onClick:y,children:[c.jsx(V,{sx:{fontSize:"0.9rem",fontWeight:700,color:"white",lineHeight:1.25,mb:.25},children:"Crie o link da sua loja"}),c.jsx(V,{sx:{fontSize:"0.75rem",fontWeight:500,color:"rgba(255,255,255,0.6)",mb:1.25},children:"Configure para compartilhar seu catálogo e receber pedidos"}),c.jsx(F,{sx:{p:1.25,borderRadius:"10px",bgcolor:"rgba(0,0,0,0.15)"},children:c.jsx(V,{sx:{fontSize:"0.85rem",fontWeight:600,color:"rgba(255,255,255,0.4)"},children:"https://sualoja.stoqui.shop"})})]})};var ux={},pge=zt;Object.defineProperty(ux,"__esModule",{value:!0});var Bg=ux.default=void 0,mge=pge(Wt()),gge=c;Bg=ux.default=(0,mge.default)((0,gge.jsx)("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"}),"Person");const iS=[["#1abc9c","#ffffff"],["#2ecc71","#ffffff"],["#3498db","#ffffff"],["#9b59b6","#ffffff"],["#34495e","#ffffff"],["#16a085","#ffffff"],["#27ae60","#ffffff"],["#2980b9","#ffffff"],["#8e44ad","#ffffff"],["#2c3e50","#ffffff"],["#f1c40f","#ffffff"],["#e67e22","#ffffff"],["#e74c3c","#ffffff"],["#ecf0f1","#2c3e50"],["#95a5a6","#ffffff"],["#f39c12","#ffffff"],["#d35400","#ffffff"],["#c0392b","#ffffff"],["#bdc3c7","#2c3e50"],["#7f8c8d","#ffffff"]];function vge(e){const t=e.split("").reduce((r,n)=>r+n.charCodeAt(0),0);return iS[t%iS.length]}function yge(e){if(!e)return{sx:{bgcolor:"#bdc3c7",color:"#2c3e50",fontWeight:500},children:c.jsx(Bg,{})};e=e.trim();const[t,r]=vge(e);return e.split(" ").length<2?{children:`${e[0]}`,sx:{bgcolor:t,color:r,fontWeight:500}}:{children:`${e.split(" ")[0][0]}${e.split(" ")[e.split(" ").length-1][0]}`,sx:{bgcolor:t,color:r,fontWeight:500}}}function _ge(e){const{alt:t="",src:r,sx:n,...i}=e,o=yge(t);return r?c.jsxs(F,{...i,sx:{position:"relative",borderRadius:"50%",overflow:"hidden",width:40,height:40,...n},children:[c.jsx("img",{src:r,alt:"",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",filter:"blur(8px)",transform:"scale(1.1)"}}),c.jsx("img",{src:r,alt:t,style:{position:"relative",width:"100%",height:"100%",objectFit:"contain",zIndex:1}})]}):c.jsx(Dh,{...i,...o,sx:{...n,...o.sx}})}const bge=async e=>{if(!e)throw new Error("User must be logged in to fetch notifications.");const{data:t,error:r}=await Te.from("notificacao").select("id, lido, grupo_id").limit(200).eq("user_id",e).eq("lido",!1);if(r)throw new Error(r.message);let n=0;const i=new Set;return t.forEach(o=>{o.grupo_id?i.has(o.grupo_id)||(i.add(o.grupo_id),n++):n++}),n},xge=()=>{const{user:e}=ot(),t=e==null?void 0:e.id;return Et({queryKey:["unreadNotificationCount"],queryFn:()=>bge(t),enabled:!!t})},wge=async e=>{if(!e)throw new Error("User is not authenticated");const{count:t,error:r}=await Te.from("conversa_cliente_view").select("*",{count:"exact",head:!0}).eq("vendedor_id",e).gt("nao_lidas",0);if(r)throw new Error(r.message);return t||0},Ege=()=>{const{user:e}=ot(),t=e==null?void 0:e.id;return Et({queryKey:["unreadConversationsCount"],queryFn:()=>wge(t),enabled:!!t})},Sge=async e=>{var d,u;const{startDate:t,endDate:r}=e,n=t.toISOString(),i=r.toISOString(),o=await Io.get("/reports/basic/v2",{params:{startDate:n,endDate:i}});if(o.status&&o.status!==200)throw new Error(((d=o.data)==null?void 0:d.error)||((u=o.data)==null?void 0:u.message)||"Failed to fetch report metrics");const s=o.data;if(!s||typeof s!="object")throw new Error("Invalid response data format");const a=["kpis","ordersVolumeChart","revenueChart","profitChart","salesDistribution"];for(const h of a)h in s||console.warn(`Missing required property: ${h}`);return["ordersVolumeChart","revenueChart","profitChart"].forEach(h=>{if(s[h]&&typeof s[h]=="object"){const f=s[h];
185f.series&&Array.isArray(f.series)&&f.series.forEach((p,m)=>{if(!p||typeof p!="object"){console.warn(`Invalid series data at ${h}[${m}]`);return}Array.isArray(p.data)?p.data=p.data.filter(g=>{if(!g||typeof g!="object")return console.warn(`Invalid data point in ${h}[${m}]:`,g),!1;const{x:y,y:b}=g;if(typeof y!="string"||y.trim()==="")return console.warn(`Invalid x value in ${h}[${m}]:`,y),!1;const E=typeof b=="number"?b:parseFloat(b);return Number.isFinite(E)?!0:(console.warn(`Invalid y value in ${h}[${m}]:`,b),!1)}):(console.warn(`Invalid series.data at ${h}[${m}] - expected array`),p.data=[])})}}),s},Cge=e=>{const t=e?{startDate:e.startDate.toISOString(),endDate:e.endDate.toISOString()}:void 0;return Et({queryKey:["report-metrics",t],refetchOnMount:!0,queryFn:()=>{if(!e)return Promise.reject(new Error("Params are required for report metrics."));const r={startDate:new Date(e.startDate),endDate:new Date(e.endDate)};return Sge(r)},enabled:!!e})},Tge=async e=>{var d,u;const{startDate:t,endDate:r}=e,n=h=>{const f=h.getFullYear(),p=String(h.getMonth()+1).padStart(2,"0"),m=String(h.getDate()).padStart(2,"0");return`${f}-${p}-${m}`},i=n(t),o=n(r),s=await Io.get("/reports/analytics",{params:{startDate:i,endDate:o}});if(s.status&&s.status!==200)throw new Error(((d=s.data)==null?void 0:d.error)||((u=s.data)==null?void 0:u.message)||"Failed to fetch analytics data");const a=s.data;if(!a||typeof a!="object")throw new Error("Invalid response data format");const l=["kpis","uniqueVisitorsChart","pageViewsChart","environment"];for(const h of l)h in a||console.warn(`Missing required property: ${h}`);return a},Age=e=>{const t=e?{startDate:e.startDate.toISOString(),endDate:e.endDate.toISOString()}:void 0;return Et({queryKey:["analytics",t],refetchOnMount:!0,queryFn:()=>
185{if(!e)return Promise.reject(new Error("Params are required for analytics data."));const r={startDate:new Date(e.startDate),endDate:new Date(e.endDate)};return Tge(r)},enabled:!!e})};function oS(e){const t=new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL",minimumFractionDigits:2,maximumFractionDigits:2}),r=new Intl.NumberFormat("en",{notation:"compact",compactDisplay:"short",maximumFractionDigits:1});return e<1e3?t.format(e):`R$ ${r.format(e).replace(".",",")}`}var dx={},kge=zt;Object.defineProperty(dx,"__esModule",{value:!0});var vL=dx.default=void 0,Rge=kge(Wt()),Ige=c;vL=dx.default=(0,Rge.default)((0,Ige.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2M9 8V6c0-1.66 1.34-3 3-3s3 1.34 3 3v2z"}),"LockRounded");var hx={},Pge=zt;Object.defineProperty(hx,"__esModule",{value:!0});var Oo=hx.default=void 0,Oge=Pge(Wt()),jge=c;Oo=hx.default=(0,Oge.default)((0,jge.jsx)("path",{d:"M9.29 6.71c-.39.39-.39 1.02 0 1.41L13.17 12l-3.88 3.88c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0l4.59-4.59c.39-.39.39-1.02 0-1.41L10.7 6.7c-.38-.38-1.02-.38-1.41.01"}),"ChevronRightRounded");var fx={},Lge=zt;Object.defineProperty(fx,"__esModule",{value:!0});var px=fx.default=void 0,$ge=Lge(Wt()),Dge=c;px=fx.default=(0,$ge.default)((0,Dge.jsx)("path",{d:"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward");const an=()=>{const{user:e}=ot(),t=e==null?void 0:e.id;return Et({queryKey:["subscription"],queryFn:async()=>{if(!e)return null;try{return(await Io("/revenuecat/update",{method:"GET"})).data.subscription}catch(r){if((r==null?void 0:r.status)===404)return null;throw r}},staleTime:60*1e3,refetchOnWindowFocus:!1,retry:2,enabled:!!t})},qu={free:0,lite:1,pro:2,black:3},Qn={lite:{products:250,categories:20,manualSales:100,onlineSales:1/0,imagesPerProduct:5,aiDescriptions:50,customPaymentMethods:1,customPages:0,monthlyCredits:100},pro:{products:1/0,categories:1/0,manualSales:1/0,onlineSales:1/0,imagesPerProduct:10,aiDescriptions:1/0,customPaymentMethods:1/0,customPages:2,monthlyCredits:200},black:{products:1/0,categories:1/0,manualSales:1/0,onlineSales:1/0,imagesPerProduct:20,aiDescriptions:1/0,customPaymentMethods:1/0,customPages:10,monthlyCredits:400},free:{products:50,categories:10,manualSales:10,onlineSales:1/0,imagesPerProduct:1,aiDescriptions:5,customPaymentMethods:1,customPages:0,monthlyCredits:0}};function np(e){return e!=null&&e.gives_access?e.plan:"free"}function vd(e,t){const r=np(e);return qu[r]>=qu[t]}function yL(e){return vd(e,"lite")}function Hn(e){return vd(e,"pro")}function Mge(e){return vd(e,"black")}const Nge={whatsappSupport:"lite",pixParcelado:"lite",melhorEnvio:"lite",storePickup:"lite",productAttributes:"lite",pixChaveCheckout:"pro",fiadoParcelado:"pro",customPaymentMethods:"pro",pagamentoNaEntrega:"pro",printing:"pro",promotions:"pro",advancedReports:"pro",profitabilityAnalysis:"pro",marketingAnalytics:"pro",bulkImport:"pro",barcodeScanner:"pro",customPages:"pro",bulkPriceChange:"pro",produtosDigitais:"pro",precoSobConsulta:"pro",customerReviews:"pro",customDomain:"black",customLogo:"black",customFavicon:"black",expertConsultation:"black",prioritySupport:"black",featuredStore:"black",priceTables:"black",notaFiscal:"black"};function YCe(e,t){const r=Nge[t];return vd(e,r)}function ZCe(e,t){return qu[e]>=qu[t]}function XCe(e){return!!(e!=null&&e.gives_access)}function JCe(e){return(e==null?void 0:e.status)==="trialing"}function Fge(e){switch(np(e)){case"free":return Qn.free.imagesPerProduct;case"lite":return Qn.lite.imagesPerProduct;case"pro":return Qn.pro.imagesPerProduct;case"black":return Qn.black.imagesPerProduct;default:return Qn.free.imagesPerProduct}}function QCe(e,t=0){const r=Fge(e);return t<r}function eTe(e,t){return e==="free"||e==="lite"?"Páginas de conteúdo estão disponÃveis no plano PRO (2 páginas) ou BLACK (10 páginas). Faça upgrade para criar páginas como polÃtica de privacidade, termos de uso, sobre nós, etc.":e==="pro"?`O plano PRO permite apenas 2 páginas de conteúdo. Você já criou ${t}. Faça upgrade para o plano BLACK para ter até 10 páginas de conteúdo.`:"Você atingiu o limite de páginas de conteúdo para seu plano."}const sS={products_limit:{plan:"lite",kind:"limit",icon:Fs,featureLabel:"Mais produtos",headline:"Sua loja está crescendo",benefit:"Você chegou ao limite de produtos do seu plano. Continue cadastrando e deixe o catálogo completo.",unlockNote:"250 produtos no LITE, ilimitados no PRO"},product_visibility_limit:{plan:"lite",kind:"limit",icon:w1e,featureLabel:"Todos os produtos visÃveis",headline:"Tem produto seu escondido",benefit:"Produtos acima do limite do plano ficam inv
185isÃveis para seus clientes. Libere e volte a vender todos.",unlockNote:"250 visÃveis no LITE, todos no PRO"},product_photos_limit:{plan:"lite",kind:"limit",icon:Ov,featureLabel:"Mais fotos por produto",headline:"Produto com mais fotos vende mais",benefit:"Mostre todos os ângulos, detalhes e variações de cada produto.",unlockNote:"5 fotos no LITE, 10 no PRO e 20 no BLACK"},product_images_view:{plan:"lite",kind:"limit",icon:Ov,featureLabel:"Todas as fotos visÃveis",headline:"Algumas fotos não estão aparecendo",benefit:"Fotos acima do limite do plano ficam ocultas na loja. Libere e mostre o produto por inteiro.",unlockNote:"5 fotos no LITE, 10 no PRO e 20 no BLACK"},promo_price:{plan:"lite",kind:"feature",icon:F7,featureLabel:"Preço promocional",headline:"Coloque seus produtos em promoção",benefit:"O preço antigo aparece riscado ao lado do novo, e a etiqueta de desconto chama o clique."},price_on_request:{plan:"pro",kind:"feature",icon:D1e,featureLabel:"Preço sob consulta",headline:"Venda no seu ritmo",benefit:"Esconda o preço e receba o contato do cliente no WhatsApp para negociar direto."},product_video:{plan:"pro",kind:"feature",icon:q1e,featureLabel:"VÃdeo no produto",headline:"Deixe o produto em movimento",benefit:"Adicione um vÃdeo do YouTube na página do produto e mostre ele em uso."},digital_product:{plan:"pro",kind:"feature",icon:B7,featureLabel:"Produtos digitais",headline:"Venda e entregue na hora",benefit:"Arquivos, códigos e links entregues automaticamente assim que o pagamento é confirmado."},combos:{plan:"pro",kind:"feature",icon:S1e,featureLabel:"Combos de produtos",headline:"Venda combos de produtos",benefit:"Monte kits com produtos do seu catálogo e venda por um preço especial. O estoque do combo acompanha o dos componentes."},personalization:{plan:"pro",kind:"feature",icon:F1e,featureLabel:"Personalização de produtos",headline:"Produtos do jeito que o cliente pedir",benefit:"Campos de texto, opções e fotos para o cliente montar o produto dele no pedido."},variations:{plan:"lite",kind:"feature",icon:P1e,featureLabel:"Variações de produto",headline:"Um produto, todas as opções",benefit:"Tamanhos, cores e modelos no mesmo produto, cada um com seu preço e estoque."},product_grid:{plan:"lite",kind:"feature",icon:O1e,featureLabel:"Grade de produtos",headline:"Monte sua grade de uma vez",benefit:"Combine cores e tamanhos automaticamente e gere todas as variações em segundos."},variation_image:{plan:"pro",kind:"feature",icon:A1e,featureLabel:"Foto por variação",headline:"Cada cor com a sua foto",benefit:"O cliente escolhe a variação e vê exatamente o que vai receber."},variation_promo_price:{plan:"lite",kind:"feature",icon:F7,featureLabel:"Preço promocional",headline:"Promoção na variação certa",benefit:"Dê desconto só nas variações que você quer queimar, com o preço antigo riscado."},ai_descriptions_limit:{plan:"lite",kind:"limit",icon:H7,featureLabel:"Mais descrições com IA",headline:"Descrições prontas em segundos",benefit:"Você usou todas as descrições com IA do seu plano. Libere mais e cadastre sem digitar.",unlockNote:"50 por mês no LITE, ilimitadas no PRO"},bulk_price_change:{plan:"pro",kind:"feature",icon:U1e,featureLabel:"Alteração de preços em lote",headline:"Reajuste tudo de uma vez",benefit:"Aumente ou reduza os preços de vários produtos juntos, por valor ou porcentagem."},product_margin:{plan:"pro",kind:"feature",icon:_a,featureLabel:"Margem e lucratividade",headline:"Saiba quanto você lucra de verdade",benefit:"Veja a margem de cada produto e descubra onde está o seu lucro."},product_fiscal:{plan:"black",kind:"feature",icon:Aa,featureLabel:"Nota fiscal",headline:"Emita nota fiscal direto do app",benefit:"NF-e e NFC-e emitidas na hora da venda, sem sistema separado e sem contador no meio."},manual_orders_limit:{plan:"lite",kind:"limit",icon:z1e,featureLabel:"Mais vendas presenciais",headline:"Você vendeu muito este mês",benefit:"Chegou ao limite de vendas presenciais do plano. Libere e registre quantas quiser.",unlockNote:"100 por mês no LITE, ilimitadas no PRO"},order_filters_status:{plan:"lite",kind:"feature",icon:L1e,featureLabel:"Filtros avançados",headline:"Ache qualquer pedido em segundos",benefit:"Filtre por status e condição de pagamento e veja só o que importa agora."},order_filters_date:{plan:"pro",kind:"feature",icon:U7,featureLabel:"Filtros por data",headline:"Seus pedidos, perÃodo a perÃodo",benefit:"Compare semanas, feche o mês e encontre pedidos por qualquer intervalo de datas."},bulk_print:{plan:"black",kind:"feature",icon:jv,featureLabel:"Impressão em massa",headline:"Imprima todos os pedidos de uma vez",benefit:"Selecione vários pedidos e gere os comprovantes juntos, prontos para despachar."}
185,orders_export:{plan:"pro",kind:"feature",icon:Aa,featureLabel:"Exportar relatório de pedidos",headline:"Seus pedidos em planilha ou PDF",benefit:"Exporte a lista filtrada para fechar caixa, conferir com o contador ou arquivar."},barcode_scanner:{plan:"pro",kind:"feature",icon:H1e,featureLabel:"Leitor de código de barras",headline:"Venda na velocidade do balcão",benefit:"Escaneie o código de barras e o produto entra no pedido na hora."},cart_import:{plan:"pro",kind:"feature",icon:$v,featureLabel:"Checkout rápido via WhatsApp",headline:"Do WhatsApp para o pedido em um toque",benefit:"Importe o carrinho que o cliente montou na loja e feche a venda sem redigitar nada."},contacts_import:{plan:"pro",kind:"feature",icon:G7,featureLabel:"Importação de contatos",headline:"Seus clientes já estão no seu celular",benefit:"Puxe o cliente direto da agenda do telefone e monte sua base sem digitar."},payment_installments:{plan:"pro",kind:"feature",icon:x1e,featureLabel:"Pagamento parcelado",headline:"Seu cliente parcela, você controla",benefit:"Registre o parcelamento do cliente e acompanhe cada parcela até o pagamento completo."},payment_fiado:{plan:"pro",kind:"feature",icon:M1e,featureLabel:"Fiado",headline:"O caderninho, só que organizado",benefit:"Venda fiado com controle de quem deve, quanto e quando, sem depender da memória."},custom_payment_methods:{plan:"pro",kind:"limit",icon:Lv,featureLabel:"Formas de pagamento personalizadas",headline:"Aceite do jeito que seu cliente paga",benefit:"Crie quantas formas de pagamento quiser, do vale alimentação ao crediário próprio.",unlockNote:"Ilimitadas no PRO"},order_receipt:{plan:"pro",kind:"feature",icon:V1e,featureLabel:"Comprovante em PDF",headline:"Comprovante profissional no WhatsApp",benefit:"Gere o PDF do pedido e envie para o cliente com a cara da sua loja."},order_print:{plan:"pro",kind:"feature",icon:jv,featureLabel:"Impressão de pedidos",headline:"Do pedido para a impressora",benefit:"Comprovantes térmicos, etiquetas e declaração de conteúdo prontos para imprimir."},print_thermal:{plan:"pro",kind:"feature",icon:jv,featureLabel:"Impressão térmica",headline:"Comprovante impresso na hora",benefit:"Imprima o comprovante na impressora térmica e entregue junto com o pedido."},print_shipping_label:{plan:"pro",kind:"feature",icon:Vd,featureLabel:"Etiquetas de entrega",headline:"Etiqueta pronta para colar na caixa",benefit:"Gere a etiqueta do pedido já com o endereço e os dados do cliente, pronta para imprimir."},print_declaracao:{plan:"pro",kind:"feature",icon:Aa,featureLabel:"Declaração de conteúdo",headline:"Declaração de conteúdo sem retrabalho",benefit:"A declaração exigida pelos Correios sai preenchida com os dados do pedido."},superfrete_label:{plan:"lite",kind:"feature",icon:Vd,featureLabel:"Etiquetas com frete barato",headline:"Frete com até 80% de desconto",benefit:"Gere a etiqueta na hora e pague muito menos pelo envio via SuperFrete."},fiscal_menu:{plan:"black",kind:"feature",icon:Aa,featureLabel:"Nota fiscal",headline:"Emita nota fiscal direto do app",benefit:"NF-e e NFC-e emitidas na hora da venda, sem sistema separado e sem complicação."},shipping_config:{plan:"lite",kind:"feature",icon:Vd,featureLabel:"Frete com desconto",headline:"Envie mais barato que no balcão",benefit:"SuperFrete, Melhor Envio e Uber com etiquetas geradas direto do pedido."},shipping_superfrete:{plan:"lite",kind:"feature",icon:Vd,featureLabel:"SuperFrete",headline:"Frete até 80% mais barato",benefit:"Conecte a SuperFrete e gere etiquetas com desconto direto do pedido."},shipping_melhor_envio:{plan:"lite",kind:"feature",icon:Vd,featureLabel:"Melhor Envio",headline:"Compare fretes e pague menos",benefit:"Conecte o Melhor Envio, compare transportadoras e gere etiquetas com desconto."},shipping_uber:{plan:"lite",kind:"feature",icon:$v,featureLabel:"Uber Direct",headline:"Entrega na mesma hora com a Uber",benefit:"Chame um entregador Uber direto do pedido e entregue no mesmo dia."},store_pickup:{plan:"lite",kind:"feature",icon:W7,featureLabel:"Retirada na loja",headline:"Cliente busca, você não paga frete",benefit:"Configure endereço, horários e instruções para retirada no balcão."},pix_checkout:{plan:"pro",kind:"feature",icon:$v,featureLabel:"Pix direto no checkout",headline:"Pix cai direto na sua conta",benefit:"Sua chave Pix no checkout da loja, sem intermediário e sem taxa por venda."},pagaleve:{plan:"lite",kind:"feature",icon:Lv,featureLabel:"Pix 4x
185sem juros",headline:"Pix parcelado para seus clientes",benefit:"O cliente parcela no Pix em até 4x sem juros e você recebe à vista."},pay_on_delivery:{plan:"pro",kind:"feature",icon:b1e,featureLabel:"Pagamento na entrega",headline:"Seu cliente paga na entrega",benefit:"Ofereça pagamento na entrega e destrave os clientes que não pagam online."},custom_domain:{plan:"black",kind:"feature",icon:C1e,featureLabel:"DomÃnio próprio",headline:"Sua loja com o seu endereço",benefit:"www.sualoja.com.br incluso no plano, com a marca da sua loja em todo lugar."},content_pages:{plan:"pro",kind:"limit",icon:Aa,featureLabel:"Páginas de conteúdo",headline:"Sua loja com cara de site grande",benefit:"Crie páginas de polÃtica, trocas e sobre a loja para passar confiança na compra.",unlockNote:"2 páginas no PRO, 10 no BLACK"},checkout_settings:{plan:"pro",kind:"feature",icon:V7,featureLabel:"Checkout configurável",headline:"O checkout do seu jeito",benefit:"Pedido mÃnimo, checkout via WhatsApp e controle dos dados pedidos na finalização."},stock_display:{plan:"pro",kind:"feature",icon:Fs,featureLabel:"Exibição de esgotados",headline:"Esgotou? Você decide o que aparece",benefit:"Esconda produtos esgotados ou mostre como indisponÃveis, do jeito que vende mais."},pixels:{plan:"pro",kind:"feature",icon:c_,featureLabel:"Pixels de anúncios",headline:"Anuncie com mira",benefit:"Pixel do Facebook, Google e TikTok na loja para rastrear e otimizar suas campanhas."},google_shopping:{plan:"black",kind:"feature",icon:W7,featureLabel:"Google Shopping",headline:"Seus produtos no Google",benefit:"Catálogo integrado ao Google Merchant Center, aparecendo para quem busca."},instagram_shopping:{plan:"black",kind:"feature",icon:I1e,featureLabel:"Sacolinha do Instagram",headline:"Venda dentro do Instagram",benefit:"Marque produtos nos posts e stories e leve o seguidor direto para o checkout."},email_notifications:{plan:"black",kind:"feature",icon:$1e,featureLabel:"Emails automáticos",headline:"Seu cliente informado sem você digitar",benefit:"Confirmação de pedido e aviso de envio por email, automáticos e com sua marca."},store_font:{plan:"pro",kind:"feature",icon:N1e,featureLabel:"Fonte personalizada",headline:"A letra da sua marca",benefit:"Escolha a tipografia da loja e deixe tudo com a identidade do seu negócio."},favicon:{plan:"black",kind:"feature",icon:z7,featureLabel:"Favicon personalizado",headline:"Seu Ãcone na aba do navegador",benefit:"Troque o Ãcone padrão pelo seu logo e pareça grande em cada detalhe."},promo_strip:{plan:"pro",kind:"feature",icon:c_,featureLabel:"Faixa promocional",headline:"Seu aviso no topo da loja",benefit:"Frete grátis, cupom ou novidade anunciados em destaque para todo visitante."},store_banners:{plan:"pro",kind:"feature",icon:Ov,featureLabel:"Banners na loja",headline:"Sua loja muda com a campanha",benefit:"Banners rotativos na home da loja para destacar lançamentos e promoções."},home_layout:{plan:"pro",kind:"feature",icon:j1e,featureLabel:"Página inicial personalizada",headline:"Uma loja, não só uma lista",benefit:"Monte a página inicial com categorias, vitrines de produtos, banners e vantagens."},chrome_colors:{plan:"pro",kind:"feature",icon:qj,featureLabel:"Cores do cabeçalho e rodapé",headline:"A loja com a sua cor de ponta a ponta",benefit:"Escolha a cor do cabeçalho e do rodapé da loja. Texto e Ãcones se ajustam sozinhos."},category_media:{plan:"pro",kind:"feature",icon:k1e,featureLabel:"Imagem e banner da categoria",headline:"Cada categoria com a sua cara",benefit:"Imagem na página inicial e banner próprio no topo de cada categoria."},footer_text:{plan:"lite",kind:"feature",icon:Aa,featureLabel:"Rodapé personalizado",headline:"Rodapé que passa confiança",benefit:"CNPJ, endereço e recados visÃveis deixam sua loja mais profissional para quem compra."},coupons:{plan:"pro",kind:"feature",icon:q7,featureLabel:"Cupons de desconto",headline:"Cupom que traz o cliente de volta",benefit:"Crie cupons por valor, porcentagem ou frete grátis e espalhe onde quiser."},abandoned_carts:{plan:"black",kind:"feature",icon:V7,featureLabel:"Recuperação de carrinhos",headline:"Tem venda esperando você",benefit:"Veja quem montou o carrinho e não fechou, e chame no WhatsApp para recuperar a venda."},reviews:{plan:"pro",kind:"feature",icon:z7,featureLabel:"Avaliações de clientes",headline:"Deixe seus clientes venderem por você",benefit:"Colete avaliações com foto e mostre na página do produto para gerar confiança."},reports:{plan:"pro",kind:"feature",icon:_a,featureLabel:"Relatórios completos",headline:"Seu negócio em números",benefit:"Lucratividade, visitas, ticket médio e mais vendidos para decidir com dados."},analytics_advanced:{plan:"black",kind:"feature",icon:_a,featureLabel:"Analytics avançado",headline:"Veja o que seus visitantes fazem",benefit:"Produtos mais visitados, adições ao carrinho e de onde vêm seus clientes."},store_analytics:{plan:"pro",kind:"feature",icon:_a,featureLabel:"Analytics da loja",headline:"Veja quem visita sua loja",benefit:"Acompanhe as visitas e as páginas mais vistas da sua loja, direto no app."},profitability_order:{plan:"pro",kind:"feature",icon:_a,featureLabel:"Lucro por pedido",headline:"Quanto sobrou dessa venda?",benefit:"Veja custo, margem e lucro de cada pedido, na hora que ele acontece."},profitability_product:{plan:"pro",kind:"feature",icon:_a,featureLabel:"Lucro por produto",headline:"Descubra seus produtos campeões",benefit:"Margem e lucro por produto para saber o que empurrar e o que repensar."},profitability_variation:{plan:"pro",kind:"feature",icon:_a,featureLabel:"Lucro por variação",headline:"A variação que dá mais lucro",benefit:"Compare margens entre cores e tamanhos e aposte no que rende mais."},stock_report:{plan:"pro",kind:"feature",icon:Fs,featureLabel:"Relatório de estoque",headline:"Seu estoque em uma planilha",benefit:"Baixe o relatório completo de estoque para conferência e inventário."},home_metric:{plan:"pro",kind:"feature",icon:_a,featureLabel:"Métricas da loja",headline:"Seus números, sem achismo",benefit:"Acompanhe faturamento, visitas e conversão direto da tela inicial."},contas_a_pagar:{plan:"pro",kind:"feature",icon:B1e,featureLabel:"Contas a pagar",headline:"Suas contas sem sustos",benefit:"Boletos, despesas e fluxo de caixa organizados, com aviso antes do vencimento."},receivables_filters:{plan:"pro",kind:"feature",icon:U7,featureLabel:"Filtros por data",headline:"O que entra, perÃodo a perÃodo",benefit:"Filtre o contas a receber por data e saiba exatamente o que c
185ai quando."},bulk_import_products:{plan:"pro",kind:"feature",icon:Fs,featureLabel:"Importação de produtos",headline:"Catálogo inteiro em minutos",benefit:"Suba centenas de produtos de uma vez com uma planilha simples."},bulk_import_customers:{plan:"pro",kind:"feature",icon:G7,featureLabel:"Importação de clientes",headline:"Sua base de clientes de uma vez",benefit:"Importe seus clientes por planilha e comece com o histórico completo."},customers_export:{plan:"pro",kind:"feature",icon:B7,featureLabel:"Exportar clientes",headline:"Sua base de clientes em planilha",benefit:"Baixe a lista filtrada em CSV, no mesmo formato da importação, para usar em outras ferramentas ou guardar uma cópia."},catalog_pdf:{plan:"pro",kind:"feature",icon:Aa,featureLabel:"Catálogo em PDF",headline:"Seu catálogo pronto para o WhatsApp",benefit:"Gere um PDF bonito com seus produtos e preços e envie para qualquer cliente."},product_labels:{plan:"pro",kind:"feature",icon:q7,featureLabel:"Etiquetas de produtos",headline:"Etiquetas com código de barras",benefit:"Imprima etiquetas de preço e código de barras para organizar sua operação."},price_tables:{plan:"black",kind:"feature",icon:W1e,featureLabel:"Tabelas de preço",headline:"Atacado e varejo na mesma loja",benefit:"Preços diferentes por tipo de cliente, com a tabela certa para cada um."},image_credits:{plan:"lite",kind:"limit",icon:H7,featureLabel:"Créditos do Image Studio",headline:"Seus créditos de imagem acabaram",benefit:"Libere mais créditos por mês e continue criando fotos profissionais sem estúdio.",unlockNote:"100 créditos por mês no LITE, 200 no PRO e 400 no BLACK"},plan_home_card:{plan:"pro",kind:"generic",icon:zc,featureLabel:"Todos os recursos",headline:"Sua loja completa, sem limites",benefit:"Produtos ilimitados, cupons, relatórios e nota fiscal. Escolha o plano e destrave agora."},upgrade_cta:{plan:"pro",kind:"generic",icon:zc,featureLabel:"Todos os recursos",headline:"Sua loja completa, sem limites",benefit:"Produtos ilimitados, cupons, relatórios e nota fiscal. Escolha o plano e destrave agora."},menu:{plan:"pro",kind:"generic",icon:zc,featureLabel:"Todos os recursos",headline:"Sua loja completa, sem limites",benefit:"Produtos ilimitados, cupons, relatórios e nota fiscal. Escolha o plano e destrave agora."},subscription:{plan:"pro",kind:"generic",icon:zc,featureLabel:"Todos os recursos",headline:"Sua loja completa, sem limites",benefit:"Produtos ilimitados, cupons, relatórios e nota fiscal. Escolha o plano e destrave agora."},compare_plans:{plan:"pro",kind:"generic",icon:zc,featureLabel:"Todos os recursos",headline:"Sua loja completa, sem limites",benefit:"Produtos ilimitados, cupons, relatórios e nota fiscal. Escolha o plano e destrave agora."},subscription_details_upgrade:{plan:"pro",kind:"generic",icon:R1e,featureLabel:"Todos os recursos",headline:"Sua loja tem mais para destravar",benefit:"Veja o que o próximo plano libera. No upgrade você paga só a diferença do atual."},stoqui_pay:{plan:"lite",kind:"feature",icon:Lv,featureLabel:"Stoqui Pay",headline:"Receba Pix e cartão direto na loja",benefit:"O gateway de pagamento do Stoqui no seu checkout, com taxas que cabem no seu bolso."},direct_link:{plan:"pro",kind:"generic",icon:zc,featureLabel:"Todos os recursos",headline:"Sua loja completa, sem limites",benefit:"Produtos ilimitados, cupons, relatórios e nota fiscal. Escolha o plano e destrave agora."}},_L=e=>sS[e]??sS.direct_link,Uge=v.lazy(()=>X(()=>import("./PaywallSheetV2-DyMzzx6B.js"),__vite__mapDeps([22,1,2,23,24,25,26,3,27,28,4,5,6]))),bL=v.createContext(null),Bge=({children:e})=>{const{tags:t,setTag:r}=al(),[n,i]=v.useState({open:!1,trigger:"direct_link"}),o=v.useRef(t);o.current=t;const s=v.useRef(r);s.current=r;const a=v.useCallback((u,h)=>{var m;const f=_L(u),p=f.kind!=="generic";pe(fe.PAYWALL_V2.TRIGGER,{trigger:u,required_plan:f.plan,kind:f.kind,surface:p?"sheet":"page",source:h.source,platform:qe.isNativePlatform()?qe.getPlatform():"web"}),((m=o.current)==null?void 0:m.last_paywall_seen)!==u&&s.current("last_paywall_seen",u),p?i({open:!0,trigger:u,source:h.source,planHint:h.planHint,onV2Close:h.onV2Close}):h.pageAction()},[]),l=v.useMemo(()=>({triggerPaywall:a}),[a]),d=v.useCallback(()=>{i(u=>({...u,open:!1,onV2Close:void 0}))},[]);return c.jsxs(bL.Provider,{value:l,children:[e,n.open&&c.jsx(v.Suspense,{fallback:null,children:c.jsx(Uge,{open:n.open,trigger:n.trigger,source:n.source,planHint:n.planHint,onClose:()=>{const u=n.onV2Close;d(),u==null||u()},onPurchaseSuccess:d})})]})},No=()=>{const e=v.useContext(bL);if(!e)throw new Error("usePaywall must be used within a PaywallProvider");return e},a0={visitors:"#2563EB",orders:"#8865FE",revenue:"#658FFE",profit:"#2AC769"},l0=({title:e,value:t,icon:r,color:n,isLoading:i,locked:o,to:s})=>{const a=c.jsxs(F,{sx:{bgcolor:"white",borderRadius:"14px",p:2,display:"flex",flexDirection:"column",gap:1.5,minHeight:100,userSelect:"none",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)","&:active":o?void 0:{transform:"scale(0.97)"}},children:[c.jsx(F,{sx:{width:36,height:36,borderRadius:"10px",bgcolor:gt(n,.1),display:"flex",alignItems:"center",justifyContent:"center",color:n,fontSize:18},children:r}),c.jsxs(me,{direction:"row",alignItems:"flex-end",justifyContent:"space-between",children:[c.jsxs(F,{children:[c.jsx(V,{sx:{fontSize:"0.75rem",fontWeight:500,color:"text.secondary",mb:.25},children:e}),i?c.jsx(Lt,{variant:"text",width:"70%",height:32}):o?c.jsxs(me,{direction:"row",alignItems:"center",spacing:.5,children:[c.jsx(V,{sx:{fontSize:"1.25rem",fontWeight:700,color:"text.primary",filter:"blur(6px)",userSelect:"none",letterSpacing:"-0.02em"},children:t}),c.jsx(vL,{sx:{fontSize:14,color:"text.disabled",ml:.5}})]}):c.jsx(V,{sx:{fontSize:"1.25rem",fontWeight:700,color:"text.primary",letterSpacing:"-0.02em"},children:t})]}),!o&&c.jsx(Oo,{sx:{fontSize:16,color:"text.disabled",opacity:.4,mb:.25}})]})]}),l=At(),{triggerPaywall:d}=No();return o?c.jsx(F,{onClick:()=>d("home_metric",{pageAction:()=>l("/profile/paywall?initialPlan=pro&ref=home_metric"),source:"home_metrics"}),sx:{cursor:"pointer"},children:a}):s?c.jsx(F,{onClick:()=>l(s),sx:{cursor:"pointer"},children:a}):a},Vge={hidden:{},visible:{transition:{staggerChildren:.06}}},c0={hidden:{opacity:0,y:8},visible:{opacity:1,y:0,transition:{type:"spring",stiffness:260,damping:24}}},Hge=()=>{var h,f,p,m;const e=At(),[t,r]=v.useState("today"),{data:n}=an(),i=Hn(n),o=v.useMemo(()=>{const g=Ka(new Date);let y;switch(t){case"today":y=Bn(new Date);break;case"7days":y=Bn(V1(new Date,6));break;case"30days":y=Bn(V1(new Date,29));break;default:y=Bn(new Date)}return{startDate:y,endDate:g}},[t]),{data:s,isLoading:a}=Cge(o),{data:l,isLoading:d}=Age(i?o:void 0),u=[{value:"today",label:"Hoje"},{value:"7days",label:"7 dias"},{value:"30days",label:"30 dias"}];return c.jsxs(me,{spacing:1.5,children:[c.jsxs(me,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[c.jsx(V,{sx:{fontSize:"1rem",fontWeight:600,color:"text.primary"},children:"Desempenho"}),c.jsx(me,{direction:"row",spacing:.75,children:u.map(g=>c.jsx(Fn,{label:g.label,onClick:()=>{t!==g.value&&Li(Ja.Light),r(g.value)}
185,size:"small",sx:{fontWeight:t===g.value?600:400,fontSize:"0.75rem",bgcolor:t===g.value?"primary.main":gt("#000",.04),color:t===g.value?"white":"text.secondary","&:hover":{bgcolor:t===g.value?"primary.dark":gt("#000",.08)},height:28}},g.value))})]}),c.jsx(rt.div,{variants:Vge,initial:"hidden",animate:"visible",children:c.jsxs(F,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr 1fr",md:"1fr 1fr 1fr 1fr"},gap:1.5},children:[c.jsx(rt.div,{variants:c0,children:c.jsx(l0,{title:"Visitas",value:i?(((h=l==null?void 0:l.kpis)==null?void 0:h.totalUniqueVisitors)||0).toLocaleString("pt-BR"):"124",icon:c.jsx(a3,{}),color:a0.visitors,isLoading:i?d:!1,locked:!i,to:"/reports"})}),c.jsx(rt.div,{variants:c0,children:c.jsx(l0,{title:"Pedidos",value:(((f=s==null?void 0:s.kpis)==null?void 0:f.totalOrders)||0).toLocaleString("pt-BR"),icon:c.jsx(Fg,{}),color:a0.orders,isLoading:a,to:"/orders"})}),c.jsx(rt.div,{variants:c0,children:c.jsx(l0,{title:"Receita",value:oS(((p=s==null?void 0:s.kpis)==null?void 0:p.totalRevenue)||0),icon:c.jsx(Pme,{}),color:a0.revenue,isLoading:a,to:"/reports"})}),c.jsx(rt.div,{variants:c0,children:c.jsx(l0,{title:"Lucro",value:i?oS(((m=s==null?void 0:s.kpis)==null?void 0:m.totalProfit)||0):"R$ 1.234",icon:c.jsx(Lme,{}),color:a0.profit,isLoading:i?a:!1,locked:!i,to:"/reports"})})]})}),c.jsx(F,{sx:{display:"flex",justifyContent:"flex-end",mr:-.75},children:c.jsx(De,{variant:"text",size:"small",endIcon:c.jsx(px,{}),onClick:()=>{Li(Ja.Light),pe(fe.HOME.REPORTS_LINK_CLICK),e("/reports")},sx:{color:"primary.main",textTransform:"none",fontSize:"0.875rem",fontWeight:600,"&:hover":{backgroundColor:g=>gt(g.palette.primary.main,.04)}},children:"Ver relatórios"})})]})};var mx={},zge=zt;Object.defineProperty(mx,"__esModule",{value:!0});var Vg=mx.default=void 0,Wge=zge(Wt()),qge=c;Vg=mx.default=(0,Wge.default)((0,qge.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");var gx={},Gge=zt;Object.defineProperty(gx,"__esModule",{value:!0});var pm=gx.default=void 0,Kge=Gge(Wt()),Yge=c;pm=gx.default=(0,Kge.default)((0,Yge.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckCircle");const d_="/assets/mascot-clipboard-DLu9-dtl.png",Zge=async()=>{const{data:e}=await Io.get("/store-score");return e},vx=()=>{const{user:e}=ot();return Et({queryKey:["storeScore"],queryFn:Zge,enabled:!!e,refetchOnWindowFocus:!0})},Xge={Inventory2:Fs,CameraAlt:W2,PhotoLibrary:W2,Description:fse,Category:s3,LocalOffer:l3,Palette:qj,LocalShipping:yse,CreditCard:Pl,People:v1e,Image:W2,BarChart:$I,TrackChanges:T1e,Chat:DI,Campaign:c_,Language:a3,Article:Aa,Email:pse,WhatsApp:y1e},Jge=({value:e})=>c.jsx(F,{sx:{width:"100%",height:10,borderRadius:5,bgcolor:gt("#8865FE",.12),overflow:"hidden"},children:c.jsx(F,{sx:{width:`${Math.min(e,100)}%`,height:"100%",borderRadius:5,bgcolor:"#8865FE",transition:"width 0.8s cubic-bezier(0.4, 0, 0.2, 1)"}})}),Qge=({label:e,completed:t,route:r,icon:n,progress:i})=>{const o=At(),s=Xge[n];return c.jsxs(F,{onClick:()=>o(r),sx:{display:"flex",alignItems:"center",gap:1.5,p:1.5,borderRadius:2,bgcolor:t?gt("#17A24A",.04):gt("#8865FE",.04),textDecoration:"none",color:"inherit",cursor:"pointer",userSelect:"none",transition:"all 0.15s ease","&:active":{transform:"scale(0.98)"},opacity:t?.7:1},children:[c.jsx(F,{sx:{bgcolor:t?gt("#17A24A",.1):gt("#8865FE",.1),borderRadius:"50%",width:36,height:36,display:"flex",alignItems:"center",justifyContent:"center",color:t?"#17A24A":"#8865FE",flexShrink:0},children:t?c.jsx(pm,{sx:{fontSize:20}}):s&&c.jsx(s,{size:18})}),c.jsxs(F,{flex:1,minWidth:0,children:[c.jsx(V,{fontWeight:t?500:600,color:t?"text.secondary":"text.primary",sx:{fontSize:"0.88rem",textDecoration:t?"line-through":"none"},children:e}),i&&!t&&c.jsx(V,{color:"text.secondary",sx:{fontSize:"0.75rem",fontWeight:500,mt:.25},children:i})]}),!t&&c.jsx(Vg,{sx:{fontSize:18,color:"text.secondary",opacity:.3,flexShrink:0}})]})},e2e=()=>c.jsxs(F,{sx:{borderRadius:2.5,bgcolor:"white",p:2},children:[c.jsxs(me,{direction:"row",spacing:1.5,alignItems:"center",sx:{mb:2},children:[c.jsxs(F,{flex:1,children:[c.jsx(Lt,{variant:"text",width:"60%",height:24}),c.jsx(Lt,{variant:"text",width:"80%",height:18,sx:{mt:.5}}),c.jsx(Lt,{variant:"rounded",width:"100%",height:10,sx:{mt:2,borderRadius:5}})]}),c.jsx(Lt,{variant:"rounded",width:80,height:80})]}),c.jsx(me,{spacing:1,children:[1,2,3].map(e=>c.jsx(Lt,{variant:"rounded",height:52,sx:{borderRadius:2}},e))})]}),t2e=()=>{const{data:e,isLoading:t}=vx();if(t)return c.jsx(e2e,{});if(!e||e.mode!=="onboarding")return null;const{tasks:r,completedCount:n,totalCount:i}=e;return c.jsx(rt.div,{initial:{opacity:0,y:10}
185,animate:{opacity:1,y:0},transition:{duration:.3},children:c.jsxs(F,{sx:{borderRadius:"14px",overflow:"hidden",bgcolor:"white",p:2,userSelect:"none"},children:[c.jsxs(me,{direction:"row",spacing:1.5,alignItems:"center",sx:{mb:2},children:[c.jsxs(F,{flex:1,minWidth:0,children:[c.jsx(V,{fontWeight:700,sx:{fontSize:"1.1rem",color:"text.primary",lineHeight:1.25,mb:.5},children:"Primeiros passos"}),c.jsx(V,{color:"text.secondary",sx:{fontSize:"0.8rem",fontWeight:500,mb:1.5},children:"Configure sua loja e comece a receber pedidos"}),c.jsx(Jge,{value:n/i*100}),c.jsxs(V,{sx:{fontSize:"0.75rem",fontWeight:700,color:"#8865FE",mt:.75},children:[n," de ",i," passos"]})]}),c.jsx(F,{component:"img",src:d_,alt:"Mascote Stoqui",sx:{width:100,height:"auto",objectFit:"contain",flexShrink:0,filter:"drop-shadow(0 2px 8px rgba(136, 101, 254, 0.15))"}})]}),c.jsx(me,{spacing:1,children:r.map(o=>c.jsx(Qge,{label:o.label,completed:o.completed,route:o.route,icon:o.icon,progress:o.key==="products"&&!o.completed&&e.productCount>0?`${e.productCount} de 5 produtos`:void 0},o.key))})]})})},aS="/assets/mascot-thumbs-up-xV0ZHlXX.png",r2e="/assets/mascot-cheering-BH4_VX8y.png",Jl="#8865FE",xL=e=>e>=10?Math.round(e).toString().replace(".",","):e.toFixed(1).replace(".",",");function n2e(e){return e<15?{mascot:d_,message:"Complete ações para melhorar sua loja"}:e<40?{mascot:d_,message:"Cada melhoria aumenta suas chances de venda"}:e<70?{mascot:aS,message:"Continue melhorando para atrair mais clientes"}:e<90?{mascot:aS,message:"Sua loja está muito boa!"}:{mascot:r2e,message:"Sua loja está entre as melhores!"}}const i2e=({value:e})=>c.jsx(F,{sx:{width:"100%",height:6,borderRadius:3,bgcolor:gt(Jl,.12),overflow:"hidden"},children:c.jsx(F,{sx:{width:`${Math.min(e,100)}%`,height:"100%",borderRadius:3,bgcolor:Jl,transition:"width 0.8s cubic-bezier(0.4, 0, 0.2, 1)"}})}),o2e=({value:e,size:t=90})=>{const r=Math.min(e/100,1),n=36,i=7,o=Math.PI*n,s=t/90;return c.jsxs(F,{sx:{position:"relative",width:t,height:Math.round(55*s),flexShrink:0},children:[c.jsxs("svg",{viewBox:"0 0 100 52",style:{width:"100%",height:"100%"},children:[c.jsx("path",{d:"M 14 46 A 36 36 0 0 1 86 46",fill:"none",stroke:gt(Jl,.1),strokeWidth:i,strokeLinecap:"round"}),c.jsx("path",{d:"M 14 46 A 36 36 0 0 1 86 46",fill:"none",stroke:Jl,strokeWidth:i,strokeLinecap:"round",strokeDasharray:o,strokeDashoffset:o*(1-r),style:{transition:"stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1)"}})]}),c.jsxs(F,{sx:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-end",pb:"2px"},children:[c.jsx(V,{sx:{fontSize:`${1.1*s}rem`,fontWeight:800,color:Jl,lineHeight:1,letterSpacing:"-0.02em"},children:xL(e)}),c.jsx(V,{sx:{fontSize:`${.55*s}rem`,fontWeight:600,color:"text.disabled",lineHeight:1,mt:"1px"},children:"pontos"})]})]})},lS=()=>{const e=At(),{data:t,isLoading:r}=vx(),n=tl("(min-width: 900px)");if(r)return c.jsx(F,{sx:{borderRadius:"14px",bgcolor:"white",p:2},children:c.jsxs(me,{direction:"row",spacing:n?2.5:1.5,alignItems:"center",children:[n&&c.jsx(Lt,{variant:"rounded",width:120,height:73,sx:{borderRadius:2,flexShrink:0}}),c.jsxs(F,{flex:1,children:[c.jsx(Lt,{variant:"text",width:"50%",height:22}),c.jsx(Lt,{variant:"text",width:"70%",height:16,sx:{mt:.5}}),!n&&c.jsx(Lt,{variant:"rounded",width:"100%",height:6,sx:{mt:1.5,borderRadius:3}})]}),c.jsx(Lt,{variant:"rounded",width:70,height:70,sx:{flexShrink:0}})]})});if(!t||t.mode!=="score")return null;const{score:i,recommendations:o}=t,s=n2e(i),a=o[0],l=a?c.jsxs(F,{sx:{display:"flex",alignItems:"center",gap:1,mt:1.5,p:1.25,borderRadius:"10px",bgcolor:gt(Jl,.04)},children:[c.jsx(V,{sx:{flex:1,fontSize:"0.8rem",fontWeight:600,color:"text.primary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.label}),c.jsx(F,{sx:{bgcolor:gt("#17A24A",.08),px:.75,py:.25,borderRadius:1,flexShrink:0},children:c.jsxs(V,{sx:{fontSize:"0.68rem",fontWeight:700,color:"#17A24A"},children:["+",a.points>=10?Math.round(a.points):a.points.toFixed(1).replace(".",",")]})})]}):null;return c.jsx(rt.div,{initial:{opacity:0,y:8}
185,animate:{opacity:1,y:0},transition:{type:"spring",stiffness:260,damping:24},children:c.jsx(F,{onClick:()=>e("/potencial"),sx:{display:"block",borderRadius:"14px",bgcolor:"white",p:2,overflow:"hidden",textDecoration:"none",color:"inherit",cursor:"pointer",userSelect:"none",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)","&:active":{transform:"scale(0.97)"}},children:n?c.jsxs(me,{direction:"row",spacing:2.5,alignItems:"center",children:[c.jsx(o2e,{value:i,size:120}),c.jsxs(F,{sx:{flex:1,minWidth:0},children:[c.jsx(V,{sx:{fontSize:"0.9rem",fontWeight:700,color:"text.primary",lineHeight:1.25,mb:.25},children:"Potencial da loja"}),c.jsx(V,{sx:{fontSize:"0.75rem",fontWeight:500,color:"text.secondary"},children:s.message}),l]}),c.jsx(F,{component:"img",src:s.mascot,alt:"",sx:{width:80,height:"auto",objectFit:"contain",flexShrink:0,filter:"drop-shadow(0 2px 8px rgba(136, 101, 254, 0.15))"}}),c.jsx(Oo,{sx:{fontSize:20,color:"text.disabled",flexShrink:0}})]}):c.jsxs(c.Fragment,{children:[c.jsxs(me,{direction:"row",spacing:1.5,alignItems:"center",children:[c.jsxs(F,{sx:{flex:1,minWidth:0},children:[c.jsx(V,{sx:{fontSize:"0.9rem",fontWeight:700,color:"text.primary",lineHeight:1.25,mb:.25},children:"Potencial da loja"}),c.jsx(V,{sx:{fontSize:"0.75rem",fontWeight:500,color:"text.secondary",mb:1.25},children:s.message}),c.jsx(i2e,{value:i}),c.jsxs(V,{sx:{fontSize:"0.72rem",fontWeight:700,color:Jl,mt:.75},children:[xL(i)," pontos"]})]}),c.jsx(F,{component:"img",src:s.mascot,alt:"",sx:{width:75,height:"auto",objectFit:"contain",flexShrink:0,filter:"drop-shadow(0 2px 8px rgba(136, 101, 254, 0.15))"}}),c.jsx(Oo,{sx:{fontSize:20,color:"text.disabled",flexShrink:0}})]}),l]})})})},ip=({variant:e="text",fontSize:t="inherit",sx:r={}})=>{const n={color:"rgb(66, 215, 245)",display:"flex"},i={background:"linear-gradient(90deg, #00B8D9 0%, #0077B6 100%)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",MozBackgroundClip:"text",MozTextFillColor:"transparent"};return e==="contained"?c.jsxs(F,{sx:{display:"inline-flex",alignItems:"center",gap:"2px",px:1,py:.5,borderRadius:"8px",background:"linear-gradient(90deg, #00B8D9 0%, #0077B6 100%)",...r},children:[c.jsx(Ed,{sx:{fontSize:t,...n}}),c.jsx(V,{component:"span",sx:{fontWeight:600,color:"#fff",fontSize:t,lineHeight:1},children:"LITE"})]}):e==="ghost"?c.jsxs(F,{sx:{display:"inline-flex",alignItems:"center",gap:"2px",px:1,py:.5,borderRadius:"8px",backgroundColor:"rgba(0, 184, 217, 0.1)",...r},children:[c.jsx(Ed,{sx:{fontSize:t,...n}}),c.jsx(V,{component:"span",sx:{fontWeight:600,color:"#00B8D9",fontSize:t,lineHeight:1},children:"LITE"})]}):e==="cutout"?c.jsxs(F,{sx:{display:"inline-flex",alignItems:"center",gap:"2px",px:1,py:.5,borderRadius:"8px",backgroundColor:"divider",isolation:"isolate",color:"white",...r},children:[c.jsx(Ed,{sx:{fontSize:t,mixBlendMode:"destination-out"}}),c.jsx(V,{component:"span",sx:{fontWeight:600,fontSize:t,lineHeight:1,mixBlendMode:"destination-out"},children:"LITE"})]}):e==="label"?c.jsxs(F,{sx:{display:"inline-flex",alignItems:"center",gap:"2px",px:0,py:.5,borderRadius:"8px",color:"text.secondary",...r},children:[c.jsx(Ed,{sx:{fontSize:t,color:"#00B8D9"}}),c.jsx(V,{component:"span",sx:{fontWeight:600,fontSize:t,lineHeight:1,color:"#00B8D9"},children:"LITE"})]}):c.jsxs(F,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:"2px",px:1,py:.2,...r},children:[c.jsx(Ed,{sx:{fontSize:"inherit",...n}}),c.jsx(V,{component:"span",sx:{fontWeight:600,fontSize:t,lineHeight:1,...i},children:"LITE"})]})},ra=({variant:e="text",fontSize:t="inherit",sx:r={}})=>{const n={color:"rgb(249, 171, 46)",display:"flex"},i={background:"linear-gradient(90deg, #B023FD 0%, #3D219D 100%)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",MozBackgroundClip:"text",MozTextFillColor:"transparent"};return e==="contained"?c.jsxs(F,{sx:{display:"inline-flex",alignItems:"center",gap:"2px",px:1,py:.5,borderRadius:"8px",background:"linear-gradient(90deg, #B023FD 0%, #3D219D 100%)",...r},children:[c.jsx(Pn,{sx:{fontSize:t,...n},children:c.jsx(Ol,{})}),c.jsx(V,{component:"span",sx:{fontWeight:600,color:"#fff",fontSize:t,lineHeight:1},children:"PRO"})]}):e==="ghost"?c.jsxs(F,{sx:{display:"inline-flex",alignItems:"center",gap:"2px",px:1,py:.5,borderRadius:"8px",backgroundColor:"rgba(255, 255, 255, 0.1)",...r},children:[c.jsx(Pn,{sx:{fontSize:t,...n},children:c.jsx(Ol,{})}),c.jsx(V,{component:"span",sx:{fontWeight:600,color:"#fff",fontSize:t,lineHeight:1},children:"PRO"})]}):e==="cutout"?c.jsxs(F,{sx:{display:"inline-flex",alignItems:"center",gap:"2px",px:1,py:.5,borderRadius:"8px",backgroundColor:"divider",isolation:"isolate",color:"white",...r},children:[c.jsx(Pn,{sx:{fontSize:t,mixBlendMode:"destination-out"},children:c.jsx(Ol,{})}),c.jsx(V,{component:"span",sx:{fontWeight:600,fontSize:t,lineHeight:1,mixBlendMode:"destination-out"},children:"PRO"})]}):e==="label"?c.jsxs(F,{sx:{display:"inline-flex",alignItems:"center",gap:"2px",px:0,py:.5,borderRadius:"8px",color:"text.secondary",...r},children:[c.jsx(Pn,{sx:{fontSize:t},children:c.jsx(Ol,{})}),c.jsx(V,{component:"span",sx:{fontWeight:600,fontSize:t,lineHeight:1,mixBlendMode:"destination-out"},children:"PRO"})]}
185):c.jsxs(F,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:"2px",px:1,py:.2,...r},children:[c.jsx(Pn,{sx:{fontSize:"inherit",...n},children:c.jsx(Ol,{})}),c.jsx(V,{component:"span",sx:{fontWeight:600,fontSize:t,lineHeight:1,...i},children:"PRO"})]})},Qa=({variant:e="text",fontSize:t="inherit",sx:r={}})=>{const n={color:"rgb(186, 85, 211)",display:"flex"},i={background:"linear-gradient(90deg, #4A148C 0%, #1A1A1A 100%)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",MozBackgroundClip:"text",MozTextFillColor:"transparent"};return e==="contained"?c.jsxs(F,{sx:{display:"inline-flex",alignItems:"center",gap:"2px",px:1,py:.5,borderRadius:"8px",background:"linear-gradient(90deg,rgb(75, 10, 125) 0%, #1A1A1A 100%)",...r},children:[c.jsx(Sd,{sx:{fontSize:t,...n}}),c.jsx(V,{component:"span",sx:{fontWeight:600,color:"#fff",fontSize:t,lineHeight:1,letterSpacing:"-0.01em"},children:"BLACK"})]}):e==="ghost"?c.jsxs(F,{sx:{display:"inline-flex",alignItems:"center",gap:"2px",px:1,py:.5,borderRadius:"8px",backgroundColor:"rgba(74, 20, 140, 0.1)",letterSpacing:"-0.01em",...r},children:[c.jsx(Sd,{sx:{fontSize:t,...n}}),c.jsx(V,{component:"span",sx:{fontWeight:600,color:"#4A148C",fontSize:t,lineHeight:1},children:"BLACK"})]}):e==="cutout"?c.jsxs(F,{sx:{display:"inline-flex",alignItems:"center",gap:"2px",px:1,py:.5,borderRadius:"8px",backgroundColor:"divider",isolation:"isolate",color:"white",letterSpacing:"-0.01em",...r},children:[c.jsx(Sd,{sx:{fontSize:t,mixBlendMode:"destination-out"}}),c.jsx(V,{component:"span",sx:{fontWeight:600,fontSize:t,lineHeight:1,mixBlendMode:"destination-out"},children:"BLACK"})]}):e==="label"?c.jsxs(F,{sx:{display:"inline-flex",alignItems:"center",gap:"2px",px:0,py:.5,borderRadius:"8px",color:"text.secondary",...r},children:[c.jsx(Sd,{sx:{fontSize:t,color:"#4A148C"}}),c.jsx(V,{component:"span",sx:{fontWeight:600,fontSize:t,lineHeight:1,color:"#4A148C"},children:"BLACK"})]}):c.jsxs(F,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:"2px",px:1,py:.2,...r},children:[c.jsx(Sd,{sx:{fontSize:"inherit",...n}}),c.jsx(V,{component:"span",sx:{fontWeight:600,fontSize:t,lineHeight:1,letterSpacing:"-0.01em",...i},children:"BLACK"})]})},xu={lite:{color:"#00B8D9",gradient:"linear-gradient(180deg, #00B8D9 0%, #0077B6 100%)",backgroundGradient:"linear-gradient(135deg, rgba(0, 184, 217, 0.2) 0%, rgba(0, 119, 182, 0.2) 100%)",shadow:"rgba(0, 184, 217, 0.3)",description:"Para quem está começando",subscribeLabel:"Liberar o LITE",upgradeLabel:"Liberar o LITE",features:"Recursos essenciais para sua loja",label:"Lite"},pro:{color:"#8A23DE",gradient:"linear-gradient(180deg, #8A23DE 0%, #3D219D 100%)",backgroundGradient:"linear-gradient(135deg, rgba(138, 35, 222, 0.2) 0%, rgba(61, 33, 157, 0.2) 100%)",shadow:"rgba(138, 35, 222, 0.3)",description:"Para negócios em crescimento",subscribeLabel:"Liberar o PRO",upgradeLabel:"Liberar o PRO",features:"Recursos avançados e profissionais",label:"Pro"},black:{color:"#4A148C",gradient:"linear-gradient(180deg,rgb(54, 14, 103) 0%, #1A1A1A 100%)",backgroundGradient:"linear-gradient(180deg,rgb(54, 14, 103) 0%, #1A1A1A 100%)",shadow:"rgba(74, 20, 140, 0.3)",description:"Para quem exige o máximo",subscribeLabel:"Liberar o BLACK",upgradeLabel:"Liberar o BLACK",features:"Todos os recursos + benefÃcios exclusivos",label:"Black"}},s2e={lite:ip,pro:ra,black:Qa},a2e={lite:"lite",pro:"default",black:"black"},tTe=e=>xu[e].color,rTe=e=>xu[e].backgroundGradient,nTe=e=>s2e[e],iTe=e=>a2e[e],oTe=e=>{var t;try{return((t=new Intl.NumberFormat("pt-BR",{style:"currency",currency:e}).formatToParts(0).find(n=>n.type==="currency"))==null?void 0:t.value)??"R$"}catch{return"R$"}},l2e=e=>xu[e].label,c2e=e=>e==="will_renew"||e==="has_already_renewed",yl=e=>e?Di(new Date(e),"dd 'de' MMMM 'de' yyyy",{locale:Uu}):"",sTe=e=>e?Kre(new Date(e),{locale:Uu,addSuffix:!0}):"",aTe=(e,t,r,n=!1,i=!1,o=!1)=>{const s=new Date,a=t?new Date(t):void 0,l=a?Math.ceil((a.getTime()-s.getTime())/(1e3*60*60*24)):0;if(o){if(e==="active")return{label:"Ativa",color:"success",icon:"CheckCircle",description:"Gerenciada pela Flapp Store"};if(e==="cancelled")return{label:"Cancelada",color:"warning",icon:"AlertCircle",description:t?`Cancelada na Flapp Store. Acesso até ${yl(t)}`:"Cancelada na Flapp Store"};if(e==="expired")return{label:"Expirada",color:"error",icon:"XOctagon",de
185scription:"Sua assinatura da Flapp Store expirou"}}if(i&&e==="active")return l<=7?{label:"Expira em breve",color:"warning",icon:"AlertCircle",description:t?`Válido até ${yl(t)}`:"Sua assinatura expira em breve"}:{label:"Ativa",color:"success",icon:"CheckCircle",description:t?`Válido até ${yl(t)}`:"Sua assinatura está ativa"};if(e==="active"&&!r&&!n)return{label:"Cancelada",color:"warning",icon:"AlertCircle",description:t?`Assinatura cancelada. Você ainda pode usar até ${yl(t)}`:"Assinatura cancelada"};if(n){if(e==="active")return{label:"Ativa",color:"success",icon:"CheckCircle",description:t?`Válido até ${yl(t)}`:"Ativa"};if(e==="cancelled"||e==="expired")return{label:"Expirada",color:"error",icon:"XOctagon",description:t?`Válido até ${yl(t)}`:"Assinatura expirada"}}switch(e){case"active":return{label:"Ativa",color:"success",icon:"CheckCircle",description:r?"Sua assinatura está ativa e será renovada automaticamente":"Sua assinatura está ativa"};case"trialing":return{label:"PerÃodo de teste",color:"info",icon:"Star",description:"Você está no perÃodo de teste gratuito"};case"in_grace_period":return{label:"Pagamento falhou",color:"warning",icon:"AlertCircle",description:`Regularize seu meio de pagamento em até ${l} ${l===1?"dia":"dias"} para evitar o cancelamento`};case"cancelled":return{label:"Cancelada",color:"error",icon:"XCircle",description:t?`Você ainda pode usar até ${yl(t)}`:"Sua assinatura foi cancelada"};case"expired":return{label:"Expirada",color:"error",icon:"XOctagon",description:"Sua assinatura expirou"};case"in_billing_retry":return{label:"Pagamento pendente",color:"error",icon:"AlertCircle",description:"Estamos tentando processar o pagamento da sua assinatura"};case"incomplete":return{label:"Incompleta",color:"error",icon:"AlertCircle",description:"Ainda não localizamos o pagamento da sua assinatura"};default:return{label:"Status desconhecido",color:"default",icon:"HelpCircle",description:"Status da assinatura desconhecido. Entre em contato com o suporte"}}},lTe=e=>{if(!e)return{label:"Indefinido",period:""};if(e.includes("monthly"))return{label:"Mensal",period:"por mês"};if(e.includes("annual"))return{label:"Anual",period:"por ano"};if(e.includes("quarterly"))return{label:"Trimestral",period:"por trimestre"};if(e.includes("prepaid")){if(e.includes("quarterly"))return{label:"Pré-pago Trimestral",period:"por 3 meses"};if(e.includes("annual"))return{label:"Pré-pago Anual",period:"por ano"}}return{label:"Indefinido",period:""}},u2e={app_store:"https://apps.apple.com/account/subscriptions",play_store:"https://play.google.com/store/account/subscriptions"},d2e={app_store:"App Store",play_store:"Google Play"},cTe=e=>{if(e){if(e.includes("apple.com"))return"app_store";if(e.includes("play.google.com"))return"play_store"}return qe.getPlatform()==="ios"?"app_store":"play_store"},uTe=e=>d2e[e],dTe=e=>u2e[e],wL=e=>!!(e!=null&&e.gives_access)||(e==null?void 0:e.status)==="in_grace_period"||(e==null?void 0:e.status)==="in_billing_retry"||(e==null?void 0:e.status)==="on_hold",h2e={info:{bg:"#EEF4FF",accent:"#3B82F6",icon:"#2D6FE5"},success:{bg:"#E9FBF1",accent:"#2AC769",icon:"#22B45D"},warning:{bg:"#FFF8E1",accent:"#F59E0B",icon:"#DD8B0A"},error:{bg:"#FFF0F0",accent:"#EF4444",icon:"#E03737"},birthday:{bg:"#FBEEFF",accent:"#C465F8",icon:"#B43BE7"},brand:{bg:"#F1EDFF",accent:"#8865FE",icon:"#7A55F5"}},f2e=({severity:e,size:t})=>e==="info"?c.jsx(Sme,{size:t}):e==="success"?c.jsx(yme,{size:t}):e==="warning"?c.jsx(xme,{size:t}):e==="birthday"?c.jsx(wme,{size:t}):e==="brand"?c.jsx(Ame,{size:t}):c.jsx(kme,{size:t}),_s=({severity:e="info",title:t,children:r,icon:n,action:i,onClick:o,onClose:s,showChevron:a,sx:l})=>{const d=h2e[e],u=typeof o=="function",h=t!=null&&t!=="",f=r!=null&&r!=="",p=a??(u&&!i&&!s),m=h&&f?"flex-start":"center",g=!h,y=g?1.25:1.75,b=g?30:36,E=g?"8px":"10px",S=g?18:20,k=g?1.25:1.5;return c.jsx(F,{onClick:u?o:void 0,role:u?"button":void 0,tabIndex:u?0:void 0,onKeyDown:u?A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),o==null||o())}:void 0,sx:{borderRadius:"14px",bgcolor:d.bg,p:y,cursor:u?"pointer":"default",transition:u?"filter 0.15s ease":void 0,outline:"none","&:hover":u?{filter:"brightness(0.96)"}:void 0,"&:active":u?{filter:"brightness(0.92)"}:void 0,"&:focus-visible":u?{boxShadow:`0 0 0 2px ${gt(d.accent,.4)}`}:void 0,...l},children:c.jsxs(me,{direction:"row",spacing:k,alignItems:m,children:[c.jsx(F,{sx:{width:b,height:b,borderRadius:E,bgcolor:gt(d.accent,.14),
185color:d.icon,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,mt:m==="flex-start"?.125:0},children:n??c.jsx(f2e,{severity:e,size:S})}),c.jsxs(F,{sx:{flex:1,minWidth:0},children:[h&&c.jsx(V,{sx:{fontSize:"0.875rem",fontWeight:700,color:"text.primary",lineHeight:1.3},children:t}),f&&c.jsx(V,{component:"div",sx:{fontSize:h?"0.78rem":"0.875rem",fontWeight:500,color:h?"text.secondary":"text.primary",mt:h?.25:0,lineHeight:1.45},children:r})]}),s&&c.jsx($D,{onClick:A=>{A.stopPropagation(),s()},sx:{flexShrink:0,width:28,height:28,borderRadius:"8px",color:"text.secondary",transition:"background-color 0.15s","&:hover":{bgcolor:gt(d.accent,.1)}},"aria-label":"Fechar",children:c.jsx(Rme,{size:16})}),!s&&i&&c.jsx(F,{onClick:A=>A.stopPropagation(),sx:{flexShrink:0,alignSelf:"center"},children:i}),!s&&!i&&p&&c.jsx(F,{sx:{flexShrink:0,display:"flex",alignItems:"center",color:"text.disabled",ml:-.5},children:c.jsx(_me,{size:20})})]})})},p2e=e=>{if(!e.current_period_ends_at)return null;const t=new Date(e.current_period_ends_at),r=Jb(t,new Date),{source:n,status:i,auto_renewal_status:o,product_identifier:s,plan:a}=e,l=(s==null?void 0:s.includes("prepaid"))??!1,d=c2e(o),u=l2e(a),h=f=>f<=0?"hoje":f===1?"amanhã":`em ${f} dias`;return n==="manual"&&i==="active"&&r<=7?{level:r<=1?"error":"warning",title:`Plano ${u} expira ${h(r)}`,subtitle:"Renove para continuar usando todos os recursos"}:i==="trialing"&&r<=4&&!d?{level:"warning",title:`Teste termina ${h(r)}`,subtitle:"Assine para manter os recursos do plano"}:i==="in_grace_period"?{level:"warning",title:"Atualize seu pagamento",subtitle:"Continue com os recursos que você mais usa"}:i==="in_billing_retry"||i==="on_hold"?{level:"warning",title:"Volte para o seu plano",subtitle:"Atualize seu pagamento e retome seus recursos"}:i==="active"&&!d&&r<=3?{level:"warning",title:l?`Plano expira ${h(r)}`:`Cancelamento ${h(r)}`,subtitle:l?"Faça uma recarga para continuar":"Atualize seus dados de pagamento"}:i==="expired"&&r>=-3?{level:"error",title:`Plano ${u} expirou`,subtitle:"Renove para acessar recursos avançados"}:null},m2e=()=>{const{data:e,isLoading:t}=an(),r=At();if(!e||t)return null;const n=p2e(e);return n?c.jsx(_s,{severity:n.level,title:n.title,onClick:()=>r("/profile/subscription"),children:n.subtitle}):null};var yx={},g2e=zt;Object.defineProperty(yx,"__esModule",{value:!0});var Hg=yx.default=void 0,v2e=g2e(Wt()),y2e=c;Hg=yx.default=(0,v2e.default)((0,y2e.jsx)("path",{d:"M12 6c1.11 0 2-.9 2-2 0-.38-.1-.73-.29-1.03L12 0l-1.71 2.97c-.19.3-.29.65-.29 1.03 0 1.1.9 2 2 2m4.6 9.99-1.07-1.07-1.08 1.07c-1.3 1.3-3.58 1.31-4.89 0l-1.07-1.07-1.09 1.07C6.75 16.64 5.88 17 4.96 17c-.73 0-1.4-.23-1.96-.61V21c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-4.61c-.56.38-1.23.61-1.96.61-.92 0-1.79-.36-2.44-1.01M18 9h-5V7h-2v2H6c-1.66 0-3 1.34-3 3v1.54c0 1.08.88 1.96 1.96 1.96.52 0 1.02-.2 1.38-.57l2.14-2.13 2.13 2.13c.74.74 2.03.74 2.77 0l2.14-2.13 2.13 2.13c.37.37.86.57 1.38.57 1.08 0 1.96-.88 1.96-1.96V12C21 10.34 19.66 9 18 9"}),"Cake");const EL=()=>{const{user:e}=ot(),t=e==null?void 0:e.id;return Et({queryKey:["birthdaysToday"],queryFn:async()=>{if(!t)throw new Error("User is not authenticated");const r=new Date,n=r.getDate(),i=r.getMonth()+1,{data:o,error:s}=await Te.from("cliente").select("id, nome, telefone, email, profile_url, customer_user_id, dia_aniversario, mes_aniversario").eq("user_id",t).eq("dia_aniversario",n).eq("mes_aniversario",i).is("deletado_em",null);if(s)throw new Error(s.message);return o||[]},enabled:!!t})},hTe=e=>{const{user:t}=ot(),r=t==null?void 0:t.id;return Et({queryKey:["isCustomerBirthdayToday",e],queryFn:async()=>{if(!r||!e)return!1;const n=new Date,i=n.getDate(),o=n.getMonth()+1,{data:s,error:a}=await Te.from("cliente").select("id").eq("user_id",r).eq("id",e).eq("dia_aniversario",i).eq("mes_aniversario",o).is("deletado_em",null).single();if(a){if(a.code==="PGRST116")return!1;throw new Error(a.message)}return!!s},enabled:!!r&&!!e})},_2e=(e=30)=>{const{user:t}=ot(),r=t==null?void 0:t.id;return Et({queryKey:["upcomingBirthdays",e],queryFn:async()=>{if(!r)throw new Error("User is not authenticated");const{data:n,error:i}=await Te.from("cliente").select("id, nome, telefone, email, profile_url, customer_user_id, dia_aniversario, mes_aniversario").eq("user_id",r).not("dia_aniversario","is",null).not("mes_aniversario","is",null).is("deletado_em",null);if(i)throw new Error(i.message);return(n||[]).filter(s=>{if(!s.dia_aniversario||!s.mes_aniversario)return!1;const a=new Date,l=new Date(a.getFullYear(),s.mes_aniversario-1,s.dia_aniversario);l<a&&l.setFullYear(a.getFullYear()+1);const d=1e3*60*60*24,u=Math.ceil((l.getTime()-a.getTime())/d);return u>0&&u<=e}).sort((s,a)=>{const l=new Date;l.setMonth(s.mes_aniversario-1),l.setDate(s.dia_aniversario);const d=new Date;return d.setMonth(a.mes_aniversario-1),d.setDate(a.dia_aniversario),l<new Date&&l.setFullYear(l.getFullYear()+1),d<new Date&&d.setFullYear(d.getFullYear()+1),l.getTime()-d.getTime()})},enabled:!!r})},b2e="/assets/confetti-tCf5hWn7.png",cS=()=>{const e=At(),{data:t,isLoading:r}=EL();if((!t||t.length===0)&&!r)return null;const n="#C465F8",i=()=>{e("/customers?birthdayFilter=today")};if(r)return null;const o=(t==null?void 0:t.length)||0;return c.jsx(rt.div,{initial:{opacity:0,y:8}
185,animate:{opacity:1,y:0},transition:{type:"spring",stiffness:260,damping:24},children:c.jsxs(F,{onClick:i,sx:{width:"100%",minHeight:64,cursor:"pointer",position:"relative",isolation:"isolate",display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1.5,overflow:"hidden",bgcolor:"white",borderRadius:"14px",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)","&:active":{transform:"scale(0.97)"}},children:[c.jsx(F,{component:"img",src:b2e,alt:"",sx:{position:"absolute",top:0,right:0,height:"100%",width:"100%",objectFit:"cover",objectPosition:"right top",zIndex:-1,opacity:.5}}),c.jsxs(me,{direction:"row",alignItems:"center",spacing:1.5,children:[c.jsx(F,{sx:{bgcolor:`${n}30`,borderRadius:"50%",p:.5,display:"flex",justifyContent:"center",alignItems:"center"},children:c.jsx(Hg,{sx:{color:n,fontSize:"x-large"}})}),c.jsxs(V,{variant:"body2",fontWeight:"700",fontSize:"x-large",color:n,children:[o," ",o===1?"aniversário":"aniversários"," ","hoje"]})]}),c.jsx(Vg,{sx:{color:n}})]})})};var _x={},x2e=zt;Object.defineProperty(_x,"__esModule",{value:!0});var zg=_x.default=void 0,w2e=x2e(Wt()),E2e=c;zg=_x.default=(0,w2e.default)((0,E2e.jsx)("path",{d:"M12 5.99 19.53 19H4.47zM2.74 18c-.77 1.33.19 3 1.73 3h15.06c1.54 0 2.5-1.67 1.73-3L13.73 4.99c-.77-1.33-2.69-1.33-3.46 0zM11 11v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1m0 5h2v2h-2z"}),"WarningAmberRounded");var bx={},S2e=zt;Object.defineProperty(bx,"__esModule",{value:!0});var xx=bx.default=void 0,C2e=S2e(Wt()),T2e=c;xx=bx.default=(0,C2e.default)((0,T2e.jsx)("path",{d:"M19 3h-1V2c0-.55-.45-1-1-1s-1 .45-1 1v1H8V2c0-.55-.45-1-1-1s-1 .45-1 1v1H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-1 16H6c-.55 0-1-.45-1-1V8h14v10c0 .55-.45 1-1 1M8 10h3c.55 0 1 .45 1 1v3c0 .55-.45 1-1 1H8c-.55 0-1-.45-1-1v-3c0-.55.45-1 1-1"}),"TodayRounded");
185var wx={},A2e=zt;Object.defineProperty(wx,"__esModule",{value:!0});var SL=wx.default=void 0,k2e=A2e(Wt()),R2e=c;SL=wx.default=(0,k2e.default)((0,R2e.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m-.22-13h-.06c-.4 0-.72.32-.72.72v4.72c0 .35.18.68.49.86l4.15 2.49c.34.2.78.1.98-.24.21-.34.1-.79-.25-.99l-3.87-2.3V7.72c0-.4-.32-.72-.72-.72"}),"AccessTimeRounded");var Ex={},I2e=zt;Object.defineProperty(Ex,"__esModule",{value:!0});var CL=Ex.default=void 0,P2e=I2e(Wt()),O2e=c;CL=Ex.default=(0,P2e.default)((0,O2e.jsx)("path",{d:"M20 3h-1V2c0-.55-.45-1-1-1s-1 .45-1 1v1H7V2c0-.55-.45-1-1-1s-1 .45-1 1v1H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-1 18H5c-.55 0-1-.45-1-1V8h16v12c0 .55-.45 1-1 1"}),"CalendarTodayRounded");const TL=e=>c.jsxs(Pn,{...e,viewBox:"0 0 230 230",children:[c.jsx("path",{d:"M85 79.6668C71.1917 79.6668 60 87.1252 60 96.3335C60 105.542 71.1917 113 85 113C98.8083 113 110 120.458 110 129.667C110 138.875 98.8083 146.333 85 146.333M85 79.6668C94.25 79.6668 102.333 83.0168 106.658 88.0002M85 79.6668V71.3335M85 79.6668V146.333M85 146.333V154.667M85 146.333C75.75 146.333 67.6667 142.984 63.3417 138",stroke:"currentColor",fill:"none",strokeWidth:"16.6667",strokeLinecap:"round",strokeLinejoin:"round"}),c.jsx("path",{d:"M141.78 64C140.585 62.6149 139.335 61.2695 138.033 59.967C123.968 45.9018 104.891 38 85 38C65.1088 38 46.0322 45.9018 31.967 59.967C17.9018 74.0322 10 93.1088 10 113C10 122.849 11.9399 132.602 15.709 141.701C19.4781 150.801 25.0026 159.069 31.967 166.033C38.9314 172.997 47.1993 178.522 56.2987 182.291C65.3982 186.06 75.1509 188 85 188C94.8491 188 104.602 186.06 113.701 182.291C122.801 178.522 131.069 172.997 138.033 166.033",stroke:"currentColor",fill:"none",strokeWidth:"16.6667",strokeLinecap:"round",strokeLinejoin:"round"}),c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M176.606 153.596C175.075 155.135 172.998 156 170.832 156C168.667 156 166.59 155.135 165.058 153.596L132.391 120.755C130.86 119.215 130 117.127 130 114.95C130 112.773 130.86 110.685 132.391 109.146L165.058 76.3047C166.599 74.8092 168.662 73.9816 170.803 74.0003C172.944 74.019 174.993 74.8825 176.507 76.4047C178.021 77.927 178.88 79.9862 178.898 82.1389C178.917 84.2916 178.094 86.3656 176.606 87.914L157.88 106.74H219.833C221.999 106.74 224.076 107.605 225.608 109.145C227.14 110.685 228 112.773 228 114.95C228 117.128 227.14 119.216 225.608 120.756C224.076 122.296 221.999 123.161 219.833 123.161C217.667 123.161 157.88 123.161 157.88 123.161L176.606 141.987C178.137 143.526 178.997 145.614 178.997 147.791C178.997 149.969 178.137 152.056 176.606 153.596Z"})]}),j2e=async e=>{if(!e)throw new Error("User is not authenticated");const{data:t,error:r}=await Te.from("parcela").select(` 186 id, 187 pedido_id, 188 numero_parcela, 189 valor_original, 190 data_vencimento, 191 status_parcela, 192 criado_em, 193 atualizado_em, 194 total_parcelas, 195 pedido:pedido!inner ( 196 pedido_id, 197 numero_pedido, 198 data_pedido, 199 status_pedido, 200 valor_desconto, 201 condicao_pagamento, 202 vendedor_id, 203 subtotal, 204 frete_pedido:frete_pedido ( 205 valor_frete 206 ), 207 cliente:cliente ( 208 telefone, 209 nome, 210 profile_url, 211 customer_user_id, 212 cpf, 213 id 214 ) 215 ), 216 pagamento:pagamento ( 217 id, 218 valor, 219 data_pagamento, 220 status, 221 forma_pagamento:forma_pagamento ( 222 id, 223 nome, 224 icone 225 ) 226 ) 227 `).eq("pedido.vendedor_id",e).eq("status_parcela","pendente").neq("pedido.condicao_pagamento","a_vista").is("pedido.deletado_em",null).order("data_vencimento",{ascending:!0});if(r)throw new Error(r.message);return(t||[]).map(i=>{const o=Array.isArray(i.pedido)?i.pedido[0]:i.pedido,s=Array.isArray(o.cliente)?o.cliente[0]:o.cliente,a=Array.isArray(o.frete_pedido)?o.frete_pedido[0]:o.frete_pedido,l=(i.pagamento||[]).map(d=>({...d,forma_pagamento:Array.isArray(d.forma_pagamento)?d.forma_pagamento[0]:d.forma_pagamento}));return{...i,condicao_pagamento:o.condicao_pagamento,pedido:{...o,cliente:s,frete_pedido:a},pagamentos:l}})},L2e=e=>{const{user:t}=ot(),r=t==null?void 0:t.id;return Et({queryKey:["allInstallments",r],queryFn:()=>j2e(r),enabled:!!r&&((e==null?void 0:e.enabled)??!0),staleTime:18e5})},_l="#658FFE";function uS(){const e=At(),{data:t,isLoading:r}=L2e(),n=v.useMemo(()=>
227{if(!t)return{overdue:0,today:0,totalValue:0,fiadoValue:0,parceladoValue:0};const o=t.filter(u=>gu(Bn(new Date(u.data_vencimento)),Bn(new Date))).length,s=t.filter(u=>mg(new Date(u.data_vencimento))).length,{totalValue:a,fiadoValue:l,parceladoValue:d}=t.reduce((u,h)=>{const f=CI((h.pagamentos??[]).filter(m=>m.status==="pago").map(m=>m.valor)),p=TI(h.valor_original,f);return u.totalValue+=p,h.condicao_pagamento==="fiado"?u.fiadoValue+=p:h.condicao_pagamento==="parcelado"&&(u.parceladoValue+=p),u},{totalValue:0,fiadoValue:0,parceladoValue:0});return{overdue:o,today:s,totalValue:a,fiadoValue:l,parceladoValue:d}},[t]);if(!r&&(!t||t.length===0))return null;if(r)return c.jsxs(F,{sx:{borderRadius:"14px",bgcolor:"white",p:2.5},children:[c.jsxs(me,{direction:"row",spacing:1.5,alignItems:"center",sx:{mb:2},children:[c.jsx(Lt,{variant:"rounded",width:40,height:40,sx:{borderRadius:"10px"}}),c.jsxs(F,{sx:{flex:1},children:[c.jsx(Lt,{variant:"text",width:"50%",height:20}),c.jsx(Lt,{variant:"text",width:"35%",height:16})]})]}),c.jsx(Lt,{variant:"text",width:"45%",height:36}),c.jsxs(me,{direction:"row",spacing:1,sx:{mt:2},children:[c.jsx(Lt,{variant:"rounded",width:"50%",height:56,sx:{borderRadius:"10px"}}),c.jsx(Lt,{variant:"rounded",width:"50%",height:56,sx:{borderRadius:"10px"}})]})]});const i=o=>o.toLocaleString("pt-BR",{style:"currency",currency:"BRL"});return c.jsx(rt.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{type:"spring",stiffness:260,damping:24},children:c.jsxs(F,{onClick:()=>e("/contas-a-receber"),sx:{display:"block",borderRadius:"14px",bgcolor:"white",p:2.5,textDecoration:"none",color:"inherit",cursor:"pointer",userSelect:"none",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)","&:active":{transform:"scale(0.97)"}},children:[c.jsxs(me,{direction:"row",alignItems:"center",spacing:1.5,sx:{mb:1.5},children:[c.jsx(F,{sx:{width:40,height:40,borderRadius:"10px",bgcolor:gt(_l,.1),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:c.jsx(TL,{sx:{fontSize:22,color:_l}})}),c.jsxs(F,{sx:{flex:1},children:[c.jsx(V,{sx:{fontSize:"0.9rem",fontWeight:700,color:"text.primary",lineHeight:1.25},children:"Contas a receber"}),c.jsxs(V,{sx:{fontSize:"0.75rem",fontWeight:500,color:"text.secondary",mt:.25},children:[t==null?void 0:t.length," ",(t==null?void 0:t.length)===1?"parcela pendente":"parcelas pendentes"]})]}),c.jsx(Oo,{sx:{fontSize:20,color:"text.disabled"}})]}),c.jsx(V,{sx:{fontSize:"1.5rem",fontWeight:700,color:_l,letterSpacing:"-0.02em"},children:i(n.totalValue)}),(n.fiadoValue>0||n.parceladoValue>0)&&c.jsxs(me,{direction:"row",spacing:1,sx:{mt:2},children:[n.fiadoValue>0&&c.jsxs(F,{sx:{flex:1,py:1.25,px:1.5,borderRadius:"10px",bgcolor:gt(_l,.04)},children:[c.jsxs(me,{direction:"row",alignItems:"center",spacing:.75,sx:{mb:.5},children:[c.jsx(SL,{sx:{fontSize:16,color:_l}}),c.jsx(V,{sx:{fontSize:"0.7rem",fontWeight:500,color:"text.secondary"},children:"Fiado"})]}),c.jsx(V,{sx:{fontSize:"0.95rem",fontWeight:700,color:"text.primary"},children:i(n.fiadoValue)})]}),n.parceladoValue>0&&c.jsxs(F,{sx:{flex:1,py:1.25,px:1.5,borderRadius:"10px",bgcolor:gt(_l,.04)},children:[c.jsxs(me,{direction:"row",alignItems:"center",spacing:.75,sx:{mb:.5},children:[c.jsx(CL,{sx:{fontSize:16,color:_l}}),c.jsx(V,{sx:{fontSize:"0.7rem",fontWeight:500,color:"text.secondary"},children:"Parcelado"})]}),c.jsx(V,{sx:{fontSize:"0.95rem",fontWeight:700,color:"text.primary"},children:i(n.parceladoValue)})]})]}),(n.overdue>0||n.today>0)&&c.jsxs(me,{direction:"row",spacing:1,sx:{mt:1},children:[n.overdue>0&&c.jsxs(F,{sx:{flex:1,py:1.25,px:1.5,borderRadius:"10px",bgcolor:gt("#EF4444",.06)},children:[c.jsxs(me,{direction:"row",alignItems:"center",spacing:.75,sx:{mb:.5},children:[c.jsx(zg,{sx:{fontSize:16,color:"#EF4444"}}),c.jsx(V,{sx:{fontSize:"0.7rem",fontWeight:500,color:"#EF4444"},children:"Em atraso"})]}),c.jsx(V,{sx:{fontSize:"0.95rem",fontWeight:700,color:"#EF4444"},children:n.overdue})]}),n.today>0&&c.jsxs(F,{sx:{flex:1,py:1.25,px:1.5,borderRadius:"10px",bgcolor:gt("#F59E0B",.06)},children:[c.jsxs(me,{direction:"row",alignItems:"center",spacing:.75,sx:{mb:.5},children:[c.jsx(xx,{sx:{fontSize:16,color:"#D97706"}}),c.jsx(V,{sx:{fontSize:"0.7rem",fontWeight:500,color:"#D97706"},children:n.today===1?"Vence hoje":"Vencem hoje"})]}),c.jsx(V,{sx:{fontSize:"0.95rem",fontWeight:700,color:"#D97706"},children:n.today})]})]})]})})}var Sx={},$2e=zt;Object.defineProperty(Sx,"__esModule",{value:!0});var Cx=Sx.default=void 0,D2e=$2e(Wt()),M2e=c;Cx=Sx.default=(0,D2e.default)((0,M2e.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M9.29 16.29 5.7 12.7a.9959.9959 0 0 1 0-1.41c.39-.39 1.02-.39 1.41 0L10 14.17l6.88-6.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-7.59 7.59c-.38.39-1.02.39-1.41 0"}),"CheckCircleRounded");const h_=e=>c.jsxs(Pn,{...e,viewBox:"0 0 230 230",children:[c.jsx("path",{d:"M85 79.6668C71.1917 79.6668 60 87.
2271252 60 96.3335C60 105.542 71.1917 113 85 113C98.8083 113 110 120.458 110 129.667C110 138.875 98.8083 146.333 85 146.333M85 79.6668C94.25 79.6668 102.333 83.0168 106.658 88.0002M85 79.6668V71.3335M85 79.6668V146.333M85 146.333V154.667M85 146.333C75.75 146.333 67.6667 142.984 63.3417 138",stroke:"currentColor",fill:"none",strokeWidth:"16.6667",strokeLinecap:"round",strokeLinejoin:"round"}),c.jsx("path",{d:"M141.78 64C140.585 62.6149 139.335 61.2695 138.033 59.967C123.968 45.9018 104.891 38 85 38C65.1088 38 46.0322 45.9018 31.967 59.967C17.9018 74.0322 10 93.1088 10 113C10 122.849 11.9399 132.602 15.709 141.701C19.4781 150.801 25.0026 159.069 31.967 166.033C38.9314 172.997 47.1993 178.522 56.2987 182.291C65.3982 186.06 75.1509 188 85 188C94.8491 188 104.602 186.06 113.701 182.291C122.801 178.522 131.069 172.997 138.033 166.033",stroke:"currentColor",fill:"none",strokeWidth:"16.6667",strokeLinecap:"round",strokeLinejoin:"round"}),c.jsx("g",{transform:"translate(358 0) scale(-1 1)",children:c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M176.606 153.596C175.075 155.135 172.998 156 170.832 156C168.667 156 166.59 155.135 165.058 153.596L132.391 120.755C130.86 119.215 130 117.127 130 114.95C130 112.773 130.86 110.685 132.391 109.146L165.058 76.3047C166.599 74.8092 168.662 73.9816 170.803 74.0003C172.944 74.019 174.993 74.8825 176.507 76.4047C178.021 77.927 178.88 79.9862 178.898 82.1389C178.917 84.2916 178.094 86.3656 176.606 87.914L157.88 106.74H219.833C221.999 106.74 224.076 107.605 225.608 109.145C227.14 110.685 228 112.773 228 114.95C228 117.128 227.14 119.216 225.608 120.756C224.076 122.296 221.999 123.161 219.833 123.161C217.667 123.161 157.88 123.161 157.88 123.161L176.606 141.987C178.137 143.526 178.997 145.614 178.997 147.791C178.997 149.969 178.137 152.056 176.606 153.596Z"})})]}),Tx={fornecedor:"Fornecedor",aluguel:"Aluguel",agua_luz_internet:"Ãgua/luz/internet",impostos:"Impostos",retirada:"Retirada",outros:"Outros"},fTe=e=>Tx[e]||e,N2e=Object.entries(Tx).map(([e,t])=>({value:e,label:t,custom:!1})),Ax="*, fornecedor:fornecedor(id, nome)",Wg=e=>{const t=Array.isArray(e.fornecedor)?e.fornecedor[0]:e.fornecedor;return{id:e.id,descricao:e.descricao,valor:Number(e.valor),data_vencimento:e.data_vencimento,status:e.status,data_pagamento:e.data_pagamento,categoria:e.categoria,fornecedor_id:e.fornecedor_id,fornecedor_nome:(t==null?void 0:t.nome)??null,observacoes:e.observacoes,repeticao:e.repeticao,serie_id:e.serie_id,numero_parcela:e.numero_parcela,total_parcelas:e.total_parcelas,criado_em:e.criado_em}},F2e=async e=>{if(!e)throw new Error("User not authenticated");const{error:t}=await Te.rpc("garantir_recorrencias_conta_pagar");t&&console.warn("garantir_recorrencias_conta_pagar:",t.message);const{data:r,error:n}=await Te.from("conta_pagar").select(Ax).eq("user_id",e).eq("status","pendente").order("data_vencimento",{ascending:!0});if(n)throw new Error(n.message);return(r||[]).map(Wg)},U2e=e=>{if(e==="tudo")return null;const t=new Date;t.setDate(1),t.setHours(0,0,0,0),e==="mes_passado"&&t.setMonth(t.getMonth()-1);const r=new Date(t);return r.setMonth(r.getMonth()+1),{inicio:t,fim:r}},B2e=async(e,t)=>{if(!e)throw new Error("User not authenticated");let r=Te.from("conta_pagar").select(Ax).eq("user_id",e).eq("status","paga").order("data_pagamento",{ascending:!1}).limit(1e3);const n=U2e(t);n&&(r=r.gte("data_pagamento",n.inicio.toISOString()).lt("data_pagamento",n.fim.toISOString()));const{data:i,error:o}=await r;if(o)throw new Error(o.message);return(i||[]).map(Wg)},V2e=async e=>{if(!e)throw new Error("User not authenticated");const{count:t,error:r}=await Te.from("conta_pagar").select("id",{count:"exact",head:!0}).eq("user_id",e).eq("status","paga");if(r)throw new Error(r.message);return t??0},H2e=async(e,t)=>{const{data:r,error:n}=await Te.rpc("fluxo_caixa_entradas_mes",{p_inicio:e.toISOString(),p_fim:t.toISOString()});if(n)throw new Error(n.message);return{entrou_total:Number((r==null?void 0:r.entrou_total)??0),recebidos_count:Number((r==null?void 0:r.recebidos_count)??0),a_receber_total:Number((r==null?void 0:r.a_receber_total)??0),a_receber_count:Number((r==null?void 0:r.a_receber_count)??0)}},z2e=async(e,t)=>{const{data:r,error:n}=await Te.rpc("resultado_mes_conta_pagar",{p_inicio:e.toISOString(),p_fim:t.toISOString()});if(n)throw new Error(n.message);return{saiu_total:Number((r==null?void 0:r.saiu_total)??0),pagas_count:Number((r==null?void 0:r.pagas_count)??0),saiu_por_categoria:((r==null?void 0:r.saiu_por_categoria)??[]).map(i=>({categoria:i.categoria,valor:Number(i.valor)})),pendentes_count:Number((r==null?void 0:r.pendentes_count)??0),pendentes_total:Number((r==null?void 0:r.pendentes_total)??0)}},W2e=async(e,t)=>{if(!e)throw new Error("User not authenticated");const{data:r,error:n}=await Te.from("conta_pagar").select(Ax).eq("user_id",e).eq("id",t).maybeSingle();if(n)throw new Error(n.message);return r?Wg(r):null},pTe=async e=>{const{data:t,error:r}=await Te.rpc("criar_conta_pagar",{p_descricao:e.descricao,p_valor:e.valor,p_data_vencimento:e.data_vencimento,p_categoria:e.categoria,p_fornecedor_id:e.fornecedor_id,p_observacoes:e.observacoes,p_repeticao:e.repeticao,p_total_parcelas:e.total_parcelas??null,p_data_pagamento:e.data_pagamento??null});if(r)throw new Error(r.message);return Wg((t||[])[0])},mTe=async e=>{const t={};e.descricao!==void 0&&(t.descricao=e.descricao),e.valor!==void 0&&(t.valor=e.valor),e.data_vencimento!==void 0&&(t.data_vencimento=e.data_vencimento),e.categoria!==void 0&&(t.categoria=e.categoria),e.fornecedor_id!==void 0&&(t.fornecedor_id=e.fornecedor_id),e.observacoes!==void 0&&(t.observacoes=e.observacoes);const{error:r}
227=await Te.rpc("atualizar_conta_pagar",{p_id:e.id,p_escopo:e.escopo,p_changes:t});if(r)throw new Error(r.message)},gTe=async(e,t)=>{const{error:r}=await Te.from("conta_pagar").update({status:"paga",data_pagamento:t}).in("id",e);if(r)throw new Error(r.message)},vTe=async e=>{if(e.length===0)return;const{error:t}=await Te.from("conta_pagar").update({status:"pendente",data_pagamento:null}).in("id",e);if(t)throw new Error(t.message)},yTe=async(e,t)=>{const{error:r}=await Te.rpc("excluir_conta_pagar",{p_id:e,p_escopo:t});if(r)throw new Error(r.message)},_Te=async e=>{const{error:t}=await Te.rpc("encerrar_recorrencia_conta_pagar",{p_id:e});if(t)throw new Error(t.message)},q2e=async e=>{if(!e)throw new Error("User not authenticated");const{data:t,error:r}=await Te.from("conta_pagar_categoria").select("id, nome").eq("user_id",e).is("desativada_em",null).order("nome");if(r)throw new Error(r.message);return[...N2e,...(t||[]).map(({id:n,nome:i})=>({value:i,label:i,custom:!0,id:n}))]},bTe=async(e,t)=>{if(!e)throw new Error("User not authenticated");const r=t.trim(),n=Object.entries(Tx).find(([,s])=>s.toLowerCase()===r.toLowerCase());if(n)return n[0];const{data:i,error:o}=await Te.rpc("criar_categoria_conta_pagar",{p_nome:r});if(o)throw new Error(o.message);return i||r},xTe=async(e,t)=>{const{error:r}=await Te.rpc("renomear_categoria_conta_pagar",{p_id:e,p_novo_nome:t.trim()});if(r)throw r.code==="23505"||r.message.includes("duplicate key")?new Error("Já existe uma categoria com esse nome."):new Error(r.message)},wTe=async e=>{const{error:t}=await Te.rpc("desativar_categoria_conta_pagar",{p_id:e});if(t)throw new Error(t.message)},G2e=({enabled:e=!0}={})=>{const{user:t}=ot(),r=t==null?void 0:t.id;return Et({queryKey:["contasAPagar"],queryFn:()=>F2e(r),enabled:e&&!!r})},ETe=(e,{enabled:t=!0}={})=>{const{user:r}=ot(),n=r==null?void 0:r.id;return Et({queryKey:["contasAPagar","pagas",e],queryFn:()=>B2e(n,e),enabled:t&&!!n})},K2e=({enabled:e=!0}={})=>{const{user:t}=ot(),r=t==null?void 0:t.id;return Et({queryKey:["contasAPagar","pagasCount"],queryFn:()=>V2e(r),enabled:e&&!!r})},STe=(e,t)=>{const{user:r}=ot(),n=r==null?void 0:r.id;return Et({queryKey:["contasAPagar","resultadoMes",e.toISOString(),t.toISOString()],queryFn:()=>z2e(e,t),enabled:!!n})},CTe=(e,t)=>{const{user:r}=ot(),n=r==null?void 0:r.id;return Et({queryKey:["fluxoCaixaEntradas",e.toISOString(),t.toISOString()],queryFn:()=>H2e(e,t),enabled:!!n})},TTe=e=>{const{user:t}=ot(),r=t==null?void 0:t.id;return Et({queryKey:["contasAPagar",e],queryFn:()=>W2e(r,e),enabled:!!e&&!!r})},ATe=()=>{const{user:e}=ot(),t=e==null?void 0:e.id;return Et({queryKey:["contasAPagarCategorias"],queryFn:()=>q2e(t),enabled:!!t})},Hd="#F97316";function dS(){const e=At(),{data:t}=an(),r=Hn(t),{data:n,isLoading:i}=G2e({enabled:r}),{data:o,isLoading:s}=K2e({enabled:r}),a=v.useMemo(()=>(n||[]).filter(u=>u.status==="pendente"),[n]),l=v.useMemo(()=>{const u=a.filter(g=>gu(Bn(new Date(g.data_vencimento)),Bn(new Date))).length,h=a.filter(g=>mg(new Date(g.data_vencimento))).length,f=a.reduce((g,y)=>g+y.valor,0),p=fg(Wb(new Date,1)),m=a.filter(g=>gu(Bn(new Date(g.data_vencimento)),p)).reduce((g,y)=>g+y.valor,0);return{overdue:u,today:h,totalValue:f,monthValue:m}},[a]);if(!r)return null;if(!i&&a.length===0){if(s)return null;const u=(o??0)>0;return c.jsx(rt.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{type:"spring",stiffness:260,damping:24},children:c.jsxs(F,{onClick:()=>e("/contas-a-pagar"),sx:{display:"flex",alignItems:"center",gap:1.5,borderRadius:"14px",bgcolor:"white",p:2,cursor:"pointer",userSelect:"none",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)","&:active":{transform:"scale(0.97)"}},children:[c.jsx(F,{sx:{width:40,height:40,borderRadius:"10px",bgcolor:gt(Hd,.1),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:c.jsx(h_,{sx:{fontSize:22,color:Hd}})}),c.jsxs(F,{sx:{flex:1,minWidth:0},children:[c.jsx(V,{sx:{fontSize:"0.9rem",fontWeight:700,color:"text.primary",lineHeight:1.25},children:"Contas a pagar"}),u?c.jsxs(me,{direction:"row",alignItems:"center",spacing:.5,sx:{mt:.25},children:[c.jsx(Cx,{sx:{fontSize:14,color:"success.main"}}),c.jsx(V,{sx:{fontSize:"0.75rem",fontWeight:500,color:"success.main"},children:"Tudo em dia, nenhuma conta pendente"})]}):c.jsx(V,{sx:{fontSize:"0.75rem",fontWeight:500,color:"text.secondary",mt:.25},children:"Organize boletos e vencimentos da sua loja"})]}),c.jsx(Oo,{sx:{fontSize:20,color:"text.disabled"}})]})})}if(i)return c.jsxs(F,{sx:{borderRadius:"14px",bgcolor:"white",p:2.5},children:[c.jsxs(me,{direction:"row",spacing:1.5,alignItems:"center",sx:{mb:2},children:[c.jsx(Lt,{variant:"rounded",width:40,height:40,sx:{borderRadius:"10px"}}),c.jsxs(F,{sx:{flex:1},children:[c.jsx(Lt,{variant:"text",width:"50%",height:20}),c.jsx(Lt,{variant:"text",width:"35%",height:16})]})]}),c.jsx(Lt,{variant:"text",width:"45%",height:36}),c.jsxs(me,{direction:"row",spacing:1,sx:{mt:2},children:[c.jsx(Lt,{variant:"rounded",width:"50%",height:56,sx:{borderRadius:"10px"}}),c.jsx(Lt,{variant:"rounded",width:"50%",height:56,sx:{borderRadius:"10px"}})]})]});const d=u=>
227u.toLocaleString("pt-BR",{style:"currency",currency:"BRL"});return c.jsx(rt.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{type:"spring",stiffness:260,damping:24},children:c.jsxs(F,{onClick:()=>e("/contas-a-pagar"),sx:{display:"block",borderRadius:"14px",bgcolor:"white",p:2.5,textDecoration:"none",color:"inherit",cursor:"pointer",userSelect:"none",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)","&:active":{transform:"scale(0.97)"}},children:[c.jsxs(me,{direction:"row",alignItems:"center",spacing:1.5,sx:{mb:1.5},children:[c.jsx(F,{sx:{width:40,height:40,borderRadius:"10px",bgcolor:gt(Hd,.1),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:c.jsx(h_,{sx:{fontSize:22,color:Hd}})}),c.jsxs(F,{sx:{flex:1},children:[c.jsx(V,{sx:{fontSize:"0.9rem",fontWeight:700,color:"text.primary",lineHeight:1.25},children:"Contas a pagar"}),c.jsxs(V,{sx:{fontSize:"0.75rem",fontWeight:500,color:"text.secondary",mt:.25},children:[a.length," ",a.length===1?"conta pendente":"contas pendentes"]})]}),c.jsx(Oo,{sx:{fontSize:20,color:"text.disabled"}})]}),c.jsxs(me,{direction:"row",alignItems:"baseline",spacing:.75,children:[c.jsx(V,{sx:{fontSize:"1.5rem",fontWeight:700,color:Hd,letterSpacing:"-0.02em"},children:d(l.monthValue)}),c.jsx(V,{sx:{fontSize:"0.75rem",fontWeight:500,color:"text.secondary"},children:"este mês"})]}),l.totalValue!==l.monthValue&&c.jsxs(V,{sx:{fontSize:"0.75rem",fontWeight:500,color:"text.secondary",mt:.25},children:[d(l.totalValue)," no total"]}),(l.overdue>0||l.today>0)&&c.jsxs(me,{direction:"row",spacing:1,sx:{mt:2},children:[l.overdue>0&&c.jsxs(F,{sx:{flex:1,py:1.25,px:1.5,borderRadius:"10px",bgcolor:gt("#EF4444",.06)},children:[c.jsxs(me,{direction:"row",alignItems:"center",spacing:.75,sx:{mb:.5},children:[c.jsx(zg,{sx:{fontSize:16,color:"#EF4444"}}),c.jsx(V,{sx:{fontSize:"0.7rem",fontWeight:500,color:"#EF4444"},children:"Em atraso"})]}),c.jsx(V,{sx:{fontSize:"0.95rem",fontWeight:700,color:"#EF4444"},children:l.overdue})]}),l.today>0&&c.jsxs(F,{sx:{flex:1,py:1.25,px:1.5,borderRadius:"10px",bgcolor:gt("#F59E0B",.06)},children:[c.jsxs(me,{direction:"row",alignItems:"center",spacing:.75,sx:{mb:.5},children:[c.jsx(xx,{sx:{fontSize:16,color:"#D97706"}}),c.jsx(V,{sx:{fontSize:"0.7rem",fontWeight:500,color:"#D97706"},children:l.today===1?"Vence hoje":"Vencem hoje"})]}),c.jsx(V,{sx:{fontSize:"0.95rem",fontWeight:700,color:"#D97706"},children:l.today})]})]})]})})}const AL="carousel",kL="controller",Y2e="navigation",RL="no-scroll",qg="portal",Z2e="root",IL="toolbar",X2e="inline",hS="slideshow",kTe="zoom",wu="loading",f_="playing",kh="error",Rh="complete",J2e="placeholder",op=e=>`active-slide-${e}`,Q2e=op(wu),eve=op(f_),tve=op(kh),rve=op(Rh),RTe="fullsize",PL="flex_center",nve="no_scroll",OL="no_scroll_padding",kx="slide",ive="slide_wrapper",ITe="slide_wrapper_interactive",jl="prev",Ll="next",fS="swipe",hc="close",jL="onPointerDown",LL="onPointerMove",$L="onPointerUp",DL="onPointerLeave",ML="onPointerCancel",NL="onKeyDown",ove="onKeyUp",FL="onWheel",sve="Escape",ave="ArrowLeft",lve="ArrowRight",cve="button",p_="icon",UL="contain",pS="cover",uve="Unknown action type",BL="yarl__";function fs(...e){return[...e].filter(Boolean).join(" ")}function sr(e){return`${BL}${e}`}function Jn(e){return`--${BL}${e}`}function sp(e,t){return`${e}${t?`_${t}`:""}`}function Rx(e){return t=>sp(e,t)}function Gu(e,t){var r;return(r=e==null?void 0:e[t])!==null&&r!==void 0?r:t}function dve(e,t,r){return Gu(e,"{index} of {total}").replace(/\{index}/g,`${Ox(r,t.length)+1}`).replace(/\{total}/g,`${t.length}`)}function Ix(...e){return()=>{e.forEach(t=>{t()})}}function ua(e,t,r){return()=>{const n=v.useContext(r);if(!n)throw new Error(`${e} must be used within a ${t}.Provider`);return n}}function Px(){return typeof window<"u"}function hve(e,t=0){const r=10**t;return Math.round((e+Number.EPSILON)*r)/r}function VL(e){return e.type===void 0||e.type==="image"}function fve(e,t){return e.imageFit===pS||e.imageFit!==UL&&t===pS}function Gg(e){return typeof e=="string"?Number.parseInt(e,10):e}function mm(e){if(typeof e=="number")return{pixel:e};if(typeof e=="string"){const t=Gg(e);return e.endsWith("%")?{percent:t}:{pixel:t}}return{pixel:0}}function pve(e,t){const r=mm(t),n=r.percent!==void 0?e.width/100*r.percent:r.pixel;return{width:Math.max(e.width-2*n,0),height:Math.max(e.height-2*n,0)}}function PTe(){return(Px()?window==null?void 0:window.devicePixelRatio:void 0)||1}function Ox(e,t){return t>0?(e%t+t)%t:0}function HL(e){return e.length>0}function zL(e,t){return e[Ox(t,e.length)]}function m_(e,t){return HL(e)?zL(e,t):void 0}function mve(e){return VL(e)?e.src:void 0}function gve(e,t,r){if(!r)return e;const{buttons:n,...i}=e,o=n.findIndex(a=>a===t),s=v.isValidElement(r)?v.cloneElement(r,{key:t},null):r;if(o>=0){const a=[...n];return a.splice(o,1,s),{buttons:a,...i}}return{buttons:[s,...n],...i}}function vve(e,t,r=0){return Math.min(e.preload,Math.max(e.finite?t.length-1:Math.floor(t.length/2),r))}const yve=Number(v.version.split(".")[0])>=19;function _ve(e){return{inert:yve?e:e?"":void 0}}function bve(e){e.scrollTop}const g_={open:!1,close:()=>{},index:0,slides:[],render:{},plugins:[],toolbar:{buttons:[hc]},labels:{},animation:{fade:250,swipe:500,easing:{fade:"ease",swipe:"ease-out",n
227avigation:"ease-in-out"}},carousel:{finite:!1,preload:2,padding:"16px",spacing:"30%",imageFit:UL,imageProps:{}},controller:{ref:null,focus:!0,aria:!1,touchAction:"none",closeOnPullUp:!1,closeOnPullDown:!1,closeOnBackdropClick:!1,preventDefaultWheelX:!0,preventDefaultWheelY:!1,disableSwipeNavigation:!1},portal:{},noScroll:{disabled:!1},on:{},styles:{},className:""};function da(e,t){return{name:e,component:t}}function gn(e,t){return{module:e,children:t}}function WL(e,t,r){return e.module.name===t?r(e):e.children?[gn(e.module,e.children.flatMap(n=>{var i;return(i=WL(n,t,r))!==null&&i!==void 0?i:[]}))]:[e]}function Wc(e,t,r){return e.flatMap(n=>{var i;return(i=WL(n,t,r))!==null&&i!==void 0?i:[]})}function xve(e,t=[],r=[]){let n=e;const i=p=>{const m=[...n];for(;m.length>0;){const g=m.pop();if((g==null?void 0:g.module.name)===p)return!0;g!=null&&g.children&&m.push(...g.children)}return!1},o=(p,m)=>{if(p===""){n=[gn(m,n)];return}n=Wc(n,p,g=>[gn(m,[g])])},s=(p,m)=>{n=Wc(n,p,g=>[gn(g.module,[gn(m,g.children)])])},a=(p,m,g)=>{n=Wc(n,p,y=>{var b;return[gn(y.module,[...g?[gn(m)]:[],...(b=y.children)!==null&&b!==void 0?b:[],...g?[]:[gn(m)]])]})},l=(p,m,g)=>{n=Wc(n,p,y=>[...g?[gn(m)]:[],y,...g?[]:[gn(m)]])},d=p=>{s(kL,p)},u=(p,m)=>{n=Wc(n,p,g=>[gn(m,g.children)])},h=p=>{n=Wc(n,p,m=>m.children)},f=p=>{r.push(p)};return t.forEach(p=>{p({contains:i,addParent:o,append:s,addChild:a,addSibling:l,addModule:d,replace:u,remove:h,augment:f})}),{config:n,augmentation:p=>r.reduce((m,g)=>g(m),p)}}const qL=v.createContext(null),jx=ua("useA11yContext","A11yContext",qL);function wve({children:e}){const[t,r]=v.useState(!1),[n,i]=v.useState(!1),o=v.useMemo(()=>({focusWithin:t,trackFocusWithin:(a,l)=>{const d=u=>h=>{var f;h.currentTarget.contains(h.relatedTarget)||r(u),(f=u?a:l)===null||f===void 0||f(h)};return{onFocus:d(!0),onBlur:d(!1)}},autoPlaying:n,setAutoPlaying:i}),[t,n]);return v.createElement(qL.Provider,{value:o},e)}const GL=v.createContext(null),Lx=ua("useDocument","DocumentContext",GL);function Eve({nodeRef:e,children:t}){const r=v.useMemo(()=>{const n=o=>{var s;return((s=o||e.current)===null||s===void 0?void 0:s.ownerDocument)||document};return{getOwnerDocument:n,getOwnerWindow:o=>{var s;return((s=n(o))===null||s===void 0?void 0:s.defaultView)||window}}},[e]);return v.createElement(GL.Provider,{value:r},t)}const KL=v.createContext(null),ap=ua("useEvents","EventsContext",KL);function Sve({children:e}){const[t]=v.useState({});v.useEffect(()=>()=>{Object.keys(t).forEach(n=>delete t[n])},[t]);const r=v.useMemo(()=>{const n=(s,a)=>{var l;(l=t[s])===null||l===void 0||l.splice(0,t[s].length,...t[s].filter(d=>d!==a))};return{publish:(...[s,a])=>{var l;(l=t[s])===null||l===void 0||l.forEach(d=>d(a))},subscribe:(s,a)=>(t[s]||(t[s]=[]),t[s].push(a),()=>n(s,a)),unsubscribe:n}},[t]);return v.createElement(KL.Provider,{value:r},e)}const YL=v.createContext(null),yd=ua("useLightboxProps","LightboxPropsContext",YL);function Cve({children:e,...t}){return v.createElement(YL.Provider,{value:t},e)}const ZL=v.createContext(null),lp=ua("useLightboxState","LightboxStateContext",ZL),XL=v.createContext(null),Tve=ua("useLightboxDispatch","LightboxDispatchContext",XL);function Ave(e,t){switch(t.type){case"swipe":{const{slides:r}=e,n=(t==null?void 0:t.increment)||0,i=e.globalIndex+n,o=Ox(i,r.length),s=m_(r,o),a=n||t.duration!==void 0?{increment:n,duration:t.duration,easing:t.easing}:void 0;return{slides:r,currentIndex:o,globalIndex:i,currentSlide:s,animation:a}}case"update":return t.slides!==e.slides||t.index!==e.currentIndex?{slides:t.slides,currentIndex:t.index,globalIndex:t.index,currentSlide:m_(t.slides,t.index)}:e;default:throw new Error(uve)}}function kve({slides:e,index:t,children:r}){const[n,i]=v.useReducer(Ave,{slides:e,currentIndex:t,globalIndex:t,currentSlide:m_(e,t)});v.useEffect(()=>{i({type:"update",slides:e,index:t})},[e,t]);const o=v.useMemo(()=>({...n,state:n,dispatch:i}),[n,i]);return v.createElement(XL.Provider,{value:i},v.createElement(ZL.Provider,{value:o},r))}const JL=v.createContext(null),cp=ua("useTimeouts","TimeoutsContext",JL);function Rve({children:e}){const[t]=v.useState([]);v.useEffect(()=>()=>{t.forEach(n=>window.clearTimeout(n)),t.splice(0,t.length)},[t]);const r=v.useMemo(()=>{const n=s=>{t.splice(0,t.length,...t.filter(a=>a!==s))};return{setTimeout:(s,a)=>{const l=window.setTimeout(()=>{n(l),s()},a);return t.push(l),l},clearTimeout:s=>
227{s!==void 0&&(n(s),window.clearTimeout(s))}}},[t]);return v.createElement(JL.Provider,{value:r},e)}const $x=v.forwardRef(function({label:t,className:r,icon:n,renderIcon:i,onClick:o,style:s,...a},l){const{styles:d,labels:u}=yd(),h=Gu(u,t);return v.createElement("button",{ref:l,type:"button",title:h,"aria-label":h,className:fs(sr(cve),r),onClick:o,style:{...s,...d.button},...a},i?i():v.createElement(n,{className:sr(p_),style:d.icon}))});function Ive(e,t){const r=n=>v.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false",...n},t);return r.displayName=e,r}function Cc(e,t){return Ive(e,v.createElement("g",{fill:"currentColor"},v.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t))}const Pve=Cc("Close",v.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),Ove=Cc("Previous",v.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})),jve=Cc("Next",v.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),Lve=Cc("Loading",v.createElement(v.Fragment,null,Array.from({length:8}).map((e,t,r)=>v.createElement("line",{key:t,x1:"12",y1:"6.5",x2:"12",y2:"1.8",strokeLinecap:"round",strokeWidth:"2.6",stroke:"currentColor",strokeOpacity:1/r.length*(t+1),transform:`rotate(${360/r.length*t}, 12, 12)`})))),$ve=Cc("Error",v.createElement("path",{d:"M21.9,21.9l-8.49-8.49l0,0L3.59,3.59l0,0L2.1,2.1L0.69,3.51L3,5.83V19c0,1.1,0.9,2,2,2h13.17l2.31,2.31L21.9,21.9z M5,18 l3.5-4.5l2.5,3.01L12.17,15l3,3H5z M21,18.17L5.83,3H19c1.1,0,2,0.9,2,2V18.17z"})),up=Px()?v.useLayoutEffect:v.useEffect;function QL(){const[e,t]=v.useState(!1);return v.useEffect(()=>{var r,n;const i=(r=window.matchMedia)===null||r===void 0?void 0:r.call(window,"(prefers-reduced-motion: reduce)");t(i==null?void 0:i.matches);const o=s=>t(s.matches);return(n=i==null?void 0:i.addEventListener)===null||n===void 0||n.call(i,"change",o),()=>{var s;return(s=i==null?void 0:i.removeEventListener)===null||s===void 0?void 0:s.call(i,"change",o)}},[]),e}function Dve(e){let t=0,r=0,n=0;const o=window.getComputedStyle(e).transform.match(/matrix.*\((.+)\)/);if(o){const s=o[1].split(",").map(Gg);s.length===6?(t=s[4],r=s[5]):s.length===16&&(t=s[12],r=s[13],n=s[14])}return{x:t,y:r,z:n}}function mS(e,t){const r=v.useRef(void 0),n=v.useRef(void 0),i=QL();return up(()=>{var o,s,a;if(e.current&&r.current!==void 0&&!i){const{keyframes:l,duration:d,easing:u,onfinish:h}=t(r.current,e.current.getBoundingClientRect(),Dve(e.current))||{};if(l&&d){(o=n.current)===null||o===void 0||o.cancel(),n.current=void 0;try{n.current=(a=(s=e.current).animate)===null||a===void 0?void 0:a.call(s,l,{duration:d,easing:u})}catch(f){console.error(f)}n.current&&(n.current.onfinish=()=>{n.current=void 0,h==null||h()})}}r.current=void 0}),{prepareAnimation:o=>{r.current=o},isAnimationPlaying:()=>{var o;return((o=n.current)===null||o===void 0?void 0:o.playState)==="running"}}}function e$(){const e=v.useRef(null),t=v.useRef(void 0),[r,n]=v.useState();return{setContainerRef:v.useCallback(o=>{e.current=o,t.current&&(t.current.disconnect(),t.current=void 0);const s=()=>
227{if(o){const a=window.getComputedStyle(o),l=d=>parseFloat(d)||0;n({width:Math.round(o.clientWidth-l(a.paddingLeft)-l(a.paddingRight)),height:Math.round(o.clientHeight-l(a.paddingTop)-l(a.paddingBottom))})}else n(void 0)};s(),o&&typeof ResizeObserver<"u"&&(t.current=new ResizeObserver(s),t.current.observe(o))},[]),containerRef:e,containerRect:r}}function W0(){const e=v.useRef(void 0),{setTimeout:t,clearTimeout:r}=cp();return v.useCallback((n,i)=>{r(e.current),e.current=t(n,i>0?i:0)},[t,r])}function Rr(e){const t=v.useRef(e);return up(()=>{t.current=e}),v.useCallback((...r)=>{var n;return(n=t.current)===null||n===void 0?void 0:n.call(t,...r)},[])}function gS(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function v_(e,t){return v.useMemo(()=>e==null&&t==null?null:r=>{gS(e,r),gS(t,r)},[e,t])}function t$(e,t=!1){const r=v.useRef(!1);up(()=>{t&&r.current&&(r.current=!1,e())},[t,e]);const n=v.useCallback(()=>{r.current=!0},[]),i=v.useCallback(()=>{r.current=!1},[]);return{onFocus:n,onBlur:i}}function Dx(){const[e,t]=v.useState(!1);return up(()=>{t(window.getComputedStyle(window.document.documentElement).direction==="rtl")},[]),e}function Mve(){const[e]=v.useState({}),t=v.useCallback((i,o)=>{var s;(s=e[i])===null||s===void 0||s.forEach(a=>{o.isPropagationStopped()||a(o)})},[e]),r=v.useMemo(()=>({onPointerDown:i=>t(jL,i),onPointerMove:i=>t(LL,i),onPointerUp:i=>t($L,i),onPointerLeave:i=>t(DL,i),onPointerCancel:i=>t(ML,i),onKeyDown:i=>t(NL,i),onKeyUp:i=>t(ove,i),onWheel:i=>t(FL,i)}),[t]),n=v.useCallback((i,o)=>(e[i]||(e[i]=[]),e[i].unshift(o),()=>{const s=e[i];s&&s.splice(0,s.length,...s.filter(a=>a!==o))}),[e]);return{registerSensors:r,subscribeSensors:n}}function vS(e,t){const r=v.useRef(0),n=W0(),i=Rr((...o)=>{r.current=Date.now(),e(o)});return v.useCallback((...o)=>{n(()=>{i(o)},t-(Date.now()-r.current))},[t,i,n])}const Fv=Rx("slide"),Uv=Rx("slide_image");function Nve({slide:e,offset:t,render:r,rect:n,imageFit:i,imageProps:o,onClick:s,onLoad:a,onError:l,style:d}){var u,h,f,p,m,g,y,b;const[E,S]=v.useState(wu),{publish:k}=ap(),{setTimeout:A}=cp(),w=v.useRef(null);v.useEffect(()=>{t===0&&k(op(E))},[t,E,k]);const _=Rr(re=>{("decode"in re?re.decode():Promise.resolve()).catch(()=>{}).then(()=>{re.parentNode&&(S(Rh),A(()=>{a==null||a(re)},0))})}),x=v.useCallback(re=>{w.current=re,re!=null&&re.complete&&_(re)},[_]),C=v.useCallback(re=>{_(re.currentTarget)},[_]),P=Rr(()=>{S(kh),l==null||l()}),I=fve(e,i),O=(re,_e)=>Number.isFinite(re)?re:_e,D=O(Math.max(...((h=(u=e.srcSet)===null||u===void 0?void 0:u.map(re=>re.width))!==null&&h!==void 0?h:[]).concat(e.width?[e.width]:[]).filter(Boolean)),((f=w.current)===null||f===void 0?void 0:f.naturalWidth)||0),M=O(Math.max(...((m=(p=e.srcSet)===null||p===void 0?void 0:p.map(re=>re.height))!==null&&m!==void 0?m:[]).concat(e.height?[e.height]:[]).filter(Boolean)),((g=w.current)===null||g===void 0?void 0:g.naturalHeight)||0),U=D&&M?{maxWidth:`min(${D}px, 100%)`,maxHeight:`min(${M}px, 100%)`}:{maxWidth:"100%",maxHeight:"100%"},$=(y=e.srcSet)===null||y===void 0?void 0:y.sort((re,_e)=>re.width-_e.width).map(re=>`${re.src} ${re.width}w`).join(", "),j=()=>n&&!I&&e.width&&e.height?n.height/e.height*e.width:Number.MAX_VALUE,q=$&&n&&Px()?`${Math.round(Math.min(j(),n.width))}px`:void 0,{style:W,className:ne,...ae}=o||{};return v.createElement(v.Fragment,null,v.createElement("img",{ref:x,onLoad:C,onError:P,onClick:s,draggable:!1,className:fs(sr(Uv()),I&&sr(Uv("cover")),E!==Rh&&sr(Uv("loading")),ne),style:{...U,...d,...W},...ae,alt:(b=e.alt)!==null&&b!==void 0?b:"",sizes:q,srcSet:$,src:e.src}),E!==Rh&&v.createElement("div",{className:sr(Fv(J2e))},E===wu&&(r!=null&&r.iconLoading?r.iconLoading():v.createElement(Lve,{className:fs(sr(p_),sr(Fv(wu)))})),E===kh&&(r!=null&&r.iconError?r.iconError():v.createElement($ve,{className:fs(sr(p_),sr(Fv(kh)))}))))}const r$=v.forwardRef(function({className:t,children:r,onFocus:n,onBlur:i,...o},s){const a=v.useRef(null),{trackFocusWithin:l}=jx();return v.createElement(Eve,{nodeRef:a},v.createElement("div",{ref:v_(s,a),className:fs(sr("root"),t),...l(n,i),...o},r))});var Dn;(function(e){e[e.NONE=0]="NONE",e[e.SWIPE=1]="SWIPE",e[e.PULL=2]="PULL",e[e.ANIMATION=3]="ANIMATION"})(Dn||(Dn={}));function Fve(e,t,r,n,i){v.useEffect(()=>i?()=>{}:Ix(e(jL,t),e(LL,r),e($L,n),e(DL,n),e(ML,n)),[e,t,r,n,i])}var vo;(function(e){e[e.NONE=0]="NONE",e[e.SWIPE=1]="SWIPE",e[e.PULL=2]="PULL"})(vo||(vo={}));const Bv=30;function Uve({disableSwipeNavigation:e,closeOnBackdropClick:t},r,n,i,o,s,a,l,d,u,h,f,p,m,g,y){const b=v.useRef(0),E=v.useRef([]),S=v.useRef(void 0),k=v.useRef(0),A=v.useRef(vo.NONE),w=v.useCallback(D=>{S.current===D.pointerId&&(S.current=void 0,A.current=vo.NONE);const M=E.current;M.splice(0,M.length,...M.filter(U=>U.pointerId!==D.pointerId))},[]),_=v.useCallback(D=>{w(D),D.persist(),E.current.push(D)},[w]),x=v.useCallback(D=>E.current.find(({pointerId:M})=>D.pointerId===M),[]),C=Rr(D=>{_(D)}),P=(D,M)=>h&&D>M||u&&D<-M,I=Rr(D=>{const M=x(D);if(M)if(S.current===D.pointerId){const U=Date.now()-k.current,$=b.current;A.current===vo.SWIPE?Math.abs($)>.3*i||Math.abs($)>5&&U<o?l($,U):d($):A.current===vo.PULL&&(P($,2*Bv)?m($,U):g($)),b.current=0,A.current=vo.NONE}else{const{target:U}=D;t&&U instanceof HTMLElement&&U===M.target&&(U.classList.contains(sr(kx))||U.classList.contains(sr(ive)))&&y()}w(D)}),O=Rr(D=>{const M=x(D);if(M){const U=S.current===D.pointerId;if(D.buttons===0){U&&b.current!==0?I(D):w(M);return}const $=D.clientX-M.clientX,j=D.clientY-M.clientY;if(S.current===void 0){const q=W=>{_(D),S.current=D.pointerId,k.current=Date.now(),A.current=W};Math.abs($)>Math.abs(j)&&Math.abs($)>Bv&&n($)?e||(q(vo.SWIPE),s()):Math.abs(j)>Math.abs($)&&P(j,Bv)&&(q(vo.PULL),f())}else U&&(A.current===vo.SWIPE?(b.current=$,a($)):A.current===vo.PULL&&(b.current=j,p(j)))}});Fve(r,C,O,I)}function Bve({preventDefaultWheelX:e,preventDefaultWheelY:t}){const r=v.useRef(null),n=Rr(i=>{const o=Math.abs(i.deltaX)>Math.abs(i.deltaY);(o&&e||!o&&t||i.ctrlKey)&&i.preventDefault()});return v.useCallback(i=>{var o;i?i.addEventListener("wheel",n,{passive:!1}):(o=r.current)===null||o===void 0||o.removeEventListener("wheel",n),r.current=i},[n])}function Vve(e,t,r,n,i,o,s,a,l){const d=v.useRef(0),u=v.useRef(0),h=v.useRef(void 0),f=v.useRef(void 0),p=v.useRef(0),m=v.useRef(void 0),g=v.useRef(0),{setTimeout:y,clearTimeout:b}=cp(),E=v.useCallback(()=>{h.current&&(b(h.current),h.current=void 0)},[b]),S=v.useCallback(()=>{f.current&&(b(f.current),f.current=void 0)},[b]),k=Rr(()=>{e!==Dn.SWIPE&&(d.current=0,g.current=0,E(),S())});v.useEffect(k,[e,k]);const A=Rr(_=>{f.current=void 0,d.current===_&&l(d.current)}),w=Rr(_=>{if(_.ctrlKey||Math.abs(_.deltaY)>Math.abs(_.deltaX))return;const x=C=>{p.current=C,b(m.current),m.current=C>0?y(()=>{p.current=0,m.current=void 0},300):void 0};if(e===Dn.NONE){if(Math.abs(_.deltaX)<=1.2*Math.abs(p.current)){x(_.deltaX);return}if(!r(-_.deltaX))return;if(u.current+=_.deltaX,E(),Math.abs(u.current)>30)u.current=0,x(0),g.current=Date.now(),o();else{const C=u.current;h.current=y(()=>{h.current=void 0,C===u.current&&(u.current=0)},i)}}else if(e===Dn.SWIPE){let C=d.current-_.deltaX;if(C=Math.min(Math.abs(C),n)*Math.sign(C),d.current=C,s(C),S(),Math.abs(C)>.2*n){x(_.deltaX),a(C,Date.now()-g.current);return}f.current=y(()=>A(C),2*i)}else x(_.deltaX)});v.useEffect(()=>t(FL,w),[t,w])}const yS=Rx("container"),n$=v.createContext(null),Tc=ua("useController","ControllerContext",n$);function Hve({children:e,...t}){var r;const{carousel:n,animation:i,controller:o,on:s,styles:a,render:l}=t,{closeOnPullUp:d,closeOnPullDown:u,preventDefaultWheelX:h,preventDefaultWheelY:f}=o,[p,m]=v.useState(),g=lp(),y=Tve(),[b,E]=v.useState(Dn.NONE),S=v.useRef(0),k=v.useRef(0),A=v.useRef(1),{registerSensors:w,subscribeSensors:_}=Mve(),{subscribe:x,publish:C}
227=ap(),P=W0(),I=W0(),O=W0(),{containerRef:D,setContainerRef:M,containerRect:U}=e$(),$=v_(Bve({preventDefaultWheelX:h,preventDefaultWheelY:f}),M),j=v.useRef(null),q=v_(j,void 0),{getOwnerDocument:W}=Lx(),ne=Dx(),ae=te=>(ne?-1:1)*(typeof te=="number"?te:1),re=Rr(()=>{var te;return(te=D.current)===null||te===void 0?void 0:te.focus()}),_e=Rr(()=>t),be=Rr(()=>g),J=v.useCallback(te=>C(jl,te),[C]),xe=v.useCallback(te=>C(Ll,te),[C]),Ze=v.useCallback(()=>C(hc),[C]),$e=te=>!(n.finite&&(ae(te)>0&&g.currentIndex===0||ae(te)<0&&g.currentIndex===g.slides.length-1)),Le=te=>{var he;S.current=te,(he=D.current)===null||he===void 0||he.style.setProperty(Jn("swipe_offset"),`${Math.round(te)}px`)},Fe=te=>{var he,ve;k.current=te,A.current=(()=>{const dt=u&&te>0?te:d&&te<0?-te:0;return Math.min(Math.max(hve(1-dt/60*(1-.5),2),.5),1)})(),(he=D.current)===null||he===void 0||he.style.setProperty(Jn("pull_offset"),`${Math.round(te)}px`),(ve=D.current)===null||ve===void 0||ve.style.setProperty(Jn("pull_opacity"),`${A.current}`)},{prepareAnimation:ft}=mS(j,(te,he,ve)=>{if(j.current&&U)return{keyframes:[{transform:`translate(0, ${te.rect.y-he.y+ve.y}px)`,opacity:te.opacity},{transform:"translate(0, 0)",opacity:1}],duration:te.duration,easing:i.easing.fade}}),Ge=(te,he)=>{if(d||u){Fe(te);let ve=0;j.current&&(ve=i.fade*(he?2:1),ft({rect:j.current.getBoundingClientRect(),opacity:A.current,duration:ve})),O(()=>{Fe(0),E(Dn.NONE)},ve),E(Dn.ANIMATION),he||Ze()}},{prepareAnimation:Se,isAnimationPlaying:je}=mS(j,(te,he,ve)=>{var Re;if(j.current&&U&&(!((Re=g.animation)===null||Re===void 0)&&Re.duration)){const He=mm(n.spacing),dt=(He.percent?He.percent*U.width/100:He.pixel)||0;return{keyframes:[{transform:`translate(${ae(g.globalIndex-te.index)*(U.width+dt)+te.rect.x-he.x+ve.x}px, 0)`},{transform:"translate(0, 0)"}],duration:g.animation.duration,easing:g.animation.easing}}}),Ce=Rr(te=>{var he,ve;const Re=te.offset||0,He=Re?i.swipe:(he=i.navigation)!==null&&he!==void 0?he:i.swipe,dt=!Re&&!je()?i.easing.navigation:i.easing.swipe;let{direction:N}=te;const T=(ve=te.count)!==null&&ve!==void 0?ve:1;let R=Dn.ANIMATION,B=He*T;if(!N){const le=U==null?void 0:U.width,ce=te.duration||0,Ke=le?He/le*Math.abs(Re):He;T!==0?(ce<Ke?B=B/Ke*Math.max(ce,Ke/5):le&&(B=He/le*(le-Math.abs(Re))),N=ae(Re)>0?jl:Ll):B=He/2}let G=0;N===jl?$e(ae(1))?G=-T:(R=Dn.NONE,B=He):N===Ll&&($e(ae(-1))?G=T:(R=Dn.NONE,B=He)),B=Math.round(B),I(()=>{Le(0),E(Dn.NONE)},B),j.current&&Se({rect:j.current.getBoundingClientRect(),index:g.globalIndex}),E(R),C(fS,{type:"swipe",increment:G,duration:B,easing:dt})});v.useEffect(()=>{var te,he;!((te=g.animation)===null||te===void 0)&&te.increment&&(!((he=g.animation)===null||he===void 0)&&he.duration)&&P(()=>y({type:"swipe",increment:0}),g.animation.duration)},[g.animation,y,P]);const Pe=[_,$e,(U==null?void 0:U.width)||0,i.swipe,()=>E(Dn.SWIPE),te=>Le(te),(te,he)=>Ce({offset:te,duration:he,count:1}),te=>Ce({offset:te,count:0})],Ue=[()=>{u&&E(Dn.PULL)},te=>Fe(te),te=>Ge(te),te=>Ge(te,!0)];Uve(o,...Pe,d,u,...Ue,Ze),Vve(b,...Pe);const z=Rr(()=>{o.focus&&W().querySelector(`.${sr(qg)} .${sr(yS())}`)&&re()});v.useEffect(z,[z]);const Q=Rr(()=>{var te;(te=s.view)===null||te===void 0||te.call(s,{index:g.currentIndex})});v.useEffect(Q,[g.globalIndex,Q]),v.useEffect(()=>Ix(x(jl,te=>Ce({direction:jl,...te})),x(Ll,te=>Ce({direction:Ll,...te})),x(fS,te=>y(te))),[x,Ce,y]);const ie=v.useMemo(()=>({prev:J,next:xe,close:Ze,focus:re,slideRect:U?pve(U,n.padding):{width:0,height:0},containerRect:U||{width:0,height:0},subscribeSensors:_,containerRef:D,setCarouselRef:q,toolbarWidth:p,setToolbarWidth:m}),[J,xe,Ze,re,_,U,D,q,p,m,n.padding]);return v.useImperativeHandle(o.ref,()=>({prev:J,next:xe,close:Ze,focus:re,getLightboxProps:_e,getLightboxState:be}),[J,xe,Ze,re,_e,be]),v.createElement("div",{ref:$,className:fs(sr(yS()),sr(PL)),style:{...b===Dn.SWIPE?{[Jn("swipe_offset")]:`${Math.round(S.current)}px`}:null,...b===Dn.PULL?{[Jn("pull_offset")]:`${Math.round(k.current)}px`,[Jn("pull_opacity")]:`${A.current}`}:null,...o.touchAction!=="none"?{[Jn("controller_touch_action")]:o.touchAction}:null,...a.container},tabIndex:-1,...w},U&&v.createElement(n$.Provider,{value:ie},e,(r=l.controls)===null||r===void 0?void 0:r.call(l)))}const zve=da(kL,Hve);function bl(e){return sp(AL,e)}function _S(e){return sp(kx,e)}function Wve({slide:e,offset:t}){const r=v.useRef(null),{currentIndex:n,slides:i}=lp(),{slideRect:o,focus:s}=Tc(),{render:a,carousel:{imageFit:l,imageProps:d},on:{click:u},styles:{slide:h},labels:f}=yd(),{getOwnerDocument:p}=Lx(),m=t!==0;v.useEffect(()=>{var y;m&&(!((y=r.current)===null||y===void 0)&&y.contains(p().activeElement))&&s()},[m,s,p]);const g=()=>{var y,b,E,S;let k=(y=a.slide)===null||y===void 0?void 0:y.call(a,{slide:e,offset:t,rect:o});return!k&&VL(e)&&(k=v.createElement(Nve,{slide:e,offset:t,render:a,rect:o,imageFit:l,imageProps:d,onClick:m?void 0:()=>u==null?void 0:u({index:n})})),k?v.createElement(v.Fragment,null,(b=a.slideHeader)===null||b===void 0?void 0:b.call(a,{slide:e}),((E=a.slideContainer)!==null&&E!==void 0?E:({children:A})=>A)({slide:e,children:k}),(S=a.slideFooter)===null||S===void 0?void 0:S.call(a,{slide:e})):null};return v.createElement("div",{ref:r,className:fs(sr(_S()),!m&&sr(_S("current")),sr(PL)),..._ve(m),style:h,role:"group","aria-roledescription":Gu(f,"Slide"),"aria-label":dve(f,i,n+t)},g())}function qve(){const e=yd().styles.slide;return v.createElement("div",{className:sr(kx),style:e})}function Gve({carousel:e,labels:t}){const{slides:r,currentIndex:n,globalIndex:i}=lp(),{setCarouselRef:o}=Tc(),{autoPlaying:s,focusWithin:a}=jx(),l=mm(e.spacing),d=mm(e.padding),u=vve(e,r,1),h=[];if(HL(r))for(let f=n-u;f<=n+u;f+=1){const p=zL(r,f),m=i-n+f,g=e.finite&&(f<0||f>r.length-1);h.push(g?{key:m}:{key:[`${m}
227`,mve(p)].filter(Boolean).join("|"),offset:f-n,slide:p})}return v.createElement("div",{ref:o,className:fs(sr(bl()),h.length>0&&sr(bl("with_slides"))),style:{[`${Jn(bl("slides_count"))}`]:h.length,[`${Jn(bl("spacing_px"))}`]:l.pixel||0,[`${Jn(bl("spacing_percent"))}`]:l.percent||0,[`${Jn(bl("padding_px"))}`]:d.pixel||0,[`${Jn(bl("padding_percent"))}`]:d.percent||0},role:"region","aria-live":s&&!a?"off":"polite","aria-roledescription":Gu(t,"Carousel"),"aria-label":Gu(t,"Photo gallery")},h.map(({key:f,slide:p,offset:m})=>p?v.createElement(Wve,{key:f,slide:p,offset:m}):v.createElement(qve,{key:f})))}const Kve=da(AL,Gve);function i$(){const{carousel:e}=yd(),{slides:t,currentIndex:r}=lp(),n=t.length===0||e.finite&&r===0,i=t.length===0||e.finite&&r===t.length-1;return{prevDisabled:n,nextDisabled:i}}function Yve(e){var t;const r=Dx(),{publish:n}=ap(),{animation:i}=yd(),{prevDisabled:o,nextDisabled:s}=i$(),a=((t=i.navigation)!==null&&t!==void 0?t:i.swipe)/2,l=vS(()=>n(jl),a),d=vS(()=>n(Ll),a),u=Rr(h=>{switch(h.key){case sve:n(hc);break;case ave:(r?s:o)||(r?d:l)();break;case lve:(r?o:s)||(r?l:d)();break}});v.useEffect(()=>e(NL,u),[e,u])}function bS({label:e,icon:t,renderIcon:r,action:n,onClick:i,disabled:o,style:s}){return v.createElement($x,{label:e,icon:t,renderIcon:r,className:sr(`navigation_${n}`),disabled:o,onClick:i,style:s,...t$(Tc().focus,o)})}function Zve({render:{buttonPrev:e,buttonNext:t,iconPrev:r,iconNext:n},styles:i}){const{prev:o,next:s,subscribeSensors:a}=Tc(),{prevDisabled:l,nextDisabled:d}=i$();return Yve(a),v.createElement(v.Fragment,null,e?e():v.createElement(bS,{label:"Previous",action:jl,icon:Ove,renderIcon:r,style:i.navigationPrev,disabled:l,onClick:o}),t?t():v.createElement(bS,{label:"Next",action:Ll,icon:jve,renderIcon:n,style:i.navigationNext,disabled:d,onClick:s}))}const Xve=da(Y2e,Zve),xS=sr(nve),Jve=sr(OL);function Qve(e){return"style"in e}function wS(e,t,r){const n=window.getComputedStyle(e),i=r?"padding-left":"padding-right",o=r?n.paddingLeft:n.paddingRight,s=e.style.getPropertyValue(i);return e.style.setProperty(i,`${(Gg(o)||0)+t}px`),()=>{s?e.style.setProperty(i,s):e.style.removeProperty(i)}}function e5e({noScroll:{disabled:e},children:t}){const r=Dx(),{getOwnerDocument:n,getOwnerWindow:i}=Lx();return v.useEffect(()=>{if(e)return()=>{};const o=[],s=i(),{body:a,documentElement:l}=n(),d=Math.round(s.innerWidth-l.clientWidth);if(d>0){o.push(wS(a,d,r));const u=a.getElementsByTagName("*");for(let h=0;h<u.length;h+=1){const f=u[h];Qve(f)&&s.getComputedStyle(f).getPropertyValue("position")==="fixed"&&!f.classList.contains(Jve)&&o.push(wS(f,d,r))}}return a.classList.add(xS),()=>{a.classList.remove(xS),o.forEach(u=>u())}},[r,e,n,i]),v.createElement(v.Fragment,null,t)}const t5e=da(RL,e5e);function ES(e){return sp(qg,e)}function SS(e,t,r){const n=e.getAttribute(t);return e.setAttribute(t,r),()=>{n?e.setAttribute(t,n):e.removeAttribute(t)}}function r5e({children:e,animation:t,styles:r,className:n,on:i,portal:o,close:s,labels:a}){const[l,d]=v.useState(!1),[u,h]=v.useState(!1),f=v.useRef([]),p=v.useRef(null),{setTimeout:m}=cp(),{subscribe:g}=ap(),b=QL()?0:t.fade;v.useEffect(()=>(d(!0),()=>{d(!1),h(!1)}),[]);const E=Rr(()=>{f.current.forEach(w=>w()),f.current=[]}),S=Rr(()=>{var w;h(!1),E(),(w=i.exiting)===null||w===void 0||w.call(i),m(()=>{var _;(_=i.exited)===null||_===void 0||_.call(i),s()},b)});v.useEffect(()=>g(hc,S),[g,S]);const k=Rr(w=>{var _,x,C;bve(w),h(!0),(_=i.entering)===null||_===void 0||_.call(i);const P=(C=(x=w.parentNode)===null||x===void 0?void 0:x.children)!==null&&C!==void 0?C:[];for(let I=0;I<P.length;I+=1){const O=P[I];["TEMPLATE","SCRIPT","STYLE"].indexOf(O.tagName)===-1&&O!==w&&(f.current.push(SS(O,"inert","")),f.current.push(SS(O,"aria-hidden","true")))}f.current.push(()=>{var I,O;(O=(I=p.current)===null||I===void 0?void 0:I.focus)===null||O===void 0||O.call(I)}),m(()=>{var I;(I=i.entered)===null||I===void 0||I.call(i)},b)}),A=v.useCallback(w=>{w?k(w):E()},[k,E]);return l?Ns.createPortal(v.createElement(r$,{ref:A,className:fs(n,sr(ES()),sr(OL),u&&sr(ES("open"))),"aria-modal":!0,role:"dialog","aria-label":Gu(a,"Lightbox"),style:{...t.fade!==g_.animation.fade?{[Jn("fade_animation_duration")]:`${b}ms`}:null,...t.easing.fade!==g_.animation.easing.fade?{[Jn("fade_animation_timing_function")]:t.easing.fade}:null,...r.root},onFocus:w=>{p.current||(p.current=w.relatedTarget)}},e),o.root||document.body):null}const n5e=da(qg,r5e);function i5e({children:e}){return v.createElement(v.Fragment,null,e)}const o5e=da(Z2e,i5e);function s5e(e){return sp(IL,e)}function a5e({toolbar:{buttons:e},render:{buttonClose:t,iconClose:r},styles:n}){const{close:i,setToolbarWidth:o}=Tc(),{setContainerRef:s,containerRect:a}=e$();up(()=>{o(a==null?void 0:a.width)},[o,a==null?void 0:a.width]);const l=()=>t?t():v.createElement($x,{key:hc,label:"Close",icon:Pve,renderIcon:r,onClick:i});return v.createElement("div",{ref:s,style:n.toolbar,className:sr(s5e())},e==null?void 0:e.map(d=>d===hc?l():d))}const l5e=da(IL,a5e);function o$(e,t){var r;return v.createElement(e.module.component,{key:e.module.name,...t},(r=e.children)===null||r===void 0?void 0:r.map(n=>o$(n,t)))}function c5e(e,t={}){const{easing:r,...n}=e,{easing:i,...o}=t;return{easing:{...r,...i},...n,...o}}function u5e({carousel:e,animation:t,render:r,toolbar:n,controller:i,noScroll:o,on:s,plugins:a,slides:l,index:d,...u}){const{animation:h,carousel:f,render:p,toolbar:m,controller:g,noScroll:y,on:b,slides:E,index:S,plugins:k,...A}=g_,{config:w,augmentation:_}=xve([gn(n5e,[gn(t5e,[gn(zve,[gn(Kve),gn(l5e),gn(Xve)])])])],a||k),x=_({animation:c5e(h,t),carousel:{...f,...e},render:{...p,...r},toolbar:{...m,...n},controller:{...g,...i},noScroll:{...y,...o},on:{...b,...s},...A,...u});return x.open?v.createElement(Cve,{...x},v.createElement(kve,{slides:l||E,index:Gg(d||S)},v.createElement(Rve,null,v.createElement(Sve,null,v.createElement(wve,null,o$(gn(o5e,w),x)))))):null}function d5e({inline:{className:e,style:t,...r}={},styles:n,children:i}){return v.createElement(r$,{className:fs(sr("relative"),e),style:{[Jn("controller_overscroll_behavior")]:"contain auto",...n.root,...t},...r},i)}function h5e({augment:e,replace:t,remove:r}){e(({toolbar:{buttons:n,...i},open:o,close:s,controller:{focus:a,aria:l,touchAction:d,...u},className:h,...f})=>({open:!0,close:()=>{},toolbar:{buttons:n.filter(p=>p!==hc),...i},inline:{style:{width:"100%",height:"100%"},className:h},controller:{focus:!1,aria:!0,touchAction:"pan-y",...u},className:h,...f})),r(RL),t(qg,da(X2e,d5e))}const f5e={autoplay:!1,delay:3e3,ref:null},s$=e=>({...f5e,...e}),a$=v.createContext(null),p5e=ua("useSlideshow","SlideshowContext",a$);function m5e({slideshow:e,carousel:{finite:t},on:r,children:n}){const{autoplay:i,delay:o,ref:s}=s$(e),a=v.useRef(i),[l,d]=v.useState(i),u=v.useRef(void 0),h=v.useRef(void 0),{slides:f,currentIndex:p}=lp(),{setTimeout:m,clearTimeout:g}=cp(),{subscribe:y}=ap(),{next:b}=Tc(),{setAutoPlaying:E}=jx();v.useEffect(()=>E(l),[l,E]);const S=f.length===0||t&&p===f.length-1,k=v.useCallback(()=>{!l&&!S&&d(!0)},[l,S]),A=v.useCallback(()=>{l&&d(!1)},[l]),w=v.useCallback(()=>{g(u.current),u.current=void 0},[g]),_=Rr(()=>{w(),!(!l||S||h.current===wu||h.current===f_)&&(u.current=m(()=>{l&&(h.current=void 0,b())},o))});v.useEffect(_,[p,l,_]),v.useEffect(()=>{l&&S&&d(!1)},[p,l,S]);const x=Rr(()=>{var I;return(I=r.slideshowStart)===null||I===void 0?void 0:I.call(r)}
227),C=Rr(()=>{var I;return(I=r.slideshowStop)===null||I===void 0?void 0:I.call(r)});v.useEffect(()=>{l?x():a.current&&C(),a.current=l},[l,x,C]),v.useEffect(()=>Ix(w,y(Q2e,()=>{h.current=wu,w()}),y(eve,()=>{h.current=f_,w()}),y(tve,()=>{h.current=kh,_()}),y(rve,()=>{h.current=Rh,_()})),[y,w,_]);const P=v.useMemo(()=>({playing:l,disabled:S,play:k,pause:A}),[l,S,k,A]);return v.useImperativeHandle(s,()=>P,[P]),v.createElement(a$.Provider,{value:P},n)}const g5e=Cc("Play",v.createElement("path",{d:"M8 5v14l11-7z"})),v5e=Cc("Pause",v.createElement("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"}));function y5e(){const{playing:e,disabled:t,play:r,pause:n}=p5e(),{render:i}=yd(),o=t$(Tc().focus,t);return i.buttonSlideshow?v.createElement(v.Fragment,null,i.buttonSlideshow({playing:e,disabled:t,play:r,pause:n})):v.createElement($x,{label:e?"Pause":"Play",icon:e?v5e:g5e,renderIcon:e?i.iconSlideshowPause:i.iconSlideshowPlay,onClick:e?n:r,disabled:t,...o})}function _5e({augment:e,addModule:t}){e(({slideshow:r,toolbar:n,...i})=>({toolbar:gve(n,hS,v.createElement(y5e,null)),slideshow:s$(r),...i})),t(da(hS,m5e))}function b5e(e,t){if(!e||!e.conditions||e.conditions.length===0)return!0;const r=e.conditions.map(n=>{const i=t[n.tag];switch(n.operator){case"exists":return i!==void 0;case"not_exists":return i===void 0;case"equals":return i===n.value;case"not_equals":return i!==n.value;case"contains":return typeof i=="string"&&i.includes(String(n.value));default:return!1}});return e.operator==="AND"?r.every(Boolean):r.some(Boolean)}function x5e(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return Math.abs(t)}function w5e(e,t){const r=[...e];let n=t;for(let i=r.length-1;i>0;i--){n=n*1103515245+12345&2147483647;const o=n%(i+1);[r[i],r[o]]=[r[o],r[i]]}return r}function E5e(e,t){if(e.length<=1)return e;const r=new Date,n=`${r.toISOString().split("T")[0]}-${r.getHours()}`,i=x5e(t+n);return w5e(e,i)}const S5e="HOME_BANNERS_CONFIG",C5e=async()=>{const{data:e,error:t}=await Te.from("app_public_vars").select("value").eq("key",S5e).single();if(t){if(t.code==="PGRST116")return null;throw t}if(!(e!=null&&e.value))return null;try{return JSON.parse(e.value)}catch{return console.error("Failed to parse HOME_BANNERS_CONFIG"),null}},T5e=()=>{var o;const{user:e}=ot(),{tags:t,isLoading:r}=al(),n=Et({queryKey:["homeBanners"],queryFn:C5e,staleTime:1e3*60*30});return{banners:v.useMemo(()=>{var a;if(!((a=n.data)!=null&&a.banners)||r)return[];let s=n.data.banners.filter(l=>l.habilitado);return s=s.filter(l=>b5e(l.regrasSegmentacao,t)),s=s.filter(l=>l.imagemMobileUrl||l.imagemDesktopUrl),e!=null&&e.id&&s.length>1?E5e(s,e.id):s},[(o=n.data)==null?void 0:o.banners,t,r,e==null?void 0:e.id]),isLoading:n.isLoading||r,isError:n.isError,error:n.error}},A5e=()=>{const{banners:e,isLoading:t}=T5e(),r=$o(),n=tl(r.breakpoints.down("md")),i=At(),[o,s]=v.useState(0),a=v.useMemo(()=>e.map(f=>({src:n?f.imagemMobileUrl||f.imagemDesktopUrl||"":f.imagemDesktopUrl||f.imagemMobileUrl||""})),[e,n]),l=f=>{const p=e[f];if(!(p!=null&&p.linkUrl))return;const m=n?p.imagemMobileUrl||p.imagemDesktopUrl:p.imagemDesktopUrl||p.imagemMobileUrl;pe(fe.BANNER.CLICK,{bannerId:p.id,bannerName:p.nome,linkUrl:p.linkUrl,imageSrc:m,isMobile:n});let g=p.linkUrl;g.startsWith("https://app.stoqui.com.br/")&&(g=g.replace("https://app.stoqui.com.br","")),g.startsWith("http://")||g.startsWith("https://")?window.open(g,"_blank"):i(g)};if(t||!e.length)return null;const d=e[o],u=!!(d!=null&&d.linkUrl);if(!(e.length>1)){const f=n?e[0].imagemMobileUrl||e[0].imagemDesktopUrl:e[0].imagemDesktopUrl||e[0].imagemMobileUrl;return f?c.jsx(F,{onClick:e[0].linkUrl?()=>l(0):void 0,sx:{width:"100%",aspectRatio:{xs:"800/360",md:"1920/320"},borderRadius:2,overflow:"hidden",cursor:e[0].linkUrl?"pointer":"default",transition:"transform 0.15s ease","&:active":e[0].linkUrl?{transform:"scale(0.98)"}:void 0},children:c.jsx(F,{component:"img",src:f,alt:e[0].nome||"Banner",sx:{width:"100%",height:"100%",objectFit:"cover",display:"block"}})}):null}return c.jsxs(F,{sx:{width:"100%",position:"relative",transition:"transform 0.15s ease","&:active":u?{transform:"scale(0.98)"}:void 0},children:[c.jsx(u5e,{plugins:[h5e,_5e],slides:a,index:o,noScroll:{disabled:!0},on:{view:({index:f})=>s(f),click:()=>l(o)},slideshow:{autoplay:!0,delay:1e4},carousel:{imageFit:"cover",finite:!1,spacing:0,padding:0},inline:{style:{width:"100%",aspectRatio:n?"800/360":"1920/320",borderRadius:12,overflow:"hidden",cursor:u?"pointer":"default"}},render:{buttonPrev:()=>null,buttonNext:()=>null,buttonSlideshow:()=>null},styles:{container:{backgroundColor:"transparent"}}}),c.jsx(F,{sx:{position:"absolute",bottom:12,left:"50%",transform:"translateX(-50%)",display:"flex",justifyContent:"center",gap:.75,zIndex:10},children:e.map((f,p)=>c.jsx(F,{onClick:()=>s(p),sx:{width:8,height:8,borderRadius:"50%",backgroundColor:p===o?"rgba(255, 255, 255, 0.7)":"rgba(255, 255, 255, 0.25)",cursor:"pointer",transition:"background-color 0.2s ease","&:hover":{backgroundColor:p===o?"rgba(255, 255, 255, 0.85)":"rgba(255, 255, 255, 0.4)"}}},f.id))})]})},k5e={lite:29,pro:39,black:89},R5e=()=>{const{data:e,isLoading:t}=an(),{hasTag:r,addTag:n,getTag:i,setTags:o,isLoading:s}=al(),{user:a}=ot(),l=v.useRef(!1),d=v.useRef(null);v.useEffect(()=>
227{if(l.current||t||s||!qe.isNativePlatform()||!a)return;const u=new Date("2025-10-27T00:00:00Z");if(new Date(a.created_at)<u||!e||e.status!=="active")return;const f=`subscription_conversion_tracked_${a.id}`;if(localStorage.getItem(f))return;if(r("subscription_conversion_tracked")){localStorage.setItem(f,"1");return}const p=k5e[e.plan];localStorage.setItem(f,"1"),l.current=!0,pe(fe.SUBSCRIPTION.SUBSCRIBED_TO_STOQUI,{value:p,currency:"BRL",plan:e.plan,source:e.source,product_identifier:e.product_identifier}),e.source==="flappstore"&&df(KI.SUBSCRIBE,{semanticAttributes:{[Sa.ACTION]:"new_subscription",[Sa.VALUE]:p,[Sa.CURRENCY]:"BRL",[Sa.PRODUCTS]:[{[Sa.PRODUCT_ID]:e.product_identifier||e.plan,[Sa.PRODUCT_PRICE]:p,[Sa.CURRENCY]:"BRL"}]},customAttributes:{plan:e.plan,source:e.source}}),n("subscription_conversion_tracked"),console.log(`[Subscription Tracking] Conversion tracked for ${e.plan} plan (${p} BRL)`)},[e,t,s,r,n,a]),v.useEffect(()=>{if(t||s)return;const u=e!=null&&e.gives_access&&(e!=null&&e.plan)?e.plan:"free";if(d.current===u)return;d.current=u;const h=i("plan");if(h===u)return;const f={plan:u},p=i("last_paywall_seen")||"unknown",m=qu[h??"free"]??0,g=qu[u]??0;g>0&&m===0&&!r("paywall_before_first_purchase")?f.paywall_before_first_purchase=p:g>m&&m>0&&(f.paywall_before_upgrade=p),o(f,!0)},[e,t,s,i,r,o])},I5e=async()=>{const e=Ka(wc(new Date,15)),t={source:"manual",plan:"lite",status:"trialing",gives_access:!0,current_period_ends_at:e.getTime(),plan_identifier:"superfrete_promo_15d",auto_renewal_status:"cancelled"};await OI({subscription:t}),console.log("[Superfrete Promo] 15-day LITE trial granted until:",e)},OTe=async()=>{const e=Ka(wc(new Date,60)),t={source:"manual",plan:"lite",status:"trialing",gives_access:!0,current_period_ends_at:e.getTime(),plan_identifier:"superfrete_promo_60d",auto_renewal_status:"cancelled"};await OI({subscription:t}),console.log("[Superfrete Promo] Trial extended to 60 days until:",e)},P5e=e=>!e||!e.gives_access,O5e=()=>{const e=sn(),{data:t,isLoading:r}=an(),{hasTag:n,addTag:i,isLoading:o}=al(),[s,a]=v.useState("idle"),[l,d]=v.useState(!1),[u,h]=v.useState(),[f,p]=v.useState(!1);return v.useEffect(()=>{new URLSearchParams(e.search).get("promo")==="superfrete"&&(p(!0),a("checking"))},[e.search]),v.useEffect(()=>{if(!(!f||s!=="checking")&&!(r||o)){if(n("superfrete_promo_initial_granted")){a("already_applied"),d(!0);return}if(n("superfrete_promo_applied")){a("already_applied"),d(!0);return}if(!P5e(t)){a("ineligible"),d(!0),i("superfrete_promo_ineligible");return}a("eligible"),d(!0)}},[f,s,r,o,n,t,i]),{status:s,isPromoDetected:f,showDialog:l,applyPromo:async()=>{try{a("applying"),await I5e(),i("superfrete_promo_applied"),i("superfrete_promo_initial_granted"),a("applied"),console.log("[Superfrete Promo] Successfully applied 15-day trial")}catch(y){console.error("[Superfrete Promo] Error applying promo:",y),h(y instanceof Error?y.message:"Erro ao aplicar promoção"),a("error")}},closeDialog:()=>{d(!1)},error:u}};var Mx={},j5e=zt;Object.defineProperty(Mx,"__esModule",{value:!0});var y_=Mx.default=void 0,L5e=j5e(Wt()),$5e=c;y_=Mx.default=(0,L5e.default)((0,$5e.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info");const D5e="data:image/svg+xml,%3csvg%20width='200'%20height='200'%20viewBox='0%200%20200%20200'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M168.715%20111.755C168.412%20109.399%20167.453%20107.175%20165.947%20105.337C164.44%20103.5%20162.447%20102.124%20160.195%20101.366L158.351%20100.734C157.036%20100.344%20155.739%2099.8919%20154.495%2099.3921L110.335%2084.0131C109.816%2083.8362%20109.302%2083.6312%20108.813%2083.4094C104.466%2081.4691%20101.442%2078.094%20100.297%2073.9102C99.064%2069.4035%20100.12%2064.4727%20103.27%2060.0278L145.794%200L37.5003%2075.7466C35.5556%2077.1064%2034.0243%2078.9768%2033.0753%2081.1517C32.1262%2083.3266%2031.7963%2085.7213%2032.1218%2088.0718C32.4474%2090.4223%2033.4159%2092.6372%2034.9204%2094.4722C36.4248%2096.3072%2038.4069%2097.6911%2040.648%2098.4711L41.1927%2098.662C43.4767%2099.2624%2045.7102%20100.041%2047.8728%20100.99L90.7666%20115.922C91.2749%20116.096%2091.7859%20116.299%2092.2717%20116.518C96.6183%20118.452%2099.6509%20121.825%20100.802%20126.014C102.04%20130.524%20100.985%20135.46%2097.8314%20139.91L55.2576%20200L163.363%20124.082C165.321%20122.736%20166.862%20120.867%20167.808%20118.687C168.755%20116.507%20169.069%20114.105%20168.715%20111.755Z'%20fill='%230FAE79'%20/%3e%3cpath%20d='M136.929
227%2027.2848C141.073%2018.9621%20144.684%209.97959%20150.076%202.37012L108.198%2061.4938C105.75%2064.9503%20104.904%2068.6905%20105.817%2072.0291C106.643%2075.042%20108.881%2077.4989%20112.129%2078.9506C112.511%2079.1219%20112.913%2079.282%20113.323%2079.4252L146.872%2091.1089C141.275%2086.9699%20136.729%2081.575%20133.598%2075.3583C130.467%2069.1417%20128.839%2062.2769%20128.845%2055.3163C128.845%2047.0695%20131.453%2039.1427%20134.84%2031.6792C135.512%2030.191%20136.208%2028.7262%20136.929%2027.2848Z'%20fill='%230FAE79'%20/%3e%3cpath%20d='M64.1338%20172.16C60.0932%20180.62%2056.3699%20189.737%2050.9365%20197.411L92.9066%20138.164C95.3579%20134.705%2096.2003%20130.959%2095.2849%20127.62C94.4565%20124.602%2092.2102%20122.145%2088.9614%20120.699C88.5767%20120.525%2088.1864%20120.37%2087.7877%20120.236L54.3341%20108.597C59.8683%20112.741%2064.3599%20118.118%2067.4522%20124.301C70.5445%20130.485%2072.1522%20137.304%2072.1476%20144.218C72.1476%20151.799%2069.9012%20159.047%2066.9529%20165.971C66.0572%20168.063%2065.1053%20170.127%2064.1338%20172.16Z'%20fill='%230FAE79'%20/%3e%3c/svg%3e",pi="#0fae79",M5e=({open:e,status:t,onApply:r,onClose:n,error:i})=>{const o=()=>{switch(t){case"checking":return c.jsxs(me,{alignItems:"center",spacing:2,py:4,children:[c.jsx(bn,{sx:{color:pi}}),c.jsx(V,{variant:"body2",color:"text.secondary",children:"Verificando elegibilidade..."})]});case"eligible":return c.jsxs(c.Fragment,{children:[c.jsxs(me,{alignItems:"center",spacing:1.5,pt:3,pb:2.5,px:3,children:[c.jsxs(me,{direction:"row",alignItems:"center",spacing:2,children:[c.jsx(F,{component:"img",src:D5e,alt:"SuperFrete",sx:{width:40,height:40}}),c.jsx(V,{variant:"h5",color:pi,children:"Ã"}),c.jsx(F,{component:"img",src:Ua,alt:"Stoqui",sx:{height:28}})]}),c.jsxs(me,{direction:"row",alignItems:"center",spacing:.5,children:[c.jsx(V,{variant:"h6",fontWeight:"bold",children:"60 dias de"}),c.jsx(ip,{variant:"contained",fontSize:"0.9rem"}),c.jsx(V,{variant:"h6",fontWeight:"bold",children:"grátis"})]})]}),c.jsx(Er,{sx:{px:3,pb:3,pt:0},children:c.jsxs(me,{spacing:2,children:[c.jsxs(F,{children:[c.jsxs(V,{variant:"body2",color:"text.secondary",mb:1.5,children:[c.jsx("strong",{children:"15 dias"})," liberados agora. Complete 3 passos para ganhar ",c.jsx("strong",{children:"60 dias"}),":"]}),c.jsxs(me,{spacing:.5,children:[c.jsx(V,{variant:"body2",children:"1. Integre sua conta SuperFrete"}),c.jsx(V,{variant:"body2",children:"2. Crie uma etiqueta pelo Stoqui"}),c.jsx(V,{variant:"body2",children:"3. Faça seu primeiro envio grátis"})]})]}),c.jsxs(F,{sx:{background:`linear-gradient(135deg, ${pi} 0%, #0d9868 100%)`,borderRadius:1,p:2,textAlign:"center"},children:[c.jsx(V,{variant:"h6",color:"white",fontWeight:"bold",children:"+ R$ 100 em créditos"}),c.jsx(V,{variant:"caption",color:"white",children:"Para usar em envios com SuperFrete"})]}),c.jsx(If,{onClick:r,variant:"contained",fullWidth:!0,sx:{bgcolor:pi,"&:hover":{bgcolor:"#0d9868"},mt:1},children:"Ativar"})]})})]});case"applying":return c.jsxs(me,{alignItems:"center",spacing:2,py:4,children:[c.jsx(bn,{sx:{color:pi}}),c.jsx(V,{variant:"body2",color:"text.secondary",children:"Ativando..."})]});case"applied":return c.jsxs(c.Fragment,{children:[c.jsxs(me,{alignItems:"center",spacing:1.5,pt:3,pb:2,px:3,children:[c.jsx(F,{sx:{width:64,height:64,borderRadius:"50%",bgcolor:"rgba(15, 174, 121, 0.1)",display:"flex",alignItems:"center",justifyContent:"center"},children:c.jsx(pm,{sx:{fontSize:40,color:pi}})}),c.jsx(V,{variant:"h6",fontWeight:"bold",children:"Promoção ativada!"}),c.jsx(Fn,{label:"15 dias liberados",size:"small",sx:{bgcolor:"rgba(15, 174, 121, 0.1)",color:pi}})]}),c.jsx(Er,{sx:{px:3,pb:3,pt:0},children:c.jsxs(me,{spacing:2,children:[c.jsx(F,{sx:{bgcolor:"rgba(33, 150, 243, 0.08)",borderRadius:1,p:2},children:c.jsxs(me,{direction:"row",spacing:1,alignItems:"flex-start",children:[c.jsx(y_,{sx:{color:"info.main",fontSize:20,mt:.2}}),c.jsxs(F,{children:[c.jsx(V,{variant:"body2",fontWeight:"bold",gutterBottom:!0,children:"Para os 60 dias completos:"}),c.jsx(V,{variant:"body2",color:"text.secondary",children:"1. Integre o SuperFrete"}),c.jsx(V,{variant:"body2",color:"text.secondary",children:"2. Crie a etiqueta pelo Stoqui"}),c.jsx(V,{variant:"body2",color:"text.secondary",children:"3. Faça o envio grátis"})]})]})}),c.jsx(De,{onClick:n,variant:"contained",fullWidth:!0,sx:{bgcolor:pi,"&:hover":{bgcolor:"#0d9868"}},children:"Começar"})]})})]});case"already_applied":return c.jsxs(c.Fragment,{children:[c.jsxs(me,{alignItems:"center",spacing:1.5,pt:3,pb:2,px:3,children:[c.jsx(F,{sx:{width:64,height:64,borderRadius:"50%",bgcolor:"rgba(15, 174, 121, 0.1)",display:"flex",alignItems:"center",justifyContent:"center"},children:c.jsx(pm,{sx:{fontSize:40,color:pi}})}),c.jsx(V,{variant:"h6",fontWeight:"bold",children:"Você já participa!"}),c.jsx(Fn,{label:"15 dias ativos",size:"small",sx:{bgcolor:"rgba(15, 174, 121, 0.1)",color:pi}})]}),c.jsx(Er,{sx:{px:3,pb:3,pt:0},children:c.jsxs(me,{spacing:2,children:[c.jsx(F,{sx:{bgcolor:"rgba(33, 150, 243, 0.08)",borderRadius:1,p:2},children:c.jsxs(me,{direction:"row",spacing:1,alignItems:"flex-start",children:[c.jsx(y_,{sx:{color:"info.main",fontSize:20,mt:.2}}),c.jsxs(F,{children:[c.jsx(V,{variant:"body2",fontWeight:"bold",gutterBottom:!0,children:"Complete os passos para 60 dias:"}),c.jsx(V,{variant:"body2",color:"text.secondary",children:"1. Integre SuperFrete"}),c.jsx(V,{variant:"body2",color:"text.secondary",children:"2. Crie etiqueta"}),c.jsx(V,{variant:"body2",color:"text.secondary",children:"3. Faça o envio"})]})]})}),c.jsx(De,{onClick:n,variant:"contained",fullWidth:!0,sx:{bgcolor:pi,"&:hover":{bgcolor:"#0d9868"}},children:"Continuar"})]})})]});case"ineligible":return c.jsxs(c.Fragment,{children:[c.jsxs(me,{alignItems:"center",spacing:1.5,pt:3,pb:2,px:3,children:[c.jsx(F,{sx:{width:64,height:64,borderRadius:"50%",bgcolor:"rgba(15, 174, 121, 0.1)",display:"flex",alignItems:"center",justifyContent:"center"},children:c.jsx(Jj,{style:{fontSize:40,color:pi}})}),c.jsx(V,{variant:"h6",fontWeight:"bold",children:"Você tem um presente!"})]}),c.jsx(Er,{sx:{px:3,pb:3,pt:0},children:c.jsxs(me,{spacing:2,children:[c.jsx(V,{variant:"body2",textAlign:"center",color:"text.secondary",children:"Como você já é um usuário Stoqui:"}),c.jsxs(F,{sx:{background:`linear-gradient(135deg, ${pi} 0%, #0d9868 100%)`,borderRadius:1,p:2.5,textAlign:"center"},children:[c.jsx(V,{variant:"h4",color:"white",fontWeight:"bold",children:"R$ 100"}),c.jsx(V,{variant:"body2",color:"white",children:"em créditos SuperFrete"})]}),c.jsxs(F,{sx:{bgcolor:"background.default",borderRadius:1,p:2},children:[c.jsx(V,{variant:"body2",fontWeight:"bold",gutterBottom:!0,children:"Para resgatar:"}),c.jsx(V,{variant:"body2",color:"text.secondary",children:"1. Integre sua conta SuperFrete"}),c.jsx(V,{variant:"body2",color:"text.secondary",children:"2. Avise o suporte sobre a promoção"})]}),c.jsx(De,{onClick:n,variant:"contained",fullWidth:!0,sx:{bgcolor:pi,"&:hover":{bgcolor:"#0d9868"}},children:"Vou resgatar!"})]})})]});
227case"error":return c.jsxs(c.Fragment,{children:[c.jsx(me,{alignItems:"center",spacing:1.5,pt:3,pb:2,px:3,children:c.jsx(V,{variant:"h6",fontWeight:"bold",children:"Erro"})}),c.jsx(Er,{sx:{px:3,pb:3,pt:0},children:c.jsxs(me,{spacing:2,children:[c.jsx(F,{sx:{bgcolor:"rgba(211, 47, 47, 0.08)",borderRadius:1,p:2},children:c.jsx(V,{variant:"body2",color:"error.main",children:i||"Ocorreu um erro ao ativar a promoção"})}),c.jsx(V,{variant:"body2",textAlign:"center",color:"text.secondary",children:"Tente novamente ou contate o suporte."}),c.jsx(De,{onClick:n,variant:"contained",color:"error",fullWidth:!0,children:"Fechar"})]})})]});default:return null}};return c.jsx(Fr,{open:e,onClose:n,maxWidth:"xs",fullWidth:!0,PaperProps:{sx:{m:2,borderRadius:2}},children:o()})},Vv="#8865FE";function N5e({title:e,subtitle:t,trackingLocation:r,minAccountAgeDays:n=0,sx:i}){const{user:o}=ot(),{isGranted:s,isReady:a,openNotificationSettings:l,enable:d,isEnabling:u,showSettingsDialog:h,setShowSettingsDialog:f}=Bj(m=>pe(fe.ONESIGNAL.PERMISSION_CONTEXTUAL_ACCEPTED,{userId:o==null?void 0:o.id,location:r,granted:m}));if(!qe.isNativePlatform()||!a||s||n>0&&(!(o!=null&&o.created_at)||Jb(new Date,new Date(o.created_at))<n))return null;const p=()=>{f(!1),l()};return c.jsxs(c.Fragment,{children:[c.jsx(F,{sx:{borderRadius:"14px",bgcolor:gt(Vv,.06),p:2,...i},children:c.jsxs(me,{direction:"row",spacing:1.5,alignItems:"center",children:[c.jsx(F,{sx:{width:36,height:36,borderRadius:"10px",bgcolor:gt(Vv,.12),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:c.jsx(P_,{sx:{fontSize:20,color:Vv}})}),c.jsxs(F,{sx:{flex:1,minWidth:0},children:[c.jsx(V,{sx:{fontSize:"0.85rem",fontWeight:700,color:"text.primary",lineHeight:1.25},children:e}),c.jsx(V,{sx:{fontSize:"0.75rem",fontWeight:500,color:"text.secondary",mt:.25},children:t})]}),c.jsx(De,{variant:"contained",size:"small",onClick:d,disabled:u,sx:{borderRadius:"10px",flexShrink:0,textTransform:"none",px:2,py:.75,fontSize:"0.8rem",fontWeight:600},children:"Ativar"})]})}),c.jsx(Vj,{open:h,onClose:()=>f(!1),onOpenSettings:p})]})}const F5e=new Set(["paid","processing","shipped","delivered"]);function U5e(e,t,r){if(r!==null){const i=e.find(o=>o.produto_id===t&&o.produto_variacao_id===r);if(i)return i.fonte}const n=e.find(i=>i.produto_id===t&&i.produto_variacao_id===null);return(n==null?void 0:n.fonte)??null}const B5e=()=>{const{user:e}=ot();return Et({enabled:!!(e!=null&&e.id),queryKey:["digital-codigo-awaiting",e==null?void 0:e.id],queryFn:async()=>{if(!(e!=null&&e.id))return{totalOrders:0,totalItems:0,firstPedidoId:null};const{data:t,error:r}=await Te.from("produto_arquivo_digital").select("produto_id").eq("fonte","codigo");if(r)throw r;const n=Array.from(new Set((t||[]).map(E=>E.produto_id)));if(n.length===0)return{totalOrders:0,totalItems:0,firstPedidoId:null};const{data:i,error:o}=await Te.from("produto_arquivo_digital").select("produto_id, produto_variacao_id, fonte").in("produto_id",n);if(o)throw o;const s=i||[];if(s.length===0)return{totalOrders:0,totalItems:0,firstPedidoId:null};const a=Array.from(new Set(s.map(E=>E.produto_id))),{data:l,error:d}=await Te.from("itens_pedido").select(` 228 pedido_id, 229 produto_id, 230 produto_variacao_id, 231 quantidade, 232 digital_codigo, 233 digital_codigos, 234 pedido:pedido!inner ( 235 pedido_id, 236 status_pedido, 237 vendedor_id, 238 deletado_em 239 ) 240 `).in("produto_id",a).in("pedido.status_pedido",Array.from(F5e)).eq("pedido.vendedor_id",e.id).is("pedido.deletado_em",null).order("pedido_id",{ascending:!1});if(d)throw d;const u=(l||[]).filter(E=>{if(U5e(s,E.produto_id,E.produto_variacao_id)!=="codigo")return!1;const k=E.digital_codigos&&E.digital_codigos.length||(E.digital_codigo?1:0),A=Math.max(1,Number(E.quantidade)||1);return k<A});if(u.length===0)return{totalOrders:0,totalItems:0,firstPedidoId:null};const h=Array.from(new Set(u.map(E=>E.produto_id))),{data:f,error:p}=await Te.from("produto_codigo_digital").select("produto_id, produto_variacao_id").in("produto_id",h).is("usado_em",null);if(p)throw p;const m=new Set;for(const E of f||[])m.add(`${E.produto_id}:${E.produto_variacao_id??"base"}`);const g=u.filter(E=>{const S=`${E.produto_id}:${E.produto_variacao_id??"base"}`;return!m.has(S)}),y=new Set(g.map(E=>E.pedido_id)),b=g.length>0?g[0].pedido_id:null;return{totalOrders:y.size,totalItems:g.length,firstPedidoId:b}},staleTime:60*1e3})},V5e=()=>{const e=At(),{data:t}=B5e();if(!t||t.totalOrders===0)return null;const r=t.totalOrders===1?"1 pedido aguardando código":`${t.totalOrders.toLocaleStr
240ing("pt-BR")} pedidos aguardando código`,n=()=>{t.totalOrders===1&&t.firstPedidoId?e(`/orders/${t.firstPedidoId}`):e("/orders")};return c.jsx(_s,{severity:"warning",title:r,onClick:n,children:"Adicione mais códigos no produto para liberar o acesso."})};var Nx={},H5e=zt;Object.defineProperty(Nx,"__esModule",{value:!0});var l$=Nx.default=void 0,z5e=H5e(Wt()),W5e=c;l$=Nx.default=(0,z5e.default)((0,W5e.jsx)("path",{d:"M12 7c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1s-1-.45-1-1V8c0-.55.45-1 1-1m-.01-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m1-3h-2v-2h2z"}),"ErrorOutlineRounded");const c$=e=>c.jsxs(Pn,{...e,viewBox:"0 0 51 51",children:[c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22 22.1598C25.3137 22.1598 28 24.8461 28 28.1598V44.1598C28 47.4735 25.3137 50.1598 22 50.1598H6C2.68629 50.1598 0 47.4735 0 44.1598V28.1598C5.79831e-07 24.8461 2.68629 22.1598 6 22.1598H22ZM5 45.1598H23V27.1598H18V32.1598C18 33.2644 17.1046 34.1598 16 34.1598H12C10.8954 34.1598 10 33.2644 10 32.1598V27.1598H5V45.1598Z"}),c.jsx("path",{d:"M45 22.1598L45.3086 22.1676C48.4789 22.3282 51 24.9496 51 28.1598V44.1598L50.9922 44.4684C50.8367 47.5365 48.3767 49.9965 45.3086 50.152L45 50.1598H31.2207C32.1744 48.697 32.7869 46.9932 32.9521 45.1598H45C45.5523 45.1598 46 44.7121 46 44.1598V28.1598C46 27.6075 45.5523 27.1598 45 27.1598H41V33.1598C41 34.2643 40.1046 35.1598 39 35.1598H35C33.8954 35.1598 33 34.2643 33 33.1598V27.1598H32.9531C32.7878 25.3263 32.1745 23.6225 31.2207 22.1598H45Z"}),c.jsx("path",{d:"M17.8086 5.00003C17.2563 5.00003 16.8086 5.44774 16.8086 6.00003V17.8345H11.8086V6.00003C11.8086 2.68632 14.4949 2.57069e-05 17.8086 2.56747e-05H33.8086L34.1172 0.00783817C37.2875 0.168455 39.8086 2.78982 39.8086 6.00003V17.8345H34.8086V6.00003C34.8086 5.44774 34.3609 5.00003 33.8086 5.00003H29.8086V9.00003C29.8086 10.1046 28.9132 11 27.8086 11H23.8086C22.704 11 21.8086 10.1046 21.8086 9.00003V5.00003H17.8086Z"})]}),q5e=async e=>{if(!e)throw new Error("User not authenticated");const{data:t,error:r}=await Te.rpc("get_stock_counts_for_user",{user_id_param:e}).single(),n=t;if(r)throw console.error("Error fetching stock counts:",r),new Error(r.message);if(!n)return console.warn("No data returned from get_stock_counts_for_user RPC."),{all:0,inStock:0,lowStock:0,outOfStock:0,stockEnabled:0,stockDisabled:0};const i=n.low_stock_count??0,o=n.out_of_stock_count??0,s=n.stock_enabled_count??0,a=n.stock_disabled_count??0,l=a+(s-o);return{all:n.all_count??0,inStock:Math.max(0,l),lowStock:i,outOfStock:o,stockEnabled:s,stockDisabled:a}},G5e=()=>{const{user:e}=ot(),t=e==null?void 0:e.id;return Et({queryKey:["stock-counts"],queryFn:()=>q5e(t),enabled:!!t})},Gi={inStock:"#2AC769",lowStock:"#F59E0B",outOfStock:"#EF4444"};function CS(){const e=At(),{data:t,isLoading:r}=G5e();if(r)return c.jsxs(F,{sx:{borderRadius:"14px",bgcolor:"white",p:2.5},children:[c.jsxs(me,{direction:"row",spacing:1.5,alignItems:"center",sx:{mb:2},children:[c.jsx(Lt,{variant:"rounded",width:40,height:40,sx:{borderRadius:"10px"}}),c.jsxs(F,{sx:{flex:1},children:[c.jsx(Lt,{variant:"text",width:"40%",height:20}),c.jsx(Lt,{variant:"text",width:"55%",height:16})]})]}),c.jsx(Lt,{variant:"rounded",width:"100%",height:8,sx:{borderRadius:4}}),c.jsxs(me,{direction:"row",spacing:1,sx:{mt:2},children:[c.jsx(Lt,{variant:"rounded",width:"33%",height:64,sx:{borderRadius:"10px"}}),c.jsx(Lt,{variant:"rounded",width:"33%",height:64,sx:{borderRadius:"10px"}}),c.jsx(Lt,{variant:"rounded",width:"33%",height:64,sx:{borderRadius:"10px"}})]})]});if(!t)return null;const{inStock:n,lowStock:i,outOfStock:o,stockEnabled:s}=t,a=s,l=a>0?n/a*100:0,d=a>0?i/a*100:0,u=a>0?o/a*100:0;return c.jsx(rt.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{type:"spring",stiffness:260,damping:24},children:c.jsxs(F,{onClick:()=>e("/stock"),sx:{display:"block",borderRadius:"14px",bgcolor:"white",p:2.5,textDecoration:"none",color:"inherit",cursor:"pointer",userSelect:"none",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)","&:active":{transform:"scale(0.97)"}},children:[c.jsxs(me,{direction:"row",alignItems:"center",spacing:1.5,sx:{mb:2},children:[c.jsx(F,{sx:{width:40,height:40,borderRadius:"10px",bgcolor:gt(Gi.inStock,.1),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}
240,children:c.jsx(c$,{sx:{fontSize:22,color:Gi.inStock}})}),c.jsxs(F,{sx:{flex:1},children:[c.jsx(V,{sx:{fontSize:"0.9rem",fontWeight:700,color:"text.primary",lineHeight:1.25},children:"Estoque"}),c.jsxs(V,{sx:{fontSize:"0.75rem",fontWeight:500,color:"text.secondary",mt:.25},children:[a," ",a===1?"produto com controle":"produtos com controle"]})]}),c.jsx(Oo,{sx:{fontSize:20,color:"text.disabled"}})]}),c.jsxs(F,{sx:{display:"flex",height:8,borderRadius:4,overflow:"hidden",mb:2},children:[l>0&&c.jsx(F,{sx:{width:`${l}%`,bgcolor:Gi.inStock,transition:"width 0.6s cubic-bezier(0.16, 1, 0.3, 1)"}}),d>0&&c.jsx(F,{sx:{width:`${d}%`,bgcolor:Gi.lowStock,transition:"width 0.6s cubic-bezier(0.16, 1, 0.3, 1)"}}),u>0&&c.jsx(F,{sx:{width:`${u}%`,bgcolor:Gi.outOfStock,transition:"width 0.6s cubic-bezier(0.16, 1, 0.3, 1)"}})]}),c.jsxs(me,{direction:"row",spacing:1,children:[c.jsxs(F,{sx:{flex:1,py:1.25,px:1.5,borderRadius:"10px",bgcolor:gt(Gi.inStock,.06)},children:[c.jsxs(me,{direction:"row",alignItems:"center",spacing:.5,sx:{mb:.5},children:[c.jsx(Cx,{sx:{fontSize:15,color:Gi.inStock}}),c.jsx(V,{sx:{fontSize:"0.7rem",fontWeight:500,color:"text.secondary"},children:"Em estoque"})]}),c.jsx(V,{sx:{fontSize:"1.1rem",fontWeight:700,color:Gi.inStock},children:n})]}),c.jsxs(F,{sx:{flex:1,py:1.25,px:1.5,borderRadius:"10px",bgcolor:gt(Gi.lowStock,.06)},children:[c.jsxs(me,{direction:"row",alignItems:"center",spacing:.5,sx:{mb:.5},children:[c.jsx(zg,{sx:{fontSize:15,color:"#D97706"}}),c.jsx(V,{sx:{fontSize:"0.7rem",fontWeight:500,color:"text.secondary"},children:"Baixo"})]}),c.jsx(V,{sx:{fontSize:"1.1rem",fontWeight:700,color:"#D97706"},children:i})]}),c.jsxs(F,{sx:{flex:1,py:1.25,px:1.5,borderRadius:"10px",bgcolor:gt(Gi.outOfStock,.06)},children:[c.jsxs(me,{direction:"row",alignItems:"center",spacing:.5,sx:{mb:.5},children:[c.jsx(l$,{sx:{fontSize:15,color:Gi.outOfStock}}),c.jsx(V,{sx:{fontSize:"0.7rem",fontWeight:500,color:"text.secondary"},children:"Esgotado"})]}),c.jsx(V,{sx:{fontSize:"1.1rem",fontWeight:700,color:Gi.outOfStock},children:o})]})]})]})})}var Fx={},K5e=zt;Object.defineProperty(Fx,"__esModule",{value:!0});var u$=Fx.default=void 0,Y5e=K5e(Wt()),Z5e=c;u$=Fx.default=(0,Y5e.default)((0,Z5e.jsx)("path",{d:"M20.22 6.86c-2-.6-4.06-.04-5.39 1.29L12 10.66 10.48 12h.01L7.8 14.39c-.81.81-1.95 1.15-3.12.92-1.25-.25-2.28-1.25-2.57-2.49-.52-2.23 1.16-4.2 3.29-4.2.91 0 1.76.35 2.44 1.03l.47.41c.38.34.95.34 1.33 0 .45-.4.45-1.1 0-1.5l-.42-.36C8.2 7.18 6.84 6.62 5.4 6.62 2.42 6.62 0 9.04 0 12s2.42 5.38 5.4 5.38c1.44 0 2.8-.56 3.77-1.53l2.83-2.5.01.01L13.52 12h-.01l2.69-2.39c.81-.81 1.95-1.15 3.12-.92 1.25.25 2.28 1.25 2.57 2.49.52 2.23-1.16 4.2-3.29 4.2-.9 0-1.76-.35-2.44-1.03l-.48-.42c-.38-.34-.95-.34-1.33 0-.45.4-.45 1.1 0 1.5l.42.37c1.02 1.01 2.37 1.57 3.82 1.57 3.27 0 5.86-2.9 5.33-6.25-.3-1.99-1.77-3.69-3.7-4.26"}),"AllInclusiveRounded");const X5e=async e=>{if(!e)throw new Error("User must be logged in to fetch categories.");const{data:t,error:r}=await Te.rpc("get_categories_with_product_count",{user_id_param:e,show_hidden_param:!0});if(r)throw r;return t},d$=()=>{const{user:e}=ot(),t=e==null?void 0:e.id;return Et({queryKey:["categories"],queryFn:()=>X5e(t),enabled:!!t})},J5e=()=>{var d,u;const{data:e,isLoading:t}
240=d$(),{data:r}=an(),n=np(r),i=((d=Qn[n])==null?void 0:d.categories)||Qn.free.categories,o=((u=e==null?void 0:e.filter(h=>h.id>0))==null?void 0:u.length)??0,s=o>=i,a=o>i,l=o-i;return{categoryCount:o,categoryLimit:i,hasReachedLimit:s,isLoading:t,isSubscribed:(r==null?void 0:r.gives_access)??!1,userPlan:n,hasExceededLimit:a,categoriesOverLimit:l}},Q5e=async e=>{if(!e)throw new Error("User is not authenticated");const t=fg(new Date),r=pg(new Date),{count:n,error:i}=await Te.from("pedido").select("*",{count:"exact",head:!0}).eq("vendedor_id",e).eq("origem","manual").neq("status_pedido","cart").is("deletado_em",null).gte("data_pedido",t.toISOString()).lte("data_pedido",r.toISOString());if(i)throw new Error(i.message);return n||0},h$=()=>{const{user:e}=ot(),t=e==null?void 0:e.id;return Et({queryKey:["manual-orders-count"],queryFn:()=>Q5e(t),staleTime:1e3*60*120,enabled:!!t})},eye=e=>e===1/0?"â":new Intl.NumberFormat("pt-BR",{minimumFractionDigits:0,maximumFractionDigits:0}).format(e),jTe=(e,t=1)=>e.toLocaleString("pt-BR",{minimumFractionDigits:t,maximumFractionDigits:t}),LTe=(e,t=1)=>e.toLocaleString("pt-BR",{minimumFractionDigits:t,maximumFractionDigits:t}),tye=({variant:e="text",fontSize:t="inherit",sx:r={}})=>{const n={color:"rgb(94, 208, 150)",display:"flex"},i={background:"linear-gradient(90deg, #36B37E 0%, #238462 100%)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",MozBackgroundClip:"text",MozTextFillColor:"transparent"};return e==="contained"?c.jsxs(F,{sx:{display:"inline-flex",alignItems:"center",gap:"2px",px:1,py:.5,borderRadius:"8px",background:"linear-gradient(90deg, #36B37E 0%, #238462 100%)",...r},children:[c.jsx(Cd,{sx:{fontSize:t,...n}}),c.jsx(V,{component:"span",sx:{fontWeight:600,color:"#fff",fontSize:t,lineHeight:1},children:"GRÃTIS"})]}):e==="ghost"?c.jsxs(F,{sx:{display:"inline-flex",alignItems:"center",gap:"2px",px:1,py:.5,borderRadius:"8px",backgroundColor:"rgba(54, 179, 126, 0.1)",...r},children:[c.jsx(Cd,{sx:{fontSize:t,...n}}),c.jsx(V,{component:"span",sx:{fontWeight:600,color:"#36B37E",fontSize:t,lineHeight:1},children:"GRÃTIS"})]}):e==="cutout"?c.jsxs(F,{sx:{display:"inline-flex",alignItems:"center",gap:"2px",px:1,py:.5,borderRadius:"8px",backgroundColor:"divider",isolation:"isolate",color:"white",...r},children:[c.jsx(Cd,{sx:{fontSize:t,mixBlendMode:"destination-out"}}),c.jsx(V,{component:"span",sx:{fontWeight:600,fontSize:t,lineHeight:1,mixBlendMode:"destination-out"},children:"GRÃTIS"})]}):e==="label"?c.jsxs(F,{sx:{display:"inline-flex",alignItems:"center",gap:"2px",px:0,py:.5,borderRadius:"8px",color:"text.secondary",...r},children:[c.jsx(Cd,{sx:{fontSize:t,color:"#36B37E"}}),c.jsx(V,{component:"span",sx:{fontWeight:600,fontSize:t,lineHeight:1,color:"#36B37E"},children:"GRÃTIS"})]}):c.jsxs(F,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:"2px",px:1,py:.2,...r},children:[c.jsx(Cd,{sx:{fontSize:"inherit",...n}}),c.jsx(V,{component:"span",sx:{fontWeight:600,fontSize:t,lineHeight:1,...i},children:"GRÃTIS"})]})},rye=e=>!e||!e.gives_access?"gratis":e.plan==="pro"?"pro":e.plan==="black"?"black":"lite",nye={gratis:"linear-gradient(135deg, #36B37E 0%, #1E7A52 100%)",lite:xu.lite.gradient,pro:xu.pro.gradient,black:xu.black.gradient},iye=({plano:e})=>{const t={bgcolor:"rgba(255,255,255,0.2)",background:"none"};switch(e){case"gratis":return c.jsx(tye,{variant:"contained",fontSize:14,sx:t});case"lite":return c.jsx(ip,{variant:"contained",fontSize:14,sx:t});case"black":return c.jsx(Qa,{variant:"contained",fontSize:14,sx:t});default:return c.jsx(ra,{variant:"contained",fontSize:14,sx:t})}},oye=e=>{switch(e){case"gratis":return"pro";case"lite":return"pro";case"pro":return"black";case"black":return null}},sye=e=>{switch(e){case"gratis":return"Libere produtos ilimitados, relatórios e mais";case"lite":return"Libere produtos ilimitados, relatórios e mais";case"pro":return"Adicione domÃnio próprio, automações e mais";default:return""}};function TS(){const e=At(),{triggerPaywall:t}=No(),{data:r,isLoading:n}=an(),{data:i=0,isLoading:o}=xg(),{categoryCount:s=0,isLoading:a}=J5e(),{data:l=0,isLoading:d}=h$();if(n||o||a||d)return c.jsx(F,{sx:{borderRadius:"14px",bgcolor:"white",p:2.5},children:c.jsxs(me,{direction:"row",spacing:1.5,alignItems:"center",children:[c.jsx(Lt,{variant:"rounded",width:60,height:28,sx:{borderRadius:"8px"}}),c.jsx(Lt,{variant:"text",width:"40%",height:18})]})});const h=rye(r||null),f=(r==null?void 0:r.status)==="trialing",p=h==="gratis",m={gratis:Qn.free,lite:Qn.lite,pro:Qn.pro,black:Qn.black}[h],g=oye(h),y=g?`/profile/paywall?initialPlan=${g}`:"/profile/subscription",b=[{label:"Produtos",count:i,limit:m.products},{label:"Categorias",count:s,limit:m.categories},{label:"Vendas presenciais/mês",count:l,limit:m.manualSales},{label:"Vendas online",count:0,limit:m.onlineSales}];return c.jsx(rt.div,{initial:{opacity:0,y:8}
240,animate:{opacity:1,y:0},transition:{type:"spring",stiffness:260,damping:24},children:c.jsxs(F,{onClick:()=>{g?t("plan_home_card",{pageAction:()=>e(y),source:"plan_home_card"}):e(y)},sx:{display:"block",borderRadius:"14px",background:nye[h],p:2.5,textDecoration:"none",color:"white",cursor:"pointer",userSelect:"none",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)","&:active":{transform:"scale(0.97)"}},children:[c.jsxs(me,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[c.jsx(V,{sx:{fontSize:"0.9rem",fontWeight:700,lineHeight:1.25},children:"Seu plano"}),c.jsx(Oo,{sx:{fontSize:20,opacity:.5,flexShrink:0}})]}),c.jsxs(me,{direction:"row",alignItems:"center",spacing:1.25,sx:{mt:1},children:[c.jsx(iye,{plano:h}),c.jsx(V,{sx:{fontSize:"0.75rem",fontWeight:500,opacity:.75},children:f?"PerÃodo de teste":p?"Grátis para sempre":"Assinatura ativa"})]}),c.jsx(F,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr 1fr",md:"1fr 1fr 1fr 1fr"},gap:1,mt:2},children:b.map(E=>c.jsxs(F,{sx:{flex:1,bgcolor:"rgba(255,255,255,0.12)",borderRadius:"10px",py:1,px:1.25},children:[c.jsx(F,{sx:{height:20,display:"flex",alignItems:"center"},children:E.limit===1/0?c.jsx(u$,{sx:{fontSize:20,opacity:.85}}):c.jsxs(V,{sx:{fontSize:"1rem",fontWeight:700,lineHeight:1.2},children:[E.count,"/",eye(E.limit)]})}),c.jsx(V,{sx:{fontSize:"0.65rem",fontWeight:500,opacity:.7,mt:.25},children:E.label})]},E.label))}),g&&c.jsxs(F,{sx:{display:"flex",alignItems:"center",gap:1.25,mt:2,py:1,px:1.5,borderRadius:"10px",bgcolor:"rgba(255,255,255,0.15)"},children:[c.jsx(V,{sx:{flex:1,fontSize:"0.78rem",fontWeight:600,lineHeight:1.3},children:sye(h)}),c.jsx(Oo,{sx:{fontSize:16,opacity:.6,flexShrink:0}})]})]})})}var Ux={},aye=zt;Object.defineProperty(Ux,"__esModule",{value:!0});var f$=Ux.default=void 0,lye=aye(Wt()),cye=c;f$=Ux.default=(0,lye.default)((0,cye.jsx)("path",{d:"m12 17.27 4.15 2.51c.76.46 1.69-.22 1.49-1.08l-1.1-4.72 3.67-3.18c.67-.58.31-1.68-.57-1.75l-4.83-.41-1.89-4.46c-.34-.81-1.5-.81-1.84 0L9.19 8.63l-4.83.41c-.88.07-1.24 1.17-.57 1.75l3.67 3.18-1.1 4.72c-.2.86.73 1.54 1.49 1.08z"}),"StarRounded");const uye=async(e,t)=>{let r=Te.from("avaliacao_produto").select(` 241 *, 242 produto:produto_id (id, nome, image_url), 243 cliente:cliente_id (id, nome, telefone, profile_url) 244 `).eq("user_id",e).is("deletada_em",null).order("criada_em",{ascending:!1});t.status&&t.status!=="todas"&&(r=r.eq("status",t.status)),t.produto_id&&(r=r.eq("produto_id",t.produto_id)),typeof t.minStars=="number"&&t.minStars>1&&(r=r.gte("classificacao",t.minStars)),typeof t.maxStars=="number"&&t.maxStars<5&&(r=r.lte("classificacao",t.maxStars));const{data:n,error:i}=await r;if(i)throw i;return n??[]},$Te=(e={})=>{const{user:t}=ot(),r=t==null?void 0:t.id;return Et({queryKey:["reviews",r,e],queryFn:()=>uye(r,e),enabled:!!r})},DTe=e=>{const{user:t}=ot(),r=t==null?void 0:t.id;return Et({queryKey:["review",e],queryFn:async()=>{if(!e)return null;const{data:n,error:i}=await Te.from("avaliacao_produto").select(` 245 *, 246 produto:produto_id (id, nome, image_url), 247 cliente:cliente_id (id, nome, telefone, profile_url) 248 `).eq("user_id",r).eq("id",e).is("deletada_em",null).maybeSingle();if(i)throw i;return n??null},enabled:!!r&&!!e})},dye=()=>{const{user:e}=ot(),t=e==null?void 0:e.id;return Et({queryKey:["pendingReviewsCount",t],queryFn:async()=>{const{count:r,error:n}=await Te.from("avaliacao_produto").select("*",{count:"exact",head:!0}).eq("user_id",t).eq("status","pendente").is("deletada_em",null);if(n)throw n;return r??0},enabled:!!t})},MTe=e=>{const{user:t}=ot(),r=t==null?void 0:t.id;return Et({queryKey:["productPendingReviewsCount",r,e],queryFn:async()=>{const{count:n,error:i}=await Te.from("avaliacao_produto").select("*",{count:"exact",head:!0}).eq("user_id",r).eq("produto_id",e).eq("status","pendente").is("deletada_em",null);if(i)throw i;return n??0},enabled:!!r&&e!=null})},NTe=e=>{const{user:t}=ot(),r=t==null?void 0:t.id;return Et({queryKey:["productReviewsSummary",r,e],queryFn:async()=>{const{data:n,error:i}=await Te.from("avaliacao_produto").select("classificacao").eq("user_id",r).eq("produto_id",e).eq("status","aprovada").is("deletada_em",null);if(i)throw i;const o=n??[],s={1:0,2:0,3:0,4:0,5:0};o.forEach(u=>{s[u.classificacao]+=1});const a=o.length,l=o.reduce((u,h)=>u+h.classificacao,0),d=a===0?0:l/a;return{produto_id:e,total:a,media:d,distribuicao:s}},enabled:!!r&&e!=null})},u0="#F59E0B";function AS(){const e=At(),{data:t}=dye();return!t||t<=0?null:c.jsx(rt.div,{initial:{opacity:0,y:8}
248,animate:{opacity:1,y:0},transition:{type:"spring",stiffness:260,damping:24},children:c.jsx(F,{onClick:()=>e("/reviews"),sx:{display:"block",borderRadius:"14px",bgcolor:"white",p:2.5,textDecoration:"none",color:"inherit",cursor:"pointer",userSelect:"none",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)","&:active":{transform:"scale(0.97)"}},children:c.jsxs(me,{direction:"row",alignItems:"center",spacing:1.5,children:[c.jsx(F,{sx:{width:40,height:40,borderRadius:"10px",bgcolor:gt(u0,.1),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:c.jsx(f$,{sx:{fontSize:22,color:u0}})}),c.jsxs(F,{sx:{flex:1,minWidth:0},children:[c.jsx(V,{sx:{fontSize:"0.9rem",fontWeight:700,color:"text.primary",lineHeight:1.25},children:"Avaliações pendentes"}),c.jsx(V,{sx:{fontSize:"0.75rem",fontWeight:500,color:"text.secondary",mt:.25},children:"Toque para aprovar ou rejeitar"})]}),c.jsx(F,{sx:{minWidth:28,height:28,px:1,borderRadius:"999px",bgcolor:gt(u0,.12),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:c.jsx(V,{sx:{fontSize:"0.8rem",fontWeight:700,color:u0,lineHeight:1},children:t})}),c.jsx(Oo,{sx:{fontSize:20,color:"text.disabled"}})]})})})}function hye(){var f;const{user:e}=ot(),{data:t}=xge(),{data:r}=Ege(),{data:n}=lo(),i=tl("(min-width: 900px)"),{data:o}=vx(),s=(o==null?void 0:o.mode)==="onboarding";R5e();const{status:a,showDialog:l,applyPromo:d,closeDialog:u,error:h}=O5e();return c.jsxs(F,{sx:{position:"relative",marginTop:{xs:"24px",md:0},overflow:"auto",maxWidth:{md:"1200px"},mx:{md:"auto"}},children:[c.jsxs(Sc,{useIcon:!0,children:[c.jsx(mr,{color:"inherit",component:w2,to:"/chats",children:c.jsx(e1,{badgeContent:r,color:"secondary",children:r?c.jsx(jI,{}):c.jsx(DI,{})})}),c.jsx(mr,{color:"inherit",component:w2,to:"/notifications",children:c.jsx(e1,{badgeContent:t,color:"secondary",children:t?c.jsx(nse,{}):c.jsx(use,{})})}),c.jsx(mr,{color:"inherit",component:w2,to:"/profile",children:c.jsx(_ge,{sx:{border:"3px solid white",outline:"2px solid",outlineColor:"primary.main",outlineOffset:"-1px"},alt:(n==null?void 0:n.nome_loja)||((f=e==null?void 0:e.user_metadata)==null?void 0:f.nome),src:(n==null?void 0:n.logo_url)||void 0})})]}),c.jsxs(me,{direction:"column",spacing:{xs:2.5,md:3},py:{xs:2,md:3},px:{xs:2,md:0},children:[c.jsx(m2e,{}),c.jsx(V5e,{}),c.jsx(N5e,{title:"Ative as notificações",subtitle:"Receba alertas de pedidos e mensagens",trackingLocation:"home_card",minAccountAgeDays:1}),!s&&c.jsx(A5e,{}),s&&c.jsx(t2e,{}),c.jsx(Hge,{}),i?c.jsxs(me,{spacing:2.5,children:[c.jsx(cS,{}),!s&&c.jsx(lS,{}),c.jsxs(F,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2.5,alignItems:"start"},children:[c.jsxs(me,{spacing:2,children:[c.jsx(CS,{}),c.jsx(uS,{}),c.jsx(dS,{})]}),c.jsxs(me,{spacing:2,children:[c.jsx(AS,{}),c.jsx(nS,{}),c.jsx(TS,{})]})]})]}):c.jsxs(me,{spacing:1.5,children:[c.jsx(cS,{}),!s&&c.jsx(lS,{}),c.jsx(CS,{}),c.jsx(uS,{}),c.jsx(dS,{}),c.jsx(AS,{}),c.jsx(nS,{}),c.jsx(TS,{})]})]}),c.jsx(M5e,{open:l,status:a,onApply:d,onClose:u,error:h})]})}const kS=ni(V)``,q0=({value:e,sx:t,className:r})=>{const[n,i]=e.toFixed(2).split("."),o=Number(n).toLocaleString("pt-BR"),s=i!=="00",a=t!=null&&t.fontSize?String(t.fontSize):"1rem",l=parseFloat(String(a)),d=String(a).replace(/[\d.]/g,"")||"rem",u=`${(l*.6).toFixed(3)}${d}`;return c.jsxs(me,{direction:"row",alignItems:"flex-start",className:r,sx:{display:"inline-flex",whiteSpace:"nowrap",marginRight:"-0.1em"},children:[c.jsxs(kS,{component:"span",sx:{lineHeight:1,...t},children:["R$ ",o]}),s&&c.jsx(kS,{component:"span",sx:{lineHeight:1,marginTop:"1px",verticalAlign:"super",...t,fontSize:u,fontWeight:500},children:i})]})},FTe=12,UTe=72,fye=2,RS=56,Hv=64,BTe=40,pye=8,p$=40,mye=10,m$=e=>e+16,Bx={fontSize:"0.875rem",fontWeight:600,lineHeight:1.43},gye={fontSize:"11px",fontWeight:500,color:"text.secondary",whiteSpace:"nowrap",flexShrink:0},vye={fontSize:"1rem",fontWeight:700},VTe={fontSize:"0.875rem",fontWeight:600},G0={neutral:{backgroundColor:"#F5F5F5",textColor:"#415064"},info:{backgroundColor:"#E1EBFF",textColor:"#2E54C2"},success:{backgroundColor:"#D1FAE5",textColor:"#065F46"},warning:{backgroundColor:"#FEF3C7",textColor:"#92400E"},error:{backgroundColor:"#FEE2E2",textColor:"#991B1B"},brand:{backgroundColor:"#F1EDFF",textColor:"#8865FE"}},fc=({label:e,tint:t="neutral",backgroundColor:r,textColor:n,sx:i,...o})=>{const s=G0[t],a=r??s.backgroundColor,l=n??s.textColor;return c.jsx(Fn,{label:e,size:"small",sx:{height:20,backgroundColor:a,color:l,border:"none","& .MuiChip-label":{px:1,fontSize:"11px",fontWeight:600,lineHeight:1},"& .MuiChip-icon":{color:l,fontSize:12,ml:.75,mr:-.5},...i},...o})},yye=({color:e,backgroundColor:t,size:r=p$,children:n,sx:i,...o})=>{const s=$o(),a=e??s.palette.primary.main;return c.jsx(F,{sx:{width:r,height:r,borderRadius:`${mye}px`,backgroundColor:t??gt(a,.08),color:a,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,...i},...o,children:n})};function Oi(e){switch(e){case"new":return"Novo";
248case"pending_payment":return"Pendente";case"paid":return"Aprovado";case"processing":return"Preparação";case"shipped":return"Enviado";case"delivered":return"Entregue";case"returned":return"Devolvido";case"canceled":return"Cancelado";case"pendente":return"Pendente";case"paga":return"Paga";case"cancelada":return"Cancelada";case"reembolsada":return"Reembolsada";default:return"-"}}function g$(e){switch(e){case"new":return{backgroundColor:"#FFF9E0",color:"#8A6F10"};case"pending_payment":return{backgroundColor:"#FFE9B0",color:"#7A4A00"};case"paid":return{backgroundColor:"#E8F5C8",color:"#4F6B0E"};case"processing":return{backgroundColor:"#D6EEFB",color:"#1A6A94"};case"shipped":return{backgroundColor:"#E1EBFF",color:"#2E54C2"};case"delivered":return{backgroundColor:"#D1FAE5",color:"#065F46"};case"canceled":return{backgroundColor:"#FFDFE4",color:"#C12240"};case"returned":return{backgroundColor:"#F2D3D3",color:"#7A1F2C"};default:return{backgroundColor:"#F3F4F6",color:"#374151"}}}const _ye=e=>{const t=new Date(e),r=new Date;return mg(t)?Di(t,"HH:mm",{locale:Uu}):sI(t)?"ontem":Jb(r,t)<=6?Di(t,"eeee",{locale:Uu}):t.getFullYear()===r.getFullYear()?Di(t,"dd/MM"):Di(t,"dd/MM/yyyy")},bye=({orderNumber:e,userName:t,timestamp:r,value:n,orderStatus:i,paymentCondition:o,parcelas:s,onClick:a,onSelect:l,selectEnabled:d,selected:u,longPressEvents:h,showRelativeDate:f=!1,showUserName:p=!0,itemsSummary:m,payOnDeliveryLabel:g})=>{const y=()=>{d&&l?l():a&&a()},E=(()=>{const k=s&&s.length>0;if(!!g&&i!=="canceled"&&(!k||s.some(_=>_.status_parcela==="pendente")))return{text:g,color:"#2563EB",icon:c.jsx(cse,{size:12,style:{color:"#2563EB"}})};if(!k)return{text:"Sem pagamento",color:"#9CA3AF",icon:c.jsx(Pl,{size:12,style:{color:"#9CA3AF"}})};const w=s.some(_=>_.status_parcela==="cancelada"||_.status_parcela==="reembolsada");switch(o){case"a_vista":{const _=s[0],x=_.status_parcela==="paga",C=_.status_parcela==="cancelada",P=_.status_parcela==="reembolsada";return C||P?{text:"à vista (cancelado)",color:"#9CA3AF",icon:c.jsx(Pl,{size:12,style:{color:"#9CA3AF"}})}:x?{text:"à vista",color:"#059669",icon:c.jsx(Pl,{size:12,style:{color:"#059669"}})}:{text:"à vista pendente",color:"#D97706",icon:c.jsx(Pl,{size:12,style:{color:"#D97706"}})}}case"parcelado":{const _=s.filter(P=>P.status_parcela==="paga").length,x=s.length,C=_===x;return w?{text:`${_}/${x} parcelas (cancelado)`,color:"#9CA3AF",icon:c.jsx(Kd,{sx:{fontSize:12,color:"#9CA3AF"}})}:C?{text:`${_}/${x} parcelas`,color:"#059669",icon:c.jsx(Kd,{sx:{fontSize:12,color:"#059669"}})}:_>0?{text:`${_}/${x} parcelas`,color:"#2563EB",icon:c.jsx(Kd,{sx:{fontSize:12,color:"#2563EB"}})}:{text:`${_}/${x} parcelas`,color:"#D97706",icon:c.jsx(Kd,{sx:{fontSize:12,color:"#D97706"}})}}case"fiado":{const _=s[0],x=s.every(I=>I.status_parcela==="paga"),C=(_==null?void 0:_.status_parcela)==="cancelada",P=(_==null?void 0:_.status_parcela)==="reembolsada";return C||P?{text:"Fiado (cancelado)",color:"#9CA3AF",icon:c.jsx(r2,{sx:{fontSize:12,color:"#9CA3AF"}})}:x?{text:"Fiado quitado",color:"#059669",icon:c.jsx(r2,{sx:{fontSize:12,color:"#059669"}})}:{text:"Fiado",color:"#D97706",icon:c.jsx(r2,{sx:{fontSize:12,color:"#D97706"}})}}default:return{text:"Sem pagamento",color:"#9CA3AF",icon:c.jsx(Pl,{size:12,style:{color:"#9CA3AF"}})}}})(),S=g$(i);return c.jsx($m,{disablePadding:!0,children:c.jsxs(yn,{onClick:y,sx:{py:1.5},...d?{}:h==null?void 0:h(),children:[d&&c.jsx(pc,{edge:"start",checked:u,tabIndex:-1,disableRipple:!0,onClick:k=>{k.stopPropagation(),l&&l()}}),c.jsx(Vt,{sx:{minWidth:m$(p$)},children:c.jsxs(F,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:.75},children:[c.jsx(yye,{children:c.jsx(Zj,{size:20})}),c.jsxs(V,{variant:"caption",color:"primary",fontWeight:700,lineHeight:1,sx:{maxWidth:48,textAlign:"center",wordBreak:"break-word"},children:["#",e]})]})}),c.jsx(St,{primary:c.jsxs(F,{children:[c.jsxs(F,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:1,mb:.5},children:[c.jsx(V,{component:"span",sx:{...Bx,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,minWidth:0},children:p?t||"Sem cliente":m}),c.jsx(V,{component:"span",sx:gye,children:f?_ye(_o(r)):Di(_o(r),"HH:mm")}
248)]}),c.jsx(F,{sx:{mb:1},children:c.jsx(q0,{value:n,sx:vye})}),c.jsxs(F,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[c.jsxs(F,{sx:{display:"flex",alignItems:"center",gap:.5,flexWrap:"wrap",minWidth:0},children:[E.icon,c.jsx(V,{variant:"caption",color:E.color,fontWeight:500,children:E.text})]}),c.jsx(fc,{label:Oi(i),backgroundColor:S.backgroundColor,textColor:S.color})]})]})})]})})};var Vx={},xye=zt;Object.defineProperty(Vx,"__esModule",{value:!0});var __=Vx.default=void 0,wye=xye(Wt()),Eye=c;__=Vx.default=(0,wye.default)((0,Eye.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search");var Hx={},Sye=zt;Object.defineProperty(Hx,"__esModule",{value:!0});var v$=Hx.default=void 0,Cye=Sye(Wt()),Tye=c;v$=Hx.default=(0,Cye.default)((0,Tye.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear");function Aye(e,t,r){var n=this,i=v.useRef(null),o=v.useRef(0),s=v.useRef(null),a=v.useRef([]),l=v.useRef(),d=v.useRef(),u=v.useRef(e),h=v.useRef(!0);u.current=e;var f=typeof window<"u",p=!t&&t!==0&&f;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var m=!!(r=r||{}).leading,g=!("trailing"in r)||!!r.trailing,y="maxWait"in r,b="debounceOnServer"in r&&!!r.debounceOnServer,E=y?Math.max(+r.maxWait||0,t):null;v.useEffect(function(){return h.current=!0,function(){h.current=!1}},[]);var S=v.useMemo(function(){var k=function(P){var I=a.current,O=l.current;return a.current=l.current=null,o.current=P,d.current=u.current.apply(O,I)},A=function(P,I){p&&cancelAnimationFrame(s.current),s.current=p?requestAnimationFrame(P):setTimeout(P,I)},w=function(P){if(!h.current)return!1;var I=P-i.current;return!i.current||I>=t||I<0||y&&P-o.current>=E},_=function(P){return s.current=null,g&&a.current?k(P):(a.current=l.current=null,d.current)},x=function P(){var I=Date.now();if(w(I))return _(I);if(h.current){var O=t-(I-i.current),D=y?Math.min(O,E-(I-o.current)):O;A(P,D)}},C=function(){if(f||b){var P=Date.now(),I=w(P);if(a.current=[].slice.call(arguments),l.current=n,i.current=P,I){if(!s.current&&h.current)return o.current=i.current,A(x,t),m?k(i.current):d.current;if(y)return A(x,t),k(i.current)}return s.current||A(x,t),d.current}};return C.cancel=function(){s.current&&(p?cancelAnimationFrame(s.current):clearTimeout(s.current)),o.current=0,a.current=i.current=l.current=s.current=null},C.isPending=function(){return!!s.current},C.flush=function(){return s.current?_(Date.now()):d.current},C},[m,y,t,E,g,p,f,b]);return S}const kye=ni("div")(({theme:e})=>({position:"relative",borderRadius:e.shape.borderRadius,backgroundColor:gt(e.palette.common.white,.15),transition:"width 0.3s ease",marginRight:0,marginLeft:0,width:"100%",[e.breakpoints.up("sm")]:{width:"auto"}})),Rye=ni("div")(({theme:e})=>({padding:e.spacing(0,2),height:"100%",position:"absolute",pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"})),Iye=ni("div")(({theme:e})=>({height:"100%",position:"absolute",right:e.spacing(.5),top:0,display:"flex",alignItems:"center",justifyContent:"center"})),Pye=ni($C)(({theme:e})=>({color:"inherit",backgroundColor:"transparent",width:"100%",borderRadius:e.shape.borderRadius,"& .MuiInputBase-input":{backgroundColor:"transparent",padding:e.spacing(1,1,1,0),paddingLeft:`calc(1em + ${e.spacing(4)})`,paddingRight:e.spacing(4),transition:"width 0.3s ease, background-color 0.2s ease",width:"100%",borderRadius:"inherit",[e.breakpoints.up("md")]:{width:"12ch",backgroundColor:gt(e.palette.common.black,.025),"&:focus":{width:"20ch"},"&:hover":{backgroundColor:gt(e.palette.common.black,.035)}}}})),zx=()=>{const[e]=ws(),t=At(),r=sn(),n=$o(),i=tl(n.breakpoints.up("md")),o=e.get("query")||"",[s,a]=v.useState(!!o),l=v.useRef(null),d=Aye(h=>{const f=new URLSearchParams(e);h?f.set("query",h):f.delete("query"),t(`${r.pathname}?${f.toString()}`,{replace:!0})},400),u=()=>{d(""),l.current&&l.current.blur(),a(!1)};return v.useEffect(()=>{o&&a(!0)},[o]),c.jsxs(F,{sx:{display:s||i?"flex":"block",alignItems:"center",justifyContent:"center",width:"auto",maxWidth:s||i?"100%":"48px"},children:[c.jsx(mr,{color:"inherit",onClick:()=>a(!0),sx:{visibility:s||i?"hidden":"visible",opacity:s||i?0:1,transition:"opacity 0.2s ease-in",display:s||i?"none":"flex"},children:c.jsx(__,{})}
248),c.jsxs(kye,{style:{visibility:s||i?"visible":"hidden",width:s||i?"100%":"0",marginLeft:s||i?"24px":"0",opacity:s||i?1:0},children:[c.jsx(Rye,{children:c.jsx(__,{})}),(s||i)&&c.jsx(Pye,{placeholder:"Pesquisarâ¦",inputProps:{"aria-label":"search"},onBlur:()=>!o&&!i&&a(!1),autoFocus:!i,defaultValue:o,onChange:h=>d(h.target.value),ref:l}),s&&!i&&o&&c.jsx(Iye,{children:c.jsx(mr,{size:"small",onClick:u,sx:{color:"inherit",padding:.25,minWidth:"auto",width:24,height:24},children:c.jsx(v$,{fontSize:"small"})})})]})]})};function qc(e,t,r){let n=r.initialDeps??[],i;function o(){var s,a,l,d;let u;r.key&&((s=r.debug)!=null&&s.call(r))&&(u=Date.now());const h=e();if(!(h.length!==n.length||h.some((m,g)=>n[g]!==m)))return i;n=h;let p;if(r.key&&((a=r.debug)!=null&&a.call(r))&&(p=Date.now()),i=t(...h),r.key&&((l=r.debug)!=null&&l.call(r))){const m=Math.round((Date.now()-u)*100)/100,g=Math.round((Date.now()-p)*100)/100,y=g/16,b=(E,S)=>{for(E=String(E);E.length<S;)E=" "+E;return E};console.info(`%câ± ${b(g,5)} /${b(m,5)} ms`,` 249 font-size: .6rem; 250 font-weight: bold; 251 color: hsl(${Math.max(0,Math.min(120-120*y,120))}deg 100% 31%);`,r==null?void 0:r.key)}return(d=r==null?void 0:r.onChange)==null||d.call(r,i),i}return o.updateDeps=s=>{n=s},o}function IS(e,t){if(e===void 0)throw new Error(`Unexpected undefined${t?`: ${t}`:""}`);return e}const Oye=(e,t)=>Math.abs(e-t)<=1,y$=(e,t,r)=>{let n;return function(...i){e.clearTimeout(n),n=e.setTimeout(()=>t.apply(this,i),r)}},PS=e=>{const{offsetWidth:t,offsetHeight:r}=e;return{width:t,height:r}},jye=e=>e,Lye=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1),n=[];for(let i=t;i<=r;i++)n.push(i);return n},$ye=(e,t)=>{const r=e.scrollElement;if(!r)return;const n=e.targetWindow;if(!n)return;const i=s=>{const{width:a,height:l}=s;t({width:Math.round(a),height:Math.round(l)})};if(i(PS(r)),!n.ResizeObserver)return()=>{};const o=new n.ResizeObserver(s=>{const a=()=>{const l=s[0];if(l!=null&&l.borderBoxSize){const d=l.borderBoxSize[0];if(d){i({width:d.inlineSize,height:d.blockSize});return}}i(PS(r))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(r,{box:"border-box"}),()=>{o.unobserve(r)}},wf={passive:!0},Dye=(e,t)=>{const r=e.scrollElement;if(!r)return;const n=()=>{t({width:r.innerWidth,height:r.innerHeight})};return n(),r.addEventListener("resize",n,wf),()=>{r.removeEventListener("resize",n)}},gm=typeof window>"u"?!0:"onscrollend"in window,Mye=(e,t)=>{const r=e.scrollElement;if(!r)return;const n=e.targetWindow;if(!n)return;let i=0;const o=e.options.useScrollendEvent&&gm?()=>{}:y$(n,()=>{t(i,!1)},e.options.isScrollingResetDelay),s=u=>()=>{const{horizontal:h,isRtl:f}=e.options;i=h?r.scrollLeft*(f&&-1||1):r.scrollTop,o(),t(i,u)},a=s(!0),l=s(!1);l(),r.addEventListener("scroll",a,wf);const d=e.options.useScrollendEvent&&gm;return d&&r.addEventListener("scrollend",l,wf),()=>{r.removeEventListener("scroll",a),d&&r.removeEventListener("scrollend",l)}},Nye=(e,t)=>{const r=e.scrollElement;if(!r)return;const n=e.targetWindow;if(!n)return;let i=0;const o=e.options.useScrollendEvent&&gm?()=>{}:y$(n,()=>{t(i,!1)},e.options.isScrollingResetDelay),s=u=>()=>{i=r[e.options.horizontal?"scrollX":"scrollY"],o(),t(i,u)},a=s(!0),l=s(!1);l(),r.addEventListener("scroll",a,wf);const d=e.options.useScrollendEvent&&gm;return d&&r.addEventListener("scrollend",l,wf),()=>{r.removeEventListener("scroll",a),d&&r.removeEventListener("scrollend",l)}},Fye=(e,t,r)=>{if(t!=null&&t.borderBoxSize){const n=t.borderBoxSize[0];if(n)return Math.round(n[r.options.horizontal?"inlineSize":"blockSize"])}return e[r.options.horizontal?"offsetWidth":"offsetHeight"]},Uye=(e,{adjustments:t=0,behavior:r},n)=>{var i,o;const s=e+t;(o=(i=n.scrollElement)==null?void 0:i.scrollTo)==null||o.call(i,{[n.options.horizontal?"left":"top"]:s,behavior:r})},Bye=(e,{adjustments:t=0,behavior:r},n)=>{var i,o;const s=e+t;(o=(i=n.scrollElement)==null?void 0:i.scrollTo)==null||o.call(i,{[n.options.horizontal?"left":"top"]:s,behavior:r})};class Vye{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let r=null;const n=()=>r||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:r=new this.targetWindow.ResizeObserver(i=>
251{i.forEach(o=>{const s=()=>{this._measureElement(o.target,o)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var i;(i=n())==null||i.disconnect(),r=null},observe:i=>{var o;return(o=n())==null?void 0:o.observe(i,{box:"border-box"})},unobserve:i=>{var o;return(o=n())==null?void 0:o.unobserve(i)}}})(),this.range=null,this.setOptions=r=>{Object.entries(r).forEach(([n,i])=>{typeof i>"u"&&delete r[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:jye,rangeExtractor:Lye,onChange:()=>{},measureElement:Fye,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...r}},this.notify=r=>{var n,i;(i=(n=this.options).onChange)==null||i.call(n,this,r)},this.maybeNotify=qc(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),r=>{this.notify(r)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(r=>r()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var r;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((r=this.scrollElement)==null?void 0:r.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=o,this.maybeNotify()}))}}
251,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(r,n)=>{const i=new Map,o=new Map;for(let s=n-1;s>=0;s--){const a=r[s];if(i.has(a.lane))continue;const l=o.get(a.lane);if(l==null||a.end>l.end?o.set(a.lane,a):a.end<l.end&&i.set(a.lane,!0),i.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=qc(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(r,n,i,o,s)=>(this.pendingMeasuredCacheIndexes=[],{count:r,paddingStart:n,scrollMargin:i,getItemKey:o,enabled:s}),{key:!1}),this.getMeasurements=qc(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:r,paddingStart:n,scrollMargin:i,getItemKey:o,enabled:s},a)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(u=>{this.itemSizeCache.set(u.key,u.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const d=this.measurementsCache.slice(0,l);for(let u=l;u<r;u++){const h=o(u),f=this.options.lanes===1?d[u-1]:this.getFurthestMeasurement(d,u),p=f?f.end+this.options.gap:n+i,m=a.get(h),g=typeof m=="number"?m:this.options.estimateSize(u),y=p+g,b=f?f.lane:u%this.options.lanes;d[u]={index:u,start:p,size:g,end:y,key:h,lane:b}}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=qc(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(r,n,i,o)=>this.range=r.length>0&&n>0?Hye({measurements:r,outerSize:n,scrollOffset:i,lanes:o}):null,{key:!1,debug:()=>this.options.debug}
251),this.getVirtualIndexes=qc(()=>{let r=null,n=null;const i=this.calculateRange();return i&&(r=i.startIndex,n=i.endIndex),this.maybeNotify.updateDeps([this.isScrolling,r,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,r,n]},(r,n,i,o,s)=>o===null||s===null?[]:r({startIndex:o,endIndex:s,overscan:n,count:i}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=r=>{const n=this.options.indexAttribute,i=r.getAttribute(n);return i?parseInt(i,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this._measureElement=(r,n)=>{const i=this.indexFromElement(r),o=this.measurementsCache[i];if(!o)return;const s=o.key,a=this.elementsCache.get(s);a!==r&&(a&&this.observer.unobserve(a),this.observer.observe(r),this.elementsCache.set(s,r)),r.isConnected&&this.resizeItem(i,this.options.measureElement(r,n,this))},this.resizeItem=(r,n)=>{const i=this.measurementsCache[r];if(!i)return;const o=this.itemSizeCache.get(i.key)??i.size,s=n-o;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(i,s,this):i.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(i.index),this.itemSizeCache=new Map(this.itemSizeCache.set(i.key,n)),this.notify(!1))},this.measureElement=r=>{if(!r){this.elementsCache.forEach((n,i)=>{n.isConnected||(this.observer.unobserve(n),this.elementsCache.delete(i))});return}this._measureElement(r,void 0)},this.getVirtualItems=qc(()=>
251[this.getVirtualIndexes(),this.getMeasurements()],(r,n)=>{const i=[];for(let o=0,s=r.length;o<s;o++){const a=r[o],l=n[a];i.push(l)}return i},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=r=>{const n=this.getMeasurements();if(n.length!==0)return IS(n[_$(0,n.length-1,i=>IS(n[i]).start,r)])},this.getOffsetForAlignment=(r,n,i=0)=>{const o=this.getSize(),s=this.getScrollOffset();n==="auto"&&(n=r>=s+o?"end":"start"),n==="center"?r+=(i-o)/2:n==="end"&&(r-=o);const a=this.getTotalSize()-o;return Math.max(Math.min(a,r),0)},this.getOffsetForIndex=(r,n="auto")=>{r=Math.max(0,Math.min(r,this.options.count-1));const i=this.measurementsCache[r];if(!i)return;const o=this.getSize(),s=this.getScrollOffset();if(n==="auto")if(i.end>=s+o-this.options.scrollPaddingEnd)n="end";else if(i.start<=s+this.options.scrollPaddingStart)n="start";else return[s,n];const a=n==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,n,i.size),n]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(r,{align:n="start",behavior:i}={})=>{this.cancelScrollToIndex(),i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(r,n),{adjustments:void 0,behavior:i})},this.scrollToIndex=(r,{align:n="auto",behavior:i}={})=>{r=Math.max(0,Math.min(r,this.options.count-1)),this.cancelScrollToIndex(),i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const o=this.getOffsetForIndex(r,n);if(!o)return;const[s,a]=o;this._scrollToOffset(s,{adjustments:void 0,behavior:i}),i!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(r))){const d=this.getOffsetForIndex(r,a);if(!d)return;const[u]=d,h=this.getScrollOffset();Oye(u,h)||this.scrollToIndex(r,{align:a,behavior:i})}else this.scrollToIndex(r,{align:a,behavior:i})}))},this.scrollBy=(r,{behavior:n}={})=>{this.cancelScrollToIndex(),n==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+r,{adjustments:void 0,behavior:n})},this.getTotalSize=()=>{var r;const n=this.getMeasurements();let i;if(n.length===0)i=this.options.paddingStart;else if(this.options.lanes===1)i=((r=n[n.length-1])==null?void 0:r.end)??0;else{const o=Array(this.options.lanes).fill(null);let s=n.length-1;for(;s>=0&&o.some(a=>a===null);){const a=n[s];o[a.lane]===null&&(o[a.lane]=a.end),s--}i=Math.max(...o.filter(a=>a!==null))}return Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(r,{adjustments:n,behavior:i})=>{this.options.scrollToFn(r,{behavior:i,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const _$=(e,t,r,n)=>{for(;e<=t;){const i=(e+t)/2|0,o=r(i);if(o<n)e=i+1;else if(o>n)t=i-1;else return i}return e>0?e-1:0};function Hye({measurements:e,outerSize:t,scrollOffset:r,lanes:n}){const i=e.length-1,o=l=>e[l].start;if(e.length<=n)return{startIndex:0,endIndex:i};let s=_$(0,i,o,r),a=s;if(n===1)for(;a<i&&e[a].end<r+t;)a++;else if(n>1){const l=Array(n).fill(0);for(;a<i&&l.some(u=>u<r+t);){const u=e[a];l[u.lane]=u.end,a++}const d=Array(n).fill(r+t);for(;s>=0&&d.some(u=>u>=r);){const u=e[s];d[u.lane]=u.start,s--}s=Math.max(0,s-s%n),a=Math.min(i,a+(n-1-a%n))}return{startIndex:s,endIndex:a}}const OS=typeof document<"u"?v.useLayoutEffect:v.useEffect;function b$(e){const t=v.useReducer(()=>({}),{})[1],r={...e,onChange:(i,o)=>{var s;o?Ns.flushSync(t):t(),(s=e.onChange)==null||s.call(e,i,o)}},[n]=v.useState(()=>new Vye(r));return n.setOptions(r),OS(()=>n._didMount(),[]),OS(()=>n._willUpdate()),n}function HTe(e){return b$({observeElementRect:$ye,observeElementOffset:Mye,scrollToFn:Bye,...e})}function x$(e){return b$({getScrollElement:()=>typeof document<"u"?window:null,observeElementRect:Dye,observeElementOffset:Nye,scrollToFn:Uye,initialOffset:()=>typeof document<"u"?window.scrollY:0,...e})}var ih=(e=>(e.Mouse="mouse",e.Touch="touch",e.Pointer="pointer",e))(ih||{}),oh=(e=>(e.CancelledByMovement="cancelled-by-movement",e.CancelledByRelease="cancelled-by-release",e.CancelledOutsideElement="cancelled-outside-element",e))(oh||{});const zye=["mousedown","mousemove","mouseup","mouseleave","mouseout"],Wye=["touchstart","touchmove","touchend","touchcancel"],qye=["pointerdown","pointermove","pointerup","pointerleave","pointerout"];function Gye(e){return typeof e=="object"&&e!==null&&"pageX"in e&&typeof e.pageX=="number"&&"pageY"in e&&typeof e.pageY=="number"}function Kye(e){var t;return zye.includes((t=e==null?void 0:e.nativeEvent)==null?void 0:t.type)}function w$(e){var t;return Wye.includes((t=e==null?void 0:e.nativeEvent)==null?void 0:t.type)||"touches"in e}function Yye(e){const{nativeEvent:t}=e;return t?qye.includes(t==null?void 0:t.type)||"pointerId"in t:!1}function zv(e){return Kye(e)||w$(e)||Yye(e)}function jS(e){var t;const r=w$(e)?(t=e==null?void 0:e.touches)==null?void 0:t[0]:e;return Gye(r)?{x:r.pageX,y:r.pageY}:null}function Zye(e){return{target:e.target,currentTarget:e.currentTarget,nativeEvent:e,persist:()=>{}}}function Wx(e,{threshold:t=400,captureEvent:r=!1,detect:n=ih.Pointer,cancelOnMovement:i=!1,cancelOutsideElement:o=!0,filterEvents:s,onStart:a,onMove:l,onFinish:d,onCancel:u}={}){const h=v.useRef(!1),f=v.useRef(!1),p=v.useRef(),m=v.useRef(),g=v.useRef(e),y=v.useRef(null),b=v.useCallback(A=>w=>{f.current||zv(w)&&(s!==void 0&&!s(w)||(r&&w.persist(),a==null||a(w,{context:A}),y.current=jS(w),f.current=!0,p.current=w.currentTarget,m.current=setTimeout(()=>{g.current&&(g.current(w,{context:A}),h.current=!0)},t)))},[r,s,a,t]),E=v.useCallback(A=>(w,_)=>{zv(w)&&f.current&&(y.current=null,r&&w.persist(),h.current?d==null||d(w,{context:A}):f.current&&(u==null||u(w,{context:A,reason:_??oh.CancelledByRelease})),h.current=!1,f.current=!1,m.current!==void 0&&clearTimeout(m.current))},[r,d,u]),S=v.useCallback(A=>w=>{if(zv(w)&&(l==null||l(w,{context:A}),i!==!1&&y.current)){const _=jS(w);if(_){const x=i===!0?25:i,C={x:Math.abs(_.x-y.current.x),y:Math.abs(_.y-y.current.y)};(C.x>x||C.y>x)&&E(A)(w,oh.CancelledByMovement)}}},[E,i,l]),k=v.useCallback(A=>{if(e===null)return{};switch(n){case ih.Mouse:{const w={onMouseDown:b(A),onMouseMove:S(A),onMouseUp:E(A)};return o&&(w.onMouseLeave=_=>{E(A)(_,oh.CancelledOutsideElement)}),w}case ih.Touch:return{onTouchStart:b(A),onTouchMove:S(A),onTouchEnd:E(A)};case ih.Pointer:{const w={onPointerDown:b(A),onPointerMove:S(A),onPointerUp:E(A)};return o&&(w.onPointerLeave=_=>E(A)(_,oh.CancelledOutsideElement)),w}}},[e,E,o,n,S,b]);return v.useEffect(()=>{function A(w){const _=Zye(w);E()(_)}return window.addEventListener("mouseup",A),window.addEventListener("touchend",A),window.addEventListener("pointerup",A),()=>{window.removeEventListener("mouseup",A),window.removeEventListener("touchend",A),window.removeEventListener("pointerup",A)}},[E]),v.useEffect(()=>()=>{m.current!==void 0&&clearTimeout(m.current)},[]),v.useEffect(()=>{g.current=e},[e]),k}function qx(e){return e.variacoes.filter(t=>!t.oculto&&!t.flag_produto_simples)}function Gx(e,t){return e.produto_variacao_id!=null?"fixed_variation":t&&qx(t).length>0?"choice":"fixed_product"}function Wv(e,t,r){return e?Math.floor(Math.max(0,t??0)/r):1/0}function E$(e,t){if(!t||t.deletado_em)return 0;const r=Gx(e,t);if(r==="fixed_variation"){const n=t.variacoes.find(i=>i.id===e.produto_variacao_id);return n?Wv(n.controlar_estoque,n.estoque_atual,e.quantidade):0}if(r==="choice"){const n=qx(t);return n.length===0?0:Math.max(...n.map(i=>Wv(i.controlar_estoque,i.estoque_atual,e.quantidade)))}return Wv(t.controlar_estoque,t.estoque_atual,e.quantidade)}function zTe(e,t){if(e.length===0)return{available:!1,maxQuantity:0};let r=1/0;for(const n of e){const i=E$(n,t.get(n.produto_id));if(r=Math.min(r,i),r<=0)return{available:!1,maxQuantity:0}}return{available:!0,maxQuantity:r}}function WTe(e,t,r){if(e.length===0)return 0;const n=new Map;let i=1/0;for(const o of e){const s=t.get(o.produto_id);if(!s||s.deletado_em)return 0;const a=Gx(o,s);let l=null;if(a==="fixed_variation")l=o.produto_variacao_id;else if(a==="choice"){const d=r.find(u=>u.produto_id===o.produto_id);if(!d){i=Math.min(i,E$(o,s));continue}l=d.produto_variacao_id}if(l!=null){const d=s.variacoes.find(f=>f.id===l);if(!d)return 0;const u=`v:${l}`,h=n.get(u);
251n.set(u,{controlar:!!d.controlar_estoque,estoque:Math.max(0,d.estoque_atual??0),needed:((h==null?void 0:h.needed)??0)+o.quantidade})}else{const d=`p:${s.id}`,u=n.get(d);n.set(d,{controlar:!!s.controlar_estoque,estoque:Math.max(0,s.estoque_atual??0),needed:((u==null?void 0:u.needed)??0)+o.quantidade})}}for(const o of n.values())o.controlar&&(i=Math.min(i,Math.floor(o.estoque/o.needed)));return Math.max(0,i)}function LS(e,t){const r=e==null?void 0:e.preco;return r!=null&&r!==0?r:t.preco??null}function qTe(e,t){let r=0;for(const n of e){const i=t.get(n.produto_id);if(!i)return null;const o=Gx(n,i);if(o==="fixed_variation"){const s=i.variacoes.find(l=>l.id===n.produto_variacao_id);if(!s)return null;const a=LS(s,i);if(a==null)return null;r+=a*n.quantidade}else if(o==="choice"){const s=qx(i).map(a=>LS(a,i)).filter(a=>a!=null);if(s.length===0)return null;r+=Math.min(...s)*n.quantidade}else{if(i.preco==null)return null;r+=i.preco*n.quantidade}}return r}function Xye(e){const t=e.filter(n=>n.combo_parent_item_id!=null);if(t.length===0)return e;const r=new Map;for(const n of t){const i=n.combo_parent_item_id,o=r.get(i)??[];o.push(n),r.set(i,o)}return e.filter(n=>n.combo_parent_item_id==null).map(n=>{const i=n.id!=null?r.get(n.id):void 0;return i?{...n,combo_componentes:i}:n})}function GTe(e){return e.filter(t=>t.combo_parent_item_id==null)}const Jye=async(e,t)=>{if(!e)throw new Error("User is not authenticated");let r=Te.from("pedido").select(` 252 pedido_id, 253 data_pedido, 254 taxa_de_venda, 255 observacoes, 256 observacoes_cliente, 257 frete_pedido:frete_pedido ( 258 id, 259 tipo_frete, 260 valor_frete, 261 distancia_km, 262 faixa_frete_distancia_id, 263 regiao_frete_personalizado_id, 264 criado_em 265 ), 266 status_pedido, 267 cliente_id, 268 numero_pedido, 269 cupom_id, 270 cupom_codigo, 271 cupom_tipo_desconto, 272 cupom_valor_desconto, 273 cupom_aplicado_em, 274 valor_desconto, 275 condicao_pagamento, 276 origem, 277 pagamento_entrega_escolha, 278 pagamento_entrega_metodo_nome, 279 cliente:cliente ( 280 telefone, 281 nome, 282 profile_url, 283 customer_user_id 284 ), 285 itens_pedido:itens_pedido ( 286 id, 287 produto_id, 288 produto_variacao_id, 289 quantidade, 290 combo_parent_item_id, 291 produto:produto ( 292 id, 293 nome, 294 image_url, 295 sku 296 ), 297 produto_variacao:produto_variacao ( 298 id, 299 nome, 300 codigo_produto, 301 image_url, 302 produto_variacao_valor ( 303 atributo_valor:atributo_valor ( 304 id, 305 valor, 306 atributo:atributos ( 307 id, 308 nome 309 ) 310 ) 311 ) 312 ), 313 preco_snapshot 314 ), 315 parcelas:parcela ( 316 id, 317 numero_parcela, 318 valor_original, 319 data_vencimento, 320 status_parcela, 321 pagamentos:pagamento ( 322 id, 323 valor, 324 data_pagamento, 325 forma_pagamento_id 326 ) 327 ), 328 endereco_entrega:endereco_entrega!fk_endereco_entrega(*) 329 `).neq("status_pedido","cart").eq("vendedor_id",e).is("deletado_em",null).order("data_pedido",{ascending:!1});t&&(r=r.eq("cliente_id",t));const{data:n,error:i}=await r;if(i)throw new Error(i.message);return n?n.map(o=>{const s=o.itens_pedido.reduce((u,h)=>u+h.quantidade*h.preco_snapshot,0),a=Xye(o.itens_pedido);let l=0,d=0;return o.parcelas&&o.parcelas.length>0&&o.parcelas.forEach(u=>{if(u.status_parcela==="paga"){const f=(u.pagamentos||[]).reduce((p,m)=>p+m.valor,0);l+=f}else d+=u.valor_original}),{...o,itens_pedido:a,subtotal:s,total_pago:l,total_pendente:d}}):[]},Kx=e=>{const{user:t}=ot(),r=t==null?void 0:t.id;return Et({queryKey:["pedidos",e],queryFn:()=>Jye(r,e),enabled:!!r&&(!e||e>0)})},Qye=async e=>{const{data:t,error:r}=await Te.from("cliente").select("id, telefone, cpf_cnpj, inscricao_estadual, nome, email, profile_url, customer_user_id, observacoes, deletado_em, dia_aniversario, mes_aniversario, tabela_preco_id, tabela_preco:tabela_preco_id(id, nome)").eq("id",e).is("deletado_em",null).single();if(r)throw new Error(r.message);if(!t)return null;const n=t;return{...n,tabela_preco:Array.isArray(n.tabela_preco)?n.tabela_preco[0]||null:n.tabela_preco||null}},e_e=e=>Et({queryKey:["customer",e],queryFn:()=>Qye(e),enabled:!!e}),t_e=async(e,t)=>{if(!e)throw new Error("No couponId provided");
329if(!t)throw new Error("Usuário não autenticado");const{data:r,error:n}=await Te.from("cupom").select(`*, 330 cupom_produto ( produto_id, produto_variacao_id ), 331 cupom_categoria ( categoria_id )`).eq("id",e).eq("user_id",t).single();if(n)throw n;const i=r;return{id:i.id,codigo:i.codigo,tipo_desconto:i.tipo_desconto,valor_desconto:i.valor_desconto,frete_gratis:!!i.frete_gratis,tipo_aplicacao:i.tipo_aplicacao??"todos",valor_minimo_compra:i.valor_minimo_compra??null,uso_maximo:i.uso_maximo??null,data_expiracao:i.data_expiracao??null,produtos:(i.cupom_produto??[]).map(o=>({p:o.produto_id,v:o.produto_variacao_id??null})),categorias:(i.cupom_categoria??[]).map(o=>o.categoria_id)}},r_e=e=>{const{user:t}=ot(),r=t==null?void 0:t.id;return Et({queryKey:["coupon",e],queryFn:()=>t_e(e,r),enabled:!!e&&!!r})},n_e=({anchorEl:e,open:t,onClose:r,onSelectStatus:n})=>{const i=["pending_payment","paid","processing","shipped","delivered","returned","canceled"];return c.jsxs(Ba,{anchorEl:e,open:t,onClose:r,children:[c.jsx(V,{variant:"caption",fontWeight:500,color:"text.secondary",sx:{px:2,pt:1},children:"Mudar status para:"}),i.map(o=>c.jsx(Mt,{onClick:()=>n(o),children:Oi(o)},o))]})},i_e=async({order_ids:e,order_status:t})=>{const{data:r,error:n}=await Te.from("pedido").update({status_pedido:t}).in("pedido_id",e).select("pedido_id, status_pedido");if(n)throw new Error(n.message);return r},o_e=()=>{const e=ao();return jn({mutationFn:i_e,onMutate:async r=>{const{order_ids:n,order_status:i}=r;await e.cancelQueries({queryKey:["pedidos"]});const o=e.getQueryData(["pedidos"]);return e.setQueryData(["pedidos"],s=>s==null?void 0:s.map(a=>n.includes(a.pedido_id)?{...a,status_pedido:i}:a)),{previousOrders:o||[]}},onError:(r,n,i)=>{console.error("Error editing orders:",r.message),i!=null&&i.previousOrders&&e.setQueryData(["pedidos"],i.previousOrders)},onSettled:(r,n,i)=>{e.invalidateQueries({queryKey:["pedidos"]}),e.invalidateQueries({queryKey:["report-metrics"]}),i.order_ids.forEach(o=>{e.invalidateQueries({queryKey:["pedido",o]}),e.invalidateQueries({queryKey:["orderPayments",o]})})},retry:0})},s_e=()=>{const e=ao();return jn({mutationFn:async({order_ids:t})=>{if(!t.length)throw new Error("Nenhum pedido selecionado para exclusão");const{data:r,error:n}=await Te.from("pedido").update({deletado_em:new Date().toISOString()}).in("pedido_id",t).select("pedido_id");if(n)throw new Error(n.message||"Erro ao excluir pedidos");return{success:!0,count:(r==null?void 0:r.length)||0}},onSuccess:(t,r)=>{pe(fe.DELETE.ORDER_BULK,{orderIds:r.order_ids,count:r.order_ids.length}),e.invalidateQueries({queryKey:["pedidos"]}),e.invalidateQueries({queryKey:["pedido"]}),e.invalidateQueries({queryKey:["newOrdersCount"]}),e.invalidateQueries({queryKey:["manual-orders-count"]}),e.invalidateQueries({queryKey:["report-metrics"]}),e.invalidateQueries({queryKey:["report-top-products"]}),e.invalidateQueries({queryKey:["report-top-customers"]})}})},a_e=()=>{const{data:e}=lo();return Et({queryKey:["storeAddress",e==null?void 0:e.id],queryFn:async()=>{if(!(e!=null&&e.id))return null;const{data:t,error:r}=await Te.from("endereco_loja").select("*").eq("catalogo_web_id",e.id).single();if(r){if(r.code==="PGRST116")return null;throw r}return t},enabled:!!(e!=null&&e.id)})},zd={tamanho_impressao_termica_bluetooth:"58mm",tamanho_impressao_termica_usb:"80mm",tamanho_etiqueta_envio:"a4",incluir_fotos_no_comprovante:!1},l_e=e=>{if(!e)return zd;const t=e.tamanho_impressao_termica;return{tamanho_impressao_termica_bluetooth:e.tamanho_impressao_termica_bluetooth??t??zd.tamanho_impressao_termica_bluetooth,tamanho_impressao_termica_usb:e.tamanho_impressao_termica_usb??t??zd.tamanho_impressao_termica_usb,tamanho_etiqueta_envio:e.tamanho_etiqueta_envio??zd.tamanho_etiqueta_envio,incluir_fotos_no_comprovante:e.incluir_fotos_no_comprovante??zd.incluir_fotos_no_comprovante}},c_e=async e=>{if(!e)throw new Error("User is not authenticated.");const{data:t,error:r}=await Te.from("preferencias_usuario").select("*").eq("user_id",e).maybeSingle();if(r){if(r.code==="PGRST116")return null;throw console.error("Error fetching user preferences:",r),r}return t},S$=()=>{const{user:e}=ot(),t=e==null?void 0:e.id;return Et({queryKey:["userPreferences",t],queryFn:()=>c_e(t),enabled:!!t,retry:(r,n)=>n&&typeof n.code<"u"&&n.code==="PGRST116"?!1:r<3})},qv={},Yx=async(e,t=300,r=300,n=.9)=>{const i=`${e}_${t}x${r}_${n}`;if(qv[i])return qv[i];try{const o=new Image;o.crossOrigin="anonymous",await new Promise((h,f)=>{o.onload=()=>h(),o.onerror=()=>f(new Error("Failed to load image")),o.src=e});const s=document.createElement("canvas"),a=s.getContext("2d");if(!a)throw new Error("Could not get canvas context");const{width:l,height:d}=u_e(o.width,o.height,t,r);s.width=l,s.height=d,a.fillStyle="#ffffff",a.fillRect(0,0,l,d),a.drawImage(o,0,0,l,d);const u=s.toDataURL("image/jpeg",n);return qv[i]=u,s.remove(),u}catch(o){return console.warn("Failed to convert image:",e,o),null}};function u_e(e,t,r,n){const i=e/t;let o=r,s=n;return i>1?(s=Math.round(o/i),s>n&&(s=n,o=Math.round(s*i))):(o=Math.round(s*i),o>r&&(o=r,s=Math.round(o/i))),{width:o,height:s}}const C$=e=>e?!!(e.includes(".webp")||e.includes("format=webp")||e.includes("supabase.co/storage")):!1,d_e=e=>{var n,i;const t=(n=e==null?void 0:e.produto_variacao)==null?void 0:n.image_url;if(typeof t=="string"&&t)return t;const r=(i=e==null?void 0:e.produto)==null?void 0:i.image_url;return Array.isArray(r)&&r[0]?r[0]:typeof r=="string"&&r?r:null},$S=6,h_e=async e=>{if(!e||e.length===0)return{};const t=Array.from(new Set(e.map(d_e).filter(n=>typeof n=="string"&&!!n))),r={};for(let n=0;n<t.length;n+=$S){const i=t.slice(n,n+$S),o=await Promise.all(i.map(s=>Yx(s,120,120,.75)));
331i.forEach((s,a)=>{const l=o[a];l&&(r[s]=l)})}return r},f_e=e=>{const[t,r]=v.useState(!1),[n,i]=v.useState(null),o=qe.isNativePlatform(),{data:s}=Kx(),{data:a}=a_e(),{data:l}=lo(),{data:d}=an(),{data:u}=S$(),{storeUrl:h}=Ng(),{user:f}=ot(),p=Hn(d),m=l_e(u==null?void 0:u.configuracao_impressao).incluir_fotos_no_comprovante,g=()=>`pedidos-stoqui_${Di(new Date,"yyyy-MM-dd_HH-mm-ss")}.pdf`,y=async S=>{if(!(f!=null&&f.id))return null;try{const{data:k,error:A}=await Te.from("parcela").select(` 332 id, 333 pedido_id, 334 numero_parcela, 335 valor_original, 336 data_vencimento, 337 status_parcela, 338 criado_em, 339 atualizado_em, 340 observacoes, 341 pagamento:pagamento ( 342 id, 343 parcela_id, 344 valor, 345 forma_pagamento_id, 346 data_pagamento, 347 criado_em, 348 status, 349 mercadopago_payment_id, 350 mercadopago_preference_id, 351 pagaleve_checkout_id, 352 pagaleve_checkout_url, 353 pagaleve_payment_id, 354 asaas_payment_id, 355 link_pagamento, 356 codigo_pix, 357 pix_key_id, 358 forma_pagamento:forma_pagamento ( 359 id, 360 nome, 361 codigo_padrao, 362 ativo, 363 icone, 364 user_id 365 ), 366 chave_pix:chave_pix ( 367 id, 368 banco, 369 cidade, 370 nome_recebedor, 371 tipo_chave, 372 valor_chave, 373 criado_em, 374 user_id 375 ) 376 ) 377 `).eq("pedido_id",S).order("numero_parcela");return A?null:{parcelas:(k==null?void 0:k.map(_=>{var x;return{id:_.id,pedido_id:_.pedido_id,numero_parcela:_.numero_parcela,valor_original:_.valor_original,data_vencimento:_.data_vencimento,status_parcela:_.status_parcela,criado_em:_.criado_em,atualizado_em:_.atualizado_em,observacoes:_.observacoes,pagamentos:((x=_.pagamento)==null?void 0:x.map(C=>({id:C.id,parcela_id:C.parcela_id,valor:C.valor,forma_pagamento_id:C.forma_pagamento_id,data_pagamento:C.data_pagamento,criado_em:C.criado_em,status:C.status,mercadopago_payment_id:C.mercadopago_payment_id,mercadopago_preference_id:C.mercadopago_preference_id,pagaleve_checkout_id:C.pagaleve_checkout_id,pagaleve_checkout_url:C.pagaleve_checkout_url,pagaleve_payment_id:C.pagaleve_payment_id,asaas_payment_id:C.asaas_payment_id,link_pagamento:C.link_pagamento,codigo_pix:C.codigo_pix,pix_key_id:C.pix_key_id,forma_pagamento:Array.isArray(C.forma_pagamento)?C.forma_pagamento[0]:C.forma_pagamento,chave_pix:Array.isArray(C.chave_pix)?C.chave_pix[0]:C.chave_pix})))||[]}}))||[]}}catch(k){return console.error("Error fetching payment data for order",S,k),null}},b=async S=>{if(!S)return null;try{const{data:k,error:A}=await Te.from("endereco_entrega").select("*").eq("cliente_id",S).order("criado_em",{ascending:!1});return A?null:k||null}catch(k){return console.error("Error fetching addresses for customer",S,k),null}};return{isGenerating:t,error:n,isMobile:o,generateBulkOrdersPDF:async()=>{var S,k;r(!0),i(null);try{const[{pdf:A,Document:w},{VectorizedPrintOrderPage:_}]=await Promise.all([X(()=>import("./react-pdf.browser-1EhQzxMi.js"),__vite__mapDeps([29,2,30,1,3,4,5,6])),X(()=>import("./VectorizedPrintOrder-o2QTzEOv.js"),__vite__mapDeps([31,1,2,29,30,3,4,5,6,32]))]),x=s==null?void 0:s.filter(U=>e.includes(U.pedido_id));if(!x||x.length===0)throw new Error("Nenhum pedido selecionado");const C=g();let P=l;if(l!=null&&l.logo_url)if(C$(l.logo_url)){const U=await Yx(l.logo_url,300,78,.8);P={...l,processed_logo_url:U}}else P={...l,processed_logo_url:l.logo_url};const I=await Promise.all(x.map(async U=>{const $=await y(U.pedido_id),j=await b(U.cliente_id);return{order:U,paymentData:$||void 0,customerAddresses:j||void 0}})),O=m?await h_e(I.flatMap(({order:U})=>U.itens_pedido||[])):void 0,D=c.jsx(w,{children:I.map(({order:U,paymentData:$,customerAddresses:j})=>c.jsx(_,{order:U,storeAddress:a,webCatalog:P,paymentData:$,customerAddresses:j,storeUrl:h,isPro:p,includePhotos:m,productImagesMap:O},U.pedido_id))}),M=await A(D).toBlob();if(o){const U=new FileReader,$=await new Promise(q=>{U.onloadend=()=>{const W=U.result.split(",")[1];q(W)},U.readAsDataURL(M)});await Ao.writeFile({path:C,data:$,directory:Ni.Cache,recursive:!0});const j=await Ao.getUri({directory:Ni.Cache,path:C});await dc.share({title:"Comprovantes dos pedidos",text:`${x.length} comprovante(s) PDF gerado(s)`,url:j.uri,dialogTitle:"Compartilhar PDF"})}else{const U=URL.createObjectURL(M),$=window.open(U,"_blank");if($)$.onload=()=>{$.print(),setTimeout(()=>{URL.revokeObjectURL(U)},1e3)};else{const j=document.createElement("a");j.href=U,j.download=C,document.body.appendChild(j),j.click(),document.body.removeChild(j),URL.revokeObjectURL(U)}}}catch(A){A!=null&&A.message&&!((k=(S=A==null?void 0:A.message)==null?void 0:S.toLowerCase())!=null&&k.includes("cancel"))&&(i("Ocorreu um erro ao gerar o PDF. Por favor, tente novamente."),console.error("Error generating bulk PDF:",A))}finally{r(!1)}},setError:i}},p_e=e=>{var S;const[t,r]=v.useState(!1),[n,i]=v.useState(null),o=qe.isNativePlatform(),{data:s}=Kx(),{data:a}=lo(),{data:l}=an(),{storeUrl:d}=Ng(),{user:u}=ot(),{data:h}=S$(),f=Hn(l),p=(a==null?void 0:a.nome_loja)||"Loja",m=((S=h==null?void 0:h.configuracao_impressao)==null?void 0:S.tamanho_impressao_termica_usb)||"80mm",g=()=>`pedidos-termico-stoqui_${Di(new Date,"yyyy-MM-dd_HH-mm-ss")}.pdf`,y=async k=>
377{if(!(u!=null&&u.id))return null;try{const{data:A,error:w}=await Te.from("parcela").select(` 378 id, 379 pedido_id, 380 numero_parcela, 381 valor_original, 382 data_vencimento, 383 status_parcela, 384 criado_em, 385 atualizado_em, 386 observacoes, 387 pagamento:pagamento ( 388 id, 389 parcela_id, 390 valor, 391 forma_pagamento_id, 392 data_pagamento, 393 criado_em, 394 status, 395 mercadopago_payment_id, 396 mercadopago_preference_id, 397 pagaleve_checkout_id, 398 pagaleve_checkout_url, 399 pagaleve_payment_id, 400 asaas_payment_id, 401 link_pagamento, 402 codigo_pix, 403 pix_key_id, 404 forma_pagamento:forma_pagamento ( 405 id, 406 nome, 407 codigo_padrao, 408 ativo, 409 icone, 410 user_id 411 ), 412 chave_pix:chave_pix ( 413 id, 414 banco, 415 cidade, 416 nome_recebedor, 417 tipo_chave, 418 valor_chave, 419 criado_em, 420 user_id 421 ) 422 ) 423 `).eq("pedido_id",k).order("numero_parcela");return w?null:{parcelas:(A==null?void 0:A.map(x=>{var C;return{id:x.id,pedido_id:x.pedido_id,numero_parcela:x.numero_parcela,valor_original:x.valor_original,data_vencimento:x.data_vencimento,status_parcela:x.status_parcela,criado_em:x.criado_em,atualizado_em:x.atualizado_em,observacoes:x.observacoes,pagamentos:((C=x.pagamento)==null?void 0:C.map(P=>({id:P.id,parcela_id:P.parcela_id,valor:P.valor,forma_pagamento_id:P.forma_pagamento_id,data_pagamento:P.data_pagamento,criado_em:P.criado_em,status:P.status,mercadopago_payment_id:P.mercadopago_payment_id,mercadopago_preference_id:P.mercadopago_preference_id,pagaleve_checkout_id:P.pagaleve_checkout_id,pagaleve_checkout_url:P.pagaleve_checkout_url,pagaleve_payment_id:P.pagaleve_payment_id,asaas_payment_id:P.asaas_payment_id,link_pagamento:P.link_pagamento,codigo_pix:P.codigo_pix,pix_key_id:P.pix_key_id,forma_pagamento:Array.isArray(P.forma_pagamento)?P.forma_pagamento[0]:P.forma_pagamento,chave_pix:Array.isArray(P.chave_pix)?P.chave_pix[0]:P.chave_pix})))||[]}}))||[]}}catch(A){return console.error("Error fetching payment data for order",k,A),null}},b=async k=>{if(!k)return null;try{const{data:A,error:w}=await Te.from("endereco_entrega").select("*").eq("cliente_id",k).order("criado_em",{ascending:!1});return w?null:(A==null?void 0:A[0])||null}catch(A){return console.error("Error fetching addresses for customer",k,A),null}};return{isGenerating:t,error:n,isMobile:o,generateBulkThermalOrdersPDF:async()=>{var k,A;r(!0),i(null);try{const[{pdf:w,Document:_},{VectorizedPrintThermalReceiptPage:x}]=await Promise.all([X(()=>import("./react-pdf.browser-1EhQzxMi.js"),__vite__mapDeps([29,2,30,1,3,4,5,6])),X(()=>import("./VectorizedPrintThermalReceipt-DV9mnvng.js"),__vite__mapDeps([33,1,2,29,30,3,4,5,6]))]),C=s==null?void 0:s.filter(M=>e.includes(M.pedido_id));if(!C||C.length===0)throw new Error("Nenhum pedido selecionado");const P=g(),I=await Promise.all(C.map(async M=>{const U=await y(M.pedido_id),$=await b(M.cliente_id);return{order:M,paymentData:U||void 0,customerAddress:$||void 0}})),O=c.jsx(_,{children:I.map(({order:M,paymentData:U,customerAddress:$})=>c.jsx(x,{order:M,storeName:p,storeUrl:f?d:void 0,paymentData:U,customerAddress:$,size:m==="desativado"?"80mm":m},M.pedido_id))}),D=await w(O).toBlob();if(o){const M=new FileReader,U=await new Promise(j=>{M.onloadend=()=>{const q=M.result.split(",")[1];j(q)},M.readAsDataURL(D)});await Ao.writeFile({path:P,data:U,directory:Ni.Cache,recursive:!0});const $=await Ao.getUri({directory:Ni.Cache,path:P});await dc.share({title:"Comprovantes térmicos dos pedidos",text:`${C.length} comprovante(s) térmico(s) PDF gerado(s)`,url:$.uri,dialogTitle:"Compartilhar PDF"})}else{const M=URL.createObjectURL(D),U=window.open(M,"_blank");if(U)U.onload=()=>{U.print(),setTimeout(()=>{URL.revokeObjectURL(M)},1e3)};else{const $=document.createElement("a");$.href=M,$.download=P,document.body.appendChild($),$.click(),document.body.removeChild($),URL.revokeObjectURL(M)}}}catch(w){w!=null&&w.message&&!((A=(k=w==null?void 0:w.message)==null?void 0:k.toLowerCase())!=null&&A.includes("cancel"))&&(i("Ocorreu um erro ao gerar o PDF. Por favor, tente novamente."),console.error("Error generating bulk thermal PDF:",w))}finally{r(!1)}},setError:i}},m_e=()=>{const[e,t]=v.useState(!1),[r,n]=v.useState(null),i=qe.isNativePlatform(),{data:o}=lo(),{data:s}=an(),{storeUrl:a}=Ng(),l=Hn(s),d=y=>`relatorio-pedidos_${Di(new Date,"yyyy-MM-dd_HH-mm-ss")}.${y}`,u=y=>{if(!(y.parcelas&&y.parcelas.length>0))return"Não pago";const E=y.parcelas.length,S=y.parcelas.filter(k=>k.status_parcela==="paga").length;return S===E&&E>0?"Pago":S>0?"Parcialmente pago":"Não pago"},h=y=>{switch(y){case"a_vista":return"à vista";case"parcelado":return"Parcelado";
423case"fiado":return"Fiado";default:return y}},f=y=>{var k;const b=((k=y.frete_pedido)==null?void 0:k.valor_frete)||0,E=y.valor_desconto||0,S=y.taxa_de_venda||0;return y.subtotal+b+S-E},p=y=>{const b=["Data/Hora","Nº Pedido","Cliente","Telefone","Status do pedido","Status do pagamento","Condição de pagamento","Qtd. Itens","Subtotal","Frete","Desconto","Taxa de venda","Total","Total pago","Total pendente","Origem","Cupom"],E=y.map(w=>{var U,$,j,q;const _=_o(w.data_pedido),x=((U=w.frete_pedido)==null?void 0:U.valor_frete)||0,C=w.valor_desconto||0,P=w.taxa_de_venda||0,I=f(w),O=(($=w.itens_pedido)==null?void 0:$.reduce((W,ne)=>W+ne.quantidade,0))||0,D=w.total_pago||0,M=w.total_pendente||I-D;return[Di(_,"dd/MM/yyyy HH:mm"),w.numero_pedido||w.pedido_id,`"${(((j=w.cliente)==null?void 0:j.nome)||"").replace(/"/g,'""')}"`,((q=w.cliente)==null?void 0:q.telefone)||"",Oi(w.status_pedido),u(w),h(w.condicao_pagamento),O,w.subtotal.toFixed(2).replace(".",","),x.toFixed(2).replace(".",","),C.toFixed(2).replace(".",","),P.toFixed(2).replace(".",","),I.toFixed(2).replace(".",","),D.toFixed(2).replace(".",","),M.toFixed(2).replace(".",","),w.origem==="catalogo"?"Online":"Presencial",w.cupom_codigo||""]}),S=y.reduce((w,_)=>{var P,I;const x=f(_),C=((P=_.itens_pedido)==null?void 0:P.reduce((O,D)=>O+D.quantidade,0))||0;return{items:w.items+C,subtotal:w.subtotal+_.subtotal,shipping:w.shipping+(((I=_.frete_pedido)==null?void 0:I.valor_frete)||0),discount:w.discount+(_.valor_desconto||0),taxa:w.taxa+(_.taxa_de_venda||0),total:w.total+x,paid:w.paid+(_.total_pago||0),pending:w.pending+(_.total_pendente||x-(_.total_pago||0))}},{items:0,subtotal:0,shipping:0,discount:0,taxa:0,total:0,paid:0,pending:0}),k=["TOTAL",`${y.length} pedidos`,"","","","","",S.items,S.subtotal.toFixed(2).replace(".",","),S.shipping.toFixed(2).replace(".",","),S.discount.toFixed(2).replace(".",","),S.taxa.toFixed(2).replace(".",","),S.total.toFixed(2).replace(".",","),S.paid.toFixed(2).replace(".",","),S.pending.toFixed(2).replace(".",","),"",""];return["\uFEFF",b.join(";"),...E.map(w=>w.join(";")),"",k.join(";")].join(` 424`)};return{isExporting:e,error:r,exportToCSV:async y=>{var b,E;t(!0),n(null);try{if(y.length===0)throw new Error("Nenhum pedido para exportar");const S=p(y),k=d("csv");if(i){const A=btoa(unescape(encodeURIComponent(S)));await Ao.writeFile({path:k,data:A,directory:Ni.Cache,recursive:!0});const w=await Ao.getUri({directory:Ni.Cache,path:k});await dc.share({title:"Relatório de pedidos",text:`Relatório com ${y.length} pedido(s)`,url:w.uri,dialogTitle:"Exportar CSV"})}else{const A=new Blob([S],{type:"text/csv;charset=utf-8;"}),w=URL.createObjectURL(A),_=document.createElement("a");_.href=w,_.download=k,document.body.appendChild(_),_.click(),document.body.removeChild(_),URL.revokeObjectURL(w)}}catch(S){S!=null&&S.message&&!((E=(b=S==null?void 0:S.message)==null?void 0:b.toLowerCase())!=null&&E.includes("cancel"))&&(n("Ocorreu um erro ao exportar CSV. Por favor, tente novamente."),console.error("Error exporting CSV:",S))}finally{t(!1)}},exportToPDF:async(y,b)=>{var E,S;t(!0),n(null);try{if(y.length===0)throw new Error("Nenhum pedido para exportar");const[{pdf:k},{default:A}]=await Promise.all([X(()=>import("./react-pdf.browser-1EhQzxMi.js"),__vite__mapDeps([29,2,30,1,3,4,5,6])),X(()=>import("./OrdersReportPDF-X4V0y0_n.js"),__vite__mapDeps([34,1,2,29,30,3,4,5,6,32]))]),w=d("pdf");let _=o;if(o!=null&&o.logo_url)if(C$(o.logo_url)){const P=await Yx(o.logo_url,200,60,.8);_={...o,processed_logo_url:P}}else _={...o,processed_logo_url:o.logo_url};const C=await k(c.jsx(A,{orders:y,webCatalog:_,storeUrl:a,isPro:l,dateRange:b})).toBlob();if(i){const P=new FileReader,I=await new Promise(D=>{P.onloadend=()=>{const M=P.result.split(",")[1];D(M)},P.readAsDataURL(C)});await Ao.writeFile({path:w,data:I,directory:Ni.Cache,recursive:!0});const O=await Ao.getUri({directory:Ni.Cache,path:w});await dc.share({title:"Relatório de pedidos",text:`Relatório PDF com ${y.length} pedido(s)`,url:O.uri,dialogTitle:"Exportar PDF"})}else{const P=URL.createObjectURL(C);if(!window.open(P,"_blank")){const O=document.createElement("a");O.href=P,O.download=w,document.body.appendChild(O),O.click(),document.body.removeChild(O)}setTimeout(()=>{URL.revokeObjectURL(P)},1e3)}}catch(k){k!=null&&k.message&&!((S=(E=k==null?void 0:k.message)==null?void 0:E.toLowerCase())!=null&&S.includes("cancel"))&&(n("Ocorreu um erro ao exportar PDF. Por favor, tente novamente."),console.error("Error exporting PDF:",k))}finally{t(!1)}},setError:n}};var Zx={},g_e=zt;Object.defineProperty(Zx,"__esModule",{value:!0});var vm=Zx.default=void 0,v_e=g_e(Wt()),y_e=c;vm=Zx.default=(0,v_e.default)((0,y_e.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");var Xx={},__e=zt;Object.defineProperty(Xx,"__esModule",{value:!0});var Eu=Xx.default=void 0,b_e=__e(Wt()),x_e=c;Eu=Xx.default=(0,b_e.default)((0,x_e.jsx)("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert");var Jx={},w_e=zt;Object.defineProperty(Jx,"__esModule",{value:!0});var Qx=Jx.default=void 0,E_e=w_e(Wt()),S_e=c;Qx=Jx.default=(0,E_e.default)((0,S_e.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H5V5h14zM17.99 9l-1.41-1.42-6.59 6.59-2.58-2.57-1.42 1.41 4 3.99z"}),"CheckBoxOutlined");var e4={},C_e=zt;
424Object.defineProperty(e4,"__esModule",{value:!0});var t4=e4.default=void 0,T_e=C_e(Wt()),A_e=c;t4=e4.default=(0,T_e.default)((0,A_e.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete");var r4={},k_e=zt;Object.defineProperty(r4,"__esModule",{value:!0});var Ih=r4.default=void 0,R_e=k_e(Wt()),I_e=c;Ih=r4.default=(0,R_e.default)((0,I_e.jsx)("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList");var n4={},P_e=zt;Object.defineProperty(n4,"__esModule",{value:!0});var T$=n4.default=void 0,O_e=P_e(Wt()),DS=c;T$=n4.default=(0,O_e.default)([(0,DS.jsx)("path",{d:"M19.5 3.5 18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2v14H3v3c0 1.66 1.34 3 3 3h12c1.66 0 3-1.34 3-3V2zM19 19c0 .55-.45 1-1 1s-1-.45-1-1v-3H8V5h11z"},"0"),(0,DS.jsx)("path",{d:"M9 7h6v2H9zm7 0h2v2h-2zm-7 3h6v2H9zm7 0h2v2h-2z"},"1")],"ReceiptLong");var i4={},j_e=zt;Object.defineProperty(i4,"__esModule",{value:!0});var A$=i4.default=void 0,L_e=j_e(Wt()),$_e=c;A$=i4.default=(0,L_e.default)((0,$_e.jsx)("path",{d:"M22 10V6c0-1.11-.9-2-2-2H4c-1.1 0-1.99.89-1.99 2v4c1.1 0 1.99.9 1.99 2s-.89 2-2 2v4c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2v-4c-1.1 0-2-.9-2-2s.9-2 2-2m-9 7.5h-2v-2h2zm0-4.5h-2v-2h2zm0-4.5h-2v-2h2z"}),"ConfirmationNumber");const k$=e=>c.jsxs(Pn,{...e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c.jsx("path",{d:"M19.5 14.25V11.625C19.5 10.7299 19.1444 9.87145 18.5115 9.23851C17.8786 8.60558 17.0201 8.25 16.125 8.25H14.625C14.3266 8.25 14.0405 8.13147 13.8295 7.9205C13.6185 7.70952 13.5 7.42337 13.5 7.125V5.625C13.5 4.72989 13.1444 3.87145 12.5115 3.23851C11.8785 2.60558 11.0201 2.25 10.125 2.25H8.25M10.5 2.25H5.625C5.004 2.25 4.5 2.754 4.5 3.375V20.625C4.5 21.246 5.004 21.75 5.625 21.75H18.375C18.996 21.75 19.5 21.246 19.5 20.625V11.25C19.5 8.86305 18.5518 6.57387 16.864 4.88604C15.1761 3.19821 12.8869 2.25 10.5 2.25Z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),c.jsx("path",{d:"M16.999 13.4738C16.9893 13.588 16.9377 13.6942 16.8546 13.7712C16.7714 13.8481 16.6629 13.8901 16.5507 13.8887H15.2601V14.7773H16.1149C16.2271 14.7758 16.3357 14.8177 16.4189 14.8947C16.502 14.9717 16.5536 15.078 16.5632 15.1922C16.5672 15.253 16.5588 15.314 16.5388 15.3713C16.5187 15.4287 16.4873 15.4812 16.4465 15.5256C16.4058 15.5701 16.3565 15.6055 16.3018 15.6296C16.2471 15.6538 16.1881 15.6662 16.1285 15.666H15.2601V16.5397C15.2616 16.6544 15.2206 16.7654 15.1453 16.8504C15.07 16.9354 14.9659 16.9881 14.8542 16.9979C14.7947 17.0019 14.735 16.9934 14.6789 16.9729C14.6228 16.9524 14.5714 16.9203 14.528 16.8787C14.4845 16.837 14.4499 16.7866 14.4262 16.7307C14.4026 16.6748 14.3905 16.6145 14.3906 16.5536V13.4443C14.3906 13.3265 14.4364 13.2135 14.5179 13.1301C14.5995 13.0468 14.7101 13 14.8254 13H16.5643C16.6239 12.9999 16.6829 13.0123 16.7376 13.0364C16.7923 13.0606 16.8416 13.0959 16.8824 13.1404C16.9231 13.1848 16.9545 13.2373 16.9746 13.2947C16.9947 13.352 17.003 13.413 16.999 13.4738ZM8.30427 13H7.43479C7.31949 13 7.20892
42413.0468 7.12739 13.1301C7.04586 13.2135 7.00006 13.3265 7.00006 13.4443V16.5397C6.99827 16.6546 7.03917 16.7658 7.11451 16.8511C7.18984 16.9363 7.29401 16.9892 7.40599 16.999C7.46546 17.0031 7.5251 16.9946 7.58122 16.974C7.63733 16.9535 7.68872 16.9214 7.73219 16.8798C7.77566 16.8381 7.81029 16.7877 7.83391 16.7318C7.85754 16.6759 7.86966 16.6156 7.86953 16.5547V16.1104H8.27167C9.09984 16.1104 9.80086 15.4483 9.82531 14.6024C9.8315 14.3943 9.79673 14.187 9.72307 13.9929C9.64941 13.7987 9.53836 13.6217 9.39651 13.4723C9.25465 13.3228 9.08488 13.204 8.89726 13.1229C8.70964 13.0418 8.50799 13 8.30427 13ZM8.28525 15.2217H7.86953V13.8887H8.30427C8.39548 13.8882 8.48576 13.9074 8.56929 13.9448C8.65282 13.9823 8.72773 14.0372 8.78918 14.1061C8.85064 14.175 8.89727 14.2563 8.92607 14.3447C8.95487 14.4332 8.9652 14.5268 8.95638 14.6196C8.93741 14.7871 8.85824 14.9415 8.73424 15.0527C8.61024 15.164 8.45023 15.2242 8.28525 15.2217ZM11.7822 13H10.9127C10.7974 13 10.6868 13.0468 10.6053 13.1301C10.5238 13.2135 10.478 13.3265 10.478 13.4443V16.5547C10.478 16.6725 10.5238 16.7856 10.6053 16.8689C10.6868 16.9522 10.7974 16.999 10.9127 16.999H11.7452C12.8136 16.999 13.713 16.1392 13.738 15.0478C13.7443 14.7813 13.6983 14.5161 13.6029 14.2679C13.5074 14.0198 13.3644 13.7936 13.1821 13.6028C12.9999 13.412 12.7822 13.2604 12.5417 13.1569C12.3013 13.0533 12.0431 13 11.7822 13ZM11.7556 16.1104H11.3474V13.8887H11.7822C11.9285 13.8886 12.0733 13.9186 12.208 13.9771C12.3427 14.0356 12.4644 14.1213 12.5659 14.229C12.6674 14.3367 12.7465 14.4643 12.7986 14.604C12.8507 14.7438 12.8747 14.8928 12.869 15.0423C12.8462 15.6432 12.3441 16.1104 11.7556 16.1104Z",fill:"currentColor"})]});var o4={},D_e=zt;Object.defineProperty(o4,"__esModule",{value:!0});var ym=o4.default=void 0,M_e=D_e(Wt()),N_e=c;ym=o4.default=(0,M_e.default)((0,N_e.jsx)("path",{d:"M10 10.02h5V21h-5zM17 21h3c1.1 0 2-.9 2-2v-9h-5zm3-18H5c-1.1 0-2 .9-2 2v3h19V5c0-1.1-.9-2-2-2M3 19c0 1.1.9 2 2 2h3V10H3z"}),"TableChart");function Hl({primaryText:e,secondaryText:t}){return c.jsxs(me,{mt:4,spacing:1,alignItems:"center",justifyContent:"center",mx:"auto",children:[c.jsx(V,{variant:"body1",color:"textSecondary",fontStyle:"italic",textAlign:"center",children:e}),t&&c.jsx(V,{variant:"body2",color:"textSecondary",textAlign:"center",children:t})]})}const F_e=e=>{const t=new Date(e);return mg(t)?"hoje":sI(t)?"ontem":Di(t,"PPPP")},U_e="/assets/orders-B-9NLwcj.png";function B_e(){return c.jsxs(me,{alignItems:"center",spacing:1.5,sx:{pt:8,pb:4,px:3},children:[c.jsx(F,{component:"img",src:U_e,alt:"",sx:{height:120,mb:1}}),c.jsx(V,{variant:"subtitle1",fontWeight:600,textAlign:"center",children:"Seus pedidos aparecerão aqui"}),c.jsx(V,{variant:"body2",color:"text.secondary",textAlign:"center",sx:{maxWidth:280},children:"Registre uma venda manualmente ou compartilhe sua loja para receber pedidos online."})]})}const Ef=({open:e,onClose:t,title:r="",description:n,children:i,planSuggestion:o="pro"})=>{const s=At(),a=()=>{s(`/profile/paywall?initialPlan=${o}`)},l=o==="lite"?ip:o==="black"?Qa:ra;return c.jsxs(Fr,{open:e,onClose:t,PaperProps:{sx:{borderRadius:2,maxWidth:"320px",margin:2}},children:[c.jsxs(zr,{sx:{pb:1,pt:3,px:3,display:"flex",alignItems:"center",gap:1,"& .MuiTypography-root":{fontSize:"1rem",fontWeight:600}},children:[r||"Recurso "," ",c.jsx(l,{variant:"contained",fontSize:14})]}),c.jsxs(Er,{sx:{px:3,pt:1,pb:3},children:[c.jsx(V,{variant:"body2",color:"text.secondary",sx:{mb:1},children:n}),i]}),c.jsxs(nn,{sx:{px:3,pb:3,display:"flex",flexDirection:"column",gap:1},children:[c.jsx(De,{fullWidth:!0,variant:"contained",onClick:a,sx:{background:o==="lite"?"linear-gradient(180deg, #00B8D9 0%, #0077B6 100%)":o==="black"?"linear-gradient(90deg, #4A148C 0%, #1A1A1A 100%)":"linear-gradient(180deg, #8A23DE 0%, #3D219D 100%)",textTransform:"none",py:1,fontSize:"0.875rem",fontWeight:500,boxShadow:"0px 4px 6px rgba(0, 0, 0, 0.1)"},children:c.jsx(me,{direction:"row",spacing:1,alignItems:"center",children:c.jsx("span",{children:"Saiba mais"})})}),c.jsx(De,{fullWidth:!0,color:"inherit",onClick:t,sx:{textTransform:"none",fontSize:"0.875rem"},children:"Agora não"})]})]})};var s4={},V_e=zt;
424Object.defineProperty(s4,"__esModule",{value:!0});var a4=s4.default=void 0,H_e=V_e(Wt()),z_e=c;a4=s4.default=(0,H_e.default)((0,z_e.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add");const W_e=()=>{const e=Qn.lite.manualSales,t=Qn.free.manualSales,r=At(),{triggerPaywall:n}=No(),[i,o]=v.useState(!1),{data:s}=an(),a=np(s),l=a==="pro"||a==="black"?1/0:a==="lite"?e:t,{data:d=0}=h$(),u=a==="pro"||d<l,h=a==="free"?"lite":"pro",f=`Você atingiu o limite mensal de ${t} pedidos manuais. Faça upgrade para criar mais pedidos.`,p=`Você atingiu o limite mensal de ${e} pedidos manuais. Faça upgrade para criar pedidos ilimitados.`,m=()=>{pe(fe.ORDER.CREATE_CLICK),u?(pe(fe.ORDER.CREATE_START),r("/orders/new")):(pe(fe.ORDER.CREATE_BLOCKED,{reason:"manual_orders_limit",current_count:d,limit:l}),n("manual_orders_limit",{pageAction:()=>o(!0),source:"new_order_fab"}))};return c.jsxs(c.Fragment,{children:[c.jsx(k_,{color:"primary","aria-label":"add",onClick:m,sx:{position:"fixed",bottom:"calc(56px + 16px + var(--safe-area-inset-bottom))",right:16},children:c.jsx(a4,{})}),c.jsx(Ef,{open:i,planSuggestion:h,onClose:()=>o(!1),title:"Limite de pedidos manuais atingido",description:a==="free"?f:a==="lite"?p:"",children:c.jsxs(zn,{severity:"info",sx:{mt:2},children:[c.jsx(Q0,{children:"Não se preocupe"}),"Os pedidos ",c.jsx("strong",{children:"online"})," continuam funcionando normalmente pelo link da sua loja."]})})]})},q_e=DD` 425 0% { 426 box-shadow: 0 0 0 0 rgba(103, 58, 183, 0.7); 427 } 428 429 70% { 430 box-shadow: 0 0 0 10px rgba(103, 58, 183, 0); 431 } 432 433 100% { 434 box-shadow: 0 0 0 0 rgba(103, 58, 183, 0); 435 } 436`,l4=({text:e,visible:t,fabBottom:r="calc(var(--safe-area-inset-bottom) + 16px + 56px)",fabRight:n=16})=>{const[i,o]=v.useState(!1);if(v.useEffect(()=>{if(t){const d=setTimeout(()=>{o(!0)},500);return()=>clearTimeout(d)}else o(!1)},[t]),!t)return null;const s={bottom:r,right:n},a=`calc(${s.bottom} + 70px)`;return c.jsxs(F,{sx:{position:"fixed",bottom:a,right:16,zIndex:1200,pointerEvents:"none",display:"flex",alignItems:"center",flexDirection:"column"},children:[c.jsx(F,{sx:{position:"relative",background:"#ffffff",color:"#505060",padding:"10px 14px",borderRadius:"16px",boxShadow:"0 1px 4px rgba(0, 0, 0, 0.04)",maxWidth:"220px",transform:i?"translateY(0)":"translateY(10px)",opacity:i?1:0,transition:"transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease",marginBottom:"12px",border:"1px solid rgba(236, 236, 246, 0.6)","&::before":{content:'""',position:"absolute",bottom:"-10px",right:"20px",width:"20px",height:"20px",backgroundColor:"#ffffff",clipPath:"polygon(0 0, 100% 0, 50% 100%)",transform:"rotate(135deg)",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.03)",zIndex:-1,borderRight:"1px solid rgba(236, 236, 246, 0.6)",borderBottom:"1px solid rgba(236, 236, 246, 0.6)"}},children:c.jsx(V,{variant:"body2",sx:{fontWeight:500,textAlign:"center",fontSize:"13px",letterSpacing:"0",lineHeight:1.3},children:e})}),c.jsx(F,{sx:{position:"fixed",bottom:s.bottom,right:s.right,width:"56px",height:"56px",borderRadius:"50%",animation:i?`${q_e} 2s infinite`:"none",boxShadow:i?"0 0 0 0 rgba(103, 58, 183, 0.4)":"none"}})]})},G_e=[{value:"all",label:"Todos os status"},{value:"new",label:Oi("new")},{value:"pending_payment",label:Oi("pending_payment")},{value:"paid",label:Oi("paid")},{value:"processing",label:Oi("processing")},{value:"shipped",label:Oi("shipped")},{value:"delivered",label:Oi("delivered")},{value:"returned",label:Oi("returned")},{value:"canceled",label:Oi("canceled")}],K_e=({value:e})=>
436{if(e==="all")return c.jsx(F,{sx:{width:14,height:14,borderRadius:"50%",bgcolor:"#F3F4F6"}});const t=g$(e);return c.jsx(F,{sx:{width:14,height:14,borderRadius:"50%",bgcolor:t.backgroundColor,border:`2px solid ${t.color}`}})},Y_e=[{value:"all",label:"Todos",icon:c.jsx(ps,{}),color:"default"},{value:"paid",label:"Pago",icon:c.jsx(ps,{}),color:"success.main"},{value:"partial",label:"Parcialmente pago",icon:c.jsx(cM,{}),color:"info.main"},{value:"unpaid",label:"Não pago",icon:c.jsx(uM,{}),color:"warning.main"}],Z_e=({open:e,onClose:t,selectedStatus:r,selectedPaymentStatus:n,onApply:i,onClearAll:o})=>{const[s,a]=v.useState(r),[l,d]=v.useState(n);v.useEffect(()=>{e&&(a(r),d(n))},[e,r,n]);const u=s!=="all"||l!=="all",h=g=>{a(g)},f=g=>{d(g)},p=()=>{i(s,l),t()},m=()=>{a("all"),d("all"),o(),t()};return c.jsxs(Fr,{open:e,onClose:t,maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:2}},children:[c.jsxs(zr,{children:[c.jsx(V,{variant:"h6",fontWeight:600,children:"Filtros"}),c.jsx(V,{variant:"body2",color:"text.secondary",children:"Selecione os filtros para refinar sua busca"})]}),c.jsx(Er,{children:c.jsxs(F,{children:[c.jsx(V,{variant:"subtitle1",fontWeight:600,gutterBottom:!0,sx:{mt:1},children:"Status do pedido"}),c.jsx(ei,{sx:{mb:3},children:G_e.map(g=>c.jsxs(yn,{onClick:()=>h(g.value),selected:s===g.value,children:[c.jsx(Vt,{sx:{minWidth:36},children:c.jsx(K_e,{value:g.value})}),c.jsx(St,{primary:g.label,primaryTypographyProps:{fontWeight:s===g.value?600:400}}),s===g.value&&c.jsx(io,{color:"primary"})]},g.value))}),c.jsx(V,{variant:"subtitle1",fontWeight:600,gutterBottom:!0,children:"Status do pagamento"}),c.jsx(ei,{children:Y_e.map(g=>c.jsxs(yn,{onClick:()=>f(g.value),selected:l===g.value,children:[c.jsx(Vt,{children:c.jsx(F,{sx:{color:g.color||"text.primary"},children:g.icon})}),c.jsx(St,{primary:g.label,primaryTypographyProps:{fontWeight:l===g.value?600:400}}),l===g.value&&c.jsx(io,{color:"primary"})]},g.value))})]})}),c.jsxs(nn,{sx:{p:2,gap:1,flexDirection:u?"row":"column"},children:[u&&c.jsx(De,{onClick:m,color:"inherit",fullWidth:!0,children:"Limpar"}),c.jsx(De,{onClick:p,variant:"contained",fullWidth:!0,children:"Aplicar"})]})]})},Ku=(e,t=!1)=>{if(!e||typeof e!="string")return"";let r=e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim();return t&&(r=r.replace(/[^a-z0-9]/g,"")),r},Ql=(e,t)=>{if(!e||typeof e!="string"||!e.trim())return!0;if(!t||typeof t!="string")return!1;const r=Ku(e),n=Ku(t);return r.split(/\s+/).filter(o=>o.length>0).every(o=>n.includes(o))},X_e=(e,t)=>{if(!e||typeof e!="string"||!e.trim())return!0;if(!t||typeof t!="string")return!1;const r=Ku(e,!0);return Ku(t,!0).includes(r)},J_e=(e,t)=>!e||typeof e!="string"||!e.trim()?!0:!t||typeof t!="string"?!1:Ku(t,!0).includes(Ku(e,!0)),KTe=e=>!e||typeof e!="string"?"":e.replace(/[\u{1F600}-\u{1F64F}]/gu,"").replace(/[\u{1F300}-\u{1F5FF}]/gu,"").replace(/[\u{1F680}-\u{1F6FF}]/gu,"").replace(/[\u{1F700}-\u{1F77F}]/gu,"").replace(/[\u{1F780}-\u{1F7FF}]/gu,"").replace(/[\u{1F800}-\u{1F8FF}]/gu,"").replace(/[\u{1F900}-\u{1F9FF}]/gu,"").replace(/[\u{1FA00}-\u{1FA6F}]/gu,"").replace(/[\u{1FA70}-\u{1FAFF}]/gu,"").replace(/[\u{2600}-\u{26FF}]/gu,"").replace(/[\u{2700}-\u{27BF}]/gu,"").replace(/[\u{1F1E0}-\u{1F1FF}]/gu,"").replace(/[\u{FE00}-\u{FE0F}]/gu,"").replace(/\u{200D}/gu,"").replace(/[\u{E0000}-\u{E007F}]/gu,"").trim(),Q_e=oe(()=>X(()=>import("./CustomDateRangePicker--Q6V_lmU.js").then(e=>e.a),__vite__mapDeps([35,1,2,36]))),ebe=[{value:"all",label:"Todos"},{value:"thisMonth",label:"Este mês"},{value:"thisWeek",label:"Esta semana"},{value:"30days",label:"Ãltimos 30 dias"}],tbe=({selectedOption:e,onOptionChange:t,customDateRange:r,onCustomDateRangeChange:n})=>{const i=$o(),[o,s]=v.useState(!1),a=v.useMemo(()=>({startDate:new Date(Date.now()-7*24*60*60*1e3),endDate:new Date}),[]),l=r||a,d=()=>{const f=l.startDate,p=l.endDate,m=y=>String(y).padStart(2,"0"),g=y=>`${m(y.getDate())}/${m(y.getMonth()+1)}`;return`${g(f)} - ${g(p)}`},u=(f,p)=>{Li(Ja.Light),f==="custom"?s(!0):t(f),p.currentTarget&&p.currentTarget.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},h=(f,p)=>{n==null||n({startDate:f,endDate:p}),t("custom")};return c.jsxs(c.Fragment,{children:[c.jsxs(me,{direction:"row",spacing:1,sx:{overflowX:"auto",px:i.spacing(2),"&::-webkit-scrollbar":{display:"none"},"-ms-overflow-style":"none","scrollbar-width":"none"},children:[c.jsx(Fn,{avatar:c.jsx(Dh,{children:c.jsx(Kd,{sx:{fontSize:"14px"}})}),label:e==="custom"?d():"Personalizado",onClick:f=>u("custom",f),color:e==="custom"?"primary":"default",variant:"filled",sx:{fontWeight:500,flexShrink:0,height:32}}),ebe.map(f=>c.jsx(Fn,{label:f.label,onClick:p=>u(f.value,p),color:e===f.value?"primary":"default",variant:"filled",sx:{fontWeight:500,flexShrink:0,height:32}},f.value))]}),o&&c.jsx(v.Suspense,{fallback:null,children:c.jsx(Q_e,{open:o,onClose:()=>s(!1),onApply:h,initialStartDate:l.startDate,initialEndDate:l.endDate})})]})},rbe=({orders:e,subscription:t})=>{const r=e.length,n=e.reduce((l,d)=>{var m;const u=((m=d.frete_pedido)==null?void 0:m.valor_frete)||0,h=d.valor_desconto||0,f=d.taxa_de_venda||0,p=d.subtotal+u+f-h;return l+p},0),i=l=>new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(l),o=Hn(t),s=l=>
436o||l===0?i(l):"R$ ***",a=l=>o||l===0?l:"***";return r===0?null:c.jsx(F,{sx:{mb:1},children:c.jsxs(me,{direction:"row",spacing:.5,alignItems:"center",children:[c.jsxs(V,{variant:"caption",color:"text.secondary",children:[a(r)," ",r===1?"pedido":"pedidos",", ",s(n)," total"]}),!o&&(r>0||n>0)&&c.jsx(ra,{variant:"text",fontSize:"10px"})]})})},nbe=Ee.memo(bye);function ibe(){const[e,t]=ws(),r=v.useRef(0),n=v.useRef(null),[i,o]=v.useState([]),[s,a]=v.useState(!1),[l,d]=v.useState(!1),[u,h]=v.useState(null),[f,p]=v.useState(null),[m,g]=v.useState(!1),[y,b]=v.useState(null),[E,S]=v.useState(!1),[k,A]=v.useState(!1),[w,_]=v.useState(!1),{triggerPaywall:x}=No(),[C,P]=v.useState("dateFilter"),I=e.get("query")||"",O=e.get("status")||"all",D=e.get("paymentStatus")||"all",M=e.get("dateRangeOption")||"all",U=e.get("startDate"),$=e.get("endDate"),j=e.get("customerId"),q=e.get("couponId"),[W,ne]=v.useState(()=>{if(U&&$)try{return{startDate:_o(U),endDate:_o($)}}catch{return null}return null}),ae=O!=="all"||D!=="all"||M!=="all"||!!j||!!q,re=At(),_e=j?Number(j):void 0,{data:be,isLoading:J,isError:xe,error:Ze}=Kx(_e),{data:$e}=e_e(j||""),{data:Le}=r_e(q||void 0),{data:Fe}=an(),ft=o_e(),Ge=s_e(),{generateBulkOrdersPDF:Se,isGenerating:je}=f_e(i),{generateBulkThermalOrdersPDF:Ce,isGenerating:Pe}=p_e(i),{exportToCSV:Ue,exportToPDF:z,isExporting:Q}=m_e(),ie=Mge(Fe),te=ue=>{if(!(ue.parcelas&&ue.parcelas.length>0))return"unpaid";const Oe=ue.parcelas.length,ct=ue.parcelas.filter(Ot=>Ot.status_parcela==="paga").length;return ct===Oe&&Oe>0?"paid":ct>0?"partial":"unpaid"},he=v.useMemo(()=>{if(!be)return[];let ue=be;if(I.trim()&&(ue=ue.filter(ye=>{var Oe,ct;return Ql(I,(Oe=ye.cliente)==null?void 0:Oe.nome)||Ql(I,(ct=ye.numero_pedido)==null?void 0:ct.toString())})),O!=="all"&&(ue=ue.filter(ye=>ye.status_pedido===O)),D!=="all"&&(ue=ue.filter(ye=>te(ye)===D)),q){const ye=Number(q);ue=ue.filter(Oe=>Oe.cupom_id===ye)}if(M!=="all"){let ye=null,Oe=null;const ct=new Date;switch(M){case"30days":ye=Bn(V1(ct,29)),Oe=Ka(ct);break;case"thisMonth":ye=fg(ct),Oe=pg(ct);break;case"thisWeek":ye=vs(ct,{weekStartsOn:1}),Oe=BR(ct,{weekStartsOn:1});break;case"custom":W!=null&&W.startDate&&(W!=null&&W.endDate)&&(ye=Bn(W.startDate),Oe=Ka(W.endDate));break}if(ye&&Oe){const Ot=ye.getTime(),Be=Oe.getTime();ue=ue.filter(Y=>{const ke=_o(Y.data_pedido).getTime();return ke>=Ot&&ke<=Be})}}return ue.sort((ye,Oe)=>ye.numero_pedido&&Oe.numero_pedido?Oe.numero_pedido-ye.numero_pedido:_o(Oe.data_pedido).getTime()-_o(ye.data_pedido).getTime())},[be,I,O,D,q,M,W]),ve=ue=>{o(ye=>ye.includes(ue)?ye.filter(Oe=>Oe!==ue):[...ye,ue])},Re=(ue,ye)=>{if((ue!=="all"||ye!=="all")&&!vd(Fe,"lite")){x("order_filters_status",{pageAction:()=>{P("regularFilter"),_(!0)},source:"orders_page"});return}const Oe=new URLSearchParams(e);ue!=="all"?Oe.set("status",ue):Oe.delete("status"),ye!=="all"?Oe.set("paymentStatus",ye):Oe.delete("paymentStatus"),t(Oe,{replace:!0})},He=()=>{const ue=new URLSearchParams(e);ue.delete("status"),ue.delete("paymentStatus"),ue.delete("dateRangeOption"),ue.delete("startDate"),ue.delete("endDate"),ue.delete("customerId"),ue.delete("couponId"),t(ue,{replace:!0})},dt=ue=>{const ye=new URLSearchParams(e);ue==="status"?ye.delete("status"):ue==="paymentStatus"?ye.delete("paymentStatus"):ue==="dateRange"?(ye.delete("dateRangeOption"),ye.delete("startDate"),ye.delete("endDate")):ue==="customer"?ye.delete("customerId"):ue==="coupon"&&ye.delete("couponId"),t(ye,{replace:!0})},N=Wx(()=>{Li(),a(!0)},{cancelOnMovement:!0}),T=ue=>{h(ue.currentTarget)},R=()=>{h(null),A(!1)},B=ue=>{p(ue.currentTarget)},G=()=>{p(null)},le=()=>{R(),A(!0);const ue=u;setTimeout(()=>{h(ue)},100)},ce=ue=>{b(ue),g(!0),A(!1),R()},Ke=()=>{y&&ft.mutate({order_ids:i,order_status:y}),g(!1),b(null),A(!1),a(!1),o([])},xt=()=>{S(!0),R()},vt=()=>{Ge.mutate({order_ids:i}),S(!1),A(!1),a(!1),o([])},Rt=()=>{ie?Se():(x("bulk_print",{pageAction:()=>{P("bulkPDF"),_(!0)},source:"orders_page_bulk_a4"}),R())},yt=()=>{ie?Ce():(x("bulk_print",{pageAction:()=>{P("bulkPDF"),_(!0)},source:"orders_page_bulk_thermal"}),R())},Me=()=>{let ue="Todos os pedidos";return M!=="all"&&(ue=yr(M)),{startDate:W==null?void 0:W.startDate,endD
436ate:W==null?void 0:W.endDate,label:ue}},it=()=>{if(G(),!Hn(Fe)){x("orders_export",{pageAction:()=>{P("export"),_(!0)},source:"orders_page_export_csv"});return}Ue(he)},tr=()=>{if(G(),!Hn(Fe)){x("orders_export",{pageAction:()=>{P("export"),_(!0)},source:"orders_page_export_pdf"});return}z(he,Me())},lt=()=>{a(!1),o([]),A(!1)},Ct=()=>{a(!0),G()},Zt=ue=>{const Oe=Object.values(ue).flat().map(Ot=>Ot.pedido_id),ct=Oe.length>0&&Oe.every(Ot=>i.includes(Ot));o(ct?i.filter(Ot=>!Oe.includes(Ot)):[...i.filter(Ot=>!Oe.includes(Ot)),...Oe])},pt=ue=>{const Oe=Object.values(ue).flat().map(Ot=>Ot.pedido_id),ct=Oe.filter(Ot=>i.includes(Ot)).length;return ct===0?{checked:!1,indeterminate:!1}:ct===Oe.length?{checked:!0,indeterminate:!1}:{checked:!1,indeterminate:!0}},ur=ue=>ue==="all"?"":Oi(ue),Ut=ue=>{switch(ue){case"paid":return"Pago";case"partial":return"Parcialmente pago";case"unpaid":return"Não pago";default:return""}},lr=ue=>{if(ue!=="all"&&!Hn(Fe)){x("order_filters_date",{pageAction:()=>{P("dateFilter"),_(!0)},source:"orders_page"});return}const ye=new URLSearchParams(e);ue==="all"?(ye.delete("dateRangeOption"),ye.delete("startDate"),ye.delete("endDate")):ue==="custom"?ye.set("dateRangeOption",ue):(ye.set("dateRangeOption",ue),ye.delete("startDate"),ye.delete("endDate")),t(ye,{replace:!0})},Ln=ue=>{if(!Hn(Fe)){x("order_filters_date",{pageAction:()=>{P("dateFilter"),_(!0)},source:"orders_page_custom_range"});return}ne(ue);const ye=new URLSearchParams(e);ye.set("dateRangeOption","custom"),ye.set("startDate",ue.startDate.toISOString()),ye.set("endDate",ue.endDate.toISOString()),t(ye,{replace:!0})},yr=ue=>{switch(ue){case"30days":return"Ãltimos 30 dias";case"thisMonth":return"Este mês";case"thisWeek":return"Esta semana";case"custom":{const ye=Be=>String(Be).padStart(2,"0"),Oe=Be=>`${ye(Be.getDate())}/${ye(Be.getMonth()+1)}`,ct=W==null?void 0:W.startDate,Ot=W==null?void 0:W.endDate;return ct&&Ot?`${Oe(ct)} - ${Oe(Ot)}`:"Personalizado"}default:return""}},Z=()=>j?($e==null?void 0:$e.nome)||`Cliente ${j}`:"",se=()=>q?(Le==null?void 0:Le.codigo)||`Cupom ${q}`:"",de=!J&&(be==null?void 0:be.length)===0,Ae=he.reduce((ue,ye)=>{const Oe=F_e(_o(ye.data_pedido));return ue[Oe]||(ue[Oe]=[]),ue[Oe].push(ye),ue},{}),Ve=Object.keys(Ae).sort((ue,ye)=>_o(Ae[ye][0].data_pedido).getTime()-_o(Ae[ue][0].data_pedido).getTime());v.useLayoutEffect(()=>{const ue=()=>{n.current&&(r.current=n.current.offsetTop)};return ue(),window.addEventListener("resize",ue),()=>window.removeEventListener("resize",ue)},[]);const Je=v.useMemo(()=>{const ue=[];let ye=0;return Ve.forEach(Oe=>{ue.push({type:"header",date:Oe,index:ye++}),Ae[Oe].forEach(ct=>{ue.push({type:"order",order:ct,index:ye++})})}),ue},[Ve,Ae]),at=x$({count:Je.length,estimateSize:ue=>{const ye=Je[ue];return(ye==null?void 0:ye.type)==="header"?40:120},getItemKey:ue=>{const ye=Je[ue];return ye?ye.type==="header"?`header-${ye.date}`:`order-${ye.order.pedido_id}`:ue},overscan:5,scrollMargin:r.current,enabled:!0}),Qe=at.getVirtualItems(),Xe=Ee.useMemo(()=>`${O}-${D}-${M}-${j}-${q}-${I}`,[O,D,M,j,q,I]);return Ee.useEffect(()=>{window.scrollTo({top:0,behavior:"instant"})},[Xe]),xe?c.jsx(V,{color:"error",children:Ze==null?void 0:Ze.message}):c.jsxs(F,{sx:{width:"100%",display:"flex",flexDirection:"column",flexGrow:1,overflow:"hidden",position:"relative"},children:[c.jsx(Sc,{title:"Pedidos",children:s?c.jsxs(c.Fragment,{children:[c.jsx(mr,{color:"inherit",onClick:lt,children:c.jsx(vm,{})}),c.jsx(mr,{color:"inherit",onClick:T,children:c.jsx(Eu,{})})]}):c.jsxs(c.Fragment,{children:[c.jsx(zx,{}),c.jsx(e1,{color:"primary",variant:"dot",invisible:!ae,sx:{"& .MuiBadge-badge":{right:6,top:6},ml:1},children:c.jsx(mr,{color:"inherit",onClick:()=>d(!0),children:c.jsx(Ih,{})})}),he.length>0&&c.jsx(mr,{color:"inherit",onClick:B,children:c.jsx(Eu,{})})]})}),c.jsxs(F,{ref:n,sx:{bgcolor:"background.default",pt:2,pb:2},children:[c.jsx(F,{children:c.jsx(tbe,{selectedOption:M,onOptionChange:lr,customDateRange:W||void 0,onCustomDateRangeChange:Ln})}),(O!=="all"||D!=="all"||!!j||!!q||M!=="all"&&(O!=="all"||D!=="all"||!!j||!!q))&&c.jsx(F,{sx:{px:2,pt:1},children:c.jsxs(me,{direction:"row",spacing:1,flexWrap:"wrap",children:[O!=="all"&&c.jsx(Fn,{label:ur(O),onDelete:()=>dt("status"),variant:"filled",color:"primary",sx:{"& .MuiChip-label":{fontWeight:600}}}),D!=="all"&&c.jsx(Fn,{label:Ut(D),onDelete:()=>dt("paymentStatus"),variant:"filled",color:"secondary",sx:{"& .MuiChip-label":{fontWeight:600}}}),j&&c.jsx(Fn,{label:Z(),onDelete:()=>dt("customer"),variant:"filled",color:"info",icon:c.jsx(Bg,{}),sx:{"& .MuiChip-label":{fontWeight:600}}}),q&&c.jsx(Fn,{label:se(),onDelete:()=>dt("coupon"),variant:"filled",color:"success",icon:c.jsx(A$,{}),sx:{"& .MuiChip-label":{fontWeight:600}}}),M!=="all"&&(O!=="all"||D!=="all"||!!j||!!q)&&c.jsx(Fn,{label:yr(M),onDelete:()=>dt("dateRange"),variant:"filled",color:"primary",sx:{"& .MuiChip-label":{fontWeight:600}}})]})})]}),c.jsx(W_e,{}),c.jsx(l4,{text:"Clique no botão de + para criar um pedido manualmente",visible:de,fabBottom:"calc(56px + 16px + var(--safe-area-inset-bottom))",fabRight:16}),c.jsxs(Ba,{anchorEl:f,open:!!f,onClose:G,children:[c.jsxs(Mt,{onClick:Ct,children:[c.jsx(Vt,{children:c.jsx(Qx,{})}),c.jsx(St,{primary:"Selecionar"})]}),c.jsxs(Mt,{onClick:it,disabled:Q,children:[c.jsx(Vt,{children:c.jsx(ym,{})}),c.jsx(St,{primary:`Exportar CSV${he.length>0?` (${he.length})`:""}`})]}),c.jsxs(Mt,{onClick:tr,disabled:Q,children:[c.jsx(Vt,{children:c.jsx(k$,{})}),c.jsx(St,{primary:`Exportar PDF${he.length>0?` (${he.length})`:""}`})]})]}),c.jsx(F,{sx:{position:"relative",overflow:"auto",px:2,pb:2},children:J?c.jsxs(ei,{sx:{backgroundColor:"background.paper"},children:[c.jsx(F,{sx:{px:1,py:1.5},component:"li",children:c.jsx(Lt,{variant:"text",width:50,height:16,sx:{fontSize:"0.75rem"}})}),Array.from({length:6}).map((ue,ye)=>c.jsx(Lt,{variant:"rectangular",sx:{borderRadius:1,mb:1},width:"100%",height:"104px"},ye))]}):he.length>0?c.jsxs(c.Fragment,{children:[c.jsx(rbe,{orders:he,subscription:Fe}),c.jsx(F,{style:{height:`${at.getTotalSize()}px`,width:"100%",position:"relative",contain:"layout style paint",willChange:"transform"},children:Qe.map(ue=>{var ke,et,Gt;const ye=Je[ue.index];if(!ye)return null;if(ye.type==="header")return c.jsx(F,{"data-index":ue.index,ref:at.measureElement,style:{position:"absolute",display:"flow-root",top:0,left:0,width:"100%",transform:`translateY(${ue.start-at.options.scrollMargin}px)`},children:c.jsx(F,{sx:{px:2,py:1.5},children:c.jsx(V,{variant:"caption",display:"block",gutterBottom:!0,fontWeight:600,color:"text.secondary",children:ye.date})})},`header-${ye.date}`);const Oe=ye.order,ct=((ke=Oe.frete_pedido)==null?void 0:ke.valor_frete)||0,Ot=Oe.valor_desconto||0,Be=Oe.taxa_de_venda||0,Y=Oe.subtotal+ct+Be-Ot;return c.jsx(F,{"data-index":ue.index,ref:at.measureElement,style:{position:"absolute",display:"flow-root",top:0,left:0,width:"100%",transform:`translateY(${ue.start-at.options.scrollMargin}px)`},children:c.jsx(nbe,{orderNumber:Oe.numero_pedido,userName:(et=Oe.cliente)==null?void 0:et.nome,value:Y,timestamp:Oe.data_pedido,orderStatus:Oe.status_pedido,paymentCondition:Oe.condicao_pagamento,parcelas:Oe.parcelas,onClick:()=>re(`/orders/${Oe.pedido_id}?navigateBack=true`),onSelect:()=>ve(Oe.pedido_id),selectEnabled:s,selected:i.includes(Oe.pedido_id),longPressEvents:N,payOn
436DeliveryLabel:Oe.origem==="catalogo"&&Oe.pagamento_entrega_escolha==="na_entrega"&&Oe.pagamento_entrega_metodo_nome?`${Oe.pagamento_entrega_metodo_nome} na ${((Gt=Oe.frete_pedido)==null?void 0:Gt.tipo_frete)==="retirada"?"retirada":"entrega"}`:null})},`order-${Oe.pedido_id}`)})},Xe)]}):(be==null?void 0:be.length)===0?c.jsx(B_e,{}):c.jsx(Hl,{primaryText:"Nenhum resultado encontrado",secondaryText:"Tente remover a palavra-chave de busca ou os filtros selecionados."})}),c.jsx(n_e,{anchorEl:u,open:!!u&&k,onClose:()=>{A(!1),R()},onSelectStatus:ce}),c.jsxs(Ba,{anchorEl:u,open:!!u&&s&&!k,onClose:R,children:[c.jsxs(Mt,{onClick:()=>Zt(Ae),children:[c.jsx(Vt,{children:c.jsx(pc,{checked:pt(Ae).checked,indeterminate:pt(Ae).indeterminate,tabIndex:-1,disableRipple:!0,sx:{p:"0px"}})}),c.jsx(St,{primary:"Selecionar todos"})]}),c.jsxs(Mt,{onClick:le,disabled:i.length===0,children:[c.jsx(Vt,{children:c.jsx(px,{})}),c.jsx(St,{primary:i.length>0?`Mudar status (${i.length})`:"Mudar status"})]}),c.jsxs(Mt,{onClick:Rt,disabled:i.length===0||je,children:[c.jsx(Vt,{children:c.jsx(jme,{})}),c.jsx(St,{primary:c.jsxs(F,{sx:{display:"flex",alignItems:"center",gap:1},children:[i.length>0?`Comprovante A4 (${i.length})`:"Comprovante A4",c.jsx(Qa,{variant:ie?"cutout":"contained",fontSize:14})]})})]}),c.jsxs(Mt,{onClick:yt,disabled:i.length===0||Pe,children:[c.jsx(Vt,{children:c.jsx(T$,{})}),c.jsx(St,{primary:c.jsxs(F,{sx:{display:"flex",alignItems:"center",gap:1},children:[i.length>0?`Comprovante térmico (${i.length})`:"Comprovante térmico",c.jsx(Qa,{variant:ie?"cutout":"contained",fontSize:14})]})})]}),c.jsxs(Mt,{onClick:xt,disabled:i.length===0,children:[c.jsx(Vt,{children:c.jsx(t4,{})}),c.jsx(St,{primary:i.length>0?`Excluir pedidos (${i.length})`:"Excluir pedidos"})]})]}),c.jsxs(Fr,{open:m,onClose:()=>g(!1),children:[c.jsx(zr,{children:"Mudar status?"}),c.jsx(Er,{children:c.jsx(vi,{children:`Quer marcar ${i.length} pedido(s) como "${Oi(y||"")}"?`})}),c.jsxs(nn,{children:[c.jsx(De,{onClick:()=>g(!1),color:"primary",children:"Cancelar"}),c.jsx(De,{onClick:Ke,color:"primary",autoFocus:!0,children:"Confirmar"})]})]}),c.jsxs(Fr,{open:E,onClose:()=>S(!1),children:[c.jsx(zr,{children:"Excluir pedidos?"}),c.jsx(Er,{children:c.jsx(vi,{children:`Tem certeza que deseja excluir ${i.length} pedido(s)? Esta ação não pode ser desfeita.`})}),c.jsxs(nn,{children:[c.jsx(De,{onClick:()=>S(!1),color:"primary",children:"Cancelar"}),c.jsx(De,{onClick:vt,color:"error",autoFocus:!0,children:"Excluir"})]})]}),c.jsx(Z_e,{open:l,onClose:()=>d(!1),selectedStatus:O,selectedPaymentStatus:D,onApply:Re,onClearAll:He}),c.jsx(Ef,{open:w,onClose:()=>_(!1),title:C==="dateFilter"?"Filtros de data":C==="bulkPDF"?"Impressão de pedidos em massa":C==="export"?"Exportar relatório de pedidos":"Filtros avançados",description:C==="dateFilter"?"Os filtros de data nos pedidos são um recurso de planos PRO ou acima. Faça upgrade para acessar filtros por perÃodo personalizado e outras funcionalidades avançadas.":C==="bulkPDF"?"Impressão de pedidos em massa é exclusivo do plano BLACK. Faça upgrade para gerar comprovantes A4 de múltiplos pedidos de uma vez.":C==="export"?"A exportação de relatórios de pedidos para CSV e PDF é um recurso do plano PRO. Faça upgrade para gerar relatórios dos seus pedidos.":"Os filtros por status e condição de pagamento nos pedidos são recursos para planos pagos. Faça upgrade para acessar filtros avançados e outras funcionalidades.",planSuggestion:C==="dateFilter"?"pro":C==="bulkPDF"?"black":C==="export"?"pro":"lite"})]})}const obe=()=>qe.isNativePlatform(),sbe=e=>new Promise((t,r)=>{const n=new FileReader;n.onerror=()=>r(n.error),n.onloadend=()=>t(n.result.split(",")[1]),n.readAsDataURL(e)}),abe=e=>{var t,r;return(e==null?void 0:e.name)==="AbortError"||!!((r=(t=e==null?void 0:e.message)==null?void 0:t.toLowerCase)!=null&&r.call(t).includes("cancel"))};async function lbe(e,t,r={}){if(obe()){await Ao.writeFile({path:t,data:await sbe(e),directory:Ni.Cache,recursive:!0});const{uri:o}=await Ao.getUri({directory:Ni.Cache,path:t});await dc.share({title:r.title,text:r.text,url:o,dialogTitle:r.dialogTitle});return}const n=window.URL.createObjectURL(e),i=document.createElement("a");i.href=n,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(n)}const cbe=e=>{if(!e)return"";const t=e.match(/^(\d{3})(\d{3})(\d{3})(\d{2})$/);if(t){const[,r,n,i,o]=t;return`${r}.${n}.${i}-${o}`}return e},ube=e=>{if(!e)return"";const t=e.match(/^(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})$/);if(t){const[,r,n,i,o,s]=t;return`${r}.${n}.${i}/${o}-${s}`}return e},dbe=e=>{if(!e)return"";const t=e.replace(/\D/g,"");return t.length===11?cbe(t):t.length===14?ube(t):e},hbe=["nome","email","cpf_cnpj","telefone","observacoes","dia_aniversario","mes_aniversario","cep","logradouro","numero","complemento","bairro","localidade","uf","nome_destinatario","telefone_contato","informacoes_adicionais"],MS=";",fbe=e=>{if(e==null)return"";const t=String(e);return/[";\n\r]/.test(t)?`"${t.replace(/"/g,'""')}"`:t},pbe=e=>e.reduce((t,r)=>t===null||r.id>t.id?r:t,null),mbe=e=>{const t=pbe(e.enderecos??[]);return[e.nome,e.email,e.cpf_cnpj?dbe(e.cpf_cnpj):null,e.telefone,e.observacoes,e.dia_aniversario,e.mes_aniversario,t!=null&&t.cep?q1(t.cep):null,(t==null?void 0:t.logradouro)??null,(t==null?void 0:t.numero)??null,(t==null?void 0:t.complemento)??null,(t==null?void 0:t.bairro)??null,(t==null?void 0:t.localidade)??null,(t==null?void 0:t.uf)??null,(t==null?void 0:t.nome_destinatario)??null,(t==null?void 0:t.telefone_contato)??null,(t==null?void 0:t.informacoes_adicionais)??null]},gbe=e=>"\uFEFF"+[hbe.join(MS),...e.map(r=>mbe(r).map(fbe).join(MS))].join(` 437`),Gv=1e3,vbe=50,ybe=async e=>{const t=[];for(let r=0;r<vbe;r++){const n=r*Gv,{data:i,error:o}=await Te.from("cliente").select(` 438 id, 439 nome, 440 email, 441 cpf_cnpj, 442 telefone, 443 observacoes, 444 dia_aniversario, 445 mes_aniversario, 446 enderecos:endereco_entrega( 447 id, 448 cep, 449 logradouro, 450 numero, 451 complemento, 452 bairro, 453 localidade, 454 uf, 455 nome_destinatario, 456 telefone_contato, 457 informacoes_adicionais 458 ) 459 `).eq("user_id",e).is("deletado_em",null).order("nome",{ascending:!0}).order("id",{ascending:!0}).range(n,n+Gv-1);if(o)throw new Error(o.message);const s=i??[];if(t.push(...s),s.length<Gv)break}return t},_be=()=>{const{user:e}=ot(),[t,r]=v.useState(!1),[n,i]=v.useState(null);return{isExporting:t,error:n,setError:i,exportToCSV:async s=>{if(!(!(e!=null&&e.id)||s.length===0)){r(!0),i(null);try{const a=new Set(s),l=(await ybe(e.id)).filter(h=>a.has(h.id));if(l.length===0)throw new Error("Nenhum cliente para exportar");const d=gbe(l),u=`clientes_${Di(new Date,"yyyy-MM-dd_HH-mm-ss")}.csv`;await lbe(new Blob([d],{type:"text/csv;charset=utf-8;"}),u,{title:"Clientes",text:`${l.length} ${l.length===1?"cliente":"clientes"}`,dialogTitle:"Exportar CSV"})}catch(a){abe(a)||(console.error("Error exporting customers CSV:",a),i("Não foi possÃvel exportar os clientes. Tente novamente."))}finally{r(!1)}}}}},xa=(e,t)=>({background:`hsl(${e}, ${t}%, 91%)`,border:`hsl(${e}, ${t}%, 82%)`,text:`hsl(${e}, ${t}%, 45%)`}),NS=[xa(222,55),xa(186,50),xa(258,52),xa(292,45),xa(338,55),xa(18,60),xa(40,65),xa(160,40)],bbe=e=>{let t=0;for(let r=0;r<e.length;r++)t=t*31+e.charCodeAt(r)>>>0;return NS[t%NS.length]},xbe=async(e,t)=>{if(!e)return null;try{let r=e;if(e.includes("/storage/v1/object/public/")){const o=e.match(new RegExp(`\\/${t}
459\\/(.+)$`));o&&(r=o[1])}else if(e.includes(`/${t}/`))r=e.replace(`/${t}/`,"");else if(e.startsWith("http"))return e;const{data:n,error:i}=await Te.storage.from(t).createSignedUrl(r,3600);return i?(console.warn("Failed to generate signed URL:",i),null):n.signedUrl}catch(r){return console.warn("Error generating signed URL:",r),null}},wbe=({path:e,bucketName:t,enabled:r=!0})=>Et({queryKey:["signedImage",t,e],queryFn:()=>xbe(e,t),enabled:r&&!!e,staleTime:30*60*1e3,gcTime:60*60*1e3,retry:1});function Ebe(e){if(!e||e.trim()==="")return{sx:{bgcolor:"rgba(158, 158, 158, 0.4)",border:"2px solid rgba(158, 158, 158, 0.55)",color:"rgba(97, 97, 97, 1)"},children:c.jsx(Bg,{})};const t=bbe(e.trim()),r=t.background,n=t.border,i=t.text;return e=e.trim(),e.split(" ").length<2?{children:`${e[0]}`,sx:{bgcolor:r,color:i,border:`2px solid ${n}`}}:{children:`${e.split(" ")[0][0]}${e.split(" ")[e.split(" ").length-1][0]}`,sx:{bgcolor:r,color:i,border:`2px solid ${n}`}}}function Sbe(e){const{alt:t="",id:r="",imageUrl:n,...i}=e,{data:o,isLoading:s}=wbe({path:n,bucketName:"customer-images",enabled:!!n&&!n.startsWith("blob:")});let a=null;if(n!=null&&n.startsWith("blob:")?a=n:n&&o?a=o:n&&s&&(a=n),a)return c.jsx(Dh,{...i,src:a,alt:t,sx:{...e.sx}});const l=Ebe(t);return c.jsx(Dh,{...i,...l,sx:{...e.sx,...l.sx}})}const Cbe=({isBirthday:e=!0,onClick:t,size:r="medium",showLabel:n=!1})=>{if(!e)return null;const o=(()=>{switch(r){case"small":return{icon:{fontSize:16},box:{width:24,height:24},button:{padding:.5}};case"large":return{icon:{fontSize:24},box:{width:40,height:40},button:{padding:1.5}};case"medium":default:return{icon:{fontSize:20},box:{width:32,height:32},button:{padding:1}}}})(),s="#C465F8",a=c.jsx(F,{sx:{bgcolor:`${s}20`,borderRadius:"50%",display:"flex",justifyContent:"center",alignItems:"center",...o.box},children:c.jsx(Hg,{sx:{color:s,...o.icon}})}),l=t?c.jsx(mr,{onClick:t,sx:{p:o.button},"aria-label":"View birthdays",children:a}):a;return c.jsxs(F,{sx:{display:"flex",alignItems:"center",gap:1},children:[l,n&&c.jsx(V,{variant:"caption",sx:{fontSize:r==="small"?"0.7rem":"0.8rem",color:s,fontWeight:600},children:"Aniversário"})]})},Tbe="#C465F8",Kv=({name:e,phone:t,imageUrl:r,onClick:n,userId:i,id:o,selected:s=!1,selectEnabled:a=!1,longPressEvents:l,isBirthdayToday:d=!1,birthdayDate:u,daysUntilBirthday:h})=>
459{const f=!d&&!!(u!=null&&u.day)&&!!(u!=null&&u.month);return c.jsx($m,{disablePadding:!0,children:c.jsxs(yn,{onClick:n,sx:{padding:2,display:"flex",justifyContent:"space-between",width:"100%"},...a?{}:l==null?void 0:l(),children:[a&&c.jsx(pc,{edge:"start",checked:s,tabIndex:-1,disableRipple:!0,inputProps:{"aria-labelledby":o==null?void 0:o.toString()},onClick:p=>{p.stopPropagation(),n()},sx:{mr:2}}),c.jsx(DC,{children:c.jsx(Sbe,{alt:e,id:`customer-avatar-${i||""}`,imageUrl:r,sx:{width:RS,height:RS,marginRight:2}})}),c.jsx(St,{primary:c.jsxs(F,{sx:{display:"flex",alignItems:"center",gap:.5},children:[c.jsx(V,{component:"span",noWrap:!0,sx:{...Bx,minWidth:0},children:e}),d&&c.jsx(Cbe,{size:"small",showLabel:!1})]}),secondary:c.jsxs(me,{direction:"row",spacing:1,alignItems:"center",children:[c.jsx(V,{variant:"caption",sx:{color:"text.secondary"},children:Hu(t)}),f&&c.jsx(fc,{icon:c.jsx(Hg,{}),backgroundColor:"rgba(196, 101, 248, 0.08)",textColor:Tbe,label:`${String(u.day).padStart(2,"0")}/${String(u.month).padStart(2,"0")}${h!==void 0?` · ${h===1?"amanhã":`em ${h} dias`}`:""}`})]}),secondaryTypographyProps:{component:"div"}})]})})},Abe=async e=>{if(!e)throw new Error("Usuário não autenticado");const{data:t,error:r}=await Te.from("cliente").select("id, telefone, cpf_cnpj, nome, email, profile_url, customer_user_id, dia_aniversario, mes_aniversario, tabela_preco_id, tabela_preco:tabela_preco_id(nome)").eq("user_id",e).order("nome",{ascending:!0}).is("deletado_em",null);if(r)throw new Error(r.message);return(t||[]).map(n=>{var i;return{...n,tabela_preco_nome:((i=n.tabela_preco)==null?void 0:i.nome)||null,tabela_preco:void 0}})},kbe=()=>{const{user:e}=ot(),t=e==null?void 0:e.id;return Et({queryKey:["customers"],queryFn:()=>Abe(t),enabled:!!t})},Rbe=e=>{const{user:t}=ot(),r=t==null?void 0:t.id;return Et({queryKey:["todaysBirthdays",e],queryFn:async()=>{if(!r)throw new Error("User is not authenticated");const n=new Date,i=n.getDate(),o=n.getMonth()+1;let s=Te.from("cliente").select("id").eq("user_id",r).eq("dia_aniversario",i).eq("mes_aniversario",o).is("deletado_em",null);e&&e.length>0&&(s=s.in("id",e));const{data:a,error:l}=await s;if(l)throw new Error(l.message);const d={};return e&&e.forEach(u=>{d[u]=!1}),(a||[]).forEach(u=>{d[u.id]=!0}),d},enabled:!!r})},Ibe=async e=>{if(!e)throw new Error("Usuário não autenticado");const{data:t,error:r}=await Te.from("cliente").select(` 460 id, 461 telefone, 462 cpf_cnpj, 463 nome, 464 email, 465 profile_url, 466 customer_user_id, 467 dia_aniversario, 468 mes_aniversario, 469 tabela_preco_id, 470 endereco_entrega:endereco_entrega( 471 id, 472 localidade, 473 bairro 474 ) 475 `).eq("user_id",e).is("deletado_em",null).order("nome",{ascending:!0});if(r)throw new Error(r.message);return(t||[]).map(n=>({...n,addresses:n.endereco_entrega||[]}))},Pbe=()=>{const{user:e}=ot(),t=e==null?void 0:e.id;return Et({queryKey:["customersWithAddresses",t],queryFn:()=>Ibe(t),enabled:!!t})},Obe=async e=>{if(!e)throw new Error("Usuário não autenticado");const{data:t,error:r}=await Te.from("endereco_entrega").select(` 476 localidade, 477 bairro, 478 cliente:cliente_id ( 479 id, 480 user_id, 481 deletado_em 482 ) 483 `).eq("cliente.user_id",e).is("cliente.deletado_em",null);if(r)throw new Error(r.message);const n={};t==null||t.forEach(o=>{if(o.cliente&&o.localidade&&o.bairro){const s=`${o.localidade}|${o.bairro}`;n[s]||(n[s]=new Set),n[s].add(o.cliente.id)}});const i={};return Object.entries(n).forEach(([o,s])=>{const[a,l]=o.split("|"),d=s.size;i[a]||(i[a]={city:a,totalCustomers:0,neighborhoods:{}}),i[a].neighborhoods[l]=d,i[a].totalCustomers+=d}),i},jbe=()=>{const{user:e}=ot(),t=e==null?void 0:e.id;return Et({queryKey:["customerLocations",t],queryFn:()=>Obe(t),enabled:!!t})},Lbe=async e=>{if(!e)throw new Error("Usuário não autenticado");const{data:t,error:r}=await Te.from("tabela_preco").select("*, cliente(count)").eq("user_id",e).is("deletado_em",null).order("criado_em",{ascending:!1});if(r)throw new Error(r.message);return t},c4=()=>{const{user:e}=ot(),t=e==null?void 0:e.id;return Et({queryKey:["price-tables",t],queryFn:()=>Lbe(t),enabled:!!t})},$be=[{value:"all",label:"Todos",icon:c.jsx(ps,{}),color:"default"},{value:"today",label:"Aniversário hoje",icon:c.jsx(dM,{}),color:"#C465F8"},{value:"upcoming",label:"Aniversário próximo",icon:c.jsx(hM,{}),color:"#C465F8"}],Dbe=({open:e,onClose:t,onSelect:r,selectedCity:n,cities:i,isLoading:o})=>{const s=a=>{r(a),t()};return c.jsxs(Fr,{open:e,onClose:t,maxWidth:"sm",fullWidth:!0,children:[c.jsx(zr,{children:c.jsx(V,{variant:"h6",fontWeight:600,children:"Selecionar cidade"})}),c.jsx(Er,{children:o?c.jsx(me,{spacing:1,children:[1,2,3,4,5].map(a=>c.jsx(Lt,{variant:"rectangular",height:48},a))}):c.jsxs(ei,{children:[c.jsxs(yn,{onClick:()=>s(null),selected:!n,children:[c.jsx(St,{primary:"Todas as cidades"}),!n&&c.jsx(io,{color:"primary"})]}),i.map(a=>c.jsxs(yn,{onClick:()=>s(a.city),selected:n===a.city,children:[c.jsx(St,{primary:`${a.city} (${a.totalCustomers})`}),n===a.city&&c.jsx(io,{color:"primary"})]},a.city))]})}),c.jsx(nn,{children:c.jsx(De,{onClick:t,children:"Cancelar"})})]})},Mbe=({open:e,onClose:t,onSelect:r,selectedNeighborhood:n,neighborhoods:i,isLoading:o})=>{const s=a=>{r(a),t()};return c.jsxs(Fr,{open:e,onClose:t,maxWidth:"sm",fullWidth:!0,children:[c.jsx(zr,{children:c.jsx(V,{variant:"h6",fontWeight:600,children:"Selecionar bairro"})}),c.jsx(Er,{children:o?c.jsx(me,{spacing:1,children:[1,2,3,4,5].map(a=>c.jsx(Lt,{variant:"rectangular",height:48},a))}):c.jsxs(ei,{children:[c.jsxs(yn,{onClick:()=>s(null),selected:!n,children:[c.jsx(St,{primary:"Todos os bairros"}),!n&&c.jsx(io,{color:"primary"})]}),i.map(a=>c.jsxs(yn,{onClick:()=>s(a.name),selected:n===a.name,children:[c.jsx(St,{primary:`${a.name} (${a.count})`}),n===a.name&&c.jsx(io,{color:"primary"})]},`${a.city}-${a.name}`))]})}),c.jsx(nn,{children:c.jsx(De,{onClick:t,children:"Cancelar"})})]})},Nbe=({open:e,onClose:t,onSelect:r,selectedPriceTableId:n,priceTables:i})=>{const o=s=>{r(s),t()};return c.jsxs(Fr,{open:e,onClose:t,maxWidth:"sm",fullWidth:!0,children:[c.jsx(zr,{children:c.jsx(V,{variant:"h6",fontWeight:600,children:"Selecionar tabela de preço"})}),c.jsx(Er,{children:c.jsxs(ei,{children:[c.jsxs(yn,{onClick:()=>o(null),selected:!n,children:[c.jsx(St,{primary:"Todas as tabelas"}),!n&&c.jsx(io,{color:"primary"})]}),i.map(s=>c.jsxs(yn,{onClick:()=>
483o(s.id),selected:n===s.id,children:[c.jsx(St,{primary:s.nome}),n===s.id&&c.jsx(io,{color:"primary"})]},s.id))]})}),c.jsx(nn,{children:c.jsx(De,{onClick:t,children:"Cancelar"})})]})},Fbe=({open:e,onClose:t,selectedBirthdayFilter:r,selectedCity:n,selectedNeighborhood:i,selectedPriceTableId:o,onApply:s,onClearAll:a})=>{const[l,d]=v.useState(r),[u,h]=v.useState(n),[f,p]=v.useState(i),[m,g]=v.useState(o),[y,b]=v.useState(!1),[E,S]=v.useState(!1),[k,A]=v.useState(!1),{data:w,isLoading:_}=jbe(),{data:x}=c4(),C=v.useMemo(()=>(x||[]).filter(ae=>ae.ativo),[x]);v.useEffect(()=>{e&&(d(r),h(n),p(i),g(o))},[e,r,n,i,o]);const P=v.useMemo(()=>w?Object.values(w).sort((ae,re)=>ae.city.localeCompare(re.city)):[],[w]),I=v.useMemo(()=>{if(!w)return[];let ae=[];return Object.values(w).forEach(re=>{Object.entries(re.neighborhoods).forEach(([_e,be])=>{ae.push({name:_e,count:be,city:re.city})})}),u&&(ae=ae.filter(re=>re.city===u)),ae.sort((re,_e)=>re.name.localeCompare(_e.name))},[w,u]),O=l!=="all"||u!==null||f!==null||m!==null,D=ae=>{d(ae)},M=ae=>{var re;h(ae),f&&ae&&w&&!((re=w[ae])!=null&&re.neighborhoods[f])&&p(null)},U=ae=>{p(ae)},$=()=>{s(l,u,f,m),t()},j=()=>{d("all"),h(null),p(null),g(null),a(),t()},q=()=>u?!w||!w[u]?u:`${u} (${w[u].totalCustomers})`:"Filtrar por cidade",W=()=>{if(!f)return"Filtrar por bairro";const ae=I.find(re=>re.name===f);return ae?`${f} (${ae.count})`:f},ne=()=>{if(!m)return"Filtrar por tabela de preço";const ae=C.find(re=>re.id===m);return ae?ae.nome:"Tabela selecionada"};return c.jsxs(c.Fragment,{children:[c.jsxs(Fr,{open:e,onClose:t,maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:2}},children:[c.jsxs(zr,{children:[c.jsx(V,{variant:"h6",fontWeight:600,children:"Filtros"}),c.jsx(V,{variant:"body2",color:"text.secondary",children:"Selecione os filtros para refinar sua busca"})]}),c.jsx(Er,{children:c.jsxs(F,{children:[c.jsx(V,{variant:"subtitle1",fontWeight:600,gutterBottom:!0,sx:{mt:1},children:"Aniversários"}),c.jsx(ei,{sx:{mb:3},children:$be.map(ae=>c.jsxs(yn,{onClick:()=>D(ae.value),selected:l===ae.value,children:[c.jsx(Vt,{children:c.jsx(F,{sx:{color:ae.color==="#C465F8"?"#C465F8":"text.primary"},children:ae.icon})}),c.jsx(St,{primary:ae.label,primaryTypographyProps:{fontWeight:l===ae.value?600:400}}),l===ae.value&&c.jsx(io,{color:"primary"})]},ae.value))}),c.jsx(V,{variant:"subtitle1",fontWeight:600,gutterBottom:!0,children:"Cidade"}),c.jsx(ei,{sx:{mb:3},children:c.jsxs(yn,{onClick:()=>b(!0),children:[c.jsx(St,{primary:q(),primaryTypographyProps:{color:u?"text.primary":"text.secondary",fontWeight:u?600:400}}),c.jsx(n2,{})]})}),c.jsx(V,{variant:"subtitle1",fontWeight:600,gutterBottom:!0,children:"Bairro"}),c.jsx(ei,{sx:{mb:3},children:c.jsxs(yn,{onClick:()=>S(!0),children:[c.jsx(St,{primary:W(),primaryTypographyProps:{color:f?"text.primary":"text.secondary",fontWeight:f?600:400}}),c.jsx(n2,{})]})}),C.length>0&&c.jsxs(c.Fragment,{children:[c.jsx(V,{variant:"subtitle1",fontWeight:600,gutterBottom:!0,children:"Tabela de preço"}),c.jsx(ei,{children:c.jsxs(yn,{onClick:()=>A(!0),children:[c.jsx(St,{primary:ne(),primaryTypographyProps:{color:m?"text.primary":"text.secondary",fontWeight:m?600:400}}),c.jsx(n2,{})]})})]})]})}),c.jsxs(nn,{sx:{p:2,gap:1,flexDirection:O?"row":"column"},children:[O&&c.jsx(De,{onClick:j,color:"inherit",fullWidth:!0,children:"Limpar"}),c.jsx(De,{onClick:$,variant:"contained",fullWidth:!0,children:"Aplicar"})]})]}),c.jsx(Dbe,{open:y,onClose:()=>b(!1),onSelect:M,selectedCity:u,cities:P,isLoading:_}),c.jsx(Mbe,{open:E,onClose:()=>S(!1),onSelect:U,selectedNeighborhood:f,neighborhoods:I,isLoading:_}),c.jsx(Nbe,{open:k,onClose:()=>A(!1),onSelect:g,selectedPriceTableId:m,priceTables:C})]})},Ube="/assets/customers-DbDKp6Zh.png";function Bbe(){return c.jsxs(me,{alignItems:"center",spacing:1.5,sx:{pt:8,pb:4,px:3},children:[c.jsx(F,{component:"img",src:Ube,alt:"",sx:{height:120,mb:1}}),c.jsx(V,{variant:"subtitle1",fontWeight:600,textAlign:"center",children:"Seus clientes aparecerão aqui"}),c.jsx(V,{variant:"body2",color:"text.secondary",textAlign:"center",sx:{maxWidth:280},children:"Cadastre manualmente ou venda pela sua loja. Seus clientes aparecerão aqui automaticamente."})]})}const Vbe=()=>{const e=ao();return jn({mutationFn:async({customer_ids:t})=>{if(!t.length)return{success:!0,count:0};const{data:r,error:n}=await Te.from("cliente").update({deletado_em:new Date().toISOString()}).in("id",t).select("id");if(n)throw new Error(n.message||"Erro ao excluir clientes");return{success:!0,count:(r==null?void 0:r.length)||0}},onSuccess:(t,r)=>{pe(fe.DELETE.CUSTOMER_BULK,{customerIds:r.customer_ids,count:r.customer_ids.length}
483),e.invalidateQueries({queryKey:["customers"]}),e.invalidateQueries({queryKey:["customers-count"]}),e.invalidateQueries({queryKey:["customer"]}),e.invalidateQueries({queryKey:["customerAddresses"]}),e.invalidateQueries({queryKey:["orders"]})}})},Hbe=()=>{const e=ao();return jn({mutationFn:async({customer_ids:t,tabela_preco_id:r})=>{if(!t.length)return;const{error:n}=await Te.from("cliente").update({tabela_preco_id:r}).in("id",t);if(n)throw new Error(n.message)},onSuccess:()=>{e.invalidateQueries({queryKey:["customers"]}),e.invalidateQueries({queryKey:["customer"]}),e.invalidateQueries({queryKey:["price-tables"]}),e.invalidateQueries({queryKey:["price-table"]})}})},zbe=()=>{var yt;const e=At(),[t,r]=ws(),[n,i]=v.useState(null);v.useEffect(()=>{const Me=t.get("success"),it=t.get("count"),tr=t.get("skipped");if(Me==="true"&&it){const lt=parseInt(it,10),Ct=parseInt(tr||"0",10);let Zt=`${lt} ${lt===1?"contato foi importado":"contatos foram importados"} com sucesso!`;Ct>0&&(Zt+=` ${Ct} ${Ct===1?"contato foi ignorado":"contatos foram ignorados"} por terem números de telefone inválidos.`),i(Zt);const pt=new URLSearchParams(t);pt.delete("success"),pt.delete("count"),pt.delete("skipped"),r(pt,{replace:!0})}},[t,r]);const o=t.get("query")||"",s=t.get("birthdayFilter"),[a,l]=v.useState(s||"all"),d=t.get("city"),u=t.get("neighborhood"),h=t.get("priceTable"),f=h?Number(h):null,[p,m]=v.useState(!1),{data:g}=c4(),y=f&&g&&((yt=g.find(Me=>Me.id===f))==null?void 0:yt.nome)||null,{data:b,isLoading:E,isError:S}=Pbe(),{data:k,isLoading:A,isError:w}=kbe(),{data:_}=EL(),{data:x}=_2e(),C=d||u,P=C?b:k,I=C?E:A,O=C?S:w,D=v.useMemo(()=>{if(!P)return[];let Me=P;return o.trim()&&(Me=Me.filter(it=>Ql(o,it.nome)||X_e(o,it.telefone)||J_e(o,it.cpf_cnpj)||it.email&&Ql(o,it.email))),C&&b&&(Me=Me.filter(it=>!it.addresses||it.addresses.length===0?!1:it.addresses.some(tr=>{const lt=!d||tr.localidade===d,Ct=!u||tr.bairro===u;return lt&&Ct}))),f&&(Me=Me.filter(it=>it.tabela_preco_id===f)),Me},[P,o,d,u,f,C,b]),M=(D==null?void 0:D.map(Me=>Me.id))||[],{data:U}=Rbe(M),[$,j]=v.useState([]),[q,W]=v.useState(!1),[ne,ae]=v.useState(null),[re,_e]=v.useState(!1),[be,J]=v.useState(!1),xe=Vbe(),Ze=Hbe(),{data:$e}=an(),{triggerPaywall:Le}=No(),[Fe,ft]=v.useState(!1),{exportToCSV:Ge,isExporting:Se,error:je,setError:Ce}=_be(),Pe=Wx(()=>{Li(),W(!0)},{cancelOnMovement:!0}),Ue=Me=>{ae(Me.currentTarget)},z=Me=>{ae(Me.currentTarget)},Q=()=>{ae(null)},ie=()=>{W(!0),Q()},te=()=>{e("/customers/import"),Q()},he=()=>{if(Q(),!Hn($e)){Le("customers_export",{pageAction:()=>ft(!0),source:q?"customers_page_export_selected":"customers_page_export_csv"});return}const Me=q?$:D.map(it=>it.id);Ge(Me)},ve=()=>{W(!1),j([])},Re=()=>{_e(!0),Q()},He=()=>{J(!0),Q()},dt=async Me=>{await Ze.mutateAsync({customer_ids:$,tabela_preco_id:Me}),J(!1),W(!1),j([])},N=async()=>{await xe.mutateAsync({customer_ids:$}),_e(!1),W(!1),j([])},T=(Me,it,tr,lt)=>{const Ct=new URLSearchParams(t);Me!=="all"?Ct.set("birthdayFilter",Me):Ct.delete("birthdayFilter"),l(Me),it?Ct.set("city",it):Ct.delete("city"),tr?Ct.set("neighborhood",tr):Ct.delete("neighborhood"),lt?Ct.set("priceTable",String(lt)):Ct.delete("priceTable"),r(Ct,{replace:!0})},R=()=>{const Me=new URLSearchParams(t);Me.delete("birthdayFilter"),Me.delete("city"),Me.delete("neighborhood"),Me.delete("priceTable"),r(Me,{replace:!0}),l("all")},B=Me=>{const it=new URLSearchParams(t);Me==="birthday"?(it.delete("birthdayFilter"),l("all")):Me==="city"?(it.delete("city"),it.delete("neighborhood")):Me==="neighborhood"?it.delete("neighborhood"):Me==="priceTable"&&it.delete("priceTable"),r(it,{replace:!0})},le=d||u||f,ce=Me=>{j(it=>it.includes(Me)?it.filter(tr=>tr!==Me):[...it,Me])},Ke=()=>{const it=xt().map(lt=>lt.id),tr=it.length>0&&it.every(lt=>$.includes(lt));j(tr?$.filter(lt=>!it.includes(lt)):[...$.filter(lt=>!it.includes(lt)),...it])},xt=()=>a==="today"?_||[]:a==="upcoming"?x||[]:D||[],vt=()=>{const it=xt().map(lt=>lt.id),tr=it.filter(lt=>$.includes(lt)).length;return tr===0?{checked:!1,indeterminate:!1}:tr===it.length?{checked:!0,indeterminate:!1}:{checked:!1,indeterminate:!0}},Rt=!!(!I&&D&&D.length===0&&!o&&!le);return c.jsxs(F,{sx:{position:"relative",overflow:"auto",height:"100%"}
483,children:[c.jsx(Sc,{title:"Clientes",children:q?c.jsxs(c.Fragment,{children:[c.jsx(mr,{color:"inherit",onClick:ve,children:c.jsx(fM,{})}),c.jsx(mr,{color:"inherit",onClick:z,children:c.jsx(c5,{})})]}):c.jsxs(c.Fragment,{children:[c.jsx(zx,{}),c.jsx(e1,{color:"primary",variant:"dot",invisible:!le&&a==="all",sx:{"& .MuiBadge-badge":{right:6,top:6},ml:1},children:c.jsx(mr,{color:"inherit",onClick:()=>m(!0),children:c.jsx(pM,{})})}),c.jsx(mr,{color:"inherit",onClick:Ue,sx:{ml:1},children:c.jsx(c5,{})})]})}),(a!=="all"||le)&&c.jsx(F,{sx:{px:2,pb:1,pt:2},children:c.jsxs(me,{direction:"row",spacing:1,flexWrap:"wrap",children:[a!=="all"&&c.jsx(Fn,{label:a==="today"?"Aniversário hoje":"Aniversário próximo",onDelete:()=>B("birthday"),variant:"filled",sx:{backgroundColor:"#C465F8",color:"white","& .MuiChip-label":{fontWeight:600},"& .MuiChip-deleteIcon":{color:"white"}}}),d&&c.jsx(Fn,{label:d,onDelete:()=>B("city"),variant:"filled",color:"primary",sx:{"& .MuiChip-label":{fontWeight:600}}}),u&&c.jsx(Fn,{label:u,onDelete:()=>B("neighborhood"),variant:"filled",color:"secondary",sx:{"& .MuiChip-label":{fontWeight:600}}}),f&&y&&c.jsx(Fn,{label:y,onDelete:()=>B("priceTable"),variant:"filled",color:"primary",sx:{"& .MuiChip-label":{fontWeight:600}}})]})}),c.jsxs(F,{sx:{padding:2,paddingTop:a!=="all"||le?1:2},children:[n&&c.jsx(_s,{severity:"success",sx:{mb:2},onClose:()=>i(null),children:n}),je&&c.jsx(_s,{severity:"error",sx:{mb:2},onClose:()=>Ce(null),children:je}),I&&c.jsx(me,{spacing:1,sx:{backgroundColor:"background.paper"},children:Array.from({length:10}).map((Me,it)=>c.jsx(Lt,{variant:"rectangular",sx:{borderRadius:1},width:"100%",height:"88px"},it))}),!I&&!O&&c.jsxs(ei,{sx:{backgroundColor:"background.paper"},children:[a==="all"&&D&&D.length>0&&c.jsx(c.Fragment,{children:D.map(Me=>c.jsx(Kv,{id:Me.id,name:Me.nome,phone:Me.telefone,imageUrl:Me.profile_url,onClick:()=>{q?ce(Me.id):e(`${Me.id}`,{state:{returnSearch:t.toString()}})},userId:Me.customer_user_id||"",selected:$.includes(Me.id),selectEnabled:q,longPressEvents:Pe,isBirthdayToday:U?U[Me.id]:!1},Me.id))}),a==="today"&&_&&_.length>0&&c.jsx(c.Fragment,{children:_.map(Me=>c.jsx(Kv,{id:Me.id,name:Me.nome,phone:Me.telefone,imageUrl:Me.profile_url,onClick:()=>{q?ce(Me.id):e(`${Me.id}`,{state:{returnSearch:t.toString()}})},userId:Me.customer_user_id||"",selected:$.includes(Me.id),selectEnabled:q,longPressEvents:Pe,isBirthdayToday:!0},Me.id))}),a==="upcoming"&&x&&x.length>0&&c.jsx(c.Fragment,{children:x.map(Me=>{const it=new Date,tr=it.getFullYear(),lt=new Date(tr,Me.mes_aniversario-1,Me.dia_aniversario);lt<it&<.setFullYear(tr+1);const Ct=1e3*60*60*24,Zt=Math.ceil((lt.getTime()-it.getTime())/Ct);return c.jsx(Kv,{id:Me.id,name:Me.nome,phone:Me.telefone,imageUrl:Me.profile_url,onClick:()=>{q?ce(Me.id):e(`${Me.id}`,{state:{returnSearch:t.toString()}})},userId:Me.customer_user_id||"",selected:$.includes(Me.id),selectEnabled:q,longPressEvents:Pe,isBirthdayToday:!1,birthdayDate:{day:Me.dia_aniversario,month:Me.mes_aniversario},daysUntilBirthday:Zt},Me.id)})})]}),O&&c.jsx(Hl,{primaryText:"Erro ao carregar os clientes"}),!I&&!O&&a==="all"&&D&&D.length===0&&(o||le)&&c.jsx(Hl,{primaryText:"Nenhum cliente encontrado",secondaryText:"Tente remover os filtros ou a palavra-chave de busca"}),!I&&!O&&a==="all"&&D&&D.length===0&&!o&&!le&&c.jsx(Bbe,{}),!I&&!O&&a==="today"&&(!_||_.length===0)&&c.jsx(Hl,{primaryText:"Sem aniversários hoje",secondaryText:"Nenhum cliente faz aniversário hoje"}),!I&&!O&&a==="upcoming"&&(!x||x.length===0)&&c.jsx(Hl,{primaryText:"Sem aniversários próximos",secondaryText:"Não há aniversários nos próximos dias"})]}),c.jsx(k_,{color:"primary",sx:{position:"fixed",right:16,bottom:"calc(var(--safe-area-inset-bottom) + 16px + 56px)"},onClick:()=>e("/customers/new"),children:c.jsx(FC,{})}),c.jsx(l4,{text:"Clique no botão de + para cadastrar um cliente",visible:Rt,fabBottom:"calc(var(--safe-area-inset-bottom) + 16px + 56px)",fabRight:16}),c.jsx(Ba,{anchorEl:ne,open:!!ne,onClose:Q,children:q?c.jsxs(c.Fragment,{children:[c.jsxs(Mt,{onClick:Ke,children:[c.jsx(Vt,{children:c.jsx(pc,{checked:vt().checked,indeterminate:vt().indeterminate,tabIndex:-1,disableRipple:!0,sx:{p:"0px"}})}),c.jsx(St,{children:"Selecionar todos"})]}),c.jsxs(Mt,{onClick:He,disabled:$.length===0,children:[c.jsx(Vt,{children:c.jsx(G1,{size:20})}),c.jsx(St,{children:"Tabela de preço"})]}),c.jsxs(Mt,{onClick:he,disabled:$.length===0||Se,children:[c.jsx(Vt,{children:c.jsx(ym,{})}),c.jsx(St,{children:$.length>0?`Exportar CSV (${$.length})`:"Exportar CSV"})]}),c.jsxs(Mt,{onClick:Re,disabled:$.length===0,children:[c.jsx(Vt,{children:c.jsx(mM,{})}),c.jsx(St,{children:$.length>0?`Excluir (${$.length})`:"Excluir"})]})]}):c.jsxs(c.Fragment,{children:[c.jsxs(Mt,{onClick:te,children:[c.jsx(Vt,{children:c.jsx(BC,{})}),c.jsx(St,{children:"Importar clientes"})]}),c.jsxs(Mt,{onClick:he,disabled:!D||D.length===0||Se,children:[c.jsx(Vt,{children:c.jsx(ym,{})}),c.jsx(St,{children:Se?"Exportando...":"Exportar CSV"})]}),c.jsxs(Mt,{onClick:ie,disabled:!D||D.length===0,children:[c.jsx(Vt,{children:c.jsx(gM,{})}),c.jsx(St,{children:"Selecionar"})]})]})}),c.jsxs(Fr,{open:re,onClose:()=>_e(!1),children:[c.jsx(zr,{children:"Excluir clientes"}),c.jsx(Er,{children:c.jsxs(vi,{children:["Tem certeza que deseja excluir"," ",$.length===1?"este cliente":`estes ${$.length} clientes`,"?"]})}),c.jsxs(nn,{children:[c.jsx(De,{onClick:()=>_e(!1),children:"Cancelar"}),c.jsx(De,{onClick:N,color:"error",disabled:xe.isPending,children:"Excluir"})]})]}),c.jsxs(Fr,{open:be,onClose:()=>J(!1),fullWidth:!0,maxWidth:"xs",children:[c.jsx(zr,{children:"Tabela de preço"}),c.jsx(Er,{sx:{px:1,pb:1},children:c.jsxs(ei,{disablePadding:!0,children:[c.jsx(Mt,{onClick:()=>dt(null),disabled:Ze.isPending,children:c.jsx(St,{children:"Nenhuma (remover tabela)"})}),g==null?void 0:g.map(Me=>c.jsx(Mt,{onClick:()=>dt(Me.id),disabled:Ze.isPending,children:c.jsx(St,{children:Me.nome})},Me.id))]})})]}),c.jsx(Fbe,{open:p,onClose:()=>m(!1),selectedBirthdayFilter:a,selectedCity:d,selectedNeighborhood:u,selectedPriceTableId:f,onApply:T,onClearAll:R}),c.jsx(Ef,{open:Fe,onClose:()=>ft(!1),title:"Exportar clientes",description:"A exportação da lista de clientes em CSV é um recurso do plano PRO. Faça upgrade para baixar sua base no mesmo formato da importação.",planSuggestion:"pro"})]})};var u4={},Wbe=zt;
483Object.defineProperty(u4,"__esModule",{value:!0});var K0=u4.default=void 0,qbe=Wbe(Wt()),Gbe=c;K0=u4.default=(0,qbe.default)((0,Gbe.jsx)("path",{d:"M16 17.01V10h-2v7.01h-3L15 21l4-3.99zM9 3 5 6.99h3V14h2V6.99h3z"}),"SwapVert");var d4={},Kbe=zt;Object.defineProperty(d4,"__esModule",{value:!0});var R$=d4.default=void 0,Ybe=Kbe(Wt()),Zbe=c;R$=d4.default=(0,Ybe.default)((0,Zbe.jsx)("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check");var h4={},Xbe=zt;Object.defineProperty(h4,"__esModule",{value:!0});var I$=h4.default=void 0,Jbe=Xbe(Wt()),Qbe=c;I$=h4.default=(0,Jbe.default)((0,Qbe.jsx)("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff");var f4={},e3e=zt;Object.defineProperty(f4,"__esModule",{value:!0});var P$=f4.default=void 0,t3e=e3e(Wt()),r3e=c;P$=f4.default=(0,t3e.default)((0,r3e.jsx)("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility");const O$="data:image/svg+xml,%3csvg%20width='800'%20height='800'%20viewBox='0%200%20800%20800'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20%3e%3cpath%20d='M800%200H0V800H800V0Z'%20fill='%23F2F2F2'%20/%3e%3cpath%20d='M437.43%20404.005L416.871%20415.903V629.776L602%20522.887V309.014L437.43%20404.005Z'%20fill='%239D9D9D'%20/%3e%3cpath%20d='M470.935%20212.214L399.739%20171L209.47%20280.84L280.761%20322.054L470.935%20212.214Z'%20fill='%239D9D9D'%20/%3e%3cpath%20d='M589.912%20280.84L507.865%20234.106L317.692%20343.946L328.542%20349.562L399.738%20390.68L470.554%20349.847L589.912%20280.84Z'%20fill='%239D9D9D'%20/%3e%3cpath%20d='M303.319%20422.565L269.244%20405.052V350.608L199%20310.156V522.506L382.796%20628.634V416.284L303.319%20370.501V422.565Z'%20fill='%239D9D9D'%20/%3e%3c/svg%3e",n3e="https://static.stoqui.com.br",i3e=["bvwsyolgpsbvflhbqily.supabase.co","spb.stoqui.com.br"],FS="/storage/v1/object/public/",Yv=[200,400,2560];function o3e(e){for(const t of Yv)if(e<=t)return t;return Yv[Yv.length-1]}function j$(e){if(!e||!i3e.some(n=>e.includes(n)))return null;const t=e.indexOf(FS);return t===-1?null:e.substring(t+FS.length).split("?")[0]||null}function YTe(e){return j$(e)!==null}function s3e(e,{width:t=400,height:r=400,resize:n="contain",format:i="webp"}={}){if(!e)return O$;const o=j$(e);if(!o)return e;const s=o3e(Math.max(t,r));return`${n3e}/rs:${n==="cover"?"fill":"fit"}:${s}:${s}/plain/${o}@${i}`}const a3e=e=>({display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical",overflow:"hidden",wordBreak:"break-word"}),l3e=({productName:e,price:t,minPrice:r,maxPrice:n,priceOnRequest:i=!1,isCombo:o=!1,imageUrl:s,attributes:a=[],onClick:l,hidden:d,id:u,deleted:h=!1,disabled:f=!1,selectEnabled:p=!1,selected:m=!1,longPressEvents:g,categoryName:y,originalPrice:b,sortingMode:E=!1,isDragging:S=!1,onMoveToTop:k,onMoveToBottom:A})=>{const[w,_]=v.useState(null),x=!!w,C=v.useCallback(()=>{!f&&!h&&l()},[f,h,l]),P=v.useCallback(q=>{q.stopPropagation(),_(q.currentTarget)},[]),I=v.useCallback(q=>{q&&q.stopPropagation(),_(null)},[]),O=v.useCallback(q=>{q.stopPropagation(),k==null||k(),_(null)},[k]),D=v.useCallback(q=>{q.stopPropagation(),A==null||A(),_(null)},[A]),M=v.useMemo(()=>!b||!r||b<=r?null:Math.round((b-r)/b*100),[b,r]),U=v.useMemo(()=>s?s3e(s,{width:400,height:400}):O$,[s]),$=v.useMemo(()=>a.length>0?a.join(", "):null,[a]),j=v.useMemo(()=>i?c.jsx(V,{sx:{fontSize:"0.875rem",fontWeight:600,color:"text.secondary",whiteSpace:"nowrap"},children:"Sob consulta"}):r!==void 0&&n!==void 0?r===n?c.jsxs(me,{direction:"column",alignItems:"flex-end",textAlign:"right",spacing:.25,children:[c.jsx(q0,{value:r,sx:{fontSize:"1rem",fontWeight:600,color:"text.primary"}}),!!M&&c.jsxs(V,{variant:"caption",sx:{color:"success.main",fontWeight:500,fontSize:"0.75rem"},children:[M,"% OFF"]})]}):c.jsxs(me,{direction:"column",alignItems:"flex-end",textAlign:"right",children:[c.jsxs("span",{style:{display:"inline-flex",alignItems:"center"}
483,children:[c.jsx(q0,{value:r,sx:{display:"inline-flex",fontSize:"0.875rem",fontWeight:600,color:"text.primary"}}),c.jsx(V,{variant:"body1",sx:{display:"inline-flex",fontSize:"0.875rem",lineHeight:"0.75rem",fontWeight:500,color:"text.primary",marginLeft:.5,marginRight:.5},children:" - "}),c.jsx(q0,{value:n,sx:{display:"inline-flex",fontSize:"0.875rem",fontWeight:600,color:"text.primary"}})]}),!!M&&c.jsxs(V,{variant:"caption",sx:{color:"success.main",fontWeight:500,fontSize:"0.75rem"},children:[M,"% OFF"]})]}):c.jsx(V,{variant:"body1",sx:{marginLeft:2,whiteSpace:"nowrap",color:"inherit"},children:t}),[r,n,M,t,i]);return c.jsx($m,{disablePadding:!0,id:`product-${u}`,sx:{opacity:h||f?.5:1,pointerEvents:h||f?"none":"auto",position:"relative"},children:c.jsxs(yn,{onClick:E?void 0:C,...p||E?{}:g==null?void 0:g(),disableRipple:E,sx:{padding:2,display:"flex",justifyContent:"space-between",width:"100%",cursor:E?"grab":"pointer","&:active":{cursor:E&&S?"grabbing":void 0},backgroundColor:S?"action.hover":void 0},children:[p&&c.jsx(pc,{edge:"start",checked:m,tabIndex:-1,disableRipple:!0,onClick:q=>{q.stopPropagation(),l()}}),E&&c.jsx(F,{sx:{display:"flex",alignItems:"center",mr:1,color:"text.secondary"},children:c.jsx(vM,{})}),c.jsx(DC,{sx:{overflow:"hidden",minWidth:m$(Hv)},children:c.jsxs(Dh,{variant:"square",sx:{position:"relative",width:Hv,height:Hv,marginRight:2,backgroundColor:s?"transparent":"none",borderRadius:`${pye}px`,overflow:"hidden"},children:[c.jsx("div",{style:{position:"absolute",backgroundColor:"#00000030",backdropFilter:"blur(4px)",left:0,top:0,width:"100%",height:"100%",display:d&&!h?"flex":"none",alignItems:"center",justifyContent:"center"},children:c.jsx(VC,{})}),c.jsx("div",{style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",display:h?"flex":"none",alignItems:"center",justifyContent:"center"},children:c.jsxs(V,{fontSize:"10px",textAlign:"center",color:"error",fontWeight:"bold",fontStyle:"italic",children:["Produto ",c.jsx("br",{})," Excluido"]})}),!h&&c.jsx("img",{src:U,alt:e,style:{width:"100%",height:"100%",objectFit:"contain",borderRadius:"8px"}})]})}),c.jsx(St,{primary:c.jsxs(me,{spacing:.25,children:[c.jsxs(F,{sx:{display:"flex",alignItems:"center",gap:.75},children:[c.jsx(V,{component:"div",sx:{...Bx,...a3e(fye),minWidth:0},children:e}),o&&c.jsx(fc,{label:"Combo",tint:"brand"})]}),!E&&$&&c.jsx(V,{variant:"caption",color:"text.secondary",textOverflow:"ellipsis",noWrap:!0,overflow:"hidden",children:$}),c.jsxs(F,{sx:{display:"flex",alignItems:"flex-end",justifyContent:"space-between",gap:1.5},children:[c.jsx(V,{variant:"caption",sx:{color:"text.secondary",opacity:y?1:.75,fontStyle:y?"normal":"italic",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:y||"Sem categoria"}),c.jsx(F,{sx:{display:"flex",alignItems:"center",gap:.5,flexShrink:0},children:E&&k&&A?c.jsxs(c.Fragment,{children:[j,c.jsx(mr,{size:"medium",onClick:P,sx:{p:1,ml:1},children:c.jsx(c5,{})}),c.jsxs(Ba,{anchorEl:w,open:x,onClose:()=>I(),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[c.jsxs(Mt,{onClick:O,children:[c.jsx(Vt,{children:c.jsx(yM,{fontSize:"small"})}),c.jsx(St,{children:"Mover para o topo"})]}),c.jsxs(Mt,{onClick:D,children:[c.jsx(Vt,{children:c.jsx(_M,{fontSize:"small"})}),c.jsx(St,{children:"Mover para o final"})]})]})]}):j})]})]}),primaryTypographyProps:{component:"div"}})]})})},c3e=(e,t)=>e.id===t.id&&e.productName===t.productName&&e.price===t.price&&e.minPrice===t.minPrice&&e.maxPrice===t.maxPrice&&e.priceOnRequest===t.priceOnRequest&&e.isCombo===t.isCombo&&e.imageUrl===t.imageUrl&&e.hidden===t.hidden&&e.selected===t.selected&&e.selectEnabled===t.selectEnabled&&e.sortingMode===t.sortingMode&&e.isDragging===t.isDragging&&e.categoryName===t.categoryName&&e.originalPrice===t.originalPrice&&e.attributes===t.attributes,p4=Ee.memo(l3e,c3e);p4.displayName="ProductListItem";function u3e(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return v.useMemo(()=>n=>{t.forEach(i=>i(n))},t)}const Kg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function _d(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function m4(e){return"nodeType"in e}function ci(e){var t,r;return e?_d(e)?e:m4(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function g4(e){const{Document:t}=ci(e);return e instanceof t}function dp(e){return _d(e)?!1:e instanceof ci(e).HTMLElement}function L$(e){return e instanceof ci(e).SVGElement}function bd(e){return e?_d(e)?e.document:m4(e)?g4(e)?e:dp(e)||L$(e)?e.ownerDocument:document:document:document}const jo=Kg?v.useLayoutEffect:v.useEffect;function Yg(e){const t=v.useRef(e);return jo(()=>{t.current=e}),v.useCallback(function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.current==null?void 0:t.current(...n)},[])}function d3e(){const e=v.useRef(null),t=v.useCallback((n,i)=>{e.current=setInterval(n,i)},[]),r=v.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function Sf(e,t){t===void 0&&(t=[e]);const r=v.useRef(e);return jo(()=>{r.current!==e&&(r.current=e)},t),r}function hp(e,t){const r=v.useRef();return v.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function _m(e){const t=Yg(e),r=v.useRef(null),n=v.useCallback(i=>{i!==r.current&&(t==null||t(i,r.current)),r.current=i},[]);return[r,n]}function bm(e){const t=v.useRef();return v.useEffect(()=>{t.current=e},[e]),t.current}let Zv={};function fp(e,t){return v.useMemo(()=>
483{if(t)return t;const r=Zv[e]==null?0:Zv[e]+1;return Zv[e]=r,e+"-"+r},[e,t])}function $$(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return n.reduce((o,s)=>{const a=Object.entries(s);for(const[l,d]of a){const u=o[l];u!=null&&(o[l]=u+e*d)}return o},{...t})}}const Su=$$(1),Cf=$$(-1);function h3e(e){return"clientX"in e&&"clientY"in e}function Zg(e){if(!e)return!1;const{KeyboardEvent:t}=ci(e.target);return t&&e instanceof t}function f3e(e){if(!e)return!1;const{TouchEvent:t}=ci(e.target);return t&&e instanceof t}function xm(e){if(f3e(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return h3e(e)?{x:e.clientX,y:e.clientY}:null}const el=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[el.Translate.toString(e),el.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),US="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function p3e(e){return e.matches(US)?e:e.querySelector(US)}const m3e={display:"none"};function g3e(e){let{id:t,value:r}=e;return Ee.createElement("div",{id:t,style:m3e},r)}function v3e(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Ee.createElement("div",{id:t,style:i,role:"status","aria-live":n,"aria-atomic":!0},r)}function y3e(){const[e,t]=v.useState("");return{announce:v.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const D$=v.createContext(null);function _3e(e){const t=v.useContext(D$);v.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function b3e(){const[e]=v.useState(()=>new Set),t=v.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[v.useCallback(n=>{let{type:i,event:o}=n;e.forEach(s=>{var a;return(a=s[i])==null?void 0:a.call(s,o)})},[e]),t]}const x3e={draggable:` 484 To pick up a draggable item, press the space bar. 485 While dragging, use the arrow keys to move the item. 486 Press space again to drop the item in its new position, or press escape to cancel. 487 `},w3e={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function E3e(e){let{announcements:t=w3e,container:r,hiddenTextDescribedById:n,screenReaderInstructions:i=x3e}=e;const{announce:o,announcement:s}=y3e(),a=fp("DndLiveRegion"),[l,d]=v.useState(!1);if(v.useEffect(()=>{d(!0)},[]),_3e(v.useMemo(()=>({onDragStart(h){let{active:f}=h;o(t.onDragStart({active:f}))},onDragMove(h){let{active:f,over:p}=h;t.onDragMove&&o(t.onDragMove({active:f,over:p}))},onDragOver(h){let{active:f,over:p}=h;o(t.onDragOver({active:f,over:p}))},onDragEnd(h){let{active:f,over:p}=h;o(t.onDragEnd({active:f,over:p}))},onDragCancel(h){let{active:f,over:p}=h;o(t.onDragCancel({active:f,over:p}))}}),[o,t])),!l)return null;const u=Ee.createElement(Ee.Fragment,null,Ee.createElement(g3e,{id:n,value:i.draggable}),Ee.createElement(v3e,{id:a,announcement:s}));return r?Ns.createPortal(u,r):u}var hn;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(hn||(hn={}));function wm(){}function BS(e,t){return v.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function S3e(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return v.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const Lo=Object.freeze({x:0,y:0});function M$(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function C3e(e,t){const r=xm(e);if(!r)return"0 0";const n={x:(r.x-t.left)/t.width*100,y:(r.y-t.top)/t.height*100};return n.x+"% "+n.y+"%"}function N$(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function T3e(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function VS(e){let{left:t,top:r,height:n,width:i}=e;return[{x:t,y:r},{x:t+i,y:r},{x:t,y:r+n},{x:t+i,y:r+n}]}function F$(e,t){if(!e||e.length===0)return null;const[r]=e;return t?r[t]:r}function HS(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const A3e=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=HS(t,t.left,t.top),o=[];for(const s of n){const{id:a}=s,l=r.get(a);if(l){const d=M$(HS(l),i);o.push({id:a,data:{droppableContainer:s,value:d}})}}return o.sort(N$)},k3e=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=VS(t),o=[];for(const s of n){const{id:a}=s,l=r.get(a);if(l){const d=VS(l),u=i.reduce((f,p,m)=>f+M$(d[m],p),0),h=Number((u/4).toFixed(4));o.push({id:a,data:{droppableContainer:s,value:h}})}}return o.sort(N$)};function R3e(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),s=i-n,a=o-r;if(n<i&&r<o){const l=t.width*t.height,d=e.width*e.height,u=s*a,h=u/(l+d-u);return Number(h.toFixed(4))}return 0}const I3e=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=[];for(const o of n){const{id:s}=o,a=r.get(s);if(a){const l=R3e(a,t);l>0&&i.push({id:s,data:{droppableContainer:o,value:l}})}}return i.sort(T3e)};function P3e(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function U$(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Lo}function O3e(e){return function(r){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return i.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...r})}}const j3e=O3e(1);function B$(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function L3e(e,t,r){const n=B$(t);if(!n)return e;const{scaleX:i,scaleY:o,x:s,y:a}=n,l=e.left-s-(1-i)*parseFloat(r),d=e.top-a-(1-o)*parseFloat(r.slice(r.indexOf(" ")+1)),u=i?e.width/i:e.width,h=o?e.height/o:e.he
487ight;return{width:u,height:h,top:d,right:l+u,bottom:d+h,left:l}}const $3e={ignoreTransform:!1};function xd(e,t){t===void 0&&(t=$3e);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:u}=ci(e).getComputedStyle(e);d&&(r=L3e(r,d,u))}const{top:n,left:i,width:o,height:s,bottom:a,right:l}=r;return{top:n,left:i,width:o,height:s,bottom:a,right:l}}function zS(e){return xd(e,{ignoreTransform:!0})}function D3e(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function M3e(e,t){return t===void 0&&(t=ci(e).getComputedStyle(e)),t.position==="fixed"}function N3e(e,t){t===void 0&&(t=ci(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const o=t[i];return typeof o=="string"?r.test(o):!1})}function Xg(e,t){const r=[];function n(i){if(t!=null&&r.length>=t||!i)return r;if(g4(i)&&i.scrollingElement!=null&&!r.includes(i.scrollingElement))return r.push(i.scrollingElement),r;if(!dp(i)||L$(i)||r.includes(i))return r;const o=ci(e).getComputedStyle(i);return i!==e&&N3e(i,o)&&r.push(i),M3e(i,o)?r:n(i.parentNode)}return e?n(e):r}function V$(e){const[t]=Xg(e,1);return t??null}function Xv(e){return!Kg||!e?null:_d(e)?e:m4(e)?g4(e)||e===bd(e).scrollingElement?window:dp(e)?e:null:null}function H$(e){return _d(e)?e.scrollX:e.scrollLeft}function z$(e){return _d(e)?e.scrollY:e.scrollTop}function b_(e){return{x:H$(e),y:z$(e)}}var vn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(vn||(vn={}));function W$(e){return!Kg||!e?!1:e===document.scrollingElement}function q$(e){const t={x:0,y:0},r=W$(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},i=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,s=e.scrollTop>=n.y,a=e.scrollLeft>=n.x;return{isTop:i,isLeft:o,isBottom:s,isRight:a,maxScroll:n,minScroll:t}}const F3e={x:.2,y:.2};function U3e(e,t,r,n,i){let{top:o,left:s,right:a,bottom:l}=r;n===void 0&&(n=10),i===void 0&&(i=F3e);const{isTop:d,isBottom:u,isLeft:h,isRight:f}=q$(e),p={x:0,y:0},m={x:0,y:0},g={height:t.height*i.y,width:t.width*i.x};return!d&&o<=t.top+g.height?(p.y=vn.Backward,m.y=n*Math.abs((t.top+g.height-o)/g.height)):!u&&l>=t.bottom-g.height&&(p.y=vn.Forward,m.y=n*Math.abs((t.bottom-g.height-l)/g.height)),!f&&a>=t.right-g.width?(p.x=vn.Forward,m.x=n*Math.abs((t.right-g.width-a)/g.width)):!h&&s<=t.left+g.width&&(p.x=vn.Backward,m.x=n*Math.abs((t.left+g.width-s)/g.width)),{direction:p,speed:m}}function B3e(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:s}=window;return{top:0,left:0,right:o,bottom:s,width:o,height:s}}const{top:t,left:r,right:n,bottom:i}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:i,width:e.clientWidth,height:e.clientHeight}}function G$(e){return e.reduce((t,r)=>Su(t,b_(r)),Lo)}function V3e(e){return e.reduce((t,r)=>t+H$(r),0)}function H3e(e){return e.reduce((t,r)=>t+z$(r),0)}function K$(e,t){if(t===void 0&&(t=xd),!e)return;const{top:r,left:n,bottom:i,right:o}=t(e);V$(e)&&(i<=0||o<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const z3e=[["x",["left","right"],V3e],["y",["top","bottom"],H3e]];class v4{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=Xg(r),i=G$(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,s,a]of z3e)for(const l of s)Object.defineProperty(this,l,{get:()=>{const d=a(n),u=i[o]-d;return this.rect[l]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ph{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var i;(i=this.target)==null||i.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function W3e(e){const{EventTarget:t}=ci(e);return e instanceof t?e:bd(e)}function Jv(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var Xi;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Xi||(Xi={}));function WS(e){e.preventDefault()}function q3e(e){e.stopPropagation()}var Kt;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Kt||(Kt={}));const Y$={start:[Kt.Space,Kt.Enter],cancel:[Kt.Esc],end:[Kt.Space,Kt.Enter,Kt.Tab]},G3e=(e,t)=>
487{let{currentCoordinates:r}=t;switch(e.code){case Kt.Right:return{...r,x:r.x+25};case Kt.Left:return{...r,x:r.x-25};case Kt.Down:return{...r,y:r.y+25};case Kt.Up:return{...r,y:r.y-25}}};class Z${constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new Ph(bd(r)),this.windowListeners=new Ph(ci(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Xi.Resize,this.handleCancel),this.windowListeners.add(Xi.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Xi.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&K$(n),r(Lo)}handleKeyDown(t){if(Zg(t)){const{active:r,context:n,options:i}=this.props,{keyboardCodes:o=Y$,coordinateGetter:s=G3e,scrollBehavior:a="smooth"}=i,{code:l}=t;if(o.end.includes(l)){this.handleEnd(t);return}if(o.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:d}=n.current,u=d?{x:d.left,y:d.top}:Lo;this.referenceCoordinates||(this.referenceCoordinates=u);const h=s(t,{active:r,context:n.current,currentCoordinates:u});if(h){const f=Cf(h,u),p={x:0,y:0},{scrollableAncestors:m}=n.current;for(const g of m){const y=t.code,{isTop:b,isRight:E,isLeft:S,isBottom:k,maxScroll:A,minScroll:w}=q$(g),_=B3e(g),x={x:Math.min(y===Kt.Right?_.right-_.width/2:_.right,Math.max(y===Kt.Right?_.left:_.left+_.width/2,h.x)),y:Math.min(y===Kt.Down?_.bottom-_.height/2:_.bottom,Math.max(y===Kt.Down?_.top:_.top+_.height/2,h.y))},C=y===Kt.Right&&!E||y===Kt.Left&&!S,P=y===Kt.Down&&!k||y===Kt.Up&&!b;if(C&&x.x!==h.x){const I=g.scrollLeft+f.x,O=y===Kt.Right&&I<=A.x||y===Kt.Left&&I>=w.x;if(O&&!f.y){g.scrollTo({left:I,behavior:a});return}O?p.x=g.scrollLeft-I:p.x=y===Kt.Right?g.scrollLeft-A.x:g.scrollLeft-w.x,p.x&&g.scrollBy({left:-p.x,behavior:a});break}else if(P&&x.y!==h.y){const I=g.scrollTop+f.y,O=y===Kt.Down&&I<=A.y||y===Kt.Up&&I>=w.y;if(O&&!f.x){g.scrollTo({top:I,behavior:a});return}O?p.y=g.scrollTop-I:p.y=y===Kt.Down?g.scrollTop-A.y:g.scrollTop-w.y,p.y&&g.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(t,Su(Cf(h,this.referenceCoordinates),p))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Z$.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=Y$,onActivation:i}=t,{active:o}=r;const{code:s}=e.nativeEvent;if(n.start.includes(s)){const a=o.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function qS(e){return!!(e&&"distance"in e)}function GS(e){return!!(e&&"delay"in e)}class y4{constructor(t,r,n){var i;n===void 0&&(n=W3e(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:o}=t,{target:s}=o;this.props=t,this.events=r,this.document=bd(s),this.documentListeners=new Ph(this.document),this.listeners=new Ph(n),this.windowListeners=new Ph(ci(s)),this.initialCoordinates=(i=xm(o))!=null?i:Lo,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Xi.Resize,this.handleCancel),this.windowListeners.add(Xi.DragStart,WS),this.windowListeners.add(Xi.VisibilityChange,this.handleCancel),this.windowListeners.add(Xi.ContextMenu,WS),this.documentListeners.add(Xi.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(GS(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(qS(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:i}=this.props;i(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(Xi.Click,q3e,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Xi.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:i,props:o}=this,{onMove:s,options:{activationConstraint:a}}=o;if(!i)return;const l=(r=xm(t))!=null?r:Lo,d=Cf(i,l);if(!n&&a){if(qS(a)){if(a.tolerance!=null&&Jv(d,a.tolerance))return this.handleCancel();if(Jv(d,a.distance))return this.handleStart()}if(GS(a)&&Jv(d,a.tolerance))return this.handleCancel();this.handlePending(a,d);return}t.cancelable&&t.preventDefault(),s(l)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===Kt.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const K3e={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class X$ extends y4{constructor(t){const{event:r}=t,n=bd(r.target);super(t,K3e,n)}}X$.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const Y3e={move:{name:"mousemove"},end:{name:"mouseup"}};var x_;(function(e){e[e.RightClick=2]="RightClick"})(x_||(x_={}));class J$ extends y4{constructor(t){super(t,Y3e,bd(t.event.target))}}J$.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===x_.RightClick?!1:(n==null||n({event:r}),!0)}}];const Qv={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Q$ extends y4{constructor(t){super(t,Qv)}static setup(){return window.addEventListener(Qv.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Qv.move.name,t)};function t(){}}}Q$.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:i}=r;return i.length>1?!1:(n==null||n({event:r}),!0)}}];var Oh;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Oh||(Oh={}));var Em;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="Rever
487sedTreeOrder"})(Em||(Em={}));function Z3e(e){let{acceleration:t,activator:r=Oh.Pointer,canScroll:n,draggingRect:i,enabled:o,interval:s=5,order:a=Em.TreeOrder,pointerCoordinates:l,scrollableAncestors:d,scrollableAncestorRects:u,delta:h,threshold:f}=e;const p=J3e({delta:h,disabled:!o}),[m,g]=d3e(),y=v.useRef({x:0,y:0}),b=v.useRef({x:0,y:0}),E=v.useMemo(()=>{switch(r){case Oh.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Oh.DraggableRect:return i}},[r,i,l]),S=v.useRef(null),k=v.useCallback(()=>{const w=S.current;if(!w)return;const _=y.current.x*b.current.x,x=y.current.y*b.current.y;w.scrollBy(_,x)},[]),A=v.useMemo(()=>a===Em.TreeOrder?[...d].reverse():d,[a,d]);v.useEffect(()=>{if(!o||!d.length||!E){g();return}for(const w of A){if((n==null?void 0:n(w))===!1)continue;const _=d.indexOf(w),x=u[_];if(!x)continue;const{direction:C,speed:P}=U3e(w,x,E,t,f);for(const I of["x","y"])p[I][C[I]]||(P[I]=0,C[I]=0);if(P.x>0||P.y>0){g(),S.current=w,m(k,s),y.current=P,b.current=C;return}}y.current={x:0,y:0},b.current={x:0,y:0},g()},[t,k,n,g,o,s,JSON.stringify(E),JSON.stringify(p),m,d,A,u,JSON.stringify(f)])}const X3e={x:{[vn.Backward]:!1,[vn.Forward]:!1},y:{[vn.Backward]:!1,[vn.Forward]:!1}};function J3e(e){let{delta:t,disabled:r}=e;const n=bm(t);return hp(i=>{if(r||!n||!i)return X3e;const o={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[vn.Backward]:i.x[vn.Backward]||o.x===-1,[vn.Forward]:i.x[vn.Forward]||o.x===1},y:{[vn.Backward]:i.y[vn.Backward]||o.y===-1,[vn.Forward]:i.y[vn.Forward]||o.y===1}}},[r,t,n])}function Q3e(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return hp(i=>{var o;return t==null?null:(o=n??i)!=null?o:null},[n,t])}function exe(e,t){return v.useMemo(()=>e.reduce((r,n)=>{const{sensor:i}=n,o=i.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,n)}));return[...r,...o]},[]),[e,t])}var Tf;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Tf||(Tf={}));var w_;(function(e){e.Optimized="optimized"})(w_||(w_={}));const KS=new Map;function txe(e,t){let{dragging:r,dependencies:n,config:i}=t;const[o,s]=v.useState(null),{frequency:a,measure:l,strategy:d}=i,u=v.useRef(e),h=y(),f=Sf(h),p=v.useCallback(function(b){b===void 0&&(b=[]),!f.current&&s(E=>E===null?b:E.concat(b.filter(S=>!E.includes(S))))},[f]),m=v.useRef(null),g=hp(b=>{if(h&&!r)return KS;if(!b||b===KS||u.current!==e||o!=null){const E=new Map;for(let S of e){if(!S)continue;if(o&&o.length>0&&!o.includes(S.id)&&S.rect.current){E.set(S.id,S.rect.current);continue}const k=S.node.current,A=k?new v4(l(k),k):null;S.rect.current=A,A&&E.set(S.id,A)}return E}return b},[e,o,r,h,l]);return v.useEffect(()=>{u.current=e},[e]),v.useEffect(()=>{h||p()},[r,h]),v.useEffect(()=>{o&&o.length>0&&s(null)},[JSON.stringify(o)]),v.useEffect(()=>{h||typeof a!="number"||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},a))},[a,h,p,...n]),{droppableRects:g,measureDroppableContainers:p,measuringScheduled:o!=null};function y(){switch(d){case Tf.Always:return!1;case Tf.BeforeDragging:return r;default:return!r}}}function _4(e,t){return hp(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function rxe(e,t){return _4(e,t)}function nxe(e){let{callback:t,disabled:r}=e;const n=Yg(t),i=v.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(n)},[n,r]);return v.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Jg(e){let{callback:t,disabled:r}=e;const n=Yg(t),i=v.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(n)},[r]);return v.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function ixe(e){return new v4(xd(e),e)}function YS(e,t,r){t===void 0&&(t=ixe);const[n,i]=v.useState(null);function o(){i(l=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=l??r)!=null?d:null}const u=t(e);return JSON.stringify(l)===JSON.stringify(u)?l:u})}const s=nxe({callback(l){if(e)for(const d of l){const{type:u,target:h}=d;if(u==="childList"&&h instanceof HTMLElement&&h.contains(e)){o();break}}}}),a=Jg({callback:o});return jo(()=>{o(),e?(a==null||a.observe(e),s==null||s.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),s==null||s.disconnect())},[e]),n}function oxe(e){const t=_4(e);return U$(e,t)}const ZS=[];function sxe(e){const t=v.useRef(e),r=hp(n=>e?n&&n!==ZS&&e&&t.current&&e.parentNode===t.current.parentNode?n:Xg(e):ZS,[e]);return v.useEffect(()=>{t.current=e},[e]),r}function axe(e){const[t,r]=v.useState(null),n=v.useRef(e),i=v.useCallback(o=>{const s=Xv(o.target);s&&r(a=>a?(a.set(s,b_(s)),new Map(a)):null)},[]);return v.useEffect(()=>{const o=n.current;if(e!==o){s(o);const a=e.map(l=>{const d=Xv(l);return d?(d.addEventListener("scroll",i,{passive:!0}),[d,b_(d)]):null}).filter(l=>l!=null);r(a.length?new Map(a):null),n.current=e}return()=>{s(e),s(o)};function s(a){a.forEach(l=>{const d=Xv(l);d==null||d.removeEventListener("scroll",i)})}},[i,e]),v.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,s)=>Su(o,s),Lo):G$(e):Lo,[e,t])}function XS(e,t){t===void 0&&(t=[]);const r=v.useRef(null);return v.useEffect(()=>{r.current=null},t),v.useEffect(()=>{const n=e!==Lo;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?Cf(e,r.current):Lo}function lxe(e){v.useEffect(()=>{if(!Kg)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function cxe(e,t){return v.useMemo(()=>e.reduce((r,n)=>{let{eventName:i,handler:o}=n;return r[i]=s=>{o(s,t)},r},{}),[e,t])}function eD(e){return v.useMemo(()=>e?D3e(e):null,[e])}const JS=[];function uxe(e,t){t===void 0&&(t=xd);const[r]=e,n=eD(r?ci(r):null),[i,o]=v.useState(JS);function s(){o(()=>e.length?e.map(l=>W$(l)?n:new v4(t(l),l)):JS)}const a=Jg({callback:s});return jo(()=>{a==null||a.disconnect(),s(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),i}function tD(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return dp(t)?t:e}function dxe(e){let{measure:t}=e;const[r,n]=v.useState(null),i=v.useCallback(d=>{for(const{target:u}of d)if(dp(u)){n(h=>{const f=t(u);return h?{...h,width:f.width,height:f.height}:f});break}},[t]),o=Jg({callback:i}),s=v.useCallback(d=>{const u=tD(d);o==null||o.disconnect(),u&&(o==null||o.observe(u)),n(u?t(u):null)}
487,[t,o]),[a,l]=_m(s);return v.useMemo(()=>({nodeRef:a,rect:r,setRef:l}),[r,a,l])}const hxe=[{sensor:X$,options:{}},{sensor:Z$,options:{}}],fxe={current:{}},Y0={draggable:{measure:zS},droppable:{measure:zS,strategy:Tf.WhileDragging,frequency:w_.Optimized},dragOverlay:{measure:xd}};class jh extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const pxe={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new jh,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:wm},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Y0,measureDroppableContainers:wm,windowRect:null,measuringScheduled:!1},rD={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:wm,draggableNodes:new Map,over:null,measureDroppableContainers:wm},pp=v.createContext(rD),nD=v.createContext(pxe);function mxe(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new jh}}}function gxe(e,t){switch(t.type){case hn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case hn.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case hn.DragEnd:case hn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case hn.RegisterDroppable:{const{element:r}=t,{id:n}=r,i=new jh(e.droppable.containers);return i.set(n,r),{...e,droppable:{...e.droppable,containers:i}}}case hn.SetDroppableDisabled:{const{id:r,key:n,disabled:i}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const s=new jh(e.droppable.containers);return s.set(r,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:s}}}case hn.UnregisterDroppable:{const{id:r,key:n}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const o=new jh(e.droppable.containers);return o.delete(r),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function vxe(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:i}=v.useContext(pp),o=bm(n),s=bm(r==null?void 0:r.id);return v.useEffect(()=>{if(!t&&!n&&o&&s!=null){if(!Zg(o)||document.activeElement===o.target)return;const a=i.get(s);if(!a)return;const{activatorNode:l,node:d}=a;if(!l.current&&!d.current)return;requestAnimationFrame(()=>{for(const u of[l.current,d.current]){if(!u)continue;const h=p3e(u);if(h){h.focus();break}}})}},[n,t,i,s,o]),null}function iD(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((i,o)=>o({transform:i,...n}),r):r}function yxe(e){return v.useMemo(()=>({draggable:{...Y0.draggable,...e==null?void 0:e.draggable},droppable:{...Y0.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Y0.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function _xe(e){let{activeNode:t,measure:r,initialRect:n,config:i=!0}=e;const o=v.useRef(!1),{x:s,y:a}=typeof i=="boolean"?{x:i,y:i}:i;jo(()=>{if(!s&&!a||!t){o.current=!1;return}if(o.current||!n)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const u=r(d),h=U$(u,n);if(s||(h.x=0),a||(h.y=0),o.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const f=V$(d);f&&f.scrollBy({top:h.y,left:h.x})}},[t,s,a,n,r])}const Qg=v.createContext({...Lo,scaleX:1,scaleY:1});var Ra;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ra||(Ra={}));
487const bxe=v.memo(function(t){var r,n,i,o;let{id:s,accessibility:a,autoScroll:l=!0,children:d,sensors:u=hxe,collisionDetection:h=I3e,measuring:f,modifiers:p,...m}=t;const g=v.useReducer(gxe,void 0,mxe),[y,b]=g,[E,S]=b3e(),[k,A]=v.useState(Ra.Uninitialized),w=k===Ra.Initialized,{draggable:{active:_,nodes:x,translate:C},droppable:{containers:P}}=y,I=_!=null?x.get(_):null,O=v.useRef({initial:null,translated:null}),D=v.useMemo(()=>{var lt;return _!=null?{id:_,data:(lt=I==null?void 0:I.data)!=null?lt:fxe,rect:O}:null},[_,I]),M=v.useRef(null),[U,$]=v.useState(null),[j,q]=v.useState(null),W=Sf(m,Object.values(m)),ne=fp("DndDescribedBy",s),ae=v.useMemo(()=>P.getEnabled(),[P]),re=yxe(f),{droppableRects:_e,measureDroppableContainers:be,measuringScheduled:J}=txe(ae,{dragging:w,dependencies:[C.x,C.y],config:re.droppable}),xe=Q3e(x,_),Ze=v.useMemo(()=>j?xm(j):null,[j]),$e=tr(),Le=rxe(xe,re.draggable.measure);_xe({activeNode:_!=null?x.get(_):null,config:$e.layoutShiftCompensation,initialRect:Le,measure:re.draggable.measure});const Fe=YS(xe,re.draggable.measure,Le),ft=YS(xe?xe.parentElement:null),Ge=v.useRef({activatorEvent:null,active:null,activeNode:xe,collisionRect:null,collisions:null,droppableRects:_e,draggableNodes:x,draggingNode:null,draggingNodeRect:null,droppableContainers:P,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Se=P.getNodeFor((r=Ge.current.over)==null?void 0:r.id),je=dxe({measure:re.dragOverlay.measure}),Ce=(n=je.nodeRef.current)!=null?n:xe,Pe=w?(i=je.rect)!=null?i:Fe:null,Ue=!!(je.nodeRef.current&&je.rect),z=oxe(Ue?null:Fe),Q=eD(Ce?ci(Ce):null),ie=sxe(w?Se??xe:null),te=uxe(ie),he=iD(p,{transform:{x:C.x-z.x,y:C.y-z.y,scaleX:1,scaleY:1},activatorEvent:j,active:D,activeNodeRect:Fe,containerNodeRect:ft,draggingNodeRect:Pe,over:Ge.current.over,overlayNodeRect:je.rect,scrollableAncestors:ie,scrollableAncestorRects:te,windowRect:Q}),ve=Ze?Su(Ze,C):null,Re=axe(ie),He=XS(Re),dt=XS(Re,[Fe]),N=Su(he,He),T=Pe?j3e(Pe,he):null,R=D&&T?h({active:D,collisionRect:T,droppableRects:_e,droppableContainers:ae,pointerCoordinates:ve}):null,B=F$(R,"id"),[G,le]=v.useState(null),ce=Ue?he:Su(he,dt),Ke=P3e(ce,(o=G==null?void 0:G.rect)!=null?o:null,Fe),xt=v.useRef(null),vt=v.useCallback((lt,Ct)=>{let{sensor:Zt,options:pt}=Ct;if(M.current==null)return;const ur=x.get(M.current);if(!ur)return;const Ut=lt.nativeEvent,lr=new Zt({active:M.current,activeNode:ur,event:Ut,options:pt,context:Ge,onAbort(yr){if(!x.get(yr))return;const{onDragAbort:se}=W.current,de={id:yr};se==null||se(de),E({type:"onDragAbort",event:de})},onPending(yr,Z,se,de){if(!x.get(yr))return;const{onDragPending:Ve}=W.current,Je={id:yr,constraint:Z,initialCoordinates:se,offset:de};Ve==null||Ve(Je),E({type:"onDragPending",event:Je})},onStart(yr){const Z=M.current;if(Z==null)return;const se=x.get(Z);if(!se)return;const{onDragStart:de}=W.current,Ae={activatorEvent:Ut,active:{id:Z,data:se.data,rect:O}};Ns.unstable_batchedUpdates(()=>{de==null||de(Ae),A(Ra.Initializing),b({type:hn.DragStart,initialCoordinates:yr,active:Z}),E({type:"onDragStart",event:Ae}),$(xt.current),q(Ut)})},onMove(yr){b({type:hn.DragMove,coordinates:yr})},onEnd:Ln(hn.DragEnd),onCancel:Ln(hn.DragCancel)});xt.current=lr;function Ln(yr){return async function(){const{active:se,collisions:de,over:Ae,scrollAdjustedTranslate:Ve}=Ge.current;let Je=null;if(se&&Ve){const{cancelDrop:at}=W.current;Je={activatorEvent:Ut,active:se,collisions:de,delta:Ve,over:Ae},yr===hn.DragEnd&&typeof at=="function"&&await Promise.resolve(at(Je))&&(yr=hn.DragCancel)}M.current=null,Ns.unstable_batchedUpdates(()=>{b({type:yr}),A(Ra.Uninitialized),le(null),$(null),q(null),xt.current=null;const at=yr===hn.DragEnd?"onDragEnd":"onDragCancel";if(Je){const Qe=W.current[at];Qe==null||Qe(Je),E({type:at,event:Je})}})}}},[x]),Rt=v.useCallback((lt,Ct)=>(Zt,pt)=>{const ur=Zt.nativeEvent,Ut=x.get(pt);if(M.current!==null||!Ut||ur.dndKit||ur.defaultPrevented)return;const lr={active:Ut};lt(Zt,Ct.options,lr)===!0&&(ur.dndKit={capturedBy:Ct.sensor},M.current=pt,vt(Zt,Ct))},[x,vt]),yt=exe(u,Rt);lxe(u),jo(()=>{Fe&&k===Ra.Initializing&&A(Ra.Initialized)},[Fe,k]),v.useEffect(()=>{const{onDragMove:lt}=W.current,{active:Ct,activatorEvent:Zt,collisions:pt,over:ur}=Ge.current;if(!Ct||!Zt)return;const Ut={active:Ct,activatorEvent:Zt,collisions:pt,delta:{x:N.x,y:N.y},over:ur};Ns.unstable_batchedUpdates(()=>{lt==null||lt(Ut),E({type:"onDragMove",event:Ut})})},[N.x,N.y]),v.useEffect(()=>{const{active:lt,activatorEvent:Ct,collisions:Zt,droppableContainers:pt,scrollAdjustedTranslate:ur}=Ge.current;if(!lt||M.current==null||!Ct||!ur)return;const{onDragOver:Ut}=W.current,lr=pt.get(B),Ln=lr&&lr.rect.current?{id:lr.id,rect:lr.rect.current,data:lr.data,disabled:lr.disabled}:null,yr={active:lt,activatorEvent:Ct,collisions:Zt,delta:{x:ur.x,y:ur.y},over:Ln};Ns.unstable_batchedUpdates(()=>{le(Ln),Ut==null||Ut(yr),E({type:"onDragOver",event:yr})})},[B]),jo(()=>{Ge.current={activatorEvent:j,active:D,activeNode:xe,collisionRect:T,collisions:R,droppableRects:_e,draggableNodes:x,draggingNode:Ce,draggingNodeRect:Pe,droppableContainers:P,over:G,scrollableAncestors:ie,scrollAdjustedTranslate:N},O.current={initial:Pe,translated:T}}
487,[D,xe,R,T,x,Ce,Pe,_e,P,G,ie,N]),Z3e({...$e,delta:C,draggingRect:T,pointerCoordinates:ve,scrollableAncestors:ie,scrollableAncestorRects:te});const Me=v.useMemo(()=>({active:D,activeNode:xe,activeNodeRect:Fe,activatorEvent:j,collisions:R,containerNodeRect:ft,dragOverlay:je,draggableNodes:x,droppableContainers:P,droppableRects:_e,over:G,measureDroppableContainers:be,scrollableAncestors:ie,scrollableAncestorRects:te,measuringConfiguration:re,measuringScheduled:J,windowRect:Q}),[D,xe,Fe,j,R,ft,je,x,P,_e,G,be,ie,te,re,J,Q]),it=v.useMemo(()=>({activatorEvent:j,activators:yt,active:D,activeNodeRect:Fe,ariaDescribedById:{draggable:ne},dispatch:b,draggableNodes:x,over:G,measureDroppableContainers:be}),[j,yt,D,Fe,b,ne,x,G,be]);return Ee.createElement(D$.Provider,{value:S},Ee.createElement(pp.Provider,{value:it},Ee.createElement(nD.Provider,{value:Me},Ee.createElement(Qg.Provider,{value:Ke},d)),Ee.createElement(vxe,{disabled:(a==null?void 0:a.restoreFocus)===!1})),Ee.createElement(E3e,{...a,hiddenTextDescribedById:ne}));function tr(){const lt=(U==null?void 0:U.autoScrollEnabled)===!1,Ct=typeof l=="object"?l.enabled===!1:l===!1,Zt=w&&!lt&&!Ct;return typeof l=="object"?{...l,enabled:Zt}:{enabled:Zt}}}),xxe=v.createContext(null),QS="button",wxe="Draggable";function Exe(e){let{id:t,data:r,disabled:n=!1,attributes:i}=e;const o=fp(wxe),{activators:s,activatorEvent:a,active:l,activeNodeRect:d,ariaDescribedById:u,draggableNodes:h,over:f}=v.useContext(pp),{role:p=QS,roleDescription:m="draggable",tabIndex:g=0}=i??{},y=(l==null?void 0:l.id)===t,b=v.useContext(y?Qg:xxe),[E,S]=_m(),[k,A]=_m(),w=cxe(s,t),_=Sf(r);jo(()=>(h.set(t,{id:t,key:o,node:E,activatorNode:k,data:_}),()=>{const C=h.get(t);C&&C.key===o&&h.delete(t)}),[h,t]);const x=v.useMemo(()=>({role:p,tabIndex:g,"aria-disabled":n,"aria-pressed":y&&p===QS?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[n,p,g,y,m,u.draggable]);return{active:l,activatorEvent:a,activeNodeRect:d,attributes:x,isDragging:y,listeners:n?void 0:w,node:E,over:f,setNodeRef:S,setActivatorNodeRef:A,transform:b}}function oD(){return v.useContext(nD)}const Sxe="Droppable",Cxe={timeout:25};function Txe(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:i}=e;const o=fp(Sxe),{active:s,dispatch:a,over:l,measureDroppableContainers:d}=v.useContext(pp),u=v.useRef({disabled:r}),h=v.useRef(!1),f=v.useRef(null),p=v.useRef(null),{disabled:m,updateMeasurementsFor:g,timeout:y}={...Cxe,...i},b=Sf(g??n),E=v.useCallback(()=>{if(!h.current){h.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{d(Array.isArray(b.current)?b.current:[b.current]),p.current=null},y)},[y]),S=Jg({callback:E,disabled:m||!s}),k=v.useCallback((x,C)=>{S&&(C&&(S.unobserve(C),h.current=!1),x&&S.observe(x))},[S]),[A,w]=_m(k),_=Sf(t);return v.useEffect(()=>{!S||!A.current||(S.disconnect(),h.current=!1,S.observe(A.current))},[A,S]),v.useEffect(()=>(a({type:hn.RegisterDroppable,element:{id:n,key:o,disabled:r,node:A,rect:f,data:_}}),()=>a({type:hn.UnregisterDroppable,key:o,id:n})),[n]),v.useEffect(()=>{r!==u.current.disabled&&(a({type:hn.SetDroppableDisabled,id:n,key:o,disabled:r}),u.current.disabled=r)},[n,o,r,a]),{active:s,rect:f,isOver:(l==null?void 0:l.id)===n,node:A,over:l,setNodeRef:w}}function Axe(e){let{animation:t,children:r}=e;const[n,i]=v.useState(null),[o,s]=v.useState(null),a=bm(r);return!r&&!n&&a&&i(a),jo(()=>{if(!o)return;const l=n==null?void 0:n.key,d=n==null?void 0:n.props.id;if(l==null||d==null){i(null);return}Promise.resolve(t(d,o)).then(()=>{i(null)})},[t,n,o]),Ee.createElement(Ee.Fragment,null,r,n?v.cloneElement(n,{ref:s}):null)}const kxe={x:0,y:0,scaleX:1,scaleY:1};function Rxe(e){let{children:t}=e;return Ee.createElement(pp.Provider,{value:rD},Ee.createElement(Qg.Provider,{value:kxe},t))}const Ixe={position:"fixed",touchAction:"none"},Pxe=e=>Zg(e)?"transform 250ms ease":void 0,Oxe=v.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:i,children:o,className:s,rect:a,style:l,transform:d,transition:u=Pxe}=e;if(!a)return null;const h=i?d:{...d,scaleX:1,scaleY:1}
487,f={...Ixe,width:a.width,height:a.height,top:a.top,left:a.left,transform:el.Transform.toString(h),transformOrigin:i&&n?C3e(n,a):void 0,transition:typeof u=="function"?u(n):u,...l};return Ee.createElement(r,{className:s,style:f,ref:t},o)}),jxe=e=>t=>{let{active:r,dragOverlay:n}=t;const i={},{styles:o,className:s}=e;if(o!=null&&o.active)for(const[a,l]of Object.entries(o.active))l!==void 0&&(i[a]=r.node.style.getPropertyValue(a),r.node.style.setProperty(a,l));if(o!=null&&o.dragOverlay)for(const[a,l]of Object.entries(o.dragOverlay))l!==void 0&&n.node.style.setProperty(a,l);return s!=null&&s.active&&r.node.classList.add(s.active),s!=null&&s.dragOverlay&&n.node.classList.add(s.dragOverlay),function(){for(const[l,d]of Object.entries(i))r.node.style.setProperty(l,d);s!=null&&s.active&&r.node.classList.remove(s.active)}},Lxe=e=>{let{transform:{initial:t,final:r}}=e;return[{transform:el.Transform.toString(t)},{transform:el.Transform.toString(r)}]},$xe={duration:250,easing:"ease",keyframes:Lxe,sideEffects:jxe({styles:{active:{opacity:"0"}}})};function Dxe(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:i}=e;return Yg((o,s)=>{if(t===null)return;const a=r.get(o);if(!a)return;const l=a.node.current;if(!l)return;const d=tD(s);if(!d)return;const{transform:u}=ci(s).getComputedStyle(s),h=B$(u);if(!h)return;const f=typeof t=="function"?t:Mxe(t);return K$(l,i.draggable.measure),f({active:{id:o,data:a.data,node:l,rect:i.draggable.measure(l)},draggableNodes:r,dragOverlay:{node:s,rect:i.dragOverlay.measure(d)},droppableContainers:n,measuringConfiguration:i,transform:h})})}function Mxe(e){const{duration:t,easing:r,sideEffects:n,keyframes:i}={...$xe,...e};return o=>{let{active:s,dragOverlay:a,transform:l,...d}=o;if(!t)return;const u={x:a.rect.left-s.rect.left,y:a.rect.top-s.rect.top},h={scaleX:l.scaleX!==1?s.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?s.rect.height*l.scaleY/a.rect.height:1},f={x:l.x-u.x,y:l.y-u.y,...h},p=i({...d,active:s,dragOverlay:a,transform:{initial:l,final:f}}),[m]=p,g=p[p.length-1];if(JSON.stringify(m)===JSON.stringify(g))return;const y=n==null?void 0:n({active:s,dragOverlay:a,...d}),b=a.node.animate(p,{duration:t,easing:r,fill:"forwards"});return new Promise(E=>{b.onfinish=()=>{y==null||y(),E()}})}}let eC=0;function Nxe(e){return v.useMemo(()=>{if(e!=null)return eC++,eC},[e])}const ZTe=Ee.memo(e=>
487{let{adjustScale:t=!1,children:r,dropAnimation:n,style:i,transition:o,modifiers:s,wrapperElement:a="div",className:l,zIndex:d=999}=e;const{activatorEvent:u,active:h,activeNodeRect:f,containerNodeRect:p,draggableNodes:m,droppableContainers:g,dragOverlay:y,over:b,measuringConfiguration:E,scrollableAncestors:S,scrollableAncestorRects:k,windowRect:A}=oD(),w=v.useContext(Qg),_=Nxe(h==null?void 0:h.id),x=iD(s,{activatorEvent:u,active:h,activeNodeRect:f,containerNodeRect:p,draggingNodeRect:y.rect,over:b,overlayNodeRect:y.rect,scrollableAncestors:S,scrollableAncestorRects:k,transform:w,windowRect:A}),C=_4(f),P=Dxe({config:n,draggableNodes:m,droppableContainers:g,measuringConfiguration:E}),I=C?y.setRef:void 0;return Ee.createElement(Rxe,null,Ee.createElement(Axe,{animation:P},h&&_?Ee.createElement(Oxe,{key:_,id:h.id,ref:I,as:a,activatorEvent:u,adjustScale:t,className:l,transition:o,rect:C,style:{zIndex:d,...i},transform:x},r):null))});function Lh(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function Fxe(e,t){return e.reduce((r,n,i)=>{const o=t.get(n);return o&&(r[i]=o),r},Array(e.length))}function d0(e){return e!==null&&e>=0}function Uxe(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function Bxe(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const sD=e=>{let{rects:t,activeIndex:r,overIndex:n,index:i}=e;const o=Lh(t,n,r),s=t[i],a=o[i];return!a||!s?null:{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}},h0={scaleX:1,scaleY:1},Vxe=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:i,rects:o,overIndex:s}=e;const a=(t=o[r])!=null?t:n;if(!a)return null;if(i===r){const d=o[s];return d?{x:0,y:r<s?d.top+d.height-(a.top+a.height):d.top-a.top,...h0}:null}const l=Hxe(o,i,r);return i>r&&i<=s?{x:0,y:-a.height-l,...h0}:i<r&&i>=s?{x:0,y:a.height+l,...h0}:{x:0,y:0,...h0}};function Hxe(e,t,r){const n=e[t],i=e[t-1],o=e[t+1];return n?r<t?i?n.top-(i.top+i.height):o?o.top-(n.top+n.height):0:o?o.top-(n.top+n.height):i?n.top-(i.top+i.height):0:0}const aD="Sortable",lD=Ee.createContext({activeIndex:-1,containerId:aD,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:sD,disabled:{draggable:!1,droppable:!1}});function zxe(e){let{children:t,id:r,items:n,strategy:i=sD,disabled:o=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:d,measureDroppableContainers:u}=oD(),h=fp(aD,r),f=a.rect!==null,p=v.useMemo(()=>n.map(w=>typeof w=="object"&&"id"in w?w.id:w),[n]),m=s!=null,g=s?p.indexOf(s.id):-1,y=d?p.indexOf(d.id):-1,b=v.useRef(p),E=!Uxe(p,b.current),S=y!==-1&&g===-1||E,k=Bxe(o);jo(()=>{E&&m&&u(p)},[E,p,m,u]),v.useEffect(()=>{b.current=p},[p]);const A=v.useMemo(()=>({activeIndex:g,containerId:h,disabled:k,disableTransforms:S,items:p,overIndex:y,useDragOverlay:f,sortedRects:Fxe(p,l),strategy:i}),[g,h,k.draggable,k.droppable,S,p,y,l,f,i]);return Ee.createElement(lD.Provider,{value:A},t)}const Wxe=e=>{let{id:t,items:r,activeIndex:n,overIndex:i}=e;return Lh(r,n,i).indexOf(t)},qxe=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:i,items:o,newIndex:s,previousItems:a,previousContainerId:l,transition:d}=e;return!d||!n||a!==o&&i===s?!1:r?!0:s!==i&&t===l},Gxe={duration:200,easing:"ease"},cD="transform",Kxe=el.Transition.toString({property:cD,duration:0,easing:"linear"}),Yxe={roleDescription:"sortable"};function Zxe(e){let{disabled:t,index:r,node:n,rect:i}=e;const[o,s]=v.useState(null),a=v.useRef(r);return jo(()=>{if(!t&&r!==a.current&&n.current){const l=i.current;if(l){const d=xd(n.current,{ignoreTransform:!0}),u={x:l.left-d.left,y:l.top-d.top,scaleX:l.width/d.width,scaleY:l.height/d.height};(u.x||u.y)&&s(u)}}r!==a.current&&(a.current=r)},[t,r,n,i]),v.useEffect(()=>{o&&s(null)},[o]),o}function Xxe(e){let{animateLayoutChanges:t=qxe,attributes:r,disabled:n,data:i,getNewIndex:o=Wxe,id:s,strategy:a,resizeObserverConfig:l,transition:d=Gxe}=e;const{items:u,containerId:h,activeIndex:f,disabled:p,disableTransforms:m,sortedRects:g,overIndex:y,useDragOverlay:b,strategy:E}=v.useContext(lD),S=Jxe(n,p),k=u.indexOf(s),A=v.useMemo(()=>({sortable:{containerId:h,index:k,items:u},...i}),[h,i,k,u]),w=v.useMemo(()=>u.slice(u.indexOf(s)),[u,s]),{rect:_,node:x,isOver:C,setNodeRef:P}=Txe({id:s,data:A,disabled:S.droppable,resizeObserverConfig:{updateMeasurementsFor:w,...l}}),{active:I,activatorEvent:O,activeNodeRect:D,attributes:M,setNodeRef:U,listeners:$,isDragging:j,over:q,setActivatorNodeRef:W,transform:ne}=Exe({id:s,data:A,attributes:{...Yxe,...r},disabled:S.draggable}),ae=u3e(P,U),re=!!I,_e=re&&!m&&d0(f)&&d0(y),be=!b&&j,J=be&&_e?ne:null,Ze=_e?J??(a??E)({rects:g,activeNodeRect:D,activeIndex:f,overIndex:y,index:k}):null,$e=d0(f)&&d0(y)?o({id:s,items:u,activeIndex:f,overIndex:y}):k,Le=I==null?void 0:I.id,Fe=v.useRef({activeId:Le,items:u,newIndex:$e,containerId:h}),ft=u!==Fe.current.items,Ge=t({active:I,containerId:h,isDragging:j,isSorting:re,id:s,index:k,items:u,newIndex:Fe.current.newIndex,previousItems:Fe.current.items,previousContainerId:Fe.current.containerId,transition:d,wasDragging:Fe.current.activeId!=null}),Se=Zxe({disabled:!Ge,index:k,node:x,rect:_});return v.useEffect(()=>{re&&Fe.current.newIndex!==$e&&(Fe.current.newIndex=$e),h!==Fe.current.containerId&&(Fe.current.containerId=h),u!==Fe.current.items&&(Fe.current.items=u)},[re,$e,h,u]),v.useEffect(()=>{if(Le===Fe.current.activeId)return;if(Le&&!Fe.current.activeId){Fe.current.activeId=Le;return}const Ce=setTimeout(()=>{Fe.current.activeId=Le},50);return()=>clearTimeout(Ce)},[Le]),{active:I,activeIndex:f,attributes:M,data:A,rect:_,index:k,newIndex:$e,items:u,isOver:C,isSorting:re,isDragging:j,listeners:$,node:x,overIndex:y,over:q,setN
487odeRef:ae,setActivatorNodeRef:W,setDroppableNodeRef:P,setDraggableNodeRef:U,transform:Se??Ze,transition:je()};function je(){if(Se||ft&&Fe.current.newIndex===k)return Kxe;if(!(be&&!Zg(O)||!d)&&(re||Ge))return el.Transition.toString({...d,property:cD})}}function Jxe(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}function Sm(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const Qxe=[Kt.Down,Kt.Right,Kt.Up,Kt.Left],XTe=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:i,droppableContainers:o,over:s,scrollableAncestors:a}}=t;if(Qxe.includes(e.code)){if(e.preventDefault(),!r||!n)return;const l=[];o.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const f=i.get(h.id);if(f)switch(e.code){case Kt.Down:n.top<f.top&&l.push(h);break;case Kt.Up:n.top>f.top&&l.push(h);break;case Kt.Left:n.left>f.left&&l.push(h);break;case Kt.Right:n.left<f.left&&l.push(h);break}});const d=k3e({active:r,collisionRect:n,droppableRects:i,droppableContainers:l,pointerCoordinates:null});let u=F$(d,"id");if(u===(s==null?void 0:s.id)&&d.length>1&&(u=d[1].id),u!=null){const h=o.get(r.id),f=o.get(u),p=f?i.get(f.id):null,m=f==null?void 0:f.node.current;if(m&&p&&h&&f){const y=Xg(m).some((w,_)=>a[_]!==w),b=uD(h,f),E=e4e(h,f),S=y||!b?{x:0,y:0}:{x:E?n.width-p.width:0,y:E?n.height-p.height:0},k={x:p.left,y:p.top};return S.x&&S.y?k:Cf(k,S)}}}};function uD(e,t){return!Sm(e)||!Sm(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function e4e(e,t){return!Sm(e)||!Sm(t)||!uD(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const t4e=({product:e,onClick:t,sortingEnabled:r,longPressEvents:n,onMoveToTop:i,onMoveToBottom:o})=>{var p;const{attributes:s,listeners:a,setNodeRef:l,transform:d,transition:u,isDragging:h}=Xxe({id:e.id.toString(),disabled:!r}),f=r?{transform:el.Transform.toString(d),transition:u,opacity:1,position:"relative",zIndex:h?999:"auto",boxShadow:h?"0 5px 15px rgba(0,0,0,0.2)":"none",borderRadius:h?"8px":"none"}:{};return c.jsx("div",{ref:l,style:f,...r?s:{},...r?a:{},children:c.jsx(p4,{id:e.id,hidden:e.oculto,originalPrice:e.preco_cheio??void 0,productName:e.nome,categoryName:e.categoria_nome,attributes:e.uniqueSortedAttributes,price:e.price,minPrice:e.priceRange.min,maxPrice:e.priceRange.max,imageUrl:(p=e.image_url)==null?void 0:p[0],onClick:t,selectEnabled:!1,selected:!1,longPressEvents:r?void 0:n,sortingMode:r,isDragging:h,onMoveToTop:i,onMoveToBottom:o})})},r4e=Ee.memo(t4e);var b4={},n4e=zt;Object.defineProperty(b4,"__esModule",{value:!0});var dD=b4.default=void 0,i4e=n4e(Wt()),o4e=c;dD=b4.default=(0,i4e.default)((0,o4e.jsx)("path",{d:"M3 18h6v-2H3zM3 6v2h18V6zm0 7h12v-2H3z"}),"Sort");const s4e=[{value:"name-asc",label:"Nome (A-Z)"},{value:"name-desc",label:"Nome (Z-A)"},{value:"price-asc",label:"Preço (menor primeiro)"},{value:"price-desc",label:"Preço (maior primeiro)"},{value:"date-newest",label:"Data de criação (mais recentes)"},{value:"date-oldest",label:"Data de criação (mais antigos)"}],a4e=(e,t)=>{const r=[...e];switch(t){case"name-asc":return r.sort((n,i)=>n.nome.localeCompare(i.nome,"pt-BR"));case"name-desc":return r.sort((n,i)=>i.nome.localeCompare(n.nome,"pt-BR"));case"price-asc":return r.sort((n,i)=>{const o=n.priceRange.min,s=i.priceRange.min;return o-s});case"price-desc":return r.sort((n,i)=>{const o=n.priceRange.max;return i.priceRange.max-o});case"date-newest":return r.sort((n,i)=>{const o=new Date(n.criado_em).getTime();return new Date(i.criado_em).getTime()-o});case"date-oldest":return r.sort((n,i)=>{const o=new Date(n.criado_em).getTime(),s=new Date(i.criado_em).getTime();return o-s});case"modified-newest":return r.sort((n,i)=>{const o=new Date(n.atualizado_em||n.criado_em).getTime();return new Date(i.atualizado_em||i.criado_em).getTime()-o});case"custom":default:return r}},e5=e=>{const t=e.length;return e.map((r,n)=>({id:r.id,destaque:t-n}))},l4e=({anchorEl:e,open:t,onClose:r,onSelectSort:n})=>{const i=o=>{n(o),r()};return c.jsx(Ba,{anchorEl:e,open:t,onClose:r,elevation:3,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:s4e.map(o=>c.jsxs(Mt,{onClick:()=>
487i(o.value),children:[c.jsx(Vt,{children:c.jsx(dD,{fontSize:"small"})}),c.jsx(St,{children:o.label})]},o.value))})},c4e=(e,t)=>{if(!e.length||!t.length)return e;const r=new Map;return t.sort((n,i)=>n.id-i.id).forEach(n=>{const i=new Map;[...n.valores].sort((s,a)=>s.destaque!==null&&s.destaque!==void 0&&a.destaque!==null&&a.destaque!==void 0?a.destaque-s.destaque:s.destaque!==null&&s.destaque!==void 0&&(a.destaque===null||a.destaque===void 0)?-1:a.destaque!==null&&a.destaque!==void 0&&(s.destaque===null||s.destaque===void 0)?1:s.id-a.id).forEach((s,a)=>{i.set(s.valor,a)}),r.set(n.id,i)}),[...e].sort((n,i)=>{const o=[...n.valores].sort((l,d)=>l.atributo.id-d.atributo.id),s=[...i.valores].sort((l,d)=>l.atributo.id-d.atributo.id),a=Math.max(o.length,s.length);for(let l=0;l<a;l++){const d=o[l],u=s[l];if(!d)return-1;if(!u)return 1;if(d.atributo.id!==u.atributo.id)return d.atributo.id-u.atributo.id;const h=r.get(d.atributo.id);if(h){const f=h.get(d.atributo_valor.valor)??999999,p=h.get(u.atributo_valor.valor)??999999;if(f!==p)return f-p}}return n.id-i.id})},JTe=e=>e!=null&&e.length?e.sort((t,r)=>t.atributo.id-r.atributo.id).map(t=>{var r;return(r=t.atributo_valor)==null?void 0:r.valor}).filter(Boolean).join(" / "):"",u4e=e=>{if(!e.length)return e;try{const t=new Map;e.forEach(o=>{var s;(s=o.variation_details)==null||s.forEach(a=>{if(!a.atributo_id)return;t.has(a.atributo_id)||t.set(a.atributo_id,{id:a.atributo_id,nome:a.atributo_nome||"",valores:new Map});const l=t.get(a.atributo_id);a.atributo_valor_id&&!l.valores.has(a.atributo_valor_id)&&l.valores.set(a.atributo_valor_id,{id:a.atributo_valor_id,valor:a.valor,destaque:a.atributo_valor_destaque??null})})});const r=Array.from(t.values()).map(o=>({id:o.id,nome:o.nome,valores:Array.from(o.valores.values()).map(s=>({id:s.id,valor:s.valor,destaque:s.destaque??void 0}))})),n=e.map(o=>{var s;return{...o,valores:((s=o.variation_details)==null?void 0:s.map(a=>({atributo:{id:a.atributo_id||0,nome:a.atributo_nome||""},atributo_valor:{id:a.atributo_valor_id||0,valor:a.valor}})))||[]}});return c4e(n,r).map(o=>e.find(a=>a.id===o.id)||o)}catch(t){return console.warn("Failed to sort product variations:",t),e}},d4e=e=>{const t=new Map;return e.forEach(n=>{t.set(n.id,{...n,subCategories:[]})}),e.forEach(n=>{if(n.categoria_pai_id!==null){const i=t.get(n.categoria_pai_id);i&&i.subCategories.push(t.get(n.id))}}),t.forEach(n=>{n.subCategories&&n.subCategories.length>0&&n.subCategories.sort((i,o)=>{const s=i.destaque||0;return(o.destaque||0)-s})}),Array.from(t.values()).filter(n=>n.categoria_pai_id===null).sort((n,i)=>{const o=n.destaque||0;return(i.destaque||0)-o})},tC=e=>{const t=d4e(e),r=n=>({value:n.id,label:n.nome,subOptions:n.subCategories.map(r)});return t.map(r)},QTe=(e,t)=>{if(!t)return 0;typeof t=="string"&&(t=parseInt(t));const r=(n,i=0)=>{const o=e.find(s=>s.id===n);return!o||o.categoria_pai_id===null?i:r(o.categoria_pai_id,i+1)};return r(t)},h4e=(e,t)=>{if(!t||t.length===0)return[e];const r=new Map;t.forEach(o=>{o.categoria_pai_id!==null&&(r.has(o.categoria_pai_id)||r.set(o.categoria_pai_id,[]),r.get(o.categoria_pai_id).push(o.id))});const n=[e],i=o=>{(r.get(o)||[]).forEach(a=>{n.push(a),i(a)})};return i(e),n},f4e=new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}),p4e=e=>{let t=e.preco,r=e.preco,n=1;if(e.produto_variacao&&e.produto_variacao.length>0)for(const i of e.produto_variacao){if(i.oculto||i.deletado_em)continue;const o=i.preco;o<t&&(t=o),o>r&&(r=o),n++}return{min:t,max:r,isSinglePrice:t===r||n===1}},m4e=e=>{var o,s,a,l,d,u;if(e.produto_variacao&&e.produto_variacao.length>0){let h=0,f=0,p=0;const m=[];for(const g of e.produto_variacao){if(g.deletado_em)continue;const y=((o=g.estoque)==null?void 0:o.quantidade_atual)||0,b=((s=g.estoque)==null?void 0:s.estoque_minimo)||0,E=((a=g.estoque)==null?void 0:a.custo_medio_atual)||0,S=E*y;h+=y,f+=b,p+=S,m.push({id:g.id,name:g.nome,stock:y,minStock:b,stockControlled:g.controlar_estoque,hidden:g.oculto,averageCost:E,totalValue:S})}return{totalStock:h,minStock:f,hasVariations:!0,stockControlled:e.controlar_estoque,totalValue:p,variations:m}}const r=((l=e.estoque)==null?void 0:l.custo_medio_atual)||0,n=((d=e.estoque)==null?void 0:d.quantidade_atual)||0,i=r*n;return{totalStock:n,minStock:((u=e.estoque)==null?void 0:u.estoque_minimo)||0,hasVariations:!1,stockControlled:e.controlar_estoque,totalValue:i,variations:[]}},g4e=async(e,t,r)=>{var f;if(!e)throw new Error("Usuário não autenticado");let n=Te.from("produto").select(` 488 *, 489 categoria!produto_categoria_id_fkey (nome), 490 produto_variacao ( 491 *, 492 produto_variacao_valor ( 493 atributo_valor ( 494 id, 495 valor, 496 destaque, 497 atributos ( 498 id, 499 nome 500 ) 501 ) 502 ) 503 ) 504 `).eq("user_id",e).is("deletado_em",null);if(t&&t>0){const p=r?h4e(t,r):[t];p.length>0?n=n.in("categoria_id",p):n=n.eq("categoria_id",t)}else t===-2&&(n=n.is("categoria_id",null));const i=n.order("oculto",{ascending:!0}).order("destaque",{ascending:!1}).order("criado_em",{ascending:!1}).order("id",{ascending:!1}),o=1e3,s=30,a=[];let l=null;for(let p=0;p<s;p++){const m=p*o,{data:g,error:y}=await i.range(m,m+o-1);if(y){l=y;break}if(a.push(...g??[]),!g||g.length<o)break}const d=a;if(l)throw new Error(l.message);if(!d)return[];const u=new Array(d.length);for(let p=0;p<d.length;p++){const m=d[p],g=m.produto_variacao;let y=[];if(g&&g.length>0){y=[];for(const b of g){if(b.deletado_em)continue;const E=b.produto_variacao_valor,S=E&&E.length>0?E.map(k=>{var A,w,_,x,C,P,I;return{valor:((A=k.atributo_valor)==null?void 0:A.valor)||"",atributo_nome:((_=(w=k.atributo_valor)==null?void 0:w.atributos)==null?void 0:_.nome)||"",atributo_id:(C=(x=k.atributo_valor)==null?void 0:x.atributos)==null?void 0:C.id,atributo_valor_id:(P=k.atributo_valor)==null?void 0:P.id,atributo_valor_destaque:(I=k.atributo_valor)==null?void 0:I.destaque}}):[];y.push({...b,variation_details:S,estoque:{quantidade_atual:b.estoque_atual||0,estoque_minimo:b.estoque_minimo||0,custo_medio_compra:b.custo_medio_compra||0,custo_medio_atual:b.custo_medio_atual||0}})}y=u4e(y)}u[p]={...m,categoria_nome:((f=m.categoria)==null?void 0:f.nome)||null,produto_variacao:y,estoque:{quantidade_atual:m.estoque_atual||0,estoque_minimo:m.estoque_minimo||0,custo_medio_compra:m.custo_medio_compra||0,custo_medio_atual:m.custo_medio_atual||0}}}const h=new Array(u.length);for(let p=0;p<u.length;p++){const m=u[p],g=new Set,y=(m==null?void 0:m.produto_variacao)??[];for(const E of y){const S=(E==null?void 0:E.variation_details)??[];for(const k of S)k!=null&&k.atributo_nome&&typeof k.atributo_nome=="string"&&g.add(k.atributo_nome)}const b=Array.from(g).sort();h[p]={...m,uniqueSortedAttributes:b,price:f4e.format(m.preco),priceRange:p4e(m),stockInfo:m4e(m)}}return h},hD=({categoryId:e=null,allCategories:t=[]}={})=>{const{user:r}=ot(),n=r==null?void 0:r.id;return Et({queryKey:["products",e],queryFn:()=>g4e(n,e,t),enabled:!!n})},$h=new Map,t5=new Map,E_=1e4;async function rC(e){try{const{data:{session:t}}=await Te.auth.getSession(),r={"Content-Type":"application/json"};t!=null&&t.access_token&&(r.Authorization=`Bearer ${t.access_token}`);const n=await fetch("https://catalogo.stoqui.com.br/api/revalidate",{method:"POST",headers:r,body:JSON.stringify({tags:e})});if(!n.ok)return console.warn(`Cache revalidation failed: ${n.statusText}`),null;const i=await n.json();return console.log("Cache revalidation successful:",i),i}catch(t){return console.warn("Cache revalidation error:",t),null}}
504function v4e(e,t=[]){if(!e){console.warn("Cannot revalidate cache: no store slug provided");return}const r=Date.now(),n=[e,...t].sort().join("|"),i=$h.get(n),o=[e,...t];if(i&&r-i<E_){if(!t5.has(n)){const s=E_-(r-i);t5.set(n,setTimeout(()=>{t5.delete(n),$h.set(n,Date.now()),rC(o).catch(()=>{})},s))}return}$h.set(n,r),console.log("Triggering cache revalidation for tags:",o),rC(o).catch(()=>{}),y4e()}function y4e(){const t=Date.now()-E_;for(const[r,n]of $h.entries())n<t&&$h.delete(r)}const mp=()=>{const{data:e}=lo();return{triggerRevalidation:()=>{e!=null&&e.slug_loja&&v4e(e.slug_loja)}}};class _4e extends Error{constructor(r){const n=r.join(", ");super(r.length===1?`Este produto faz parte do combo "${n}". Remova o produto do combo antes de excluir.`:`Este produto faz parte dos combos: ${n}. Remova o produto dos combos antes de excluir.`);ze(this,"comboNames");this.name="ComboDependencyError",this.comboNames=r}}async function b4e(e){if(e.length===0)return[];const{data:t,error:r}=await Te.from("produto_combo_item").select("combo_produto_id, produto_id, combo:produto!combo_produto_id (id, nome, deletado_em)").in("produto_id",e);if(r)return[];const n=new Set;for(const i of t??[]){const o=i.combo;o&&!o.deletado_em&&!e.includes(i.combo_produto_id)&&n.add(o.nome)}return[...n]}function x4e(e){if(!e)return null;const t=e.match(/COMBO_(?:DEPENDENCY|INVALID):\s*(.+)/);return t?t[1]:null}const w4e=async({product_ids:e},t)=>{if(!t)throw new Error("User must be logged in to delete products.");const r=await b4e(e);if(r.length>0)throw new _4e(r);const{data:n}=await Te.from("produto").select("id").in("id",e).eq("combo",!0),i=(n??[]).map(s=>s.id),o=e.filter(s=>!i.includes(s));for(const s of[i,o]){if(s.length===0)continue;const{error:a}=await Te.from("produto").update({deletado_em:new Date().toISOString()}).in("id",s);if(a){const l=x4e(a.message);throw l?new Error(l):a}}return e.map(s=>({id:s}))},E4e=()=>{const e=ao(),{user:t}=ot(),r=t==null?void 0:t.id,{triggerRevalidation:n}=mp();return jn({mutationFn:o=>w4e(o,r),onMutate:async o=>{await e.cancelQueries({queryKey:["products"]});const s=e.getQueryData(["products"])||[];return e.setQueryData(["products"],a=>a?a.filter(l=>!o.product_ids.includes(l.id)):[]),{previousProducts:s}},onError:(o,s,a)=>{console.error("Error deleting products:",o.message),a!=null&&a.previousProducts&&e.setQueryData(["products"],a.previousProducts)},onSuccess:(o,s)=>{pe(fe.DELETE.PRODUCT_BULK,{productIds:s.product_ids,count:s.product_ids.length}),n()},onSettled:()=>{e.invalidateQueries({queryKey:["products"]}),e.invalidateQueries({queryKey:["productsCount"]}),e.invalidateQueries({queryKey:["products-visibility-count"]}),e.invalidateQueries({queryKey:["categories"]})},retry:0})},S4e=()=>{const e=ao(),{user:t}=ot(),r=t==null?void 0:t.id,{triggerRevalidation:n}=mp();return jn({mutationFn:async({products:i})=>{if(!r)throw new Error("User must be logged in to update product order.");const o=500,s=[];for(let a=0;a<i.length;a+=o)s.push(i.slice(a,a+o));for(const a of s){const l=a.map(({id:u,destaque:h})=>({id:u,destaque:h,user_id:r})),{error:d}=await Te.from("produto").upsert(l,{onConflict:"id",ignoreDuplicates:!1});if(d)throw d}},onMutate:async({products:i,originalProducts:o})=>{await e.cancelQueries({queryKey:["products"]});const s=e.getQueryData(["products"]);if(o){const a=JSON.parse(JSON.stringify(o)),l=new Map(i.map(({id:d,destaque:u})=>[d,u]));a.forEach(d=>{const u=l.get(d.id);u!==void 0&&(d.destaque=u)}),a.sort((d,u)=>{const h=d.destaque||0;return(u.destaque||0)-h}),e.setQueryData(["products"],a)}return{previousProducts:s}},onError:(i,o,s)=>{s!=null&&s.previousProducts&&e.setQueryData(["products"],s.previousProducts)},onSettled:()=>{e.removeQueries({queryKey:["products"]}),e.invalidateQueries({queryKey:["product"]}),n()}})},C4e=async({product_ids:e,categoria_id:t},r)=>{if(!r)throw new Error("User must be logged in to update products.");const{error:n}=await Te.from("produto").update({categoria_id:t}).in("id",e);if(n)throw n;return e.map(i=>({id:i}))},T4e=()=>{const e=ao(),{user:t}=ot(),r=t==null?void 0:t.id,{triggerRevalidation:n}=mp();return jn({mutationFn:o=>C4e(o,r),onMutate:async()=>(await e.cancelQueries({queryKey:["products"]}),{previousProducts:e.getQueryData(["products"])||[]}),onError:(o,s,a)=>{console.error("Error updating product categories:",o.message),a!=null&&a.previousProducts&&e.setQueryData(["products"],a.previousProducts)},onSettled:()=>
504{e.invalidateQueries({queryKey:["products"]}),e.invalidateQueries({queryKey:["productsCount"]}),e.invalidateQueries({queryKey:["categories"]}),n()},retry:0})},A4e=async({product_ids:e,oculto:t},r)=>{if(!r)throw new Error("User must be logged in to update products.");const{error:n}=await Te.from("produto").update({oculto:t}).in("id",e);if(n)throw n;return e.map(i=>({id:i}))},k4e=()=>{const e=ao(),{user:t}=ot(),r=t==null?void 0:t.id,{triggerRevalidation:n}=mp();return jn({mutationFn:o=>A4e(o,r),onMutate:async()=>(await e.cancelQueries({queryKey:["products"]}),{previousProducts:e.getQueryData(["products"])||[]}),onError:(o,s,a)=>{console.error("Error updating product visibility:",o.message),a!=null&&a.previousProducts&&e.setQueryData(["products"],a.previousProducts)},onSettled:()=>{e.invalidateQueries({queryKey:["products"]}),e.invalidateQueries({queryKey:["products-visibility-count"]}),n()},retry:0})};function fD(e,t){if(e<=0)return 0;const r=t/100,i=Math.floor(e-r)+r,o=i+1;if(i<=0)return o;const s=Math.abs(e-i),a=Math.abs(e-o);return s<a?i:o}function f0(e,t){let r;if(t.operacao==="definir")r=t.valor;else if(t.tipoValor==="reais")r=t.operacao==="aumentar"?e+t.valor:e-t.valor;else{const n=t.operacao==="aumentar"?1+t.valor/100:1-t.valor/100;r=e*n}return t.arredondamento!==null&&(r=fD(r,t.arredondamento)),Math.max(0,Math.round(r*100)/100)}function R4e(e,t,r){var i;const n={produtos:[],totalProdutos:0,totalVariacoes:0,totalItens:0,precosZero:0};for(const o of e){if(!t.has(o.id))continue;const s=f0(o.preco,r);let a=o.preco_cheio??null,l=!1;a!=null&&(r.ajustarPrecoCheio&&(a=f0(a,r)),s>=a&&(a=null,l=!0)),s===0&&n.precosZero++;const d=[];if((((i=o.produto_variacao)==null?void 0:i.length)??0)>0)for(const u of o.produto_variacao){if(u.deletado_em)continue;const h=f0(u.preco,r);let f=u.preco_cheio??null,p=!1;f!=null&&(r.ajustarPrecoCheio&&(f=f0(f,r)),h>=f&&(f=null,p=!0)),h===0&&n.precosZero++,d.push({id:u.id,nome:u.nome,preco_anterior:u.preco,preco_cheio_anterior:u.preco_cheio??null,preco_novo:h,preco_cheio_novo:f,promoRemovida:p}),n.totalVariacoes++}n.produtos.push({id:o.id,nome:o.nome,preco_anterior:o.preco,preco_cheio_anterior:o.preco_cheio??null,preco_novo:s,preco_cheio_novo:a,promoRemovida:l,variacoes:d}),n.totalProdutos++,n.totalItens+=1+d.length}return n}function nC(e,t,r){const n=t??e;if(r.desconto===0)return t!=null?{newPreco:n,newPrecoCheio:null,promoRemovida:!0,promoCriada:!1,semAlteracao:!1,precoSobe:!1}:{newPreco:e,newPrecoCheio:null,promoRemovida:!1,promoCriada:!1,semAlteracao:!0,precoSobe:!1};let i=n*(1-r.desconto/100);if(r.arredondamento!==null&&(i=fD(i,r.arredondamento)),i=Math.max(0,Math.round(i*100)/100),i>=n){const a=i===e&&t==null;return{newPreco:a?e:n,newPrecoCheio:null,promoRemovida:t!=null,promoCriada:!1,semAlteracao:a,precoSobe:t!=null&&n>e}}const o=n,s=i===e&&o===t;return{newPreco:i,newPrecoCheio:o,promoRemovida:!1,promoCriada:t==null,semAlteracao:s,precoSobe:i>e}}function I4e(e,t,r){const n={produtos:[],totalProdutos:0,totalVariacoes:0,totalItens:0,precosZero:0,totalSemAlteracao:0,totalPrecosSobem:0};for(const i of e){if(!t.has(i.id))continue;const o=nC(i.preco,i.preco_cheio??null,r);o.newPreco===0&&n.precosZero++,o.semAlteracao&&n.totalSemAlteracao++,o.precoSobe&&n.totalPrecosSobem++;const s=[];for(const a of i.produto_variacao||[]){if(a.deletado_em)continue;const l=nC(a.preco,a.preco_cheio??null,r);l.newPreco===0&&n.precosZero++,l.semAlteracao&&n.totalSemAlteracao++,l.precoSobe&&n.totalPrecosSobem++,s.push({id:a.id,nome:a.nome,preco_anterior:a.preco,preco_cheio_anterior:a.preco_cheio??null,preco_novo:l.newPreco,preco_cheio_novo:l.newPrecoCheio,promoRemovida:l.promoRemovida,promoCriada:l.promoCriada,semAlteracao:l.semAlteracao,precoSobe:l.precoSobe}),n.totalVariacoes++}n.produtos.push({id:i.id,nome:i.nome,preco_anterior:i.preco,preco_cheio_anterior:i.preco_cheio??null,preco_novo:o.newPreco,preco_cheio_novo:o.newPrecoCheio,promoRemovida:o.promoRemovida,promoCriada:o.promoCriada,semAlteracao:o.semAlteracao,precoSobe:o.precoSobe,variacoes:s}),n.totalProdutos++,n.totalItens+=1+s.length}return n}function P4e(e){const t=[];for(const r of e.produtos){t.push({tipo:"produto",id:r.id,nome:r.nome,preco_anterior:r.preco_anterior,preco_cheio_anterior:r.preco_cheio_anterior,preco_novo:r.preco_novo,preco_cheio_novo:r.preco_cheio_novo});for(const n of r.variacoes)t.push({tipo:"variacao",id:n.id,produto_id:r.id,nome:n.nome,preco_anterior:n.preco_anterior,preco_cheio_anterior:n.preco_cheio_anterior,preco_novo:n.prec
504o_novo,preco_cheio_novo:n.preco_cheio_novo})}return t}function O4e(e){if(e.operacao==="promocao"){if(e.valor===0)return"Removeu promoção";const i=e.arredondamento!==null?` · arredondou ,${String(e.arredondamento).padStart(2,"0")}`:"";return`Promoção ${String(e.valor).replace(".",",")}%${i}`}if(e.operacao==="definir"){const i=`R$ ${e.valor.toFixed(2).replace(".",",")}`,o=e.arredondamento!==null?` · arredondou ,${String(e.arredondamento).padStart(2,"0")}`:"";return`Definiu ${i}${o}`}const t=e.operacao==="aumentar"?"Aumentou":"Diminuiu",r=e.tipoValor==="reais"?`R$ ${e.valor.toFixed(2).replace(".",",")}`:`${String(e.valor).replace(".",",")}%`,n=e.arredondamento!==null?` · arredondou ,${String(e.arredondamento).padStart(2,"0")}`:"";return`${t} ${r}${n}`}const p0=500,j4e=()=>{const e=ao(),{user:t}=ot(),r=t==null?void 0:t.id,{triggerRevalidation:n}=mp();return jn({mutationFn:async({preview:i,config:o})=>{if(!r)throw new Error("Usuário deve estar logado para atualizar preços.");const s=P4e(i),a=O4e(o),l=s.filter(f=>f.tipo==="produto");for(let f=0;f<l.length;f+=p0){const p=l.slice(f,f+p0),m=await Promise.all(p.map(g=>Te.from("produto").update({preco:g.preco_novo,preco_cheio:g.preco_cheio_novo}).eq("id",g.id).eq("user_id",r)));for(const{error:g}of m)if(g)throw g}const d=s.filter(f=>f.tipo==="variacao");for(let f=0;f<d.length;f+=p0){const p=d.slice(f,f+p0),m=await Promise.all(p.map(g=>Te.from("produto_variacao").update({preco:g.preco_novo,preco_cheio:g.preco_cheio_novo}).eq("id",g.id).eq("user_id",r)));for(const{error:g}of m)if(g)throw g}const{data:u,error:h}=await Te.from("alteracao_preco_lote").insert({user_id:r,descricao:a,configuracao:{operacao:o.operacao,tipo_valor:o.tipoValor,valor:o.valor,arredondamento:o.arredondamento,ajustar_preco_cheio:o.ajustarPrecoCheio,total_produtos:i.totalProdutos,total_variacoes:i.totalVariacoes},itens:s}).select("id").single();if(h)throw h;return{logId:u.id}},onMutate:async()=>(await e.cancelQueries({queryKey:["products"]}),{previousProducts:e.getQueryData(["products"])||[]}),onSuccess:()=>{e.removeQueries({queryKey:["products"]}),e.invalidateQueries({queryKey:["product"]}),e.invalidateQueries({queryKey:["productsCount"]}),e.invalidateQueries({queryKey:["priceChangeHistory"]}),n()},onError:(i,o,s)=>{console.error("Error updating prices:",i.message),s!=null&&s.previousProducts&&e.setQueryData(["products"],s.previousProducts)},retry:0})},L4e=async e=>{const{data:t,error:r}=await Te.from("tabela_preco").select(` 505 *, 506 tabela_preco_item( 507 *, 508 produto:produto_id(id, nome, image_url, preco, preco_cheio), 509 produto_variacao:produto_variacao_id(id, nome, preco, preco_cheio) 510 ), 511 cliente(id, nome, telefone, profile_url) 512 `).eq("id",e).is("deletado_em",null).single();if(r)throw new Error(r.message);return t},$4e=e=>Et({queryKey:["price-table",e],queryFn:()=>L4e(e),enabled:!!e});function D4e(e,t,r,n){if(r){const o=e.itens.find(s=>s.produto_id===t&&s.produto_variacao_id===r);if(o)return{price:o.preco_override,source:"override_variation"}}const i=e.itens.find(o=>o.produto_id===t&&o.produto_variacao_id===null);return i?{price:i.preco_override,source:"override_product"}:{price:n,source:"base"}}const M4e=e=>{const{data:t,isLoading:r}=$4e(e?String(e):"");return{getPrice:v.useMemo(()=>{if(!t||!e)return null;const i={itens:(t.tabela_preco_item||[]).map(o=>({produto_id:o.produto_id,produto_variacao_id:o.produto_variacao_id,preco_override:o.preco_override}))};return(o,s,a)=>D4e(i,o,s,a)},[t,e]),priceTable:t,isLoading:r,hasTable:!!e&&!!t,tableName:(t==null?void 0:t.nome)||null}};function N4e(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}var Cm;(function(e){e.event="event",e.props="prop"})(Cm||(Cm={}));function Jc(){}function F4e(e){var t,r=void 0;return function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];return t&&n.length===t.length&&n.every(function(o,s){return o===t[s]})||(t=n,r=e.apply(void 0,n)),r}}function S_(e){return!!(e||"").match(/\d/)}function C_(e){return e==null}function U4e(e){return typeof e=="number"&&isNaN(e)}function B4e(e){return C_(e)||U4e(e)||typeof e=="number"&&!isFinite(e)}function V4e(e){var t=v.useRef(e);t.current=e;var r=v.useRef(function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];return t.current.apply(t,n)});return r.current}function iC(e,t){return Array(t+1).join(e)}function H4e(e){var t=e+"",r=t[0]==="-"?"-":"";r&&(t=t.substring(1));var n=t.split(/[eE]/g),i=n[0],o=n[1];if(o=Number(o),!o)return r+i;i=i.replace(".","");var s=1+o,a=i.length;return s<0?i="0."+iC("0",Math.abs(s))+i:s>=a?i=i+iC("0",s-a):i=(i.substring(0,s)||"0")+"."+i.substring(s),r+i}function oC(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var r=e.createTextRange();return r.move("character",t),r.select(),!0}
512return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var z4e=F4e(function(e,t){for(var r=0,n=0,i=e.length,o=t.length;e[r]===t[r]&&r<i;)r++;for(;e[i-1-n]===t[o-1-n]&&o-n>r&&i-n>r;)n++;return{from:{start:r,end:i-n},to:{start:r,end:o-n}}});function W4e(e,t,r){return Math.min(Math.max(e,t),r)}function r5(e){return Math.max(e.selectionStart,e.selectionEnd)}function q4e(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function G4e(e){var t=e.currentValue,r=e.formattedValue,n=e.currentValueIndex,i=e.formattedValueIndex;return t[n]===r[i]}function K4e(e,t,r,n,i,o,s){s===void 0&&(s=G4e);var a=i.findIndex(function(k){return k}),l=e.slice(0,a);!t&&!r.startsWith(l)&&(t=l,r=l+r,n=n+l.length);for(var d=r.length,u=e.length,h={},f=new Array(d),p=0;p<d;p++){f[p]=-1;for(var m=0,g=u;m<g;m++){var y=s({currentValue:r,lastValue:t,formattedValue:e,currentValueIndex:p,formattedValueIndex:m});if(y&&h[m]!==!0){f[p]=m,h[m]=!0;break}}}for(var b=n;b<d&&(f[b]===-1||!o(r[b]));)b++;var E=b===d||f[b]===-1?u:f[b];for(b=n-1;b>0&&f[b]===-1;)b--;var S=b===-1||f[b]===-1?0:f[b]+1;return S>E?E:n-S<E-n?S:E}function sC(e,t,r,n){var i=e.length;if(t=W4e(t,0,i),n==="left"){for(;t>=0&&!r[t];)t--;t===-1&&(t=r.indexOf(!0))}else{for(;t<=i&&!r[t];)t++;t>i&&(t=r.lastIndexOf(!0))}return t===-1&&(t=i),t}function Y4e(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),r=0,n=t.length;r<n;r++)t[r]=!!(S_(e[r])||S_(e[r-1]));return t}function Z4e(e,t,r,n,i,o){o===void 0&&(o=Jc);var s=V4e(function(m,g){var y,b;return B4e(m)?(b="",y=""):typeof m=="number"||g?(b=typeof m=="number"?H4e(m):m,y=n(b)):(b=i(m,void 0),y=n(b)),{formattedValue:y,numAsString:b}}),a=v.useState(function(){return s(C_(e)?t:e,r)}),l=a[0],d=a[1],u=function(m,g){m.formattedValue!==l.formattedValue&&d({formattedValue:m.formattedValue,numAsString:m.value}),o(m,g)},h=e,f=r;C_(e)&&(h=l.numAsString,f=!0);var p=s(h,f);return v.useMemo(function(){d(p)},[p.formattedValue]),[l,u]}function X4e(e){return e.replace(/[^0-9]/g,"")}function J4e(e){return e}function Q4e(e){var t=e.type;t===void 0&&(t="text");var r=e.displayType;r===void 0&&(r="input");var n=e.customInput,i=e.renderText,o=e.getInputRef,s=e.format;s===void 0&&(s=J4e);var a=e.removeFormatting;a===void 0&&(a=X4e);var l=e.defaultValue,d=e.valueIsNumericString,u=e.onValueChange,h=e.isAllowed,f=e.onChange;f===void 0&&(f=Jc);var p=e.onKeyDown;p===void 0&&(p=Jc);var m=e.onMouseUp;m===void 0&&(m=Jc);var g=e.onFocus;g===void 0&&(g=Jc);var y=e.onBlur;y===void 0&&(y=Jc);var b=e.value,E=e.getCaretBoundary;E===void 0&&(E=Y4e);var S=e.isValidInputCharacter;S===void 0&&(S=S_);var k=e.isCharacterSame,A=N4e(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),w=Z4e(b,l,!!d,s,a,u),_=w[0],x=_.formattedValue,C=_.numAsString,P=w[1],I=v.useRef({formattedValue:x,numAsString:C}),O=function(Ce,Pe){I.current={formattedValue:Ce.formattedValue,numAsString:Ce.value},P(Ce,Pe)},D=v.useState(!1),M=D[0],U=D[1],$=v.useRef(null),j=v.useRef({setCaretTimeout:null,focusTimeout:null});v.useEffect(function(){return U(!0),function(){clearTimeout(j.current.setCaretTimeout),clearTimeout(j.current.focusTimeout)}},[]);var q=s,W=function(Ce,Pe){var Ue=parseFloat(Pe);return{formattedValue:Ce,value:Pe,floatValue:isNaN(Ue)?void 0:Ue}},ne=function(Ce,Pe,Ue){Ce.selectionStart===0&&Ce.selectionEnd===Ce.value.length||(oC(Ce,Pe),j.current.setCaretTimeout=setTimeout(function(){Ce.value===Ue&&Ce.selectionStart!==Pe&&oC(Ce,Pe)},0))},ae=function(Ce,Pe,Ue){return sC(Ce,Pe,E(Ce),Ue)},re=function(Ce,Pe,Ue){var z=E(Pe),Q=K4e(Pe,x,Ce,Ue,z,S,k);return Q=sC(Pe,Q,z),Q},_e=function(Ce){var Pe=Ce.formattedValue;Pe===void 0&&(Pe="");var Ue=Ce.input,z=Ce.source,Q=Ce.event,ie=Ce.numAsString,te;if(Ue){var he=Ce.inputValue||Ue.value,ve=r5(Ue);Ue.value=Pe,te=re(he,Pe,ve),te!==void 0&&ne(Ue,te,Pe)}Pe!==x&&O(W(Pe,ie),{event:Q,source:z})};v.useEffect(function(){var Ce=I.current,Pe=Ce.formattedValue,Ue=Ce.numAsString;x!==Pe&&(x!==C||Pe!==Ue)&&O(W(x,C),{event:void 0,source:Cm.props})},[x,C]);var be=$.current?r5($.current):void 0,J=typeof window<"u"?v.useLayoutEffect:v.useEffect;J(function(){var Ce=$.current;if(x!==I.current.formattedValue&&Ce){var Pe=re(I.current.formattedValue,x,be);Ce.value=x,ne(Ce,Pe,x)}},[x]);var xe=function(Ce,Pe,Ue){var z=z4e(x,Ce),Q=Object.assign(Object.assign({},z),{lastValue:x}),ie=a(Ce,Q),te=q(ie);if(ie=a(te,void 0),h&&!h(W(te,ie))){var he=Pe.target,ve=r5(he),Re=re(Ce,x,ve);return he.value=x,ne(he,Re,x),!1}return _e({formattedValue:te,numAsString:ie,inputValue:Ce,event:Pe,
512source:Ue,input:Pe.target}),!0},Ze=function(Ce){var Pe=Ce.target,Ue=Pe.value,z=xe(Ue,Ce,Cm.event);z&&f(Ce)},$e=function(Ce){var Pe=Ce.target,Ue=Ce.key,z=Pe.selectionStart,Q=Pe.selectionEnd,ie=Pe.value;ie===void 0&&(ie="");var te;if(Ue==="ArrowLeft"||Ue==="Backspace"?te=Math.max(z-1,0):Ue==="ArrowRight"?te=Math.min(z+1,ie.length):Ue==="Delete"&&(te=z),te===void 0||z!==Q){p(Ce);return}var he=te;if(Ue==="ArrowLeft"||Ue==="ArrowRight"){var ve=Ue==="ArrowLeft"?"left":"right";he=ae(ie,te,ve),he!==te&&Ce.preventDefault()}else Ue==="Delete"&&!S(ie[te])?he=ae(ie,te,"right"):Ue==="Backspace"&&!S(ie[te])&&(he=ae(ie,te,"left"));he!==te&&ne(Pe,he,ie),Ce.isUnitTestRun&&ne(Pe,he,ie),p(Ce)},Le=function(Ce){var Pe=Ce.target,Ue=function(){var z=Pe.selectionStart,Q=Pe.selectionEnd,ie=Pe.value;if(ie===void 0&&(ie=""),z===Q){var te=ae(ie,z);te!==z&&ne(Pe,te,ie)}};Ue(),requestAnimationFrame(function(){Ue()}),m(Ce)},Fe=function(Ce){Ce.persist&&Ce.persist();var Pe=Ce.target,Ue=Ce.currentTarget;$.current=Pe,j.current.focusTimeout=setTimeout(function(){var z=Pe.selectionStart,Q=Pe.selectionEnd,ie=Pe.value;ie===void 0&&(ie="");var te=ae(ie,z);te!==z&&!(z===0&&Q===ie.length)&&ne(Pe,te,ie),g(Object.assign(Object.assign({},Ce),{currentTarget:Ue}))},0)},ft=function(Ce){$.current=null,clearTimeout(j.current.focusTimeout),clearTimeout(j.current.setCaretTimeout),y(Ce)},Ge=M&&q4e()?"numeric":void 0,Se=Object.assign({inputMode:Ge},A,{type:t,value:x,onChange:Ze,onKeyDown:$e,onMouseUp:Le,onFocus:Fe,onBlur:ft});if(r==="text")return i?Ee.createElement(Ee.Fragment,null,i(x,A)||null):Ee.createElement("span",Object.assign({},A,{ref:o}),x);if(n){var je=n;return Ee.createElement(je,Object.assign({},Se,{ref:o}))}return Ee.createElement("input",Object.assign({},Se,{ref:o}))}function e6e(e){const t=Math.pow(10,e);return function(n){return n?new Intl.NumberFormat("pt-BR",{minimumFractionDigits:e,maximumFractionDigits:e}).format(Number(n)/t):""}}const t6e=v.forwardRef(function(t,r){const{onChange:n,name:i,value:o,decimals:s=2,...a}=t,l=Math.pow(10,s),[d,u]=v.useState(()=>o!=null&&o!==""?String(Math.round(parseFloat(String(o))*l)):"");return v.useEffect(()=>{const h=o!=null&&o!==""?String(Math.round(parseFloat(String(o))*l)):"";d!==h&&u(h)},[o,d,l]),c.jsx(Q4e,{...a,getInputRef:r,format:e6e(s),onValueChange:h=>{const f=h.value||"";u(f),n(f?{target:{name:i,value:String(Number(f)/l)}}:{target:{name:i,value:""}})},value:d,isAllowed:h=>{const{value:f}=h;return f?Number(f)<1e12:!0}})}),n5=v.forwardRef((e,t)=>{const{onChange:r,value:n,decimals:i,...o}=e;return c.jsx(Ci,{...o,ref:t,value:n,InputProps:{inputComponent:t6e,...o.InputProps},onChange:s=>{r&&r(s.target.value)},inputProps:{...o.inputProps,name:o.name||"currencyInput",value:n,inputMode:"numeric",decimals:i}})});var x4={},r6e=zt;Object.defineProperty(x4,"__esModule",{value:!0});var pD=x4.default=void 0,n6e=r6e(Wt()),i6e=c;pD=x4.default=(0,n6e.default)((0,i6e.jsx)("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack");var w4={},o6e=zt;Object.defineProperty(w4,"__esModule",{value:!0});var Tm=w4.default=void 0,s6e=o6e(Wt()),aC=c;Tm=w4.default=(0,s6e.default)([(0,aC.jsx)("path",{d:"M12 5.99 19.53 19H4.47zM12 2 1 21h22z"},"0"),(0,aC.jsx)("path",{d:"M13 16h-2v2h2zm0-6h-2v5h2z"},"1")],"WarningAmber");const Z0=e=>e.toLocaleString("pt-BR",{style:"currency",currency:"BRL"}),lC=({antes:e,depois:t,small:r})=>{const n=t===0,i=r?"0.75rem":"0.8125rem";return e===t?c.jsx(V,{sx:{fontSize:i,color:"text.secondary"},children:Z0(e)}):c.jsxs(me,{direction:"row",spacing:.75,alignItems:"center",flexShrink:0,children:[c.jsx(V,{sx:{fontSize:i,color:"text.secondary",textDecoration:"line-through"},children:Z0(e)}),c.jsx(V,{sx:{fontSize:i,color:"text.secondary"},children:"â"}),c.jsx(V,{sx:{fontSize:i,fontWeight:600,color:n?"warning.main":"text.primary"},children:Z0(t)})]})},cC=({item:e,isVariation:t,isPromoTab:r})=>{const n=r&&e.semAlteracao;return c.jsxs(F,{sx:n?{opacity:.45}:void 0,children:[c.jsxs(me,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{py:t?.25:.5,pl:t?2:0},children:[c.jsx(V,{variant:"body2",fontWeight:t?400:600,color:t?"text.secondary":"text.primary",sx:{flex:1,mr:2,wordBreak:"break-word"},children:e.nome}),c.jsx(me,{direction:"row",spacing:.5,alignItems:"center",flexShrink:0,children:r&&e.semAlteracao?c.jsx(V,{variant:"caption",color:"text.secondary",children:"sem alteração"}):c.jsxs(c.Fragment,{children:[c.jsx(lC,{antes:e.preco_anterior,depois:e.preco_novo,small:t}),r&&e.precoSobe&&c.jsx(Tm,{sx:{fontSize:14,color:"warning.main",ml:.25}})]})})]}),!n&&(e.preco_cheio_anterior!=null||e.preco_cheio_novo!=null)&&c.jsxs(me,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{pl:t?4:2,py:.25},children:[c.jsx(V,{variant:"caption",color:"text.secondary",fontSize:t?"0.7rem":void 0,children:e.promoCriada?"Preço cheio":"Preço regular"}),e.promoRemovida?c.jsx(V,{variant:"caption",color:"warning.main",fontWeight:500,fontSize:t?"0.7rem":void 0,children:"promoção removida"}):e.promoCriada?c.jsx(V,{variant:"caption",color:"text.secondary",fontSize:t?"0.7rem":void 0,children:Z0(e.preco_cheio_novo)}):c.jsx(lC,{antes:e.preco_cheio_anterior,depois:e.preco_cheio_novo,small:!0})]})]})},a6e=({preview:e,subtitle:t,isApplying:r,applyError:n,onBack:i,onApply:o,isPromoTab:s,summaryOverride:a,applyLabel:l})=>{const d=e?e.totalItens-(e.totalSemAlteracao??0):0;return c.jsxs(c.Fragment,{children:[c.jsxs(zr,{sx:{display:"flex",alignItems:"flex-start",ga
512p:1,pb:1},children:[c.jsx(mr,{onClick:i,edge:"start",size:"small",sx:{mt:.25},disabled:r,children:c.jsx(pD,{})}),c.jsxs(F,{children:[c.jsx(V,{variant:"h6",fontWeight:600,children:"Confirmar alterações"}),c.jsx(V,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:t})]})]}),c.jsx(Er,{sx:{px:0},children:c.jsxs(me,{spacing:0,children:[n&&c.jsx(zn,{severity:"error",sx:{mx:3,mb:1.5},children:"Erro ao aplicar alterações. Tente novamente."}),e&&e.precosZero>0&&c.jsx(zn,{severity:"warning",icon:c.jsx(Tm,{fontSize:"small"}),sx:{mx:3,mb:1.5},children:e.precosZero===1?"1 preço ficará R$ 0,00":`${e.precosZero} preços ficarão R$ 0,00`}),s&&e&&(e.totalPrecosSobem??0)>0&&c.jsx(zn,{severity:"warning",icon:c.jsx(Tm,{fontSize:"small"}),sx:{mx:3,mb:1.5},children:e.totalPrecosSobem===1?"1 item terá o preço aumentado (desconto menor que o atual)":`${e.totalPrecosSobem} itens terão o preço aumentado (desconto menor que o atual)`}),c.jsx(F,{sx:{maxHeight:400,overflow:"auto",px:3},children:e==null?void 0:e.produtos.map((u,h)=>c.jsxs(F,{children:[h>0&&c.jsx(Om,{sx:{my:1.5}}),c.jsx(cC,{item:u,isPromoTab:s}),u.variacoes.map(f=>c.jsx(cC,{item:f,isVariation:!0,isPromoTab:s},f.id))]},u.id))}),e&&c.jsx(F,{sx:{px:3,pt:2},children:c.jsx(V,{variant:"caption",color:"text.secondary",fontWeight:500,children:a!==void 0?a:s?c.jsxs(c.Fragment,{children:[d," ",d===1?"item alterado":"itens alterados",(e.totalSemAlteracao??0)>0&&` · ${e.totalSemAlteracao} sem alteração`]}):c.jsxs(c.Fragment,{children:[e.totalProdutos," ",e.totalProdutos===1?"produto":"produtos",e.totalVariacoes>0&&` · ${e.totalVariacoes} ${e.totalVariacoes===1?"variação":"variações"}`,` · ${e.totalItens} itens`]})})})]})}),c.jsxs(nn,{children:[c.jsx(De,{onClick:i,color:"primary",disabled:r,children:"Voltar"}),c.jsx(If,{onClick:o,color:"primary",variant:"contained",loading:r,disabled:s&&d===0,children:l??(s?`Aplicar (${d} itens)`:`Aplicar (${(e==null?void 0:e.totalItens)||0} itens)`)})]})]})},l6e=[{label:"Sem",value:null},{label:",00",value:0},{label:",90",value:90},{label:",99",value:99},{label:"Outro",value:"custom"}],c6e=({roundingSelection:e,customEnding:t,onRoundingChange:r,onCustomEndingChange:n})=>c.jsxs(F,{children:[c.jsx(V,{variant:"subtitle2",fontWeight:600,sx:{mb:1},children:"Terminar em"}),c.jsx(me,{direction:"row",spacing:.75,flexWrap:"wrap",useFlexGap:!0,children:l6e.map(i=>{const o=i.value===null?e===null:i.value==="custom"?e==="custom":e===i.value;return c.jsx(Fn,{label:i.label,size:"small",color:o?"primary":"default",onClick:()=>r(i.value),sx:{fontWeight:500}},String(i.value))})}),e==="custom"&&c.jsxs(me,{direction:"row",alignItems:"center",spacing:1,sx:{mt:1.5},children:[c.jsx(V,{variant:"body2",color:"text.secondary",children:"R$ X ,"}),c.jsx(Ci,{autoFocus:!0,value:t,onChange:i=>{const o=i.target.value.replace(/\D/g,"").slice(0,2);n(o)},variant:"outlined",size:"small",placeholder:"00",sx:{width:72},inputProps:{inputMode:"numeric",maxLength:2}})]})]});function u6e(e,t){if(e===null)return null;if(e==="custom"){const r=parseInt(t,10);return isNaN(r)||r<0||r>99?null:r}return e}function d6e(e,t){if(e!=="custom")return!0;if(t==="")return!1;const r=parseInt(t,10);return!isNaN(r)&&r>=0&&r<=99}const h6e=({open:e,onClose:t,onApply:r,isApplying:n,applyError:i,products:o,selectedIds:s,hasHistory:a,onViewHistory:l})=>{const[d,u]=v.useState("config"),[h,f]=v.useState("aumentar"),[p,m]=v.useState("percentual"),[g,y]=v.useState(""),[b,E]=v.useState(null),[S,k]=v.useState(""),[A,w]=v.useState(!0),_=h==="promocao",x=v.useMemo(()=>o.filter($e=>s.has($e.id)),[o,s]),C=v.useMemo(()=>x.reduce(($e,Le)=>{var ft;const Fe=((ft=Le.produto_variacao)==null?void 0:ft.filter(Ge=>!Ge.deletado_em))||[];return $e+Fe.length},0),[x]),P=v.useMemo(()=>x.some($e=>{var Le;return $e.preco_cheio?!0:(Le=$e.produto_variacao)==null?void 0:Le.some(Fe=>!Fe.deletado_em&&Fe.preco_cheio)}),[x]),I=v.useMemo(()=>parseFloat(g)||0,[g]),O=v.useMemo(()=>u6e(b,S),[b,S]),D=h==="definir"||_?"reais":p,M=v.useMemo(()=>_?{operacao:"promocao",tipoValor:"percentual",valor:I,arredondamento:O,ajustarPrecoCheio:!1}:{operacao:h,tipoValor:D,valor:I,arredondamento:O,ajustarPrecoCheio:A},[_,h,D,I,O,A]),U=v.useMemo(()=>({desconto:I,arredondamento:O}),[I,O]),$=v.useMemo(()=>d6e(b,S)?_?g===""?!1:I>=0&&I<=100:h==="definir"?g!=="":!(I<=0||D==="percentual"&&I>999):!1,[_,h,g,I,D,b,S]),j=v.useMemo(()=>d!=="review"||!$?null:_?I4e(o,s,U):R4e(o,s,M),[d,$,_,o,s,M,U]),q=v.useMemo(()=>
512{if(_){if(I===0)return"Remover promoção";const ft=O!==null?` · arredondar ,${String(O).padStart(2,"0")}`:"";return`Promoção de ${String(I).replace(".",",")}%${ft}`}if(h==="definir"){const ft=`R$ ${I.toFixed(2).replace(".",",")}`,Ge=O!==null?` · arredondar ,${String(O).padStart(2,"0")}`:"";return`Definir ${ft}${Ge}`}const $e=h==="aumentar"?"Aumentar":"Diminuir",Le=D==="reais"?`R$ ${I.toFixed(2).replace(".",",")}`:`${I}%`,Fe=O!==null?` · arredondar ,${String(O).padStart(2,"0")}`:"";return`${$e} ${Le}${Fe}`},[_,h,D,I,O]),W=v.useCallback(()=>{n||(u("config"),f("aumentar"),m("percentual"),y(""),E(null),k(""),w(!0),t())},[n,t]),ne=v.useCallback(()=>u("review"),[]),ae=v.useCallback(()=>u("config"),[]),re=v.useCallback(()=>{j&&r(j,M)},[j,M,r]),_e=v.useCallback(($e,Le)=>{Le!==null&&(f(Le),y(""))},[]),be=v.useCallback(($e,Le)=>{Le!==null&&(m(Le),y(""))},[]),J=v.useCallback($e=>{$e.target.select()},[]),xe=h!=="definir"&&h!=="promocao",Ze=h!=="definir";return c.jsx(Fr,{open:e,onClose:n?void 0:W,maxWidth:"sm",fullWidth:!0,children:d==="config"?c.jsxs(c.Fragment,{children:[c.jsxs(zr,{children:[c.jsx(V,{variant:"h6",fontWeight:600,children:"Alterar preços em lote"}),c.jsxs(me,{direction:"row",alignItems:"center",spacing:.5,sx:{mt:.5},children:[c.jsxs(V,{variant:"body2",color:"text.secondary",children:[s.size," ",s.size===1?"produto":"produtos",C>0&&` · ${C} variações`]}),a&&l&&c.jsxs(c.Fragment,{children:[c.jsx(V,{variant:"body2",color:"text.secondary",children:"·"}),c.jsx(V,{variant:"body2",color:"primary",sx:{cursor:"pointer",fontWeight:500},onClick:()=>{t(),l()},children:"Ver histórico"})]})]})]}),c.jsx(Er,{children:c.jsxs(me,{spacing:2.5,children:[c.jsxs(F,{children:[c.jsx(V,{variant:"subtitle2",fontWeight:600,sx:{mb:1},children:"Operação"}),c.jsxs(A4,{value:h,exclusive:!0,onChange:_e,fullWidth:!0,color:"primary",size:"small",sx:{"& .MuiToggleButton-root":{textTransform:"none",fontWeight:500,py:1}},children:[c.jsx(Ac,{value:"aumentar",children:"Aumentar"}),c.jsx(Ac,{value:"diminuir",children:"Diminuir"}),c.jsx(Ac,{value:"definir",children:"Definir"}),c.jsx(Ac,{value:"promocao",children:"Promoção"})]})]}),c.jsxs(F,{children:[c.jsx(V,{variant:"subtitle2",fontWeight:600,sx:{mb:1},children:_?"Desconto":"Valor"}),c.jsxs(me,{direction:"row",spacing:1.5,alignItems:"flex-start",children:[xe&&c.jsxs(A4,{value:p,exclusive:!0,onChange:be,color:"primary",size:"small",sx:{flexShrink:0,"& .MuiToggleButton-root":{textTransform:"none",fontWeight:500,py:1,px:2}},children:[c.jsx(Ac,{value:"reais",children:"R$"}),c.jsx(Ac,{value:"percentual",children:"%"})]}),_?c.jsx(n5,{autoFocus:!0,value:g,onChange:$e=>y($e),onFocus:J,fullWidth:!0,variant:"outlined",size:"small",placeholder:"0",InputProps:{endAdornment:c.jsx(Us,{position:"end",children:"%"})}}):D==="reais"?c.jsx(n5,{autoFocus:!0,value:g,onChange:$e=>y($e),onFocus:J,fullWidth:!0,variant:"outlined",size:"small",placeholder:"0,00",InputProps:{startAdornment:c.jsx(Us,{position:"start",children:"R$"})}}):c.jsx(n5,{autoFocus:!0,value:g,onChange:$e=>y($e),onFocus:J,fullWidth:!0,variant:"outlined",size:"small",placeholder:"0",InputProps:{endAdornment:c.jsx(Us,{position:"end",children:"%"})}})]}),_&&c.jsxs(c.Fragment,{children:[c.jsx(V,{variant:"caption",color:"text.secondary",sx:{mt:.75,display:"block"},children:"Define o desconto final sobre o preço cheio. 0% remove a promoção."}),P&&g!=="0"&&c.jsx(V,{variant:"caption",color:"primary",sx:{cursor:"pointer",fontWeight:500,mt:.5,display:"inline-block"},onClick:()=>y("0"),children:"Remover promoção de todos"})]})]}
512),Ze&&c.jsx(c6e,{roundingSelection:b,customEnding:S,onRoundingChange:E,onCustomEndingChange:k}),!_&&P&&c.jsxs(F,{children:[c.jsx(V,{variant:"subtitle2",fontWeight:600,sx:{mb:.5},children:"Produtos em promoção"}),c.jsx(V,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:1},children:"Alguns produtos selecionados possuem preço promocional."}),c.jsxs(MD,{value:A?"ambos":"venda",onChange:$e=>w($e.target.value==="ambos"),children:[c.jsx(k4,{value:"ambos",control:c.jsx(R4,{size:"small"}),label:"Ajustar preço regular e promocional"}),c.jsx(k4,{value:"venda",control:c.jsx(R4,{size:"small"}),label:"Ajustar apenas preço promocional"})]})]})]})}),c.jsxs(nn,{children:[c.jsx(De,{onClick:W,color:"primary",children:"Cancelar"}),c.jsx(De,{onClick:ne,color:"primary",variant:"contained",disabled:!$,children:"Ver alterações"})]})]}):c.jsx(a6e,{preview:j,subtitle:q,isApplying:n,applyError:i,onBack:ae,onApply:re,isPromoTab:_})})},f6e=48,p6e=async e=>{if(!e)throw new Error("Usuário não autenticado");const{data:t,error:r}=await Te.from("alteracao_preco_lote").select("*").eq("user_id",e).order("created_at",{ascending:!1}).limit(20);if(r)throw r;return t||[]},eAe=e=>{if(e.desfeito)return!1;const t=new Date(e.created_at).getTime();return(Date.now()-t)/(1e3*60*60)<=f6e},m6e=()=>{const{user:e}=ot(),t=e==null?void 0:e.id;return Et({queryKey:["priceChangeHistory"],queryFn:()=>p6e(t),enabled:!!t})},g6e="/assets/products-BifHjXg4.png";function v6e(){return c.jsxs(me,{alignItems:"center",spacing:1.5,sx:{pt:8,pb:4,px:3},children:[c.jsx(F,{component:"img",src:g6e,alt:"",sx:{height:120,mb:1}}),c.jsx(V,{variant:"subtitle1",fontWeight:600,textAlign:"center",children:"Adicione seu primeiro produto"}),c.jsx(V,{variant:"body2",color:"text.secondary",textAlign:"center",sx:{maxWidth:280},children:"Cadastre um produto para montar seu catálogo e registrar suas primeiras vendas."})]})}var E4={},y6e=zt;Object.defineProperty(E4,"__esModule",{value:!0});var mD=E4.default=void 0,_6e=y6e(Wt()),b6e=c;mD=E4.default=(0,_6e.default)((0,b6e.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");const i5=({options:e,onChange:t,...r})=>{const[n,i]=v.useState(!1),o=()=>i(!0),s=()=>i(!1),a=d=>{const u=h=>{for(const f of h){if(`${f.value}`==`${d}`)return f.label;if(f.subOptions){const p=u(f.subOptions);if(p)return p}}return""};return u(e)},l=(d,u=0)=>d.flatMap(h=>[c.jsxs(Mt,{value:h.value,disabled:h.disabled,children:[c.jsx(St,{primary:h.label,style:{paddingLeft:`${u*1.25}rem`}}),h.subOptions&&h.subOptions.length>0&&c.jsx(Vt,{children:c.jsx(mD,{fontSize:"small"})})]},h.value+""+h.label),...h.subOptions?l(h.subOptions,u+1):[]]);return c.jsx(c.Fragment,{children:c.jsx(X0,{...r,open:n,onOpen:o,onClose:s,renderValue:a,onChange:d=>{const u=d.target.value;t==null||t(u)},MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},...r.MenuProps},children:l(e)})})};function x6e({fabHintText:e,showFabHint:t}){const r=At(),n=()=>{r("/products/create")};return c.jsxs(c.Fragment,{children:[c.jsx(OC,{title:"Novo produto",placement:"left",children:c.jsx(k_,{color:"primary","aria-label":"add product",onClick:n,sx:{position:"fixed",bottom:"calc(var(--safe-area-inset-bottom) + 16px + 56px)",right:16,zIndex:i=>i.zIndex.appBar+1},children:c.jsx(a4,{})})}),c.jsx(l4,{text:e,visible:t,fabBottom:"calc(var(--safe-area-inset-bottom) + 16px + 56px)",fabRight:16})]})}const w6e=async e=>{if(!e)throw new Error("User not authenticated");const{count:t,error:r}=await Te.from("produto").select("*",{count:"exact",head:!0}).eq("user_id",e).is("deletado_em",null).eq("oculto",!1);if(r)throw r;const{count:n,error:i}=await Te.from("produto").select("*",{count:"exact",head:!0}).eq("user_id",e).is("deletado_em",null).eq("oculto",!0).eq("oculto_por_limite",!0);if(i)throw i;return{visibleCount:t||0,hiddenByLimitCount:n||0}},E6e=()=>{const{user:e}=ot(),t=e==null?void 0:e.id,{data:r,isLoading:n,error:i}=Et({queryKey:["products-visibility-count"],queryFn:()=>w6e(t),enabled:!!t});return{visibleCount:(r==null?void 0:r.visibleCount)??0,hiddenByLimitCount:(r==null?void 0:r.hiddenByLimitCount)??0,isLoading:n,error:i}};function uC({variant:e="list",productName:t}){var d;const r=At(),{triggerPaywall:n}=No(),{hiddenByLimitCount:i}=E6e(),{data:o}=an(),s=np(o),a=Hn(o),l=((d=Qn[s])==null?void 0:d.products)||Qn.free.products;return a?null:e==="single"&&t?c.jsxs(_s,{severity:"warning",action:c.jsxs(De,{variant:"contained",size:"small",onClick:()=>n("product_visibility_limit",{pageAction:()=>r("/profile/paywall"),source:"product_page"}),children:["Assinar ",s==="free"?"LITE ou PRO":"PRO"]}),children:[t," está oculto porque você atingiu o limite de ",l," ","produtos visÃveis no plano ",s==="free"?"gratuito":"LITE","."]}):e==="list"&&i>0?c.jsxs(_s,{severity:"warning",sx:{mt:2},children:[i===1?"Foi ocultado 1 produto que ultrapassa o limite":`Foram ocultados ${i} produtos que ultrapassam o limite`," ","do plano ",s==="free"?"gratuito":"LITE","."]}):null}function S6e(e){return ee({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M1.5 1a.5.5 0 0 0-.5.5v3a.5.5 0 0 1-1 0v-3A1.5 1.5 0 0 1 1.5 0h3a.5.5 0 0 1 0 1zM11 .5a.5.5 0 0 1 .5-.5h3A1.5 1.5 0 0 1 16 1.5v3a.5.5 0 0 1-1 0v-3a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 1-.5-.5M.5 11a.5.5 0 0 1 .5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 1 0 1h-3A1.5 1.5 0 0 1 0 14.5v-3a.5.5 0 0 1 .5-.5m15 0a.5.5 0 0 1 .5.5v3a1.5 1.5 0 0 1-1.5 1.5h-3a.5.5 0 0 1 0-1h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 1 .5-.5M3 4.5a.5.5 0 0 1 1 0v7a.5.5 0 0 1-1 0zm2 0a.5.5 0 0 1 1 0v7a.5.5 0 0 1-1 0zm2 0a.5.5 0 0 1 1 0v7a.5.5 0 0 1-1 0zm2 0a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm3 0a.5.5 0 0 1 1 0v7a.5.5 0 0 1-1 0z"},child:[]}]})(e)}const C6e=ni(MC)(()=>({position:"fixed",left:"50%",transform:"translateX(-50%)",width:"calc(100% - 16px)",zIndex:9999})),T6e=()=>{const e=At(),{data:t=[]}=hD(),[r,n]=v.useState({open:!1,message:"",severity:"info"}),i=()=>{n(a=>({...a,open:!1}))},o=(a,l="info")=>{n({open:!0,message:a,severity:l})},s=async()=>{try{const{CapacitorBarcodeScanner:a,CapacitorBarcodeScannerTypeHintALLOption:l,CapacitorBarcodeScannerAndroidScanningLibrary:d}=await X(()=>import("./index-D9stzMVV.js").then(h=>h.i),__vite__mapDeps([37,2]));document.body.classList.add("scanner-active");const u=await a.scanBarcode({android:{scanningLibrary:d.MLKIT},hint:l.ALL});if(document.body.classList.remove("scanner-active"),u.ScanResult){const h=u.ScanResult;if(t&&t.length>0){const f=t.find(p=>p.codigo_de_barras===h);if(f){e(`/products/${f.id}`);return}for(const p of t)if(p.produto_variacao&&p.produto_variacao.length>0&&p.produto_variacao.find(g=>g.codigo_de_barras===h)){e(`/products/${p.id}`);return}}o("Produto não encontrado","error")}}catch(a){if(document.body.classList.remove("scanner-active"),!(a&&a.message&&a.message.toLowerCase().includes("cancelled"))){console.error("Barcode scan error",a);let l="Erro ao ler código de barras.";a&&a.message&&(a.message.toLowerCase().includes("permission")?l="Permissão da câmera negada.":a.message.toLowerCase().includes("not available")&&(l="Scanner não disponÃvel.")),o(l,"error")}}};return qe.isNativePlatform()?c.jsxs(c.Fragment,{children:[c.jsx(mr,{color:"inherit",onClick:s,sx:{ml:1},children:c.jsx(S6e,{})}),c.jsx(C6e,{open:r.open,autoHideDuration:3e3,onClose:i,anchorOrigin:{vertical:"top",horizontal:"center"},children:c.jsx(zn,{onClose:i,severity:r.severity,variant:"filled",elevation:6,sx:{width:"100%"},children:r.message})})]}):null},o5="selectedCategory",Wd=ni($C)(({theme:e})=>({color:"inherit",backgroundColor:gt(e.palette.common.white,.4),borderRadius:e.shape.borderRadius,fontSize:"small","& .MuiInputBase-input":{backgroundColor:gt(e.palette.common.white,.4),padding:e.spacing(1,1,1,0),paddingLeft:`calc(1em + ${e.spacing(4)})`,transition:"width 0.3s ease"}})),qd=ni("div")(({theme:e})=>({position:"absolute",pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",left:e.spacing(2)})),A6e=()=>{const e=At(),[t]=ws(),r=t.get("query")||"",[n,i]=v.useState(()=>{const Ie=t.get("category");return Ie?(localStorage.setItem(o5,Ie),Ie):localStorage.getItem(o5)||"-1"}),o=v.useRef(0),s=v.useRef(null);v.useEffect(()=>{if(t.get("category")){const Ye=new URLSearchParams(t);Ye.delete("category"),e({search:Ye.toString()},{replace:!0})}},[]);const[a,l]=v.useState(new Set),[d,u]=v.useState(!1),[h,f]=v.useState(null),[p,m]=v.useState(null),[g,y]=v.useState(!1),[b,E]=v.useState(!1),[S,k]=v.useState("-2"),[A,w]=v.useState(!1),[_,x]=v.useState(!1),[C,P]=v.useState(!1),[I,O]=v.useState(!1),[D,M]=v.useState([]),[U,$]=v.useState(null),[j,q]=v.useState(null),[W,ne]=v.useState(!1),[ae,re]=v.useState(!1),{data:_e,
512isLoading:be,isError:J}=d$(),{data:xe,isLoading:Ze,isError:$e}=hD({categoryId:Number(n),allCategories:_e}),Le=v.useMemo(()=>xe?r.trim()?xe.filter(Ie=>Ql(r,Ie.nome)||Ql(r,Ie.sku)||Ql(r,Ie.codigo_de_barras)):xe:[],[xe,r]),{data:Fe}=xg(),ft=E4e(),[Ge,Se]=v.useState(null),je=S4e(),Ce=T4e(),Pe=k4e(),Ue=j4e(),{data:z}=m6e(),Q=v.useMemo(()=>!!(z!=null&&z.some(Ie=>!Ie.desfeito)),[z]),{data:ie}=an(),te=Hn(ie),[he,ve]=v.useState(!1),[Re,He]=v.useState(!1),{triggerPaywall:dt}=No(),[N,T]=v.useState(null),{data:R}=c4(),{getPrice:B}=M4e(N),G=v.useMemo(()=>R?R.filter(Ie=>Ie.ativo):[],[R]),le=S3e(BS(J$,{activationConstraint:{distance:5}}),BS(Q$,{activationConstraint:{delay:200,tolerance:5}})),ce=v.useMemo(()=>!_e||!Fe?[]:[...[..._e].sort((Ye,mt)=>Ye.id===-1?-1:mt.id===-1?1:Ye.id===-2?-1:mt.id===-2||Ye.product_count===0&&mt.product_count>0?1:Ye.product_count>0&&mt.product_count===0?-1:Ye.nome.localeCompare(mt.nome))],[_e,Fe]);v.useEffect(()=>{localStorage.setItem(o5,n)},[n]);const Ke=v.useMemo(()=>{var ln,$n;if(!ce)return[];const Ie=($r,pa)=>$r.map(uo=>{var C4,T4;return{...uo,label:`${uo.label} (${((C4=pa.get(uo.value.toString()))==null?void 0:C4.product_count)||0})`,subOptions:uo.subOptions?Ie(uo.subOptions,pa):void 0,disabled:(((T4=pa.get(uo.value.toString()))==null?void 0:T4.product_count)||0)===0}}),Ye=new Map(ce.map($r=>[$r.id.toString(),$r])),mt=tC(ce.slice(2));return[{value:"-1",label:`Todos os produtos (${((ln=ce[0])==null?void 0:ln.product_count)||0})`},{value:"-2",label:`Sem categoria (${(($n=ce[1])==null?void 0:$n.product_count)||0})`},...Ie(mt,Ye)]},[ce]),xt=v.useMemo(()=>{if(!ce)return[];const Ie=tC(ce.slice(2));return[{value:"-2",label:"Sem categoria"},...Ie]},[ce]),vt=v.useMemo(()=>Le||[],[Le]),Rt=v.useMemo(()=>{var Ye;if(!B||!(vt!=null&&vt.length))return null;const Ie=new Map;for(const mt of vt){const ln=B(mt.id,null,mt.preco);let $n=ln.price,$r=ln.price;if(((Ye=mt.produto_variacao)==null?void 0:Ye.length)>0)for(const pa of mt.produto_variacao){if(pa.oculto||pa.deletado_em)continue;const uo=B(mt.id,pa.id,pa.preco);uo.price<$n&&($n=uo.price),uo.price>$r&&($r=uo.price)}Ie.set(mt.id,{min:$n,max:$r})}return Ie},[B,vt]);v.useLayoutEffect(()=>{const Ie=()=>{s.current&&(o.current=s.current.offsetTop)};return Ie(),window.addEventListener("resize",Ie),()=>window.removeEventListener("resize",Ie)},[]);const yt=I?D:vt,Me=v.useCallback(Ie=>Ie?Ie.getBoundingClientRect().height:104,[]),it=x$({count:(yt==null?void 0:yt.length)||0,estimateSize:v.useCallback(()=>104,[]),getItemKey:v.useCallback(Ie=>{var Ye;return((Ye=yt==null?void 0:yt[Ie])==null?void 0:Ye.id)??Ie},[yt]),overscan:5,scrollMargin:o.current,isScrollingResetDelay:150,measureElement:Me}),tr=v.useCallback(Ie=>{i(Ie.toString())},[]),lt=v.useCallback(Ie=>{l(Ye=>{const mt=new Set(Ye);return mt.has(Ie)?mt.delete(Ie):mt.add(Ie),mt})},[]),Ct=Wx(v.useCallback(()=>{Li(),u(!0)},[]),{cancelOnMovement:!0}),Zt=v.useCallback(Ie=>{f(Ie.currentTarget)},[]),pt=v.useCallback(()=>{f(null)},[]),ur=v.useCallback(Ie=>{m(Ie.currentTarget)},[]),Ut=v.useCallback(()=>{m(null)},[]),lr=v.useCallback(()=>{pt(),y(!0)},[pt]),Ln=v.useCallback(()=>{u(!0),Ut()},[Ut]),yr=v.useCallback(()=>{u(!1),l(new Set)},[]),Z=v.useCallback(()=>{const Ie=(Le==null?void 0:Le.map(mt=>mt.id))||[];if(Ie.length>0&&Ie.every(mt=>a.has(mt))){const mt=new Set(a);Ie.forEach(ln=>mt.delete(ln)),l(mt)}else{const mt=new Set(a);Ie.forEach(ln=>mt.add(ln)),l(mt)}},[Le,a]),se=v.useCallback(()=>{const Ie=(Le==null?void 0:Le.map(mt=>mt.id))||[],Ye=Ie.filter(mt=>a.has(mt)).length;return Ye===0?{checked:!1,indeterminate:!1}:Ye===Ie.length?{checked:!0,indeterminate:!1}:{checked:!1,indeterminate:!0}},[Le,a]),de=v.useMemo(()=>!Le||a.size===0?!1:Le.some(Ie=>a.has(Ie.id)&&Ie.oculto),[Le,a]),Ae=v.useCallback(()=>{ft.mutate({product_ids:Array.from(a)},{onError:Ie=>{Se((Ie==null?void 0:Ie.message)||"Erro ao excluir os produtos")}}),y(!1),u(!1),l(new Set)},[ft,a]),Ve=v.useCallback(()=>{pt(),P(!0)},[pt]),Je=v.useCallback(()=>{P(!1)},[]),at=v.useCallback((Ie,Ye)=>{if(!te){dt("bulk_price_change",{pageAction:()=>ve(!0),source:"products_page"});return}Ue.mutate({preview:Ie,config:Ye},{onSuccess:()=>{P(!1),u(!1),l(new Set)}})},[Ue,te,dt]),Qe=v.useCallback(()=>{pt(),E(!0)},[pt]),Xe=v.useCallback(()=>{E(!1),k("-2")},[]),ue=v.useCallback(Ie=>{k(Ie)},[]),ye=v.useCallback(()=>{const Ie=S==="-1"||S==="-2"?null:Number(S);Ce.mutate({product_ids:Array.from(a),categoria_id:Ie},{onSuccess:()=>{E(!1),u(!1),l(new Set),k("-2")}})},[Ce,a,S]),Oe=v.useCallback(()=>{pt(),w(!0)},[pt]),ct=v.useCallback(()=>{pt(),x(!0)},[pt]),Ot=v.useCallback(()=>{Pe.mutate({product_ids:Array.from(a),oculto:!0},{onSuccess:()=>{w(!1),u(!1),l(new Set)}})},[Pe,a]),Be=v.useCallback(()=>{Pe.mutate({product_ids:Array.from(a),oculto:!1},{onSuccess:()=>{x(!1),u(!1),l(new Set)}})},[Pe,a]),Y=v.useCallback(Ie=>{d?lt(Ie):I||e(`/products/${Ie}`)},[d,I,lt,e]),ke=v.useCallback(()=>{r&&e({search:""},{replace:!0}),n!=="-1"&&i("-1"),O(!0),M([...xe||[]]),Ut()},[r,n,xe,e,Ut]),et=v.useCallback(()=>!I||D.length!==vt.length?!1:D.some((Ie,Ye)=>{var mt;return Ie.id!==((mt=vt[Ye])==null?void 0:mt.id)}),[I,D,vt]),Gt=v.useCallback(()=>{et()?re(!0):(O(!1),M([]),$(null))},[et]),gr=v.useCallback(()=>{O(!1),M([]),$(null),re(!1)},[]),rr=v.useCallback(Ie=>{q(Ie.currentTarget)},[]),Yr=v.useCallback(()=>{q(null)},[]),wn=v.useCallback(Ie=>{const Ye=a4e(D,Ie);M(Ye)},[D]),Kn=v.useCallback(Ie=>{$(Ie.active.id.toString()),Li()},[]),Fo=v.useCallback(Ie=>{$(null);const{active:Ye,over:mt}=Ie;if(!mt||!Ye||Ye.id===mt.id)return;const ln=D.findIndex($r=>$r.id.toString()===Ye.id),$n=D.findIndex($r=>$r.id.toString()===mt.id);if(ln!==-1&&$n!==-1){const $r=Lh(D,ln,$n);M($r)}},[D]),kr=v.useCallback(()=>{ne(!0)},[]),$t=v.useCallback(()=>{ne(!1)},[]),_r=v.useCallback(()=>{const Ie=e5(D);je.mutate({products:Ie,originalProducts:xe},{onSuccess:()=>{ne(!1),O(!1),M([])}})},[D,xe,je]),ha=v.useCallback(Ie=>{const Ye=D.findIndex(mt=>mt.id===Ie);if(Ye>0){const mt=Lh(D,Ye,0);M(mt),Li()}},[D]),fl=v.useCallback(Ie=>{const Ye=D.findIndex(mt=>mt.id===Ie);if(Ye!==-1&&Ye<D.length-1){const mt=Lh(D,Ye,D.length-1);M(mt),Li()}},[D]),Lr=v.useCallback(()=>{const Ie=Array.from(a),Ye=(xe==null?void 0:xe.filter($r=>Ie.includes($r.id)))||[],mt=(xe==null?void 0:xe.filter($r=>!Ie.includes($r.id)))||[],ln=[...Ye,...mt],$n=e5(ln);je.mutate({products:$n,originalProducts:xe},{onSuccess:()=>{u(!1),l(new Set),pt(),Li()}})},[a,xe,je,pt]),fa=v.useCallback(()=>{const Ie=Array.from(a),Ye=(xe==null?void 0:xe.filter($r=>!Ie.includes($r.id)))||[],mt=(xe==null?void 0:xe.filter($r=>Ie.includes($r.id)))||[],ln=[...Ye,...mt],$n=e5(ln);je.mutate({products:$n,originalProducts:xe},{onSuccess:()=>{u(!1),l(new Set),pt(),Li()}})},[a,xe,je,pt]),gp=!Ze&&Le&&Le.length<=1&&!r&&n==="-1",e2=Fe===0?"Clique no botão de + para cadastrar produtos":"Continue adicionando seus produtos",SD=yt!=null&&yt.length?
512it.getVirtualItems():[];return c.jsxs(F,{sx:{position:"relative",padding:"16px"},children:[c.jsx(Sc,{title:I?"Reordenar produtos":"Produtos",children:I?c.jsxs(c.Fragment,{children:[c.jsx(mr,{color:"inherit",onClick:Gt,children:c.jsx(vm,{})}),c.jsx(mr,{color:"inherit",onClick:kr,children:c.jsx(R$,{})}),c.jsx(mr,{color:"inherit",onClick:rr,children:c.jsx(Eu,{})})]}):d?c.jsxs(c.Fragment,{children:[c.jsx(mr,{color:"inherit",onClick:yr,children:c.jsx(vm,{})}),c.jsx(mr,{color:"inherit",onClick:Zt,children:c.jsx(Eu,{})})]}):c.jsxs(c.Fragment,{children:[c.jsx(zx,{}),c.jsx(T6e,{}),c.jsx(mr,{color:"inherit",onClick:ur,sx:{ml:1},disabled:!Le||(Le==null?void 0:Le.length)===0,children:c.jsx(Eu,{})})]})}),c.jsx(F,{ref:s,children:Ze?c.jsxs(c.Fragment,{children:[c.jsxs(F,{sx:{display:"flex",gap:1,mb:2,alignItems:"center",flexWrap:"wrap"},children:[ce&&ce.length>0?c.jsxs(F,{sx:{position:"relative"},children:[c.jsx(qd,{children:c.jsx(Ih,{fontSize:"small",sx:{color:"text.secondary"}})}),c.jsx(i5,{options:Ke,value:n,onChange:tr,disabled:be||J||I,sx:{height:"40px",minWidth:"200px"},input:c.jsx(Wd,{})})]}):c.jsx(F,{children:c.jsx(Lt,{variant:"rectangular",height:40,sx:{borderRadius:Ie=>Ie.shape.borderRadius,width:"200px"}},"category-filter-skeleton")},"category-filter-skeleton-container"),G.length>0&&!I&&!d&&c.jsxs(F,{sx:{position:"relative"},children:[c.jsx(qd,{children:c.jsx(G1,{size:20,style:{color:"inherit"}})}),c.jsxs(X0,{value:N??"",onChange:Ie=>T(Ie.target.value===""?null:Number(Ie.target.value)),displayEmpty:!0,sx:{height:"40px",minWidth:"140px"},input:c.jsx(Wd,{}),renderValue:Ie=>{if(!Ie)return"Padrão";const Ye=G.find(mt=>mt.id===Ie);return(Ye==null?void 0:Ye.nome)||"Padrão"},children:[c.jsx(Mt,{value:"",children:"Padrão"}),G.map(Ie=>c.jsx(Mt,{value:Ie.id,children:Ie.nome},Ie.id))]})]})]}),c.jsx(F,{sx:{mb:2},children:c.jsx(uC,{variant:"list"})})]}):c.jsxs(c.Fragment,{children:[((ce==null?void 0:ce.length)>0||G.length>0)&&c.jsxs(F,{sx:{display:"flex",gap:1,mb:2,alignItems:"center",flexWrap:"wrap"},children:[ce&&ce.length>0&&c.jsxs(F,{sx:{position:"relative"},children:[c.jsx(qd,{children:c.jsx(Ih,{fontSize:"small",sx:{color:"text.secondary"}})}),c.jsx(i5,{options:Ke,value:n,onChange:tr,disabled:be||J||I,sx:{height:"40px",minWidth:"200px"},input:c.jsx(Wd,{})})]}),G.length>0&&!I&&!d&&c.jsxs(F,{sx:{position:"relative"},children:[c.jsx(qd,{children:c.jsx(G1,{size:20,style:{color:"inherit"}})}),c.jsxs(X0,{value:N??"",onChange:Ie=>T(Ie.target.value===""?null:Number(Ie.target.value)),displayEmpty:!0,sx:{height:"40px",minWidth:"140px"},input:c.jsx(Wd,{}),renderValue:Ie=>{if(!Ie)return"Padrão";const Ye=G.find(mt=>mt.id===Ie);return(Ye==null?void 0:Ye.nome)||"Padrão"},children:[c.jsx(Mt,{value:"",children:"Padrão"}),G.map(Ie=>c.jsx(Mt,{value:Ie.id,children:Ie.nome},Ie.id))]})]})]}),c.jsx(F,{sx:{mb:2},children:c.jsx(uC,{variant:"list"})})]})}),Ze?c.jsx(me,{spacing:1,sx:{backgroundColor:"background.paper"},children:Array.from({length:10}).map((Ie,Ye)=>c.jsx(Lt,{variant:"rectangular",sx:{borderRadius:1},width:"100%",height:"96px"},`product-list-skeleton-${Ye}`))}):vt&&vt.length>0?c.jsx(bxe,{sensors:le,collisionDetection:A3e,onDragStart:Kn,onDragEnd:Fo,children:c.jsx(zxe,{items:(I?D:vt).map(Ie=>Ie.id.toString()),strategy:Vxe,children:c.jsx(F,{style:{height:`${it.getTotalSize()}px`,width:"100%",position:"relative",contain:I?"none":"layout style paint",willChange:"transform",overflow:"visible"},children:SD.map(Ie=>{var mt,ln,$n;const Ye=yt[Ie.index];return Ye?c.jsx(F,{"data-index":Ie.index,ref:it.measureElement,style:{position:"absolute",display:"flow-root",top:0,left:0,width:"100%",transform:`translateY(${Ie.start-it.options.scrollMargin}px)`,zIndex:U===Ye.id.toString()?9999:"auto"},children:I?c.jsx(r4e,{product:Ye,onClick:()=>Y(Ye.id),sortingEnabled:!0,onMoveToTop:()=>ha(Ye.id),onMoveToBottom:()=>fl(Ye.id)}):c.jsx(p4,{id:Ye.id,hidden:Ye.oculto,isCombo:!!Ye.combo,priceOnRequest:!!Ye.preco_sob_consulta,originalPrice:Ye.preco_cheio??void 0,productName:Ye.nome,categoryName:Ye.categoria_nome,attributes:Ye.uniqueSortedAttributes,price:Ye.price,minPrice:((mt=Rt==null?void 0:Rt.get(Ye.i
512d))==null?void 0:mt.min)??Ye.priceRange.min,maxPrice:((ln=Rt==null?void 0:Rt.get(Ye.id))==null?void 0:ln.max)??Ye.priceRange.max,imageUrl:($n=Ye.image_url)==null?void 0:$n[0],onClick:()=>Y(Ye.id),selectEnabled:d,selected:a.has(Ye.id),longPressEvents:Ct})},Ye.id):null})})})}):c.jsxs(c.Fragment,{children:[$e&&c.jsx(Hl,{primaryText:"Erro ao carregar os produtos"}),!$e&&Le&&Le.length===0&&(r||n!=="-1")&&c.jsx(Hl,{primaryText:"Nenhum produto encontrado",secondaryText:"Tente remover os filtros ou a palavra-chave de busca"}),!$e&&Le&&Le.length===0&&!r&&n==="-1"&&c.jsx(v6e,{})]}),c.jsxs(Ba,{anchorEl:h,open:!!h,onClose:pt,children:[c.jsxs(Mt,{onClick:Z,children:[c.jsx(Vt,{children:c.jsx(pc,{checked:se().checked,indeterminate:se().indeterminate,tabIndex:-1,disableRipple:!0,sx:{p:"0px"}})}),c.jsx(St,{children:"Selecionar todos"})]}),c.jsxs(Mt,{onClick:Lr,disabled:a.size===0,children:[c.jsx(Vt,{children:c.jsx(K0,{})}),c.jsx(St,{children:a.size>0?`Mover para o topo (${a.size})`:"Mover para o topo"})]}),c.jsxs(Mt,{onClick:fa,disabled:a.size===0,children:[c.jsx(Vt,{children:c.jsx(K0,{})}),c.jsx(St,{children:a.size>0?`Mover para o final (${a.size})`:"Mover para o final"})]}),c.jsxs(Mt,{onClick:Qe,disabled:a.size===0,children:[c.jsx(Vt,{children:c.jsx(s3,{})}),c.jsx(St,{children:a.size>0?`Alterar categoria (${a.size})`:"Alterar categoria"})]}),c.jsxs(Mt,{onClick:Ve,disabled:a.size===0,children:[c.jsx(Vt,{children:c.jsx(l3,{})}),c.jsx(St,{children:a.size>0?`Alterar preços (${a.size})`:"Alterar preços"}),c.jsx(ra,{variant:te?"cutout":"contained",fontSize:12,sx:{ml:1}})]}),de?c.jsxs(Mt,{onClick:ct,disabled:a.size===0,children:[c.jsx(Vt,{children:c.jsx(P$,{})}),c.jsx(St,{children:a.size>0?`Desocultar (${a.size})`:"Desocultar"})]}):c.jsxs(Mt,{onClick:Oe,disabled:a.size===0,children:[c.jsx(Vt,{children:c.jsx(I$,{})}),c.jsx(St,{children:a.size>0?`Ocultar (${a.size})`:"Ocultar"})]}),c.jsxs(Mt,{onClick:lr,disabled:a.size===0,children:[c.jsx(Vt,{children:c.jsx(t4,{})}),c.jsx(St,{children:a.size>0?`Excluir (${a.size})`:"Excluir"})]})]}),c.jsxs(Ba,{anchorEl:p,open:!!p,onClose:Ut,children:[c.jsxs(Mt,{onClick:Ln,children:[c.jsx(Vt,{children:c.jsx(Qx,{})}),c.jsx(St,{children:"Selecionar"})]}),c.jsxs(Mt,{onClick:ke,children:[c.jsx(Vt,{children:c.jsx(K0,{})}),c.jsx(St,{children:"Reordenar produtos"})]}),c.jsxs(Mt,{onClick:()=>{if(Ut(),!te){dt("combos",{pageAction:()=>He(!0),source:"products_menu"});return}e("/products/create-combo")},children:[c.jsx(Vt,{children:c.jsx(mse,{size:22})}),c.jsx(St,{children:"Criar combo"}),c.jsx(ra,{variant:te?"cutout":"contained",fontSize:12,sx:{ml:1}})]})]}),c.jsx(l4e,{anchorEl:j,open:!!j,onClose:Yr,onSelectSort:wn}),c.jsx(MC,{open:!!Ge,autoHideDuration:6e3,onClose:()=>Se(null),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:c.jsx(F,{children:c.jsx(_s,{severity:"warning",onClose:()=>Se(null),children:Ge})})}),c.jsxs(Fr,{open:g,onClose:()=>y(!1),children:[c.jsx(zr,{children:"Excluir produtos?"}),c.jsx(Er,{children:c.jsx(vi,{children:`Quer excluir ${a.size} produto(s)?`})}),c.jsxs(nn,{children:[c.jsx(De,{onClick:()=>y(!1),color:"primary",children:"Cancelar"}),c.jsx(De,{onClick:Ae,color:"primary",autoFocus:!0,children:"Confirmar"})]})]}),c.jsxs(Fr,{open:W,onClose:je.isPending?void 0:$t,children:[c.jsx(zr,{children:"Salvar nova ordenação?"}),c.jsxs(Er,{children:[c.jsx(vi,{children:"Isso irá reorganizar todos os produtos na sua loja online."}),c.jsx(vi,{sx:{mt:2,fontWeight:500},children:"Os clientes verão os produtos nesta nova ordem."})]}),c.jsxs(nn,{children:[c.jsx(De,{onClick:$t,color:"primary",disabled:je.isPending,children:"Cancelar"}),c.jsx(De,{onClick:_r,color:"primary",autoFocus:!0,disabled:je.isPending,children:je.isPending?"Salvando...":"Salvar ordem"})]})]}),c.jsxs(Fr,{open:ae,onClose:()=>re(!1),children:[c.jsx(zr,{children:"Descartar alterações?"}),c.jsxs(Er,{children:[c.jsx(vi,{children:"Você fez alterações na ordem dos produtos que não foram salvas."}),c.jsx(vi,{sx:{mt:2},children:"Deseja descartar as alterações?"})]}),c.jsxs(nn,{children:[c.jsx(De,{onClick:()=>re(!1),color:"primary",children:"Continuar editando"}
512),c.jsx(De,{onClick:gr,color:"primary",autoFocus:!0,children:"Descartar"})]})]}),c.jsxs(Fr,{open:b,onClose:Ce.isPending?void 0:Xe,maxWidth:"sm",fullWidth:!0,children:[c.jsx(zr,{children:"Alterar categoria"}),c.jsxs(Er,{children:[c.jsxs(vi,{sx:{mb:2},children:["Selecione a nova categoria para"," ",a.size===1?"1 produto":`${a.size} produtos`,":"]}),c.jsxs(F,{sx:{position:"relative"},children:[c.jsx(qd,{children:c.jsx(Ih,{fontSize:"small",sx:{color:"text.secondary"}})}),c.jsx(i5,{options:xt,value:S,onChange:ue,disabled:Ce.isPending,sx:{height:"40px",minWidth:"100%"},input:c.jsx(Wd,{})})]})]}),c.jsxs(nn,{children:[c.jsx(De,{onClick:Xe,color:"primary",disabled:Ce.isPending,children:"Cancelar"}),c.jsx(De,{onClick:ye,color:"primary",autoFocus:!0,disabled:Ce.isPending,children:Ce.isPending?"Salvando...":"Salvar"})]})]}),c.jsxs(Fr,{open:A,onClose:Pe.isPending?void 0:()=>w(!1),children:[c.jsx(zr,{children:"Ocultar produtos?"}),c.jsxs(Er,{children:[c.jsx(vi,{children:a.size===1?"Deseja ocultar 1 produto?":`Deseja ocultar ${a.size} produtos?`}),c.jsx(vi,{sx:{mt:2},children:"Os produtos ocultos não aparecerão na sua loja online."})]}),c.jsxs(nn,{children:[c.jsx(De,{onClick:()=>w(!1),color:"primary",disabled:Pe.isPending,children:"Cancelar"}),c.jsx(De,{onClick:Ot,color:"primary",autoFocus:!0,disabled:Pe.isPending,children:Pe.isPending?"Ocultando...":"Ocultar"})]})]}),c.jsxs(Fr,{open:_,onClose:Pe.isPending?void 0:()=>x(!1),children:[c.jsx(zr,{children:"Desocultar produtos?"}),c.jsxs(Er,{children:[c.jsx(vi,{children:a.size===1?"Deseja desocultar 1 produto?":`Deseja desocultar ${a.size} produtos?`}),c.jsx(vi,{sx:{mt:2},children:"Os produtos serão exibidos novamente na sua loja online."})]}),c.jsxs(nn,{children:[c.jsx(De,{onClick:()=>x(!1),color:"primary",disabled:Pe.isPending,children:"Cancelar"}),c.jsx(De,{onClick:Be,color:"primary",autoFocus:!0,disabled:Pe.isPending,children:Pe.isPending?"Desocultando...":"Desocultar"})]})]}),c.jsx(h6e,{open:C,onClose:Je,onApply:at,isApplying:Ue.isPending,applyError:Ue.isError,products:Le||[],selectedIds:a,hasHistory:Q,onViewHistory:()=>e("/general/price-changes")}),c.jsx(Ef,{open:he,onClose:()=>ve(!1),title:"Alteração de preços em lote",description:"Altere os preços de vários produtos de uma vez. Aumente, diminua ou defina um valor fixo para todos os itens selecionados.",planSuggestion:"pro"}),c.jsx(Ef,{open:Re,onClose:()=>He(!1),title:"Combos de produtos",description:"Venda kits com preço próprio. O estoque do combo vem dos produtos que o compõem, sem controle duplicado.",planSuggestion:"pro"}),!I&&c.jsx(x6e,{fabHintText:e2,showFabHint:!!gp})]})},gD="/assets/gift_box-Bm1IleDP.png";function tAe(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10 9m0 1.105a1.105 1.105 0 0 1 1.105 -1.105h1.79a1.105 1.105 0 0 1 1.105 1.105v9.79a1.105 1.105 0 0 1 -1.105 1.105h-1.79a1.105 1.105 0 0 1 -1.105 -1.105z"},child:[]},{tag:"path",attr:{d:"M17 3m0 1.105a1.105 1.105 0 0 1 1.105 -1.105h1.79a1.105 1.105 0 0 1 1.105 1.105v15.79a1.105 1.105 0 0 1 -1.105 1.105h-1.79a1.105 1.105 0 0 1 -1.105 -1.105z"},child:[]},{tag:"path",attr:{d:"M5 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]}]})(e)}function k6e(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15h-2.5c-.398 0 -.779 .158 -1.061 .439c-.281 .281 -.439 .663 -.439 1.061c0 .398 .158 .779 .439 1.061c.281 .281 .663 .439 1.061 .439h1c.398 0 .779 .158 1.061 .439c.281 .281 .439 .663 .439 1.061c0 .398 -.158 .779 -.439 1.061c-.281 .281 -.663 .439 -1.061 .439h-2.5"},child:[]},{tag:"path",attr:{d:"M19 21v1m0 -8v1"},child:[]},{tag:"path",attr:{d:"M13 21h-7c-.53 0 -1.039 -.211 -1.414 -.586c-.375 -.375 -.586 -.884 -.586 -1.414v-10c0 -.53 .211 -1.039 .586 -1.414c.375 -.375 .884 -.586 1.414 -.586h2m12 3.12v-1.12c0 -.53 -.211 -1.039 -.586 -1.414c-.375 -.375 -.884 -.586 -1.414 -.586h-2"},child:[]},{tag:"path",attr:{d:"M16 10v-6c0 -.53 -.211 -1.039 -.586 -1.414c-.375 -.375 -.884 -.586 -1.414 -.586h-4c-.53 0 -1.039 .211 -1.414 .586c-.375 .375 -.586 .884 -.586 1.414v6m8 0h-8m8 0h1m-9 0h-1"},child:[]},{tag:"path",attr:{d:"M8 14v.01"},child:[]},{tag:"path",attr:{d:"M8 17v.01"},child:[]},{tag:"path",attr:{d:"M12 13.99v.01"},child:[]},{tag:"path",attr:{d:"M12 17v.01"},child:[]}]})(e)}function rAe(e){return ee({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}
512,child:[{tag:"path",attr:{d:"M19.875 12c.621 0 1.125 .512 1.125 1.143v5.714c0 .631 -.504 1.143 -1.125 1.143h-15.875a1 1 0 0 1 -1 -1v-5.857c0 -.631 .504 -1.143 1.125 -1.143h15.75z"},child:[]},{tag:"path",attr:{d:"M9 12v2"},child:[]},{tag:"path",attr:{d:"M6 12v3"},child:[]},{tag:"path",attr:{d:"M12 12v3"},child:[]},{tag:"path",attr:{d:"M18 12v3"},child:[]},{tag:"path",attr:{d:"M15 12v2"},child:[]},{tag:"path",attr:{d:"M3 3v4"},child:[]},{tag:"path",attr:{d:"M3 5h18"},child:[]},{tag:"path",attr:{d:"M21 3v4"},child:[]}]})(e)}const R6e={"/profile/fiscal":"fiscal_menu","/coupons":"coupons","/reports/analytics":"analytics_advanced","/contas-a-pagar":"contas_a_pagar","/general/product-labels":"product_labels","/price-tables":"price_tables","/customers/import":"bulk_import_customers","/customers/contacts-import":"contacts_import","/products/import":"bulk_import_products","/export-catalog":"catalog_pdf","/reviews":"reviews","/abandoned-carts":"abandoned_carts"},Am=e=>R6e[e]??"menu",nAe=64,I6e=52,iAe=20,oAe=24,m0=22,P6e={fontSize:"1rem",fontWeight:600,lineHeight:1.5},O6e={fontSize:"0.75rem",fontWeight:600,color:"text.secondary",display:"block",ml:.5,mb:1},j6e={fontSize:"0.7rem",fontWeight:500,letterSpacing:.3,color:"text.secondary",display:"block"},L6e=e=>gt(e,.35),$6e=20,D6e=16,sAe={success:{dot:"#22B45D",text:G0.success.textColor},warning:{dot:"#DD8B0A",text:G0.warning.textColor},neutral:{dot:"#9AA3AF",text:"text.secondary"},error:{dot:"#E5484D",text:G0.error.textColor}},M6e=()=>{const e=At(),{triggerPaywall:t}=No(),{data:r,isLoading:n}=an();if(n||wL(r))return null;const i=()=>{pe(fe.NAVIGATION.BUTTON_CLICK,{button_name:"Assine o Stoqui",location:"desktop_drawer",route:"/profile/paywall",section:"subscription",is_pro_only:!1,is_black_only:!1,is_support:!1,is_whatsapp:!1,is_help_center:!1,is_external_link:!1,subscription_status:"free",action:"subscribe"}),t("subscription",{pageAction:()=>e("/profile/paywall"),source:"desktop_drawer"})};return c.jsxs(F,{sx:{mx:1.5,mt:1.5,p:1.75,borderRadius:"12px",background:o=>`linear-gradient(135deg, ${o.palette.primary.dark} 0%, ${o.palette.primary.main} 100%)`,color:"white"},children:[c.jsxs(me,{direction:"row",alignItems:"center",spacing:.75,sx:{mb:.5},children:[c.jsx(Ol,{size:18,color:"#FFBB00"}),c.jsx(V,{sx:{fontSize:15,fontWeight:700},children:"Assine o Stoqui"})]}),c.jsx(V,{sx:{fontSize:12,lineHeight:1.4,color:gt("#FFFFFF",.85),mb:1.5},children:"Produtos ilimitados, cupons, relatórios e mais."}),c.jsx(De,{fullWidth:!0,variant:"contained",onClick:i,sx:{bgcolor:"white",color:"primary.dark",borderRadius:"8px",py:.75,fontSize:14,fontWeight:700,textTransform:"none",boxShadow:"none","&:hover":{bgcolor:gt("#FFFFFF",.9),boxShadow:"none"}},children:"Ver planos"})]})},N6e={home_layout:"2026-10-31",category_media:"2026-10-31",chrome_colors:"2026-10-31"};function F6e(e,t=new Date){const r=N6e[e],[n,i,o]=r.split("-").map(Number),s=new Date(n,i-1,o,23,59,59,999);return t.getTime()<=s.getTime()}function aAe(e){return ee({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 0 1 1.141.195v3.325a8.623 8.623 0 0 0-.653-.036 26.805 26.805 0 0 0-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 0 0-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 2.103-.287 1.564h-3.246v8.245C19.396 23.238 24 18.179 24 12.044c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.628 3.874 10.35 9.101 11.647Z"},child:[]}]})(e)}function lAe(e){return ee({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M7.0301.084c-1.2768.0602-2.1487.264-2.911.5634-.7888.3075-1.4575.72-2.1228 1.3877-.6652.6677-1.075 1.3368-1.3802 2.127-.2954.7638-.4956 1.6365-.552 2.914-.0564 1.2775-.0689 1.6882-.0626 4.947.0062 3.2586.0206 3.6671.0825 4.9473.061 1.2765.264 2.1482.5635 2.9107.308.7889.72 1.4573 1.388 2.1228.6679.6655 1.3365 1.0743 2.1285 1.38.7632.295 1.6361.4961 2.9134.552 1.2773.056 1.6884.069 4.9462.0627 3.2578-.0062 3.668-.0207 4.9478-.0814 1.28-.0607 2.147-.2652 2.9098-.5633.7889-.3086 1.4578-.72 2.1228-1.3881.665-.6682 1.0745-1.3378 1.3795-2.1284.2957-.7632.4966-1.636.552-2.9124.056-1.2809.0692-1.6898.063-4.948-.0063-3.2583-.021-3.6668-.0817-4.9465-.0607-1.2797-.264-2.1487-.5633-2.9117-.3084-.7889-.72-1.4568-1.3876-2.1228C21.2982 1.33 20.628.9208 19.8378.6165 19.074.321 18.2017.1197 16.9244.0645 15.6471.0093 15.236-.005 11.977.0014 8.718.0076 8.31.0215 7.0301.0839m.1402 21.6932c-1.17-.0509-1.8053-.2453-2.2287-.408-.5606-.216-.96-.4771-1.3819-.895-.422-.4178-.6811-.8186-.9-1.378-.1644-.4234-.3624-1.058-.4171-2.228-.0595-1.2645-.072-1.6442-.079-4.848-.00
5127-3.2037.0053-3.583.0607-4.848.05-1.169.2456-1.805.408-2.2282.216-.5613.4762-.96.895-1.3816.4188-.4217.8184-.6814 1.3783-.9003.423-.1651 1.0575-.3614 2.227-.4171 1.2655-.06 1.6447-.072 4.848-.079 3.2033-.007 3.5835.005 4.8495.0608 1.169.0508 1.8053.2445 2.228.408.5608.216.96.4754 1.3816.895.4217.4194.6816.8176.9005 1.3787.1653.4217.3617 1.056.4169 2.2263.0602 1.2655.0739 1.645.0796 4.848.0058 3.203-.0055 3.5834-.061 4.848-.051 1.17-.245 1.8055-.408 2.2294-.216.5604-.4763.96-.8954 1.3814-.419.4215-.8181.6811-1.3783.9-.4224.1649-1.0577.3617-2.2262.4174-1.2656.0595-1.6448.072-4.8493.079-3.2045.007-3.5825-.006-4.848-.0608M16.953 5.5864A1.44 1.44 0 1 0 18.39 4.144a1.44 1.44 0 0 0-1.437 1.4424M5.8385 12.012c.0067 3.4032 2.7706 6.1557 6.173 6.1493 3.4026-.0065 6.157-2.7701 6.1506-6.1733-.0065-3.4032-2.771-6.1565-6.174-6.1498-3.403.0067-6.156 2.771-6.1496 6.1738M8 12.0077a4 4 0 1 1 4.008 3.9921A3.9996 3.9996 0 0 1 8 12.0077"},child:[]}]})(e)}function cAe(e){return ee({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"},child:[]}]})(e)}function dC(e){return ee({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"},child:[]}]})(e)}const U6e=e=>c.jsxs(Pn,{...e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c.jsx("path",{d:"M19.875 21.7501V4.75706C19.875 3.64906 19.068 2.70006 17.968 2.57206C14.2518 2.14069 10.4982 2.14069 6.782 2.57206C5.681 2.70006 4.875 3.64906 4.875 4.75706V21.7501L8.625 20.2501L12.375 21.7501L16.125 20.2501L19.875 21.7501Z",stroke:"currentColor",fill:"none",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),c.jsx("path",{d:"M11.9007 11C12.113 11 12.2871 11.0648 12.4059 11.2065C12.5276 11.3462 12.5828 11.5424 12.5829 11.7803V16.2438C12.5828 16.4612 12.5331 16.6461 12.4248 16.789L12.4237 16.7901C12.3128 16.9304 12.1611 17 11.9786 17C11.8096 17 11.6646 16.9654 11.5524 16.8882L11.5479 16.8848C11.45 16.8079 11.3482 16.6933 11.243 16.5449L9.36997 13.8495V16.2106C9.36997 16.4522 9.31606 16.65 9.19525 16.7901L9.19636 16.7913C9.07739 16.9345 8.90235 17 8.68889 17C8.47523 17 8.2991 16.9351 8.17584 16.7936C8.05378 16.6533 8 16.4535 8 16.2106V11.8213C8 11.5736 8.05399 11.3699 8.17472 11.2247C8.29436 11.0753 8.45423 11 8.6466 11C8.80693 11 8.94435 11.0346 9.04835 11.1141C9.14309 11.1867 9.24283 11.303 9.34772 11.4562L11.2196 14.1403V11.7803C11.2197 11.5433 11.2715 11.3486 11.3876 11.2087L11.3888 11.2065C11.5119 11.0652 11.6874 11.0001 11.9007 11ZM16.4101 11.073C16.5941 11.0731 16.7468 11.1267 16.852 11.2475C16.9548 11.3657 17 11.5291 17 11.7243C17 11.9245 16.9557 12.0928 16.8541 12.216L16.852 12.2171C16.7468 12.338 16.5941 12.3915 16.4101 12.3916H14.7764V13.3601H16.2554C16.4351 13.3601 16.5847 13.414 16.6895 13.5335L16.7595 13.6305C16.8188 13.7357 16.8464 13.8653 16.8464 14.0126C16.8463 14.2124 16.7974 14.3778 16.6895 14.4963L16.6906 14.4973C16.5858 14.6176 16.4357 14.6719 16.2554 14.6719H14.7764V16.1468C14.7764 16.4121 14.7221 16.6277 14.5973 16.7776C14.4701 16.93 14.2827 17 14.053 17C13.8288 17 13.6428 16.9287 13.5066 16.7788L13.5044 16.7753C13.3746 16.6199 13.3152 16.4064 13.3152 16.1468V11.9251C13.3152 11.6659 13.3744 11.454 13.5055 11.3035C13.6425 11.146 13.8367 11.073 14.0742 11.073H16.4101Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"0.15"})]}),B6e=e=>c.jsxs(Pn,{...e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c.jsx("path",{d:"M17.7059 3H6.29412C4.89053 3.00164 3.5449 3.56294 2.55242 4.56076C1.55993 5.55858 1.00163 6.91145 1 8.32258V16.0108C1.00163 17.4219 1.55993 18.7747 2.55242 19.7726C3.5449 20.7704 4.89053 21.3317 6.29412 21.3333H14.8824C14.9961 21.3333 15.109 21.3147 15.2168 21.2783C17.6547 20.4613 22.1326 15.9558 22.9453 13.5083C22.9815 13.3999 23 13.2864 23 13.172V8.32258C22.9984 6.91145 22.4401 5.55858 21.4476 4.56076C20.4551 3.56294 19.1095 3.00164 17.7059 3ZM3.11765 16.0108V8.32258C3.11765 7.4756 3.45231 6.66331 4.04801 6.0644C4.64372 5.46549 5.45167 5.12903 6.29412 5.12903H17.7059C18.5483 5.12903 19.3563 5.46549 19.952 6.0644C20.5477 6.66331 20.8824 7.4756 20.8824 8.32258V12.1075H19.1176C17.7141 12.1092 16.3684 12.6705 15.3759 13.6683C14.3835 14.6661 13.8252 16.019 13.8235 17.4301V19.2043H6.29412C5.45167 19.2043 4.64372 18.8678 4.04801 18.2689C3.45231 17.67 3.11765 16.8577 3.11765 16.0108ZM15.9412 18.4618V17.4301C15.9412 16.5831 16.2758 15.7708 16.8715 15.1719C17.4672 14.573
51218.2752 14.2366 19.1176 14.2366H20.1438C19.1176 15.6657 17.3626 17.4301 15.9412 18.4618Z",fill:"currentColor"}),c.jsx("path",{d:"M5.9268 8.05762C5.60897 8.05762 5.35327 8.26102 5.35327 8.51384V16.1175C5.35327 16.3703 5.60897 16.5737 5.9268 16.5737H6.30915C6.62698 16.5737 6.88268 16.3703 6.88268 16.1175V8.51384C6.88268 8.26102 6.62698 8.05762 6.30915 8.05762H5.9268ZM8.02974 8.05762C7.81945 8.05762 7.64739 8.19448 7.64739 8.36176V16.2696C7.64739 16.4369 7.81945 16.5737 8.02974 16.5737C8.24004 16.5737 8.4121 16.4369 8.4121 16.2696V8.36176C8.4121 8.19448 8.24004 8.05762 8.02974 8.05762ZM9.75033 8.05762C9.4325 8.05762 9.1768 8.26102 9.1768 8.51384V16.1175C9.1768 16.3703 9.4325 16.5737 9.75033 16.5737H10.1327C10.4505 16.5737 10.7062 16.3703 10.7062 16.1175V8.51384C10.7062 8.26102 10.4505 8.05762 10.1327 8.05762H9.75033ZM12.0444 8.05762C11.7266 8.05762 11.4709 8.26102 11.4709 8.51384V16.1175C11.4709 16.3703 11.7266 16.5737 12.0444 16.5737H12.4268C12.7446 16.5737 13.0003 16.3703 13.0003 16.1175V8.51384C13.0003 8.26102 12.7446 8.05762 12.4268 8.05762H12.0444ZM16.0592 8.51384V11.5512C16.0592 11.804 16.3149 12.0074 16.6327 12.0074H17.015C17.3329 12.0074 17.5886 11.804 17.5886 11.5512V8.51384C17.5886 8.26102 17.3329 8.05762 17.015 8.05762H16.6327C16.3149 8.05762 16.0592 8.26102 16.0592 8.51384ZM14.5297 8.36176V12.9578C14.5297 13.1251 14.7018 13.2619 14.9121 13.2619C15.1224 13.2619 15.2944 13.1251 15.2944 12.9578V8.36176C15.2944 8.19448 15.1224 8.05762 14.9121 8.05762C14.7018 8.05762 14.5297 8.19448 14.5297 8.36176Z",fill:"currentColor"})]}),V6e=e=>c.jsx(Pn,{...e,viewBox:"0 0 12 12",children:c.jsx("path",{d:"M1.5 1C1.22386 1 1 1.22386 1 1.5C1 1.77614 1.22386 2 1.5 2V1.5V1ZM2.5 1.5L2.99029 1.40194C2.94355 1.16823 2.73834 1 2.5 1V1.5ZM8.5 6.5V7C8.68939 7 8.86252 6.893 8.94721 6.72361L8.5 6.5ZM10.5 2.5L10.9472 2.72361C11.0247 2.56861 11.0164 2.38454 10.9253 2.23713C10.8342 2.08973 10.6733 2 10.5 2V2.5ZM4.5 9.5H4H4.5ZM2.5 9.5H2H2.5ZM7 4L7.35355 4.35355L7.57206 4.13505L7.47434 3.84189L7 4ZM6 5L5.64645 4.64645L5.42794 4.86495L5.52566 5.15811L6 5ZM1.5 1.5V2H2.5V1.5V1H1.5V1.5ZM2.5 1.5L2.00971 1.59806L2.20971 2.59806L2.7 2.5L3.19029 2.40194L2.99029 1.40194L2.5 1.5ZM3.5 6.5V7H8.5V6.5V6H3.5V6.5ZM8.5 6.5L8.94721 6.72361L10.9472 2.72361L10.5 2.5L10.0528 2.27639L8.05279 6.27639L8.5 6.5ZM3.5 6.5L3.99029 6.40194L3.19029 2.40194L2.7 2.5L2.20971 2.59806L3.00971 6.59806L3.5 6.5ZM3.5 6.5L3.14645 6.14645L1.99995 7.29295L2.3535 7.6465L2.70705 8.00005L3.85355 6.85355L3.5 6.5ZM2.3535 7.6465L1.99995 7.29295C1.37003 7.92286 1.81596 9 2.707 9V8.5V8L2.70705 8.00005L2.3535 7.6465ZM2.707 8.5V9H8.5V8.5V8H2.707V8.5ZM8.5 8.5V8C8.10217 8 7.72064 8.15804 7.43934 8.43934L7.79289 8.79289L8.14645 9.14645C8.24022 9.05268 8.36739 9 8.5 9V8.5ZM7.79289 8.79289L7.43934 8.43934C7.15804 8.72064 7 9.10217 7 9.5H7.5H8C8 9.36739 8.05268 9.24022 8.14645 9.14645L7.79289 8.79289ZM7.5 9.5H7C7 9.89783 7.15804 10.2794 7.43934 10.5607L7.79289 10.2071L8.14645 9.85355C8.05268 9.75978 8 9.63261 8 9.5H7.5ZM7.79289 10.2071L7.43934 10.5607C7.72064 10.842 8.10217 11 8.5 11V10.5V10C8.36739 10 8.24022 9.94732 8.14645 9.85355L7.79289 10.2071ZM8.5 10.5V11C8.89783 11 9.27936 10.842 9.56066 10.5607L9.20711 10.2071L8.85355 9.85355C8.75978 9.94732 8.63261 10 8.5 10V10.5ZM9.20711 10.2071L9.56066 10.5607C9.84196 10.2794 10 9.89783 10 9.5H9.5H9C9 9.63261 8.94732 9.75978 8.85355 9.85355L9.20711 10.2071ZM9.5 9.5H10C10 9.10217 9.84196 8.72064 9.56066 8.43934L9.20711 8.79289L8.85355 9.14645C8.94732 9.24022 9 9.36739 9 9.5H9.5ZM9.20711 8.79289L9.56066 8.43934C9.27936 8.15804 8.89783 8 8.5 8V8.5V9C8.63261 9 8.75978 9.05268 8.85355 9.14645L9.20711 8.79289ZM4.5 9.5H4C4 9.63261 3.94732 9.75978 3.85355 9.85355L4.20711 10.2071L4.56066 10.5607C4.84196 10.2794 5 9.89783 5 9.5H4.5ZM4.20711 10.2071L3.85355 9.85355C3.75978 9.94732 3.63261 10 3.5 10V10.5V11C3.89783 11 4.27936 10.842 4.56066 10.5607L4.20711 10.2071ZM3.5 10.5V10C3.36739 10 3.24021 9.94732 3.14645 9.85355L2.79289 10.2071L2.43934 10.5607C2.72064 10.842 3.10217 11 3.5 11V10.5ZM2.79289 10.2071L3.14645 9.85355C3.05268 9.75978 3 9.63261 3 9.5H2.5H2C2 9.89783 2.15804 10.2794 2.43934 10.5607L2.79289 10.2071ZM2.5 9.5H3C3 9.36739 3.05268 9.24021 3.14645 9.14645L2.79289 8.79289L2.43934 8.43934C2.15804 8.72064 2 9.10218 2 9.5H2.5ZM2.79289 8.79289L3.14645 9.14645C3.24021 9.05268 3.36739 9 3.5 9V8.5V8C3.10217 8 2.72064 8.15804 2.43934 8.43934L2.79289 8.79289ZM3.5 8.5V9C3.63261 9 3.75978 9.05268 3.85355 9.14645L4.20711 8.79289L4.56066 8.43934C4.27936 8.15804 3.89783 8 3.5 8V8.5ZM4.20711 8.79289L3.85355 9.14645C3.94732 9.24022 4 9.36739 4 9.5H4.5H5C5 9.10217 4.84196 8.72064 4.56066 8.43934L4.20711 8.79289ZM10.5 2.5V2H6.5V2.5V3H10.5V2.5ZM6.5 2.5V2H2.7V2.5V3H6.5V2.5ZM7 4L7.47434 3.84189L6.97434 2.34189L6.5 2.5L6.02566 2.65811L6.52566 4.15811L7 4ZM7 4L6.64645 3.64645L5.64645 4.64645L6 5L6.35355 5.35355L7.35355 4.35355L7 4ZM6 5L5.52566 5.15811L6.02566 6.65811L6.5 6.5L6.97434
5126.34189L6.47434 4.84189L6 5Z"})}),H6e="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15.8301%208.63363C16.3081%208.35704%2016.9198%208.52035%2017.1964%208.99839C17.7077%209.88203%2018%2010.9082%2018%2011.9996C18%2013.091%2017.7077%2014.1172%2017.1964%2015.0008C16.9198%2015.4788%2016.3081%2015.6421%2015.8301%2015.3656C15.352%2015.089%2015.1887%2014.4772%2015.4653%2013.9992C15.8052%2013.4118%2016%2012.73%2016%2011.9996C16%2011.2692%2015.8052%2010.5874%2015.4653%209.99999C15.1887%209.52196%2015.352%208.91022%2015.8301%208.63363ZM8.16995%208.63363C8.64798%208.91022%208.81129%209.52196%208.5347%209.99999C8.19484%2010.5874%208%2011.2692%208%2011.9996C8%2012.73%208.19484%2013.4118%208.5347%2013.9992C8.81129%2014.4772%208.64798%2015.089%208.16995%2015.3656C7.69191%2015.6421%207.08017%2015.4788%206.80358%2015.0008C6.29231%2014.1172%206%2013.091%206%2011.9996C6%2010.9082%206.29231%209.88203%206.80358%208.99839C7.08017%208.52035%207.69191%208.35704%208.16995%208.63363Z'%20fill='black'%20/%3e%3cpath%20d='M13.5%2012C13.5%2012.8284%2012.8284%2013.5%2012%2013.5C11.1716%2013.5%2010.5%2012.8284%2010.5%2012C10.5%2011.1716%2011.1716%2010.5%2012%2010.5C12.8284%2010.5%2013.5%2011.1716%2013.5%2012Z'%20fill='black'%20/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5.33243%2016.4826L5.09622%2017.2728C4.86428%2018.0487%204.62086%2018.8707%204.41748%2019.5825C5.12931%2019.3791%205.95126%2019.1357%206.72722%2018.9038L7.51743%2018.6676L8.24444%2019.057C9.36447%2019.6571%2010.6412%2020%2012%2020C16.4154%2020%2020%2016.4154%2020%2012C20%207.58457%2016.4154%204%2012%204C7.58457%204%204%207.58457%204%2012C4%2013.3588%204.34295%2014.6355%204.94296%2015.7556L5.33243%2016.4826ZM3.18%2016.7C2.63%2018.54%202%2020.69%202%2021C2%2021.55%202.45%2022%203%2022C3.31%2022%205.46%2021.37%207.3%2020.82C8.7%2021.57%2010.3%2022%2012%2022C17.52%2022%2022%2017.52%2022%2012C22%206.48%2017.52%202%2012%202C6.48%202%202%206.48%202%2012C2%2013.7%202.43%2015.3%203.18%2016.7Z'%20fill='black'%20/%3e%3c/svg%3e",z6e="#25D366",W6e="#FF0000",q6e="invert(64%) sepia(98%) saturate(451%) hue-rotate(87deg) brightness(92%) contrast(86%)",km=[{title:"Configurações",items:[{label:"Personalizar loja",icon:c.jsx(gse,{}),route:"/profile/store-appearance",isNew:F6e("home_layout")},{label:"Configurar loja",icon:c.jsx(hse,{}),route:"/profile/web-catalog"},{label:"Opções de entrega",icon:c.jsx(Jj,{}),route:"/profile/shipping"},{label:"Meios de pagamento",icon:c.jsx(Pl,{}),route:"/profile/payments"},{label:"Nota fiscal",icon:c.jsx(U6e,{}),route:"/profile/fiscal",blackOnly:!0},{label:"Preferências do app",icon:c.jsx(ase,{}),route:"/profile/app-preferences"},{label:"Gerenciar assinatura",icon:c.jsx(MI,{}),route:"/profile/subscription",subscribedOnly:!0,hideInGeneral:!0}]},{title:"Promoções",items:[{label:"Cupons de desconto",icon:c.jsx(l3,{}),route:"/coupons",proOnly:!0}]},{title:"Vendas",items:[{label:"Pedidos",icon:c.jsx(Fg,{}),route:"/orders",hideInDrawer:!0},{label:"Relatórios",icon:c.jsx($I,{}),route:"/reports"},{label:"Analytics",icon:c.jsx(bM,{}),route:"/reports/analytics",blackOnly:!0},{label:"Contas a receber",icon:c.jsx(TL,{}),route:"/contas-a-receber"},{label:"Contas a pagar",icon:c.jsx(h_,{}),route:"/contas-a-pagar",isNew:!0,proOnly:!0,allowRoute:!0},{label:"Carrinhos abandonados",icon:c.jsx(V6e,{}),route:"/abandoned-carts",blackOnly:!0,allowRoute:!0}]},{title:"Relacionamento",items:[{label:"Clientes",icon:c.jsx(c3,{}),route:"/customers"},{label:"Conversas",icon:c.jsx(Ime,{}),route:"/chats"},{label:"Importação de clientes",icon:c.jsx(AE,{}),route:"/customers/import",proOnly:!0},{label:"Importar dos contatos",icon:c.jsx(BC,{}),route:"/customers/contacts-import",proOnly:!0,nativeOnly:!0,hideInGeneral:!0},{label:"Fornecedores",icon:c.jsx(E1e,{}),route:"/suppliers"}]},{title:"Produtos",items:[{label:"Produtos",icon:c.jsx(Fs,{}),route:"/products",hideInDrawer:!0},{label:"Estoque",icon:c.jsx(c$,{}),route:"/stock"},{label:"Categorias",icon:c.jsx(s3,{}),route:"/categories"},{label:"Atributos da grade",icon:c.jsx(xM,{}),route:"/attributes"},{label:"Importação de produtos",icon:c.jsx(AE,{}),route:"/products/import",proOnly:!0},{label:"Catálogo em PDF",icon:c.jsx(k$,{}),route:"/export-catalog",proOnly:!0,allowRoute:!0},{label:"Etiquetas de produtos",icon:c.jsx(B6e,{}),route:"/general/product-labels",proOnly:!0},{label:"Tabelas de preço",icon:c.jsx(G1,{}),route:"/price-tables",blackOnly:!0},{label:"Avaliações",icon:c.jsx(vse,{}),route:"/reviews",proOnly:!0,isNew:!0}]},{title:"Suporte",items:[{label:"Suporte",icon:c.jsx(sx,{}),route:"#",isSupport:!0},{label:"Central de ajuda",icon:c.jsx(wM,{}),route:"#",isHelpCenter:!0},{label:"Entre no grupo do WhatsApp",icon:c.jsx(Rf,{}),route:"#",isWhatsApp:!0},{label:"Siga nosso canal",icon:c.jsx(F,{component:"img",src:H6e,sx:{filter:q6e}}),route:"#",isWhatsAppChannel:!0},{label:"Tutoriais",icon:c.jsx(dC,{}),route:"#",isYoutubeTutorials:!0}]},{title:"Links úteis",hideInDrawer:!0,items:[{label:"Acesse pelo computador",icon:c.jsx(EM,{}),route:"#",isDesktopLink:!0},{label:"Site do Stoqui",icon:c.jsx(a3,{}),route:"#",isWebsiteLink:!0}]},{title:"Siga o Stoqui nas redes sociais",items:[{label:"Instagram",icon:c.jsx(SM,{}),route:"#",publicVarKey:"INSTAGRAM_URL"},{label:"Facebook",icon:c.jsx(CM,{}),route:"#",publicVarKey:"FACEBOOK_URL"},{label:"LinkedIn",icon:c.jsx(TM,{}),route:"#",publicVarKey:"LINKEDIN_URL"},{label:"YouTube",icon:c.jsx(dC,{}),route:"#",publicVarKey:"YOUTUBE_URL"}]}],vD=e=>{if(e.isWhatsApp||e.isWhatsAppChannel)return z6e;if(e.isYoutubeTutorials)return W6e},T_=e=>!!(e.isSupport||e.isHelpCenter||e.isWhatsApp||e.isWhatsAppChannel||e.isYoutubeTutorials||e.isDesktopLink||e.isWebsiteLink||e.publicVarKey),G6e=[{icon:c.jsx(Xj,{}),label:"Home",route:"/"},{icon:c.jsx(Fg,{}),label:"Pedidos",route:"/orders"},{icon:c.jsx(k6e,{}),label:"Registrar pedido",route:"/orders/new"},{icon:c.jsx(Fs,{}),label:"Produtos",route:"/products"},{icon:c.jsx(c3,{}),label:"Clientes",route:"/customers"},{icon:c.jsx(Wj,{}),label:"Image Studio IA",route:"/image-studio"},{icon:c.jsx("img",{src:gD,alt:"Indique e ganhe",style:{height:"20px",width:"auto",transform:"rotate(-25deg)"}}),label:"Indique e ganhe",route:"/affiliate"}],hC=(e,t)=>({borderRadius:1,mb:.25,py:.75,color:t?"text.disabled":e?"primary.main":"text.primary","&.Mu
512i-selected":{backgroundColor:r=>gt(r.palette.primary.main,.08),"&:hover":{backgroundColor:r=>gt(r.palette.primary.main,.12)}}}),fC=(e,t,r)=>({minWidth:36,color:e?"primary.main":r?"text.disabled":t??"text.secondary","& svg":{width:20,height:20},"& img":{width:20,height:20}}),pC=e=>({fontSize:14,fontWeight:e?600:500,color:e?"primary.main":"inherit"}),yD=()=>{const e=At(),t=sn(),{triggerPaywall:r}=No(),{data:n}=an(),{data:i}=co(),o=yL(n),s=wL(n),a=Hn(n),l=(n==null?void 0:n.gives_access)&&(n==null?void 0:n.plan)==="black",d=i==null?void 0:i.SUPPORT_URL,u=i==null?void 0:i.WHATSAPP_GROUP_URL,h=i==null?void 0:i.WHATSAPP_CHANNEL_URL,f=i==null?void 0:i.HELP_CENTER_URL,p=i==null?void 0:i.YOUTUBE_TUTORIALS_URL,{drawerWidth:m,shouldHideDrawer:g}=Mg(),y=o||(i==null?void 0:i.FREE_USER_SUPPORT_ENABLED)==="true",b=Ee.useCallback(_=>_.hideInDrawer||_.nativeOnly&&!qe.isNativePlatform()||_.subscribedOnly&&!s?!1:_.isSupport?!!((!i||d)&&y):_.isHelpCenter?!!((!i||f)&&y):_.isWhatsApp?!!(!i||u):_.isWhatsAppChannel?!!(!i||h):_.isYoutubeTutorials?!!(!i||p):_.publicVarKey?!!(!i||i[_.publicVarKey]):!0,[i,d,y,f,u,h,p,s]),E=v.useMemo(()=>km.filter(_=>!_.hideInDrawer&&_.title!=="Suporte"&&_.title!=="Siga o Stoqui nas redes sociais").map(_=>({..._,visibleItems:_.items.filter(b)})),[b]),S=v.useMemo(()=>km.filter(_=>_.title==="Suporte"||_.title==="Siga o Stoqui nas redes sociais").map(_=>({..._,visibleItems:_.items.filter(b)})),[b]);if(g)return null;const k=_=>_==="/"&&t.pathname==="/"?!0:_==="/orders"&&t.pathname.includes("/orders/new")||_==="/reports"&&t.pathname.includes("/reports/analytics")?!1:_!=="/"&&t.pathname.startsWith(_),A=(_,x)=>{if(pe(fe.NAVIGATION.BUTTON_CLICK,{button_name:_.label,location:"desktop_drawer",route:_.route,section:x,is_pro_only:_.proOnly||!1,is_black_only:_.blackOnly||!1,is_support:_.isSupport||!1,is_whatsapp:_.isWhatsApp||_.isWhatsAppChannel||!1,is_help_center:_.isHelpCenter||!1,is_external_link:T_(_),subscription_status:o?a?"pro":l?"black":"lite":"free"}),_.proOnly&&!a&&!_.allowRoute)r(Am(_.route),{pageAction:()=>e("/profile/paywall?initialPlan=pro"),source:"drawer"});else if(_.blackOnly&&!l&&!_.allowRoute)r(Am(_.route),{pageAction:()=>e("/profile/paywall?initialPlan=black"),source:"drawer"});else if(_.isSupport&&d)pe(fe.SUPPORT.SUPPORT_CLICK),window.open(d,"_blank");else if(_.isHelpCenter&&f)window.open(f,"_blank");else if(_.isWhatsApp&&u)pe(fe.SUPPORT.WHATSAPP_CLICK),window.open(u,"_blank");else if(_.isWhatsAppChannel&&h)pe(fe.SUPPORT.WHATSAPP_CLICK),window.open(h,"_blank");else if(_.isYoutubeTutorials&&p)window.open(p,"_blank");else if(_.publicVarKey){const C=i==null?void 0:i[_.publicVarKey];C&&window.open(C,"_blank")}else _.isDesktopLink?window.open((i==null?void 0:i.DESKTOP_APP_URL)||"https://app.stoqui.com.br","_blank"):_.isWebsiteLink?window.open("https://stoqui.com.br","_blank"):T_(_)||e(_.route)},w=_=>{if(_.visibleItems.length===0)return null;const x=_.title==="Siga o Stoqui nas redes sociais";return c.jsxs(F,{sx:{mb:1.5},children:[c.jsx(V,{sx:{...j6e,ml:1.5,mb:.25},children:_.title}),c.jsx(ei,{disablePadding:!0,children:_.visibleItems.map(C=>{const P=k(C.route),I=C.proOnly&&!a||C.blackOnly&&!l;return c.jsxs(yn,{selected:P,onClick:()=>A(C,_.title),sx:hC(P,I),children:[c.jsx(Vt,{sx:fC(P,x?"primary.main":vD(C),I),children:C.icon}),c.jsx(St,{primary:c.jsxs(me,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{width:"100%"},children:[c.jsx(V,{sx:pC(P),children:C.label}),c.jsxs(me,{direction:"row",alignItems:"center",spacing:.5,children:[C.isNew&&c.jsx(fc,{label:"Novo",tint:"brand"}),C.proOnly&&c.jsx(ra,{variant:a?"cutout":"contained",fontSize:11}),C.blackOnly&&c.jsx(Qa,{variant:l?"cutout":"contained",fontSize:11})]})]})})]},C.label)})})]},_.title)};return c.jsxs(ND,{variant:"permanent",sx:{width:m,flexShrink:0,display:{xs:"none",md:"block"},"& .MuiDrawer-paper":{width:m,boxSizing:"border-box",borderRight:"1px solid",borderColor:"divider",bgcolor:"white",display:"flex",flexDirection:"column","@media (max-height: 899px)":{overflowY:"auto"},"@media (min-height: 900px)":{overflowY:"hidden"}}},children:[c.jsx(F,{sx:{mt:"var(--safe-area-inset-top)",p:1.5,position:"sticky",top:0,zIndex:1,bgcolor:"white",borderBottom:"1px solid",borderColor:"divider",height:"72px",display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box"},children:c.jsx(F,{display:"flex",justifyContent:"center",alignItems:"center",onClick:()=>{pe(fe.NAVIGATION.BUTTON_CLICK,{button_name:"Logo",location:"desktop_drawer",route:"/",section:"logo",is_pro_only:!1,is_black_only:!1,is_support:!1,is_whatsapp:!1,is_help_center:!1,is_external_link:!1,subscription_status:o?a?"pro":l?"black":"lite":"free"}),e("/")},sx:{cursor:"pointer"},padding:1,children:c.jsx("img",{src:Ua,alt:"Stoqui Logo",height:"40px"})})}),c.jsx(M6e,{}),c.jsx(ei,{sx:{px:1.5,pt:1.5,"@media (min-height: 900px)":{overflowY:"auto",flexShrink:0}},children:G6e.map(_=>{const x=k(_.route),C=_.route==="/affiliate"&&(i==null?void 0:i.AFFILIATE_ENABLED)!=="true";return c.jsxs(yn,{selected:x,disabled:C,onClick:()=>{C||(pe(fe.NAVIGATION.BUTTON_CLICK,{button_name:_.label,location:"desktop_drawer",route:_.route,section:"main_navigation",is_pro_only:!1,is_black_only:!1,is_support:!1,is_whatsapp:!1,is_help_center:!1,is_external_link:!1,subscription_status:o?a?"pro":l?"black":"lite":"free"}),e(_.route))}
512,sx:{...hC(x),mb:.5},children:[c.jsx(Vt,{sx:fC(x),children:_.icon}),c.jsx(St,{primary:c.jsxs(me,{direction:"row",alignItems:"center",spacing:1,justifyContent:"space-between",children:[c.jsx(V,{sx:pC(x),children:_.label}),C&&c.jsx(fc,{label:"Em breve",tint:"neutral"})]})})]},_.route)})}),c.jsx(Om,{sx:{mt:1.5,mb:1.5}}),c.jsxs(F,{sx:{px:1.5,pb:4,display:"flex",flexDirection:"column",justifyContent:"space-between",flexGrow:1,"@media (min-height: 900px)":{overflowY:"auto"}},children:[c.jsx("div",{children:E.map(w)}),c.jsx(F,{sx:{mt:"auto",pt:2},children:S.map(w)})]})]})};class K6e extends v.Component{constructor(){super(...arguments);ze(this,"state",{error:null,attempts:0,generation:0});ze(this,"retry",()=>{MR(),this.setState(r=>({error:null,attempts:r.attempts+1,generation:r.generation+1}))})}static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,n){try{Db(r,{extra:{componentStack:n.componentStack,tier:"route"}})}catch{}}componentDidUpdate(r){this.state.error&&r.resetKey!==this.props.resetKey&&this.setState({error:null,attempts:0})}render(){const{error:r,attempts:n,generation:i}=this.state;if(!r)return c.jsx(v.Fragment,{children:this.props.children},i);const o=n>=1||NR(r);return c.jsxs(F,{sx:{p:2},children:[c.jsx(_s,{severity:"error",title:"Esta tela não carregou",action:c.jsx(De,{variant:"contained",size:"small",onClick:o?()=>window.location.reload():this.retry,children:o?"Recarregar o app":"Tentar novamente"}),children:"Você pode continuar usando o resto do app normalmente."}),c.jsx(De,{fullWidth:!0,variant:"text",sx:{mt:1.5},onClick:()=>this.props.onLeave(),children:"Voltar para o inÃcio"})]})}}function _D({children:e}){const t=sn(),r=At();return c.jsx(K6e,{resetKey:t.key,onLeave:()=>r("/",{replace:!0}),children:e})}function bD(){return c.jsx(F,{sx:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:240,p:3},children:c.jsx(F,{"aria-hidden":!0,sx:{width:40,height:40,border:"4px solid #8865FE66",borderRadius:"50%",borderTopColor:"#8865FE",opacity:0,animation:"route-fallback-spin 1s ease-in-out infinite, route-fallback-in 1ms linear 150ms forwards","@keyframes route-fallback-spin":{to:{transform:"rotate(360deg)"}},"@keyframes route-fallback-in":{to:{opacity:1}}}})})}function Y6e(){const{mainContentWidth:e,contentPadding:t,isDesktop:r}=Mg();return c.jsxs(F,{sx:{display:"flex",minHeight:{xs:"calc(100vh - 56px - var(--safe-area-inset-bottom) - var(--safe-area-inset-top))",sm:"calc(100vh - 120px - var(--safe-area-inset-bottom) - var(--safe-area-inset-top))"},overflow:"hidden",backgroundColor:"background.default"},children:[c.jsx(Lm,{}),c.jsx(yD,{}),c.jsxs(F,{component:"main",sx:{flexGrow:1,display:"flex",flexDirection:"column",overflow:"hidden",width:e},children:[c.jsx(jm,{}),c.jsx(F,{sx:{flexGrow:1,pb:r?t.md.pb:0,px:r?t.md.px:0,pt:r?t.md.pt:0},children:c.jsx(_D,{children:c.jsx(v.Suspense,{fallback:c.jsx(bD,{}),children:c.jsx(rd,{})})})})]})]})}function Z6e(){const e=At(),t=sn(),r=$o(),n=tl(r.breakpoints.up("md")),i={minWidth:"64px",transition:"color 0.15s ease","&:active":{color:"text.primary"}},s=(d=>{switch(d){case"/":return 0;case"orders":return 1;case"customers":return 2;case"products":return 3;case"general":return 4;default:return 0}})(t.pathname.split("/")[1]),a=()=>{window.scrollTo({top:0,behavior:"smooth"})},l=(d,u)=>{if(Li(Ja.Light),s===u){a();return}switch(u){case 0:e("/");break;case 1:e("/orders");break;case 2:e("/customers");break;case 3:e("/products");break;case 4:e("/general");break;default:e("/");break}};return c.jsx(FD,{sx:{position:"fixed",bottom:0,left:0,right:0,paddingBottom:"var(--safe-area-inset-bottom)",backgroundColor:"white",borderTop:"1px solid",borderColor:"divider"},elevation:3,children:c.jsxs(UD,{showLabels:!0,value:s,onChange:l,children:[c.jsx(wd,{disableRipple:!0,label:"InÃcio",sx:i,icon:c.jsx(Pn,{children:s===0?c.jsx(Eme,{}):c.jsx(Xj,{})})}),c.jsx(wd,{disableRipple:!0,label:"Pedidos",sx:i,icon:c.jsx(Pn,{children:s===1?c.jsx(Zj,{}):c.jsx(Fg,{})})}),c.jsx(wd,{disableRipple:!0,label:"Clientes",sx:i,icon:c.jsx(Pn,{children:s===2?c.jsx(sse,{}):c.jsx(c3,{})})}),c.jsx(wd,{disableRipple:!0,label:"Produtos",sx:i,icon:c.jsx(Pn,{children:c.jsx(Fs,{})})}),!n&&c.jsx(wd,{disableRipple:!0,label:"Menu",sx:i,icon:c.jsx(Pn,{children:s===4?c.jsx(Cme,{}):c.jsx(Ome,{})})})]})})}function X6e(){const{mainContentWidth:e,contentPadding:t,isDesktop:r}=Mg();
512return c.jsxs(F,{sx:{display:"flex",minHeight:{xs:"calc(100vh - 56px - var(--safe-area-inset-bottom) - var(--safe-area-inset-top))",sm:"calc(100vh - 120px - var(--safe-area-inset-bottom) - var(--safe-area-inset-top))"},overflow:"hidden",backgroundColor:"background.default"},children:[c.jsx(Lm,{}),c.jsx(yD,{}),c.jsxs(F,{component:"main",sx:{flexGrow:1,display:"flex",flexDirection:"column",overflow:"hidden",width:e},children:[c.jsx(jm,{}),c.jsx(F,{sx:{flexGrow:1,pb:{xs:7,md:r?t.md.pb:0},px:r?t.md.px:0,pt:r?t.md.pt:0,overflow:"auto"},children:c.jsx(_D,{children:c.jsx(v.Suspense,{fallback:c.jsx(bD,{}),children:c.jsx(rd,{})})})}),c.jsx(F,{sx:{display:{xs:"block",md:"none"}},children:c.jsx(Z6e,{})})]})]})}const Rm=({icon:e,iconColor:t,label:r,trailing:n,trailingIcon:i="chevron",locked:o=!1,disabled:s=!1,onClick:a})=>{const l=$o(),d=L6e(l.palette.text.primary);return c.jsx($m,{disablePadding:!0,children:c.jsxs(yn,{onClick:a,disabled:s,sx:{minHeight:I6e},children:[c.jsx(Vt,{sx:{color:o?"text.disabled":t??"primary.main","& svg":{width:m0,height:m0},"& img":{width:m0,height:m0}},children:e}),c.jsx(F,{sx:{flex:1,minWidth:0},children:c.jsx(V,{component:"span",noWrap:!0,sx:{...P6e,display:"block",color:o?"text.disabled":"text.primary"},children:r})}),(n||i!=="none")&&c.jsxs(me,{direction:"row",alignItems:"center",spacing:.75,sx:{flexShrink:0,ml:1},children:[n,i==="chevron"&&c.jsx(AM,{sx:{fontSize:$6e,color:d}}),i==="external"&&c.jsx(kM,{sx:{fontSize:D6e,color:d}})]})]})})},J6e=({onClick:e})=>c.jsxs(De,{fullWidth:!0,onClick:e,sx:{mb:2,py:2,borderRadius:"12px",textTransform:"none",fontSize:"16px",fontWeight:600,display:"flex",justifyContent:"space-between",alignItems:"center",background:t=>`linear-gradient(135deg, ${t.palette.primary.dark} 0%, ${t.palette.primary.main} 100%)`,color:"white"},children:[c.jsxs(me,{direction:"row",spacing:1,alignItems:"center",children:[c.jsx(Ol,{style:{color:"#FFBB00",marginRight:8}}),c.jsx(V,{fontWeight:600,children:"Assine o Stoqui"})]}),c.jsx(Vg,{sx:{fontSize:20}})]}),Q6e=({onClick:e,plan:t})=>{const r=t==="pro"?ra:t==="black"?Qa:ip;return c.jsx(Rm,{icon:c.jsx(MI,{}),label:"Gerenciar assinatura",trailing:c.jsx(r,{variant:"contained",fontSize:11}),onClick:e})},ewe=({item:e,sectionTitle:t,isSubscribed:r,isProSubscriber:n,isBlackSubscriber:i})=>{const o=At(),{triggerPaywall:s}=No(),{data:a}=co(),l=a==null?void 0:a.SUPPORT_URL,d=a==null?void 0:a.WHATSAPP_GROUP_URL,u=a==null?void 0:a.WHATSAPP_CHANNEL_URL,h=a==null?void 0:a.HELP_CENTER_URL,f=a==null?void 0:a.YOUTUBE_TUTORIALS_URL,p=e.publicVarKey?a==null?void 0:a[e.publicVarKey]:void 0,m=r||(a==null?void 0:a.FREE_USER_SUPPORT_ENABLED)==="true";if(e.isSupport&&!(l&&m)||e.isWhatsApp&&!d||e.isWhatsAppChannel&&!u||e.isHelpCenter&&!(h&&m)||e.isYoutubeTutorials&&!f||e.publicVarKey&&!p)return null;const g=T_(e),y=e.proOnly&&!n||e.blackOnly&&!i,b=()=>{pe(fe.NAVIGATION.BUTTON_CLICK,{button_name:e.label,location:"general_page",route:e.route,section:t,is_pro_only:e.proOnly||!1,is_black_only:e.blackOnly||!1,is_support:e.isSupport||!1,is_whatsapp:e.isWhatsApp||e.isWhatsAppChannel||!1,is_help_center:e.isHelpCenter||!1,is_external_link:g,subscription_status:r?n?"pro":i?"black":"lite":"free"}),e.proOnly&&!n&&!e.allowRoute?s(Am(e.route),{pageAction:()=>o("/profile/paywall?initialPlan=pro"),source:"menu"}):e.blackOnly&&!i&&!e.allowRoute?s(Am(e.route),{pageAction:()=>o("/profile/paywall?initialPlan=black"),source:"menu"}):e.isSupport&&l?(pe(fe.SUPPORT.SUPPORT_CLICK),window.open(l,"_blank")):e.isHelpCenter&&h?window.open(h,"_blank"):e.isWhatsApp&&d?(pe(fe.SUPPORT.WHATSAPP_CLICK),window.open(d,"_blank")):e.isWhatsAppChannel&&u?(pe(fe.SUPPORT.WHATSAPP_CLICK),window.open(u,"_blank")):e.isYoutubeTutorials&&f?window.open(f,"_blank"):e.publicVarKey&&p?window.open(p,"_blank"):e.isDesktopLink?window.open((a==null?void 0:a.DESKTOP_APP_URL)||"https://app.stoqui.com.br","_blank"):e.isWebsiteLink?window.open("https://stoqui.com.br","_blank"):g||o(e.route)};return c.jsx(Rm,{icon:e.icon,iconColor:vD(e),label:e.label,locked:y,trailingIcon:g?"external":"chevron",trailing:c.jsxs(c.Fragment,{children:[e.isNew&&c.jsx(fc,{label:"Novo",tint:"brand"}),e.proOnly&&c.jsx(ra,{variant:n?"cutout":"contained",fontSize:11}),e.blackOnly&&c.jsx(Qa,{variant:i?"cutout":"contained",fontSize:11})]}),onClick:b})},twe=()=>{const e=At(),{triggerPaywall:t}=No(),{data:r,isLoading:n,isError:i}=an(),{data:o}=co(),s=yL(r),a=Hn(r),l=(r==null?void 0:r.gives_access)&&(r==null?void 0:r.plan)==="black",d=()=>{pe(fe.NAVIGATION.BUTTON_CLICK,{button_name:s?"Gerenciar assinatura":"Assine o Stoqui",location:"general_page",route:s?"/profile/subscription":"/profile/paywall",section:"subscription",is_pro_only:!1,is_black_only:!1,is_support:!1,is_whatsapp:!1,is_help_center:!1,is_external_link:!1,subscription_status:s?a?"pro":l?"black":"lite":"free",action:s?"manage_subscription":"subscribe"}),s?e("/profile/subscription?comesFromPaywall=true"):t("subscription",{pageAction:()=>e("/profile/paywall"),source:"general_page"})},u=()=>{(o==null?void 0:o.AFFILIATE_ENABLED)==="true"&&(pe(fe.NAVIGATION.BUTTON_CLICK,{button_name:"Indique e Ganhe",location:"general_page",route:"/affiliate",section:"affiliate",is_pro_only:!1,is_black_only:!1,is_support:!1,is_whatsapp:!1,is_help_center:!1,is_external_link:!1,subscription_status:s?a?"pro":l?"black":"lite":"free"}),e("/affiliate"))},h=()=>{pe(fe.NAVIGATION.BUTTON_CLICK,{button_name:"Image Studio IA",location:"general_page",route:"/image-studio",section:"tools",is_pro_only:!1,is_black_only:!1,is_support:!1,is_whatsapp:!1,is_help_center:!1,is_external_link:!1,subscription_status:s?a?"pro":l?"black":"lite":"free"}),e("/image-studio")};return c.jsxs(F,{sx:{display:"flex",flexDirection:"column"},children:[c.jsx(Sc,{title:"Geral"}),n&&c.jsx(F,{sx:{p:2,pb:0},children:c.jsx(Lt,{variant:"rectangular",width:"100%",height:56,sx:{borderRadius:"12px",mb:2}})}),i&&c.jsx(F,{sx:{p:2,pb:0},children:c.jsx(zn,{severity:"error",children:"Erro ao carregar dados"})}),!n&&!i&&c.jsxs(F,{sx:{p:2,pb:0,mb:2},children:[s?c.jsx(Q6e,{onClick:d,plan:(r==null?void 0:r.plan)||"pro"}):c.jsx(J6e,{onClick:d}),c.jsx(Rm,{icon:c.jsx(Wj,{}),label:"Image Studio IA",onClick:h}),c.jsx(Rm,{icon:c.jsx(F,{component:"img",src:gD,sx:{transform:"rotate(-25deg)"}}),label:"Indique e ganhe",disabled:(o==null?void 0:o.AFFILIATE_ENABLED)!=="true",trailing:(o==null?void 0:o.AFFILIATE_ENABLED)!=="true"?c.jsx(fc,{label:"Em breve",tint:"neutral"}):void 0,trailingIcon:(o==null?void 0:o.AFFILIATE_ENABLED)!=="true"?"none":"chevron",onClick:u})]}),c.jsx(F,{sx:{flex:1,overflow:"auto",bgcolor:"background.paper"},children:c.jsx(ei,{sx:{width:"100%",p:2,pt:0},children:km.map((f,p)=>{const m=f.items.filter(g=>!g.hideInGeneral);return m.length===0?null:c.jsxs(F,{sx:{mb:p!==km.length-1?3:0},children:[c.jsx(V,{sx:O6e,children:f.title}),m.map(g=>c.jsx(ewe,{item:g,sectionTitle:f.title,isSubscribed:s,isProSubscriber:a,isBlackSubscriber:!!l},g.route+g.label))]},f.title)})})})]})},rwe=v.lazy(()=>X(()=>import("./PaywallSheetV2-DyMzzx6B.js"),__vite__mapDeps([22,1,2,23,24,25,26,3,27,28,4,5,6]))),xD=({trigger:e})=>{const t=At(),r=sn(),{tags:n,setTag:i}=al(),o=v.useRef(!1);v.useEffect(()=>{if(o.current)return;o.current=!0;const a=_L(e);pe(fe.PAYWALL_V2.TRIGGER,{trigger:e,required_plan:a.plan,kind:a.kind,variant:"v3",surface:"sheet",source:"route",platform:qe.isNativePlatform()?qe.getPlatform():"web"}),(n==null?void 0:n.last_paywall_seen)!==e&&i("last_paywall_seen",e)},[e]);const s=()=>{r.key!=="default"?t(-1):t("/",{replace:!0})};return c.jsx(F,{sx:{minHeight:"100vh",bgcolor:"background.default"},children:c.jsx(v.Suspense,{fallback:null,children:c.jsx(rwe,{open:!0,onClose:s,trigger:e,source:"route"})})})},Xt=({children:e,requiredPlan:t="pro",trigger:r})=>{const{data:n,isLoading:i}=an(),o=sn();return i?c.jsx(F,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"70vh"},children:c.jsx(bn,{})}):vd(n,t)?c.jsx(c.Fragment,{children:e}):r?c.jsx(xD,{trigger:r}):c.jsx(Hs,{to:`/profile/paywall?initialPlan=${t}`,state:{from:o},replace:!0})},xl=({title:e,children:t})=>{const{data:r,isLoading:n}=an();return Hn(r)?c.jsx(c.Fragment,{children:t}):n?c.jsx(F,{sx:{display:"flex",flexDirection:"column",height:"100%",bgcolor:"background.default"},children:c.jsx(Sc,{title:e,navigateBack:!0})}):c.jsx(xD,{trigger:"contas_a_pagar"})},mC=["pagaleve","parcelado","fiado"],s5=["dinheiro"],nwe=["dinheiro","pix"],wD=v.createContext(void 0);function wa({children:e}){const[t,r]=v.useState([]),n=()=>t.some(m=>mC.includes(m.paymentMethodId)),i=m=>n()?{isValid:!1,reason:"Já existe um método de pagamento exclusivo"}:mC.includes(m)&&t.length>0?{isValid:!1,reason:"Método de pagamento exclusivo não pode ser combinado"}:t.find(y=>y.paymentMethodId===m)&&!nwe.includes(m)?{isValid:!1,reason:"Este método de pagamento já foi adicionado"}:{isValid:!0},o=(m,g)=>{const y=h(),b=g-y;return s5.includes(m)?1/0:Math.max(0,b)},s=(m,g)=>{if(s5.includes(m)){const y=t.find(b=>b.paymentMethodId===m);if(y){l(y.id,y.amount+g);return}}a({paymentMethodId:m,paymentMethodName:f(m),amount:g})},a=m=>{const g=i(m.paymentMethodId);if(!g.isValid)return g;if(s5.includes(m.paymentMethodId)){const b=t.find(E=>E.paymentMethodId===m.paymentMethodId);if(b){const E=b.amount+m.amount;return r(S=>S.map(k=>k.id===b.id?{...k,amount:E}:k)),{isValid:!0}}}const y={...m,id:Date.now().toString()};return r(b=>[...b,y]),{isValid:!0}},l=(m,g)=>g<=0?{isValid:!1,reason:"Valor deve ser maior que zero"}:(r(y=>y.map(b=>b.id===m?{...b,amount:g}:b)),{isValid:!0}),d=m=>{r(g=>g.filter(y=>y.id!==m))},u=v.useCallback(()=>{r([])},[]),h=()=>Number(t.reduce((m,g)=>m+g.amount,0).toFixed(2)),f=m=>({dinheiro:"Dinheiro",pix:"Pix",cartao_credito:"Cartão de crédito",cartao_debito:"Cartão de débito",mercadopago:"Mercado Pago",pagaleve:"Pagaleve",parcelado:"Parcelado",fiado:"Fiado"})[m]||m,p=v.useMemo(()=>({payments:t,addPayment:a,updatePayment:l,removePayment:d,clearPayments:u,setPayments:r,getTotalPaid:h,canAddPaymentMethod:i,getMaxAllowedAmount:o,hasExclusivePayment:n,consolidatePayments:s}
512),[t]);return c.jsx(wD.Provider,{value:p,children:e})}function uAe(){const e=v.useContext(wD);if(e===void 0)throw new Error("usePayments must be used within a PaymentProvider");return e}const iwe=oe(()=>X(()=>import("./ProfilePage-ChTBqs47.js"),__vite__mapDeps([38,1,2,39,40,5,3,4,6]))),owe=oe(()=>X(()=>import("./ChatsPage-CbynnMKh.js"),__vite__mapDeps([41,1,2,5,42,43,3,4,6]))),swe=oe(()=>X(()=>import("./ChatPage-D33WYGPn.js"),__vite__mapDeps([44,1,2,45,43,3,42,5,4,6]))),awe=oe(()=>X(()=>import("./ProductPage-B3xKH4f6.js"),__vite__mapDeps([46,1,2,43,3,47,5,48,49,39,50,51,52,53,54,55,56,57,58,6,59,60,61,62,63,64,4]))),gC=oe(()=>X(()=>import("./ComboFormPage-CGZ9TbGt.js"),__vite__mapDeps([65,1,2,66,67,68,69,3,6,70,48,71,45,49,72,73,74,75,76,77,5,78,79,80,51,52,54,81,43,53,4]))),lwe=oe(()=>X(()=>import("./CreateProductPage-DYRuOTc2.js"),__vite__mapDeps([82,1,2,83,47,5,3,84,67,68,69,6,70,48,71,45,49,72,73,74,75,76,85,86,87,57,43,88,89,64,90,77,91,92,66,93,4]))),cwe=oe(()=>X(()=>import("./OrderPage-B_L7I5Yw.js"),__vite__mapDeps([94,1,2,95,39,96,3,5,25,97,51,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,73,6,118,119,120,121,122,123,54,124,125,126,127,4]))),uwe=oe(()=>X(()=>import("./CreatePixPage-BMr0zfRI.js"),__vite__mapDeps([128,1,2,129,6,3,4,5]))),dwe=oe(()=>X(()=>import("./PixListPage-CoujHxDc.js"),__vite__mapDeps([130,1,2,39,129,131,132,3,133,134,4,5,6]))),hwe=oe(()=>X(()=>import("./EditProfilePage-CIbnN3yY.js"),__vite__mapDeps([135,1,2,39,3,6,4,5]))),fwe=oe(()=>X(()=>import("./ChangePasswordPage-Bn9F8R4O.js"),__vite__mapDeps([136,1,2,3,4,5,6]))),pwe=oe(()=>X(()=>import("./ChangePhoneNumberPage-BjFIiv9V.js"),__vite__mapDeps([137,1,2,6,3,4,5]))),mwe=oe(()=>X(()=>import("./EditProductPage-AMLZ1LGO.js"),__vite__mapDeps([138,1,2,83,47,5,3,84,67,68,69,6,70,48,71,45,49,72,73,74,75,76,85,86,87,57,43,88,89,64,90,77,66,92,93,4]))),gwe=oe(()=>X(()=>import("./CustomerPage-DPoPi4AZ.js"),__vite__mapDeps([139,1,2,48,106,3,140,141,142,5,143,144,132,129,4,6]))),vwe=oe(()=>X(()=>import("./TemplateMensagemPage-B-I1HzD8.js"),__vite__mapDeps([145,1,2,146,3,86,87,4,5,6]))),ywe=oe(()=>X(()=>import("./WebCatalogPage-C3sjRm5B.js"),__vite__mapDeps([147,1,2,26,148,3,40,149,52,5,4,6]))),_we=oe(()=>X(()=>import("./IdentityScreen-55IQTSHG.js"),__vite__mapDeps([150,1,2,39,151,86,87,152,3,153,66,6,148,4,5]))),bwe=oe(()=>X(()=>import("./ContactScreen-DRZL1k3Y.js"),__vite__mapDeps([154,1,2,155,26,151,153,66,6,148,3,4,5]))),xwe=oe(()=>X(()=>import("./CheckoutScreen-Bujmkbs1.js"),__vite__mapDeps([156,1,2,25,153,66,6,148,3,4,5]))),wwe=oe(()=>X(()=>import("./CatalogScreen-C5K8HTG8.js"),__vite__mapDeps([157,1,2,153,66,6,148,3,4,5]))),Ewe=oe(()=>X(()=>import("./ChatScreen-BLrExdGO.js"),__vite__mapDeps([158,1,2,81,25,153,66,6,148,3,4,5]))),Swe=oe(()=>X(()=>import("./NotificationsScreen-PZ8eQajB.js"),__vite__mapDeps([159,1,2,153,66,6,148,3,4,5]))),Cwe=oe(()=>X(()=>import("./StoreAppearancePage-78293XtG.js"),__vite__mapDeps([160,1,2,26,148,3,161,149,52,5,162,163,164,4,6]))),Twe=oe(()=>X(()=>import("./BrandScreen-BQN8vLZH.js"),__vite__mapDeps([165,1,2,5,153,66,6,148,3,163,164,4]))),Awe=oe(()=>X(()=>import("./AiLogoGeneratorPage-DfpSWs2m.js"),__vite__mapDeps([166,1,2,167,168,169,3,152,148,164,6,4,5]))),kwe=oe(()=>X(()=>import("./PromoStripScreen-VFp1k61u.js"),__vite__mapDeps([170,1,2,153,66,6,148,3,163,171,5,164,4]))),Rwe=oe(()=>X(()=>import("./ProductCardsScreen-CUtSjj7S.js"),__vite__mapDeps([172,1,2,81,153,66,6,148,3,163,85,60,164,4,5]))),Iwe=oe(()=>X(()=>import("./TypographyScreen--Uq8vqAj.js"),__vite__mapDeps([173,1,2,81,153,66,6,148,3,164,4,5]))),Pwe=oe(()=>X(()=>import("./FooterScreen-awIh27Ee.js"),__vite__mapDeps([174,1,2,153,66,6,148,3,175,164,4,5]))),Owe=oe(()=>X(()=>import("./FaviconScreen-D_RY_l-3.js"),__vite__mapDeps([176,1,2,153,66,6,148,3,5,164,4]))),jwe=oe(()=>X(()=>import("./DeveloperPage-C3M_M1TW.js"),__vite__mapDeps([177,1,2,91,3,178,39,4,5,6]))),Lwe=oe(()=>X(()=>import("./BluetoothPrinterPage-DD-bBYh9.js"),__vite__mapDeps([179,1,2,119,120,3,4,5,6]))),$we=oe(()=>X(()=>import("./NotificationsPage-CTfm_XNn.js"),__vite__mapDeps([180,1,2,3,4,5,6]))),Dwe=oe(()=>X(()=>import("./ImportProductsPage-BI25G7cd.js"),__vite__mapDeps([181,1,2,182,3,183,5,6,4]))),Mwe=oe(()=>X(()=>import("./ImportDetailsPage-iHer4mki.js"),__vite__mapDeps([184,1,2,3,50,6,4,5]))),Nwe=oe(()=>X(()=>import("./CustomersImportPage-CM2OHQfQ.js"),__vite__mapDeps([185,1,2,186,79,3,182,183,5,6,4]))),Fwe=oe(()=>X(()=>import("./CustomerImportDetailsPage-I2RCvF3g.js"),__vite__mapDeps([187,1,2,3,6,4,5]))),Uwe=oe(()=>X(()=>import("./CategoriesPageRedesigned-Db3hj9jY.js"),__vite__mapDeps([188,1,2,189,3,69,6,5,4]))),vC=oe(()=>X(()=>import("./CategoryDetailPage-BWGA7sHH.js"),__vite__mapDeps([190,1,2,125,5,191,161,3,189,69,6,149,52,192,4]))),Bwe=oe(()=>X(()=>import("./CategoryMediaPage-jxhE7DO3.js"),__vite__mapDeps([193,1,2,153,66,6,194,45,70,68,69,3,78,79,80,51,5,195,191,161,196,164,4]))),Vwe=oe(()=>X(()=>import("./ReportsPage-B1xuirlx.js"),__vite__mapDeps([197,1,2,198,199,5,51,3,200,201,202,203,204,62,109,110,111,112,205,206,4,6]))),Hwe=oe(()=>X(()=>import("./ShippingConfigPage-CrW-nQwy.js"),__vite__mapDeps([207,1,2,208,3,209,210,211,149,52,5,212,213,214,126,215,4,6]))),zwe=oe(()=>X(()=>import("./FreeShippingConfigPage-C5sDmC53.js"),__vite__mapDeps([216,1,2,208,3,86,87,217,148,6,218,4,5]))),Wwe=oe(()=>X(()=>import("./DistanceShippingConfigPage-CCsLCPlh.js"),__vite__mapDeps([219,1,2,39,213,3,86,87,217,148,6,4,5]))),qwe=oe(()=>X(()=>import("./CustomShippingConfigPage-BGwCOc5l.js"),__vite__mapDeps([220,1,2,39,3,212,86,87,6,4,5]))),Gwe=oe(()=>X(()=>import("./StoreAddressConfigPage-CG5BIWoS.js"),__vite__mapDeps([221,1,2,222,3,4,5,6]))),Kwe=oe(()=>X(()=>import("./BillingAddressConfigPage-CkISqQP6.js"),__vite__mapDeps([223,1,2,222,3,4,5,6]))),Ywe=oe(()=>X(()=>import("./FiscalConfigPage-DWCqHunq.js"),__vite__mapDeps([224,1,2,149,52,5,117,73,3,74,75,4,6])
512)),Zwe=oe(()=>X(()=>import("./FiscalEmpresaPage-Bj_8tpJ6.js"),__vite__mapDeps([225,1,2,73,3,226,222,5,6,4]))),Xwe=oe(()=>X(()=>import("./FiscalCertificadoPage-B4bX0KU7.js"),__vite__mapDeps([227,1,2,117,183,5,73,3,6,4]))),Jwe=oe(()=>X(()=>import("./FiscalSettingsPage-VlsqFW5m.js"),__vite__mapDeps([228,1,2,73,3,226,6,4,5]))),Qwe=oe(()=>X(()=>import("./FiscalDefaultsPage-haXyY2kk.js"),__vite__mapDeps([229,1,2,3,73,75,6,4,5]))),e8e=oe(()=>X(()=>import("./FiscalRegrasPage-BkaXvGCN.js"),__vite__mapDeps([230,1,2,231,73,3,74,75,4,5,6]))),t8e=oe(()=>X(()=>import("./FiscalRegraFormPage-K0SSbiEp.js"),__vite__mapDeps([232,1,2,231,75,5,3,74,6,73,4]))),r8e=oe(()=>X(()=>import("./NotasFiscaisPage-CZBw_Vo3.js"),__vite__mapDeps([233,1,2,3,116,5,234,4,6]))),n8e=oe(()=>X(()=>import("./CombinarEntregaConfigPage-BDkQ4CPy.js"),__vite__mapDeps([235,1,2,211,3,218,6,236,4,5]))),i8e=oe(()=>X(()=>import("./RetiradaConfigPage-B3GCtBUL.js"),__vite__mapDeps([237,1,2,210,3,218,6,236,4,5]))),o8e=oe(()=>X(()=>import("./AttributesPage-BOVzEzsw.js"),__vite__mapDeps([238,1,2,89,3,85,5,4,6]))),s8e=oe(()=>X(()=>import("./AttributeEditPage-BDAS09EZ.js"),__vite__mapDeps([239,1,2,3,51,85,5,240,6,4]))),a8e=oe(()=>X(()=>import("./CreateAttributePage-BlhpAD_F.js"),__vite__mapDeps([241,1,2,3,240,5,6,4]))),l8e=oe(()=>X(()=>import("./ProductVariationsPage-DHK4OVHv.js"),__vite__mapDeps([242,1,2,55,3,43,5,4,6]))),c8e=oe(()=>X(()=>import("./ProductDigitalDeliveryPage-DyNpUWoX.js"),__vite__mapDeps([243,1,2,124,244,3,84,6,43,55,64,4,5]))),u8e=oe(()=>X(()=>import("./ProductDigitalVariationDeliveryPage-DDHoaG4z.js"),__vite__mapDeps([245,1,2,244,3,84,6,43,55,64,4,5]))),yC=oe(()=>X(()=>import("./ProductAttributesPage-1E_WlR-v.js"),__vite__mapDeps([246,1,2,88,3,43,85,51,6,5,4]))),d8e=oe(()=>X(()=>import("./EditVariationPage-DpdmqgWN.js"),__vite__mapDeps([247,1,2,55,3,43,59,5,86,87,248,118,6,4]))),_C=oe(()=>X(()=>import("./StockPage-DScSIhR9.js"),__vite__mapDeps([249,1,2,250,251,5,252,51,56,58,6,57,3,59,253,4]))),h8e=oe(()=>X(()=>import("./StockProductPage-BfmmoJQF.js"),__vite__mapDeps([254,1,2,43,3,55,255,51,256,257,253,258,4,5,6,56,92,57]))),f8e=oe(()=>X(()=>import("./SuppliersPage-0ECZKcZN.js"),__vite__mapDeps([259,1,2,260,253,3,5,4,6]))),p8e=oe(()=>X(()=>import("./SupplierPage-CKD7v5Xq.js"),__vite__mapDeps([261,1,2,5,262,3,255,51,256,4,6]))),bC=oe(()=>X(()=>import("./SupplierFormPage-dUdvpWTX.js"),__vite__mapDeps([263,1,2,6,262,3,4,5]))),m8e=oe(()=>X(()=>import("./StockVariationPage-Dm9LiApq.js"),__vite__mapDeps([264,1,2,43,3,55,255,51,256,257,253,258,4,5,6,56,92,59]))),g8e=oe(()=>X(()=>import("./StockMovementPage-BrelsSvv.js"),__vite__mapDeps([265,1,2,266,3,260,51,256,5,4,6]))),v8e=oe(()=>X(()=>import("./EditStockMovementPage-BXTFjB1L.js"),__vite__mapDeps([267,1,2,266,3,268,256,258,253,51,5,4,6]))),y8e=oe(()=>X(()=>import("./MercadoPagoConnectPage-CWHohZ0D.js"),__vite__mapDeps([269,1,2,3,270,250,271,272,273,274,133,275,134,276,277,30,111,5,6,4]))),_8e=oe(()=>X(()=>import("./AsaasConnectPage-DxdQmFzn.js"),__vite__mapDeps([278,1,2,250,271,23,272,275,3,133,273,134,276,6,4,5]))),b8e=oe(()=>X(()=>import("./CheckoutSettingsPage-nHTlb2gV.js"),__vite__mapDeps([279,1,2,270,5,3,276,111,6,133,275,273,132,4]))),x8e=oe(()=>X(()=>import("./PaymentMethodsPage-DQpiaLuW.js"),__vite__mapDeps([280,1,2,149,52,5,273,3,274,281,275,133,282,276,112,4,6]))),w8e=oe(()=>X(()=>import("./PayOnDeliveryPage-BzHQZ4Ng.js"),__vite__mapDeps([283,1,2,109,110,5,111,112,284,3,282,6,4]))),E8e=oe(()=>X(()=>import("./PaymentMethodsListPage-B4IaV0fE.js"),__vite__mapDeps([285,1,2,284,3,109,110,5,111,112,146,286,287,275,4,6]))),S8e=oe(()=>X(()=>import("./CreatePaymentMethodPage-CS2-UTGc.js"),__vite__mapDeps([288,1,2,289,110,5,3,284,4,6]))),C8e=oe(()=>X(()=>import("./EditPaymentMethodPage-DANppV84.js"),__vite__mapDeps([290,1,2,289,110,5,3,284,4,6]))),xC=oe(()=>X(()=>import("./CustomerFormPage-DHBWlnYc.js"),__vite__mapDeps([291,1,2,222,3,292,70,6,293,123,4,5]))),T8e=oe(()=>X(()=>import("./PixelsAnalyticsPage-D7uJz3jM.js"),__vite__mapDeps([294,1,2,155,39,3,6,4,5]))),A8e=oe(()=>X(()=>import("./ReportsAnalyticsPage-Bho-lhTl.js"),__vite__mapDeps([295,1,2,198,199,5,204,200,3,51,86,87,205,206,4,6]))),k8e=oe(()=>X(()=>import("./MelhorEnvioConfigPage-BYH_D9tm.js"),__vite__mapDeps([296,1,2,271,277,30,214,3,86,87,72,6,217,148,4,5]))),R8e=oe(()=>X(()=>import("./SuperfreteConfigPage-CfaAd2k0.js"),__vite__mapDeps([297,1,2,298,271,126,3,62,86,87,72,6,217,148,4,5]))),I8e=oe(()=>X(()=>import("./UberConfigPage-C13RceIH.js"),__vite__mapDeps([299,1,2,206,210,298,271,215,3,62,86,87,6,217,148,4,5]))),P8e=oe(()=>X(()=>import("./CouponsListPage-91sCtihC.js"),__vite__mapDeps([300,1,2,96,3,301,107,5,4,6]))),wC=oe(()=>X(()=>
512import("./CouponFormPage-BLF_dhQt.js"),__vite__mapDeps([302,1,2,86,87,77,5,78,79,80,51,303,301,4,6,3]))),O8e=oe(()=>X(()=>import("./SubscriptionPage-CBtd12hO.js"),__vite__mapDeps([304,1,2,5,23,3,25,120,87,4,6]))),j8e=oe(()=>X(()=>import("./PaywallPage-B-Ew3hFT.js"),__vite__mapDeps([305,1,2,23,28,3,24,25,26,27,81,4,5,6]))),EC=oe(()=>X(()=>import("./ComparePlansPage-CFYwMJ71.js"),__vite__mapDeps([306,1,2,3,4,5,6]))),SC=oe(()=>X(()=>import("./CustomerAddressFormPage-BS5koWPn.js"),__vite__mapDeps([307,1,2,222,3,292,6,141,293,123,4,5]))),L8e=oe(()=>X(()=>import("./CustomerAddressesPage-w7qaOif-.js"),__vite__mapDeps([308,1,2,142,5,106,3,140,141,4,6]))),$8e=oe(()=>X(()=>import("./PagalevePage-C7WyjkgR.js"),__vite__mapDeps([309,1,2,310,5,6,281,3,217,148,4]))),D8e=oe(()=>X(()=>import("./PagaleveConnectPage-NszlqtmK.js"),__vite__mapDeps([311,1,2,310,5,6,3,281,4]))),M8e=oe(()=>X(()=>import("./NewOrderResponsivePage-CLpjm2jw.js"),__vite__mapDeps([312,1,2,313,314,39,51,54,98,293,123,53,3,25,315,92,6,93,5,250,316,317,253,258,256,4]))),N8e=oe(()=>X(()=>import("./NewOrderProductSearchPage-X1hCPAC1.js"),__vite__mapDeps([318,1,2,316,51,5,79,317,3,253,92,258,256,4,6,54,315,314,93,53,293,123,319]))),F8e=oe(()=>X(()=>import("./NewOrderDetailsPage-DVD6ErOk.js"),__vite__mapDeps([320,1,2,250,62,108,95,39,96,3,5,178,293,123,100,106,4,6]))),U8e=oe(()=>X(()=>import("./NewOrderCustomerPage-DeFdTevB.js"),__vite__mapDeps([321,1,2,106,3,293,123,322,79,186,4,5,6]))),B8e=oe(()=>X(()=>import("./NewOrderAddressPage-7K2KsPvr.js"),__vite__mapDeps([323,1,2,106,3,142,5,293,123,4,6]))),V8e=oe(()=>X(()=>import("./EditOrderProductsPage-Be6wAvty.js"),__vite__mapDeps([324,1,2,313,314,39,51,54,98,99,3,100,53,102,122,123,250,62,268,6,4,5]))),H8e=oe(()=>X(()=>import("./EditOrderProductsSearchPage-C3GBRgEB.js"),__vite__mapDeps([325,1,2,319,5,99,3,100,316,51,79,317,253,92,258,256,4,6,54,122,123,53]))),z8e=oe(()=>X(()=>import("./EditOrderCustomerPage-CMDCWhW7.js"),__vite__mapDeps([326,1,2,99,3,100,101,102,322,79,186,4,5,6]))),W8e=oe(()=>X(()=>import("./EditOrderAddressPage-C_vuERsT.js"),__vite__mapDeps([327,1,2,106,3,99,100,101,102,104,108,5,4,6]))),q8e=oe(()=>X(()=>import("./SubscriptionDebugPage-lNp_ejuC.js"),__vite__mapDeps([328,1,2,30,3,4,5,6]))),G8e=oe(()=>X(()=>import("./PagaleveAddressSelectPage-CaH4vLnz.js"),__vite__mapDeps([329,1,2,106,3,142,5,99,100,4,6]))),K8e=oe(()=>X(()=>import("./OrderProfitabilityPage-C7mbA8rw.js"),__vite__mapDeps([330,1,2,99,3,100,331,205,206,86,87,4,5,6]))),Y8e=oe(()=>X(()=>import("./ProductProfitabilityPage-wMKo3D41.js"),__vite__mapDeps([332,1,2,43,3,61,331,205,206,55,4,5,6]))),Z8e=oe(()=>X(()=>import("./VariationProfitabilityPage-LwzOr1Bu.js"),__vite__mapDeps([333,1,2,331,205,206,55,3,43,4,5,6]))),X8e=oe(()=>X(()=>import("./OrderPaymentSelectionPage-D2rLNwpd.js"),__vite__mapDeps([334,1,2,99,3,100,284,286,5,109,110,111,112,281,287,275,4,6]))),J8e=oe(()=>X(()=>import("./OrderPaymentConfigPage-COYo6VaE.js"),__vite__mapDeps([335,1,2,99,3,100,105,109,110,5,111,112,336,4,6]))),Q8e=oe(()=>X(()=>import("./OrderPaymentAmountPage-Bs32bsyP.js"),__vite__mapDeps([337,1,2,99,3,100,338,336,287,339,5,4,6]))),eEe=oe(()=>X(()=>import("./OrderPaymentSuccessPage-CzE5_LoB.js"),__vite__mapDeps([340,1,2,109,110,5,111,112,99,3,100,105,4,6]))),tEe=oe(()=>X(()=>import("./OrderPaymentInstallmentsPage-BDf76bPd.js"),__vite__mapDeps([341,1,2,99,3,100,105,342,113,114,109,110,5,111,112,115,287,4,6]))),rEe=oe(()=>X(()=>import("./OrderPaymentInstallmentPaymentPage-B1AkrJXp.js"),__vite__mapDeps([343,1,2,99,3,100,105,143,144,132,129,5,284,273,287,275,344,342,345,109,110,111,112,4,6]))),nEe=oe(()=>X(()=>import("./OrderPaymentInstallmentConfigPage-B4YIa3Xg.js"),__vite__mapDeps([346,1,2,99,3,100,284,342,336,109,110,5,111,112,4,6]))),iEe=oe(()=>X(()=>import("./OrderPaymentFiadoPage-7WmzESRU.js"),__vite__mapDeps([347,1,2,99,3,100,342,4,5,6]))),oEe=oe(()=>X(()=>import("./OrderPaymentFiadoViewPage-Dg_WrHh4.js"),__vite__mapDeps([348,1,2,99,3,100,105,342,113,114,5,4,6]))),sEe=oe(()=>X(()=>import("./OrderPaymentMercadoPagoPage-DRHo-uAB.js"),__vite__mapDeps([349,1,2,350,25,5,99,3,100,273,345,111,339,6,4]))),aEe=oe(()=>X(()=>
512import("./OrderPaymentMercadoPagoDetailsPage-shop2BI3.js"),__vite__mapDeps([351,1,2,350,25,5,99,3,100,105,111,103,102,6,4]))),lEe=oe(()=>X(()=>import("./OrderPaymentPagalevePage-CFiskwiE.js"),__vite__mapDeps([352,1,2,350,25,5,99,3,100,281,106,112,6,4]))),cEe=oe(()=>X(()=>import("./OrderPaymentPagaleveDetailsPage-BPG5kUpQ.js"),__vite__mapDeps([353,1,2,350,25,5,99,3,100,105,112,103,102,6,4]))),uEe=oe(()=>X(()=>import("./OrderPaymentPixPage-Dzz7DHW7.js"),__vite__mapDeps([354,1,2,99,3,100,132,338,336,131,129,110,5,4,6]))),dEe=oe(()=>X(()=>import("./OrderPaymentPixQrPage-CXi3g7Yi.js"),__vite__mapDeps([355,1,2,25,99,3,100,132,336,131,129,110,5,4,6]))),hEe=oe(()=>X(()=>import("./OrderPaymentManualPixDetailsPage-BoTasFMm.js"),__vite__mapDeps([356,1,2,99,3,100,105,110,5,103,102,6,4]))),fEe=oe(()=>X(()=>import("./OrderPaymentStoquiPayDetailsPage-B0vfQZ_p.js"),__vite__mapDeps([357,1,2,99,3,100,105,103,102,5,6,4]))),pEe=oe(()=>X(()=>import("./OrderPaymentAsaasDirectPage-DzlOL81p.js"),__vite__mapDeps([358,1,2,350,25,5,99,3,100,275,344,339,4,6]))),mEe=oe(()=>X(()=>import("./OrderPaymentAsaasDirectDetailsPage-FnJ-OelH.js"),__vite__mapDeps([359,1,2,350,25,5,99,3,100,105,103,102,6,4]))),gEe=oe(()=>X(()=>import("./ContasAReceberPage-CB4B1YCY.js"),__vite__mapDeps([360,1,2,5,361,362,3,234,144,132,129,363,114,109,110,111,112,284,4,6]))),vEe=oe(()=>X(()=>import("./CustomerContasAReceberPage-M9lLTBu7.js"),__vite__mapDeps([364,1,2,5,361,362,3,234,144,132,129,143,363,114,4,6]))),yEe=oe(()=>X(()=>import("./ContasAPagarPage-DJt2DG-N.js"),__vite__mapDeps([365,1,2,5,366,4,6,367,3,363,114]))),CC=oe(()=>X(()=>import("./ContaPagarFormPage-Kb82KZXS.js"),__vite__mapDeps([368,1,2,253,3,367,4,5,6]))),_Ee=oe(()=>X(()=>import("./ContaPagarViewPage-DYCj9yLe.js"),__vite__mapDeps([369,1,2,366,4,6,367,3,5]))),bEe=oe(()=>X(()=>import("./FluxoCaixaReportPage-4jyyj_R1.js"),__vite__mapDeps([370,1,2,371,198,5,234,3,4,6]))),xEe=oe(()=>X(()=>import("./FluxoCaixaEntradasPage-CoXcwryj.js"),__vite__mapDeps([372,1,2,362,3,234,5,371,198,4,6]))),wEe=oe(()=>X(()=>import("./CategoriasGastosPage-DPvf8Fm4.js"),__vite__mapDeps([373,1,2,367,3,5,6,4]))),EEe=oe(()=>X(()=>import("./DomainConfigPage-BXWVu7xs.js"),__vite__mapDeps([374,1,2,5,3,6,4]))),SEe=oe(()=>X(()=>import("./GoogleMerchantCenterPage-Bvk9qdOH.js"),__vite__mapDeps([375,1,2,3,4,5,6]))),CEe=oe(()=>X(()=>import("./GoogleVerificationTagPage-CSNCSDy9.js"),__vite__mapDeps([376,1,2,3,377,5,4,6]))),TEe=oe(()=>X(()=>import("./InstagramShoppingPage-CLFdcuf5.js"),__vite__mapDeps([378,1,2,3,4,5,6]))),AEe=oe(()=>X(()=>import("./FacebookVerificationTagPage-BG9T6TVu.js"),__vite__mapDeps([379,1,2,3,5,4,6]))),kEe=oe(()=>X(()=>import("./CustomPagesPage-Ce-BGQ6D.js"),__vite__mapDeps([380,1,2,195,3,381,5,4,6]))),TC=oe(()=>X(()=>import("./CustomPageFormPage-CmcSwOs4.js"),__vite__mapDeps([382,1,2,3,175,23,381,195,6,4,5]))),REe=oe(()=>X(()=>import("./CatalogExportPage-CHJd_-kY.js"),__vite__mapDeps([383,1,2,377,3,4,5,6]))),IEe=oe(()=>X(()=>import("./ProductLabelsPage-Cj87LsIr.js").then(e=>e.P),__vite__mapDeps([384,1,2,3,5,248,118]))),PEe=oe(()=>X(()=>import("./PriceChangeHistoryPage-CkRpnuo0.js"),__vite__mapDeps([385,1,2,3,6,4,5]))),OEe=oe(()=>X(()=>import("./LabelProductSelectionPage-DNRPUHaA.js"),__vite__mapDeps([386,1,2,79,80,51,5,3,4,6]))),jEe=oe(()=>X(()=>import("./AllProductsReportPage-f3EISiZ-.js"),__vite__mapDeps([387,1,2,198,199,5,51,3,200,4,6]))),LEe=oe(()=>X(()=>import("./AllCustomersReportPage-6RXlxEE4.js"),__vite__mapDeps([388,1,2,198,199,5,201,3,200,4,6]))),$Ee=oe(()=>X(()=>import("./StockBalanceReportPage-BhaUi4xB.js"),__vite__mapDeps([389,1,2,198,199,5,51,202,3,4,6]))),DEe=oe(()=>X(()=>import("./CouponUsageReportPage-Cjvle-i7.js"),__vite__mapDeps([390,1,2,198,199,5,203,3,200,4,6]))),MEe=oe(()=>X(()=>import("./SalesItemsReportPage-BFTIWlg4.js"),__vite__mapDeps([391,1,2,198,199,5,3,200,4,6]))),NEe=oe(()=>X(()=>import("./DailySalesReportPage-BjdTgLGi.js"),__vite__mapDeps([392,1,2,198,199,5,3,200,4,6]))),FEe=oe(()=>X(()=>import("./StockItemReportPage-CTDFWUj0.js"),__vite__mapDeps([393,1,2,200,3,4,5,6]))),UEe=oe(()=>X(()=>import("./PriceTablesPage-MZ6xBRst.js"),__vite__mapDeps([394,1,2,5,3,4,6]))),AC=oe(()=>X(()=>import("./PriceTableFormPage-CLdCU8tj.js"),__vite__mapDeps([395,1,2,3,4,5,6]))),BEe=oe(()=>X(()=>import("./PriceTablePage-D7H9Nn5k.js"),__vite__mapDeps([396,1,2,3,5,4,6]))),VEe=oe(()=>X(()=>import("./PriceTableAddProductPage-CVMnjfe7.js"),__vite__mapDeps([397,1,2,79,51,63,3,4,5,6]))),HEe=oe(()=>X(()=>import("./PriceTableCustomersPage-CuhRVxgK.js"),__vite__mapDeps([398,1,2,5,3,4,6]))),zEe=oe(()=>X(()=>import("./PriceTableCustomerSelectPage-BB_RHl4q.js"),__vite__mapDeps([399,1,2,79,3,4,5,6]))),WEe=oe(()=>X(()=>import("./StoreScorePage-B6uaGlvY.js"),__vite__mapDeps([400,1,2,3,4,5,6]))),qEe=oe(()=>X(()=>import("./ProductImprovementsPage-ho940c_9.js"),__vite__mapDeps([401,1,2,3,4,5,6]))),GEe=oe(()=>X(()=>import("./AffiliatePage-Tr0s3POk.js"),__vite__mapDeps([402,1,2,3,5,4,6]))),KEe=oe(()=>X(()=>import("./AffiliateDetailsPage-ChdbESiw.js"),__vite__mapDeps([403,1,2,3,5,4,6]))),YEe=oe(()=>X(()=>import("./AffiliateTermsPage-i-_dLkxg.js"),__vite__mapDeps([404,1,2,3,4,5,6]))),ZEe=oe(()=>X(()=>import("./AffiliateHowToUseCodePage-B-oQ6lSj.js"),__vite__mapDeps([405,1,2,3,4,5,6]))),XEe=oe(()=>X(()=>import("./AffiliateFAQPage-SPvQXUVV.js"),__vite__mapDeps([406,1,2,5,3,4,6]))),JEe=oe(()=>X(()=>import("./OrderSuperfreteLabelPage-DJsH7Rsd.js"),__vite__mapDeps([407,1,2,39,72,3,99,100,121,126,6,408,5,4]))),QEe
512=oe(()=>X(()=>import("./SuperfreteLabelPage-CXVEBz-z.js"),__vite__mapDeps([409,1,2,331,121,3,126,408,6,4,5]))),e9e=oe(()=>X(()=>import("./AbandonedCartsPage-CtTaqBCW.js"),__vite__mapDeps([410,1,2,3,5,4,6]))),t9e=oe(()=>X(()=>import("./AbandonedCartDetailPage-BBTuDpo_.js"),__vite__mapDeps([411,1,2,25,39,205,206,3,97,51,98,5,4,6]))),r9e=oe(()=>X(()=>import("./AbandonedCartMessageTemplatePage-JI9kaawc.js"),__vite__mapDeps([412,1,2,146,3,86,87,4,5,6]))),n9e=oe(()=>X(()=>import("./ReviewsPage-DnpIFXdS.js"),__vite__mapDeps([413,1,2,251,414,127,415,3,416,60,417,51,252,4,5,6]))),i9e=oe(()=>X(()=>import("./ProductReviewsPage-BTyLfJLA.js"),__vite__mapDeps([418,1,2,43,3,416,60,417,51,4,5,6]))),o9e=oe(()=>X(()=>import("./ReviewDetailPage-BEo4QPzy.js"),__vite__mapDeps([419,1,2,39,3,60,417,251,414,127,51,48,4,5,6]))),kC=oe(()=>X(()=>import("./ReviewFormPage-BjGsnyFy.js"),__vite__mapDeps([420,1,2,51,60,3,421,79,316,5,4,6]))),s9e=oe(()=>X(()=>import("./ReviewProductSelectPage-CoGDyAh_.js"),__vite__mapDeps([421,1,2,79,316,51,5,3,4,6]))),a9e=oe(()=>X(()=>import("./ReviewSettingsPage-DnGJ5H7B.js"),__vite__mapDeps([422,1,2,415,3,4,5,6]))),l9e=oe(()=>X(()=>import("./BannersScreen-CjFcYncy.js"),__vite__mapDeps([423,1,2,153,66,6,148,3,424,81,164,4,5]))),c9e=oe(()=>X(()=>import("./ChromeColorsScreen-COPz-y3A.js"),__vite__mapDeps([425,1,2,153,66,6,148,3,171,163,5,164,81,162,26,196,4]))),u9e=oe(()=>X(()=>import("./HomeLayoutScreen-BoDKfZf1.js"),__vite__mapDeps([426,1,2,196,5,153,66,6,148,3,192,161,164,81,303,78,79,80,51,194,45,70,68,69,195,424,26,163,4]))),RC=oe(()=>X(()=>import("./BannerEditScreen-Bp4sqp7n.js"),__vite__mapDeps([427,1,2,153,66,6,148,3,194,45,70,68,69,78,79,80,51,5,195,164,4]))),d9e=oe(()=>X(()=>import("./ImageStudioPage-DOtdV6RK.js"),__vite__mapDeps([428,1,2,71,3,70,169,152,146,250,39,429,167,168,6,4,5]))),h9e=oe(()=>X(()=>import("./ImageGenerationsPage-CDWT7xCz.js"),__vite__mapDeps([430,1,2,429,3,71,4,5,6]))),f9e=oe(()=>X(()=>import("./ImageStudioProductSelectPage-fNow3mqC.js"),__vite__mapDeps([431,1,2,79,316,51,5,3,4,6]))),p9e=oe(()=>X(()=>import("./CreditExtratoPage-B4h7Cr3I.js"),__vite__mapDeps([432,1,2,168,3,169,4,5,6]))),m9e=oe(()=>X(()=>import("./FreeCreditsPage-C4EaLC0J.js"),__vite__mapDeps([433,1,2,3,169,168,23,4,5,6]))),g9e=oe(()=>X(()=>import("./BuyCreditsPage-2gEpapZm.js"),__vite__mapDeps([434,1,2,81,3,28,169,4,5,6]))),v9e=oe(()=>X(()=>import("./AppPreferencesPage-4uE5wjBz.js"),__vite__mapDeps([435,1,2,146,3,4,5,6])));function y9e(){return c.jsxs(yb,{children:[c.jsxs(K,{element:c.jsx(X6e,{}),children:[c.jsx(K,{index:!0,element:c.jsx(hye,{})}),c.jsx(K,{path:"orders",element:c.jsx(ibe,{})}),c.jsx(K,{path:"customers",element:c.jsx(zbe,{})}),c.jsx(K,{path:"products",element:c.jsx(A6e,{})}),c.jsx(K,{path:"general",element:c.jsx(twe,{})})]}),c.jsxs(K,{element:c.jsx(Y6e,{}),children:[c.jsx(K,{path:"potencial",element:c.jsx(WEe,{})}),c.jsx(K,{path:"potencial/produtos",element:c.jsx(qEe,{})}),c.jsx(K,{path:"contas-a-receber",element:c.jsx(gEe,{})}),c.jsx(K,{path:"contas-a-pagar",element:c.jsx(xl,{title:"Contas a pagar",children:c.jsx(yEe,{})})}),c.jsx(K,{path:"contas-a-pagar/categorias",element:c.jsx(xl,{title:"Categorias de gastos",children:c.jsx(wEe,{})})}),c.jsx(K,{path:"contas-a-pagar/nova",element:c.jsx(xl,{title:"Nova conta",children:c.jsx(CC,{})})}),c.jsx(K,{path:"contas-a-pagar/:contaId",element:c.jsx(xl,{title:"Conta a pagar",children:c.jsx(_Ee,{})})}),c.jsx(K,{path:"contas-a-pagar/:contaId/editar",element:c.jsx(xl,{title:"Editar conta",children:c.jsx(CC,{})})}),c.jsx(K,{path:"reports/fluxo-caixa",element:c.jsx(xl,{title:"Fluxo de caixa",children:c.jsx(bEe,{})})}),c.jsx(K,{path:"reports/fluxo-caixa/entradas",element:c.jsx(xl,{title:"Entradas",children:c.jsx(xEe,{})})}),c.jsx(K,{path:"reports",element:c.jsx(Vwe,{})}),c.jsx(K,{path:"reports/analytics",element:c.jsx(A8e,{})}),c.jsx(K,{path:"reports/products",element:c.jsx(jEe,{})}),c.jsx(K,{path:"reports/customers",element:c.jsx(LEe,{})}),c.jsx(K,{path:"reports/stock-balance",element:c.jsx($Ee,{})}),c.jsx(K,{path:"reports/coupons",element:c.jsx(DEe,{})}),c.jsx(K,{path:"reports/sales-items",element:c.jsx(MEe,{})}),c.jsx(K,{path:"reports/daily-sales",element:c.jsx(NEe,{})}),c.jsx(K,{path:"reports/stock-items",element:c.jsx(FEe,{})}),c.jsx(K,{path:"reports/stock-movements",element:c.jsx(Hs,{to:"/reports/stock-balance",replace:!0})}),c.jsx(K,{path:"chats",element:c.jsx(owe,{})}),c.jsx(K,{path:"customers/new",element:c.jsx(xC,{})}),c.jsx(K,{path:"customers/birthdays/template",element:c.jsx(vwe,{})}),c.jsx(K,{path:"customers/:customerId/edit",element:c.jsx(xC,{})}),c.jsx(K,{path:"customers/:customerId/addresses",element:c.jsx(L8e,{})}),c.jsx(K,{path:"customers/:customerId/addresses/new",element:c.jsx(SC,{})}),c.jsx(K,{path:"customers/:customerId/addresses/:addressId/edit",element:c.jsx(SC,{})}),c.jsx(K,{path:"abandoned-carts",element:c.jsx(e9e,{})}),c.jsx(K,{path:"abandoned-carts/:pedidoId",element:c.jsx(t9e,{})}),c.jsx(K,{path:"abandoned-carts/message-template",element:c.jsx(r9e,{})}),c.jsx(K,{path:"reviews",element:c.jsx(Xt,{requiredPlan:"pro",trigger:"reviews",children:c.jsx(n9e,{})})}),c.jsx(K,{path:"reviews/new",element:c.jsx(Xt,{requiredPlan:"pro",trigger:"reviews",children:c.jsx(kC,{})})}),c.jsx(K,{path:"reviews/new/select-product",element:c.jsx(Xt,{requiredPlan:"pro",trigger:"reviews",children:c.jsx(s9e,{})})}),c.jsx(K,{path:"reviews/settings",element:c.jsx(Xt,{requiredPlan:"pro",trigger:"reviews",children:c.jsx(a9e,{})})}),c.jsx(K,{path:"reviews/:reviewId",element:c.jsx(Xt,{requiredPlan:"pro",trigger:"reviews",children:c.jsx(o9e,{})})}),c.jsx(K,{path:"reviews/:reviewId/edit",element:c.jsx(Xt,{requiredPlan:"pro",trigger:"reviews",children:c.jsx(kC,{})})}),c.jsx(K,{path:"profile",element:c.jsx(iwe,{})}),c.jsx(K,{path:"profile/pix",element:c.jsx(dwe,{})}),c.jsx(K,{path:"profile/pix/create",element:c.jsx(uwe,{})}),c.jsx(K,{path:"profile/payment-methods",element:c.jsx(E8e,{})}),c.jsx(K,{path:"profile/payment-methods/create",element:c.jsx(S8e,{})}),c.jsx(K,{path:"profile/payment-methods/:paymentMethodId/edit",element:c.jsx(C8e,{})}),c.jsx(K,{path:"profile/edit-profile",element:c.jsx(hwe,{})}),c.jsx(K,{path:"profile/billing-address",element:c.jsx(Kwe,{})}),c.jsx(K,{path:"profile/change-phone-number",element:c.jsx(pwe,{})}),c.jsx(K,{path:"profile/shipping",element:c.jsx(Hwe,{})}),c.jsx(K,{path:"profile/payments",element:c.jsx(x8e,{})}),c.jsx(K,{path:"profile/pay-on-delivery",element:c.jsx(Xt,{requiredPlan:"pro",trigger:"pay_on_delivery",children:c.jsx(w8e,{})})}
512),c.jsx(K,{path:"profile/checkout-settings",element:c.jsx(b8e,{})}),c.jsx(K,{path:"profile/fiscal",element:c.jsx(Ywe,{})}),c.jsx(K,{path:"profile/fiscal/empresa",element:c.jsx(Zwe,{})}),c.jsx(K,{path:"profile/fiscal/certificado",element:c.jsx(Xwe,{})}),c.jsx(K,{path:"profile/fiscal/configuracao",element:c.jsx(Jwe,{})}),c.jsx(K,{path:"profile/fiscal/defaults",element:c.jsx(Qwe,{})}),c.jsx(K,{path:"profile/fiscal/regras",element:c.jsx(e8e,{})}),c.jsx(K,{path:"profile/fiscal/regras/:id",element:c.jsx(t8e,{})}),c.jsx(K,{path:"profile/fiscal/notas",element:c.jsx(r8e,{})}),c.jsx(K,{path:"profile/analytics",element:c.jsx(Xt,{trigger:"pixels",children:c.jsx(T8e,{})})}),c.jsx(K,{path:"profile/mercadopago",element:c.jsx(y8e,{})}),c.jsx(K,{path:"profile/asaas",element:c.jsx(_8e,{})}),c.jsx(K,{path:"profile/pagaleve",element:c.jsx($8e,{})}),c.jsx(K,{path:"profile/pagaleve/connect",element:c.jsx(Xt,{requiredPlan:"lite",trigger:"pagaleve",children:c.jsx(D8e,{})})}),c.jsx(K,{path:"profile/google-merchant-center",element:c.jsx(Xt,{requiredPlan:"black",trigger:"google_shopping",children:c.jsx(SEe,{})})}),c.jsx(K,{path:"profile/google-merchant-center/verification",element:c.jsx(Xt,{requiredPlan:"black",trigger:"google_shopping",children:c.jsx(CEe,{})})}),c.jsx(K,{path:"profile/instagram-shopping",element:c.jsx(Xt,{requiredPlan:"black",trigger:"instagram_shopping",children:c.jsx(TEe,{})})}),c.jsx(K,{path:"profile/instagram-shopping/verification",element:c.jsx(Xt,{requiredPlan:"black",trigger:"instagram_shopping",children:c.jsx(AEe,{})})}),c.jsx(K,{path:"profile/shipping/combinar",element:c.jsx(n8e,{})}),c.jsx(K,{path:"profile/shipping/retirada",element:c.jsx(i8e,{})}),c.jsx(K,{path:"profile/shipping/free",element:c.jsx(zwe,{})}),c.jsx(K,{path:"profile/shipping/distance",element:c.jsx(Wwe,{})}),c.jsx(K,{path:"profile/shipping/custom",element:c.jsx(qwe,{})}),c.jsx(K,{path:"profile/shipping/address",element:c.jsx(Gwe,{})}),c.jsx(K,{path:"profile/shipping/melhorenvio",element:c.jsx(Xt,{requiredPlan:"lite",trigger:"shipping_melhor_envio",children:c.jsx(k8e,{})})}),c.jsx(K,{path:"profile/shipping/superfrete",element:c.jsx(Xt,{requiredPlan:"lite",trigger:"shipping_superfrete",children:c.jsx(R8e,{})})}),c.jsx(K,{path:"profile/shipping/uber",element:c.jsx(Xt,{requiredPlan:"lite",trigger:"shipping_uber",children:c.jsx(I8e,{})})}),c.jsx(K,{path:"profile/change-password",element:c.jsx(fwe,{})}),c.jsx(K,{path:"profile/web-catalog",element:c.jsx(ywe,{})}),c.jsx(K,{path:"profile/web-catalog/identity",element:c.jsx(_we,{})}),c.jsx(K,{path:"profile/web-catalog/contact",element:c.jsx(bwe,{})}),c.jsx(K,{path:"profile/web-catalog/checkout",element:c.jsx(xwe,{})}),c.jsx(K,{path:"profile/web-catalog/catalog",element:c.jsx(wwe,{})}),c.jsx(K,{path:"profile/web-catalog/chat",element:c.jsx(Ewe,{})}),c.jsx(K,{path:"profile/web-catalog/notifications",element:c.jsx(Swe,{})}),c.jsx(K,{path:"profile/store-appearance",element:c.jsx(Cwe,{})}),c.jsx(K,{path:"profile/store-appearance/brand",element:c.jsx(T
512we,{})}),c.jsx(K,{path:"profile/store-appearance/brand/ai-logo",element:c.jsx(Awe,{})}),c.jsx(K,{path:"profile/store-appearance/promo-strip",element:c.jsx(kwe,{})}),c.jsx(K,{path:"profile/store-appearance/product-cards",element:c.jsx(Rwe,{})}),c.jsx(K,{path:"profile/store-appearance/typography",element:c.jsx(Iwe,{})}),c.jsx(K,{path:"profile/store-appearance/footer",element:c.jsx(Pwe,{})}),c.jsx(K,{path:"profile/store-appearance/favicon",element:c.jsx(Owe,{})}),c.jsx(K,{path:"profile/app-preferences",element:c.jsx(v9e,{})}),c.jsx(K,{path:"profile/store-appearance/home",element:c.jsx(u9e,{})}),c.jsx(K,{path:"profile/store-appearance/colors",element:c.jsx(c9e,{})}),c.jsx(K,{path:"profile/store-appearance/banners",element:c.jsx(l9e,{})}),c.jsx(K,{path:"profile/store-appearance/banners/new",element:c.jsx(RC,{})}),c.jsx(K,{path:"profile/store-appearance/banners/:bannerId/edit",element:c.jsx(RC,{})}),c.jsx(K,{path:"profile/domain",element:c.jsx(Xt,{requiredPlan:"black",trigger:"custom_domain",children:c.jsx(EEe,{})})}),c.jsx(K,{path:"coupons",element:c.jsx(Xt,{trigger:"coupons",children:c.jsx(P8e,{})})}),c.jsx(K,{path:"coupons/new",element:c.jsx(Xt,{trigger:"coupons",children:c.jsx(wC,{})})}),c.jsx(K,{path:"coupons/:couponId/edit",element:c.jsx(Xt,{trigger:"coupons",children:c.jsx(wC,{})})}),c.jsx(K,{path:"chats/:chatId",element:c.jsx(swe,{})}),c.jsx(K,{path:"products/create",element:c.jsx(lwe,{})}),c.jsx(K,{path:"products/create-combo",element:c.jsx(gC,{})}),c.jsx(K,{path:"products/:productId/edit-combo",element:c.jsx(gC,{})}),c.jsx(K,{path:"products/create/attributes",element:c.jsx(yC,{})}),c.jsx(K,{path:"products/import",element:c.jsx(Xt,{trigger:"bulk_import_products",children:c.jsx(Dwe,{})})}),c.jsx(K,{path:"products/import/:importId",element:c.jsx(Xt,{trigger:"bulk_import_products",children:c.jsx(Mwe,{})})}),c.jsx(K,{path:"customers/import",element:c.jsx(Xt,{trigger:"bulk_import_customers",children:c.jsx(Nwe,{})})}),c.jsx(K,{path:"customers/import/:importId",element:c.jsx(Xt,{trigger:"bulk_import_customers",children:c.jsx(Fwe,{})})}),c.jsx(K,{path:"customers/contacts-import",element:c.jsx(Hs,{to:"/customers/import",replace:!0})}),c.jsx(K,{path:"products/:productId",element:c.jsx(awe,{})}),c.jsx(K,{path:"products/:productId/edit",element:c.jsx(mwe,{})}),c.jsx(K,{path:"image-studio",element:c.jsx(d9e,{})}),c.jsx(K,{path:"image-studio/generations",element:c.jsx(h9e,{})}),c.jsx(K,{path:"image-studio/use-in-product",element:c.jsx(f9e,{})}),c.jsx(K,{path:"image-studio/credits",element:c.jsx(p9e,{})}),c.jsx(K,{path:"image-studio/buy-credits",element:c.jsx(g9e,{})}),c.jsx(K,{path:"image-studio/free-credits",element:c.jsx(m9e,{})}),c.jsx(K,{path:"products/:productId/profitability",element:c.jsx(Y8e,{})}),c.jsx(K,{path:"products/:productId/profitability/variations/:variationId",element:c.jsx(Z8e,{})}),c.jsx(K,{path:"products/:productId/attributes",element:c.jsx(yC,{})}),c.jsx(K,{path:"products/:productId/reviews",element:c.jsx(Xt,{requiredPlan:"pro",trigger:"reviews",children:c.jsx(i9e,{})})}),c.jsx(K,{path:"products/:productId/variations",element:c.jsx(l8e,{})}),c.jsx(K,{path:"products/:productId/digital-delivery",element:c.jsx(Xt,{requiredPlan:"pro",trigger:"digital_product",children:c.jsx(c8e,{})})}),c.jsx(K,{path:"products/:productId/digital-delivery/variations/:variationId",element:c.jsx(Xt,{requiredPlan:"pro",trigger:"digital_product",children:c.jsx(u8e,{})})}),c.jsx(K,{path:"products/:productId/variations/:variationId/edit",element:c.jsx(d8e,{})}),c.jsx(K,{path:"categories",element:c.jsx(Uwe,{})}),c.jsx(K,{path:"categories/:categoryId",element:c.jsx(vC,{})}),c.jsx(K,{path:"categories/:categoryId/images",element:c.jsx(Bwe,{})}),c.jsx(K,{path:"categories/:categoryId/edit",element:c.jsx(vC,{})}),c.jsx(K,{path:"attributes",element:c.jsx(o8e,{})}),c.jsx(K,{path:"attributes/new",element:c.jsx(a8e,{})}),c.jsx(K,{path:"attributes/:attributeId/edit",element:c.jsx(s8e,{})}),c.jsx(K,{path:"orders/new/",element:c.jsx(M8e,{})}),c.jsx(K,{path:"orders/new/products",element:c.jsx(N8e,{})}),c.jsx(K,{path:"orders/new/details",element:c.jsx(F8e,{})}),c.jsx(K,{path:"orders/new/customer",element:c.jsx(U8e,{})}),c.jsx(K,{path:"orders/new/address/:customerId",element:c.jsx(B8e,{})}),c.jsx(K,{path:"orders/:orderId",element:c.jsx(cwe,{})}),c.jsx(K,{path:"orders/:orderId/profitability",element:c.jsx(K8e,{})}),c.jsx(K,{path:"orders/:orderId/edit/products",element:c.jsx(V8e,{})}),c.jsx(K,{path:"orders/:orderId/edit/products/search",element:c.jsx(H8e,{})}),c.jsx(K,{path:"orders/:orderId/edit/customer",element:c.jsx(z8e,{})}),c.jsx(K,{path:"orders/:orderId/edit/address",element:c.jsx(W8e,{})}),c.jsx(K,{path:"orders/:orderId/pagaleve/address",element:c.jsx(G8e,{})}),c.jsx(K,{path:"orders/:id/superfrete-label",element:c.jsx(JEe,{})}),c.jsx(K,{path:"orders/:orderId/superfrete-label/:labelId",element:c.jsx(QEe,{})}),c.jsx(K,{path:"customers/:customerId",element:c.jsx(gwe,{})}),c.jsx(K,{path:"customers/:customerId/contas-a-receber",element:c.jsx(vEe,{})}),c.jsx(K,{path:"notifications",element:c.jsx($we,{})}),c.jsx(K,{path:"debug",element:c.jsx(jwe,{})}),c.jsx(K,{path:"debug/printer",element:c.jsx(Lwe,{})}),c.jsx(K,{path:"debug/subscription",element:c.jsx(q8e,{})}),c.jsx(K,{path:"stock",element:c.jsx(_C,{})}),c.jsx(K,{path:"stock/products/:productId",element:c.jsx(h8e,{})}),c.jsx(K,{path:"suppliers",element:c.jsx(f8e,{})}),c.jsx(K,{path:"suppliers/:supplierId",element:c.jsx(p8e,{})}),c.jsx(K,{path:"suppliers/:supplierId/edit",element:c.jsx(bC,{})}),c.jsx(K,{path:"suppliers/new",element:c.jsx(bC,{})}),c.jsx(K,{path:"custom-pages",element:c.jsx(Xt,{requiredPlan:"pro",trigger:"content_pages",children:c.jsx(kEe,{})})}),c.jsx(K,{path:"custom-pages/new",element:c.jsx(Xt,{requiredPlan:"pro",trigger:"content_pages",children:c.jsx(v.Suspense,{fallback:null,children:c.jsx(TC,{})})})}),c.jsx(K,{path:"custom-pages/:pageId/edit",element:c.jsx(Xt,{requiredPlan:"pro",trigger:"content_pages",children:c.jsx(v.Suspense,{fallback:null,children:c.jsx(TC,{})})})}),c.jsx(K,{path:"stock/products/",element:c.jsx(_C,{})}),c.jsx(K,{path:"stock/products/:productId/variation/:variationId",element:c.jsx(m8e,{})}),c.jsx(K,{path:"stock/movements/:movementId",element:c.jsx(g8e,{})}),c.jsx(K,{path:"stock/movements/:movementId/edit",element:c.jsx(v8e,{})}),c.jsx(K,{path:"profile/subscription",element:c.jsx(O8e,{})}),c.jsx(K,{path:"profile/paywall",element:c.jsx(j8e,{})}),c.jsx(K,{path:"profile/compare-plans",element:c.jsx(EC,{})}),c.jsx(K,{path:"profile/subscription/benefits",element:c.jsx(EC,{})}),c.jsx(K,{path:"orders/:orderId/payment-selection",element:c.jsx(wa,{children:c.jsx(X8e,{})})}),c.jsx(K,{path:"orders/:orderId/payment/config",element:c.jsx(wa,{children:c.jsx(J8e,{})})}),c.jsx(K,{path:"orders/:orderId/payment/amount",element:c.jsx(wa,{children:c.jsx(Q8e,{})})}),c.jsx(K,{path:"orders/:orderId/payment/pix",element:c.jsx(wa,{children:c.jsx(uEe,{})})}),c.jsx(K,{path:"orders/:orderId/payment/pix/qr",element:c.jsx(wa,{children:c.jsx(dEe,{})})}),c.jsx(K,{path:"orders/:orderId/payment/pix/:paymentId",element:c.jsx(hEe,{})}),c.jsx(K,{path:"orders/:orderId/payment/success",element:c.jsx(wa,{children:c.jsx(eEe,{})})}),c.jsx(K,{path:"orders/:orderId/payment/installments",element:c.jsx(tEe,{})}),c.jsx(K,{path:"orders/:orderId/payment/installment-config",element:c.jsx(Xt,{requiredPlan:"pro",trigger:"payment_installments",children:c.jsx(nEe,{})})}),c.jsx(K,{path:"orders/:orderId/payment/installment/:installmentId/payment",element:c.jsx(Xt,{requiredPlan:"pro",trigger:"payment_installments",children:c.jsx(rEe,{})})}),c.jsx(K,{path:"orders/:orderId/payment/fiado",element:c.jsx(Xt,{requiredPlan:"pro",trigger:"payment_fiado",children:c.jsx(iEe,{})})}),c.jsx(K,{path:"orders/:orderId/payment/fiado/:parcelaId",element:c.jsx(Xt,{requiredPlan:"pro",trigger:"payment_fiado",children:c.jsx(oEe,{})})}),c.jsx(K,{path:"orders/:orderId/payment/mercadopago",element:c.jsx(wa,{children:c.jsx(sEe,{})})}),c.jsx(K,{path:"orders/:orderId/payment/mercadopago/:paymentId",element:c.jsx(aEe,{})}),c.jsx(K,{path:"orders/:orderId/payment/pagaleve",element:c.jsx(lEe,{})}),c.jsx(K,{path:"orders/:orderId/payment/pagaleve/:paymentId",element:c.jsx(cEe,{})}),c.jsx(K,{path:"orders/:orderId/payment/asaas-direct",element:c.jsx(wa,{children:c.jsx(pEe,{})})}),c.jsx(K,{path:"orders/:orderId/payment/asaas-direct/:paymentId",element:c.jsx(mEe,{})}),c.jsx(K,{path:"orders/:orderId/payment/stoqui-pay/:paymentId",element:c.jsx(v.Suspense,{fallback:null,children:c.jsx(fEe,{})})}),c.jsx(K,{path:"export-catalog",element:c.jsx(REe,{})}),c.jsx(K,{path:"general/product-labels",element:c.jsx(IEe,{})}),c.jsx(K,{path:"general/price-changes",element:c.jsx(PEe,{})}),c.jsx(K,{path:"general/product-labels/select",element:c.jsx(OEe,{})}),c.jsx(K,{path:"price-tables",element:c.jsx(UEe,{})}),c.jsx(K,{path:"price-tables/new",element:c.jsx(AC,{})}),c.jsx(K,{path:"price-tables/:tableId",element:c.jsx(BEe,{})}),c.jsx(K,{path:"price-tables/:tableId/edit",element:c.jsx(AC,{})}),c.jsx(K,{path:"price-tables/:tableId/prices",element:c.jsx(VEe,{})}),c.jsx(K,{path:"price-tables/:tableId/customers",element:c.jsx(HEe,{})}),c.jsx(K,{path:"price-tables/:tableId/customers/add",element:c.jsx(zEe,{})}),c.jsx(K,{path:"affiliate",element:c.jsx(GEe,{})}),c.jsx(K,{path:"affiliate/details",element:c.jsx(KEe,{})}),c.jsx(K,{path:"affiliate/terms",element:c.jsx(YEe,{})}),c.jsx(K,{path:"affiliate/how-to-use-code",element:c.jsx(ZEe,{})}),c.jsx(K,{path:"affiliate/faq",element:c.jsx(XEe,{})})]}),c.jsx(K,{path:"*",element:c.jsx(Hs,{to:"/",replace:!0})})]})}const _9e=v.forwardRef((e,t)=>
512{const[r,n]=v.useState(!1),i=()=>{n(!r)};return c.jsx(Ci,{...e,type:r?"text":"password",ref:t,InputProps:{...e.InputProps,endAdornment:c.jsx(Us,{position:"end",children:c.jsx(mr,{"aria-label":"toggle password visibility",onClick:i,edge:"end",children:r?c.jsx(VC,{}):c.jsx(RM,{})})})}})});function A_(e,t){switch(console.log(e),e){case"A user with this phone number has already been registered":return"Um usuário com este número de telefone já foi registrado. Caso seja você, faça login com o seu telefone, e exclua a conta antiga.";case"Invalid login credentials":return"Usuário ou senha inválidos";case"Email not confirmed":return"Seu email ainda não foi confirmado. Verifique sua caixa de entrada e spam.";case"A user with this email address has already been registered":return"Um usuário com este email já foi registrado";case"Signups not allowed for otp":return"Nenhuma conta com este email. Crie uma nova conta, ou tente fazer login com o seu telefone.";case"Token has expired or is invalid":case"Email link is invalid or has expired":case"Otp has expired":return"Este link de acesso expirou ou já foi usado. Solicite um novo link abaixo.";default:return t||e}}const b9e=ca().shape({email:no().email("Não é um e-mail válido").required("Obrigatório"),password:no().required("Obrigatório")}),x9e=()=>{var l,d;const[e,t]=v.useState(!1),[r,n]=v.useState(null),{register:i,handleSubmit:o,formState:{errors:s}}=cl({resolver:dl(b9e)}),a=async({email:u,password:h})=>{t(!0);const{error:f}=await Te.auth.signInWithPassword({email:u,password:h});f&&n(f.message),t(!1)};return c.jsx(F,{sx:{padding:"16px"},children:c.jsxs("form",{onSubmit:o(a),children:[c.jsx(V,{variant:"h4",fontSize:"x-large",fontWeight:500,gutterBottom:!0,mb:4,sx:{textAlign:"center",color:"primary.main"},children:"Login"}),c.jsxs(me,{spacing:2,children:[c.jsx(Ci,{label:"Email",variant:"outlined",error:!!s.email,helperText:(l=s.email)==null?void 0:l.message,...i("email"),inputProps:{autoComplete:"email",autoCapitalize:"none",autoCorrect:"off"},fullWidth:!0}),c.jsx(_9e,{label:"Senha",variant:"outlined",error:!!s.password,helperText:(d=s.password)==null?void 0:d.message,...i("password"),inputProps:{autoComplete:"current-password",autoCapitalize:"none",autoCorrect:"off"},fullWidth:!0}),c.jsx(De,{type:"submit",variant:"contained",disabled:e,fullWidth:!0,children:e?c.jsx(bn,{size:24}):"Login"}),r&&c.jsx(zn,{severity:"error",children:A_(r)})]})]})})},w9e=ca().shape({phone:no().test("phone-format","Número de telefone inválido",e=>hj(e||"")).required("Obrigatório")}),E9e=()=>{const[e,t]=v.useState(!1),[r,n]=v.useState(!1),[i,o]=v.useState(!1),[s,a]=v.useState(null),l=At(),{data:d}=co(),u=qe.getPlatform()==="ios",h=(d==null?void 0:d.ENABLE_GOOGLE_LOGIN)==="true"&&!u,f=(d==null?void 0:d.ENABLE_MAGIC_LINK_LOGIN)==="true",{handleSubmit:p,control:m,formState:{errors:g}}=cl({resolver:dl(w9e)}),y=async({phone:A})=>{if(pe(fe.AUTH.LOGIN_START,{method:"phone",phone:A.replace(/\D/g,"")}),A.replace(/\D/g,"")==="5502020202020"){l("/auth/login");return}t(!0);const{error:w}=await Te.auth.signInWithOtp({phone:A.replace(/\D/g,""),options:{channel:"whatsapp"}});if(w){const _=nB(w),x=_?rB():void 0;pe(fe.AUTH.LOGIN_PHONE_ERROR,{error:w.message,errorCode:w.code,connection:_,host:x}),a({message:w.message,connection:_,host:x})}else l("/auth/verify-phone?phone="+A.replace(/\D/g,""));t(!1)},b=async()=>{n(!0),a(null);try{pe(fe.AUTH.LOGIN_START,{method:"google"});const{signInWithGoogle:A}=await X(()=>Promise.resolve().then(()=>$A),void 0),w=await A();w.user&&w.user.email?pe(fe.AUTH.LOGIN_SUCCESS,{method:"google",email:w.user.email}):pe(fe.AUTH.LOGIN_SUCCESS,{method:"google",platform:"web"})}catch(A){if(A.message&&A.message.toLowerCase().includes("cancelled by user")){n(!1);return}pe(fe.AUTH.LOGIN_PHONE_ERROR,{method:"google",error:A.message||"Unknown error"}),a({message:`Erro ao conectar com Google: ${A.message}`,connection:!1}),n(!1)}},E=()=>{pe(fe.APP.SUPABASE_HOST_RESET,{from:"login"}),tB(),window.location.reload()},S=async()=>{o(!0),a(null);try{pe(fe.AUTH.LOGIN_START,{method:"email_magic_link"}),l("/auth/email-login")}catch{a({message:"Erro ao redirecionar para login por email",connection:!1}),o(!1)}},k=h||f;return c.jsx(F,{sx:{padding:"16px"},children:c.jsxs("form",{onSubmit:p(y),children:[c.jsx(V,{variant:"h4",fontSize:"x-large",fontWeight:500,gutterBottom:!0,mb:4,sx:{textAlign:"center",color:"primary.main"},children:"Entre na sua conta"}),c.jsxs(me,{spacing:2,children:[c.jsx(ss,{name:"phone",control:m,render:({field:{ref:A,value:w,onChange:_,onBlur:x}})=>{var C;return c.jsx(dj,{inputRef:A,value:w||"",onChange:_,onBlur:x,lockPrefix:!0,label:"Número de telefone",fullWidth:!0,error:!!g.phone,helperText:(C=g.phone)==null?void 0:C.message})}}),c.jsx(If,{type:"submit",variant:"contained",loading:e,fullWidth:!0,disabled:r||i,startIcon:c.jsx(Rf,{}),children:"Receber código"}
512),k&&c.jsx(Om,{sx:{my:2},children:c.jsx(V,{variant:"body2",color:"text.secondary",children:"ou"})}),h&&c.jsx(De,{variant:"outlined",fullWidth:!0,startIcon:r?c.jsx(bn,{size:20}):c.jsx("img",{src:fj,alt:"Google",style:{width:20,height:20}}),onClick:b,disabled:e||r||i,sx:{textTransform:"none",borderColor:"divider",color:"text.primary","&:hover":{borderColor:"primary.main",backgroundColor:"action.hover"}},children:r?"Conectando...":"Entrar com Google"}),f&&c.jsx(De,{variant:"outlined",fullWidth:!0,startIcon:i?c.jsx(bn,{size:20}):c.jsx(I_,{}),onClick:S,disabled:e||r||i,sx:{textTransform:"none",borderColor:"divider",color:"text.primary","&:hover":{borderColor:"primary.main",backgroundColor:"action.hover"}},children:i?"Redirecionando...":"Entrar com email"}),c.jsx(De,{variant:"text",fullWidth:!0,size:"small",onClick:()=>l("/"),disabled:e||r||i,sx:{textTransform:"none",fontSize:"0.875rem",mt:2},children:"Ainda não tem uma conta?"}),s&&(s.connection?c.jsxs(_s,{severity:"error",title:"Não foi possÃvel conectar",action:c.jsx(De,{size:"small",onClick:E,children:"Tentar reconectar"}),children:["Não conseguimos falar com o servidor. Confira sua internet e toque em tentar reconectar.",s.host&&c.jsxs(V,{variant:"caption",color:"text.secondary",display:"block",mt:.5,children:["(",s.host,")"]})]}):c.jsx(_s,{severity:"error",children:s.message}))]})]})})},S9e=ca().shape({email:no().required("E-mail é obrigatório").email("E-mail inválido")}),C9e=()=>{const[e,t]=v.useState(!1),[r,n]=v.useState(!1),[i,o]=v.useState(null),[s,a]=ws(),l=At(),d=s.get("token_hash"),u=s.get("type"),h=!!d&&u==="email",[f,p]=v.useState(h),[m,g]=v.useState(null),y=v.useRef(!1),{handleSubmit:b,control:E,formState:{errors:S},getValues:k}=cl({resolver:dl(S9e),defaultValues:{email:""}});v.useEffect(()=>{if(!h||y.current)return;y.current=!0,(async()=>{try{pe(fe.AUTH.MAGIC_LINK_LOGIN_START);const{data:x,error:C}=await Te.auth.verifyOtp({token_hash:d,type:"email"});if(C){pe(fe.AUTH.MAGIC_LINK_LOGIN_ERROR,{error:C.message,errorCode:C.code}),g(C.message),p(!1);return}if(x.session){pe(fe.AUTH.MAGIC_LINK_LOGIN_SUCCESS,{email:x.session.user.email});return}g("Não foi possÃvel criar a sessão"),p(!1)}catch{pe(fe.AUTH.MAGIC_LINK_LOGIN_ERROR,{error:"Unexpected error"}),g("Erro inesperado ao validar o link"),p(!1)}})()},[h,d]);const A=()=>{a({},{replace:!0}),g(null),p(!1)},w=async({email:_})=>{t(!0),o(null);try{pe(fe.AUTH.LOGIN_START,{method:"email_magic_link",email:_});const x=window.location.search||"?",C=`https://app.stoqui.com.br${window.location.pathname}${x}`,{error:P}=await Te.auth.signInWithOtp({email:_,options:{shouldCreateUser:!1,emailRedirectTo:C}});P?(pe(fe.AUTH.LOGIN_PHONE_ERROR,{method:"email_magic_link",error:P.message,errorCode:P.code,email:_}),o(P.message)):(pe(fe.AUTH.LOGIN_SUCCESS,{method:"email_magic_link",email:_}),n(!0))}catch{pe(fe.AUTH.LOGIN_PHONE_ERROR,{method:"email_magic_link",error:"Unexpected error",email:_}),o("Ocorreu um erro ao enviar o link de confirmação")}t(!1)};return f?c.jsxs(F,{sx:{padding:"16px"},children:[c.jsx(V,{variant:"h4",fontSize:"x-large",fontWeight:500,gutterBottom:!0,mb:4,sx:{textAlign:"center",color:"primary.main"},children:"Validando seu link"}),c.jsxs(me,{spacing:3,alignItems:"center",children:[c.jsx(bn,{size:48}),c.jsx(V,{variant:"body1",color:"text.secondary",textAlign:"center",children:"Aguarde enquanto confirmamos seu acesso..."})]})]}):m?c.jsxs(F,{sx:{padding:"16px"},children:[c.jsx(V,{variant:"h4",fontSize:"x-large",fontWeight:500,gutterBottom:!0,mb:4,sx:{textAlign:"center",color:"primary.main"},children:"Link expirado"}),c.jsxs(me,{spacing:2,children:[c.jsx(zn,{severity:"error",children:A_(m)}),c.jsx(V,{variant:"body2",color:"text.secondary",textAlign:"center",children:"Por segurança, os links de acesso são válidos por pouco tempo e só podem ser usados uma vez."}),c.jsx(De,{variant:"contained",fullWidth:!0,onClick:A,children:"Solicitar novo link"}),c.jsx(De,{variant:"text",fullWidth:!0,size:"small",onClick:()=>l("/auth/phone-login"),sx:{textTransform:"none",fontSize:"0.875rem"},children:"Entrar com telefone"})]})]}):r?c.jsxs(F,{sx:{padding:"16px"},children:[c.jsx(V,{variant:"h4",fontSize:"x-large",fontWeight:500,gutterBottom:!0,mb:4,sx:{textAlign:"center",color:"primary.main"},children:"E-mail enviado"}),c.jsxs(me,{spacing:2,children:[c.jsxs(V,{variant:"body1",color:"text.secondary",textAlign:"center",children:["Verifique sua caixa de entrada e clique no link que enviamos para"," ",c.jsx("strong",{children:k("email")})]}),c.jsxs(V,{variant:"body2",color:"text.secondary",textAlign:"center",sx:{fontStyle:"italic",mt:1},children:["Se não encontrar na caixa de entrada, confira também a pasta de"," ",c.jsx("strong",{children:"spam"}),"."]}),c.jsx(De,{variant:"contained",fullWidth:!0,onClick:()=>{n(!1),o(null)},children:"Tentar novamente"}),c.jsx(De,{variant:"text",fullWidth:!0,size:"small",onClick:()=>l("/"),sx:{textTransform:"none",fontSize:"0.875rem"},children:"Ainda não tem uma conta?"})]})]}):c.jsx(F,{sx:{padding:"16px"},children:c.jsxs("form",{onSubmit:b(w),children:[c.jsx(V,{variant:"h4",fontSize:"x-large",fontWeight:500,gutterBottom:!0,mb:4,sx:{textAlign:"center",color:"primary.main"},children:"Entre com seu e-mail"}),c.jsxs(me,{spacing:2,children:[c.jsx(ss,{name:"email",control:E,render:({field:_})=>{var x;return c.jsx(Ci,{..._,label:"E-mail",type:"email",fullWidth:!0,variant:"outlined",error:!!S.email,helperText:(x=S.email)==null?void 0:x.message,placeholder:"[email protected]",autoComplete:"email",autoFocus:!0})}}),c.jsx(If,{type:"submit",variant:"contained",loading:e,fullWidth:!0,children:"Enviar link"}),c.jsx(De,{variant:"text",fullWidth:!0,size:"small",onClick:()=>l("/"),sx:{textTransform:"none",fontSize:"0.875rem"},children:"Ainda não tem uma conta?"}),i&&c.jsx(zn,{severity:"error",children:A_(i)})]})]})})},IC=1.5,T9e=({onClick:e,channel:t="whatsapp",phone:r})=>t==="sms"?c.jsxs(zn,{icon:c.jsx(IM,{sx:{color:"#1976d2",fontSize:22,mt:.5}}),sx:{background:"#eaf3fa",color:"#174076",borderRadius:IC,boxShadow:"none",py:1,px:1.5,alignItems:"flex-start",fontSize:15}
512,onClick:e,elevation:0,children:[c.jsx(Q0,{sx:{fontWeight:600,fontSize:15,mb:.25,display:"flex",alignItems:"center"},children:"Código enviado por SMS"}),c.jsxs(F,{component:"span",sx:{fontWeight:400,fontSize:13,color:"#22518a"},children:["Digite o código recebido por SMS"," ",r?` no número ${Hu(r)}`:"","."]})]}):c.jsxs(zn,{icon:c.jsx(Rf,{sx:{color:"#25D366",fontSize:22,mt:.5}}),sx:{background:"#eafaf3",color:"#1c4637",borderRadius:IC,boxShadow:"none",py:1,px:1.5,alignItems:"flex-start",fontSize:15},onClick:e,elevation:0,children:[c.jsx(Q0,{sx:{fontWeight:600,fontSize:15,mb:.25,display:"flex",alignItems:"center"},children:"Código enviado por WhatsApp"}),c.jsxs(F,{component:"span",sx:{fontWeight:400,fontSize:13,color:"#234b3a"},children:["Digite o código que foi enviado para você no WhatsApp"," ",r?` ${Hu(r)}`:"","."]})]}),A9e=({phone:e,onError:t,channel:r="whatsapp"})=>{const[n,i]=v.useState(!1),o=async s=>{if(s.preventDefault(),n)return;pe(fe.AUTH.RESEND_OTP,{method:"phone",phone:e.replace(/\D/g,"")});const{error:a}=await Te.auth.signInWithOtp({phone:e,options:r==="sms"?{channel:"sms"}:{channel:"whatsapp"}});a?(pe(fe.AUTH.LOGIN_PHONE_ERROR,{error:a.message,errorCode:a.code,isResend:!0}),t("Erro ao reenviar o código")):i(!0)};return n?c.jsxs(rt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3},style:{display:"flex",alignItems:"center",gap:8},children:[c.jsx(io,{sx:{fontSize:16,color:"success.main"}}),c.jsx("span",{style:{color:"success.main"},children:"Código reenviado"})]}):c.jsx(R_,{component:"button",type:"button",onClick:o,children:"Reenviar código"})},k9e=({phone:e,onError:t,onSuccess:r})=>{const[n,i]=v.useState(!1),o=async s=>{if(s.preventDefault(),n)return;pe(fe.AUTH.FORCED_SMS,{method:"phone",phone:e.replace(/\D/g,"")});const{error:a}=await Te.auth.signInWithOtp({phone:e,options:{channel:"sms"}});a?(pe(fe.AUTH.LOGIN_PHONE_ERROR,{error:a.message,errorCode:a.code,channel:"sms"}),t("Erro ao enviar código por SMS")):(i(!0),r())};return n?c.jsxs(rt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3},style:{display:"flex",alignItems:"center",gap:8},children:[c.jsx(io,{sx:{fontSize:16,color:"success.main"}}),c.jsx("span",{style:{color:"success.main"},children:"Código enviado por SMS"})]}):c.jsx(R_,{component:"button",type:"button",onClick:o,children:"Receber por SMS"})},R9e=ca().shape({otp:no().length(6,"Código inválido").required("Obrigatório")}),I9e=()=>{const[e,t]=v.useState(30),[r,n]=v.useState(!1),[i,o]=v.useState(null),[s,a]=v.useState("whatsapp"),{control:l,handleSubmit:d,watch:u,setValue:h,formState:{errors:f}}=cl({resolver:dl(R9e)}),p=At(),[m]=ws(),g=m.get("phone")||"";v.useEffect(()=>{const b=setInterval(()=>{t(E=>E>0?E-1:0)},1e3);return()=>clearInterval(b)},[]);const y=v.useCallback(async b=>{var k,A;n(!0),o(null);const{error:E,data:S}=await Te.auth.verifyOtp({phone:g,token:b.otp,type:"sms"});E?(pe(fe.AUTH.LOGIN_OTP_ERROR,{error:E.message,errorCode:E.code}),o("Código inválido"),h("otp",""),n(!1)):(pe(fe.AUTH.LOGIN_SUCCESS,{method:"phone",isNewUser:((k=S==null?void 0:S.user)==null?void 0:k.created_at)===((A=S==null?void 0:S.user)==null?void 0:A.updated_at)}),p("/"))},[g,p,h,s]);return v.useEffect(()=>{const b=u(E=>{var S;((S=E.otp)==null?void 0:S.length)===6&&d(y)()});return()=>b.unsubscribe()},[u,d,y]),c.jsx(F,{sx:{padding:"16px"},children:c.jsxs("form",{onSubmit:d(y),children:[c.jsx(V,{variant:"h4",fontSize:"x-large",fontWeight:500,sx:{textAlign:"center",color:"primary.main",mb:2},children:"Verificar telefone"}),c.jsx(F,{sx:{width:"100%",mb:2},children:c.jsx(T9e,{channel:s,phone:g})}),c.jsxs(me,{spacing:2,alignItems:"center",children:[c.jsx(ss,{name:"otp",control:l,render:({field:b})=>c.jsx(pj,{...b,length:6,sx:{gap:.5,flexShrink:0},autoFocus:!0,style:{width:"100%"},TextFieldsProps:{autoComplete:"one-time-code",autoCapitalize:"none",type:"tel",inputMode:"numeric",error:!!f.otp||!!i}})}),i&&c.jsx(J0,{error:!0,color:"error",children:i}),c.jsx(If,{type:"submit",variant:"contained",loading:r,fullWidth:!0,children:"Verificar"}),c.jsx(V,{variant:"body2",children:e>0?`Reenviar código em ${e}s`:c.jsx(A9e,{phone:g,onError:o,channel:s})}),e===0&&s==="whatsapp"&&c.jsx(V,{variant:"body2",children:c.jsx(k9e,{p
512hone:g,onError:o,onSuccess:()=>a("sms")})}),c.jsx(V,{variant:"body2",children:c.jsx(R_,{onClick:()=>{pe(fe.AUTH.CANCEL_OTP,{phone:g.replace(/\D/g,"")}),p("/auth/phone-login")},children:"Voltar"})})]})]})})},P9e="/assets/onboarding-slide-1-CMmHurVl.png",O9e="/assets/onboarding-slide-2-Dhplk1n3.png",j9e="/assets/onboarding-slide-3-5c2y4qJi.png",a5=[{image:j9e,title:"Vendas, estoque e catálogo num app só",body:"Registre as vendas do balcão e acompanhe o estoque em tempo real, sem caderno nem planilha"},{image:P9e,title:"Venda no balcão, no WhatsApp e online",body:"Compartilhe seu catálogo pelo WhatsApp e receba pedidos direto no app. Sua loja online já vem junto, grátis"},{image:O9e,title:"Uma IA que trabalha pra você",body:"Tire uma foto e a IA cadastra o produto com nome, descrição e preço. Na sua loja online, ela ainda responde clientes a qualquer hora"}],l5={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},L9e=()=>{const[e,t]=v.useState(0),[r,n]=v.useState(!1),[i,o]=v.useState(!0),s=At(),a=$o(),l=tl(a.breakpoints.up("md"));v.useEffect(()=>{const p=a5.map(y=>new Promise(b=>{const E=new Image;E.src=y.image,E.onload=()=>b(),E.onerror=()=>b()})),m=new Promise(y=>{const b=new Image;b.src=Ua,b.onload=()=>y(),b.onerror=()=>y()}),g=new Promise(y=>{const b=new Image;b.src=Ah,b.onload=()=>y(),b.onerror=()=>y()});Promise.all([...p,m,g]).then(()=>{n(!0),o(!1)}).catch(()=>{n(!0),o(!1)})},[]),v.useEffect(()=>{if(!r)return;const p=setInterval(()=>{t(m=>(m+1)%a5.length)},7e3);return()=>clearInterval(p)},[r]);const d=()=>{s("/auth/register")},u=()=>{s("/auth/phone-login")},h=a5[e],f="calc(100vh - 180px)";return i?c.jsx(F,{sx:{width:l?"100%":"100vw",height:"calc(100vh - var(--safe-area-inset-bottom) - var(--safe-area-inset-top))",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:a.palette.background.default},children:c.jsx(bn,{color:"primary"})}):l?c.jsxs(F,{sx:{width:"100%",height:"100vh",display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:[c.jsx("img",{src:Ah,alt:"",style:{position:"fixed",top:0,left:0,width:"102%",height:"102%",objectFit:"cover",zIndex:-1}}),c.jsxs(me,{direction:"row",sx:{maxWidth:"1100px",width:"100%",mx:"auto",gap:6,alignItems:"center",px:4},children:[c.jsx(F,{sx:{width:"55%",flexShrink:0,display:"flex",justifyContent:"center",alignItems:"center"},children:c.jsx(Ws,{mode:"wait",children:c.jsx(rt.div,{variants:l5,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.5},style:{width:"100%",display:"flex",justifyContent:"center"},children:c.jsx(F,{component:"img",src:h.image,alt:`Slide ${e+1}`,sx:{width:"100%",maxHeight:"70vh",objectFit:"contain",borderRadius:"24px"}})},e)})}),c.jsxs(me,{sx:{flex:1,justifyContent:"center",gap:4},children:[c.jsx(F,{component:"img",src:Ua,alt:"Stoqui",sx:{height:"56px",width:"auto",alignSelf:"flex-start"}}),c.jsx(Ws,{mode:"wait",children:c.jsx(rt.div,{variants:l5,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.5},children:c.jsxs(me,{spacing:2,children:[c.jsx(V,{sx:{fontWeight:700,color:a.palette.text.primary,lineHeight:1.15,fontSize:"2.25rem"},children:h.title}),c.jsx(V,{sx:{color:a.palette.text.secondary,fontSize:"1.05rem",lineHeight:1.6,maxWidth:"400px"},children:h.body})]})},e)}),c.jsxs(me,{spacing:1.5,sx:{maxWidth:"380px"},children:[c.jsx(De,{variant:"contained",fullWidth:!0,size:"large",sx:{borderRadius:"200px",fontSize:"1.2rem",textTransform:"none",py:1.75},onClick:d,children:"Começar grátis"}),c.jsx(De,{variant:"text",fullWidth:!0,size:"large",sx:{textTransform:"none",fontSize:"1rem"},onClick:u,children:"Já tenho uma conta"})]})]})]})]}):c.jsxs(F,{sx:{width:"100vw",height:"calc(100vh - var(--safe-area-inset-bottom) - var(--safe-area-inset-top))",maxHeight:"calc(100vh - var(--safe-area-inset-bottom) - var(--safe-area-inset-top))",boxSizing:"border-box",overflow:"visible",px:2,pt:2,pb:2,position:"relative"},children:[c.jsx("img",{src:Ah,alt:"",style:{position:"fixed",top:0,left:0,width:"102%",height:"102%",objectFit:"cover",zIndex:-1}}),c.jsxs(me,{sx:{maxWidth:"500px",mx:"auto",display:"flex",flexDirection:"column",justifyContent:"space-between",width:"100%",height:"100%"},spacing:2,children:[c.jsx(F,{sx:{pt:1,width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:c.jsx(F,{component:"img",src:Ua,alt:"Stoqui",sx:{height:"48px",width:"auto"}})}),c.jsx(me,{direction:"column",sx:{flexGrow:1,minHeight:0},children:c.jsx(F,{sx:{height:f,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",overflow:"hidden",px:2},children:c.jsx(Ws,{mode:"wait",children:c.jsx(rt.div,{variants:l5,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.5},style:{width:"100%"},children:c.jsxs(me,{spacing:2,alignItems:"center",sx:{width:"100%",textAlign:"center"},children:[c.jsx(F,{sx:{position:"relative",width:"100%",maxWidth:"460px",height:"calc(60vh - 110px)",maxHeight:"calc(60vh - 110px)",display:"flex",justifyContent:"center",alignItems:"center"},children:c.jsx(F,{component:"img",src:h.image,alt:`Slide ${e+1}`,sx:{width:"100%",height:"100%",objectFit:"contain",borderRadius:"24px"}})}),c.jsx(V,{sx:{fontWeight:700,color:a.palette.text.primary,lineHeight:1.2,fontSize:"clamp(1.5rem, 4vh, 1.75rem)"},children:h.title}),c.jsx(V,{sx:{color:a.palette.text.secondary,maxWidth:"360px",mx:"auto",fontSize:"0.875rem"},children:h.body})]})},e)})})}),c.jsxs(me,{spacing:1,sx:{width:"100%"},children:[c.jsx(De,{variant:"contained",fullWidth:!0,size:"large",sx:{borderRadius:"200px",fontSize:"1.125rem",textTransform:"none"},onClick:d,children:"Começar grátis"}),c.jsx(De,{variant:"text",fullWidth:!0,size:"large",sx:{textTransform:"none",fontSize:"0.875rem"},onClick:u,children:"Já tenho uma conta"})]})]})]})},$9e=()=>{const[e]=ws(),t=At(),[r,n]=v.useState(null),[i,o]=v.useState(!0);return v.useEffect(()=>{(async()=>{const a=e.get("token_hash"),l=e.get("type");if(!a||l!=="email"){n("Link de confirmação inválido"),o(!1);return}try{pe(fe.AUTH.MAGIC_LINK_LOGIN_START);const{data:d,error:u}=await Te.auth.verifyOtp({token_hash:a,type:"email"});if(u){console.error("Email confirmation error:",u),n(u.message||"Erro ao confirmar email"),pe(fe.AUTH.MAGIC_LINK_LOGIN_START,{error:u.message,errorCode:u.code}),o(!1);return}d.session?(console.log("Email confirmed successfully",d),pe(fe.AUTH.MAGIC_LINK_LOGIN_SUCCESS,{email:d.session.user.email}),t("/auth/onboarding",{replace:!0})):(n("Não foi possÃvel criar a sessão"),o(!1))}catch(d){console.error("Unexpected error during email confirmation:",d),n("Erro inesperado ao confirmar email"),pe(fe.AUTH.MAGIC_LINK_LOGIN_ERROR,{error:"Unexpected error"}),o(!1)}})()},[e,t]),c.jsxs(F,{sx:{padding:"16px"},children:[c.jsx(V,{variant:"h4",fontSize:"x-large",fontWeight:500,gutterBottom:!0,mb:4,sx:{textAlign:"center",color:"primary.main"},children:"Confirmação de email"}),c.jsx(me,{spacing:3,alignItems:"center",children:i?c.jsxs(c.Fragment,{children:[c.jsx(bn,{size:48}),c.jsx(V,{variant:"body1",textAlign:"center",children:"Confirmando seu email..."})]}):r?c.jsxs(c.Fragment,{children:[c.jsx(zn,{severity:"error",sx:{width:"100%"},children:r}),c.jsx(De,{variant:"contained",fullWidth:!0,onClick:()=>
512t("/auth/phone-login"),children:"Voltar"})]}):c.jsxs(c.Fragment,{children:[c.jsx(ps,{color:"success",sx:{fontSize:64}}),c.jsx(V,{variant:"body1",textAlign:"center",children:"Email confirmado com sucesso!"})]})})]})};function D9e(){return c.jsxs(c.Fragment,{children:[c.jsx(Lm,{}),c.jsx(Gj,{}),c.jsxs(me,{spacing:1,sx:{position:"relative",display:"flex",width:"100vw",flexGrow:1,height:"100%",minHeight:"calc(100vh - var(--safe-area-inset-bottom) - var(--safe-area-inset-top))",alignItems:"center",justifyContent:"space-around",padding:"20px",flexDirection:"column"},children:[c.jsx("img",{src:Ah,alt:"",style:{position:"fixed",top:0,left:0,width:"102%",height:"102%",objectFit:"cover",zIndex:-1}}),c.jsx(me,{spacing:1,alignItems:"center",justifyContent:"center",sx:{width:"100%",position:"relative"},children:c.jsx("img",{src:Ua,alt:"logo",width:"70%",style:{maxWidth:"200px"},height:"auto"})}),c.jsx(sh,{sx:{width:"100%",flexShrink:0,maxWidth:"sm",position:"relative"},children:c.jsx(v0,{children:c.jsx(rd,{})})})]})]})}function M9e(){return c.jsxs(yb,{children:[c.jsx(K,{path:"onboarding",element:c.jsx(L9e,{})}),c.jsxs(K,{element:c.jsx(D9e,{}),children:[c.jsx(K,{path:"login",element:c.jsx(x9e,{})}),c.jsx(K,{path:"phone-login",element:c.jsx(E9e,{})}),c.jsx(K,{path:"email-login",element:c.jsx(C9e,{})}),c.jsx(K,{path:"verify-phone",element:c.jsx(I9e,{})}),c.jsx(K,{path:"confirm",element:c.jsx($9e,{})})]}),c.jsx(K,{path:"*",element:c.jsx(Hs,{to:"/auth/phone-login",replace:!0})})]})}const N9e=()=>{const{session:e}=ot(),{data:t,isSuccess:r,isFetching:n,refetch:i}=lo(),o=s1e(a1e);return e?t?c.jsx(rd,{}):r?c.jsx(Hs,{to:"/auth/register",replace:!0}):o?c.jsx(M1,{children:c.jsx($R,{title:"Não conseguimos carregar sua loja",body:"Verifique sua conexão com a internet e tente novamente.",onRetry:()=>{I4.setOnline(!0),i().finally(()=>{I4.setOnline(typeof navigator>"u"?!0:navigator.onLine)})},retrying:n})}):c.jsx(M1,{busy:!0}):c.jsx(Hs,{to:"/auth/onboarding",replace:!0})},F9e=()=>{const{session:e}=ot();return e?c.jsx(Hs,{to:"/",replace:!0}):c.jsx(rd,{})};function U9e(){return c.jsx(v.Suspense,{fallback:c.jsx(M1,{busy:!0}),children:c.jsxs(yb,{children:[c.jsx(K,{path:"/auth/register/*",element:c.jsx(Q1e,{})}),c.jsx(K,{path:"/auth/sso",element:c.jsx(nme,{})}),c.jsx(K,{path:"/clock-skew",element:c.jsx(ame,{})}),c.jsx(K,{element:c.jsx(F9e,{}),children:c.jsx(K,{path:"/auth/*",element:c.jsx(M9e,{})})}),c.jsx(K,{element:c.jsx(N9e,{}),children:c.jsx(K,{path:"/*",element:c.jsx(y9e,{})})}),c.jsx(K,{path:"*",element:c.jsx(Hs,{to:"/",replace:!0})})]})})}const B9e=()=>{const e=sn();v.useEffect(()=>{qe.isNativePlatform()||e.search&&uI(e.search,"web_url")},[e.search])};var S4={},V9e=zt;Object.defineProperty(S4,"__esModule",{value:!0});var ED=S4.default=void 0,H9e=V9e(Wt()),z9e=c;ED=S4.default=(0,H9e.default)((0,z9e.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");const W9e=async e=>{const{data:t,error:r}=await Te.from("seguranca_da_conta").select("*").eq("user_id",e).maybeSingle();if(r){if(r.code==="PGRST116")return null;throw console.error("Error fetching seguranca_da_conta:",r),r}return t},q9e=()=>{const{user:e}=ot(),t=e==null?void 0:e.id;return Et({queryKey:["segurancaDaConta",t],queryFn:()=>W9e(t),enabled:!!t})};function G9e(){const{data:e}=lo(),{data:t}=q9e(),r=(e==null?void 0:e.conta_banida)===!0||(t==null?void 0:t.conta_banida)===!0,{signOut:n}=ot(),{data:i}=co(),o=()=>{n()},s=()=>{const a=i==null?void 0:i.SUPPORT_URL;a&&window.open(a,"_blank")};return c.jsx(Fr,{disableEscapeKeyDown:!0,open:r,onClose:()=>{},maxWidth:"sm",fullWidth:!0,children:c.jsxs(F,{sx:{padding:4,textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center"},children:[c.jsx(F,{sx:{width:90,height:90,borderRadius:"50%",backgroundColor:"error.main",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:3},children:c.jsx(ED,{sx:{fontSize:50,color:"white"}})}),c.jsx(V,{variant:"h5",fontWeight:700,color:"error.main",gutterBottom:!0,sx:{mb:2},children:"Conta suspensa"}),c.jsx(V,{variant:"body1",color:"text.primary",fontSize:"1rem",lineHeight:1.6,sx:{mb:3},children:"Sua conta foi suspensa pois viola os termos de uso do nosso serviço."}),c.jsx(V,{variant:"body2",color:"text.secondary",fontSize:"0.95rem",lineHeight:1.6,sx:{mb:4},children:"Se você acredita que isso é um erro, por favor entre em contato com nosso suporte para obter assistência."}),c.jsx(De,{variant:"contained",color:"primary",size:"large",onClick:s,fullWidth:!0,startIcon:c.jsx(sx,{}),sx:{mb:1,py:1.5,fontWeight:600},children:"Falar com suporte"}),c.jsx(V,{variant:"caption",color:"text.secondary",fontSize:"0.75rem",lineHeight:1.6,sx:{mb:3},children:"Segunda a sexta das 8h às 18h"}),c.jsx(De,{size:"large",onClick:o,fullWidth:!0,startIcon:c.jsx(lse,{}),sx:{py:1.5,fontWeight:600},children:"Sair da conta"})]})})}const g0=Kr("LiveUpdate",{web:()=>X(()=>import("./web-D8XOGex4.js"),__vite__mapDeps([436,1,2,3,4,5,6])).then(e=>new e.LiveUpdateWeb)});let Gd=null;const K9e=()=>{const e=qe.isNativePlatform(),t=v.useRef(!1);v.useEffect(()=>{if(!e)return;(async()=>{try{const{currentBundleId:i}=await g0.ready(),{bundleId:o}=await g0.getNextBundle();if(o&&o!==i){console.log(`Live Update: Pending bundle ${o} ready`),Gd=o;return}console.log("Live Update: Checking for updates...");const s=await g0.sync();s.nextBundleId&&s.nextBundleId!==i&&(console.log(`Live Update: Downloaded ${s.nextBundleId}`),pe(fe.APP.LIVE_UPDATE_DEFERRED,{bundleId:s.nextBundleId}),Gd=s.nextBundleId)}catch(i){console.error("Live Update error:",i),pe(fe.APP.LIVE_UPDATE_SYNC_E
512RROR,{error:String(i)})}})();const n=sc.addListener("appStateChange",async({isActive:i})=>{if(!i){t.current=!0;return}if(!(!t.current||!Gd)){if(window.location.pathname.startsWith("/auth/")){console.log("Live Update: Skipping reload â user is on onboarding");return}console.log(`Live Update: Applying ${Gd} on foreground return`),pe(fe.APP.LIVE_UPDATE_APPLIED,{bundleId:Gd,source:"foreground_return"}),await g0.reload()}});return()=>{n.then(i=>i.remove())}},[e])};function Y9e(){v.useEffect(()=>{if(!qe.isNativePlatform())return;const e=t=>{const r=t.target;if(r.type!=="checkbox"&&r.type!=="radio")return;r.closest(".MuiCheckbox-root, .MuiSwitch-root, .MuiRadio-root")&&Li(Ja.Light)};return document.addEventListener("change",e,!0),()=>document.removeEventListener("change",e,!0)},[])}var PC={VITE_ONESIGNAL_APP_ID:"d275f7e8-1da8-448e-b753-3a8623d08ff9",VITE_VERCEL_GIT_REPO_ID:"903014956",VITE_FLAPP_CLIENT_ID:"stoqui-client",VITE_VERCEL_ENV:"production",VITE_VERCEL_GIT_PULL_REQUEST_ID:"",VITE_VERCEL_OBSERVABILITY_CLIENT_CONFIG:'{"analytics":{"scriptSrc":"5c7f35832be5cdac/script.
512js","viewEndpoint":"5c7f35832be5cdac/view","eventEndpoint":"5c7f35832be5cdac/event","sessionEndpoint":"5c7f35832be5cdac/session"},"speedInsights":{"scriptSrc":"dd9889db239eb903/script.js","endpoint":"dd9889db239eb903/vitals"}}',VITE_VERCEL_BRANCH_URL:"stoqui-app-git-master-lc-haddad.vercel.app",VITE_VERCEL_GIT_COMMIT_SHA:"2ad85febf9735404429b0670d4acf56a0af5a0a2",VITE_GOOGLE_OAUTH_ANDROID_CLIENT_ID:"496661333301-j42kqtc95kuk2gu0b640rs0lfhggpcf4.apps.googleusercontent.com",VITE_VERCEL_URL:"stoqui-knxjt64qe-lc-haddad.vercel.app",VITE_MIXPANEL_TOKEN:"bdb98d7fc008b54b925b5b099913f317",VITE_VERCEL_GIT_COMMIT_AUTHOR_NAME:"leochaddad",VITE_VERCEL_GIT_PREVIOUS_SHA:"",VITE_MERCADO_PAGO_CLIENT_ID:"5640523890674349",VITE_API_URL:"https://catalogo.stoqui.com.br/api",VITE_SUPABASE_URL:"https://spb.stoqui.com.br",VITE_VERCEL_PROJECT_ID:"prj_7Z0bhIlJOelrImZYXL4hKtSVRcnw",VITE_APP_ENV:"production",VITE_MELHOR_ENVIO_REDIRECT_URI:"https://app.stoqui.com.br/profile/shipping/melhorenvio",VITE_VERCEL_PROJECT_PRODUCTION_URL:"app.stoqui.com.br",VITE_CHAT_AVAILABLE:"true",VITE_FLAPP_AUTH_URL:"https://authorization.asaas.com",VITE_SUPABASE_ANON_KEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJ2d3N5b2xncHNidmZsaGJxaWx5Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTY5NDU5ODMsImV4cCI6MjAxMjUyMTk4M30.IeHTL6jYLp-4qOaUEcWyfaf9U88gx_Az7yCqnbKC428",VITE_VERCEL_DEPLOYMENT_ID:"dpl_52bArHmdy91NN4TjGRMA3N9YpZP3",VITE_VERCEL_GIT_REPO_OWNER:"Versi-Tecnologia-LTDA",VITE_MELHOR_ENVIO_API_URL:"https://melhorenvio.com.br",VITE_VERCEL_GIT_COMMIT_AUTHOR_LOGIN:"leochaddad",VITE_VERCEL_TARGET_ENV:"production",VITE_MERCADO_PAGO_REDIRECT_URI:"https://app.stoqui.com.br/profile/mercadopago",VITE_VERCEL_GIT_PROVIDER:"github",VITE_APP_URL:"https://app.stoqui.com.br",VITE_GOOGLE_OAUTH_WEB_CLIENT_ID:"496661333301-1rtif0doi99fcohm1on1vdbcb7vlh2rs.apps.googleusercontent.com",VITE_VERCEL_GIT_COMMIT_REF:"master",VITE_VERCEL_GIT_REPO_SLUG:"stoqui-app",VITE_DISABLE_IMAGE_RESIZING:"true",VITE_VERCEL_GIT_COMMIT_MESSAGE:`feat(relatorios): paginar "todos os produtos" e mostrar o total do perÃodo 513 514A tela pedia limit 100 e renderizava o array cru, então loja que vendeu 515mais de 100 produtos distintos no perÃodo perdia o resto sem aviso - e 516ampliar o perÃodo piorava, porque mais produtos concorrem pelo corte. 517 518- usa /reports/top-products/v2 via useInfiniteQuery, com "Carregar mais 519 produtos" e contador "X de Y"; 520- cabeçalho mostra o total real do perÃodo (vem do banco), então o 521 truncamento nunca mais é silencioso; 522- CSV agora busca todas as páginas em vez de exportar só o que estava 523 carregado na tela. 524 525O widget do dashboard (TopProductsTable) fica na v1 de propósito: ali 526top 5 é o comportamento correto. 527 528A queryKey mantém o prefixo "report-top-products", então as 529invalidações de useDeleteOrders/useEditOrder/useBulkDeleteOrders 530continuam valendo. 531 532Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>`,VITE_MELHOR_ENVIO_CLIENT_ID:"17597",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};une({locale:Uu});const Z9e=()=>{const{user:e}=ot(),{data:t}=lo(),{data:r}=xg();return fne(),B9e(),co(),ese(),K9e(),Y9e(),Jse(),eae(),v.useEffect(()=>{lV(),fh(fe.APP.OPEN),yV();try{OV().then(()=>{console.log("Firebase Analytics initialized"),aA("initialized_analytics")})}catch(n){console.error("Error initializing Firebase Analytics:",n)}},[]),v.useEffect(()=>{var n,i,o,s,a,l,d;if(e){const u={$name:((n=e.user_metadata)==null?void 0:n.nome)||(t==null?void 0:t.nome_loja)||"",$email:e.email||e.new_email||((i=e.user_metadata)==null?void 0:i.email),$phone_number:e.phone||e.new_phone,store_name:t==null?void 0:t.nome_loja,store_slug:t==null?void 0:t.slug_loja,product_count:r||0,first_screen_experiment_group:((o=e.user_metadata)==null?void 0:o.first_screen_experiment_group)||"unknown"};cV(e.id,u),bV(e.id,u),qe.isNativePlatform()&&(jV(e.id),Yse(e.id,{email:e.email||e.new_email||((s=e.user_metadata)==null?void 0:s.email),phone:e.phone||e.new_phone}),LV({user_email:e.email||e.new_email||((a=e.user_metadata)==null?void 0:a.email)||"",store_name:(t==null?void 0:t.nome_loja)||"",store_slug:(t==null?void 0:t.slug_loja)||"",product_count:String(r||0),first_screen_experiment_group:((l=e.user_metadata)==null?void 0:l.first_screen_experiment_group)||"unknown"}),rae({phoneNumber:e.phone?`+${e.phone}`:void 0,emailAddress:e.email||e.new_email||((d=e.user_metadata)==null?void 0:d.email)}))}else qe.isNativePlatform()&&Zse()},[e,t,r]),v.useEffect(()=>{if(qe.isNativePlatform()){const i=qe.getPlatform()==="ios"?PC.VITE_REVENUECAT_APP_STORE_API_KEY:PC.VITE_REVENUECAT_GOOGLE_PLAY_API_KEY;j0.configure({apiKey:i})}},[]),c.jsxs(c.Fragment,{children:[c.jsx(_se,{}),c.jsx(G9e,{}),c.jsx(tse,{}),c.jsx(Sse,{}),c.jsx(Qoe,{}),c.jsx(fq,{}),c.jsx(mne,{}),c.jsx(bse,{}),c.jsx(Bge,{children:c.jsx(U9e,{})})]})};var X9e=function(){return null};function J9e(e){const t={...e};return Xk(t,"react"),mK("react",{version:v.version}),kR(t)}const Q9e=Kr("SplashScreen",{web:()=>X(()=>import("./web-D7tkmS_E.js"),__vite__mapDeps([437,1,2,3,4,5,6])).then(e=>new e.SplashScreenWeb)});var e7e={VITE_ONESIGNAL_APP_ID:"d275f7e8-1da8-448e-b753-3a8623d08ff9",VITE_VERCEL_GIT_REPO_ID:"903014956",VITE_FLAPP_CLIENT_ID:"stoqui-client",VITE_VERCEL_ENV:"production",VITE_VERCEL_GIT_PULL_REQUEST_ID:"",VITE_VERCEL_OBSERVABILITY_CLIENT_CONFIG:'{"analytics":{"scriptSrc":"5c7f35832be5cdac/script.
532js","viewEndpoint":"5c7f35832be5cdac/view","eventEndpoint":"5c7f35832be5cdac/event","sessionEndpoint":"5c7f35832be5cdac/session"},"speedInsights":{"scriptSrc":"dd9889db239eb903/script.js","endpoint":"dd9889db239eb903/vitals"}}',VITE_VERCEL_BRANCH_URL:"stoqui-app-git-master-lc-haddad.vercel.app",VITE_VERCEL_GIT_COMMIT_SHA:"2ad85febf9735404429b0670d4acf56a0af5a0a2",VITE_GOOGLE_OAUTH_ANDROID_CLIENT_ID:"496661333301-j42kqtc95kuk2gu0b640rs0lfhggpcf4.apps.googleusercontent.com",VITE_VERCEL_URL:"stoqui-knxjt64qe-lc-haddad.vercel.app",VITE_MIXPANEL_TOKEN:"bdb98d7fc008b54b925b5b099913f317",VITE_VERCEL_GIT_COMMIT_AUTHOR_NAME:"leochaddad",VITE_VERCEL_GIT_PREVIOUS_SHA:"",VITE_MERCADO_PAGO_CLIENT_ID:"5640523890674349",VITE_API_URL:"https://catalogo.stoqui.com.br/api",VITE_SUPABASE_URL:"https://spb.stoqui.com.br",VITE_VERCEL_PROJECT_ID:"prj_7Z0bhIlJOelrImZYXL4hKtSVRcnw",VITE_APP_ENV:"production",VITE_MELHOR_ENVIO_REDIRECT_URI:"https://app.stoqui.com.br/profile/shipping/melhorenvio",VITE_VERCEL_PROJECT_PRODUCTION_URL:"app.stoqui.com.br",VITE_CHAT_AVAILABLE:"true",VITE_FLAPP_AUTH_URL:"https://authorization.asaas.com",VITE_SUPABASE_ANON_KEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJ2d3N5b2xncHNidmZsaGJxaWx5Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTY5NDU5ODMsImV4cCI6MjAxMjUyMTk4M30.IeHTL6jYLp-4qOaUEcWyfaf9U88gx_Az7yCqnbKC428",VITE_VERCEL_DEPLOYMENT_ID:"dpl_52bArHmdy91NN4TjGRMA3N9YpZP3",VITE_VERCEL_GIT_REPO_OWNER:"Versi-Tecnologia-LTDA",VITE_MELHOR_ENVIO_API_URL:"https://melhorenvio.com.br",VITE_VERCEL_GIT_COMMIT_AUTHOR_LOGIN:"leochaddad",VITE_VERCEL_TARGET_ENV:"production",VITE_MERCADO_PAGO_REDIRECT_URI:"https://app.stoqui.com.br/profile/mercadopago",VITE_VERCEL_GIT_PROVIDER:"github",VITE_APP_URL:"https://app.stoqui.com.br",VITE_GOOGLE_OAUTH_WEB_CLIENT_ID:"496661333301-1rtif0doi99fcohm1on1vdbcb7vlh2rs.apps.googleusercontent.com",VITE_VERCEL_GIT_COMMIT_REF:"master",VITE_VERCEL_GIT_REPO_SLUG:"stoqui-app",VITE_DISABLE_IMAGE_RESIZING:"true",VITE_VERCEL_GIT_COMMIT_MESSAGE:`feat(relatorios): paginar "todos os produtos" e mostrar o total do perÃodo 533 534A tela pedia limit 100 e renderizava o array cru, então loja que vendeu 535mais de 100 produtos distintos no perÃodo perdia o resto sem aviso - e 536ampliar o perÃodo piorava, porque mais produtos concorrem pelo corte. 537 538- usa /reports/top-products/v2 via useInfiniteQuery, com "Carregar mais 539 produtos" e contador "X de Y"; 540- cabeçalho mostra o total real do perÃodo (vem do banco), então o 541 truncamento nunca mais é silencioso; 542- CSV agora busca todas as páginas em vez de exportar só o que estava 543 carregado na tela. 544 545O widget do dashboard (TopProductsTable) fica na v1 de propósito: ali 546top 5 é o comportamento correto. 547 548A queryKey mantém o prefixo "report-top-products", então as 549invalidações de useDeleteOrders/useEditOrder/useBulkDeleteOrders 550continuam valendo. 551 552Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>`,VITE_MELHOR_ENVIO_CLIENT_ID:"17597",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};window.addEventListener("vite:preloadError",()=>{zj()});function t7e(e,t){const r=window.requestIdleCallback;if(typeof r=="function"){r(e,{timeout:t});return}setTimeout(e,t)}SQ({dsn:"https://8d853d080eae6cb0647344e5183154a6@o4505550982283264.ingest.us.sentry.io/4509321628483584",integrations:[zJ()],replaysSessionSampleRate:0,replaysOnErrorSampleRate:.5,ignoreErrors:["Share canceled","AbortError","Abort due to cancellation"]},J9e),t7e(()=>{(async()=>{try{const e=await ZY("replayIntegration");SK(e())}catch{}})()},15e3);const r7e=qW(S1(c.jsx(K,{element:c.jsx(Ure,{}),children:c.jsx(K,{path:"*",element:c.jsx(Z9e,{})})})));function n7e(){return v.useLayoutEffect(()=>{gq(),qe.isNativePlatform()&&Q9e.hide()},[]),null}u5.createRoot(document.getElementById("root")).render(c.jsxs(vq,{children:[c.jsx(n7e,{}),c.jsx(mq,{children:c.jsxs(GD,{client:x1,children:[e7e.VITE_RQ_DEVTOOLS==="true"&&c.jsx(X9e,{initialIsOpen:!1}),c.jsx(Fre,{children:c.jsx(PQ,{children:c.jsx(tq,{router:r7e})})})]})})]}));export{E6e as $,sc as A,hj as B,cl as C,ss as D,pj as E,dl as F,A_ as G,aCe as H,x1 as I,m7e as J,Hl as K,S$ as L,Rm as M,Ng as N,ra as O,dj as P,n5 as Q,vE as R,dC as S,Sc as T,_ge as U,xE as V,sb as W,Ef as X,ee as Y,c4e as Z,fc as _,CE as a,Bn as a$,Cc as a0,yd as a1,$x as a2,gve as a3,kTe as a4,VL as a5,da as a6,ua as a7,lp as a8,up as a9,pSe as aA,FSe as aB,vm as aC,WSe as aD,s3 as aE,mSe as aF,rt as aG,HTe as aH,Aye as aI,__ as aJ,Io as aK,v4e as aL,w2 as aM,JTe as aN,Xye as aO,CI as aP,Hoe as aQ,TI as aR,ys as aS,U7e as aT,u4e as aU,F7e as aV,Ws as aW,dse as aX,TE as aY,mme as aZ,gme as a_,Nve as aa,fs as ab,sr as ac,ITe as ad,ive as ae,PL as af,RTe as ag,Tc as ah,fve as ai,Rr as aj,hve as ak,Lx as al,Fve as am,Ix as an,FL as ao,NL as ap,uve as aq,PTe as ar,QL as as,b4e as at,_4e as au,x4e as av,s3e as aw,O$ as ax,sAe as ay,d$ as az,At as b,zTe as b$,Jb as b0,mg as b1,X as b2,_s as b3,Kb as b4,wc as b5,Xb as b6,yye as b7,Bx as b8,nAe as b9,Wb as bA,BCe as bB,OCe as bC,p$ as bD,mye as bE,E1e as bF,l4 as bG,tAe as bH,cAe as bI,pm as bJ,Ql as bK,e_e as bL,Zj as bM,Pl as bN,YCe as bO,UTe as bP,m$ as bQ,BTe as bR,pye as bS,a3e as bT,fye as bU,q0 as bV,M4e as bW,c4 as bX,hD as bY,Ku as bZ,Fs as b_,$6e as ba,L6e as bb,Mg as bc,Mge as bd,Qa as be,x0e as bf,V1 as bg,Ka as bh,vs as bi,BR as bj,fg as bk,oe as bl,Li as bm,Ja as bn,Di as bo,Uu as bp,aSe as bq,iAe as br,LSe as b
552s,ySe as bt,cSe as bu,hse as bv,fse as bw,t_ as bx,tfe as by,rhe as bz,co as c,W2 as c$,G1 as c0,qe as c1,kbe as c2,Kv as c3,a4 as c4,Jj as c5,MQ as c6,Db as c7,sn as c8,uAe as c9,Hee as cA,Tx as cB,lAe as cC,aAe as cD,vd as cE,_o as cF,c3 as cG,bme as cH,Ao as cI,Ni as cJ,dc as cK,c$ as cL,Hbe as cM,X_e as cN,vx as cO,d_ as cP,Xge as cQ,Vg as cR,aS as cS,r2e as cT,wCe as cU,TSe as cV,Lg as cW,l_e as cX,pse as cY,Ol as cZ,qSe as c_,Wx as ca,rj as cb,eS as cc,vme as cd,X7 as ce,Ume as cf,eme as cg,sI as ch,pTe as ci,mTe as cj,gTe as ck,vTe as cl,yTe as cm,bTe as cn,xTe as co,wTe as cp,_Te as cq,TTe as cr,ATe as cs,N2e as ct,G2e as cu,gu as cv,Z7e as cw,fTe as cx,CTe as cy,STe as cz,lo as d,Vxe as d$,zd as d0,u_ as d1,g$ as d2,q1 as d3,Oi as d4,d_e as d5,tn as d6,H1 as d7,IV as d8,Q7 as d9,qx as dA,tC as dB,QTe as dC,i5 as dD,VTe as dE,Pme as dF,yL as dG,YSe as dH,tCe as dI,rCe as dJ,BSe as dK,ip as dL,t1e as dM,Qb as dN,t4 as dO,g0 as dP,DV as dQ,bj as dR,p4 as dS,Vbe as dT,Bg as dU,S3e as dV,BS as dW,Lh as dX,bxe as dY,A3e as dZ,zxe as d_,cCe as da,dCe as db,KTe as dc,GSe as dd,cse as de,XSe as df,lSe as dg,J7e as dh,gse as di,F6e as dj,a3 as dk,QSe as dl,wSe as dm,$I as dn,nSe as dp,DI as dq,Jp as dr,Vhe as ds,Wt as dt,j0 as du,dE as dv,W7e as dw,vse as dx,E$ as dy,Gx as dz,an as e,B7e as e$,rSe as e0,Xxe as e1,el as e2,Q$ as e3,J$ as e4,ICe as e5,px as e6,_9e as e7,mCe as e8,zx as e9,yne as eA,PCe as eB,Eu as eC,qI as eD,a_e as eE,M2 as eF,FTe as eG,l3 as eH,GCe as eI,k$ as eJ,Sbe as eK,RS as eL,FQ as eM,YTe as eN,C$ as eO,Yx as eP,Kre as eQ,gye as eR,bpe as eS,kpe as eT,gCe as eU,p2 as eV,T$ as eW,ube as eX,lCe as eY,z2 as eZ,V7e as e_,Kr as ea,ase as eb,oAe as ec,eye as ed,tye as ee,s2e as ef,pD as eg,xu as eh,tTe as ei,R$ as ej,Tpe as ek,ppe as el,xD as em,y_ as en,jTe as eo,vye as ep,Vee as eq,K0 as er,Ute as es,uSe as et,$4e as eu,_ye as ev,NTe as ew,$Te as ex,L7e as ey,j7e as ez,Hu as f,Age as f$,jme as f0,N5e as f1,vCe as f2,Hre as f3,dg as f4,Vre as f5,ug as f6,qte as f7,zte as f8,Hte as f9,VSe as fA,DSe as fB,U6e as fC,lbe as fD,abe as fE,pg as fF,mD as fG,oTe as fH,rTe as fI,iTe as fJ,nTe as fK,hCe as fL,ETe as fM,K2e as fN,h_ as fO,ZSe as fP,ECe as fQ,uCe as fR,eTe as fS,Oo as fT,u5e as fU,MCe as fV,LCe as fW,the as fX,S6e as fY,SCe as fZ,P$ as f_,WTe as fa,m6e as fb,eAe as fc,GTe as fd,dSe as fe,DTe as ff,ESe as fg,xSe as fh,afe as fi,oSe as fj,SSe as fk,ASe as fl,kSe as fm,eCe as fn,nCe as fo,Hj as fp,Npe as fq,x7 as fr,Hde as fs,PSe as ft,s_ as fu,v$ as fv,h4e as fw,z7e as fx,eSe as fy,CCe as fz,lse as g,y7e as g$,ume as g0,fD as g1,u6e as g2,d6e as g3,c6e as g4,a6e as g5,Qx as g6,gD as g7,dye as g8,x$ as g9,vR as gA,LZ as gB,DZ as gC,cr as gD,Zs as gE,gX as gF,Hb as gG,C7e as gH,mK as gI,Wo as gJ,Ei as gK,Mf as gL,cc as gM,WK as gN,zK as gO,Ai as gP,to as gQ,ru as gR,ad as gS,DG as gT,Dk as gU,iK as gV,qn as gW,uc as gX,mY as gY,Fa as gZ,Fk as g_,Ih as ga,oS as gb,wbe as gc,hTe as gd,Kx as ge,TL as gf,bye as gg,qC as gh,gL as gi,L2e as gj,A7e as gk,Ht as gl,T7e as gm,og as gn,Or as go,rf as gp,nd as gq,li as gr,Wn as gs,ir as gt,ns as gu,Yt as gv,k7e as gw,ms as gx,Mu as gy,yR as gz,sx as h,_L as h$,b7e as h0,_7e as h1,Ob as h2,v7e as h3,w7e as h4,x7e as h5,S7e as h6,E7e as h7,_c as h8,ld as h9,ZCe as hA,ehe as hB,Cx as hC,KSe as hD,yse as hE,ise as hF,JSe as hG,ISe as hH,r_e as hI,iCe as hJ,zSe as hK,vSe as hL,fSe as hM,iSe as hN,gSe as hO,X7e as hP,RSe as hQ,bSe as hR,rAe as hS,XCe as hT,JCe as hU,c2e as hV,yCe as hW,l2e as hX,qu as hY,P1e as hZ,sE as h_,zG as ha,g7e as hb,bc as hc,BG as hd,Sb as he,UK as hf,Ik as hg,Nk as hh,zJ as hi,fG as hj,YJ as hk,x8 as hl,SQ as hm,I7e as hn,R7e as ho,An as hp,$pe as hq,bCe as hr,Mpe as hs,_Ce as ht,MSe as hu,xCe as hv,sCe as hw,OTe as hx,D5e as hy,LTe as hz,KCe as i,USe as i$,Uj as i0,hm as i1,l_ as i2,G5e as i3,Tm as i4,FCe as i5,VCe as i6,zCe as i7,qCe as i8,WCe as i9,hSe as iA,cTe as iB,jSe as iC,CSe as iD,yl as iE,uTe as iF,dTe as iG,H7e as iH,q7e as iI,aTe as iJ,lTe as iK,sTe as iL,Hs as iM,h5e as iN,b7 as iO,HCe as iP,Bme as iQ,MTe as iR,NCe as iS,oCe as iT,XTe as iU,Z$ as iV,tSe as iW,K7e as iX,NSe as iY,mse as iZ,_Se as i_,jCe as ia,$Ce as ib,DCe as ic,LS as id,qTe as ie,Kae as ig,jr as ih,Vn as ii,I3 as ij,f3 as ik,zu as il,M3 as im,ZI as io,Ya as ip,e9 as iq,OSe as ir,Fg as is,Q7e as it,$Se as iu,HSe as iv,sSe as iw,G7e as ix,Y7e as iy,ose as iz,z6e as j,jQ as j0,f$ as j1,RCe as j2,z1e as j3,q7 as j4,Vd as j5,Lv as j6,kCe as j7,R1e as j8,_a as j9,Mm as jA,O7e as jB,V1e as ja,$v as jb,qj as jc,Aa as jd,C1e as je,V7 as jf,W7 as jg,$1e as jh,W1e as ji,Lme as jj,Cge as jk,D4e as jl,F5e as jm,UCe as jn,h_e as jo,TCe as jp,jv as jq,n_e as jr,d4e as js,A1e as jt,QCe as ju,sD as jv,ZTe as jw,ACe as jx,Z0e as jy,jxe as jz,H6e as k,fe as l,mp as m,al as n,xg as o,np as p,Qn as q,No as r,O6e as s,pe as t,ot as u,ws as v,Te as w,Hn as x,ca as y,no as z};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.