From 80cbd452e5981e751832870456624635208edc47 Mon Sep 17 00:00:00 2001 From: liu <2302563948@qq.com> Date: Sun, 13 Sep 2026 23:42:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A6=E5=8D=95=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .phpunit.result.cache | 2 +- app/Exports/BillExport.php | 61 ++++------- app/Http/Controllers/Mini/BillController.php | 31 ++---- app/Http/Controllers/Recon/BillController.php | 26 ++--- app/Services/BillDetailService.php | 18 ---- public/assets/bill-d4QJGLlp.js | 1 - public/assets/bill-qG3t0JUE.js | 1 + .../{index-_7W4DmEA.js => index-B519TAEb.js} | 4 +- public/index.html | 2 +- tests/Feature/BillExportTest.php | 102 ++++++++---------- web/api/recon/bill.ts | 10 +- web/pages/recon/bill.tsx | 82 ++++---------- 12 files changed, 112 insertions(+), 228 deletions(-) delete mode 100644 public/assets/bill-d4QJGLlp.js create mode 100644 public/assets/bill-qG3t0JUE.js rename public/assets/{index-_7W4DmEA.js => index-B519TAEb.js} (67%) diff --git a/.phpunit.result.cache b/.phpunit.result.cache index f9b5a34..8b727b3 100644 --- a/.phpunit.result.cache +++ b/.phpunit.result.cache @@ -1 +1 @@ -{"version":2,"defects":{"Tests\\Feature\\ProductPriceTest::test_product_list_returns_price_for_store_level":8,"Tests\\Feature\\ProductPriceTest::test_store_without_level_is_rejected":8,"Tests\\Feature\\ProductPriceTest::test_batch_price_updates_and_notifies_affected_stores":7,"Tests\\Feature\\ProductPriceTest::test_price_matrix_structure":8,"Tests\\Feature\\StoreOrderTest::test_place_order_snapshots_level_price_and_recalculates":8,"Tests\\Feature\\StoreOrderTest::test_client_supplied_amount_is_ignored":8,"Tests\\Feature\\StoreOrderTest::test_product_without_level_price_rejected":8,"Tests\\Feature\\StoreOrderTest::test_cancel_only_pending_orders":8,"Tests\\Feature\\StoreOrderTest::test_summarized_order_cannot_be_cancelled":8,"Tests\\Feature\\StoreOrderTest::test_order_data_isolated_between_stores":8,"Tests\\Feature\\PurchaseGenerateTest::test_generate_aggregates_orders_by_product":7,"Tests\\Feature\\PurchaseGenerateTest::test_generate_writes_back_order_status":7,"Tests\\Feature\\PurchaseGenerateTest::test_generate_without_pending_orders_fails":8,"Tests\\Feature\\PurchaseGenerateTest::test_generate_is_idempotent":7,"Tests\\Feature\\AllocationTest::test_allocation_conserves_amount_with_tail_correction":7,"Tests\\Feature\\AllocationTest::test_allocation_follows_order_ratio":7,"Tests\\Feature\\AllocationTest::test_allocation_is_idempotent":7,"Tests\\Feature\\AllocationTest::test_allocation_rejected_without_actual_amount":8,"Tests\\Feature\\MiniAuthTest::test_login_creates_user_and_issues_token":7,"Tests\\Feature\\MiniAuthTest::test_phone_binding_matches_store":8,"Tests\\Feature\\MiniAuthTest::test_phone_no_match_stays_pending":8,"Tests\\Feature\\ExportTest::test_export_xlsx_with_encoded_chinese_filename":7,"Tests\\Feature\\CartTest::test_list_with_prices_amounts_and_totals":7,"Tests\\Feature\\CartTest::test_list_marks_off_shelf_item_unbuyable":7,"Tests\\Feature\\DebugCartListTest::test_dump_cart_list_response":5,"Tests\\Feature\\ProductCostPriceTest::test_create_product_with_cost_and_percent_pricing":7,"Tests\\Feature\\ProductCostPriceTest::test_create_percent_row_without_percent_fails":7,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_cost_only_notifies_percent_level_stores":7,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_empty_row_rejected":7,"Tests\\Feature\\MiniAuthTest::test_disabled_user_cannot_login":8,"Tests\\Feature\\MiniAuthTest::test_mini_token_cannot_access_admin_api":8,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_percent_row_update":7,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_mixed_row_updates_cost_and_level":7,"Tests\\Feature\\ReconciliationTest::test_build_creates_reconciliation_items":8,"Tests\\Feature\\ReconciliationTest::test_build_filters_by_supplier":8,"Tests\\Feature\\ReconciliationTest::test_update_item_recalculates_diff_and_header":8,"Tests\\Feature\\ReconciliationTest::test_toggle_reconciled_flag":8,"Tests\\Feature\\ReconciliationTest::test_settle_creates_settlements_per_store":8,"Tests\\Feature\\ProductCostPriceTest::test_mini_list_returns_actual_price_without_cost_price":8,"Tests\\Feature\\ProductCostPriceTest::test_mini_order_uses_actual_price_for_percent_row":8,"Tests\\Feature\\ProductCostPriceTest::test_mini_cart_uses_actual_price_for_percent_row":8,"Tests\\Feature\\StoreOrderTest::test_container_update_recalculates_amounts":8,"Tests\\Feature\\StoreOrderTest::test_container_update_allowed_in_editable_statuses":8,"Tests\\Feature\\StoreOrderTest::test_container_update_rejected_in_other_statuses":8,"Tests\\Feature\\StoreOrderTest::test_container_update_heals_legacy_product_amount":8,"Tests\\Feature\\StoreOrderTest::test_container_update_validates_negative_numbers":8,"Tests\\Feature\\StoreOrderItemTest::test_sync_item_rejected_when_product_deleted":7,"Tests\\Feature\\StoreOrderItemTest::test_order_list_search_by_product_name":8,"Tests\\Feature\\PurchaseEditTest::test_detail_returns_store_matrix":7,"Tests\\Feature\\PurchaseEditTest::test_update_cell_syncs_order_item_and_totals":7,"Tests\\Feature\\PurchaseEditTest::test_update_row_cost_syncs_all_order_items":7,"Tests\\Feature\\PurchaseEditTest::test_update_row_weight_distributed_by_quantity":7,"Tests\\Feature\\PurchaseEditTest::test_update_row_syncs_product_attributes":7,"Tests\\Feature\\PurchaseGenerateTest::test_generate_aggregates_order_items_into_header":7,"Tests\\Feature\\ExportTest::test_export_category_filters_to_vegetables":7,"Tests\\Feature\\ExportTest::test_export_pdf":7,"Tests\\Feature\\PurchaseEditTest::test_update_row_does_not_touch_manual_weight":7,"Tests\\Feature\\PurchaseEditTest::test_update_row_syncs_to_product_catalog":7,"Tests\\Feature\\PurchaseEditTest::test_update_cell_weight_cascades_totals":7,"Tests\\Feature\\PurchaseEditTest::test_cell_sync_refreshes_snapshot_and_cascades":7,"Tests\\Feature\\PurchaseEditTest::test_edits_rejected_when_purchase_completed":7,"Tests\\Feature\\StoreOrderItemTest::test_update_item_recalculates_order_totals":7,"Tests\\Feature\\StoreOrderItemTest::test_update_item_validates_negative_price":7,"Tests\\Feature\\StoreOrderItemTest::test_sync_item_updates_snapshot_from_product":7,"Tests\\Feature\\StoreOrderItemTest::test_sync_item_recalculates_percent_price_with_latest_cost":7,"Tests\\Feature\\PurchaseEditTest::test_cell_detail_returns_items_with_order_info":8,"Tests\\Feature\\ProductCategoryTest::test_create_product_with_leaf_category_ok":7,"Tests\\Feature\\BillExportTest::test_export_filters_by_root_category":8,"Tests\\Feature\\BillExportTest::test_export_requires_export_permission":8,"Tests\\Feature\\DebugPermissionTest::test_debug_permission":8,"Tests\\Feature\\BillPaymentTest::test_order_status_progresses_via_business_chain":7,"Tests\\Feature\\BillPaymentTest::test_payment_audit_reject_does_not_accumulate":7,"Tests\\Feature\\BillPaymentTest::test_payment_detail_returns_voucher_urls":8,"Tests\\Feature\\ContainerReturnTest::test_press_containers_adds_amount_and_writes_record":7,"Tests\\Feature\\ContainerReturnTest::test_return_containers_deducts_amount":7,"Tests\\Feature\\ContainerReturnTest::test_mixed_sign_containers":7,"Tests\\Feature\\ContainerReturnTest::test_zero_containers_writes_no_record":7,"Tests\\Feature\\StoreOrderTest::test_order_list_outputs_status_name_and_item_preview":7,"Tests\\Feature\\DashboardTest::test_requires_dashboard_analysis_ability":7,"Tests\\Feature\\DashboardTest::test_recon_summary_and_receivable":8,"Tests\\Feature\\DashboardDebugTest::test_debug":8,"Tests\\Feature\\StoreOrderItemTest::test_place_order_snapshots_full_product_info":8,"Tests\\Feature\\StoreOrderItemTest::test_mini_detail_hides_cost_price":8,"Tests\\Feature\\StoreOrderItemTest::test_admin_detail_shows_cost_price_and_supplier":8,"Tests\\Feature\\StoreOrderItemTest::test_update_item_rejected_when_completed_or_cancelled":8,"Tests\\Feature\\StoreOrderItemTest::test_add_store_item_uses_level_percent_price":8,"Tests\\Feature\\ExportTest::test_export_suppliers_multi_sheet":7,"Tests\\Feature\\PurchaseEditTest::test_update_row_skips_catalog_sync_when_product_deleted":7,"Tests\\Feature\\ProductImportExportTest::test_export_filters_by_category":8,"Tests\\Feature\\ProductImportExportTest::test_import_creates_products_and_auto_supplier":7,"Tests\\Feature\\ProductImportExportTest::test_import_matches_existing_supplier":7,"Tests\\Feature\\ProductImportExportTest::test_import_errors_abort_all_rows":7,"Tests\\Feature\\ProductImportExportTest::test_import_category_path_resolution":7,"Tests\\Feature\\MiniReportTest::test_report_accumulates_same_product_across_orders":7,"Tests\\Feature\\ExportTest::test_export_suppliers_split_by_market":7,"Tests\\Feature\\MiniOnlinePaymentTest::test_query_syncs_gateway_status":7,"Tests\\Feature\\MiniSpecialTest::test_cart_quantity_attached_for_store":8,"Tests\\Feature\\MiniWechatPaymentTest::test_create_wechat_payment_success":7,"Tests\\Feature\\ExportTest::test_export_lists_all_catalog_products_with_totals_row":7,"Tests\\Feature\\MiniOnlinePaymentTest::test_create_online_payment_success":7,"Tests\\Feature\\MiniMpPaymentTest::test_mp_scene_wechat_channel":8,"Tests\\Feature\\MiniMpPaymentTest::test_default_scene_remains_mini":7,"Tests\\Feature\\MiniProductTest::test_product_list_ordered_by_category_tree":7,"Tests\\Feature\\PurchaseEditTest::test_list_includes_bill_product_amount":7},"times":{"Tests\\Feature\\ExampleTest::test_the_application_returns_a_successful_response":0.008,"Tests\\Feature\\ProductPriceTest::test_product_list_returns_price_for_store_level":0.104,"Tests\\Feature\\ProductPriceTest::test_store_without_level_is_rejected":0.007,"Tests\\Feature\\ProductPriceTest::test_batch_price_updates_and_notifies_affected_stores":0.01,"Tests\\Feature\\ProductPriceTest::test_price_matrix_structure":0.007,"Tests\\Feature\\StoreOrderTest::test_place_order_snapshots_level_price_and_recalculates":0.049,"Tests\\Feature\\StoreOrderTest::test_client_supplied_amount_is_ignored":0.049,"Tests\\Feature\\StoreOrderTest::test_product_without_level_price_rejected":0.007,"Tests\\Feature\\StoreOrderTest::test_cancel_only_pending_orders":0.065,"Tests\\Feature\\StoreOrderTest::test_summarized_order_cannot_be_cancelled":0.058,"Tests\\Feature\\StoreOrderTest::test_order_data_isolated_between_stores":0.097,"Tests\\Feature\\PurchaseGenerateTest::test_generate_aggregates_orders_by_product":0.028,"Tests\\Feature\\PurchaseGenerateTest::test_generate_writes_back_order_status":0.11,"Tests\\Feature\\PurchaseGenerateTest::test_generate_without_pending_orders_fails":0.006,"Tests\\Feature\\PurchaseGenerateTest::test_generate_is_idempotent":0.116,"Tests\\Feature\\AllocationTest::test_allocation_conserves_amount_with_tail_correction":0.076,"Tests\\Feature\\AllocationTest::test_allocation_follows_order_ratio":0.022,"Tests\\Feature\\AllocationTest::test_allocation_is_idempotent":0.028,"Tests\\Feature\\AllocationTest::test_allocation_rejected_without_actual_amount":0.021,"Tests\\Feature\\DebugGenerateTest::test_debug_generate":0.047,"Tests\\Feature\\ReconciliationTest::test_build_creates_reconciliation_items":0.019,"Tests\\Feature\\ReconciliationTest::test_build_filters_by_supplier":0.022,"Tests\\Feature\\ReconciliationTest::test_update_item_recalculates_diff_and_header":0.019,"Tests\\Feature\\ReconciliationTest::test_toggle_reconciled_flag":0.02,"Tests\\Feature\\ReconciliationTest::test_settle_creates_settlements_per_store":0.036,"Tests\\Feature\\StatementTest::test_generate_snapshots_payment_cycle":0.011,"Tests\\Feature\\StatementTest::test_statement_isolated_between_stores":0.013,"Tests\\Feature\\StatementTest::test_generate_excludes_cancelled_and_used_items":0.016,"Tests\\Feature\\MiniAuthTest::test_login_creates_user_and_issues_token":0.056,"Tests\\Feature\\MiniAuthTest::test_disabled_user_cannot_login":0.003,"Tests\\Feature\\MiniAuthTest::test_phone_binding_matches_store":0.005,"Tests\\Feature\\MiniAuthTest::test_phone_no_match_stays_pending":0.001,"Tests\\Feature\\MiniAuthTest::test_sys_token_cannot_access_mini":0.006,"Tests\\Feature\\MiniAuthTest::test_mini_token_cannot_access_admin_api":0.075,"Tests\\Feature\\ExportTest::test_export_xlsx_with_encoded_chinese_filename":0.104,"Tests\\Feature\\ExportTest::test_export_category_filters_to_vegetables":0.017,"Tests\\Feature\\ExportTest::test_export_pdf":0.015,"Tests\\Feature\\ExportTest::test_export_invalid_format_rejected":0.016,"Tests\\Feature\\ExportTest::test_export_requires_export_permission":0.072,"Tests\\Unit\\ExampleTest::test_that_true_is_true":0.001,"Tests\\Feature\\MiniAuthTest::test_login_fails_when_wechat_rejects_code":0.003,"Tests\\Feature\\CartTest::test_add_to_cart_succeeds":0.046,"Tests\\Feature\\CartTest::test_duplicate_add_merges_quantity":0.048,"Tests\\Feature\\CartTest::test_off_shelf_product_rejected":0.046,"Tests\\Feature\\CartTest::test_soft_deleted_product_rejected":0.008,"Tests\\Feature\\CartTest::test_product_without_level_price_rejected":0.006,"Tests\\Feature\\CartTest::test_unbound_user_rejected":0.006,"Tests\\Feature\\CartTest::test_store_without_level_rejected":0.088,"Tests\\Feature\\CartTest::test_list_with_prices_amounts_and_totals":0.052,"Tests\\Feature\\CartTest::test_list_marks_off_shelf_item_unbuyable":0.05,"Tests\\Feature\\CartTest::test_empty_cart_returns_empty_items":0.045,"Tests\\Feature\\CartTest::test_update_quantity":0.048,"Tests\\Feature\\CartTest::test_update_other_users_item_rejected":0.009,"Tests\\Feature\\CartTest::test_update_missing_item_rejected":0.048,"Tests\\Feature\\CartTest::test_invalid_quantity_rejected":0.048,"Tests\\Feature\\CartTest::test_delete_item":0.047,"Tests\\Feature\\CartTest::test_delete_other_users_item_rejected":0.009,"Tests\\Feature\\CartTest::test_clear_only_own_cart":0.095,"Tests\\Feature\\CartTest::test_unauthenticated_returns_401":0.002,"Tests\\Feature\\CartTest::test_cart_isolated_between_users":0.011,"Tests\\Feature\\DebugCartListTest::test_dump_cart_list_response":0.057,"Tests\\Feature\\ProductCostPriceTest::test_calc_actual_price_fixed_and_percent":0.001,"Tests\\Feature\\ProductCostPriceTest::test_calc_actual_price_edge_cases":0.001,"Tests\\Feature\\ProductCostPriceTest::test_admin_list_contains_cost_price_and_actual_price":0.009,"Tests\\Feature\\ProductCostPriceTest::test_mini_list_returns_actual_price_without_cost_price":0.059,"Tests\\Feature\\ProductCostPriceTest::test_create_product_with_cost_and_percent_pricing":0.008,"Tests\\Feature\\ProductCostPriceTest::test_create_percent_row_without_percent_fails":0.007,"Tests\\Feature\\ProductCostPriceTest::test_update_switches_fixed_to_percent":0.01,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_cost_only_notifies_percent_level_stores":0.01,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_percent_row_update":0.009,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_mixed_row_updates_cost_and_level":0.008,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_empty_row_rejected":0.011,"Tests\\Feature\\ProductCostPriceTest::test_price_matrix_includes_cost_and_percent_columns":0.007,"Tests\\Feature\\ProductCostPriceTest::test_mini_order_uses_actual_price_for_percent_row":0.007,"Tests\\Feature\\ProductCostPriceTest::test_mini_cart_uses_actual_price_for_percent_row":0.01,"Tests\\Feature\\PurchaseGenerateTest::test_generate_uses_min_actual_price_across_types":0.014,"Tests\\Feature\\ProductPriceTest::test_store_without_level_sees_products_without_price":0.052,"Tests\\Feature\\ProductPriceTest::test_unbound_user_can_browse_products_without_price_but_cannot_cart":0.009,"Tests\\Feature\\MiniAuthTest::test_login_issues_token_for_registered_user":0.01,"Tests\\Feature\\MiniAuthTest::test_login_rejects_unregistered_openid":0.002,"Tests\\Feature\\MiniAuthTest::test_register_binds_store_and_issues_token":0.009,"Tests\\Feature\\MiniAuthTest::test_register_rejects_unknown_store":0.002,"Tests\\Feature\\MiniAuthTest::test_register_rejects_duplicate_openid":0.003,"Tests\\Feature\\MiniStoreTest::test_info_returns_bound_store":0.005,"Tests\\Feature\\MiniStoreTest::test_update_info":0.048,"Tests\\Feature\\MiniStoreTest::test_update_info_ignores_readonly_fields":0.05,"Tests\\Feature\\MiniStoreTest::test_requires_bound_store":0.007,"Tests\\Feature\\MiniStoreTest::test_update_info_validates_length":0.049,"Tests\\Feature\\StoreOrderTest::test_container_update_recalculates_amounts":0.012,"Tests\\Feature\\StoreOrderTest::test_container_update_allowed_in_editable_statuses":0.022,"Tests\\Feature\\StoreOrderTest::test_container_update_rejected_in_other_statuses":0.019,"Tests\\Feature\\StoreOrderTest::test_container_update_heals_legacy_product_amount":0.02,"Tests\\Feature\\StoreOrderTest::test_container_update_validates_negative_numbers":0.014,"Tests\\Feature\\PurchaseGenerateTest::test_generate_without_accepted_orders_fails":0.066,"Tests\\Feature\\PurchaseGenerateTest::test_generate_with_selected_order_ids":0.115,"Tests\\Feature\\StoreOrderItemTest::test_place_order_snapshots_full_product_info":0.054,"Tests\\Feature\\StoreOrderItemTest::test_mini_detail_hides_cost_price":0.054,"Tests\\Feature\\StoreOrderItemTest::test_admin_detail_shows_cost_price_and_supplier":0.053,"Tests\\Feature\\StoreOrderItemTest::test_update_item_recalculates_order_totals":0.011,"Tests\\Feature\\StoreOrderItemTest::test_update_item_rejected_when_completed_or_cancelled":0.011,"Tests\\Feature\\StoreOrderItemTest::test_update_item_validates_negative_price":0.012,"Tests\\Feature\\StoreOrderItemTest::test_sync_item_updates_snapshot_from_product":0.013,"Tests\\Feature\\StoreOrderItemTest::test_sync_item_recalculates_percent_price_with_latest_cost":0.01,"Tests\\Feature\\StoreOrderItemTest::test_sync_item_rejected_when_product_deleted":0.01,"Tests\\Feature\\StoreOrderItemTest::test_order_list_search_by_product_name":0.063,"Tests\\Feature\\StoreOrderTest::test_soft_delete_only_cancelled_orders":0.071,"Tests\\Feature\\StoreOrderTest::test_soft_delete_rejected_for_non_cancelled_orders":0.291,"Tests\\Feature\\StoreOrderTest::test_soft_delete_twice_rejected":0.056,"Tests\\Feature\\PurchaseEditTest::test_detail_returns_store_matrix":0.164,"Tests\\Feature\\PurchaseEditTest::test_update_cell_syncs_order_item_and_totals":0.104,"Tests\\Feature\\PurchaseEditTest::test_update_row_cost_syncs_all_order_items":0.119,"Tests\\Feature\\PurchaseEditTest::test_update_row_weight_distributed_by_quantity":0.032,"Tests\\Feature\\PurchaseEditTest::test_update_row_requires_at_least_one_field":0.104,"Tests\\Feature\\PurchaseEditTest::test_update_cell_rejects_negative_quantity":0.1,"Tests\\Feature\\PurchaseGenerateTest::test_generate_aggregates_order_items_into_header":0.141,"Tests\\Feature\\ReconciliationTest::test_build_excludes_unfinished_orders":0.016,"Tests\\Feature\\PurchaseEditTest::test_update_row_syncs_product_attributes":0.106,"Tests\\Feature\\PurchaseEditTest::test_update_row_syncs_to_product_catalog":0.019,"Tests\\Feature\\PurchaseEditTest::test_cell_detail_returns_items_with_order_info":0.102,"Tests\\Feature\\PurchaseEditTest::test_cell_detail_rejects_missing_params":0.099,"Tests\\Feature\\PurchaseEditTest::test_update_cell_weight_cascades_totals":0.102,"Tests\\Feature\\PurchaseEditTest::test_cell_sync_refreshes_snapshot_and_cascades":0.012,"Tests\\Feature\\PurchaseEditTest::test_edits_rejected_when_purchase_completed":0.11,"Tests\\Feature\\PurchaseEditTest::test_update_row_does_not_touch_manual_weight":0.109,"Tests\\Feature\\PurchaseEditTest::test_store_summary_returns_aggregated_items":0.104,"Tests\\Feature\\PurchaseEditTest::test_store_summary_aggregates_multiple_orders_with_weighted_price":0.062,"Tests\\Feature\\PurchaseEditTest::test_store_summary_rejects_missing_or_invalid_params":0.102,"Tests\\Feature\\ExportTest::test_export_invalid_type_rejected":0.016,"Tests\\Feature\\ExportTest::test_export_missing_purchase_rejected":0.009,"Tests\\Feature\\PurchaseEditTest::test_detail_returns_container_summary":0.022,"Tests\\Feature\\PurchaseEditTest::test_update_container_syncs_order_amounts":0.018,"Tests\\Feature\\PurchaseEditTest::test_update_container_rejected_when_purchase_completed":0.018,"Tests\\Feature\\PurchaseEditTest::test_update_container_rejects_incomplete_or_foreign_orders":0.026,"Tests\\Feature\\PurchaseEditTest::test_update_container_validates_negative_and_duplicate_orders":0.018,"Tests\\Feature\\ProductCategoryTest::test_create_child_category_under_top_level":0.011,"Tests\\Feature\\ProductCategoryTest::test_create_category_under_second_level_rejected":0.02,"Tests\\Feature\\ProductCategoryTest::test_update_second_level_move_to_another_top":0.007,"Tests\\Feature\\ProductCategoryTest::test_update_parent_with_children_cannot_move_under_category":0.009,"Tests\\Feature\\ProductCategoryTest::test_update_with_missing_parent_rejected":0.007,"Tests\\Feature\\ProductCategoryTest::test_create_product_with_parent_category_rejected":0.011,"Tests\\Feature\\ProductCategoryTest::test_create_product_with_leaf_category_ok":0.011,"Tests\\Feature\\ProductCategoryTest::test_mini_categories_returns_all_enabled_categories":0.079,"Tests\\Feature\\MiniBillTest::test_bill_list_derives_pay_state_and_settlement_date":0.077,"Tests\\Feature\\MiniBillTest::test_bill_list_summary_aggregates_unpaid":0.055,"Tests\\Feature\\MiniBillTest::test_bill_list_payable_filter":0.056,"Tests\\Feature\\MiniBillTest::test_bill_list_filters_by_bill_date_range":0.051,"Tests\\Feature\\MiniBillTest::test_bill_data_isolated_between_stores":0.11,"Tests\\Feature\\MiniBillTest::test_bill_detail_outputs_bill_items_and_orders":0.052,"Tests\\Feature\\StoreOrderTest::test_order_list_outputs_status_name_and_item_preview":0.07,"Tests\\Feature\\StoreOrderTest::test_order_list_filters_by_order_date_range":0.077,"Tests\\Feature\\StoreOrderTest::test_order_list_rejects_invalid_filters":0.07,"Tests\\Feature\\BillExportTest::test_export_merges_items_across_bills":0.097,"Tests\\Feature\\BillExportTest::test_export_filters_by_root_category":0.051,"Tests\\Feature\\BillExportTest::test_export_empty_category_rejected":0.067,"Tests\\Feature\\BillExportTest::test_export_requires_export_permission":0.049,"Tests\\Feature\\BillExportTest::test_export_invalid_ids_rejected":0.009,"Tests\\Feature\\DebugPermissionTest::test_debug_permission":0.098,"Tests\\Feature\\BillExportTest::test_mini_export_scoped_to_bound_store":0.014,"Tests\\Feature\\BillExportTest::test_mini_export_requires_store_binding":0.005,"Tests\\Feature\\MiniNoticeTest::test_notice_list_includes_personal_and_broadcast":0.069,"Tests\\Feature\\MiniNoticeTest::test_broadcast_read_creates_personal_copy":0.061,"Tests\\Feature\\MiniNoticeTest::test_personal_notice_read_marks_directly":0.055,"Tests\\Feature\\MiniNoticeTest::test_other_users_notice_not_found":0.007,"Tests\\Feature\\StoreOrderTest::test_manual_status_flow_only_accept_and_cancel":0.108,"Tests\\Feature\\StoreOrderTest::test_manual_status_flow_rejects_delivery_and_completion":0.157,"Tests\\Feature\\StoreOrderTest::test_batch_status_only_accept_and_cancel":0.128,"Tests\\Feature\\BillPaymentTest::test_order_status_progresses_via_business_chain":0.058,"Tests\\Feature\\BillPaymentTest::test_manual_pay_accumulates_store_total_purchase_amount":0.067,"Tests\\Feature\\BillPaymentTest::test_payment_audit_pass_accumulates_store_total_purchase_amount":0.053,"Tests\\Feature\\BillPaymentTest::test_payment_audit_reject_does_not_accumulate":0.049,"Tests\\Feature\\MiniProductTest::test_product_detail_guest_sees_null_price":0.058,"Tests\\Feature\\MiniProductTest::test_product_detail_store_user_sees_level_price":0.006,"Tests\\Feature\\MiniProductTest::test_product_detail_percent_price_calculated_from_cost":0.053,"Tests\\Feature\\MiniProductTest::test_product_detail_off_shelf_or_missing_rejected":0.055,"Tests\\Feature\\MiniProductTest::test_product_list_store_user_sees_level_price":0.005,"Tests\\Feature\\MiniProductTest::test_product_list_guest_sees_null_price":0.065,"Tests\\Feature\\BillPaymentTest::test_admin_order_list_and_detail_show_bill_info":0.074,"Tests\\Feature\\BillPaymentTest::test_payment_detail_returns_voucher_urls":0.051,"Tests\\Feature\\StoreOrderTest::test_order_list_preview_includes_image_spec_and_unit":0.085,"Tests\\Feature\\ContainerReturnTest::test_press_containers_adds_amount_and_writes_record":0.086,"Tests\\Feature\\ContainerReturnTest::test_return_containers_deducts_amount":0.069,"Tests\\Feature\\ContainerReturnTest::test_mixed_sign_containers":0.073,"Tests\\Feature\\ContainerReturnTest::test_zero_containers_writes_no_record":0.081,"Tests\\Feature\\ContainerReturnTest::test_non_integer_containers_rejected":0.054,"Tests\\Feature\\ContainerReturnTest::test_manual_create_and_delete_routes_removed":0.006,"Tests\\Feature\\ContainerReturnTest::test_export_matrix_merges_same_day_and_zero_fills":0.104,"Tests\\Feature\\ContainerReturnTest::test_export_filters_by_selected_stores":0.157,"Tests\\Feature\\ContainerReturnTest::test_export_invalid_params_rejected":0.01,"Tests\\Feature\\ContainerReturnTest::test_export_empty_range_rejected":0.012,"Tests\\Feature\\ContainerReturnTest::test_export_requires_export_permission":0.013,"Tests\\Feature\\DashboardTest::test_guest_cannot_access_dashboard":0.002,"Tests\\Feature\\DashboardTest::test_requires_dashboard_analysis_ability":0.006,"Tests\\Feature\\DashboardTest::test_empty_database_returns_zero_structure":0.013,"Tests\\Feature\\DashboardTest::test_overview_excludes_cancelled_orders":0.061,"Tests\\Feature\\DashboardTest::test_week_growth_rate":0.079,"Tests\\Feature\\DashboardTest::test_trend_covers_30_days_with_zero_filling":0.069,"Tests\\Feature\\DashboardTest::test_category_sales_grouped_by_category":0.053,"Tests\\Feature\\DashboardTest::test_top_products_aggregated_across_orders":0.059,"Tests\\Feature\\DashboardTest::test_top_stores_ranked_by_amount":0.112,"Tests\\Feature\\DashboardTest::test_purchase_amount_prefers_actual_over_estimate":0.01,"Tests\\Feature\\DashboardTest::test_recon_summary_and_receivable":0.079,"Tests\\Feature\\DashboardTest::test_latest_orders_limited_and_ordered":0.066,"Tests\\Feature\\DashboardTest::test_archives_count_active_records_only":0.149,"Tests\\Feature\\DashboardDebugTest::test_debug_ability_check":0.044,"Tests\\Feature\\DashboardDebugTest::test_debug":0.045,"Tests\\Feature\\ProductPriceTest::test_batch_price_updates_cost_and_notifies_all_stores":0.13,"Tests\\Feature\\ProductPriceTest::test_level_percent_update_notifies_level_stores":0.121,"Tests\\Feature\\ProductPriceTest::test_level_update_without_percent_change_sends_no_notice":0.053,"Tests\\Feature\\ProductPriceTest::test_level_percent_validation":0.008,"Tests\\Feature\\ProductCostPriceTest::test_calc_level_price":0.001,"Tests\\Feature\\ProductCostPriceTest::test_calc_level_price_edge_cases":0.001,"Tests\\Feature\\ProductCostPriceTest::test_admin_list_contains_cost_price_and_level_prices":0.007,"Tests\\Feature\\ProductCostPriceTest::test_create_product_with_cost_price":0.007,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_cost_row_update":0.053,"Tests\\Feature\\ProductCostPriceTest::test_price_matrix_includes_cost_and_level_price_columns":0.027,"Tests\\Feature\\ProductCostPriceTest::test_mini_order_uses_level_price":0.061,"Tests\\Feature\\ProductCostPriceTest::test_mini_cart_uses_level_price":0.051,"Tests\\Feature\\CartTest::test_store_level_missing_rejected":0.006,"Tests\\Feature\\StoreOrderTest::test_store_level_missing_rejected":0.05,"Tests\\Feature\\PurchaseEditTest::test_update_row_skips_catalog_sync_when_product_deleted":0.104,"Tests\\Feature\\PurchaseEditTest::test_store_item_add_creates_item_and_recalculates":0.106,"Tests\\Feature\\PurchaseEditTest::test_store_item_update_merges_multi_order_rows":0.06,"Tests\\Feature\\PurchaseEditTest::test_store_item_remove_deletes_and_recalculates":0.102,"Tests\\Feature\\StoreOrderItemTest::test_update_store_item_recalculates_totals":0.059,"Tests\\Feature\\StoreOrderItemTest::test_store_item_edits_rejected_when_purchase_completed":0.073,"Tests\\Feature\\StoreOrderItemTest::test_update_store_item_validates_negative_values":0.081,"Tests\\Feature\\StoreOrderItemTest::test_add_store_item_uses_level_percent_price":0.079,"Tests\\Feature\\StoreOrderItemTest::test_add_store_item_rejected_when_product_deleted":0.067,"Tests\\Feature\\ExportTest::test_export_lists_all_catalog_products_with_totals_row":0.12,"Tests\\Feature\\ExportTest::test_export_supplier_filter":0.148,"Tests\\Feature\\ExportTest::test_export_stores_multi_sheet":0.127,"Tests\\Feature\\ExportTest::test_export_stores_single_store":0.145,"Tests\\Feature\\ExportTest::test_export_stores_without_items_rejected":0.179,"Tests\\Feature\\ExportTest::test_export_suppliers_multi_sheet":0.208,"Tests\\Feature\\ExportTest::test_export_suppliers_single":0.115,"Tests\\Feature\\ExportTest::test_export_suppliers_without_items_rejected":0.138,"Tests\\Feature\\PurchaseEditTest::test_update_row_cost_change_reprices_items_by_store_level":0.106,"Tests\\Feature\\PurchaseEditTest::test_update_row_without_cost_change_keeps_item_price":0.111,"Tests\\Feature\\CartTest::test_update_other_stores_item_rejected":0.088,"Tests\\Feature\\CartTest::test_delete_other_stores_item_rejected":0.091,"Tests\\Feature\\CartTest::test_cart_isolated_between_stores":0.108,"Tests\\Feature\\MiniAuthTest::test_login_issues_token_for_valid_credentials":0.176,"Tests\\Feature\\MiniAuthTest::test_login_rejects_wrong_password":0.13,"Tests\\Feature\\MiniAuthTest::test_login_rejects_unknown_username":0.006,"Tests\\Feature\\MiniAuthTest::test_disabled_store_cannot_login":0.124,"Tests\\Feature\\MiniAuthTest::test_login_validates_required_params":0.002,"Tests\\Feature\\MiniAuthTest::test_login_token_accesses_protected_routes":0.138,"Tests\\Feature\\MiniAuthTest::test_set_password_succeeds":0.234,"Tests\\Feature\\MiniAuthTest::test_set_password_rejects_wrong_old_password":0.146,"Tests\\Feature\\MiniAuthTest::test_set_password_validates_confirmation":0.054,"Tests\\Feature\\BillExportTest::test_mini_export_scoped_to_own_store":0.092,"Tests\\Feature\\MiniNoticeTest::test_other_stores_notice_not_found":0.096,"Tests\\Feature\\MiniProductTest::test_product_detail_store_sees_level_price":0.063,"Tests\\Feature\\MiniProductTest::test_product_list_store_sees_level_price":0.059,"Tests\\Feature\\MiniStoreTest::test_info_returns_current_store":0.059,"Tests\\Feature\\MiniStoreTest::test_disabled_store_rejected":0.053,"Tests\\Feature\\ProductImportExportTest::test_export_downloads_all_products":0.008,"Tests\\Feature\\ProductImportExportTest::test_export_filters_by_category":0.012,"Tests\\Feature\\ProductImportExportTest::test_export_template_mode":0.013,"Tests\\Feature\\ProductImportExportTest::test_export_requires_permission":0.008,"Tests\\Feature\\ProductImportExportTest::test_import_creates_products_and_auto_supplier":0.047,"Tests\\Feature\\ProductImportExportTest::test_import_matches_existing_supplier":0.03,"Tests\\Feature\\ProductImportExportTest::test_import_errors_abort_all_rows":0.023,"Tests\\Feature\\ProductImportExportTest::test_import_category_path_resolution":0.031,"Tests\\Feature\\ProductImportExportTest::test_import_rejects_invalid_header":0.018,"Tests\\Feature\\ProductImportExportTest::test_import_requires_permission":0.013,"Tests\\Feature\\ProductImportExportTest::test_list_filters_by_market":0.007,"Tests\\Feature\\MiniReportTest::test_report_aggregates_total_and_item_percent":0.048,"Tests\\Feature\\MiniReportTest::test_report_accumulates_same_product_across_orders":0.051,"Tests\\Feature\\MiniReportTest::test_report_filters_by_custom_date_range":0.046,"Tests\\Feature\\MiniReportTest::test_report_excludes_cancelled_and_deleted_orders":0.049,"Tests\\Feature\\MiniReportTest::test_report_preset_month_and_last_month":0.053,"Tests\\Feature\\MiniReportTest::test_report_preset_week_and_last_week":0.061,"Tests\\Feature\\MiniReportTest::test_report_defaults_to_current_month":0.066,"Tests\\Feature\\MiniReportTest::test_report_data_isolated_between_stores":0.108,"Tests\\Feature\\MiniReportTest::test_report_empty_period_returns_zero":0.053,"Tests\\Feature\\MiniReportTest::test_report_validates_params":0.077,"Tests\\Feature\\ProductBatchDeleteTest::test_batch_delete_soft_deletes_selected_products":0.007,"Tests\\Feature\\ProductBatchDeleteTest::test_batch_delete_requires_non_empty_ids":0.006,"Tests\\Feature\\ProductBatchDeleteTest::test_batch_delete_forbidden_without_permission":0.02,"Tests\\Feature\\CartTest::test_place_order_clears_ordered_items_from_cart":0.059,"Tests\\Feature\\StoreOrderItemTest::test_admin_order_list_filters_by_order_date_range":0.088,"Tests\\Feature\\StoreOrderItemTest::test_admin_order_list_search_by_purchase_no":0.074,"Tests\\Feature\\ExportTest::test_export_suppliers_split_by_market":0.075,"Tests\\Feature\\BillPaymentTest::test_generate_bill_saves_after_sale_and_remark":0.118,"Tests\\Feature\\ProductCostPriceTest::test_product_price_unit_default_and_editable":0.012,"Tests\\Feature\\StoreOrderTest::test_place_order_blocked_by_overdue_unpaid_bill":0.066,"Tests\\Feature\\StoreOrderTest::test_place_order_allowed_within_payment_cycle":0.062,"Tests\\Feature\\CartTest::test_cart_summary_endpoint":0.053,"Tests\\Feature\\CartTest::test_cart_summary_requires_login":0.002,"Tests\\Feature\\MiniProductTest::test_product_list_appends_cart_quantity_and_summary":0.069,"Tests\\Feature\\MiniProductTest::test_product_list_guest_sees_zero_cart_fields":0.05,"Tests\\Feature\\MiniProductTest::test_product_detail_appends_cart_quantity":0.054,"Tests\\Feature\\MiniProductTest::test_home_appends_cart_summary":0.078,"Tests\\Feature\\MiniOnlinePaymentTest::test_sign_matches_document_example":0.002,"Tests\\Feature\\MiniOnlinePaymentTest::test_create_online_payment_success":0.055,"Tests\\Feature\\MiniOnlinePaymentTest::test_create_online_payment_validation":0.121,"Tests\\Feature\\MiniOnlinePaymentTest::test_create_fails_when_code2session_fails":0.062,"Tests\\Feature\\MiniOnlinePaymentTest::test_create_gateway_failure_releases_bills":0.063,"Tests\\Feature\\MiniOnlinePaymentTest::test_notify_settles_payment":0.054,"Tests\\Feature\\MiniOnlinePaymentTest::test_notify_rejects_invalid_messages":0.064,"Tests\\Feature\\MiniOnlinePaymentTest::test_query_syncs_gateway_status":0.082,"Tests\\Feature\\MiniOnlinePaymentTest::test_query_rejects_other_store_payment":0.103,"Tests\\Feature\\MiniOnlinePaymentTest::test_offline_payment_flow_unaffected":0.07,"Tests\\Feature\\BillPaymentTest::test_generate_bill_positive_after_sale_added_to_total":0.116,"Tests\\Feature\\BillPaymentTest::test_generate_bill_rejects_non_numeric_after_sale":0.048,"Tests\\Feature\\ClientSpecialTest::test_batch_add_creates_specials":0.008,"Tests\\Feature\\ClientSpecialTest::test_batch_add_skips_existing_products":0.01,"Tests\\Feature\\ClientSpecialTest::test_batch_add_requires_non_empty_product_ids":0.008,"Tests\\Feature\\ClientSpecialTest::test_batch_add_forbidden_without_permission":0.007,"Tests\\Feature\\ClientSpecialTest::test_query_filters_by_product_name_keyword":0.008,"Tests\\Feature\\ClientSpecialTest::test_update_changes_sort_and_status":0.008,"Tests\\Feature\\ClientSpecialTest::test_delete_and_batch_delete":0.016,"Tests\\Feature\\ClientSpecialTest::test_batch_delete_requires_non_empty_ids":0.007,"Tests\\Feature\\MiniSpecialTest::test_guest_sees_specials_with_null_price":0.046,"Tests\\Feature\\MiniSpecialTest::test_store_sees_level_price":0.046,"Tests\\Feature\\MiniSpecialTest::test_disabled_special_and_off_shelf_product_excluded":0.056,"Tests\\Feature\\MiniSpecialTest::test_specials_sorted_by_sort_asc":0.098,"Tests\\Feature\\MiniSpecialTest::test_cart_quantity_attached_for_store":0.055,"Tests\\Feature\\MiniOnlinePaymentTest::test_aes_encryption_matches_demo_golden":0.001,"Tests\\Feature\\MiniOnlinePaymentTest::test_notify_envelope_round_trip":0.004,"Tests\\Feature\\MiniOnlinePaymentTest::test_swapped_key_config_fails_with_clear_message":0.005,"Tests\\Feature\\MiniWechatPaymentTest::test_create_wechat_payment_success":0.063,"Tests\\Feature\\MiniWechatPaymentTest::test_create_wechat_payment_gateway_failure_releases_bills":0.07,"Tests\\Feature\\MiniWechatPaymentTest::test_wechat_notify_settles_payment":0.061,"Tests\\Feature\\MiniWechatPaymentTest::test_wechat_notify_rejects_invalid_messages":0.059,"Tests\\Feature\\MiniWechatPaymentTest::test_wechat_notify_with_platform_cert_validates_signature":0.066,"Tests\\Feature\\MiniWechatPaymentTest::test_wechat_query_syncs_status":0.09,"Tests\\Feature\\MiniWechatPaymentTest::test_wangpu_channel_remains_default":0.07,"Tests\\Feature\\BillPaymentTest::test_payment_config_returns_pay_methods":0.047,"Tests\\Feature\\MiniMpPaymentTest::test_mp_scene_wechat_channel":0.079,"Tests\\Feature\\MiniMpPaymentTest::test_mp_scene_wangpu_channel":0.06,"Tests\\Feature\\MiniMpPaymentTest::test_mp_scene_oauth_failure":0.053,"Tests\\Feature\\MiniMpPaymentTest::test_mp_scene_requires_mp_config":0.068,"Tests\\Feature\\MiniMpPaymentTest::test_default_scene_remains_mini":0.054,"Tests\\Feature\\MiniProductTest::test_product_list_ordered_by_category_tree":0.008,"Tests\\Feature\\MiniOnlinePaymentTest::test_notify_sign_matches_doc_golden":0.002,"Tests\\Feature\\MiniOnlinePaymentTest::test_notify_verify_rejects_bad_sign":0.002,"Tests\\Feature\\ExportTest::test_export_hides_detail_columns_by_default":0.112,"Tests\\Feature\\ExportTest::test_export_scope_includes_off_shelf_but_not_deleted":0.112,"Tests\\Unit\\WeightEstimatorTest::test_weight_unit_quantity_is_weight":0.001,"Tests\\Unit\\WeightEstimatorTest::test_spec_per_unit_weight":0.001,"Tests\\Unit\\WeightEstimatorTest::test_unparsable_spec_fallback":0,"Tests\\Feature\\StoreOrderTest::test_place_order_prefills_reference_weight":0.059,"Tests\\Feature\\PurchaseGenerateTest::test_generate_sums_reference_weight":0.085,"Tests\\Feature\\PurchaseEditTest::test_store_item_add_defaults_reference_weight":0.103,"Tests\\Feature\\StoreOrderTest::test_place_order_blocked_outside_order_time_window":0.081,"Tests\\Feature\\StoreOrderTest::test_place_order_cross_midnight_time_window":0.069,"Tests\\Feature\\StoreOrderTest::test_place_order_only_cutoff_time_and_invalid_config":0.063,"Tests\\Feature\\PurchaseEditTest::test_item_check_toggle_persists_and_echoes_in_detail":0.125,"Tests\\Feature\\PurchaseEditTest::test_item_check_allowed_when_purchase_completed":0.108,"Tests\\Feature\\PurchaseEditTest::test_item_check_toggle_validates_purchase_and_product":0.146,"Tests\\Feature\\PurchaseEditTest::test_item_check_batch_marks_and_clears":0.14,"Tests\\Feature\\PurchaseEditTest::test_item_check_batch_validates_and_ignores_unknown_products":0.127,"Tests\\Feature\\PurchaseEditTest::test_list_includes_bill_product_amount":0.145,"Tests\\Feature\\BillPaymentTest::test_generate_bill_after_sale_marked_up_by_level":0.106}} \ No newline at end of file +{"version":2,"defects":{"Tests\\Feature\\ProductPriceTest::test_product_list_returns_price_for_store_level":8,"Tests\\Feature\\ProductPriceTest::test_store_without_level_is_rejected":8,"Tests\\Feature\\ProductPriceTest::test_batch_price_updates_and_notifies_affected_stores":7,"Tests\\Feature\\ProductPriceTest::test_price_matrix_structure":8,"Tests\\Feature\\StoreOrderTest::test_place_order_snapshots_level_price_and_recalculates":8,"Tests\\Feature\\StoreOrderTest::test_client_supplied_amount_is_ignored":8,"Tests\\Feature\\StoreOrderTest::test_product_without_level_price_rejected":8,"Tests\\Feature\\StoreOrderTest::test_cancel_only_pending_orders":8,"Tests\\Feature\\StoreOrderTest::test_summarized_order_cannot_be_cancelled":8,"Tests\\Feature\\StoreOrderTest::test_order_data_isolated_between_stores":8,"Tests\\Feature\\PurchaseGenerateTest::test_generate_aggregates_orders_by_product":7,"Tests\\Feature\\PurchaseGenerateTest::test_generate_writes_back_order_status":7,"Tests\\Feature\\PurchaseGenerateTest::test_generate_without_pending_orders_fails":8,"Tests\\Feature\\PurchaseGenerateTest::test_generate_is_idempotent":7,"Tests\\Feature\\AllocationTest::test_allocation_conserves_amount_with_tail_correction":7,"Tests\\Feature\\AllocationTest::test_allocation_follows_order_ratio":7,"Tests\\Feature\\AllocationTest::test_allocation_is_idempotent":7,"Tests\\Feature\\AllocationTest::test_allocation_rejected_without_actual_amount":8,"Tests\\Feature\\MiniAuthTest::test_login_creates_user_and_issues_token":7,"Tests\\Feature\\MiniAuthTest::test_phone_binding_matches_store":8,"Tests\\Feature\\MiniAuthTest::test_phone_no_match_stays_pending":8,"Tests\\Feature\\ExportTest::test_export_xlsx_with_encoded_chinese_filename":7,"Tests\\Feature\\CartTest::test_list_with_prices_amounts_and_totals":7,"Tests\\Feature\\CartTest::test_list_marks_off_shelf_item_unbuyable":7,"Tests\\Feature\\DebugCartListTest::test_dump_cart_list_response":5,"Tests\\Feature\\ProductCostPriceTest::test_create_product_with_cost_and_percent_pricing":7,"Tests\\Feature\\ProductCostPriceTest::test_create_percent_row_without_percent_fails":7,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_cost_only_notifies_percent_level_stores":7,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_empty_row_rejected":7,"Tests\\Feature\\MiniAuthTest::test_disabled_user_cannot_login":8,"Tests\\Feature\\MiniAuthTest::test_mini_token_cannot_access_admin_api":8,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_percent_row_update":7,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_mixed_row_updates_cost_and_level":7,"Tests\\Feature\\ReconciliationTest::test_build_creates_reconciliation_items":8,"Tests\\Feature\\ReconciliationTest::test_build_filters_by_supplier":8,"Tests\\Feature\\ReconciliationTest::test_update_item_recalculates_diff_and_header":8,"Tests\\Feature\\ReconciliationTest::test_toggle_reconciled_flag":8,"Tests\\Feature\\ReconciliationTest::test_settle_creates_settlements_per_store":8,"Tests\\Feature\\ProductCostPriceTest::test_mini_list_returns_actual_price_without_cost_price":8,"Tests\\Feature\\ProductCostPriceTest::test_mini_order_uses_actual_price_for_percent_row":8,"Tests\\Feature\\ProductCostPriceTest::test_mini_cart_uses_actual_price_for_percent_row":8,"Tests\\Feature\\StoreOrderTest::test_container_update_recalculates_amounts":8,"Tests\\Feature\\StoreOrderTest::test_container_update_allowed_in_editable_statuses":8,"Tests\\Feature\\StoreOrderTest::test_container_update_rejected_in_other_statuses":8,"Tests\\Feature\\StoreOrderTest::test_container_update_heals_legacy_product_amount":8,"Tests\\Feature\\StoreOrderTest::test_container_update_validates_negative_numbers":8,"Tests\\Feature\\StoreOrderItemTest::test_sync_item_rejected_when_product_deleted":7,"Tests\\Feature\\StoreOrderItemTest::test_order_list_search_by_product_name":8,"Tests\\Feature\\PurchaseEditTest::test_detail_returns_store_matrix":7,"Tests\\Feature\\PurchaseEditTest::test_update_cell_syncs_order_item_and_totals":7,"Tests\\Feature\\PurchaseEditTest::test_update_row_cost_syncs_all_order_items":7,"Tests\\Feature\\PurchaseEditTest::test_update_row_weight_distributed_by_quantity":7,"Tests\\Feature\\PurchaseEditTest::test_update_row_syncs_product_attributes":7,"Tests\\Feature\\PurchaseGenerateTest::test_generate_aggregates_order_items_into_header":7,"Tests\\Feature\\ExportTest::test_export_category_filters_to_vegetables":7,"Tests\\Feature\\ExportTest::test_export_pdf":7,"Tests\\Feature\\PurchaseEditTest::test_update_row_does_not_touch_manual_weight":7,"Tests\\Feature\\PurchaseEditTest::test_update_row_syncs_to_product_catalog":7,"Tests\\Feature\\PurchaseEditTest::test_update_cell_weight_cascades_totals":7,"Tests\\Feature\\PurchaseEditTest::test_cell_sync_refreshes_snapshot_and_cascades":7,"Tests\\Feature\\PurchaseEditTest::test_edits_rejected_when_purchase_completed":7,"Tests\\Feature\\StoreOrderItemTest::test_update_item_recalculates_order_totals":7,"Tests\\Feature\\StoreOrderItemTest::test_update_item_validates_negative_price":7,"Tests\\Feature\\StoreOrderItemTest::test_sync_item_updates_snapshot_from_product":7,"Tests\\Feature\\StoreOrderItemTest::test_sync_item_recalculates_percent_price_with_latest_cost":7,"Tests\\Feature\\PurchaseEditTest::test_cell_detail_returns_items_with_order_info":8,"Tests\\Feature\\ProductCategoryTest::test_create_product_with_leaf_category_ok":7,"Tests\\Feature\\BillExportTest::test_export_filters_by_root_category":8,"Tests\\Feature\\BillExportTest::test_export_requires_export_permission":8,"Tests\\Feature\\DebugPermissionTest::test_debug_permission":8,"Tests\\Feature\\BillPaymentTest::test_order_status_progresses_via_business_chain":7,"Tests\\Feature\\BillPaymentTest::test_payment_audit_reject_does_not_accumulate":7,"Tests\\Feature\\BillPaymentTest::test_payment_detail_returns_voucher_urls":8,"Tests\\Feature\\ContainerReturnTest::test_press_containers_adds_amount_and_writes_record":7,"Tests\\Feature\\ContainerReturnTest::test_return_containers_deducts_amount":7,"Tests\\Feature\\ContainerReturnTest::test_mixed_sign_containers":7,"Tests\\Feature\\ContainerReturnTest::test_zero_containers_writes_no_record":7,"Tests\\Feature\\StoreOrderTest::test_order_list_outputs_status_name_and_item_preview":7,"Tests\\Feature\\DashboardTest::test_requires_dashboard_analysis_ability":7,"Tests\\Feature\\DashboardTest::test_recon_summary_and_receivable":8,"Tests\\Feature\\DashboardDebugTest::test_debug":8,"Tests\\Feature\\StoreOrderItemTest::test_place_order_snapshots_full_product_info":8,"Tests\\Feature\\StoreOrderItemTest::test_mini_detail_hides_cost_price":8,"Tests\\Feature\\StoreOrderItemTest::test_admin_detail_shows_cost_price_and_supplier":8,"Tests\\Feature\\StoreOrderItemTest::test_update_item_rejected_when_completed_or_cancelled":8,"Tests\\Feature\\StoreOrderItemTest::test_add_store_item_uses_level_percent_price":8,"Tests\\Feature\\ExportTest::test_export_suppliers_multi_sheet":7,"Tests\\Feature\\PurchaseEditTest::test_update_row_skips_catalog_sync_when_product_deleted":7,"Tests\\Feature\\ProductImportExportTest::test_export_filters_by_category":8,"Tests\\Feature\\ProductImportExportTest::test_import_creates_products_and_auto_supplier":7,"Tests\\Feature\\ProductImportExportTest::test_import_matches_existing_supplier":7,"Tests\\Feature\\ProductImportExportTest::test_import_errors_abort_all_rows":7,"Tests\\Feature\\ProductImportExportTest::test_import_category_path_resolution":7,"Tests\\Feature\\MiniReportTest::test_report_accumulates_same_product_across_orders":7,"Tests\\Feature\\ExportTest::test_export_suppliers_split_by_market":7,"Tests\\Feature\\MiniOnlinePaymentTest::test_query_syncs_gateway_status":7,"Tests\\Feature\\MiniSpecialTest::test_cart_quantity_attached_for_store":8,"Tests\\Feature\\MiniWechatPaymentTest::test_create_wechat_payment_success":7,"Tests\\Feature\\ExportTest::test_export_lists_all_catalog_products_with_totals_row":7,"Tests\\Feature\\MiniOnlinePaymentTest::test_create_online_payment_success":7,"Tests\\Feature\\MiniMpPaymentTest::test_mp_scene_wechat_channel":8,"Tests\\Feature\\MiniMpPaymentTest::test_default_scene_remains_mini":7,"Tests\\Feature\\MiniProductTest::test_product_list_ordered_by_category_tree":7,"Tests\\Feature\\PurchaseEditTest::test_list_includes_bill_product_amount":7},"times":{"Tests\\Feature\\ExampleTest::test_the_application_returns_a_successful_response":0.019,"Tests\\Feature\\ProductPriceTest::test_product_list_returns_price_for_store_level":0.088,"Tests\\Feature\\ProductPriceTest::test_store_without_level_is_rejected":0.007,"Tests\\Feature\\ProductPriceTest::test_batch_price_updates_and_notifies_affected_stores":0.01,"Tests\\Feature\\ProductPriceTest::test_price_matrix_structure":0.007,"Tests\\Feature\\StoreOrderTest::test_place_order_snapshots_level_price_and_recalculates":0.048,"Tests\\Feature\\StoreOrderTest::test_client_supplied_amount_is_ignored":0.049,"Tests\\Feature\\StoreOrderTest::test_product_without_level_price_rejected":0.007,"Tests\\Feature\\StoreOrderTest::test_cancel_only_pending_orders":0.05,"Tests\\Feature\\StoreOrderTest::test_summarized_order_cannot_be_cancelled":0.049,"Tests\\Feature\\StoreOrderTest::test_order_data_isolated_between_stores":0.093,"Tests\\Feature\\PurchaseGenerateTest::test_generate_aggregates_orders_by_product":0.028,"Tests\\Feature\\PurchaseGenerateTest::test_generate_writes_back_order_status":0.102,"Tests\\Feature\\PurchaseGenerateTest::test_generate_without_pending_orders_fails":0.006,"Tests\\Feature\\PurchaseGenerateTest::test_generate_is_idempotent":0.101,"Tests\\Feature\\AllocationTest::test_allocation_conserves_amount_with_tail_correction":0.076,"Tests\\Feature\\AllocationTest::test_allocation_follows_order_ratio":0.022,"Tests\\Feature\\AllocationTest::test_allocation_is_idempotent":0.028,"Tests\\Feature\\AllocationTest::test_allocation_rejected_without_actual_amount":0.021,"Tests\\Feature\\DebugGenerateTest::test_debug_generate":0.047,"Tests\\Feature\\ReconciliationTest::test_build_creates_reconciliation_items":0.019,"Tests\\Feature\\ReconciliationTest::test_build_filters_by_supplier":0.022,"Tests\\Feature\\ReconciliationTest::test_update_item_recalculates_diff_and_header":0.019,"Tests\\Feature\\ReconciliationTest::test_toggle_reconciled_flag":0.02,"Tests\\Feature\\ReconciliationTest::test_settle_creates_settlements_per_store":0.036,"Tests\\Feature\\StatementTest::test_generate_snapshots_payment_cycle":0.011,"Tests\\Feature\\StatementTest::test_statement_isolated_between_stores":0.013,"Tests\\Feature\\StatementTest::test_generate_excludes_cancelled_and_used_items":0.016,"Tests\\Feature\\MiniAuthTest::test_login_creates_user_and_issues_token":0.056,"Tests\\Feature\\MiniAuthTest::test_disabled_user_cannot_login":0.003,"Tests\\Feature\\MiniAuthTest::test_phone_binding_matches_store":0.005,"Tests\\Feature\\MiniAuthTest::test_phone_no_match_stays_pending":0.001,"Tests\\Feature\\MiniAuthTest::test_sys_token_cannot_access_mini":0.005,"Tests\\Feature\\MiniAuthTest::test_mini_token_cannot_access_admin_api":0.048,"Tests\\Feature\\ExportTest::test_export_xlsx_with_encoded_chinese_filename":0.112,"Tests\\Feature\\ExportTest::test_export_category_filters_to_vegetables":0.017,"Tests\\Feature\\ExportTest::test_export_pdf":0.015,"Tests\\Feature\\ExportTest::test_export_invalid_format_rejected":0.016,"Tests\\Feature\\ExportTest::test_export_requires_export_permission":0.057,"Tests\\Unit\\ExampleTest::test_that_true_is_true":0.001,"Tests\\Feature\\MiniAuthTest::test_login_fails_when_wechat_rejects_code":0.003,"Tests\\Feature\\CartTest::test_add_to_cart_succeeds":0.047,"Tests\\Feature\\CartTest::test_duplicate_add_merges_quantity":0.048,"Tests\\Feature\\CartTest::test_off_shelf_product_rejected":0.047,"Tests\\Feature\\CartTest::test_soft_deleted_product_rejected":0.008,"Tests\\Feature\\CartTest::test_product_without_level_price_rejected":0.006,"Tests\\Feature\\CartTest::test_unbound_user_rejected":0.006,"Tests\\Feature\\CartTest::test_store_without_level_rejected":0.09,"Tests\\Feature\\CartTest::test_list_with_prices_amounts_and_totals":0.064,"Tests\\Feature\\CartTest::test_list_marks_off_shelf_item_unbuyable":0.051,"Tests\\Feature\\CartTest::test_empty_cart_returns_empty_items":0.045,"Tests\\Feature\\CartTest::test_update_quantity":0.048,"Tests\\Feature\\CartTest::test_update_other_users_item_rejected":0.009,"Tests\\Feature\\CartTest::test_update_missing_item_rejected":0.047,"Tests\\Feature\\CartTest::test_invalid_quantity_rejected":0.049,"Tests\\Feature\\CartTest::test_delete_item":0.048,"Tests\\Feature\\CartTest::test_delete_other_users_item_rejected":0.009,"Tests\\Feature\\CartTest::test_clear_only_own_cart":0.094,"Tests\\Feature\\CartTest::test_unauthenticated_returns_401":0.002,"Tests\\Feature\\CartTest::test_cart_isolated_between_users":0.011,"Tests\\Feature\\DebugCartListTest::test_dump_cart_list_response":0.057,"Tests\\Feature\\ProductCostPriceTest::test_calc_actual_price_fixed_and_percent":0.001,"Tests\\Feature\\ProductCostPriceTest::test_calc_actual_price_edge_cases":0.001,"Tests\\Feature\\ProductCostPriceTest::test_admin_list_contains_cost_price_and_actual_price":0.009,"Tests\\Feature\\ProductCostPriceTest::test_mini_list_returns_actual_price_without_cost_price":0.046,"Tests\\Feature\\ProductCostPriceTest::test_create_product_with_cost_and_percent_pricing":0.008,"Tests\\Feature\\ProductCostPriceTest::test_create_percent_row_without_percent_fails":0.007,"Tests\\Feature\\ProductCostPriceTest::test_update_switches_fixed_to_percent":0.01,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_cost_only_notifies_percent_level_stores":0.01,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_percent_row_update":0.009,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_mixed_row_updates_cost_and_level":0.008,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_empty_row_rejected":0.007,"Tests\\Feature\\ProductCostPriceTest::test_price_matrix_includes_cost_and_percent_columns":0.007,"Tests\\Feature\\ProductCostPriceTest::test_mini_order_uses_actual_price_for_percent_row":0.007,"Tests\\Feature\\ProductCostPriceTest::test_mini_cart_uses_actual_price_for_percent_row":0.01,"Tests\\Feature\\PurchaseGenerateTest::test_generate_uses_min_actual_price_across_types":0.014,"Tests\\Feature\\ProductPriceTest::test_store_without_level_sees_products_without_price":0.049,"Tests\\Feature\\ProductPriceTest::test_unbound_user_can_browse_products_without_price_but_cannot_cart":0.009,"Tests\\Feature\\MiniAuthTest::test_login_issues_token_for_registered_user":0.01,"Tests\\Feature\\MiniAuthTest::test_login_rejects_unregistered_openid":0.002,"Tests\\Feature\\MiniAuthTest::test_register_binds_store_and_issues_token":0.009,"Tests\\Feature\\MiniAuthTest::test_register_rejects_unknown_store":0.002,"Tests\\Feature\\MiniAuthTest::test_register_rejects_duplicate_openid":0.003,"Tests\\Feature\\MiniStoreTest::test_info_returns_bound_store":0.005,"Tests\\Feature\\MiniStoreTest::test_update_info":0.047,"Tests\\Feature\\MiniStoreTest::test_update_info_ignores_readonly_fields":0.048,"Tests\\Feature\\MiniStoreTest::test_requires_bound_store":0.007,"Tests\\Feature\\MiniStoreTest::test_update_info_validates_length":0.045,"Tests\\Feature\\StoreOrderTest::test_container_update_recalculates_amounts":0.012,"Tests\\Feature\\StoreOrderTest::test_container_update_allowed_in_editable_statuses":0.022,"Tests\\Feature\\StoreOrderTest::test_container_update_rejected_in_other_statuses":0.019,"Tests\\Feature\\StoreOrderTest::test_container_update_heals_legacy_product_amount":0.02,"Tests\\Feature\\StoreOrderTest::test_container_update_validates_negative_numbers":0.014,"Tests\\Feature\\PurchaseGenerateTest::test_generate_without_accepted_orders_fails":0.052,"Tests\\Feature\\PurchaseGenerateTest::test_generate_with_selected_order_ids":0.103,"Tests\\Feature\\StoreOrderItemTest::test_place_order_snapshots_full_product_info":0.048,"Tests\\Feature\\StoreOrderItemTest::test_mini_detail_hides_cost_price":0.052,"Tests\\Feature\\StoreOrderItemTest::test_admin_detail_shows_cost_price_and_supplier":0.053,"Tests\\Feature\\StoreOrderItemTest::test_update_item_recalculates_order_totals":0.011,"Tests\\Feature\\StoreOrderItemTest::test_update_item_rejected_when_completed_or_cancelled":0.011,"Tests\\Feature\\StoreOrderItemTest::test_update_item_validates_negative_price":0.012,"Tests\\Feature\\StoreOrderItemTest::test_sync_item_updates_snapshot_from_product":0.013,"Tests\\Feature\\StoreOrderItemTest::test_sync_item_recalculates_percent_price_with_latest_cost":0.01,"Tests\\Feature\\StoreOrderItemTest::test_sync_item_rejected_when_product_deleted":0.01,"Tests\\Feature\\StoreOrderItemTest::test_order_list_search_by_product_name":0.058,"Tests\\Feature\\StoreOrderTest::test_soft_delete_only_cancelled_orders":0.06,"Tests\\Feature\\StoreOrderTest::test_soft_delete_rejected_for_non_cancelled_orders":0.25,"Tests\\Feature\\StoreOrderTest::test_soft_delete_twice_rejected":0.052,"Tests\\Feature\\PurchaseEditTest::test_detail_returns_store_matrix":0.107,"Tests\\Feature\\PurchaseEditTest::test_update_cell_syncs_order_item_and_totals":0.104,"Tests\\Feature\\PurchaseEditTest::test_update_row_cost_syncs_all_order_items":0.107,"Tests\\Feature\\PurchaseEditTest::test_update_row_weight_distributed_by_quantity":0.032,"Tests\\Feature\\PurchaseEditTest::test_update_row_requires_at_least_one_field":0.102,"Tests\\Feature\\PurchaseEditTest::test_update_cell_rejects_negative_quantity":0.1,"Tests\\Feature\\PurchaseGenerateTest::test_generate_aggregates_order_items_into_header":0.101,"Tests\\Feature\\ReconciliationTest::test_build_excludes_unfinished_orders":0.016,"Tests\\Feature\\PurchaseEditTest::test_update_row_syncs_product_attributes":0.117,"Tests\\Feature\\PurchaseEditTest::test_update_row_syncs_to_product_catalog":0.019,"Tests\\Feature\\PurchaseEditTest::test_cell_detail_returns_items_with_order_info":0.103,"Tests\\Feature\\PurchaseEditTest::test_cell_detail_rejects_missing_params":0.1,"Tests\\Feature\\PurchaseEditTest::test_update_cell_weight_cascades_totals":0.103,"Tests\\Feature\\PurchaseEditTest::test_cell_sync_refreshes_snapshot_and_cascades":0.012,"Tests\\Feature\\PurchaseEditTest::test_edits_rejected_when_purchase_completed":0.11,"Tests\\Feature\\PurchaseEditTest::test_update_row_does_not_touch_manual_weight":0.11,"Tests\\Feature\\PurchaseEditTest::test_store_summary_returns_aggregated_items":0.101,"Tests\\Feature\\PurchaseEditTest::test_store_summary_aggregates_multiple_orders_with_weighted_price":0.062,"Tests\\Feature\\PurchaseEditTest::test_store_summary_rejects_missing_or_invalid_params":0.104,"Tests\\Feature\\ExportTest::test_export_invalid_type_rejected":0.016,"Tests\\Feature\\ExportTest::test_export_missing_purchase_rejected":0.006,"Tests\\Feature\\PurchaseEditTest::test_detail_returns_container_summary":0.022,"Tests\\Feature\\PurchaseEditTest::test_update_container_syncs_order_amounts":0.018,"Tests\\Feature\\PurchaseEditTest::test_update_container_rejected_when_purchase_completed":0.018,"Tests\\Feature\\PurchaseEditTest::test_update_container_rejects_incomplete_or_foreign_orders":0.026,"Tests\\Feature\\PurchaseEditTest::test_update_container_validates_negative_and_duplicate_orders":0.018,"Tests\\Feature\\ProductCategoryTest::test_create_child_category_under_top_level":0.007,"Tests\\Feature\\ProductCategoryTest::test_create_category_under_second_level_rejected":0.007,"Tests\\Feature\\ProductCategoryTest::test_update_second_level_move_to_another_top":0.007,"Tests\\Feature\\ProductCategoryTest::test_update_parent_with_children_cannot_move_under_category":0.007,"Tests\\Feature\\ProductCategoryTest::test_update_with_missing_parent_rejected":0.007,"Tests\\Feature\\ProductCategoryTest::test_create_product_with_parent_category_rejected":0.009,"Tests\\Feature\\ProductCategoryTest::test_create_product_with_leaf_category_ok":0.007,"Tests\\Feature\\ProductCategoryTest::test_mini_categories_returns_all_enabled_categories":0.045,"Tests\\Feature\\MiniBillTest::test_bill_list_derives_pay_state_and_settlement_date":0.055,"Tests\\Feature\\MiniBillTest::test_bill_list_summary_aggregates_unpaid":0.047,"Tests\\Feature\\MiniBillTest::test_bill_list_payable_filter":0.051,"Tests\\Feature\\MiniBillTest::test_bill_list_filters_by_bill_date_range":0.067,"Tests\\Feature\\MiniBillTest::test_bill_data_isolated_between_stores":0.087,"Tests\\Feature\\MiniBillTest::test_bill_detail_outputs_bill_items_and_orders":0.05,"Tests\\Feature\\StoreOrderTest::test_order_list_outputs_status_name_and_item_preview":0.053,"Tests\\Feature\\StoreOrderTest::test_order_list_filters_by_order_date_range":0.061,"Tests\\Feature\\StoreOrderTest::test_order_list_rejects_invalid_filters":0.049,"Tests\\Feature\\BillExportTest::test_export_merges_items_across_bills":0.097,"Tests\\Feature\\BillExportTest::test_export_filters_by_root_category":0.052,"Tests\\Feature\\BillExportTest::test_export_empty_category_rejected":0.067,"Tests\\Feature\\BillExportTest::test_export_requires_export_permission":0.049,"Tests\\Feature\\BillExportTest::test_export_invalid_ids_rejected":0.009,"Tests\\Feature\\DebugPermissionTest::test_debug_permission":0.098,"Tests\\Feature\\BillExportTest::test_mini_export_scoped_to_bound_store":0.014,"Tests\\Feature\\BillExportTest::test_mini_export_requires_store_binding":0.005,"Tests\\Feature\\MiniNoticeTest::test_notice_list_includes_personal_and_broadcast":0.059,"Tests\\Feature\\MiniNoticeTest::test_broadcast_read_creates_personal_copy":0.049,"Tests\\Feature\\MiniNoticeTest::test_personal_notice_read_marks_directly":0.045,"Tests\\Feature\\MiniNoticeTest::test_other_users_notice_not_found":0.007,"Tests\\Feature\\StoreOrderTest::test_manual_status_flow_only_accept_and_cancel":0.102,"Tests\\Feature\\StoreOrderTest::test_manual_status_flow_rejects_delivery_and_completion":0.15,"Tests\\Feature\\StoreOrderTest::test_batch_status_only_accept_and_cancel":0.101,"Tests\\Feature\\BillPaymentTest::test_order_status_progresses_via_business_chain":0.061,"Tests\\Feature\\BillPaymentTest::test_manual_pay_accumulates_store_total_purchase_amount":0.071,"Tests\\Feature\\BillPaymentTest::test_payment_audit_pass_accumulates_store_total_purchase_amount":0.053,"Tests\\Feature\\BillPaymentTest::test_payment_audit_reject_does_not_accumulate":0.048,"Tests\\Feature\\MiniProductTest::test_product_detail_guest_sees_null_price":0.046,"Tests\\Feature\\MiniProductTest::test_product_detail_store_user_sees_level_price":0.006,"Tests\\Feature\\MiniProductTest::test_product_detail_percent_price_calculated_from_cost":0.045,"Tests\\Feature\\MiniProductTest::test_product_detail_off_shelf_or_missing_rejected":0.046,"Tests\\Feature\\MiniProductTest::test_product_list_store_user_sees_level_price":0.005,"Tests\\Feature\\MiniProductTest::test_product_list_guest_sees_null_price":0.044,"Tests\\Feature\\BillPaymentTest::test_admin_order_list_and_detail_show_bill_info":0.077,"Tests\\Feature\\BillPaymentTest::test_payment_detail_returns_voucher_urls":0.06,"Tests\\Feature\\StoreOrderTest::test_order_list_preview_includes_image_spec_and_unit":0.051,"Tests\\Feature\\ContainerReturnTest::test_press_containers_adds_amount_and_writes_record":0.06,"Tests\\Feature\\ContainerReturnTest::test_return_containers_deducts_amount":0.061,"Tests\\Feature\\ContainerReturnTest::test_mixed_sign_containers":0.059,"Tests\\Feature\\ContainerReturnTest::test_zero_containers_writes_no_record":0.061,"Tests\\Feature\\ContainerReturnTest::test_non_integer_containers_rejected":0.051,"Tests\\Feature\\ContainerReturnTest::test_manual_create_and_delete_routes_removed":0.022,"Tests\\Feature\\ContainerReturnTest::test_export_matrix_merges_same_day_and_zero_fills":0.09,"Tests\\Feature\\ContainerReturnTest::test_export_filters_by_selected_stores":0.129,"Tests\\Feature\\ContainerReturnTest::test_export_invalid_params_rejected":0.016,"Tests\\Feature\\ContainerReturnTest::test_export_empty_range_rejected":0.006,"Tests\\Feature\\ContainerReturnTest::test_export_requires_export_permission":0.009,"Tests\\Feature\\DashboardTest::test_guest_cannot_access_dashboard":0.002,"Tests\\Feature\\DashboardTest::test_requires_dashboard_analysis_ability":0.006,"Tests\\Feature\\DashboardTest::test_empty_database_returns_zero_structure":0.011,"Tests\\Feature\\DashboardTest::test_overview_excludes_cancelled_orders":0.054,"Tests\\Feature\\DashboardTest::test_week_growth_rate":0.054,"Tests\\Feature\\DashboardTest::test_trend_covers_30_days_with_zero_filling":0.05,"Tests\\Feature\\DashboardTest::test_category_sales_grouped_by_category":0.052,"Tests\\Feature\\DashboardTest::test_top_products_aggregated_across_orders":0.051,"Tests\\Feature\\DashboardTest::test_top_stores_ranked_by_amount":0.091,"Tests\\Feature\\DashboardTest::test_purchase_amount_prefers_actual_over_estimate":0.009,"Tests\\Feature\\DashboardTest::test_recon_summary_and_receivable":0.052,"Tests\\Feature\\DashboardTest::test_latest_orders_limited_and_ordered":0.053,"Tests\\Feature\\DashboardTest::test_archives_count_active_records_only":0.131,"Tests\\Feature\\DashboardDebugTest::test_debug_ability_check":0.044,"Tests\\Feature\\DashboardDebugTest::test_debug":0.045,"Tests\\Feature\\ProductPriceTest::test_batch_price_updates_cost_and_notifies_all_stores":0.092,"Tests\\Feature\\ProductPriceTest::test_level_percent_update_notifies_level_stores":0.109,"Tests\\Feature\\ProductPriceTest::test_level_update_without_percent_change_sends_no_notice":0.048,"Tests\\Feature\\ProductPriceTest::test_level_percent_validation":0.008,"Tests\\Feature\\ProductCostPriceTest::test_calc_level_price":0.001,"Tests\\Feature\\ProductCostPriceTest::test_calc_level_price_edge_cases":0.001,"Tests\\Feature\\ProductCostPriceTest::test_admin_list_contains_cost_price_and_level_prices":0.008,"Tests\\Feature\\ProductCostPriceTest::test_create_product_with_cost_price":0.007,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_cost_row_update":0.053,"Tests\\Feature\\ProductCostPriceTest::test_price_matrix_includes_cost_and_level_price_columns":0.011,"Tests\\Feature\\ProductCostPriceTest::test_mini_order_uses_level_price":0.048,"Tests\\Feature\\ProductCostPriceTest::test_mini_cart_uses_level_price":0.049,"Tests\\Feature\\CartTest::test_store_level_missing_rejected":0.006,"Tests\\Feature\\StoreOrderTest::test_store_level_missing_rejected":0.047,"Tests\\Feature\\PurchaseEditTest::test_update_row_skips_catalog_sync_when_product_deleted":0.104,"Tests\\Feature\\PurchaseEditTest::test_store_item_add_creates_item_and_recalculates":0.106,"Tests\\Feature\\PurchaseEditTest::test_store_item_update_merges_multi_order_rows":0.06,"Tests\\Feature\\PurchaseEditTest::test_store_item_remove_deletes_and_recalculates":0.103,"Tests\\Feature\\StoreOrderItemTest::test_update_store_item_recalculates_totals":0.059,"Tests\\Feature\\StoreOrderItemTest::test_store_item_edits_rejected_when_purchase_completed":0.063,"Tests\\Feature\\StoreOrderItemTest::test_update_store_item_validates_negative_values":0.06,"Tests\\Feature\\StoreOrderItemTest::test_add_store_item_uses_level_percent_price":0.06,"Tests\\Feature\\StoreOrderItemTest::test_add_store_item_rejected_when_product_deleted":0.058,"Tests\\Feature\\ExportTest::test_export_lists_all_catalog_products_with_totals_row":0.103,"Tests\\Feature\\ExportTest::test_export_supplier_filter":0.104,"Tests\\Feature\\ExportTest::test_export_stores_multi_sheet":0.106,"Tests\\Feature\\ExportTest::test_export_stores_single_store":0.104,"Tests\\Feature\\ExportTest::test_export_stores_without_items_rejected":0.146,"Tests\\Feature\\ExportTest::test_export_suppliers_multi_sheet":0.107,"Tests\\Feature\\ExportTest::test_export_suppliers_single":0.104,"Tests\\Feature\\ExportTest::test_export_suppliers_without_items_rejected":0.102,"Tests\\Feature\\PurchaseEditTest::test_update_row_cost_change_reprices_items_by_store_level":0.104,"Tests\\Feature\\PurchaseEditTest::test_update_row_without_cost_change_keeps_item_price":0.107,"Tests\\Feature\\CartTest::test_update_other_stores_item_rejected":0.09,"Tests\\Feature\\CartTest::test_delete_other_stores_item_rejected":0.09,"Tests\\Feature\\CartTest::test_cart_isolated_between_stores":0.09,"Tests\\Feature\\MiniAuthTest::test_login_issues_token_for_valid_credentials":0.127,"Tests\\Feature\\MiniAuthTest::test_login_rejects_wrong_password":0.127,"Tests\\Feature\\MiniAuthTest::test_login_rejects_unknown_username":0.004,"Tests\\Feature\\MiniAuthTest::test_disabled_store_cannot_login":0.124,"Tests\\Feature\\MiniAuthTest::test_login_validates_required_params":0.002,"Tests\\Feature\\MiniAuthTest::test_login_token_accesses_protected_routes":0.128,"Tests\\Feature\\MiniAuthTest::test_set_password_succeeds":0.209,"Tests\\Feature\\MiniAuthTest::test_set_password_rejects_wrong_old_password":0.125,"Tests\\Feature\\MiniAuthTest::test_set_password_validates_confirmation":0.046,"Tests\\Feature\\BillExportTest::test_mini_export_scoped_to_own_store":0.09,"Tests\\Feature\\MiniNoticeTest::test_other_stores_notice_not_found":0.085,"Tests\\Feature\\MiniProductTest::test_product_detail_store_sees_level_price":0.045,"Tests\\Feature\\MiniProductTest::test_product_list_store_sees_level_price":0.045,"Tests\\Feature\\MiniStoreTest::test_info_returns_current_store":0.047,"Tests\\Feature\\MiniStoreTest::test_disabled_store_rejected":0.049,"Tests\\Feature\\ProductImportExportTest::test_export_downloads_all_products":0.008,"Tests\\Feature\\ProductImportExportTest::test_export_filters_by_category":0.007,"Tests\\Feature\\ProductImportExportTest::test_export_template_mode":0.018,"Tests\\Feature\\ProductImportExportTest::test_export_requires_permission":0.006,"Tests\\Feature\\ProductImportExportTest::test_import_creates_products_and_auto_supplier":0.037,"Tests\\Feature\\ProductImportExportTest::test_import_matches_existing_supplier":0.015,"Tests\\Feature\\ProductImportExportTest::test_import_errors_abort_all_rows":0.016,"Tests\\Feature\\ProductImportExportTest::test_import_category_path_resolution":0.028,"Tests\\Feature\\ProductImportExportTest::test_import_rejects_invalid_header":0.014,"Tests\\Feature\\ProductImportExportTest::test_import_requires_permission":0.01,"Tests\\Feature\\ProductImportExportTest::test_list_filters_by_market":0.007,"Tests\\Feature\\MiniReportTest::test_report_aggregates_total_and_item_percent":0.048,"Tests\\Feature\\MiniReportTest::test_report_accumulates_same_product_across_orders":0.047,"Tests\\Feature\\MiniReportTest::test_report_filters_by_custom_date_range":0.049,"Tests\\Feature\\MiniReportTest::test_report_excludes_cancelled_and_deleted_orders":0.048,"Tests\\Feature\\MiniReportTest::test_report_preset_month_and_last_month":0.049,"Tests\\Feature\\MiniReportTest::test_report_preset_week_and_last_week":0.052,"Tests\\Feature\\MiniReportTest::test_report_defaults_to_current_month":0.045,"Tests\\Feature\\MiniReportTest::test_report_data_isolated_between_stores":0.088,"Tests\\Feature\\MiniReportTest::test_report_empty_period_returns_zero":0.046,"Tests\\Feature\\MiniReportTest::test_report_validates_params":0.05,"Tests\\Feature\\ProductBatchDeleteTest::test_batch_delete_soft_deletes_selected_products":0.008,"Tests\\Feature\\ProductBatchDeleteTest::test_batch_delete_requires_non_empty_ids":0.007,"Tests\\Feature\\ProductBatchDeleteTest::test_batch_delete_forbidden_without_permission":0.008,"Tests\\Feature\\CartTest::test_place_order_clears_ordered_items_from_cart":0.076,"Tests\\Feature\\StoreOrderItemTest::test_admin_order_list_filters_by_order_date_range":0.077,"Tests\\Feature\\StoreOrderItemTest::test_admin_order_list_search_by_purchase_no":0.066,"Tests\\Feature\\ExportTest::test_export_suppliers_split_by_market":0.058,"Tests\\Feature\\BillPaymentTest::test_generate_bill_saves_after_sale_and_remark":0.132,"Tests\\Feature\\ProductCostPriceTest::test_product_price_unit_default_and_editable":0.013,"Tests\\Feature\\StoreOrderTest::test_place_order_blocked_by_overdue_unpaid_bill":0.054,"Tests\\Feature\\StoreOrderTest::test_place_order_allowed_within_payment_cycle":0.058,"Tests\\Feature\\CartTest::test_cart_summary_endpoint":0.052,"Tests\\Feature\\CartTest::test_cart_summary_requires_login":0.002,"Tests\\Feature\\MiniProductTest::test_product_list_appends_cart_quantity_and_summary":0.056,"Tests\\Feature\\MiniProductTest::test_product_list_guest_sees_zero_cart_fields":0.053,"Tests\\Feature\\MiniProductTest::test_product_detail_appends_cart_quantity":0.048,"Tests\\Feature\\MiniProductTest::test_home_appends_cart_summary":0.051,"Tests\\Feature\\MiniOnlinePaymentTest::test_sign_matches_document_example":0.002,"Tests\\Feature\\MiniOnlinePaymentTest::test_create_online_payment_success":0.056,"Tests\\Feature\\MiniOnlinePaymentTest::test_create_online_payment_validation":0.099,"Tests\\Feature\\MiniOnlinePaymentTest::test_create_fails_when_code2session_fails":0.05,"Tests\\Feature\\MiniOnlinePaymentTest::test_create_gateway_failure_releases_bills":0.052,"Tests\\Feature\\MiniOnlinePaymentTest::test_notify_settles_payment":0.049,"Tests\\Feature\\MiniOnlinePaymentTest::test_notify_rejects_invalid_messages":0.051,"Tests\\Feature\\MiniOnlinePaymentTest::test_query_syncs_gateway_status":0.06,"Tests\\Feature\\MiniOnlinePaymentTest::test_query_rejects_other_store_payment":0.087,"Tests\\Feature\\MiniOnlinePaymentTest::test_offline_payment_flow_unaffected":0.047,"Tests\\Feature\\BillPaymentTest::test_generate_bill_positive_after_sale_added_to_total":0.116,"Tests\\Feature\\BillPaymentTest::test_generate_bill_rejects_non_numeric_after_sale":0.062,"Tests\\Feature\\ClientSpecialTest::test_batch_add_creates_specials":0.008,"Tests\\Feature\\ClientSpecialTest::test_batch_add_skips_existing_products":0.006,"Tests\\Feature\\ClientSpecialTest::test_batch_add_requires_non_empty_product_ids":0.006,"Tests\\Feature\\ClientSpecialTest::test_batch_add_forbidden_without_permission":0.007,"Tests\\Feature\\ClientSpecialTest::test_query_filters_by_product_name_keyword":0.008,"Tests\\Feature\\ClientSpecialTest::test_update_changes_sort_and_status":0.007,"Tests\\Feature\\ClientSpecialTest::test_delete_and_batch_delete":0.008,"Tests\\Feature\\ClientSpecialTest::test_batch_delete_requires_non_empty_ids":0.006,"Tests\\Feature\\MiniSpecialTest::test_guest_sees_specials_with_null_price":0.044,"Tests\\Feature\\MiniSpecialTest::test_store_sees_level_price":0.046,"Tests\\Feature\\MiniSpecialTest::test_disabled_special_and_off_shelf_product_excluded":0.046,"Tests\\Feature\\MiniSpecialTest::test_specials_sorted_by_sort_asc":0.087,"Tests\\Feature\\MiniSpecialTest::test_cart_quantity_attached_for_store":0.049,"Tests\\Feature\\MiniOnlinePaymentTest::test_aes_encryption_matches_demo_golden":0.001,"Tests\\Feature\\MiniOnlinePaymentTest::test_notify_envelope_round_trip":0.004,"Tests\\Feature\\MiniOnlinePaymentTest::test_swapped_key_config_fails_with_clear_message":0.004,"Tests\\Feature\\MiniWechatPaymentTest::test_create_wechat_payment_success":0.069,"Tests\\Feature\\MiniWechatPaymentTest::test_create_wechat_payment_gateway_failure_releases_bills":0.07,"Tests\\Feature\\MiniWechatPaymentTest::test_wechat_notify_settles_payment":0.071,"Tests\\Feature\\MiniWechatPaymentTest::test_wechat_notify_rejects_invalid_messages":0.053,"Tests\\Feature\\MiniWechatPaymentTest::test_wechat_notify_with_platform_cert_validates_signature":0.054,"Tests\\Feature\\MiniWechatPaymentTest::test_wechat_query_syncs_status":0.06,"Tests\\Feature\\MiniWechatPaymentTest::test_wangpu_channel_remains_default":0.053,"Tests\\Feature\\BillPaymentTest::test_payment_config_returns_pay_methods":0.048,"Tests\\Feature\\MiniMpPaymentTest::test_mp_scene_wechat_channel":0.114,"Tests\\Feature\\MiniMpPaymentTest::test_mp_scene_wangpu_channel":0.056,"Tests\\Feature\\MiniMpPaymentTest::test_mp_scene_oauth_failure":0.047,"Tests\\Feature\\MiniMpPaymentTest::test_mp_scene_requires_mp_config":0.048,"Tests\\Feature\\MiniMpPaymentTest::test_default_scene_remains_mini":0.054,"Tests\\Feature\\MiniProductTest::test_product_list_ordered_by_category_tree":0.006,"Tests\\Feature\\MiniOnlinePaymentTest::test_notify_sign_matches_doc_golden":0.002,"Tests\\Feature\\MiniOnlinePaymentTest::test_notify_verify_rejects_bad_sign":0.002,"Tests\\Feature\\ExportTest::test_export_hides_detail_columns_by_default":0.105,"Tests\\Feature\\ExportTest::test_export_scope_includes_off_shelf_but_not_deleted":0.099,"Tests\\Unit\\WeightEstimatorTest::test_weight_unit_quantity_is_weight":0.001,"Tests\\Unit\\WeightEstimatorTest::test_spec_per_unit_weight":0.001,"Tests\\Unit\\WeightEstimatorTest::test_unparsable_spec_fallback":0,"Tests\\Feature\\StoreOrderTest::test_place_order_prefills_reference_weight":0.048,"Tests\\Feature\\PurchaseGenerateTest::test_generate_sums_reference_weight":0.058,"Tests\\Feature\\PurchaseEditTest::test_store_item_add_defaults_reference_weight":0.103,"Tests\\Feature\\StoreOrderTest::test_place_order_blocked_outside_order_time_window":0.054,"Tests\\Feature\\StoreOrderTest::test_place_order_cross_midnight_time_window":0.056,"Tests\\Feature\\StoreOrderTest::test_place_order_only_cutoff_time_and_invalid_config":0.054,"Tests\\Feature\\PurchaseEditTest::test_item_check_toggle_persists_and_echoes_in_detail":0.111,"Tests\\Feature\\PurchaseEditTest::test_item_check_allowed_when_purchase_completed":0.1,"Tests\\Feature\\PurchaseEditTest::test_item_check_toggle_validates_purchase_and_product":0.103,"Tests\\Feature\\PurchaseEditTest::test_item_check_batch_marks_and_clears":0.112,"Tests\\Feature\\PurchaseEditTest::test_item_check_batch_validates_and_ignores_unknown_products":0.105,"Tests\\Feature\\PurchaseEditTest::test_list_includes_bill_product_amount":0.109,"Tests\\Feature\\BillPaymentTest::test_generate_bill_after_sale_marked_up_by_level":0.105,"Tests\\Feature\\BillExportTest::test_export_merges_items_within_bill":0.093,"Tests\\Feature\\BillExportTest::test_export_bill_not_found_rejected":0.006}} \ No newline at end of file diff --git a/app/Exports/BillExport.php b/app/Exports/BillExport.php index bf4d445..1379a8c 100644 --- a/app/Exports/BillExport.php +++ b/app/Exports/BillExport.php @@ -16,7 +16,7 @@ use PhpOffice\PhpSpreadsheet\Style\Fill; use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet; /** - * 门店账单合并导出:勾选账单跨账单按商品合并明细(可按一级分类过滤), + * 门店账单单独导出:账单内明细按商品合并(可按一级分类过滤), * 表尾汇总商品金额/配送费/附加金额/售后金额/总金额 */ class BillExport implements FromCollection, WithStyles @@ -48,11 +48,11 @@ class BillExport implements FromCollection, WithStyles private int $lastRow = 1; /** - * @param Collection $bills 勾选账单(已按 bill_date/id 排序,with store) + * @param BillModel $bill 导出账单(with store) * @param int $categoryId 一级分类ID(0=全部) */ public function __construct( - private readonly Collection $bills, + private readonly BillModel $bill, private readonly int $categoryId = 0, ) { } @@ -66,35 +66,29 @@ class BillExport implements FromCollection, WithStyles return $this->rows; } - $items = app(BillDetailService::class)->mergedItemsOfBills( - $this->bills->pluck('id')->map(static fn ($id): int => (int) $id)->all() - ); + $items = app(BillDetailService::class)->mergedItems($this->bill); $categoryName = '全部'; if ($this->categoryId > 0) { [$items, $categoryName] = $this->filterByRootCategory($items); } + $bill = $this->bill; $rows = []; $rowIndex = 0; // 标题行 - $rows[] = ['门店账单合并导出(共 ' . $this->bills->count() . ' 张)']; + $rows[] = ['门店账单 ' . $bill->bill_no]; $this->specialRows[++$rowIndex] = 'title'; - // 范围行:账单号 / 门店 / 分类 / 导出时间 - $billNos = $this->bills->pluck('bill_no')->all(); - $billNoText = count($billNos) > 8 - ? implode('、', array_slice($billNos, 0, 8)) . ' 等 ' . count($billNos) . ' 张' - : implode('、', $billNos); - $storeNames = $this->bills - ->map(static fn (BillModel $bill): string => $bill->store->name ?? ('门店#' . $bill->store_id)) - ->unique() - ->values() - ->all(); - $rows[] = ['账单号:' . $billNoText]; - $this->specialRows[++$rowIndex] = 'scope'; - $rows[] = ['门店:' . implode('、', $storeNames) . ' 分类:' . $categoryName . ' 导出时间:' . now('Asia/Shanghai')->format('Y-m-d H:i:s')]; + // 范围行:门店 / 账单日期 / 分类 / 导出时间 + $storeName = $bill->store->name ?? ('门店#' . $bill->store_id); + $rows[] = [ + '门店:' . $storeName + . ' 账单日期:' . $bill->bill_date?->toDateString() + . ' 分类:' . $categoryName + . ' 导出时间:' . now('Asia/Shanghai')->format('Y-m-d H:i:s'), + ]; $this->specialRows[++$rowIndex] = 'scope'; // 空行 @@ -106,7 +100,7 @@ class BillExport implements FromCollection, WithStyles $this->specialRows[++$rowIndex] = 'header'; $this->headerRow = $rowIndex; - // 明细行(跨账单同商品已合并,单价为加权平均) + // 明细行(账单内同商品已合并,单价为加权平均) $totalQuantity = 0; $totalWeight = '0'; $totalAmount = '0'; @@ -135,32 +129,23 @@ class BillExport implements FromCollection, WithStyles $this->fillCells[] = ['row' => $rowIndex, 'column' => 'F', 'value' => (float) $totalQuantity]; $this->fillCells[] = ['row' => $rowIndex, 'column' => 'H', 'value' => (float) $totalAmount]; - // 配送费/附加金额/售后金额/总金额(账单级费用全额汇总,不受分类过滤影响) - $deliveryTotal = '0'; - $addedTotal = '0'; - $afterSaleTotal = '0'; - $boxNum = 0; - $trayNum = 0; - foreach ($this->bills as $bill) { - $deliveryTotal = bcadd($deliveryTotal, (string) $bill->delivery_fee, 2); - $addedTotal = bcadd($addedTotal, (string) $bill->added_amount, 2); - $afterSaleTotal = bcadd($afterSaleTotal, (string) $bill->after_sale, 2); - $boxNum += (int) $bill->box_num; - $trayNum += (int) $bill->tray_num; - } + // 配送费/附加金额/售后金额/总金额(账单级费用全额计入,不受分类过滤影响) + $deliveryTotal = (string) $bill->delivery_fee; + $addedTotal = (string) $bill->added_amount; + $afterSaleTotal = (string) $bill->after_sale; $grandTotal = bcadd(bcadd(bcadd($totalAmount, $deliveryTotal, 2), $addedTotal, 2), $afterSaleTotal, 2); - $rows[] = ['配送费合计', '', '', '', '', '', '', (float) $deliveryTotal]; + $rows[] = ['配送费', '', '', '', '', '', '', (float) $deliveryTotal]; $this->specialRows[++$rowIndex] = 'summary'; $this->mergeRows[] = $rowIndex; $this->fillCells[] = ['row' => $rowIndex, 'column' => 'H', 'value' => (float) $deliveryTotal]; - $rows[] = ['附加金额合计(周转筐 ' . $boxNum . ' 个 / 周转托盘 ' . $trayNum . ' 个)', '', '', '', '', '', '', (float) $addedTotal]; + $rows[] = ['附加金额(周转筐 ' . (int) $bill->box_num . ' 个 / 周转托盘 ' . (int) $bill->tray_num . ' 个)', '', '', '', '', '', '', (float) $addedTotal]; $this->specialRows[++$rowIndex] = 'summary'; $this->mergeRows[] = $rowIndex; $this->fillCells[] = ['row' => $rowIndex, 'column' => 'H', 'value' => (float) $addedTotal]; - $rows[] = ['售后金额合计(可正负)', '', '', '', '', '', '', (float) $afterSaleTotal]; + $rows[] = ['售后金额(可正负)', '', '', '', '', '', '', (float) $afterSaleTotal]; $this->specialRows[++$rowIndex] = 'summary'; $this->mergeRows[] = $rowIndex; $this->fillCells[] = ['row' => $rowIndex, 'column' => 'H', 'value' => (float) $afterSaleTotal]; @@ -301,7 +286,7 @@ class BillExport implements FromCollection, WithStyles )); if ($filtered === []) { - throw new RepositoryException('所选账单在「' . $categoryName . '」分类下无商品明细'); + throw new RepositoryException('该账单在「' . $categoryName . '」分类下无商品明细'); } return [$filtered, $categoryName]; diff --git a/app/Http/Controllers/Mini/BillController.php b/app/Http/Controllers/Mini/BillController.php index 3c5c817..977135b 100644 --- a/app/Http/Controllers/Mini/BillController.php +++ b/app/Http/Controllers/Mini/BillController.php @@ -87,41 +87,28 @@ class BillController extends BaseMiniController } /** - * 合并导出账单(静态路由放在 /bill/{id} 之前声明) - * 仅可导出本店账单(强制 store_id 过滤,张数不匹配说明混入无效账单整批拒绝); - * ?ids=1,2,3 必选(1~100 张);?category_id= 一级分类过滤(0/缺省=全部) + * 单独导出账单:仅可导出本店账单(强制 store_id 过滤); + * ?category_id= 一级分类过滤(0/缺省=全部) */ - #[GetRoute('/bill/export', authorize: true)] - public function export(Request $request): Response + #[GetRoute('/bill/{id}/export', authorize: true, where: ['id' => '[0-9]+'])] + public function export(int $id, Request $request): Response { $data = $request->validate([ - 'ids' => 'required|string', 'category_id' => 'nullable|integer|min:0', ]); $store = $this->currentStore($request); - $ids = array_values(array_unique(array_filter(array_map('intval', explode(',', (string) $data['ids']))))); - if ($ids === [] || count($ids) > 100) { - throw new RepositoryException('请选择 1~100 张账单'); - } - - $bills = BillModel::with('store:id,name') + $bill = BillModel::with('store:id,name') ->where('store_id', $store->id) - ->whereIn('id', $ids) - ->orderBy('bill_date') - ->orderBy('id') - ->get(); - if ($bills->isEmpty()) { + ->find($id); + if ($bill === null) { throw new RepositoryException('账单不存在'); } - if ($bills->count() !== count($ids)) { - throw new RepositoryException('存在无效账单,请刷新后重试'); - } return Excel::download( - new BillExport($bills, (int) ($data['category_id'] ?? 0)), - '门店账单_' . now()->format('Ymd_His') . '.xlsx' + new BillExport($bill, (int) ($data['category_id'] ?? 0)), + '门店账单_' . $bill->bill_no . '.xlsx' ); } diff --git a/app/Http/Controllers/Recon/BillController.php b/app/Http/Controllers/Recon/BillController.php index e66e9ff..97cc26a 100644 --- a/app/Http/Controllers/Recon/BillController.php +++ b/app/Http/Controllers/Recon/BillController.php @@ -61,34 +61,24 @@ class BillController extends BaseController } /** - * 合并导出:勾选账单跨账单按商品合并明细(可按一级分类过滤), - * 表尾汇总商品金额/配送费/附加金额/总金额 + * 单独导出账单:账单内明细按商品合并(可按一级分类过滤), + * 表尾汇总商品金额/配送费/附加金额/售后金额/总金额 */ - #[GetRoute(route: '/export', authorize: 'export')] - public function export(Request $request): Response + #[GetRoute(route: '/{id}/export', authorize: 'export', where: ['id' => '[0-9]+'])] + public function export(int $id, Request $request): Response { $data = $request->validate([ - 'ids' => 'required|string', 'category_id' => 'nullable|integer|min:0', ]); - $ids = array_values(array_filter(array_map('intval', explode(',', (string) $data['ids'])))); - if ($ids === [] || count($ids) > 100) { - throw new RepositoryException('请选择 1~100 张账单'); - } - - $bills = BillModel::with('store:id,name') - ->whereIn('id', $ids) - ->orderBy('bill_date') - ->orderBy('id') - ->get(); - if ($bills->isEmpty()) { + $bill = BillModel::with('store:id,name')->find($id); + if (empty($bill)) { throw new RepositoryException('账单不存在'); } return Excel::download( - new BillExport($bills, (int) ($data['category_id'] ?? 0)), - '门店账单_' . now()->format('Ymd_His') . '.xlsx' + new BillExport($bill, (int) ($data['category_id'] ?? 0)), + '门店账单_' . $bill->bill_no . '.xlsx' ); } diff --git a/app/Services/BillDetailService.php b/app/Services/BillDetailService.php index 3a57047..50ee313 100644 --- a/app/Services/BillDetailService.php +++ b/app/Services/BillDetailService.php @@ -29,24 +29,6 @@ class BillDetailService return $this->aggregateItems($items); } - /** - * 合并后的商品明细(跨账单口径):按商品聚合多张账单的全部订单明细 - * 用于账单合并导出,单价同为加权平均口径 - * - * @param array $billIds 账单ID列表 - * @return array - */ - public function mergedItemsOfBills(array $billIds): array - { - $items = StoreOrderItemModel::query() - ->whereIn('bill_id', $billIds) - ->where('quantity', '>', 0) - ->orderBy('id') - ->get(); - - return $this->aggregateItems($items); - } - /** * 按商品聚合订单明细:数量累加、重量/金额 bc 累加、单价加权平均, * 首图取明细快照 image_ids 批量解析,按「分类sort → 商品sort」排序 diff --git a/public/assets/bill-d4QJGLlp.js b/public/assets/bill-d4QJGLlp.js deleted file mode 100644 index 32de6af..0000000 --- a/public/assets/bill-d4QJGLlp.js +++ /dev/null @@ -1 +0,0 @@ -import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Dr as t,t as n}from"./jsx-runtime-CRBytmvs.js";import{t as r}from"./request--UCyt0wo.js";import{t as i}from"./typography-DRFhazK9.js";import{L as a,a as o}from"./lodash-DzOfPy0f.js";import{t as s}from"./table-BXi9q3AE.js";import{t as c}from"./button-BILozH6U.js";import{r as l}from"./DoubleRightOutlined-Blfli1UU.js";import{n as u}from"./LockOutlined-B8eRH1x4.js";import{u as d}from"./XinForm-BPDYdeax.js";import{t as f}from"./modal-g8Q5gNCx.js";import{t as p}from"./descriptions-BLF6MKiu.js";import{t as m}from"./form-B3R3kIqp.js";import{t as h}from"./input-CHcsaDtX.js";import{r as g}from"./PictureOutlined-CB8Pr7jP.js";import{t as _}from"./tag-DBV1bHre.js";import{t as v}from"./DownloadOutlined-DJY9Mu8c.js";import{t as y}from"./XinTable-DOLiJ5rL.js";import{t as b}from"./AuthButton-DvrpreK4.js";import{t as x}from"./download-DC9wDwqQ.js";import{t as S}from"./store-JDnJsv44.js";import{n as C}from"./iStoreOrder-CyyYoLoV.js";import{t as w}from"./iPurchaseOrder-Dn-laOqY.js";import{n as T}from"./category-MmrJkdbs.js";var E=e(t(),1),D=e(u(),1);async function O(e){return r({url:`/recon/bill/${e}`,method:`get`})}async function k(e,t){return r({url:`/recon/bill/${e}/pay`,method:`put`,data:t})}async function A(e,t){return x(`/recon/bill/export`,{ids:e.join(`,`),category_id:t},`门店账单.xlsx`)}var j=n(),{Title:M,Text:N}=i,P=()=>{let e=(0,E.useRef)(null),[t,n]=(0,E.useState)([]),[r,i]=(0,E.useState)(!1),[u,x]=(0,E.useState)(null),[P,F]=(0,E.useState)(!1),[I,L]=(0,E.useState)(null),[R,z]=(0,E.useState)(!1),[B]=m.useForm(),[V,H]=(0,E.useState)([]),[U,W]=(0,E.useState)(!1),[G,K]=(0,E.useState)(!1),[q,J]=(0,E.useState)(0),[Y,X]=(0,E.useState)([]);(0,E.useEffect)(()=>{S().then(e=>n(e.data.data??[])),T().then(e=>X((e.data.data??[]).map(e=>({value:e.id,label:e.name??``}))))},[]);let Z=async e=>{i(!0),F(!0);try{let t=await O(e);x(t.data.data??null)}finally{F(!1)}},Q=e=>{L(e),B.setFieldsValue({paid_at:(0,D.default)(),pay_remark:``})},$=async t=>{if(I?.id){z(!0);try{await k(I.id,{paid_at:t.paid_at.format(`YYYY-MM-DD HH:mm:ss`),pay_remark:t.pay_remark??``}),g.success(`收款已登记,账单已置为已支付`),L(null),await e.current?.reload()}finally{z(!1)}}},ee=async()=>{if(V.length!==0){K(!0);try{await A(V,q),W(!1)}finally{K(!1)}}},te=[{title:`品名`,dataIndex:`product_name`,width:160,align:`center`},{title:`包规`,dataIndex:`product_spec`,width:100,align:`center`,render:e=>e||`-`},{title:`单位`,dataIndex:`unit`,width:80,align:`center`,render:e=>e||`-`},{title:`单价`,dataIndex:`price`,width:100,align:`center`,render:e=>`¥${Number(e).toFixed(2)}`},{title:`数量`,dataIndex:`quantity`,width:90,align:`center`,render:e=>(0,j.jsx)(N,{strong:!0,children:e})},{title:`重量`,dataIndex:`weight`,width:100,align:`center`,render:e=>`${e}斤`},{title:`金额`,dataIndex:`amount`,width:110,align:`center`,render:e=>(0,j.jsxs)(N,{strong:!0,children:[`¥`,Number(e).toFixed(2)]})}],ne=()=>{let e=u?.items??[],t=e.reduce((e,t)=>e+Number(t.quantity),0),n=e.reduce((e,t)=>e+Number(t.weight),0),r=e.reduce((e,t)=>e+Number(t.amount),0);return(0,j.jsxs)(s.Summary.Row,{children:[(0,j.jsx)(s.Summary.Cell,{index:0,colSpan:4,align:`center`,children:(0,j.jsx)(N,{strong:!0,children:`合计`})}),(0,j.jsx)(s.Summary.Cell,{index:4,align:`center`,children:(0,j.jsx)(N,{strong:!0,children:t})}),(0,j.jsx)(s.Summary.Cell,{index:5,align:`center`,children:(0,j.jsxs)(N,{strong:!0,children:[n.toFixed(3),`斤`]})}),(0,j.jsx)(s.Summary.Cell,{index:6,align:`center`,children:(0,j.jsxs)(N,{strong:!0,type:`danger`,children:[`¥`,r.toFixed(2)]})})]})},re=[{title:`订单号`,dataIndex:`order_no`,align:`center`,render:e=>(0,j.jsx)(N,{copyable:{text:e},children:e})},{title:`订货日期`,dataIndex:`order_date`,align:`center`},{title:`订货数量`,dataIndex:`total_quantity`,align:`center`},{title:`总重量`,dataIndex:`total_weight`,align:`center`,render:e=>`${e}斤`},{title:`订单金额`,dataIndex:`total_amount`,align:`center`,render:e=>(0,j.jsxs)(N,{strong:!0,children:[`¥`,e]})},{title:`状态`,dataIndex:`status`,align:`center`,render:e=>{let t=C[Number(e??0)];return(0,j.jsx)(_,{color:t?.color,children:t?.text})}}],ie=[{title:`账单号`,dataIndex:`bill_no`,valueType:`text`,hideInForm:!0,width:210,render:(e,t)=>(0,j.jsx)(N,{copyable:{text:t.bill_no},children:t.bill_no})},{title:`门店`,dataIndex:`store_id`,valueType:`select`,hideInForm:!0,fieldProps:{options:t.map(e=>({label:e.name,value:e.id})),showSearch:!0,optionFilterProp:`label`},render:(e,t)=>t.store?.name??`门店#${t.store_id}`},{title:`采购单号`,dataIndex:`purchase_no`,valueType:`text`,hideInForm:!0,render:(e,t)=>t.purchase?.purchase_no??`-`},{title:`账单日期`,dataIndex:`bill_date`,valueType:`dateRange`,hideInForm:!0,align:`center`,render:(e,t)=>t.bill_date},{title:`商品金额`,dataIndex:`product_amount`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>`¥${t.product_amount}`},{title:`配送费`,dataIndex:`delivery_fee`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>`¥${t.delivery_fee}`},{title:`附加金额`,dataIndex:`added_amount`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>(0,j.jsxs)(`span`,{title:`周转筐 ${t.box_num} 个 / 周转托盘 ${t.tray_num} 个`,children:[`¥`,t.added_amount]})},{title:`售后金额`,dataIndex:`after_sale`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>(0,j.jsxs)(N,{type:Number(t.after_sale??0)<0?`success`:void 0,children:[`¥`,t.after_sale??`0.00`]})},{title:`账单总金额`,dataIndex:`total_amount`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>(0,j.jsxs)(N,{strong:!0,type:`danger`,children:[`¥`,t.total_amount]})},{title:`支付状态`,dataIndex:`status`,valueType:`select`,hideInForm:!0,align:`center`,fieldProps:{options:Object.entries(w).map(([e,t])=>({value:Number(e),label:t.text}))},render:(e,t)=>{let n=w[t.status??0];return(0,j.jsx)(_,{color:n?.color,children:n?.text})}},{title:`关联订单`,dataIndex:`orders_count`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>`${t.orders_count??0} 笔`},{title:`生成时间`,dataIndex:`created_at`,hideInForm:!0,hideInSearch:!0,align:`center`}];return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`mb-5`,children:[(0,j.jsx)(M,{level:3,children:`门店账单`}),(0,j.jsx)(N,{type:`secondary`,children:`采购单完成后在「采购单」页生成,每个门店单独一张;账单总金额 = 商品金额 + 配送费 + 附加金额(周转筐/托盘)+ 售后金额(可正负); 勾选多张账单可合并导出为一个 Excel(明细跨账单按商品合并,可按一级分类过滤)。`})]}),(0,j.jsx)(y,{api:`/recon/bill`,columns:ie,rowKey:`id`,accessName:`recon.bill`,tableRef:e,operateRender:e=>[(0,j.jsx)(c,{size:`small`,type:`primary`,icon:(0,j.jsx)(o,{}),onClick:()=>Z(e.id)},`detail`),e.status===0?(0,j.jsx)(b,{auth:`recon.bill.pay`,children:(0,j.jsx)(c,{size:`small`,variant:`solid`,color:`green`,onClick:()=>Q(e),children:`确认收款`})},`pay`):null],formProps:!1,actionBarRender:e=>[e.search,e.keywordSearch],rowSelection:{selectedRowKeys:V,onChange:e=>H(e.map(Number)),preserveSelectedRowKeys:!0},toolBarRender:e=>[(0,j.jsx)(b,{auth:`recon.bill.export`,children:(0,j.jsxs)(c,{icon:(0,j.jsx)(v,{}),disabled:V.length===0,onClick:()=>W(!0),children:[`导出`,V.length>0?`(${V.length})`:``]})},`export`),e.columnSetting,e.hideBorder,e.reload,e.columnHeight]}),(0,j.jsx)(a,{title:u?`账单 ${u.bill.bill_no}`:`账单详情`,open:r,onClose:()=>i(!1),size:1e3,loading:P,children:u?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(p,{column:3,size:`small`,bordered:!0,children:[(0,j.jsx)(p.Item,{label:`门店`,children:u.bill.store?.name??`门店#${u.bill.store_id}`}),(0,j.jsx)(p.Item,{label:`采购单号`,children:u.bill.purchase?.purchase_no??`-`}),(0,j.jsx)(p.Item,{label:`账单日期`,children:u.bill.bill_date}),(0,j.jsxs)(p.Item,{label:`商品金额`,children:[`¥`,u.bill.product_amount]}),(0,j.jsxs)(p.Item,{label:`配送费`,children:[`¥`,u.bill.delivery_fee]}),(0,j.jsxs)(p.Item,{label:`附加金额`,children:[`¥`,u.bill.added_amount,(0,j.jsxs)(N,{type:`secondary`,className:`ml-2!`,children:[`(筐 `,u.bill.box_num,`×¥`,u.bill.box_price,`,托盘 `,u.bill.tray_num,`×¥`,u.bill.tray_price,`)`]})]}),(0,j.jsxs)(p.Item,{label:`售后金额`,children:[(0,j.jsxs)(N,{type:Number(u.bill.after_sale??0)<0?`success`:void 0,children:[`¥`,u.bill.after_sale??`0.00`]}),(0,j.jsx)(N,{type:`secondary`,className:`ml-2!`,children:`(可正负,计入总金额)`})]}),(0,j.jsx)(p.Item,{label:`账单总金额`,children:(0,j.jsxs)(N,{strong:!0,type:`danger`,children:[`¥`,u.bill.total_amount]})}),(0,j.jsx)(p.Item,{label:`支付状态`,children:(0,j.jsx)(_,{color:w[u.bill.status??0]?.color,children:w[u.bill.status??0]?.text})}),(0,j.jsx)(p.Item,{label:`付款时间`,children:u.bill.paid_at??`-`}),(0,j.jsx)(p.Item,{label:`收款人`,children:u.bill.paid_operator?.nickname??`-`}),(0,j.jsx)(p.Item,{label:`生成人`,children:u.bill.operator?.nickname??`-`}),(0,j.jsx)(p.Item,{label:`生成时间`,children:u.bill.created_at}),u.bill.pay_remark?(0,j.jsx)(p.Item,{label:`付款备注`,span:3,children:u.bill.pay_remark}):null,u.bill.remark?(0,j.jsx)(p.Item,{label:`备注`,span:3,children:u.bill.remark}):null]}),(0,j.jsx)(M,{level:5,className:`mt-6! mb-3!`,children:`商品明细(按商品合并)`}),(0,j.jsx)(s,{rowKey:`product_id`,size:`small`,bordered:!0,columns:te,dataSource:u.items,pagination:!1,scroll:{x:`max-content`},summary:ne}),(0,j.jsxs)(M,{level:5,className:`mt-6! mb-3!`,children:[`关联订单(`,u.orders.length,` 笔)`]}),(0,j.jsx)(s,{rowKey:`id`,size:`small`,bordered:!0,columns:re,dataSource:u.orders,pagination:!1,scroll:{x:`max-content`}})]}):null}),(0,j.jsxs)(f,{title:I?`确认收款 · ${I.bill_no}`:`确认收款`,open:I!==null,onCancel:()=>L(null),onOk:()=>B.submit(),confirmLoading:R,okText:`确认收款`,destroyOnHidden:!0,children:[(0,j.jsxs)(`div`,{className:`py-2 text-gray-500`,children:[`应收金额 `,(0,j.jsxs)(N,{strong:!0,type:`danger`,children:[`¥`,I?.total_amount??`0.00`]}),`(商品 ¥`,I?.product_amount??`0.00`,` + 配送费 ¥`,I?.delivery_fee??`0.00`,` + 附加 ¥`,I?.added_amount??`0.00`,` + 售后 ¥`,I?.after_sale??`0.00`,`); 线下收款完成后登记付款信息,账单支付状态将置为「已支付」。`]}),(0,j.jsxs)(m,{form:B,layout:`vertical`,onFinish:$,children:[(0,j.jsx)(m.Item,{label:`付款时间`,name:`paid_at`,rules:[{required:!0,message:`请选择付款时间`}],children:(0,j.jsx)(d,{className:`w-full`,showTime:!0,allowClear:!1})}),(0,j.jsx)(m.Item,{label:`付款备注`,name:`pay_remark`,rules:[{max:255}],children:(0,j.jsx)(h.TextArea,{rows:2,maxLength:255,placeholder:`如:现金/转账单号等线下收款信息(选填)`})})]})]}),(0,j.jsxs)(f,{title:`导出账单`,open:U,onCancel:()=>W(!1),onOk:ee,confirmLoading:G,okText:`导出`,destroyOnHidden:!0,children:[(0,j.jsxs)(`div`,{className:`py-2 text-gray-500`,children:[`已选 `,(0,j.jsx)(N,{strong:!0,children:V.length}),` 张账单,导出为一个 Excel:商品明细跨账单按商品合并,表尾汇总配送费、附加金额与总金额; 选择分类后仅导出该一级分类下的商品明细(配送费/附加金额仍全额汇总)。`]}),(0,j.jsx)(m,{layout:`vertical`,children:(0,j.jsx)(m.Item,{label:`商品分类`,children:(0,j.jsx)(l,{value:q,onChange:e=>J(e),options:[{value:0,label:`全部分类`},...Y]})})})]})]})};export{P as default}; \ No newline at end of file diff --git a/public/assets/bill-qG3t0JUE.js b/public/assets/bill-qG3t0JUE.js new file mode 100644 index 0000000..bd6b882 --- /dev/null +++ b/public/assets/bill-qG3t0JUE.js @@ -0,0 +1 @@ +import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Dr as t,t as n}from"./jsx-runtime-CRBytmvs.js";import{t as r}from"./request--UCyt0wo.js";import{t as i}from"./typography-DRFhazK9.js";import{L as a,a as o}from"./lodash-DzOfPy0f.js";import{t as s}from"./table-BXi9q3AE.js";import{t as c}from"./button-BILozH6U.js";import{n as l}from"./LockOutlined-B8eRH1x4.js";import{u}from"./XinForm-BPDYdeax.js";import{t as d}from"./modal-g8Q5gNCx.js";import{t as f}from"./descriptions-BLF6MKiu.js";import{t as p}from"./form-B3R3kIqp.js";import{t as m}from"./input-CHcsaDtX.js";import{r as h}from"./PictureOutlined-CB8Pr7jP.js";import{t as g}from"./tag-DBV1bHre.js";import{t as _}from"./DownloadOutlined-DJY9Mu8c.js";import{t as v}from"./XinTable-DOLiJ5rL.js";import{t as y}from"./AuthButton-DvrpreK4.js";import{t as b}from"./download-DC9wDwqQ.js";import{t as x}from"./store-JDnJsv44.js";import{n as S}from"./iStoreOrder-CyyYoLoV.js";import{t as C}from"./iPurchaseOrder-Dn-laOqY.js";var w=e(t(),1),T=e(l(),1);async function E(e){return r({url:`/recon/bill/${e}`,method:`get`})}async function D(e,t){return r({url:`/recon/bill/${e}/pay`,method:`put`,data:t})}async function O(e){return b(`/recon/bill/${e}/export`,{},`门店账单.xlsx`)}var k=n(),{Title:A,Text:j}=i,M=()=>{let e=(0,w.useRef)(null),[t,n]=(0,w.useState)([]),[r,i]=(0,w.useState)(!1),[l,b]=(0,w.useState)(null),[M,N]=(0,w.useState)(!1),[P,F]=(0,w.useState)(null),[I,L]=(0,w.useState)(!1),[R]=p.useForm(),[z,B]=(0,w.useState)(null);(0,w.useEffect)(()=>{x().then(e=>n(e.data.data??[]))},[]);let V=async e=>{i(!0),N(!0);try{let t=await E(e);b(t.data.data??null)}finally{N(!1)}},H=e=>{F(e),R.setFieldsValue({paid_at:(0,T.default)(),pay_remark:``})},U=async t=>{if(P?.id){L(!0);try{await D(P.id,{paid_at:t.paid_at.format(`YYYY-MM-DD HH:mm:ss`),pay_remark:t.pay_remark??``}),h.success(`收款已登记,账单已置为已支付`),F(null),await e.current?.reload()}finally{L(!1)}}},W=async e=>{if(e.id){B(e.id);try{await O(e.id)}finally{B(null)}}},G=[{title:`品名`,dataIndex:`product_name`,width:160,align:`center`},{title:`包规`,dataIndex:`product_spec`,width:100,align:`center`,render:e=>e||`-`},{title:`单位`,dataIndex:`unit`,width:80,align:`center`,render:e=>e||`-`},{title:`单价`,dataIndex:`price`,width:100,align:`center`,render:e=>`¥${Number(e).toFixed(2)}`},{title:`数量`,dataIndex:`quantity`,width:90,align:`center`,render:e=>(0,k.jsx)(j,{strong:!0,children:e})},{title:`重量`,dataIndex:`weight`,width:100,align:`center`,render:e=>`${e}斤`},{title:`金额`,dataIndex:`amount`,width:110,align:`center`,render:e=>(0,k.jsxs)(j,{strong:!0,children:[`¥`,Number(e).toFixed(2)]})}],K=()=>{let e=l?.items??[],t=e.reduce((e,t)=>e+Number(t.quantity),0),n=e.reduce((e,t)=>e+Number(t.weight),0),r=e.reduce((e,t)=>e+Number(t.amount),0);return(0,k.jsxs)(s.Summary.Row,{children:[(0,k.jsx)(s.Summary.Cell,{index:0,colSpan:4,align:`center`,children:(0,k.jsx)(j,{strong:!0,children:`合计`})}),(0,k.jsx)(s.Summary.Cell,{index:4,align:`center`,children:(0,k.jsx)(j,{strong:!0,children:t})}),(0,k.jsx)(s.Summary.Cell,{index:5,align:`center`,children:(0,k.jsxs)(j,{strong:!0,children:[n.toFixed(3),`斤`]})}),(0,k.jsx)(s.Summary.Cell,{index:6,align:`center`,children:(0,k.jsxs)(j,{strong:!0,type:`danger`,children:[`¥`,r.toFixed(2)]})})]})},q=[{title:`订单号`,dataIndex:`order_no`,align:`center`,render:e=>(0,k.jsx)(j,{copyable:{text:e},children:e})},{title:`订货日期`,dataIndex:`order_date`,align:`center`},{title:`订货数量`,dataIndex:`total_quantity`,align:`center`},{title:`总重量`,dataIndex:`total_weight`,align:`center`,render:e=>`${e}斤`},{title:`订单金额`,dataIndex:`total_amount`,align:`center`,render:e=>(0,k.jsxs)(j,{strong:!0,children:[`¥`,e]})},{title:`状态`,dataIndex:`status`,align:`center`,render:e=>{let t=S[Number(e??0)];return(0,k.jsx)(g,{color:t?.color,children:t?.text})}}],J=[{title:`账单号`,dataIndex:`bill_no`,valueType:`text`,hideInForm:!0,width:210,render:(e,t)=>(0,k.jsx)(j,{copyable:{text:t.bill_no},children:t.bill_no})},{title:`门店`,dataIndex:`store_id`,valueType:`select`,hideInForm:!0,fieldProps:{options:t.map(e=>({label:e.name,value:e.id})),showSearch:!0,optionFilterProp:`label`},render:(e,t)=>t.store?.name??`门店#${t.store_id}`},{title:`采购单号`,dataIndex:`purchase_no`,valueType:`text`,hideInForm:!0,render:(e,t)=>t.purchase?.purchase_no??`-`},{title:`账单日期`,dataIndex:`bill_date`,valueType:`dateRange`,hideInForm:!0,align:`center`,render:(e,t)=>t.bill_date},{title:`商品金额`,dataIndex:`product_amount`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>`¥${t.product_amount}`},{title:`配送费`,dataIndex:`delivery_fee`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>`¥${t.delivery_fee}`},{title:`附加金额`,dataIndex:`added_amount`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>(0,k.jsxs)(`span`,{title:`周转筐 ${t.box_num} 个 / 周转托盘 ${t.tray_num} 个`,children:[`¥`,t.added_amount]})},{title:`售后金额`,dataIndex:`after_sale`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>(0,k.jsxs)(j,{type:Number(t.after_sale??0)<0?`success`:void 0,children:[`¥`,t.after_sale??`0.00`]})},{title:`账单总金额`,dataIndex:`total_amount`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>(0,k.jsxs)(j,{strong:!0,type:`danger`,children:[`¥`,t.total_amount]})},{title:`支付状态`,dataIndex:`status`,valueType:`select`,hideInForm:!0,align:`center`,fieldProps:{options:Object.entries(C).map(([e,t])=>({value:Number(e),label:t.text}))},render:(e,t)=>{let n=C[t.status??0];return(0,k.jsx)(g,{color:n?.color,children:n?.text})}},{title:`关联订单`,dataIndex:`orders_count`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>`${t.orders_count??0} 笔`},{title:`生成时间`,dataIndex:`created_at`,hideInForm:!0,hideInSearch:!0,align:`center`}];return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:`mb-5`,children:[(0,k.jsx)(A,{level:3,children:`门店账单`}),(0,k.jsx)(j,{type:`secondary`,children:`采购单完成后在「采购单」页生成,每个门店单独一张;账单总金额 = 商品金额 + 配送费 + 附加金额(周转筐/托盘)+ 售后金额(可正负); 每行可单独导出为一个 Excel(账单内明细按商品合并)。`})]}),(0,k.jsx)(v,{api:`/recon/bill`,columns:J,rowKey:`id`,accessName:`recon.bill`,tableRef:e,operateRender:e=>[(0,k.jsx)(c,{size:`small`,type:`primary`,icon:(0,k.jsx)(o,{}),onClick:()=>V(e.id)},`detail`),(0,k.jsx)(y,{auth:`recon.bill.export`,children:(0,k.jsx)(c,{size:`small`,color:`orange`,variant:`solid`,icon:(0,k.jsx)(_,{}),loading:z===e.id,onClick:()=>W(e)})},`export`),e.status===0?(0,k.jsx)(y,{auth:`recon.bill.pay`,children:(0,k.jsx)(c,{size:`small`,variant:`solid`,color:`green`,onClick:()=>H(e),children:`确认收款`})},`pay`):null],formProps:!1,actionBarRender:e=>[e.search,e.keywordSearch],toolBarRender:e=>[e.columnSetting,e.hideBorder,e.reload,e.columnHeight]}),(0,k.jsx)(a,{title:l?`账单 ${l.bill.bill_no}`:`账单详情`,open:r,onClose:()=>i(!1),size:1e3,loading:M,children:l?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(f,{column:3,size:`small`,bordered:!0,children:[(0,k.jsx)(f.Item,{label:`门店`,children:l.bill.store?.name??`门店#${l.bill.store_id}`}),(0,k.jsx)(f.Item,{label:`采购单号`,children:l.bill.purchase?.purchase_no??`-`}),(0,k.jsx)(f.Item,{label:`账单日期`,children:l.bill.bill_date}),(0,k.jsxs)(f.Item,{label:`商品金额`,children:[`¥`,l.bill.product_amount]}),(0,k.jsxs)(f.Item,{label:`配送费`,children:[`¥`,l.bill.delivery_fee]}),(0,k.jsxs)(f.Item,{label:`附加金额`,children:[`¥`,l.bill.added_amount,(0,k.jsxs)(j,{type:`secondary`,className:`ml-2!`,children:[`(筐 `,l.bill.box_num,`×¥`,l.bill.box_price,`,托盘 `,l.bill.tray_num,`×¥`,l.bill.tray_price,`)`]})]}),(0,k.jsxs)(f.Item,{label:`售后金额`,children:[(0,k.jsxs)(j,{type:Number(l.bill.after_sale??0)<0?`success`:void 0,children:[`¥`,l.bill.after_sale??`0.00`]}),(0,k.jsx)(j,{type:`secondary`,className:`ml-2!`,children:`(可正负,计入总金额)`})]}),(0,k.jsx)(f.Item,{label:`账单总金额`,children:(0,k.jsxs)(j,{strong:!0,type:`danger`,children:[`¥`,l.bill.total_amount]})}),(0,k.jsx)(f.Item,{label:`支付状态`,children:(0,k.jsx)(g,{color:C[l.bill.status??0]?.color,children:C[l.bill.status??0]?.text})}),(0,k.jsx)(f.Item,{label:`付款时间`,children:l.bill.paid_at??`-`}),(0,k.jsx)(f.Item,{label:`收款人`,children:l.bill.paid_operator?.nickname??`-`}),(0,k.jsx)(f.Item,{label:`生成人`,children:l.bill.operator?.nickname??`-`}),(0,k.jsx)(f.Item,{label:`生成时间`,children:l.bill.created_at}),l.bill.pay_remark?(0,k.jsx)(f.Item,{label:`付款备注`,span:3,children:l.bill.pay_remark}):null,l.bill.remark?(0,k.jsx)(f.Item,{label:`备注`,span:3,children:l.bill.remark}):null]}),(0,k.jsx)(A,{level:5,className:`mt-6! mb-3!`,children:`商品明细(按商品合并)`}),(0,k.jsx)(s,{rowKey:`product_id`,size:`small`,bordered:!0,columns:G,dataSource:l.items,pagination:!1,scroll:{x:`max-content`},summary:K}),(0,k.jsxs)(A,{level:5,className:`mt-6! mb-3!`,children:[`关联订单(`,l.orders.length,` 笔)`]}),(0,k.jsx)(s,{rowKey:`id`,size:`small`,bordered:!0,columns:q,dataSource:l.orders,pagination:!1,scroll:{x:`max-content`}})]}):null}),(0,k.jsxs)(d,{title:P?`确认收款 · ${P.bill_no}`:`确认收款`,open:P!==null,onCancel:()=>F(null),onOk:()=>R.submit(),confirmLoading:I,okText:`确认收款`,destroyOnHidden:!0,children:[(0,k.jsxs)(`div`,{className:`py-2 text-gray-500`,children:[`应收金额 `,(0,k.jsxs)(j,{strong:!0,type:`danger`,children:[`¥`,P?.total_amount??`0.00`]}),`(商品 ¥`,P?.product_amount??`0.00`,` + 配送费 ¥`,P?.delivery_fee??`0.00`,` + 附加 ¥`,P?.added_amount??`0.00`,` + 售后 ¥`,P?.after_sale??`0.00`,`); 线下收款完成后登记付款信息,账单支付状态将置为「已支付」。`]}),(0,k.jsxs)(p,{form:R,layout:`vertical`,onFinish:U,children:[(0,k.jsx)(p.Item,{label:`付款时间`,name:`paid_at`,rules:[{required:!0,message:`请选择付款时间`}],children:(0,k.jsx)(u,{className:`w-full`,showTime:!0,allowClear:!1})}),(0,k.jsx)(p.Item,{label:`付款备注`,name:`pay_remark`,rules:[{max:255}],children:(0,k.jsx)(m.TextArea,{rows:2,maxLength:255,placeholder:`如:现金/转账单号等线下收款信息(选填)`})})]})]})]})};export{M as default}; \ No newline at end of file diff --git a/public/assets/index-_7W4DmEA.js b/public/assets/index-B519TAEb.js similarity index 67% rename from public/assets/index-_7W4DmEA.js rename to public/assets/index-B519TAEb.js index 54bebb1..00a402c 100644 --- a/public/assets/index-_7W4DmEA.js +++ b/public/assets/index-B519TAEb.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/agent-BacKF2o-.js","assets/rolldown-runtime-BgaNhQyE.js","assets/jsx-runtime-CRBytmvs.js","assets/chunk-KS7C4IRE-Zm15rq6F.js","assets/typography-DRFhazK9.js","assets/tooltip-SaeG1Uv7.js","assets/style-BmYds38x.js","assets/CopyOutlined-pYq9KfGb.js","assets/es-DGcDZmXr.js","assets/CloseCircleFilled-C_pAsEWy.js","assets/space-Cu4QVMgQ.js","assets/button-BILozH6U.js","assets/ColorPresets-CG7aHuoG.js","assets/app-Bntg8WFU.js","assets/CheckCircleFilled-DcF3PzkE.js","assets/PlusOutlined-B8K2rG8r.js","assets/ExclamationCircleFilled-B0FwC6ZE.js","assets/context-D6bvp8kb.js","assets/useClosable-BLB2IUFV.js","assets/mergeProps-yLeqvqMM.js","assets/useModal-uyHD1DJx.js","assets/config-provider-CqLGIhNd.js","assets/empty-_1ZFK8yy.js","assets/avatar-DPxbCsa4.js","assets/useBreakpoint-DLqc4AYE.js","assets/popover-BGq_MyT2.js","assets/card-DU2T2-YW.js","assets/spin-CfJYIffX.js","assets/switch--LhkZymx.js","assets/tag-DBV1bHre.js","assets/theme-D5FZSALB.js","assets/useTranslation-DBl6NYjI.js","assets/agent-CCozney_.js","assets/request--UCyt0wo.js","assets/chat-CfnvY2VS.js","assets/global-DPRsdECQ.js","assets/middleware-Ctqt9WwX.js","assets/divider-BWjoWWHX.js","assets/dropdown-BgpiO8SY.js","assets/dropdown-Cg5iA4jt.js","assets/LeftOutlined-8zj_FQJP.js","assets/PurePanel-CRkmGKGB.js","assets/flex-BUqc4pUn.js","assets/input-CHcsaDtX.js","assets/SearchOutlined-C1nd7QQO.js","assets/Input-CJ-n8Xgl.js","assets/EyeOutlined-LSBUmW0e.js","assets/CaretDownFilled-DsboRsp5.js","assets/DeleteOutlined-DwOvobSM.js","assets/ArrowUpOutlined-C-Hx3V4D.js","assets/ClearOutlined-D3ecEqjC.js","assets/UserOutlined-D5Ziy0eL.js","assets/chat-Iht936bQ.css","assets/conversation-CgPPysYU.js","assets/lodash-DzOfPy0f.js","assets/DoubleRightOutlined-Blfli1UU.js","assets/DownOutlined-OYbvV7zr.js","assets/LockOutlined-B8eRH1x4.js","assets/modal-g8Q5gNCx.js","assets/ClockCircleOutlined-CNdnBEY0.js","assets/LinkOutlined-C-pRqXVc.js","assets/form-B3R3kIqp.js","assets/useForm-CAC6DWbf.js","assets/row-VfXXpsnR.js","assets/PictureOutlined-CB8Pr7jP.js","assets/WarningFilled-D9XuDTkJ.js","assets/CaretUpOutlined-ButGJLYH.js","assets/FileOutlined-DcVPckWl.js","assets/DownloadOutlined-DJY9Mu8c.js","assets/WeiboOutlined-Bp26feUj.js","assets/SmileOutlined-CxtYvF4K.js","assets/ArrowDownOutlined-hMgHFKfN.js","assets/FileDoneOutlined-Bp46bcBB.js","assets/CheckCircleOutlined-IJiAu4Hy.js","assets/CloseCircleOutlined-D2to6Tog.js","assets/EnvironmentOutlined-Be7mN2bK.js","assets/InfoCircleOutlined-ZdiYvwVM.js","assets/UploadOutlined-NadwXvrl.js","assets/PrinterOutlined-V8ipM95d.js","assets/QqOutlined-DnUKpfIS.js","assets/RiseOutlined-gXjyF9G9.js","assets/ShopOutlined-CwwKSpcq.js","assets/WalletOutlined-Bjy-chtO.js","assets/ShoppingOutlined-CsazpDg7.js","assets/TeamOutlined-DAHp-vuL.js","assets/table-BXi9q3AE.js","assets/radio-CxFl70_7.js","assets/useBubbleLock-BOXZxiMO.js","assets/checkbox-BSxplF7f.js","assets/pagination-aogAYU7q.js","assets/zh_CN-BT8mdvr9.js","assets/XinTable-DOLiJ5rL.js","assets/XinForm-BPDYdeax.js","assets/row-DfzKzMF0.js","assets/ImageUploader-C4yPpD75.js","assets/upload-oMV5VJeJ.js","assets/progress-BvFjoSli.js","assets/tslib.es6-5i5FW2KX.js","assets/XinForm-CeTR0shq.css","assets/AuthButton-DvrpreK4.js","assets/user-LBumqaa7.js","assets/banner-CJe0agU6.js","assets/image-CTRBNpBE.js","assets/nav-Dih5jXxX.js","assets/promo-CfsZu-jA.js","assets/special-DQ_cXCQl.js","assets/iProduct-l9WpLyUD.js","assets/goods-DPA1smJU.js","assets/download-DC9wDwqQ.js","assets/level-BCGrZbbc.js","assets/notice-DkzNYgG3.js","assets/store-JDnJsv44.js","assets/store-B-wG8BVA.js","assets/supplier-D0qvu-sA.js","assets/analysis-ChRcSk16.js","assets/statistic-G8YfPOC4.js","assets/iStoreOrder-CyyYoLoV.js","assets/monitor-Dd1gBWfo.js","assets/list-C8spiXAQ.js","assets/workplace-I8FwqFbs.js","assets/badge-__AeKia1.js","assets/icon-selector-Dy7uWjj7.js","assets/image-uploader-DBHOFZqO.js","assets/user-selector-C_7kHqFz.js","assets/xin-form-CjpDqXrA.js","assets/xin-table-Bw1qt43O.js","assets/403-kF5cJUEE.js","assets/result-D_u5wtF_.js","assets/404-CF76bH-T.js","assets/500-pw04psNL.js","assets/login-CKGg-k4h.js","assets/first-VYyrluR5.js","assets/breadcrumb-CSvdSHzR.js","assets/second-urN6pQJ9.js","assets/third-CmYUgLWR.js","assets/store-Wda1wq7X.js","assets/descriptions-BLF6MKiu.js","assets/popconfirm-DyseZgpU.js","assets/order-C6L8DsOz.js","assets/iPurchaseOrder-Dn-laOqY.js","assets/base-layout-o2EQVE3N.js","assets/descriptions-DSR6x1nO.js","assets/timeline-BB5N-LF8.js","assets/fix-header-DIZqZWCz.js","assets/category-BQA8kSpc.js","assets/category-MmrJkdbs.js","assets/goods-DDrxLa-h.js","assets/alert-DuXzwpQC.js","assets/supplier-BstAcwv7.js","assets/order-CzJfBGxK.js","assets/useAuth-AiNV0bRw.js","assets/bill-d4QJGLlp.js","assets/container-return-DT66R0pD.js","assets/payment-m5LFx4J0.js","assets/fail-BFEpQBfc.js","assets/info-DmaRTlzJ.js","assets/success-BtLkPs9S.js","assets/warning-D9M9NjTA.js","assets/ai-BaBcitlo.js","assets/config-tH2RSZ-J.js","assets/dept-wABp4Ul9.js","assets/dict-j8wfnfhh.js","assets/dict-CDRllPHM.js","assets/item-DyrMo47d.js","assets/file-BhqTJxRm.js","assets/info-CVHNTwj4.js","assets/mail-ChpDRzPT.js","assets/role-D-VBhILf.js","assets/relativeTime-jamE_cdZ.js","assets/rule-CqyTke2b.js","assets/storage-DhJApafx.js","assets/user-Bt-PQ9Uv.js","assets/profile-CGJ4n7jj.js","assets/useMobile-Bcq0nkW4.js"])))=>i.map(i=>d[i]); -import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Bn as t,Dr as n,Jn as r,Ln as i,Tr as a,Vn as o,Xn as s,t as c,zn as l}from"./jsx-runtime-CRBytmvs.js";import{a as u,c as d,i as f,n as p,o as m,r as h,t as g}from"./chunk-KS7C4IRE-Zm15rq6F.js";import{i as _,n as v,r as y,t as b}from"./global-DPRsdECQ.js";import{B as x,L as S,S as ee,V as C,_ as w,b as T,g as E,i as te,l as ne,n as D,t as re,x as ie}from"./lodash-DzOfPy0f.js";import{t as ae}from"./tooltip-SaeG1Uv7.js";import{t as oe}from"./config-provider-CqLGIhNd.js";import{t as se}from"./space-Cu4QVMgQ.js";import{t as O}from"./button-BILozH6U.js";import{t as ce}from"./app-Bntg8WFU.js";import{r as le}from"./DoubleRightOutlined-Blfli1UU.js";import{t as ue}from"./empty-_1ZFK8yy.js";import{t as de}from"./SearchOutlined-C1nd7QQO.js";import{t as fe}from"./avatar-DPxbCsa4.js";import{t as pe}from"./breadcrumb-CSvdSHzR.js";import{a as me,i as he,n as ge,o as _e,s as ve}from"./dropdown-Cg5iA4jt.js";import{n as ye}from"./LockOutlined-B8eRH1x4.js";import{n as be,t as xe}from"./row-DfzKzMF0.js";import{t as k}from"./divider-BWjoWWHX.js";import{t as Se}from"./modal-g8Q5gNCx.js";import{t as Ce}from"./dropdown-BgpiO8SY.js";import{t as we}from"./input-CHcsaDtX.js";import{n as Te}from"./CopyOutlined-pYq9KfGb.js";import{r as Ee}from"./PictureOutlined-CB8Pr7jP.js";import{t as De}from"./switch--LhkZymx.js";import{t as A}from"./theme-D5FZSALB.js";import{t as Oe}from"./ArrowDownOutlined-hMgHFKfN.js";import{t as ke}from"./ArrowUpOutlined-C-Hx3V4D.js";import{r as Ae}from"./InfoCircleOutlined-ZdiYvwVM.js";import{t as je}from"./UserOutlined-D5Ziy0eL.js";import{i as Me,t as j}from"./user-LBumqaa7.js";import{n as Ne,r as Pe,t as M}from"./useTranslation-DBl6NYjI.js";import{i as Fe,r as Ie,t as Le}from"./login-CKGg-k4h.js";import{t as N}from"./useMobile-Bcq0nkW4.js";import{t as Re}from"./dict-CDRllPHM.js";import{t as ze}from"./relativeTime-jamE_cdZ.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function Be(e,t,n){return typeof n==`boolean`?n:e.length?!0:r(t).some(e=>e.type===he)}var P=e(n()),F=({suffixCls:e,tagName:t,displayName:n})=>n=>P.forwardRef((r,i)=>P.createElement(n,{ref:i,suffixCls:e,tagName:t,...r})),I=P.forwardRef((e,t)=>{let{prefixCls:n,suffixCls:r,className:a,tagName:s,...c}=e,{getPrefixCls:l}=P.useContext(i),u=l(`layout`,n),[d,f]=_e(u),p=r?`${u}-${r}`:u;return P.createElement(s,{className:o(n||p,a,d,f),ref:t,...c})}),Ve=P.forwardRef((e,n)=>{let{direction:r}=P.useContext(i),[a,c]=P.useState([]),{prefixCls:u,className:d,rootClassName:f,children:p,hasSider:m,tagName:h,style:g,..._}=e,v=s(_,[`suffixCls`]),{getPrefixCls:y,className:b,style:x}=l(`layout`),S=y(`layout`,u),ee=Be(a,p,m),[C,w]=_e(S),T=o(S,{[`${S}-has-sider`]:ee,[`${S}-rtl`]:r===`rtl`},b,d,f,C,w),E=P.useMemo(()=>({siderHook:{addSider:e=>{c(n=>[].concat(t(n),[e]))},removeSider:e=>{c(t=>t.filter(t=>t!==e))}}}),[]);return P.createElement(ve.Provider,{value:E},P.createElement(h,{ref:n,className:T,style:{...x,...g},...v},p))}),He=F({tagName:`div`,displayName:`Layout`})(Ve),Ue=F({suffixCls:`header`,tagName:`header`,displayName:`Header`})(I),We=F({suffixCls:`footer`,tagName:`footer`,displayName:`Footer`})(I),Ge=F({suffixCls:`content`,tagName:`main`,displayName:`Content`})(I),L=He;L.Header=Ue,L.Footer=We,L.Content=Ge,L.Sider=he,L._InternalSiderContext=me;var Ke={type:`3rdParty`,init(e){Pe(e.options.react),Ne(e)}},qe=e(a(),1),R=c(),{useToken:Je}=A,Ye=()=>{let{token:e}=Je(),{t}=M(),n=m(),r=b(e=>e.themeDrawer),i=b(e=>e.setThemeDrawer),a=j(e=>e.userinfo),o=j(e=>e.logout),s=N(),[c,l]=(0,P.useState)(!1),[u,d]=(0,P.useState)(!1),f=()=>{let e=document.documentElement;document.fullscreenElement?document.exitFullscreen().then(()=>{l(!1)}):e.requestFullscreen().then(()=>{l(!0)})},p=[{key:`1`,label:t(`layout.profile`),icon:(0,R.jsx)(je,{}),onClick:()=>n(`/user/profile`)},{key:`2`,label:t(`layout.logout`),icon:(0,R.jsx)(te,{}),onClick:async()=>{o().then(()=>{Ee.success(t(`layout.logoutSuccess`)),window.location.href=`/login`}).catch(()=>{Ee.error(t(`layout.logoutFailed`))})}}];return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(Se,{closable:!1,open:u,footer:null,style:{top:40,width:600},styles:{body:{maxHeight:`80vh`},container:{padding:0}},onCancel:()=>d(!1),children:[(0,R.jsxs)(`div`,{className:`p-5`,children:[(0,R.jsx)(we,{size:`large`,placeholder:t(`layout.searchPlaceholder`),prefix:(0,R.jsx)(de,{})}),(0,R.jsx)(`div`,{className:`mt-5`,children:(0,R.jsx)(ue,{})})]}),(0,R.jsxs)(se,{className:`mt-5 flex align-center pl-5 pr-5 pt-2.5 pb-2.5`,style:{borderTop:`1px solid `+e.colorBorder},children:[(0,R.jsx)(Te,{}),` `,(0,R.jsx)(`span`,{className:`mr-4`,children:t(`layout.searchConfirm`)}),(0,R.jsx)(ke,{}),(0,R.jsx)(Oe,{}),` `,(0,R.jsx)(`span`,{className:`mr-4`,children:t(`layout.searchSwitch`)}),`Esc `,(0,R.jsx)(`span`,{className:`mr-2`,children:t(`layout.searchClose`)})]})]}),(0,R.jsxs)(se,{children:[!s&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(O,{icon:(0,R.jsx)(T,{}),size:`large`,type:`text`,onClick:()=>window.open(`https://xin-admin.com`)}),(0,R.jsx)(O,{icon:(0,R.jsx)(Ae,{}),size:`large`,type:`text`,onClick:()=>window.open(`https://github.com/xin-admin/xin-admin-ui`)}),(0,R.jsx)(O,{icon:(0,R.jsx)(de,{}),size:`large`,type:`text`,onClick:()=>d(!0)}),(0,R.jsx)(O,{onClick:f,icon:c?(0,R.jsx)(ee,{}):(0,R.jsx)(ie,{}),size:`large`,type:`text`}),(0,R.jsx)(Ie,{size:`large`,type:`text`}),(0,R.jsx)(O,{onClick:()=>i(!r),icon:(0,R.jsx)(ne,{}),size:`large`,type:`text`})]}),a?(0,R.jsx)(Ce,{menu:{items:p},children:(0,R.jsxs)(O,{size:`large`,type:`text`,children:[(0,R.jsx)(`div`,{children:a.nickname||a.username}),(0,R.jsx)(fe,{src:a.avatar_url?a.avatar_url:null,size:`small`})]})}):null]})]})};function Xe(e){let t={},n=(e,r=[])=>{if(!e.key)return;let i={href:e.path,title:e.name,icon:e.icon,local:e.local},a=[...r,i];t[e.key]=a,e.children&&e.children.length&&e.children.forEach(e=>n(e,a))};return e.forEach(e=>n(e)),t}function z(e,t){for(let n of e){if(n.path===t)return n;if(n.children&&n.children.length>0){let e=z(n.children,t);if(e)return e}}return null}function Ze(e,t,n=[]){for(let r of e){if(!r.key)continue;let e=[...n,r.key];if(r.path===t)return e;if(r.children&&r.children.length>0){let n=Ze(r.children,t,e);if(n)return n}}return null}function Qe(e,t){for(let n of e){if(n.key===t)return n;if(n.children&&n.children.length>0){let e=Qe(n.children,t);if(e)return e}}return null}var $e=(0,P.createContext)(null),et=({children:e})=>{let t=u(),[n,r]=(0,P.useState)([]),[i,a]=(0,P.useState)(),[o,s]=(0,P.useState)([]),[c,l]=(0,P.useState)(!1);return(0,P.useEffect)(()=>{Me().then(({data:e})=>{let t=e.data.menus;r(t)})},[]),(0,P.useEffect)(()=>{let e=t.pathname,r=Ze(n,e);r&&r.length&&(s(r),a(r[0]))},[n]),(0,R.jsx)($e.Provider,{value:{menus:n,parentKey:i,selectKey:o,collapsed:c,setParentKey:a,setCollapsed:l,setSelectKey:s},children:e})},B=()=>{let e=(0,P.useContext)($e);if(!e)throw Error(`useLayoutContext must be used within LayoutProvider`);return e},V=(e,t)=>e.reduce((e,n)=>{if(![`route`,`menu`].includes(n.type)||!n.hidden)return e;let r={label:n.local?t(n.local):n.name,icon:n.icon?(0,R.jsx)(D,{name:n.icon}):void 0,key:n.key};return n.type===`menu`&&n.children?.length&&(r.children=V(n.children,t)),e.push(r),e},[]),H=()=>{let{t:e}=M(),t=N(),n=m(),[r,i]=(0,P.useState)([]),a=b(e=>e.layout),{menus:o,parentKey:s,selectKey:c,setSelectKey:l,setParentKey:u}=B();(0,P.useEffect)(()=>{if(t){i(V(o,e));return}if([`columns`,`mix`].includes(a)&&s){let t=o.find(e=>e.key===s);i(V(t?.children||[],e))}else i(V(o,e))},[o,a,s,e,t]);let d=e=>{l(e),[`top`,`side`].includes(a)&&u(e[e.length-1]);let t=Qe(o,e[0]);if(!(!t||!t.key)){if(t.type===`route`&&t.link){window.open(t.path,`_blank`);return}if(t.type===`route`&&t.path){n(t.path);return}}};return(0,R.jsx)(R.Fragment,{children:r.length>0&&(0,R.jsx)(ge,{className:`border-b-0 flex-1`,mode:a===`top`&&!t?`horizontal`:`inline`,items:r,onSelect:e=>d(e.keyPath),selectedKeys:c})})},tt=[{title:(0,R.jsx)(T,{})}],nt=()=>{let{t:e}=M(),t=u(),{menus:n}=B(),[r,i]=(0,P.useState)(tt),a=(0,P.useMemo)(()=>Xe(n),[n]);return(0,P.useEffect)(()=>{let r=t.pathname,o=z(n,r);if(o&&o.key){let t=a[o.key];if(t){i([{title:(0,R.jsx)(T,{})},...t.map(t=>({title:(0,R.jsxs)(R.Fragment,{children:[t.icon&&(0,R.jsx)(D,{name:t.icon}),(0,R.jsx)(`span`,{children:t.local?e(t.local):t.title})]})}))]);return}}i(tt)},[e,t.pathname,a]),(0,R.jsx)(pe,{items:r})},{Header:rt}=L,it=()=>{let{t:e}=M(),t=N(),n=m(),r=b(e=>e.logo),i=b(e=>e.title),a=b(e=>e.layout),o=b(e=>e.themeConfig),{menus:s,parentKey:c,collapsed:l,setCollapsed:u,setParentKey:d,setSelectKey:f}=B(),p={token:{colorTextBase:o.headerColor},components:{Menu:{activeBarBorderWidth:0,itemBg:`transparent`}}},[h,g]=(0,P.useState)([]);(0,P.useEffect)(()=>{g(s.filter(e=>e.hidden).map(t=>({label:t.local?e(t.local):t.name,icon:t.icon?(0,R.jsx)(D,{name:t.icon}):!1,key:t.key})))},[s,e]);let _=e=>{let t=Qe(s,e);if(!(!t||!t.key)&&(d(t.key),t.type!==`menu`)){if(f([t.key]),t.type===`route`&&t.link){window.open(t.path,`_blank`);return}if(t.type===`route`&&t.path){n(t.path);return}}};return(0,R.jsx)(oe,{theme:p,children:t?(0,R.jsxs)(rt,{className:`flex sticky z-1 top-0 backdrop-blur-xs justify-between items-center`,children:[(0,R.jsxs)(`div`,{className:`flex items-center`,children:[(0,R.jsx)(`img`,{className:`w-9 mr-5`,src:r,alt:`logo`}),(0,R.jsx)(`span`,{className:`font-semibold text-[20px] mr-2`,children:i})]}),(0,R.jsx)(Ye,{})]}):(0,R.jsxs)(rt,{className:`flex sticky z-1 top-0 backdrop-blur-xs`,style:{borderBottom:`1px solid `+o.colorBorder},children:[(0,R.jsxs)(`div`,{className:`flex items-center relative`,children:[(0,R.jsx)(`img`,{className:`h-8`,src:r,alt:`logo`}),(0,R.jsx)(`span`,{className:`font-semibold text-[20px] ml-5 mr-5`,children:i}),a!==`top`&&(0,R.jsx)(O,{type:`text`,className:`text-[16px] mr-2.5`,onClick:()=>u(!l),children:l?(0,R.jsx)(E,{}):(0,R.jsx)(w,{})}),[`columns`,`side`].includes(a)&&(0,R.jsx)(nt,{})]}),(0,R.jsxs)(`div`,{className:`overflow-hidden flex-1`,children:[a==`top`&&(0,R.jsx)(H,{}),a==`mix`&&(0,R.jsx)(ge,{className:`border-b-0 w-full`,mode:`horizontal`,items:h,onSelect:e=>_(e.key),selectedKeys:[c]})]}),(0,R.jsx)(Ye,{})]})})},{Footer:at}=L,ot=()=>{let e=new Date().getFullYear(),t=b(e=>e.themeConfig);return(0,R.jsxs)(R.Fragment,{children:[t.fixedFooter&&(0,R.jsx)(`div`,{className:`h-10`}),(0,R.jsx)(at,{className:(t.fixedFooter?`sticky`:`relative`)+` z-10 w-full bottom-0 pt-2.5 pb-2.5`,style:{borderTop:`1px solid `+t.colorBorder},children:(0,R.jsxs)(`div`,{className:`flex items-center justify-center w-full`,children:[`Xin Admin ©`,e,` Created by xiaoliu`]})})]})},st=()=>{let e=b(e=>e.themeConfig),t=b(e=>e.themeDrawer),n=b(e=>e.setThemeDrawer),[r,i]=(0,P.useState)(!1);return(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`fixed bottom-8 left-8 z-999`,children:(0,R.jsx)(O,{type:`primary`,shape:`circle`,size:`large`,icon:r?(0,R.jsx)(w,{}):(0,R.jsx)(E,{}),onClick:()=>i(!r)})}),(0,R.jsx)(S,{placement:`left`,closable:!0,onClose:()=>i(!1),open:r,styles:{section:{width:280},header:{borderBottom:`1px solid `+e.colorBorder,background:e.siderBg,color:e.siderColor},body:{padding:0,background:e.siderBg}},footer:(0,R.jsxs)(se,{children:[(0,R.jsx)(O,{icon:(0,R.jsx)(T,{}),size:`large`,type:`text`,onClick:()=>window.open(`https://xin-admin.com`)}),(0,R.jsx)(O,{icon:(0,R.jsx)(Ae,{}),size:`large`,type:`text`,onClick:()=>window.open(`https://github.com/xin-admin/xin-admin-ui`)}),(0,R.jsx)(Ie,{size:`large`,type:`text`}),(0,R.jsx)(O,{onClick:()=>n(!t),icon:(0,R.jsx)(ne,{}),size:`large`,type:`text`})]}),children:(0,R.jsx)(`div`,{style:{height:`100%`,overflowY:`auto`,width:`100%`,background:e.siderBg},children:(0,R.jsx)(H,{})})})]})},ct=re(),lt={defaultAlgorithm:A.defaultAlgorithm,darkAlgorithm:A.darkAlgorithm,defaultCompactAlgorithm:[A.defaultAlgorithm,A.compactAlgorithm],darkCompactAlgorithm:[A.darkAlgorithm,A.compactAlgorithm]},ut=[{label:`layout.algorithmDefault`,value:`defaultAlgorithm`},{label:`layout.algorithmDark`,value:`darkAlgorithm`},{label:`layout.algorithmDefaultCompact`,value:`defaultCompactAlgorithm`},{label:`layout.algorithmDarkCompact`,value:`darkCompactAlgorithm`}],{useToken:dt}=A,ft=[{key:`colorPrimary`,label:`layout.colorPrimary`},{key:`colorText`,label:`layout.colorText`},{key:`colorBg`,label:`layout.colorBg`},{key:`colorSuccess`,label:`layout.colorSuccess`},{key:`colorWarning`,label:`layout.colorWarning`},{key:`colorError`,label:`layout.colorError`},{key:`bodyBg`,label:`layout.bodyBg`},{key:`footerBg`,label:`layout.footerBg`},{key:`headerBg`,label:`layout.headerBg`},{key:`headerColor`,label:`layout.headerColor`},{key:`siderBg`,label:`layout.siderBg`},{key:`siderColor`,label:`layout.siderColor`},{key:`colorBorder`,label:`layout.colorBorder`}],pt=[{key:`fixedFooter`,label:`layout.fixedFooter`,type:`switch`},{key:`borderRadius`,label:`layout.borderRadius`,type:`number`,min:0,max:30},{key:`controlHeight`,label:`layout.controlHeight`,type:`number`,min:0},{key:`headerPadding`,label:`layout.headerPadding`,type:`number`,min:0},{key:`headerHeight`,label:`layout.headerHeight`,type:`number`,min:0},{key:`siderWeight`,label:`layout.siderWeight`,type:`number`,min:0},{key:`bodyPadding`,label:`layout.bodyPadding`,type:`number`,min:0}],mt=[{background:`/static/theme/default.svg`,name:`light`,title:`layout.themeLight`},{background:`/static/theme/dark.svg`,name:`dark`,title:`layout.themeDark`}],ht=[{key:`side`,title:`layout.layoutSide`,render:e=>(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`rounded-sm w-full h-6 mb-1.5`,style:{background:e.colorPrimaryBorder}}),(0,R.jsxs)(`div`,{className:`flex`,children:[(0,R.jsx)(`div`,{className:`rounded-sm h-16 w-6`,style:{background:e.colorPrimary}}),(0,R.jsx)(`div`,{className:`rounded-sm flex-1 ml-1.5`,style:{background:e.colorPrimaryBg}})]})]})},{key:`top`,title:`layout.layoutTop`,render:e=>(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`rounded-sm h-6 w-full mb-1.5`,style:{background:e.colorPrimary}}),(0,R.jsx)(`div`,{className:`rounded-sm h-16`,style:{background:e.colorPrimaryBg}})]})},{key:`mix`,title:`layout.layoutMix`,render:e=>(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`rounded-sm w-full h-6 mb-1.5`,style:{background:e.colorPrimary}}),(0,R.jsxs)(`div`,{className:`flex`,children:[(0,R.jsx)(`div`,{className:`rounded-sm h-16 w-6`,style:{background:e.colorPrimary}}),(0,R.jsx)(`div`,{className:`rounded-sm flex-1 ml-1.5`,style:{background:e.colorPrimaryBg}})]})]})},{key:`columns`,title:`layout.layoutColumns`,render:e=>(0,R.jsxs)(`div`,{className:`flex`,children:[(0,R.jsx)(`div`,{className:`rounded-sm mr-1.5 w-3 h-24`,style:{background:e.colorPrimary}}),(0,R.jsx)(`div`,{className:`rounded-sm mr-1.5 w-6 h-24`,style:{background:e.colorPrimaryHover}}),(0,R.jsx)(`div`,{className:`rounded-sm flex-auto h-24`,style:{background:e.colorPrimaryBg}})]})}],gt=()=>{let{t:e}=M(),{token:t}=dt(),n=b(e=>e.themeDrawer),r=b(e=>e.setThemeDrawer),i=b(e=>e.setThemeConfig),a=b(e=>e.themeConfig),o=b(e=>e.layout),s=b(e=>e.setLayout),c=ut?.map(t=>({...t,label:e(t.label)}))||[],l=(0,ct.debounce)((e,t)=>{i({...a,[e]:t})},400,{leading:!0,trailing:!1});return(0,R.jsxs)(S,{styles:{body:{paddingTop:10}},placement:`right`,closable:!1,onClose:()=>r(!1),open:n,footer:(0,R.jsx)(`div`,{className:`flex w-full justify-between`,children:(0,R.jsx)(O,{onClick:()=>{i({...v,..._})},children:e(`layout.resetTheme`)})}),children:[(0,R.jsx)(k,{children:e(`layout.layoutStyle`)}),(0,R.jsx)(xe,{gutter:[20,20],children:ht.map(({key:n,title:r,render:i})=>(0,R.jsx)(be,{span:12,children:(0,R.jsx)(ae,{title:e(r),children:(0,R.jsx)(`div`,{className:`p-2 rounded-lg cursor-pointer`,style:{boxShadow:t.boxShadow,borderRadius:t.borderRadius,border:o===n?`2px solid ${t.colorPrimary}`:`2px solid transparent`},onClick:()=>s(n),children:i(t)})})},n))}),(0,R.jsx)(k,{children:e(`layout.presetTheme`)}),(0,R.jsxs)(xe,{gutter:20,onClick:e=>{let t=e.target.closest(`[data-theme]`);if(!t)return;let n=t.dataset.theme,r={dark:y,light:_};r[n]&&i({...a,...r[n]})},children:[mt.map(n=>(0,R.jsxs)(be,{span:8,className:`mb-2.5`,children:[(0,R.jsx)(`div`,{"data-theme":n.name,className:`cursor-pointer overflow-hidden border-solid`,style:{borderRadius:t.borderRadius,borderWidth:a.themeScheme===n.name?`2px`:`0px`,borderColor:a.themeScheme===n.name?t.colorPrimary:`transparent`},children:(0,R.jsx)(`img`,{src:n.background,alt:n.name})}),(0,R.jsx)(`div`,{className:`text-center mt-1.5`,children:e(n.title)})]},n.name)),(0,R.jsx)(be,{span:24,className:`mb-2.5`,children:(0,R.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,R.jsx)(`div`,{children:e(`layout.themeAlgorithm`)}),(0,R.jsx)(le,{value:a.algorithm,style:{width:160},onChange:e=>l(`algorithm`,e),options:c})]})})]}),(0,R.jsx)(k,{children:e(`layout.themeColor`)}),ft.map(({key:t,label:n})=>(0,R.jsxs)(`div`,{className:`flex justify-between items-center mb-2.5`,children:[(0,R.jsx)(`div`,{children:e(n)}),(0,R.jsx)(x,{showText:!0,value:a[t],onChange:e=>l(t,e.toCssString())})]},t)),(0,R.jsx)(k,{children:e(`layout.styleConfig`)}),pt.map(({key:t,label:n,type:r,...i})=>(0,R.jsxs)(`div`,{className:`flex justify-between items-center mb-2.5`,children:[(0,R.jsx)(`div`,{children:e(n)}),r===`switch`?(0,R.jsx)(De,{value:a[t],onChange:e=>l(t,e)}):(0,R.jsx)(C,{value:a[t],onChange:e=>l(t,e),...i})]},t))]})},_t=()=>{let{t:e}=M(),t=u(),n=b(e=>e.title),{menus:r}=B();return(0,P.useEffect)(()=>{let i=n||`Xin Admin`,a=z(r,t.pathname);if(!a){document.title=i;return}let o=a.local?e(a.local):a.name;o?document.title=o+` - `+i:document.title=i},[t.pathname,n,e,r]),null},{useToken:vt}=A,yt=()=>{let{t:e}=M(),{token:t}=vt(),n=m(),{menus:r,parentKey:i,collapsed:a,setParentKey:o,setSelectKey:s}=B(),c=b(e=>e.themeConfig),l=e=>{if(e.key&&(o(e.key),e.type!==`menu`)){if(s([e.key]),e.type===`route`&&e.link){window.open(e.path,`_blank`);return}if(e.type===`route`&&e.path){n(e.path);return}}};return(0,R.jsxs)(`div`,{className:`flex h-full`,children:[(0,R.jsx)(`div`,{className:`box-border shrink-0 h-full overflow-auto`,style:{borderRight:a?`none`:`1px solid `+c.colorBorder,width:79},children:r.filter(e=>e.hidden).map(n=>(0,R.jsxs)(`div`,{style:{backgroundColor:i===n.key?t.colorPrimaryBg:`transparent`,color:i===n.key?t.colorPrimary:c.siderColor},className:`flex items-center justify-center flex-col p-2 mb-2 pt-3 pb-3 cursor-pointer`,onClick:()=>l(n),children:[(0,R.jsx)(D,{name:n.icon,style:{fontSize:18}}),(0,R.jsx)(`span`,{className:`mt-1 truncate w-full text-center`,children:n.local?e(n.local):n.name})]},n.key))}),!a&&(0,R.jsx)(`div`,{className:`flex-1 h-full overflow-y-auto`,children:(0,R.jsx)(H,{})})]})},{Content:bt,Sider:xt}=L,St=()=>{let e=N(),t=b(e=>e.themeConfig),n=b(e=>e.layout),[r,i]=(0,P.useState)(226),{menus:a,collapsed:o,parentKey:s}=B();return(0,P.useEffect)(()=>{let e=t.siderWeight?t.siderWeight:226,r=n===`columns`?79:0,o=a.find(e=>e.key===s);[`mix`,`columns`].includes(n)?o?.children&&o?.children.length?i(r+e):i(r):i(e)},[t,n,a,s]),(0,R.jsxs)(L,{className:`min-h-screen`,style:{background:t.background},children:[(0,R.jsx)(_t,{}),(0,R.jsx)(gt,{}),(0,R.jsx)(it,{}),e&&(0,R.jsx)(st,{}),(0,R.jsxs)(L,{hasSider:!0,className:`relative`,children:[n!==`top`&&!e&&(0,R.jsx)(xt,{collapsed:o,width:r,style:{borderRight:`1px solid `+t.colorBorder,height:`calc(100vh - ${t.headerHeight}px)`,top:t.headerHeight,overflowY:`auto`,overflowX:`hidden`,position:`sticky`},children:n===`columns`?(0,R.jsx)(yt,{}):(0,R.jsx)(H,{})}),(0,R.jsxs)(L,{className:`min-w-0`,children:[(0,R.jsx)(bt,{style:{padding:t.bodyPadding},children:(0,R.jsx)(p,{})}),(0,R.jsx)(ot,{})]})]})]})},Ct=()=>(0,R.jsx)(et,{children:(0,R.jsx)(St,{})}),wt=Object.assign({"/web/pages/ai/agent/index.tsx":()=>d(()=>import(`./agent-BacKF2o-.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33])),"/web/pages/ai/chat/index.tsx":()=>d(()=>import(`./chat-CfnvY2VS.js`),__vite__mapDeps([34,1,2,3,35,36,33,4,5,6,7,8,9,21,10,15,11,12,13,14,16,17,18,19,20,23,24,25,26,37,38,39,40,41,42,43,44,45,46,47,30,48,49,50,51,31,32,52])),"/web/pages/ai/conversation/index.tsx":()=>d(()=>import(`./conversation-CgPPysYU.js`),__vite__mapDeps([53,1,2,33,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,29,31,91,92,26,93,28,30,94,95,96,97,98,42,99,100,36])),"/web/pages/client/banner.tsx":()=>d(()=>import(`./banner-CJe0agU6.js`),__vite__mapDeps([101,1,2,4,5,6,7,8,9,102,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,29,91,85,86,87,27,88,38,89,90,92,33,26,93,28,30,31,94,95,96,97,98,42,99,100,36])),"/web/pages/client/nav.tsx":()=>d(()=>import(`./nav-Dih5jXxX.js`),__vite__mapDeps([103,1,2,4,5,6,7,8,9,102,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,29,91,85,86,87,27,88,38,89,90,92,33,26,93,28,30,31,94,95,96,97,98,42,99,100,36])),"/web/pages/client/promo.tsx":()=>d(()=>import(`./promo-CfsZu-jA.js`),__vite__mapDeps([104,1,2,4,5,6,7,8,9,102,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,29,91,85,86,87,27,88,38,89,90,92,33,26,93,28,30,31,94,95,96,97,98,42,99,100,36])),"/web/pages/client/special.tsx":()=>d(()=>import(`./special-DQ_cXCQl.js`),__vite__mapDeps([105,1,2,33,4,5,6,7,8,9,15,11,12,55,40,41,21,10,22,56,44,58,20,14,16,17,18,19,61,62,24,63,102,54,25,39,57,37,45,59,60,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,29,91,85,86,87,27,88,38,89,90,92,26,93,28,30,31,94,95,96,97,98,42,99,100,36,106,107,108])),"/web/pages/customer/level.tsx":()=>d(()=>import(`./level-BCGrZbbc.js`),__vite__mapDeps([109,1,2,4,5,6,7,8,9,102,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,29,91,85,86,87,27,88,38,89,90,92,33,26,93,28,30,31,94,95,96,97,98,42,99,100,36])),"/web/pages/customer/notice.tsx":()=>d(()=>import(`./notice-DkzNYgG3.js`),__vite__mapDeps([110,1,2,4,5,6,7,8,9,29,18,19,15,12,91,54,21,10,14,16,17,24,20,11,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,92,33,26,93,28,30,31,94,95,96,97,98,42,99,100,36,111])),"/web/pages/customer/store.tsx":()=>d(()=>import(`./store-B-wG8BVA.js`),__vite__mapDeps([112,1,2,33,4,5,6,7,8,9,29,18,19,15,12,91,54,21,10,14,16,17,24,20,11,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,92,26,93,28,30,31,94,95,96,97,98,42,99,100,36])),"/web/pages/customer/supplier.tsx":()=>d(()=>import(`./supplier-D0qvu-sA.js`),__vite__mapDeps([113,1,2,4,5,6,7,8,9,29,18,19,15,12,91,54,21,10,14,16,17,24,20,11,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,92,33,26,93,28,30,31,94,95,96,97,98,42,99,100,36])),"/web/pages/dashboard/analysis.tsx":()=>d(()=>import(`./analysis-ChRcSk16.js`),__vite__mapDeps([114,1,2,33,85,19,5,21,10,24,12,11,55,9,15,6,40,41,22,56,44,39,86,62,87,27,88,45,8,38,89,90,66,67,47,26,93,63,37,115,29,18,30,71,49,81,82,31,97,116])),"/web/pages/dashboard/monitor.tsx":()=>d(()=>import(`./monitor-Dd1gBWfo.js`),__vite__mapDeps([117,2,1,10,5,23,24,25,26,15,93,63,37,118,19,55,9,6,40,41,21,22,56,44,27,89,90,30,71,49,31])),"/web/pages/dashboard/workplace.tsx":()=>d(()=>import(`./workplace-I8FwqFbs.js`),__vite__mapDeps([119,2,1,4,5,6,7,8,9,10,22,23,24,25,120,26,15,37,59,60,118,19,55,40,41,21,56,44,27,63,89,90,29,18,12,70,75,81,84,100,36,33,31])),"/web/pages/example/icon-selector.tsx":()=>d(()=>import(`./icon-selector-Dy7uWjj7.js`),__vite__mapDeps([121,1,2,4,5,6,7,8,9,10,92,33,54,21,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,26,93,28,29,30,31,94,95,96,97,98])),"/web/pages/example/image-uploader.tsx":()=>d(()=>import(`./image-uploader-DBHOFZqO.js`),__vite__mapDeps([122,1,2,4,5,6,7,8,9,10,11,12,26,15,61,14,16,62,24,63,94,33,58,20,21,17,18,19,41,64,95,46,96,67,48,68,31,97])),"/web/pages/example/user-selector.tsx":()=>d(()=>import(`./user-selector-C_7kHqFz.js`),__vite__mapDeps([123,1,2,4,5,6,7,8,9,10,92,33,54,21,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,26,93,28,29,30,31,94,95,96,97,98])),"/web/pages/example/xin-form.tsx":()=>d(()=>import(`./xin-form-CjpDqXrA.js`),__vite__mapDeps([124,1,2,4,5,6,7,8,9,10,11,12,92,33,54,21,14,15,16,17,18,19,24,20,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,26,93,28,29,30,31,94,95,96,97,98])),"/web/pages/example/xin-table.tsx":()=>d(()=>import(`./xin-table-Bw1qt43O.js`),__vite__mapDeps([125,2,1,11,12,29,5,18,19,15,72,91,54,21,10,14,9,16,17,6,24,20,40,41,55,22,56,44,25,39,57,37,45,8,58,59,60,61,62,63,43,46,7,64,65,66,67,47,48,68,69,70,71,49,50,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,92,33,26,93,28,30,31,94,95,96,97,98,42,99,100,36])),"/web/pages/exception/403.tsx":()=>d(()=>import(`./403-kF5cJUEE.js`),__vite__mapDeps([126,1,2,11,12,26,15,127,14,9,16,65])),"/web/pages/exception/404.tsx":()=>d(()=>import(`./404-CF76bH-T.js`),__vite__mapDeps([128,1,2,11,12,26,15,127,14,9,16,65])),"/web/pages/exception/500.tsx":()=>d(()=>import(`./500-pw04psNL.js`),__vite__mapDeps([129,1,2,11,12,26,15,127,14,9,16,65])),"/web/pages/login/index.tsx":()=>d(()=>import(`./login-CKGg-k4h.js`).then(e=>e.n),__vite__mapDeps([130,1,2,3,35,36,33,4,5,6,7,8,9,10,11,12,57,88,87,93,63,24,37,38,39,40,41,21,61,14,16,62,43,44,45,46,90,69,79,51,100,31])),"/web/pages/multi-menu/first.tsx":()=>d(()=>import(`./first-VYyrluR5.js`),__vite__mapDeps([131,2,1,10,5,11,12,132,56,39,40,41,21,26,15,93,63,24])),"/web/pages/multi-menu/second.tsx":()=>d(()=>import(`./second-urN6pQJ9.js`),__vite__mapDeps([133,2,1,10,5,11,12,132,56,39,40,41,21,26,15,93,63,24])),"/web/pages/multi-menu/third.tsx":()=>d(()=>import(`./third-CmYUgLWR.js`),__vite__mapDeps([134,2,1,10,5,11,12,132,56,39,40,41,21,26,15,93,63,24])),"/web/pages/order/store.tsx":()=>d(()=>import(`./store-Wda1wq7X.js`),__vite__mapDeps([135,1,2,33,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,92,85,86,87,27,88,38,89,90,26,93,28,29,30,31,94,95,96,97,98,136,102,137,91,42,99,100,36,111,116,138,108,139])),"/web/pages/page-layout/base-layout.tsx":()=>d(()=>import(`./base-layout-o2EQVE3N.js`),__vite__mapDeps([140,2,1,4,5,6,7,8,9,10,11,12,23,24,25,26,15,93,63,136,38,39,40,41,21,42,96,14,115,29,18,19,80,83,84,51])),"/web/pages/page-layout/descriptions.tsx":()=>d(()=>import(`./descriptions-DSR6x1nO.js`),__vite__mapDeps([141,2,1,4,5,6,7,8,9,85,19,21,10,24,12,11,55,15,40,41,22,56,44,39,86,62,87,27,88,45,38,89,90,66,67,47,23,25,26,93,63,37,59,136,42,142,29,18,68,73,78,83,51])),"/web/pages/page-layout/fix-header.tsx":()=>d(()=>import(`./fix-header-DIZqZWCz.js`),__vite__mapDeps([143,1,2,4,5,6,7,8,9,10,11,12,23,24,25,120,26,15,93,63,37,59,136,42,61,14,16,62,43,44,45,46,142,29,18,19,72,73,74,78])),"/web/pages/product/category.tsx":()=>d(()=>import(`./category-BQA8kSpc.js`),__vite__mapDeps([144,1,2,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,92,33,85,86,87,27,88,38,89,90,26,93,28,29,30,31,94,95,96,97,98,91,42,99,100,36,145])),"/web/pages/product/goods.tsx":()=>d(()=>import(`./goods-DDrxLa-h.js`),__vite__mapDeps([146,1,2,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,147,85,86,87,27,88,38,89,90,92,33,26,93,28,29,30,31,94,95,96,97,98,102,91,42,99,100,36,106,107,108,145,148])),"/web/pages/purchase/order.tsx":()=>d(()=>import(`./order-CzJfBGxK.js`),__vite__mapDeps([149,1,2,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,92,33,26,93,28,29,30,31,94,95,96,97,98,136,137,91,42,99,100,36,107,108,138,139,148,150])),"/web/pages/recon/bill.tsx":()=>d(()=>import(`./bill-d4QJGLlp.js`),__vite__mapDeps([151,1,2,33,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,92,26,93,28,29,30,31,94,95,96,97,98,136,91,42,99,100,36,108,111,116,139,145])),"/web/pages/recon/container-return.tsx":()=>d(()=>import(`./container-return-DT66R0pD.js`),__vite__mapDeps([152,1,2,4,5,6,7,8,9,11,12,55,15,40,41,21,10,22,56,44,57,92,33,54,14,16,17,18,19,24,20,25,39,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,26,93,28,29,30,31,94,95,96,97,98,91,42,99,100,36,108,111])),"/web/pages/recon/payment.tsx":()=>d(()=>import(`./payment-m5LFx4J0.js`),__vite__mapDeps([153,1,2,33,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,136,102,29,91,92,26,93,28,30,31,94,95,96,97,98,42,99,100,36,111,139])),"/web/pages/result/fail.tsx":()=>d(()=>import(`./fail-BFEpQBfc.js`),__vite__mapDeps([154,1,2,4,5,6,7,8,9,11,12,26,15,127,14,16,65,74])),"/web/pages/result/info.tsx":()=>d(()=>import(`./info-DmaRTlzJ.js`),__vite__mapDeps([155,1,2,11,12,26,15,127,14,9,16,65])),"/web/pages/result/success.tsx":()=>d(()=>import(`./success-BtLkPs9S.js`),__vite__mapDeps([156,1,2,11,12,26,15,127,14,9,16,65])),"/web/pages/result/warning.tsx":()=>d(()=>import(`./warning-D9M9NjTA.js`),__vite__mapDeps([157,1,2,11,12,26,15,127,14,9,16,65])),"/web/pages/system/ai.tsx":()=>d(()=>import(`./ai-BaBcitlo.js`),__vite__mapDeps([158,1,2,33,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,147,92,85,86,87,27,88,38,89,90,26,93,28,29,30,31,94,95,96,97,98])),"/web/pages/system/config.tsx":()=>d(()=>import(`./config-tH2RSZ-J.js`),__vite__mapDeps([159,1,2,33,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,92,85,86,87,27,88,38,89,90,26,93,28,29,30,31,94,95,96,97,98,137])),"/web/pages/system/dept.tsx":()=>d(()=>import(`./dept-wABp4Ul9.js`),__vite__mapDeps([160,1,2,33,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,147,85,86,87,27,88,38,89,90,92,26,93,28,29,30,31,94,95,96,97,98,137,99,100,36,150])),"/web/pages/system/dict/index.tsx":()=>d(()=>import(`./dict-j8wfnfhh.js`),__vite__mapDeps([161,1,2,3,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,120,31,162,36,33,91,85,86,87,27,88,38,89,90,92,26,93,28,29,30,94,95,96,97,98,42,99,100])),"/web/pages/system/dict/item.tsx":()=>d(()=>import(`./item-DyrMo47d.js`),__vite__mapDeps([163,1,2,3,4,5,6,7,8,9,10,11,12,40,120,57,92,33,54,21,14,15,16,17,18,19,24,20,41,55,22,56,44,25,39,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,26,93,28,29,30,31,94,95,96,97,98,91,42,99,100,36])),"/web/pages/system/file.tsx":()=>d(()=>import(`./file-BhqTJxRm.js`),__vite__mapDeps([164,1,2,33,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,92,26,93,28,29,30,31,94,95,96,97,98,136,102])),"/web/pages/system/info.tsx":()=>d(()=>import(`./info-CVHNTwj4.js`),__vite__mapDeps([165,2,1,4,5,6,7,8,9,23,24,25,26,15,37,60,142,12,29,18,19,76,79,51,31])),"/web/pages/system/mail.tsx":()=>d(()=>import(`./mail-ChpDRzPT.js`),__vite__mapDeps([166,1,2,33,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,92,85,86,87,27,88,38,89,90,26,93,28,29,30,31,94,95,96,97,98])),"/web/pages/system/role.tsx":()=>d(()=>import(`./role-D-VBhILf.js`),__vite__mapDeps([167,1,2,33,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,26,93,28,29,31,168,91,92,30,94,95,96,97,98,42,99,100,36])),"/web/pages/system/rule.tsx":()=>d(()=>import(`./rule-CqyTke2b.js`),__vite__mapDeps([169,1,2,33,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,120,28,29,31,162,36,168,91,85,86,87,27,88,38,89,90,92,26,93,30,94,95,96,97,98,42,99,100,150])),"/web/pages/system/storage.tsx":()=>d(()=>import(`./storage-DhJApafx.js`),__vite__mapDeps([170,1,2,33,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,92,85,86,87,27,88,38,89,90,26,93,28,29,30,31,94,95,96,97,98])),"/web/pages/system/user.tsx":()=>d(()=>import(`./user-Bt-PQ9Uv.js`),__vite__mapDeps([171,1,2,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,23,29,100,36,33,31,168,91,85,86,87,27,88,38,89,90,92,26,93,28,30,94,95,96,97,98,42,99,150])),"/web/pages/user/profile.tsx":()=>d(()=>import(`./profile-CGJ4n7jj.js`),__vite__mapDeps([172,1,2,4,5,6,7,8,9,10,11,12,23,24,25,57,86,62,87,26,15,61,14,16,63,43,44,45,46,118,19,55,40,41,21,22,56,27,89,90,64,17,29,18,95,96,67,48,68,73,74,75,77,51,100,36,33,31,173]))}),Tt=[`/login`];function Et(e){return(0,R.jsx)(P.Suspense,{fallback:null,children:(0,R.jsx)((0,P.lazy)(e),{})})}function Dt(){let e=[];for(let t in wt){let n=t.replace(`/web/pages`,``).replace(/\.tsx$/,``).replace(/\/index$/,``);n||=`/`,!Tt.includes(n)&&e.push({id:n,path:n,element:Et(wt[t])})}return e}function Ot(){return f([{Component:Ct,children:[...Dt(),{path:`*`,element:Et(wt[`/web/pages/result/404.tsx`])}]},{path:`/`,element:(0,R.jsx)(g,{to:`/dashboard/analysis`})},{path:`login`,element:(0,R.jsx)(Le,{})}])}function kt(){let{message:e,modal:t,notification:n}=ce.useApp();return window.$message=e,window.$modal=t,window.$notification=n,null}var At=({children:e})=>{let t=b(e=>e.themeConfig),{antdLocale:n}=Fe();return(0,R.jsx)(oe,{theme:(0,P.useMemo)(()=>({components:{Layout:{headerPadding:`0 `+t.headerPadding+`px`,headerHeight:t.headerHeight,bodyBg:t.bodyBg,footerBg:t.footerBg,headerBg:t.headerBg,headerColor:t.headerColor,siderBg:t.siderBg,footerPadding:0},Menu:{activeBarBorderWidth:0,itemBg:`transparent`,subMenuItemBg:`transparent`}},token:{colorPrimary:t.colorPrimary,colorBgBase:t.colorBg,colorTextBase:t.colorText,colorError:t.colorError,colorInfo:t.colorPrimary,colorLink:t.colorPrimary,colorSuccess:t.colorSuccess,colorWarning:t.colorWarning,borderRadius:t.borderRadius,controlHeight:t.controlHeight},algorithm:t.algorithm?lt[t.algorithm]:void 0}),[t]),locale:n,children:(0,R.jsxs)(ce,{children:[(0,R.jsx)(kt,{}),e]})})},jt=()=>{let{changeLanguage:e}=Fe(),t=j(e=>e.info),n=b(e=>e.initWebInfo),r=Re(e=>e.initDict),[i,a]=(0,P.useState)(),o=async()=>{n(),await r(),await e(localStorage.getItem(`i18nextLng`)||`zh`),localStorage.getItem(`token`)?await t():window.location.pathname!==`/login`&&(window.location.href=`/login`)};return(0,P.useEffect)(()=>{o(),a(Ot())},[]),(0,R.jsx)(At,{children:i&&(0,R.jsx)(h,{router:i})})},U=e=>typeof e==`string`,W=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},Mt=e=>e==null?``:``+e,Nt=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},Pt=/###/g,Ft=e=>e&&e.indexOf(`###`)>-1?e.replace(Pt,`.`):e,It=e=>!e||U(e),G=(e,t,n)=>{let r=U(t)?t.split(`.`):t,i=0;for(;i{let{obj:r,k:i}=G(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=G(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=G(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},Rt=(e,t,n,r)=>{let{obj:i,k:a}=G(e,t,Object);i[a]=i[a]||[],i[a].push(n)},K=(e,t)=>{let{obj:n,k:r}=G(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},zt=(e,t,n)=>{let r=K(e,n);return r===void 0?K(t,n):r},Bt=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?U(e[r])||e[r]instanceof String||U(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Bt(e[r],t[r],n):e[r]=t[r]);return e},q=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),Vt={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`,"/":`/`},Ht=e=>U(e)?e.replace(/[&<>"'\/]/g,e=>Vt[e]):e,Ut=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},Wt=[` `,`,`,`?`,`!`,`;`],Gt=new Ut(20),Kt=(e,t,n)=>{t||=``,n||=``;let r=Wt.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=Gt.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},qt=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e-1&&oe?.replace(/_/g,`-`),Jt={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},Y=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||Jt,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(U(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},X=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r{for(let i=0;i-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.indexOf(`.`)>-1?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):U(n)&&i?o.push(...n.split(i)):o.push(n)));let s=K(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!U(n)?s:qt(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.indexOf(`.`)>-1&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),Lt(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(U(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(`.`)>-1&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=K(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Bt(s,n,i):s={...s,...n},Lt(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},Xt={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},Zt=Symbol(`i18next/PATH_KEY`);function Qt(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===Zt?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function Z(e,t){let{[Zt]:n}=e(Qt()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`;if(n.length>1&&i){let e=t?.ns,a=Array.isArray(e)?e:null;if(a&&a.length>1&&a.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var $t={},en=e=>!U(e)&&typeof e!=`boolean`&&typeof e!=`number`,tn=class e extends X{constructor(e,t={}){super(),Nt([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=Y.create(`translator`)}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=en(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!Kt(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:U(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:U(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=Z(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?Z(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!U(i.count),x=e.hasDefaultValue(i),S=b?this.pluralResolver.getSuffix(d,i.count,i):``,ee=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,C=b&&!i.ordinal&&i.count===0,w=C&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${ee}`]||i.defaultValue,T=m;y&&!m&&x&&(T=w);let E=en(T),te=Object.prototype.toString.apply(T);if(y&&T&&E&&_.indexOf(te)<0&&!(U(v)&&Array.isArray(T))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,T,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(T),t=e?[]:{},n=e?g:h;for(let e in T)if(Object.prototype.hasOwnProperty.call(T,e)){let r=`${n}${o}${e}`;x&&!m?t[e]=this.translate(r,{...i,defaultValue:en(w)?w[e]:void 0,joinArrays:!1,ns:c}):t[e]=this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=T[e])}m=t}}else if(y&&U(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=w),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&w!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,s,c?w:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);C&&i[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||w)})}):n(e,s,w))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=U(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!U(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;oi?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=U(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=Xt.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return U(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?Z(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!U(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(U(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!$t[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&($t[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.indexOf(i)===0&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.indexOf(i)===0&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!U(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.substring(0,12)===`defaultValue`&&e[t]!==void 0)return!0;return!1}},nn=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Y.create(`languageUtils`)}getScriptPartFromCode(e){if(e=J(e),!e||e.indexOf(`-`)<0)return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=J(e),!e||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(U(e)&&e.indexOf(`-`)>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>{if(e===r||!(e.indexOf(`-`)<0&&r.indexOf(`-`)<0)&&(e.indexOf(`-`)>0&&r.indexOf(`-`)<0&&e.substring(0,e.indexOf(`-`))===r||e.indexOf(r)===0&&r.length>1))return e})}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),U(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return U(e)&&(e.indexOf(`-`)>-1||e.indexOf(`_`)>-1)?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):U(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}},rn={zero:0,one:1,two:2,few:3,many:4,other:5},an={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},on=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=Y.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=J(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),an;if(!e.match(/-|_/))return an;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>rn[e]-rn[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},sn=(e,t,n,r=`.`,i=!0)=>{let a=zt(e,t,n);return!a&&i&&U(n)&&(a=qt(e,n,r),a===void 0&&(a=qt(t,n,r))),a},cn=e=>e.replace(/\$/g,`$$$$`),ln=class{constructor(e={}){this.logger=Y.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?Ht:t,this.escapeValue=n===void 0||n,this.useRawValueToEscape=r!==void 0&&r,this.prefix=i?q(i):a||`{{`,this.suffix=o?q(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?q(d):f||q(`$t(`),this.nestingSuffix=p?q(p):m||q(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_!==void 0&&_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){let i=sn(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(sn(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp();let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>cn(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?cn(this.escape(e)):cn(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=U(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``;else!U(a)&&!this.useRawValueToEscape&&(a=Mt(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;let r=e.split(RegExp(`${q(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!U(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!U(i))return i;U(i)||(i=Mt(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},un=e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf(`(`)>-1){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].substring(0,r[1].length-1);t===`currency`&&i.indexOf(`:`)<0?n.currency||=i.trim():t===`relativetime`&&i.indexOf(`:`)<0?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},dn=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(J(r),i),t[o]=s),s(n)}},fn=e=>(t,n,r)=>e(J(n),r)(t),pn=class{constructor(e={}){this.logger=Y.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?dn:fn;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=dn(t)}format(e,t,n,r={}){let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&i[0].indexOf(`)`)<0&&i.find(e=>e.indexOf(`)`)>-1)){let e=i.findIndex(e=>e.indexOf(`)`)>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=un(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}},mn=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},hn=class extends X{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=Y.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{Rt(n.loaded,[i],a),mn(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r{this.read.call(this,e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();U(e)&&(e=this.languageUtils.toResolveHierarchy(e)),U(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(!(n==null||n===``)){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},gn=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,simplifyPluralSuffix:!0,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),U(e[1])&&(t.defaultValue=e[1]),U(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),_n=e=>(U(e.ns)&&(e.ns=[e.ns]),U(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),U(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.(`cimode`)<0&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),typeof e.initImmediate==`boolean`&&(e.initAsync=e.initImmediate),e),Q=()=>{},vn=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},yn=`__i18next_supportNoticeShown`,bn=()=>!!(typeof globalThis<`u`&&globalThis[yn]||typeof process<`u`&&{}.I18NEXT_NO_SUPPORT_NOTICE||typeof process<`u`),xn=()=>{typeof globalThis<`u`&&(globalThis[yn]=!0)},Sn=e=>!!(e?.modules?.backend?.name?.indexOf(`Locize`)>0||e?.modules?.backend?.constructor?.name?.indexOf(`Locize`)>0||e?.options?.backend?.backends&&e.options.backend.backends.some(e=>e?.name?.indexOf(`Locize`)>0||e?.constructor?.name?.indexOf(`Locize`)>0)||e?.options?.backend?.projectId||e?.options?.backend?.backendOptions&&e.options.backend.backendOptions.some(e=>e?.projectId)),$=class e extends X{constructor(e={},t){if(super(),this.options=_n(e),this.services={},this.logger=Y,this.modules={external:[]},vn(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(U(e.ns)?e.defaultNS=e.ns:e.ns.indexOf(`translation`)<0&&(e.defaultNS=e.ns[0]));let n=gn();this.options={...n,...this.options,..._n(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!Sn(this)&&!bn()&&(typeof console<`u`&&console.info!==void 0&&console.info(`🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙`),xn());let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?Y.init(r(this.modules.logger),this.options):Y.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:pn;let t=new nn(this.options);this.store=new Yt(this.options.resources,this.options);let i=this.services;i.logger=Y,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new on(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`),e&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(i.formatter=r(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new ln(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new hn(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new tn(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=Q,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=W(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),i.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=Q){let n=t,r=U(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&e.indexOf(t)<0&&e.push(t)})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=W();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=Q,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&Xt.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!([`cimode`,`dev`].indexOf(e)>-1)){for(let e=0;e-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=W();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=U(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(U(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n){let r=(e,t,...i)=>{let a;a=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(i)),a.lng=a.lng||r.lng,a.lngs=a.lngs||r.lngs,a.ns=a.ns||r.ns,a.keyPrefix!==``&&(a.keyPrefix=a.keyPrefix||n||r.keyPrefix);let o={...this.options,...a};typeof a.keyPrefix==`function`&&(a.keyPrefix=Z(a.keyPrefix,o));let s=this.options.keySeparator||`.`,c;return a.keyPrefix&&Array.isArray(e)?c=e.map(e=>(typeof e==`function`&&(e=Z(e,o)),`${a.keyPrefix}${s}${e}`)):(typeof e==`function`&&(e=Z(e,o)),c=a.keyPrefix?`${a.keyPrefix}${s}${e}`:e),this.t(c,a)};return U(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=W();return this.options.ns?(U(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=W();U(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services?.languageUtils||new nn(gn());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=Q){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new Yt(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...gn().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new ln(n)}return a.translator=new tn(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();$.createInstance,$.dir,$.init,$.loadResources,$.reloadResources,$.use,$.changeLanguage,$.getFixedT,$.t,$.exists,$.setDefaultNamespace,$.hasLoadedNamespace,$.loadNamespaces,$.loadLanguages;var Cn={"menu.dashboard":`Dashboard`,"menu.analysis":`Analysis`,"menu.monitor":`Monitor`,"menu.workplace":`Workplace`,"menu.result":`Results`,"menu.result.success":`Success`,"menu.result.fail":`Failure`,"menu.result.warning":`Warning`,"menu.result.info":`Information`,"menu.exception":`Exceptions`,"menu.exception.403":`403`,"menu.exception.404":`404`,"menu.exception.500":`500`,"menu.multi-menu":`Multi-level Menu`,"menu.multi-menu.two":`Level 2`,"menu.multi-menu.first":`Level 2 Page`,"menu.multi-menu.two.three":`Level 3`,"menu.multi-menu.two.second":`Level 3 Page`,"menu.multi-menu.two.three.third":`Level 4`,"menu.page-layout":`Layouts`,"menu.page-layout.base-layout":`Basic Layout`,"menu.page-layout.fix-header":`Fixed Header`,"menu.page-layout.descriptions":`Descriptions`,"menu.example":`Examples`,"menu.example.user-selector":`User Selector`,"menu.example.icon-selector":`Icon Selector`,"menu.example.image-uploader":`Image Upload`,"menu.example.xin-form":`Xin Form`,"menu.example.xin-table":`Xin Table`,"menu.ai":`AI`,"menu.ai.chat":`Chat`,"menu.ai.agent":`Agents`,"menu.ai.conversation":`Conversations`,"menu.system":`System`,"menu.system.user":`Users`,"menu.system.dept":`Departments`,"menu.system.role":`Roles`,"menu.system.rule":`Menus`,"menu.system.info":`System Information`,"menu.system.file":`Files`,"menu.system.dict":`Dictionaries`,"menu.system.mail":`Mail`,"menu.system.storage":`Storage`,"menu.system.config":`Site Config`,"menu.system.ai":`AI`,"menu.xin-admin":`XinAdmin`},wn={"login.username":`Username`,"login.password":`Password`,"login.usernamePlaceholder":`admin`,"login.passwordPlaceholder":`123456`,"login.usernameRequired":`Please enter your username!`,"login.passwordRequired":`Please enter your password!`,"login.remember":`Remember me`,"login.forgotPassword":`Forgot password`,"login.otherLogin":`Other login methods`,"login.success":`Login successful!`,"login.alreadyLoggedIn":`Already logged in, redirecting!`},Tn={"dashboard.analysis.salesAmount":`Sales`,"dashboard.analysis.orderCount":`Orders`,"dashboard.analysis.purchaseAmount":`Purchases`,"dashboard.analysis.receivable":`Receivable`,"dashboard.analysis.today":`Today`,"dashboard.analysis.thisWeek":`Last 7 days`,"dashboard.analysis.vsLastWeek":`vs last week`,"dashboard.analysis.totalBillAmount":`Total billed`,"dashboard.analysis.receivedAmount":`Received`,"dashboard.analysis.salesTrend":`Sales Trend (Last 30 Days)`,"dashboard.analysis.amountAxis":`Amount`,"dashboard.analysis.ordersAxis":`Orders`,"dashboard.analysis.emptyTrend":`No orders in the last 30 days`,"dashboard.analysis.orderStatusDistribution":`Order Status`,"dashboard.analysis.orderUnit":``,"dashboard.analysis.categorySales":`Sales by Category`,"dashboard.analysis.emptyCategory":`No sales data`,"dashboard.analysis.topProducts":`Top 10 Products`,"dashboard.analysis.rank":`Rank`,"dashboard.analysis.productName":`Product`,"dashboard.analysis.quantity":`Qty`,"dashboard.analysis.amount":`Amount`,"dashboard.analysis.topStores":`Top 10 Stores`,"dashboard.analysis.storeName":`Store`,"dashboard.analysis.reconOverview":`Reconciliation & Payment`,"dashboard.analysis.billProgress":`Bill Payment Progress`,"dashboard.analysis.pendingPaymentReview":`Payments to Review`,"dashboard.analysis.pendingPaymentTip":`Payment vouchers submitted by stores, pending review`,"dashboard.analysis.billUnit":``,"dashboard.analysis.latestOrders":`Latest Orders`,"dashboard.analysis.orderNo":`Order No.`,"dashboard.analysis.store":`Store`,"dashboard.analysis.orderDate":`Date`,"dashboard.analysis.status":`Status`,"dashboard.analysis.archivesStores":`Active Stores`,"dashboard.analysis.archivesProducts":`On-sale Products`,"dashboard.analysis.archivesSuppliers":`Suppliers`},En={"dashboard.completion":`Completion`,"dashboard.vs.lastWeek":`vs last week`,"dashboard.monitor.helpService":`Help Service`,"dashboard.monitor.propertyFee":`Property Fee`,"dashboard.monitor.alarmEvents":`Alarm Events`,"dashboard.monitor.otherEvents":`Other Events`,"dashboard.monitor.todoList":`To-Do List`,"dashboard.monitor.myFocus":`My Focus`,"dashboard.monitor.all":`All`,"dashboard.monitor.propertyOrder":`Property Orders`,"dashboard.monitor.repairOrder":`Repair Orders`,"dashboard.monitor.fireSafety":`Fire Safety`,"dashboard.monitor.paidService":`Paid Services`,"dashboard.monitor.publicService":`Public Services`},Dn={"dashboard.workplace.greeting.morning":`Good Morning`,"dashboard.workplace.greeting.afternoon":`Good Afternoon`,"dashboard.workplace.greeting.evening":`Good Evening`,"dashboard.workplace.welcome":`Welcome back!`,"dashboard.workplace.today":`Today is`,"dashboard.workplace.myProjects":`My Projects`,"dashboard.workplace.myTeams":`My Teams`,"dashboard.workplace.latestActivities":`Latest Activities`,"dashboard.workplace.notifications":`Notifications`,"dashboard.workplace.appStore":`App Store`,"dashboard.workplace.appStore.desc":`Application distribution and management platform`,"dashboard.workplace.mallSystem":`Mall System`,"dashboard.workplace.mallSystem.desc":`Enterprise e-commerce solution`,"dashboard.workplace.collaboration":`Collaboration`,"dashboard.workplace.collaboration.desc":`Team collaboration and communication tools`,"dashboard.workplace.docCenter":`Document Center`,"dashboard.workplace.docCenter.desc":`Enterprise knowledge management and document collaboration`,"dashboard.workplace.badge.new":`New`,"dashboard.workplace.status.inProgress":`In Progress`,"dashboard.workplace.status.completed":`Completed`,"dashboard.workplace.status.planning":`Planning`,"dashboard.workplace.progress":`Progress`,"dashboard.workplace.members":`Members`,"dashboard.workplace.people":`people`,"dashboard.workplace.recentVisits":`Recent Visits`,"dashboard.workplace.location":`Local`,"dashboard.workplace.project1.name":`Enterprise Management System`,"dashboard.workplace.project1.desc":`Enterprise backend management system based on React and AntDesign`,"dashboard.workplace.project2.name":`Mobile H5 Application`,"dashboard.workplace.project2.desc":`Mobile e-commerce application developed with Vue3`,"dashboard.workplace.project3.name":`Data Visualization Platform`,"dashboard.workplace.project3.desc":`Big data visualization and analysis platform based on ECharts`,"dashboard.workplace.project4.name":`System Upgrade Notice`,"dashboard.workplace.project4.desc":`System will be upgraded and maintained from 2:00-4:00 AM this Friday`,"dashboard.workplace.project5.name":`Team Invitation`,"dashboard.workplace.project5.desc":`You have been invited to join the "New Product R&D" project team`,"dashboard.workplace.project6.name":`Task Reminder`,"dashboard.workplace.project6.desc":`You have 3 tasks that are about to expire, please handle them in time`},On={"system.info.title":`System Info`,"system.info.basic.title":`System Basic Info`,"system.info.project.title":`Project Address`,"system.info.changelog.title":`Changelog`,"system.info.author.title":`Author Introduction`,"system.info.desc.title":`System Description`,"system.info.join":`Join the community for updates and support`,"system.info.label.name":`System Name`,"system.info.label.version":`Version`,"system.info.label.build":`Build Tool`,"system.info.label.frontend":`Frontend Framework`,"system.info.label.ui":`UI Framework`,"system.info.label.css":`CSS Framework`,"system.info.label.router":`Router Management`,"system.info.label.state":`State Management`,"system.info.label.ts":`TypeScript`,"system.info.link.github":`GitHub Repository`,"system.info.link.docs":`Online Documentation`,"system.info.link.demo":`Demo Address`,"system.info.link.issues":`Issues & Feedback`,"system.info.log.content":`Refactored project modules based on React 19, Vite 7, ReactRouter 7, zustand 5, and TypeScript`,"system.info.author.name":`XinAdmin Team`,"system.info.author.role":`Enterprise-level Admin Solution Provider`,"system.info.contact.github":`GitHub`,"system.info.contact.group":`QQ Group`,"system.info.contact.discuss":`Discussions`,"system.info.desc.content":`XinAdmin is an enterprise-level admin template based on Ant Design design specifications, adopting the latest frontend tech stack including React 19, Vite 7, ReactRouter 7, zustand 5, and TypeScript. +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/agent-BacKF2o-.js","assets/rolldown-runtime-BgaNhQyE.js","assets/jsx-runtime-CRBytmvs.js","assets/chunk-KS7C4IRE-Zm15rq6F.js","assets/typography-DRFhazK9.js","assets/tooltip-SaeG1Uv7.js","assets/style-BmYds38x.js","assets/CopyOutlined-pYq9KfGb.js","assets/es-DGcDZmXr.js","assets/CloseCircleFilled-C_pAsEWy.js","assets/space-Cu4QVMgQ.js","assets/button-BILozH6U.js","assets/ColorPresets-CG7aHuoG.js","assets/app-Bntg8WFU.js","assets/CheckCircleFilled-DcF3PzkE.js","assets/PlusOutlined-B8K2rG8r.js","assets/ExclamationCircleFilled-B0FwC6ZE.js","assets/context-D6bvp8kb.js","assets/useClosable-BLB2IUFV.js","assets/mergeProps-yLeqvqMM.js","assets/useModal-uyHD1DJx.js","assets/config-provider-CqLGIhNd.js","assets/empty-_1ZFK8yy.js","assets/avatar-DPxbCsa4.js","assets/useBreakpoint-DLqc4AYE.js","assets/popover-BGq_MyT2.js","assets/card-DU2T2-YW.js","assets/spin-CfJYIffX.js","assets/switch--LhkZymx.js","assets/tag-DBV1bHre.js","assets/theme-D5FZSALB.js","assets/useTranslation-DBl6NYjI.js","assets/agent-CCozney_.js","assets/request--UCyt0wo.js","assets/chat-CfnvY2VS.js","assets/global-DPRsdECQ.js","assets/middleware-Ctqt9WwX.js","assets/divider-BWjoWWHX.js","assets/dropdown-BgpiO8SY.js","assets/dropdown-Cg5iA4jt.js","assets/LeftOutlined-8zj_FQJP.js","assets/PurePanel-CRkmGKGB.js","assets/flex-BUqc4pUn.js","assets/input-CHcsaDtX.js","assets/SearchOutlined-C1nd7QQO.js","assets/Input-CJ-n8Xgl.js","assets/EyeOutlined-LSBUmW0e.js","assets/CaretDownFilled-DsboRsp5.js","assets/DeleteOutlined-DwOvobSM.js","assets/ArrowUpOutlined-C-Hx3V4D.js","assets/ClearOutlined-D3ecEqjC.js","assets/UserOutlined-D5Ziy0eL.js","assets/chat-Iht936bQ.css","assets/conversation-CgPPysYU.js","assets/lodash-DzOfPy0f.js","assets/DoubleRightOutlined-Blfli1UU.js","assets/DownOutlined-OYbvV7zr.js","assets/LockOutlined-B8eRH1x4.js","assets/modal-g8Q5gNCx.js","assets/ClockCircleOutlined-CNdnBEY0.js","assets/LinkOutlined-C-pRqXVc.js","assets/form-B3R3kIqp.js","assets/useForm-CAC6DWbf.js","assets/row-VfXXpsnR.js","assets/PictureOutlined-CB8Pr7jP.js","assets/WarningFilled-D9XuDTkJ.js","assets/CaretUpOutlined-ButGJLYH.js","assets/FileOutlined-DcVPckWl.js","assets/DownloadOutlined-DJY9Mu8c.js","assets/WeiboOutlined-Bp26feUj.js","assets/SmileOutlined-CxtYvF4K.js","assets/ArrowDownOutlined-hMgHFKfN.js","assets/FileDoneOutlined-Bp46bcBB.js","assets/CheckCircleOutlined-IJiAu4Hy.js","assets/CloseCircleOutlined-D2to6Tog.js","assets/EnvironmentOutlined-Be7mN2bK.js","assets/InfoCircleOutlined-ZdiYvwVM.js","assets/UploadOutlined-NadwXvrl.js","assets/PrinterOutlined-V8ipM95d.js","assets/QqOutlined-DnUKpfIS.js","assets/RiseOutlined-gXjyF9G9.js","assets/ShopOutlined-CwwKSpcq.js","assets/WalletOutlined-Bjy-chtO.js","assets/ShoppingOutlined-CsazpDg7.js","assets/TeamOutlined-DAHp-vuL.js","assets/table-BXi9q3AE.js","assets/radio-CxFl70_7.js","assets/useBubbleLock-BOXZxiMO.js","assets/checkbox-BSxplF7f.js","assets/pagination-aogAYU7q.js","assets/zh_CN-BT8mdvr9.js","assets/XinTable-DOLiJ5rL.js","assets/XinForm-BPDYdeax.js","assets/row-DfzKzMF0.js","assets/ImageUploader-C4yPpD75.js","assets/upload-oMV5VJeJ.js","assets/progress-BvFjoSli.js","assets/tslib.es6-5i5FW2KX.js","assets/XinForm-CeTR0shq.css","assets/AuthButton-DvrpreK4.js","assets/user-LBumqaa7.js","assets/banner-CJe0agU6.js","assets/image-CTRBNpBE.js","assets/nav-Dih5jXxX.js","assets/promo-CfsZu-jA.js","assets/special-DQ_cXCQl.js","assets/iProduct-l9WpLyUD.js","assets/goods-DPA1smJU.js","assets/download-DC9wDwqQ.js","assets/level-BCGrZbbc.js","assets/notice-DkzNYgG3.js","assets/store-JDnJsv44.js","assets/store-B-wG8BVA.js","assets/supplier-D0qvu-sA.js","assets/analysis-ChRcSk16.js","assets/statistic-G8YfPOC4.js","assets/iStoreOrder-CyyYoLoV.js","assets/monitor-Dd1gBWfo.js","assets/list-C8spiXAQ.js","assets/workplace-I8FwqFbs.js","assets/badge-__AeKia1.js","assets/icon-selector-Dy7uWjj7.js","assets/image-uploader-DBHOFZqO.js","assets/user-selector-C_7kHqFz.js","assets/xin-form-CjpDqXrA.js","assets/xin-table-Bw1qt43O.js","assets/403-kF5cJUEE.js","assets/result-D_u5wtF_.js","assets/404-CF76bH-T.js","assets/500-pw04psNL.js","assets/login-CKGg-k4h.js","assets/first-VYyrluR5.js","assets/breadcrumb-CSvdSHzR.js","assets/second-urN6pQJ9.js","assets/third-CmYUgLWR.js","assets/store-Wda1wq7X.js","assets/descriptions-BLF6MKiu.js","assets/popconfirm-DyseZgpU.js","assets/order-C6L8DsOz.js","assets/iPurchaseOrder-Dn-laOqY.js","assets/base-layout-o2EQVE3N.js","assets/descriptions-DSR6x1nO.js","assets/timeline-BB5N-LF8.js","assets/fix-header-DIZqZWCz.js","assets/category-BQA8kSpc.js","assets/category-MmrJkdbs.js","assets/goods-DDrxLa-h.js","assets/alert-DuXzwpQC.js","assets/supplier-BstAcwv7.js","assets/order-CzJfBGxK.js","assets/useAuth-AiNV0bRw.js","assets/bill-qG3t0JUE.js","assets/container-return-DT66R0pD.js","assets/payment-m5LFx4J0.js","assets/fail-BFEpQBfc.js","assets/info-DmaRTlzJ.js","assets/success-BtLkPs9S.js","assets/warning-D9M9NjTA.js","assets/ai-BaBcitlo.js","assets/config-tH2RSZ-J.js","assets/dept-wABp4Ul9.js","assets/dict-j8wfnfhh.js","assets/dict-CDRllPHM.js","assets/item-DyrMo47d.js","assets/file-BhqTJxRm.js","assets/info-CVHNTwj4.js","assets/mail-ChpDRzPT.js","assets/role-D-VBhILf.js","assets/relativeTime-jamE_cdZ.js","assets/rule-CqyTke2b.js","assets/storage-DhJApafx.js","assets/user-Bt-PQ9Uv.js","assets/profile-CGJ4n7jj.js","assets/useMobile-Bcq0nkW4.js"])))=>i.map(i=>d[i]); +import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Bn as t,Dr as n,Jn as r,Ln as i,Tr as a,Vn as o,Xn as s,t as c,zn as l}from"./jsx-runtime-CRBytmvs.js";import{a as u,c as d,i as f,n as p,o as m,r as h,t as g}from"./chunk-KS7C4IRE-Zm15rq6F.js";import{i as _,n as v,r as y,t as b}from"./global-DPRsdECQ.js";import{B as x,L as S,S as ee,V as C,_ as w,b as T,g as E,i as te,l as ne,n as D,t as re,x as ie}from"./lodash-DzOfPy0f.js";import{t as ae}from"./tooltip-SaeG1Uv7.js";import{t as oe}from"./config-provider-CqLGIhNd.js";import{t as se}from"./space-Cu4QVMgQ.js";import{t as O}from"./button-BILozH6U.js";import{t as ce}from"./app-Bntg8WFU.js";import{r as le}from"./DoubleRightOutlined-Blfli1UU.js";import{t as ue}from"./empty-_1ZFK8yy.js";import{t as de}from"./SearchOutlined-C1nd7QQO.js";import{t as fe}from"./avatar-DPxbCsa4.js";import{t as pe}from"./breadcrumb-CSvdSHzR.js";import{a as me,i as he,n as ge,o as _e,s as ve}from"./dropdown-Cg5iA4jt.js";import{n as ye}from"./LockOutlined-B8eRH1x4.js";import{n as be,t as xe}from"./row-DfzKzMF0.js";import{t as k}from"./divider-BWjoWWHX.js";import{t as Se}from"./modal-g8Q5gNCx.js";import{t as Ce}from"./dropdown-BgpiO8SY.js";import{t as we}from"./input-CHcsaDtX.js";import{n as Te}from"./CopyOutlined-pYq9KfGb.js";import{r as Ee}from"./PictureOutlined-CB8Pr7jP.js";import{t as De}from"./switch--LhkZymx.js";import{t as A}from"./theme-D5FZSALB.js";import{t as Oe}from"./ArrowDownOutlined-hMgHFKfN.js";import{t as ke}from"./ArrowUpOutlined-C-Hx3V4D.js";import{r as Ae}from"./InfoCircleOutlined-ZdiYvwVM.js";import{t as je}from"./UserOutlined-D5Ziy0eL.js";import{i as Me,t as j}from"./user-LBumqaa7.js";import{n as Ne,r as Pe,t as M}from"./useTranslation-DBl6NYjI.js";import{i as Fe,r as Ie,t as Le}from"./login-CKGg-k4h.js";import{t as N}from"./useMobile-Bcq0nkW4.js";import{t as Re}from"./dict-CDRllPHM.js";import{t as ze}from"./relativeTime-jamE_cdZ.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function Be(e,t,n){return typeof n==`boolean`?n:e.length?!0:r(t).some(e=>e.type===he)}var P=e(n()),F=({suffixCls:e,tagName:t,displayName:n})=>n=>P.forwardRef((r,i)=>P.createElement(n,{ref:i,suffixCls:e,tagName:t,...r})),I=P.forwardRef((e,t)=>{let{prefixCls:n,suffixCls:r,className:a,tagName:s,...c}=e,{getPrefixCls:l}=P.useContext(i),u=l(`layout`,n),[d,f]=_e(u),p=r?`${u}-${r}`:u;return P.createElement(s,{className:o(n||p,a,d,f),ref:t,...c})}),Ve=P.forwardRef((e,n)=>{let{direction:r}=P.useContext(i),[a,c]=P.useState([]),{prefixCls:u,className:d,rootClassName:f,children:p,hasSider:m,tagName:h,style:g,..._}=e,v=s(_,[`suffixCls`]),{getPrefixCls:y,className:b,style:x}=l(`layout`),S=y(`layout`,u),ee=Be(a,p,m),[C,w]=_e(S),T=o(S,{[`${S}-has-sider`]:ee,[`${S}-rtl`]:r===`rtl`},b,d,f,C,w),E=P.useMemo(()=>({siderHook:{addSider:e=>{c(n=>[].concat(t(n),[e]))},removeSider:e=>{c(t=>t.filter(t=>t!==e))}}}),[]);return P.createElement(ve.Provider,{value:E},P.createElement(h,{ref:n,className:T,style:{...x,...g},...v},p))}),He=F({tagName:`div`,displayName:`Layout`})(Ve),Ue=F({suffixCls:`header`,tagName:`header`,displayName:`Header`})(I),We=F({suffixCls:`footer`,tagName:`footer`,displayName:`Footer`})(I),Ge=F({suffixCls:`content`,tagName:`main`,displayName:`Content`})(I),L=He;L.Header=Ue,L.Footer=We,L.Content=Ge,L.Sider=he,L._InternalSiderContext=me;var Ke={type:`3rdParty`,init(e){Pe(e.options.react),Ne(e)}},qe=e(a(),1),R=c(),{useToken:Je}=A,Ye=()=>{let{token:e}=Je(),{t}=M(),n=m(),r=b(e=>e.themeDrawer),i=b(e=>e.setThemeDrawer),a=j(e=>e.userinfo),o=j(e=>e.logout),s=N(),[c,l]=(0,P.useState)(!1),[u,d]=(0,P.useState)(!1),f=()=>{let e=document.documentElement;document.fullscreenElement?document.exitFullscreen().then(()=>{l(!1)}):e.requestFullscreen().then(()=>{l(!0)})},p=[{key:`1`,label:t(`layout.profile`),icon:(0,R.jsx)(je,{}),onClick:()=>n(`/user/profile`)},{key:`2`,label:t(`layout.logout`),icon:(0,R.jsx)(te,{}),onClick:async()=>{o().then(()=>{Ee.success(t(`layout.logoutSuccess`)),window.location.href=`/login`}).catch(()=>{Ee.error(t(`layout.logoutFailed`))})}}];return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(Se,{closable:!1,open:u,footer:null,style:{top:40,width:600},styles:{body:{maxHeight:`80vh`},container:{padding:0}},onCancel:()=>d(!1),children:[(0,R.jsxs)(`div`,{className:`p-5`,children:[(0,R.jsx)(we,{size:`large`,placeholder:t(`layout.searchPlaceholder`),prefix:(0,R.jsx)(de,{})}),(0,R.jsx)(`div`,{className:`mt-5`,children:(0,R.jsx)(ue,{})})]}),(0,R.jsxs)(se,{className:`mt-5 flex align-center pl-5 pr-5 pt-2.5 pb-2.5`,style:{borderTop:`1px solid `+e.colorBorder},children:[(0,R.jsx)(Te,{}),` `,(0,R.jsx)(`span`,{className:`mr-4`,children:t(`layout.searchConfirm`)}),(0,R.jsx)(ke,{}),(0,R.jsx)(Oe,{}),` `,(0,R.jsx)(`span`,{className:`mr-4`,children:t(`layout.searchSwitch`)}),`Esc `,(0,R.jsx)(`span`,{className:`mr-2`,children:t(`layout.searchClose`)})]})]}),(0,R.jsxs)(se,{children:[!s&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(O,{icon:(0,R.jsx)(T,{}),size:`large`,type:`text`,onClick:()=>window.open(`https://xin-admin.com`)}),(0,R.jsx)(O,{icon:(0,R.jsx)(Ae,{}),size:`large`,type:`text`,onClick:()=>window.open(`https://github.com/xin-admin/xin-admin-ui`)}),(0,R.jsx)(O,{icon:(0,R.jsx)(de,{}),size:`large`,type:`text`,onClick:()=>d(!0)}),(0,R.jsx)(O,{onClick:f,icon:c?(0,R.jsx)(ee,{}):(0,R.jsx)(ie,{}),size:`large`,type:`text`}),(0,R.jsx)(Ie,{size:`large`,type:`text`}),(0,R.jsx)(O,{onClick:()=>i(!r),icon:(0,R.jsx)(ne,{}),size:`large`,type:`text`})]}),a?(0,R.jsx)(Ce,{menu:{items:p},children:(0,R.jsxs)(O,{size:`large`,type:`text`,children:[(0,R.jsx)(`div`,{children:a.nickname||a.username}),(0,R.jsx)(fe,{src:a.avatar_url?a.avatar_url:null,size:`small`})]})}):null]})]})};function Xe(e){let t={},n=(e,r=[])=>{if(!e.key)return;let i={href:e.path,title:e.name,icon:e.icon,local:e.local},a=[...r,i];t[e.key]=a,e.children&&e.children.length&&e.children.forEach(e=>n(e,a))};return e.forEach(e=>n(e)),t}function z(e,t){for(let n of e){if(n.path===t)return n;if(n.children&&n.children.length>0){let e=z(n.children,t);if(e)return e}}return null}function Ze(e,t,n=[]){for(let r of e){if(!r.key)continue;let e=[...n,r.key];if(r.path===t)return e;if(r.children&&r.children.length>0){let n=Ze(r.children,t,e);if(n)return n}}return null}function Qe(e,t){for(let n of e){if(n.key===t)return n;if(n.children&&n.children.length>0){let e=Qe(n.children,t);if(e)return e}}return null}var $e=(0,P.createContext)(null),et=({children:e})=>{let t=u(),[n,r]=(0,P.useState)([]),[i,a]=(0,P.useState)(),[o,s]=(0,P.useState)([]),[c,l]=(0,P.useState)(!1);return(0,P.useEffect)(()=>{Me().then(({data:e})=>{let t=e.data.menus;r(t)})},[]),(0,P.useEffect)(()=>{let e=t.pathname,r=Ze(n,e);r&&r.length&&(s(r),a(r[0]))},[n]),(0,R.jsx)($e.Provider,{value:{menus:n,parentKey:i,selectKey:o,collapsed:c,setParentKey:a,setCollapsed:l,setSelectKey:s},children:e})},B=()=>{let e=(0,P.useContext)($e);if(!e)throw Error(`useLayoutContext must be used within LayoutProvider`);return e},V=(e,t)=>e.reduce((e,n)=>{if(![`route`,`menu`].includes(n.type)||!n.hidden)return e;let r={label:n.local?t(n.local):n.name,icon:n.icon?(0,R.jsx)(D,{name:n.icon}):void 0,key:n.key};return n.type===`menu`&&n.children?.length&&(r.children=V(n.children,t)),e.push(r),e},[]),H=()=>{let{t:e}=M(),t=N(),n=m(),[r,i]=(0,P.useState)([]),a=b(e=>e.layout),{menus:o,parentKey:s,selectKey:c,setSelectKey:l,setParentKey:u}=B();(0,P.useEffect)(()=>{if(t){i(V(o,e));return}if([`columns`,`mix`].includes(a)&&s){let t=o.find(e=>e.key===s);i(V(t?.children||[],e))}else i(V(o,e))},[o,a,s,e,t]);let d=e=>{l(e),[`top`,`side`].includes(a)&&u(e[e.length-1]);let t=Qe(o,e[0]);if(!(!t||!t.key)){if(t.type===`route`&&t.link){window.open(t.path,`_blank`);return}if(t.type===`route`&&t.path){n(t.path);return}}};return(0,R.jsx)(R.Fragment,{children:r.length>0&&(0,R.jsx)(ge,{className:`border-b-0 flex-1`,mode:a===`top`&&!t?`horizontal`:`inline`,items:r,onSelect:e=>d(e.keyPath),selectedKeys:c})})},tt=[{title:(0,R.jsx)(T,{})}],nt=()=>{let{t:e}=M(),t=u(),{menus:n}=B(),[r,i]=(0,P.useState)(tt),a=(0,P.useMemo)(()=>Xe(n),[n]);return(0,P.useEffect)(()=>{let r=t.pathname,o=z(n,r);if(o&&o.key){let t=a[o.key];if(t){i([{title:(0,R.jsx)(T,{})},...t.map(t=>({title:(0,R.jsxs)(R.Fragment,{children:[t.icon&&(0,R.jsx)(D,{name:t.icon}),(0,R.jsx)(`span`,{children:t.local?e(t.local):t.title})]})}))]);return}}i(tt)},[e,t.pathname,a]),(0,R.jsx)(pe,{items:r})},{Header:rt}=L,it=()=>{let{t:e}=M(),t=N(),n=m(),r=b(e=>e.logo),i=b(e=>e.title),a=b(e=>e.layout),o=b(e=>e.themeConfig),{menus:s,parentKey:c,collapsed:l,setCollapsed:u,setParentKey:d,setSelectKey:f}=B(),p={token:{colorTextBase:o.headerColor},components:{Menu:{activeBarBorderWidth:0,itemBg:`transparent`}}},[h,g]=(0,P.useState)([]);(0,P.useEffect)(()=>{g(s.filter(e=>e.hidden).map(t=>({label:t.local?e(t.local):t.name,icon:t.icon?(0,R.jsx)(D,{name:t.icon}):!1,key:t.key})))},[s,e]);let _=e=>{let t=Qe(s,e);if(!(!t||!t.key)&&(d(t.key),t.type!==`menu`)){if(f([t.key]),t.type===`route`&&t.link){window.open(t.path,`_blank`);return}if(t.type===`route`&&t.path){n(t.path);return}}};return(0,R.jsx)(oe,{theme:p,children:t?(0,R.jsxs)(rt,{className:`flex sticky z-1 top-0 backdrop-blur-xs justify-between items-center`,children:[(0,R.jsxs)(`div`,{className:`flex items-center`,children:[(0,R.jsx)(`img`,{className:`w-9 mr-5`,src:r,alt:`logo`}),(0,R.jsx)(`span`,{className:`font-semibold text-[20px] mr-2`,children:i})]}),(0,R.jsx)(Ye,{})]}):(0,R.jsxs)(rt,{className:`flex sticky z-1 top-0 backdrop-blur-xs`,style:{borderBottom:`1px solid `+o.colorBorder},children:[(0,R.jsxs)(`div`,{className:`flex items-center relative`,children:[(0,R.jsx)(`img`,{className:`h-8`,src:r,alt:`logo`}),(0,R.jsx)(`span`,{className:`font-semibold text-[20px] ml-5 mr-5`,children:i}),a!==`top`&&(0,R.jsx)(O,{type:`text`,className:`text-[16px] mr-2.5`,onClick:()=>u(!l),children:l?(0,R.jsx)(E,{}):(0,R.jsx)(w,{})}),[`columns`,`side`].includes(a)&&(0,R.jsx)(nt,{})]}),(0,R.jsxs)(`div`,{className:`overflow-hidden flex-1`,children:[a==`top`&&(0,R.jsx)(H,{}),a==`mix`&&(0,R.jsx)(ge,{className:`border-b-0 w-full`,mode:`horizontal`,items:h,onSelect:e=>_(e.key),selectedKeys:[c]})]}),(0,R.jsx)(Ye,{})]})})},{Footer:at}=L,ot=()=>{let e=new Date().getFullYear(),t=b(e=>e.themeConfig);return(0,R.jsxs)(R.Fragment,{children:[t.fixedFooter&&(0,R.jsx)(`div`,{className:`h-10`}),(0,R.jsx)(at,{className:(t.fixedFooter?`sticky`:`relative`)+` z-10 w-full bottom-0 pt-2.5 pb-2.5`,style:{borderTop:`1px solid `+t.colorBorder},children:(0,R.jsxs)(`div`,{className:`flex items-center justify-center w-full`,children:[`Xin Admin ©`,e,` Created by xiaoliu`]})})]})},st=()=>{let e=b(e=>e.themeConfig),t=b(e=>e.themeDrawer),n=b(e=>e.setThemeDrawer),[r,i]=(0,P.useState)(!1);return(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`fixed bottom-8 left-8 z-999`,children:(0,R.jsx)(O,{type:`primary`,shape:`circle`,size:`large`,icon:r?(0,R.jsx)(w,{}):(0,R.jsx)(E,{}),onClick:()=>i(!r)})}),(0,R.jsx)(S,{placement:`left`,closable:!0,onClose:()=>i(!1),open:r,styles:{section:{width:280},header:{borderBottom:`1px solid `+e.colorBorder,background:e.siderBg,color:e.siderColor},body:{padding:0,background:e.siderBg}},footer:(0,R.jsxs)(se,{children:[(0,R.jsx)(O,{icon:(0,R.jsx)(T,{}),size:`large`,type:`text`,onClick:()=>window.open(`https://xin-admin.com`)}),(0,R.jsx)(O,{icon:(0,R.jsx)(Ae,{}),size:`large`,type:`text`,onClick:()=>window.open(`https://github.com/xin-admin/xin-admin-ui`)}),(0,R.jsx)(Ie,{size:`large`,type:`text`}),(0,R.jsx)(O,{onClick:()=>n(!t),icon:(0,R.jsx)(ne,{}),size:`large`,type:`text`})]}),children:(0,R.jsx)(`div`,{style:{height:`100%`,overflowY:`auto`,width:`100%`,background:e.siderBg},children:(0,R.jsx)(H,{})})})]})},ct=re(),lt={defaultAlgorithm:A.defaultAlgorithm,darkAlgorithm:A.darkAlgorithm,defaultCompactAlgorithm:[A.defaultAlgorithm,A.compactAlgorithm],darkCompactAlgorithm:[A.darkAlgorithm,A.compactAlgorithm]},ut=[{label:`layout.algorithmDefault`,value:`defaultAlgorithm`},{label:`layout.algorithmDark`,value:`darkAlgorithm`},{label:`layout.algorithmDefaultCompact`,value:`defaultCompactAlgorithm`},{label:`layout.algorithmDarkCompact`,value:`darkCompactAlgorithm`}],{useToken:dt}=A,ft=[{key:`colorPrimary`,label:`layout.colorPrimary`},{key:`colorText`,label:`layout.colorText`},{key:`colorBg`,label:`layout.colorBg`},{key:`colorSuccess`,label:`layout.colorSuccess`},{key:`colorWarning`,label:`layout.colorWarning`},{key:`colorError`,label:`layout.colorError`},{key:`bodyBg`,label:`layout.bodyBg`},{key:`footerBg`,label:`layout.footerBg`},{key:`headerBg`,label:`layout.headerBg`},{key:`headerColor`,label:`layout.headerColor`},{key:`siderBg`,label:`layout.siderBg`},{key:`siderColor`,label:`layout.siderColor`},{key:`colorBorder`,label:`layout.colorBorder`}],pt=[{key:`fixedFooter`,label:`layout.fixedFooter`,type:`switch`},{key:`borderRadius`,label:`layout.borderRadius`,type:`number`,min:0,max:30},{key:`controlHeight`,label:`layout.controlHeight`,type:`number`,min:0},{key:`headerPadding`,label:`layout.headerPadding`,type:`number`,min:0},{key:`headerHeight`,label:`layout.headerHeight`,type:`number`,min:0},{key:`siderWeight`,label:`layout.siderWeight`,type:`number`,min:0},{key:`bodyPadding`,label:`layout.bodyPadding`,type:`number`,min:0}],mt=[{background:`/static/theme/default.svg`,name:`light`,title:`layout.themeLight`},{background:`/static/theme/dark.svg`,name:`dark`,title:`layout.themeDark`}],ht=[{key:`side`,title:`layout.layoutSide`,render:e=>(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`rounded-sm w-full h-6 mb-1.5`,style:{background:e.colorPrimaryBorder}}),(0,R.jsxs)(`div`,{className:`flex`,children:[(0,R.jsx)(`div`,{className:`rounded-sm h-16 w-6`,style:{background:e.colorPrimary}}),(0,R.jsx)(`div`,{className:`rounded-sm flex-1 ml-1.5`,style:{background:e.colorPrimaryBg}})]})]})},{key:`top`,title:`layout.layoutTop`,render:e=>(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`rounded-sm h-6 w-full mb-1.5`,style:{background:e.colorPrimary}}),(0,R.jsx)(`div`,{className:`rounded-sm h-16`,style:{background:e.colorPrimaryBg}})]})},{key:`mix`,title:`layout.layoutMix`,render:e=>(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`rounded-sm w-full h-6 mb-1.5`,style:{background:e.colorPrimary}}),(0,R.jsxs)(`div`,{className:`flex`,children:[(0,R.jsx)(`div`,{className:`rounded-sm h-16 w-6`,style:{background:e.colorPrimary}}),(0,R.jsx)(`div`,{className:`rounded-sm flex-1 ml-1.5`,style:{background:e.colorPrimaryBg}})]})]})},{key:`columns`,title:`layout.layoutColumns`,render:e=>(0,R.jsxs)(`div`,{className:`flex`,children:[(0,R.jsx)(`div`,{className:`rounded-sm mr-1.5 w-3 h-24`,style:{background:e.colorPrimary}}),(0,R.jsx)(`div`,{className:`rounded-sm mr-1.5 w-6 h-24`,style:{background:e.colorPrimaryHover}}),(0,R.jsx)(`div`,{className:`rounded-sm flex-auto h-24`,style:{background:e.colorPrimaryBg}})]})}],gt=()=>{let{t:e}=M(),{token:t}=dt(),n=b(e=>e.themeDrawer),r=b(e=>e.setThemeDrawer),i=b(e=>e.setThemeConfig),a=b(e=>e.themeConfig),o=b(e=>e.layout),s=b(e=>e.setLayout),c=ut?.map(t=>({...t,label:e(t.label)}))||[],l=(0,ct.debounce)((e,t)=>{i({...a,[e]:t})},400,{leading:!0,trailing:!1});return(0,R.jsxs)(S,{styles:{body:{paddingTop:10}},placement:`right`,closable:!1,onClose:()=>r(!1),open:n,footer:(0,R.jsx)(`div`,{className:`flex w-full justify-between`,children:(0,R.jsx)(O,{onClick:()=>{i({...v,..._})},children:e(`layout.resetTheme`)})}),children:[(0,R.jsx)(k,{children:e(`layout.layoutStyle`)}),(0,R.jsx)(xe,{gutter:[20,20],children:ht.map(({key:n,title:r,render:i})=>(0,R.jsx)(be,{span:12,children:(0,R.jsx)(ae,{title:e(r),children:(0,R.jsx)(`div`,{className:`p-2 rounded-lg cursor-pointer`,style:{boxShadow:t.boxShadow,borderRadius:t.borderRadius,border:o===n?`2px solid ${t.colorPrimary}`:`2px solid transparent`},onClick:()=>s(n),children:i(t)})})},n))}),(0,R.jsx)(k,{children:e(`layout.presetTheme`)}),(0,R.jsxs)(xe,{gutter:20,onClick:e=>{let t=e.target.closest(`[data-theme]`);if(!t)return;let n=t.dataset.theme,r={dark:y,light:_};r[n]&&i({...a,...r[n]})},children:[mt.map(n=>(0,R.jsxs)(be,{span:8,className:`mb-2.5`,children:[(0,R.jsx)(`div`,{"data-theme":n.name,className:`cursor-pointer overflow-hidden border-solid`,style:{borderRadius:t.borderRadius,borderWidth:a.themeScheme===n.name?`2px`:`0px`,borderColor:a.themeScheme===n.name?t.colorPrimary:`transparent`},children:(0,R.jsx)(`img`,{src:n.background,alt:n.name})}),(0,R.jsx)(`div`,{className:`text-center mt-1.5`,children:e(n.title)})]},n.name)),(0,R.jsx)(be,{span:24,className:`mb-2.5`,children:(0,R.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,R.jsx)(`div`,{children:e(`layout.themeAlgorithm`)}),(0,R.jsx)(le,{value:a.algorithm,style:{width:160},onChange:e=>l(`algorithm`,e),options:c})]})})]}),(0,R.jsx)(k,{children:e(`layout.themeColor`)}),ft.map(({key:t,label:n})=>(0,R.jsxs)(`div`,{className:`flex justify-between items-center mb-2.5`,children:[(0,R.jsx)(`div`,{children:e(n)}),(0,R.jsx)(x,{showText:!0,value:a[t],onChange:e=>l(t,e.toCssString())})]},t)),(0,R.jsx)(k,{children:e(`layout.styleConfig`)}),pt.map(({key:t,label:n,type:r,...i})=>(0,R.jsxs)(`div`,{className:`flex justify-between items-center mb-2.5`,children:[(0,R.jsx)(`div`,{children:e(n)}),r===`switch`?(0,R.jsx)(De,{value:a[t],onChange:e=>l(t,e)}):(0,R.jsx)(C,{value:a[t],onChange:e=>l(t,e),...i})]},t))]})},_t=()=>{let{t:e}=M(),t=u(),n=b(e=>e.title),{menus:r}=B();return(0,P.useEffect)(()=>{let i=n||`Xin Admin`,a=z(r,t.pathname);if(!a){document.title=i;return}let o=a.local?e(a.local):a.name;o?document.title=o+` - `+i:document.title=i},[t.pathname,n,e,r]),null},{useToken:vt}=A,yt=()=>{let{t:e}=M(),{token:t}=vt(),n=m(),{menus:r,parentKey:i,collapsed:a,setParentKey:o,setSelectKey:s}=B(),c=b(e=>e.themeConfig),l=e=>{if(e.key&&(o(e.key),e.type!==`menu`)){if(s([e.key]),e.type===`route`&&e.link){window.open(e.path,`_blank`);return}if(e.type===`route`&&e.path){n(e.path);return}}};return(0,R.jsxs)(`div`,{className:`flex h-full`,children:[(0,R.jsx)(`div`,{className:`box-border shrink-0 h-full overflow-auto`,style:{borderRight:a?`none`:`1px solid `+c.colorBorder,width:79},children:r.filter(e=>e.hidden).map(n=>(0,R.jsxs)(`div`,{style:{backgroundColor:i===n.key?t.colorPrimaryBg:`transparent`,color:i===n.key?t.colorPrimary:c.siderColor},className:`flex items-center justify-center flex-col p-2 mb-2 pt-3 pb-3 cursor-pointer`,onClick:()=>l(n),children:[(0,R.jsx)(D,{name:n.icon,style:{fontSize:18}}),(0,R.jsx)(`span`,{className:`mt-1 truncate w-full text-center`,children:n.local?e(n.local):n.name})]},n.key))}),!a&&(0,R.jsx)(`div`,{className:`flex-1 h-full overflow-y-auto`,children:(0,R.jsx)(H,{})})]})},{Content:bt,Sider:xt}=L,St=()=>{let e=N(),t=b(e=>e.themeConfig),n=b(e=>e.layout),[r,i]=(0,P.useState)(226),{menus:a,collapsed:o,parentKey:s}=B();return(0,P.useEffect)(()=>{let e=t.siderWeight?t.siderWeight:226,r=n===`columns`?79:0,o=a.find(e=>e.key===s);[`mix`,`columns`].includes(n)?o?.children&&o?.children.length?i(r+e):i(r):i(e)},[t,n,a,s]),(0,R.jsxs)(L,{className:`min-h-screen`,style:{background:t.background},children:[(0,R.jsx)(_t,{}),(0,R.jsx)(gt,{}),(0,R.jsx)(it,{}),e&&(0,R.jsx)(st,{}),(0,R.jsxs)(L,{hasSider:!0,className:`relative`,children:[n!==`top`&&!e&&(0,R.jsx)(xt,{collapsed:o,width:r,style:{borderRight:`1px solid `+t.colorBorder,height:`calc(100vh - ${t.headerHeight}px)`,top:t.headerHeight,overflowY:`auto`,overflowX:`hidden`,position:`sticky`},children:n===`columns`?(0,R.jsx)(yt,{}):(0,R.jsx)(H,{})}),(0,R.jsxs)(L,{className:`min-w-0`,children:[(0,R.jsx)(bt,{style:{padding:t.bodyPadding},children:(0,R.jsx)(p,{})}),(0,R.jsx)(ot,{})]})]})]})},Ct=()=>(0,R.jsx)(et,{children:(0,R.jsx)(St,{})}),wt=Object.assign({"/web/pages/ai/agent/index.tsx":()=>d(()=>import(`./agent-BacKF2o-.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33])),"/web/pages/ai/chat/index.tsx":()=>d(()=>import(`./chat-CfnvY2VS.js`),__vite__mapDeps([34,1,2,3,35,36,33,4,5,6,7,8,9,21,10,15,11,12,13,14,16,17,18,19,20,23,24,25,26,37,38,39,40,41,42,43,44,45,46,47,30,48,49,50,51,31,32,52])),"/web/pages/ai/conversation/index.tsx":()=>d(()=>import(`./conversation-CgPPysYU.js`),__vite__mapDeps([53,1,2,33,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,29,31,91,92,26,93,28,30,94,95,96,97,98,42,99,100,36])),"/web/pages/client/banner.tsx":()=>d(()=>import(`./banner-CJe0agU6.js`),__vite__mapDeps([101,1,2,4,5,6,7,8,9,102,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,29,91,85,86,87,27,88,38,89,90,92,33,26,93,28,30,31,94,95,96,97,98,42,99,100,36])),"/web/pages/client/nav.tsx":()=>d(()=>import(`./nav-Dih5jXxX.js`),__vite__mapDeps([103,1,2,4,5,6,7,8,9,102,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,29,91,85,86,87,27,88,38,89,90,92,33,26,93,28,30,31,94,95,96,97,98,42,99,100,36])),"/web/pages/client/promo.tsx":()=>d(()=>import(`./promo-CfsZu-jA.js`),__vite__mapDeps([104,1,2,4,5,6,7,8,9,102,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,29,91,85,86,87,27,88,38,89,90,92,33,26,93,28,30,31,94,95,96,97,98,42,99,100,36])),"/web/pages/client/special.tsx":()=>d(()=>import(`./special-DQ_cXCQl.js`),__vite__mapDeps([105,1,2,33,4,5,6,7,8,9,15,11,12,55,40,41,21,10,22,56,44,58,20,14,16,17,18,19,61,62,24,63,102,54,25,39,57,37,45,59,60,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,29,91,85,86,87,27,88,38,89,90,92,26,93,28,30,31,94,95,96,97,98,42,99,100,36,106,107,108])),"/web/pages/customer/level.tsx":()=>d(()=>import(`./level-BCGrZbbc.js`),__vite__mapDeps([109,1,2,4,5,6,7,8,9,102,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,29,91,85,86,87,27,88,38,89,90,92,33,26,93,28,30,31,94,95,96,97,98,42,99,100,36])),"/web/pages/customer/notice.tsx":()=>d(()=>import(`./notice-DkzNYgG3.js`),__vite__mapDeps([110,1,2,4,5,6,7,8,9,29,18,19,15,12,91,54,21,10,14,16,17,24,20,11,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,92,33,26,93,28,30,31,94,95,96,97,98,42,99,100,36,111])),"/web/pages/customer/store.tsx":()=>d(()=>import(`./store-B-wG8BVA.js`),__vite__mapDeps([112,1,2,33,4,5,6,7,8,9,29,18,19,15,12,91,54,21,10,14,16,17,24,20,11,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,92,26,93,28,30,31,94,95,96,97,98,42,99,100,36])),"/web/pages/customer/supplier.tsx":()=>d(()=>import(`./supplier-D0qvu-sA.js`),__vite__mapDeps([113,1,2,4,5,6,7,8,9,29,18,19,15,12,91,54,21,10,14,16,17,24,20,11,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,92,33,26,93,28,30,31,94,95,96,97,98,42,99,100,36])),"/web/pages/dashboard/analysis.tsx":()=>d(()=>import(`./analysis-ChRcSk16.js`),__vite__mapDeps([114,1,2,33,85,19,5,21,10,24,12,11,55,9,15,6,40,41,22,56,44,39,86,62,87,27,88,45,8,38,89,90,66,67,47,26,93,63,37,115,29,18,30,71,49,81,82,31,97,116])),"/web/pages/dashboard/monitor.tsx":()=>d(()=>import(`./monitor-Dd1gBWfo.js`),__vite__mapDeps([117,2,1,10,5,23,24,25,26,15,93,63,37,118,19,55,9,6,40,41,21,22,56,44,27,89,90,30,71,49,31])),"/web/pages/dashboard/workplace.tsx":()=>d(()=>import(`./workplace-I8FwqFbs.js`),__vite__mapDeps([119,2,1,4,5,6,7,8,9,10,22,23,24,25,120,26,15,37,59,60,118,19,55,40,41,21,56,44,27,63,89,90,29,18,12,70,75,81,84,100,36,33,31])),"/web/pages/example/icon-selector.tsx":()=>d(()=>import(`./icon-selector-Dy7uWjj7.js`),__vite__mapDeps([121,1,2,4,5,6,7,8,9,10,92,33,54,21,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,26,93,28,29,30,31,94,95,96,97,98])),"/web/pages/example/image-uploader.tsx":()=>d(()=>import(`./image-uploader-DBHOFZqO.js`),__vite__mapDeps([122,1,2,4,5,6,7,8,9,10,11,12,26,15,61,14,16,62,24,63,94,33,58,20,21,17,18,19,41,64,95,46,96,67,48,68,31,97])),"/web/pages/example/user-selector.tsx":()=>d(()=>import(`./user-selector-C_7kHqFz.js`),__vite__mapDeps([123,1,2,4,5,6,7,8,9,10,92,33,54,21,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,26,93,28,29,30,31,94,95,96,97,98])),"/web/pages/example/xin-form.tsx":()=>d(()=>import(`./xin-form-CjpDqXrA.js`),__vite__mapDeps([124,1,2,4,5,6,7,8,9,10,11,12,92,33,54,21,14,15,16,17,18,19,24,20,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,26,93,28,29,30,31,94,95,96,97,98])),"/web/pages/example/xin-table.tsx":()=>d(()=>import(`./xin-table-Bw1qt43O.js`),__vite__mapDeps([125,2,1,11,12,29,5,18,19,15,72,91,54,21,10,14,9,16,17,6,24,20,40,41,55,22,56,44,25,39,57,37,45,8,58,59,60,61,62,63,43,46,7,64,65,66,67,47,48,68,69,70,71,49,50,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,92,33,26,93,28,30,31,94,95,96,97,98,42,99,100,36])),"/web/pages/exception/403.tsx":()=>d(()=>import(`./403-kF5cJUEE.js`),__vite__mapDeps([126,1,2,11,12,26,15,127,14,9,16,65])),"/web/pages/exception/404.tsx":()=>d(()=>import(`./404-CF76bH-T.js`),__vite__mapDeps([128,1,2,11,12,26,15,127,14,9,16,65])),"/web/pages/exception/500.tsx":()=>d(()=>import(`./500-pw04psNL.js`),__vite__mapDeps([129,1,2,11,12,26,15,127,14,9,16,65])),"/web/pages/login/index.tsx":()=>d(()=>import(`./login-CKGg-k4h.js`).then(e=>e.n),__vite__mapDeps([130,1,2,3,35,36,33,4,5,6,7,8,9,10,11,12,57,88,87,93,63,24,37,38,39,40,41,21,61,14,16,62,43,44,45,46,90,69,79,51,100,31])),"/web/pages/multi-menu/first.tsx":()=>d(()=>import(`./first-VYyrluR5.js`),__vite__mapDeps([131,2,1,10,5,11,12,132,56,39,40,41,21,26,15,93,63,24])),"/web/pages/multi-menu/second.tsx":()=>d(()=>import(`./second-urN6pQJ9.js`),__vite__mapDeps([133,2,1,10,5,11,12,132,56,39,40,41,21,26,15,93,63,24])),"/web/pages/multi-menu/third.tsx":()=>d(()=>import(`./third-CmYUgLWR.js`),__vite__mapDeps([134,2,1,10,5,11,12,132,56,39,40,41,21,26,15,93,63,24])),"/web/pages/order/store.tsx":()=>d(()=>import(`./store-Wda1wq7X.js`),__vite__mapDeps([135,1,2,33,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,92,85,86,87,27,88,38,89,90,26,93,28,29,30,31,94,95,96,97,98,136,102,137,91,42,99,100,36,111,116,138,108,139])),"/web/pages/page-layout/base-layout.tsx":()=>d(()=>import(`./base-layout-o2EQVE3N.js`),__vite__mapDeps([140,2,1,4,5,6,7,8,9,10,11,12,23,24,25,26,15,93,63,136,38,39,40,41,21,42,96,14,115,29,18,19,80,83,84,51])),"/web/pages/page-layout/descriptions.tsx":()=>d(()=>import(`./descriptions-DSR6x1nO.js`),__vite__mapDeps([141,2,1,4,5,6,7,8,9,85,19,21,10,24,12,11,55,15,40,41,22,56,44,39,86,62,87,27,88,45,38,89,90,66,67,47,23,25,26,93,63,37,59,136,42,142,29,18,68,73,78,83,51])),"/web/pages/page-layout/fix-header.tsx":()=>d(()=>import(`./fix-header-DIZqZWCz.js`),__vite__mapDeps([143,1,2,4,5,6,7,8,9,10,11,12,23,24,25,120,26,15,93,63,37,59,136,42,61,14,16,62,43,44,45,46,142,29,18,19,72,73,74,78])),"/web/pages/product/category.tsx":()=>d(()=>import(`./category-BQA8kSpc.js`),__vite__mapDeps([144,1,2,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,92,33,85,86,87,27,88,38,89,90,26,93,28,29,30,31,94,95,96,97,98,91,42,99,100,36,145])),"/web/pages/product/goods.tsx":()=>d(()=>import(`./goods-DDrxLa-h.js`),__vite__mapDeps([146,1,2,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,147,85,86,87,27,88,38,89,90,92,33,26,93,28,29,30,31,94,95,96,97,98,102,91,42,99,100,36,106,107,108,145,148])),"/web/pages/purchase/order.tsx":()=>d(()=>import(`./order-CzJfBGxK.js`),__vite__mapDeps([149,1,2,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,92,33,26,93,28,29,30,31,94,95,96,97,98,136,137,91,42,99,100,36,107,108,138,139,148,150])),"/web/pages/recon/bill.tsx":()=>d(()=>import(`./bill-qG3t0JUE.js`),__vite__mapDeps([151,1,2,33,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,92,26,93,28,29,30,31,94,95,96,97,98,136,91,42,99,100,36,108,111,116,139])),"/web/pages/recon/container-return.tsx":()=>d(()=>import(`./container-return-DT66R0pD.js`),__vite__mapDeps([152,1,2,4,5,6,7,8,9,11,12,55,15,40,41,21,10,22,56,44,57,92,33,54,14,16,17,18,19,24,20,25,39,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,26,93,28,29,30,31,94,95,96,97,98,91,42,99,100,36,108,111])),"/web/pages/recon/payment.tsx":()=>d(()=>import(`./payment-m5LFx4J0.js`),__vite__mapDeps([153,1,2,33,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,136,102,29,91,92,26,93,28,30,31,94,95,96,97,98,42,99,100,36,111,139])),"/web/pages/result/fail.tsx":()=>d(()=>import(`./fail-BFEpQBfc.js`),__vite__mapDeps([154,1,2,4,5,6,7,8,9,11,12,26,15,127,14,16,65,74])),"/web/pages/result/info.tsx":()=>d(()=>import(`./info-DmaRTlzJ.js`),__vite__mapDeps([155,1,2,11,12,26,15,127,14,9,16,65])),"/web/pages/result/success.tsx":()=>d(()=>import(`./success-BtLkPs9S.js`),__vite__mapDeps([156,1,2,11,12,26,15,127,14,9,16,65])),"/web/pages/result/warning.tsx":()=>d(()=>import(`./warning-D9M9NjTA.js`),__vite__mapDeps([157,1,2,11,12,26,15,127,14,9,16,65])),"/web/pages/system/ai.tsx":()=>d(()=>import(`./ai-BaBcitlo.js`),__vite__mapDeps([158,1,2,33,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,147,92,85,86,87,27,88,38,89,90,26,93,28,29,30,31,94,95,96,97,98])),"/web/pages/system/config.tsx":()=>d(()=>import(`./config-tH2RSZ-J.js`),__vite__mapDeps([159,1,2,33,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,92,85,86,87,27,88,38,89,90,26,93,28,29,30,31,94,95,96,97,98,137])),"/web/pages/system/dept.tsx":()=>d(()=>import(`./dept-wABp4Ul9.js`),__vite__mapDeps([160,1,2,33,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,147,85,86,87,27,88,38,89,90,92,26,93,28,29,30,31,94,95,96,97,98,137,99,100,36,150])),"/web/pages/system/dict/index.tsx":()=>d(()=>import(`./dict-j8wfnfhh.js`),__vite__mapDeps([161,1,2,3,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,120,31,162,36,33,91,85,86,87,27,88,38,89,90,92,26,93,28,29,30,94,95,96,97,98,42,99,100])),"/web/pages/system/dict/item.tsx":()=>d(()=>import(`./item-DyrMo47d.js`),__vite__mapDeps([163,1,2,3,4,5,6,7,8,9,10,11,12,40,120,57,92,33,54,21,14,15,16,17,18,19,24,20,41,55,22,56,44,25,39,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,26,93,28,29,30,31,94,95,96,97,98,91,42,99,100,36])),"/web/pages/system/file.tsx":()=>d(()=>import(`./file-BhqTJxRm.js`),__vite__mapDeps([164,1,2,33,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,92,26,93,28,29,30,31,94,95,96,97,98,136,102])),"/web/pages/system/info.tsx":()=>d(()=>import(`./info-CVHNTwj4.js`),__vite__mapDeps([165,2,1,4,5,6,7,8,9,23,24,25,26,15,37,60,142,12,29,18,19,76,79,51,31])),"/web/pages/system/mail.tsx":()=>d(()=>import(`./mail-ChpDRzPT.js`),__vite__mapDeps([166,1,2,33,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,92,85,86,87,27,88,38,89,90,26,93,28,29,30,31,94,95,96,97,98])),"/web/pages/system/role.tsx":()=>d(()=>import(`./role-D-VBhILf.js`),__vite__mapDeps([167,1,2,33,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,85,86,87,27,88,38,89,90,26,93,28,29,31,168,91,92,30,94,95,96,97,98,42,99,100,36])),"/web/pages/system/rule.tsx":()=>d(()=>import(`./rule-CqyTke2b.js`),__vite__mapDeps([169,1,2,33,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,120,28,29,31,162,36,168,91,85,86,87,27,88,38,89,90,92,26,93,30,94,95,96,97,98,42,99,100,150])),"/web/pages/system/storage.tsx":()=>d(()=>import(`./storage-DhJApafx.js`),__vite__mapDeps([170,1,2,33,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,92,85,86,87,27,88,38,89,90,26,93,28,29,30,31,94,95,96,97,98])),"/web/pages/system/user.tsx":()=>d(()=>import(`./user-Bt-PQ9Uv.js`),__vite__mapDeps([171,1,2,4,5,6,7,8,9,54,21,10,14,15,16,17,18,19,24,20,11,12,40,41,55,22,56,44,25,39,57,37,45,58,59,60,61,62,63,43,46,64,65,66,67,47,48,68,69,70,71,49,50,72,73,74,75,76,77,78,79,80,81,82,83,84,51,23,29,100,36,33,31,168,91,85,86,87,27,88,38,89,90,92,26,93,28,30,94,95,96,97,98,42,99,150])),"/web/pages/user/profile.tsx":()=>d(()=>import(`./profile-CGJ4n7jj.js`),__vite__mapDeps([172,1,2,4,5,6,7,8,9,10,11,12,23,24,25,57,86,62,87,26,15,61,14,16,63,43,44,45,46,118,19,55,40,41,21,22,56,27,89,90,64,17,29,18,95,96,67,48,68,73,74,75,77,51,100,36,33,31,173]))}),Tt=[`/login`];function Et(e){return(0,R.jsx)(P.Suspense,{fallback:null,children:(0,R.jsx)((0,P.lazy)(e),{})})}function Dt(){let e=[];for(let t in wt){let n=t.replace(`/web/pages`,``).replace(/\.tsx$/,``).replace(/\/index$/,``);n||=`/`,!Tt.includes(n)&&e.push({id:n,path:n,element:Et(wt[t])})}return e}function Ot(){return f([{Component:Ct,children:[...Dt(),{path:`*`,element:Et(wt[`/web/pages/result/404.tsx`])}]},{path:`/`,element:(0,R.jsx)(g,{to:`/dashboard/analysis`})},{path:`login`,element:(0,R.jsx)(Le,{})}])}function kt(){let{message:e,modal:t,notification:n}=ce.useApp();return window.$message=e,window.$modal=t,window.$notification=n,null}var At=({children:e})=>{let t=b(e=>e.themeConfig),{antdLocale:n}=Fe();return(0,R.jsx)(oe,{theme:(0,P.useMemo)(()=>({components:{Layout:{headerPadding:`0 `+t.headerPadding+`px`,headerHeight:t.headerHeight,bodyBg:t.bodyBg,footerBg:t.footerBg,headerBg:t.headerBg,headerColor:t.headerColor,siderBg:t.siderBg,footerPadding:0},Menu:{activeBarBorderWidth:0,itemBg:`transparent`,subMenuItemBg:`transparent`}},token:{colorPrimary:t.colorPrimary,colorBgBase:t.colorBg,colorTextBase:t.colorText,colorError:t.colorError,colorInfo:t.colorPrimary,colorLink:t.colorPrimary,colorSuccess:t.colorSuccess,colorWarning:t.colorWarning,borderRadius:t.borderRadius,controlHeight:t.controlHeight},algorithm:t.algorithm?lt[t.algorithm]:void 0}),[t]),locale:n,children:(0,R.jsxs)(ce,{children:[(0,R.jsx)(kt,{}),e]})})},jt=()=>{let{changeLanguage:e}=Fe(),t=j(e=>e.info),n=b(e=>e.initWebInfo),r=Re(e=>e.initDict),[i,a]=(0,P.useState)(),o=async()=>{n(),await r(),await e(localStorage.getItem(`i18nextLng`)||`zh`),localStorage.getItem(`token`)?await t():window.location.pathname!==`/login`&&(window.location.href=`/login`)};return(0,P.useEffect)(()=>{o(),a(Ot())},[]),(0,R.jsx)(At,{children:i&&(0,R.jsx)(h,{router:i})})},U=e=>typeof e==`string`,W=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},Mt=e=>e==null?``:``+e,Nt=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},Pt=/###/g,Ft=e=>e&&e.indexOf(`###`)>-1?e.replace(Pt,`.`):e,It=e=>!e||U(e),G=(e,t,n)=>{let r=U(t)?t.split(`.`):t,i=0;for(;i{let{obj:r,k:i}=G(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=G(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=G(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},Rt=(e,t,n,r)=>{let{obj:i,k:a}=G(e,t,Object);i[a]=i[a]||[],i[a].push(n)},K=(e,t)=>{let{obj:n,k:r}=G(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},zt=(e,t,n)=>{let r=K(e,n);return r===void 0?K(t,n):r},Bt=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?U(e[r])||e[r]instanceof String||U(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Bt(e[r],t[r],n):e[r]=t[r]);return e},q=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),Vt={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`,"/":`/`},Ht=e=>U(e)?e.replace(/[&<>"'\/]/g,e=>Vt[e]):e,Ut=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},Wt=[` `,`,`,`?`,`!`,`;`],Gt=new Ut(20),Kt=(e,t,n)=>{t||=``,n||=``;let r=Wt.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=Gt.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},qt=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e-1&&oe?.replace(/_/g,`-`),Jt={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},Y=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||Jt,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(U(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},X=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r{for(let i=0;i-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.indexOf(`.`)>-1?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):U(n)&&i?o.push(...n.split(i)):o.push(n)));let s=K(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!U(n)?s:qt(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.indexOf(`.`)>-1&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),Lt(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(U(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(`.`)>-1&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=K(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Bt(s,n,i):s={...s,...n},Lt(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},Xt={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},Zt=Symbol(`i18next/PATH_KEY`);function Qt(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===Zt?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function Z(e,t){let{[Zt]:n}=e(Qt()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`;if(n.length>1&&i){let e=t?.ns,a=Array.isArray(e)?e:null;if(a&&a.length>1&&a.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var $t={},en=e=>!U(e)&&typeof e!=`boolean`&&typeof e!=`number`,tn=class e extends X{constructor(e,t={}){super(),Nt([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=Y.create(`translator`)}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=en(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!Kt(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:U(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:U(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=Z(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?Z(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!U(i.count),x=e.hasDefaultValue(i),S=b?this.pluralResolver.getSuffix(d,i.count,i):``,ee=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,C=b&&!i.ordinal&&i.count===0,w=C&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${ee}`]||i.defaultValue,T=m;y&&!m&&x&&(T=w);let E=en(T),te=Object.prototype.toString.apply(T);if(y&&T&&E&&_.indexOf(te)<0&&!(U(v)&&Array.isArray(T))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,T,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(T),t=e?[]:{},n=e?g:h;for(let e in T)if(Object.prototype.hasOwnProperty.call(T,e)){let r=`${n}${o}${e}`;x&&!m?t[e]=this.translate(r,{...i,defaultValue:en(w)?w[e]:void 0,joinArrays:!1,ns:c}):t[e]=this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=T[e])}m=t}}else if(y&&U(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=w),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&w!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,s,c?w:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);C&&i[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||w)})}):n(e,s,w))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=U(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!U(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;oi?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=U(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=Xt.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return U(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?Z(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!U(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(U(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!$t[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&($t[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.indexOf(i)===0&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.indexOf(i)===0&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!U(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.substring(0,12)===`defaultValue`&&e[t]!==void 0)return!0;return!1}},nn=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Y.create(`languageUtils`)}getScriptPartFromCode(e){if(e=J(e),!e||e.indexOf(`-`)<0)return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=J(e),!e||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(U(e)&&e.indexOf(`-`)>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>{if(e===r||!(e.indexOf(`-`)<0&&r.indexOf(`-`)<0)&&(e.indexOf(`-`)>0&&r.indexOf(`-`)<0&&e.substring(0,e.indexOf(`-`))===r||e.indexOf(r)===0&&r.length>1))return e})}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),U(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return U(e)&&(e.indexOf(`-`)>-1||e.indexOf(`_`)>-1)?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):U(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}},rn={zero:0,one:1,two:2,few:3,many:4,other:5},an={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},on=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=Y.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=J(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),an;if(!e.match(/-|_/))return an;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>rn[e]-rn[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},sn=(e,t,n,r=`.`,i=!0)=>{let a=zt(e,t,n);return!a&&i&&U(n)&&(a=qt(e,n,r),a===void 0&&(a=qt(t,n,r))),a},cn=e=>e.replace(/\$/g,`$$$$`),ln=class{constructor(e={}){this.logger=Y.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?Ht:t,this.escapeValue=n===void 0||n,this.useRawValueToEscape=r!==void 0&&r,this.prefix=i?q(i):a||`{{`,this.suffix=o?q(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?q(d):f||q(`$t(`),this.nestingSuffix=p?q(p):m||q(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_!==void 0&&_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){let i=sn(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(sn(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp();let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>cn(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?cn(this.escape(e)):cn(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=U(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``;else!U(a)&&!this.useRawValueToEscape&&(a=Mt(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;let r=e.split(RegExp(`${q(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!U(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!U(i))return i;U(i)||(i=Mt(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},un=e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf(`(`)>-1){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].substring(0,r[1].length-1);t===`currency`&&i.indexOf(`:`)<0?n.currency||=i.trim():t===`relativetime`&&i.indexOf(`:`)<0?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},dn=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(J(r),i),t[o]=s),s(n)}},fn=e=>(t,n,r)=>e(J(n),r)(t),pn=class{constructor(e={}){this.logger=Y.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?dn:fn;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=dn(t)}format(e,t,n,r={}){let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&i[0].indexOf(`)`)<0&&i.find(e=>e.indexOf(`)`)>-1)){let e=i.findIndex(e=>e.indexOf(`)`)>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=un(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}},mn=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},hn=class extends X{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=Y.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{Rt(n.loaded,[i],a),mn(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r{this.read.call(this,e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();U(e)&&(e=this.languageUtils.toResolveHierarchy(e)),U(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(!(n==null||n===``)){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},gn=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,simplifyPluralSuffix:!0,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),U(e[1])&&(t.defaultValue=e[1]),U(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),_n=e=>(U(e.ns)&&(e.ns=[e.ns]),U(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),U(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.(`cimode`)<0&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),typeof e.initImmediate==`boolean`&&(e.initAsync=e.initImmediate),e),Q=()=>{},vn=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},yn=`__i18next_supportNoticeShown`,bn=()=>!!(typeof globalThis<`u`&&globalThis[yn]||typeof process<`u`&&{}.I18NEXT_NO_SUPPORT_NOTICE||typeof process<`u`),xn=()=>{typeof globalThis<`u`&&(globalThis[yn]=!0)},Sn=e=>!!(e?.modules?.backend?.name?.indexOf(`Locize`)>0||e?.modules?.backend?.constructor?.name?.indexOf(`Locize`)>0||e?.options?.backend?.backends&&e.options.backend.backends.some(e=>e?.name?.indexOf(`Locize`)>0||e?.constructor?.name?.indexOf(`Locize`)>0)||e?.options?.backend?.projectId||e?.options?.backend?.backendOptions&&e.options.backend.backendOptions.some(e=>e?.projectId)),$=class e extends X{constructor(e={},t){if(super(),this.options=_n(e),this.services={},this.logger=Y,this.modules={external:[]},vn(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(U(e.ns)?e.defaultNS=e.ns:e.ns.indexOf(`translation`)<0&&(e.defaultNS=e.ns[0]));let n=gn();this.options={...n,...this.options,..._n(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!Sn(this)&&!bn()&&(typeof console<`u`&&console.info!==void 0&&console.info(`🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙`),xn());let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?Y.init(r(this.modules.logger),this.options):Y.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:pn;let t=new nn(this.options);this.store=new Yt(this.options.resources,this.options);let i=this.services;i.logger=Y,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new on(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`),e&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(i.formatter=r(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new ln(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new hn(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new tn(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=Q,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=W(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),i.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=Q){let n=t,r=U(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&e.indexOf(t)<0&&e.push(t)})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=W();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=Q,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&Xt.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!([`cimode`,`dev`].indexOf(e)>-1)){for(let e=0;e-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=W();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=U(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(U(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n){let r=(e,t,...i)=>{let a;a=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(i)),a.lng=a.lng||r.lng,a.lngs=a.lngs||r.lngs,a.ns=a.ns||r.ns,a.keyPrefix!==``&&(a.keyPrefix=a.keyPrefix||n||r.keyPrefix);let o={...this.options,...a};typeof a.keyPrefix==`function`&&(a.keyPrefix=Z(a.keyPrefix,o));let s=this.options.keySeparator||`.`,c;return a.keyPrefix&&Array.isArray(e)?c=e.map(e=>(typeof e==`function`&&(e=Z(e,o)),`${a.keyPrefix}${s}${e}`)):(typeof e==`function`&&(e=Z(e,o)),c=a.keyPrefix?`${a.keyPrefix}${s}${e}`:e),this.t(c,a)};return U(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=W();return this.options.ns?(U(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=W();U(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services?.languageUtils||new nn(gn());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=Q){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new Yt(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...gn().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new ln(n)}return a.translator=new tn(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();$.createInstance,$.dir,$.init,$.loadResources,$.reloadResources,$.use,$.changeLanguage,$.getFixedT,$.t,$.exists,$.setDefaultNamespace,$.hasLoadedNamespace,$.loadNamespaces,$.loadLanguages;var Cn={"menu.dashboard":`Dashboard`,"menu.analysis":`Analysis`,"menu.monitor":`Monitor`,"menu.workplace":`Workplace`,"menu.result":`Results`,"menu.result.success":`Success`,"menu.result.fail":`Failure`,"menu.result.warning":`Warning`,"menu.result.info":`Information`,"menu.exception":`Exceptions`,"menu.exception.403":`403`,"menu.exception.404":`404`,"menu.exception.500":`500`,"menu.multi-menu":`Multi-level Menu`,"menu.multi-menu.two":`Level 2`,"menu.multi-menu.first":`Level 2 Page`,"menu.multi-menu.two.three":`Level 3`,"menu.multi-menu.two.second":`Level 3 Page`,"menu.multi-menu.two.three.third":`Level 4`,"menu.page-layout":`Layouts`,"menu.page-layout.base-layout":`Basic Layout`,"menu.page-layout.fix-header":`Fixed Header`,"menu.page-layout.descriptions":`Descriptions`,"menu.example":`Examples`,"menu.example.user-selector":`User Selector`,"menu.example.icon-selector":`Icon Selector`,"menu.example.image-uploader":`Image Upload`,"menu.example.xin-form":`Xin Form`,"menu.example.xin-table":`Xin Table`,"menu.ai":`AI`,"menu.ai.chat":`Chat`,"menu.ai.agent":`Agents`,"menu.ai.conversation":`Conversations`,"menu.system":`System`,"menu.system.user":`Users`,"menu.system.dept":`Departments`,"menu.system.role":`Roles`,"menu.system.rule":`Menus`,"menu.system.info":`System Information`,"menu.system.file":`Files`,"menu.system.dict":`Dictionaries`,"menu.system.mail":`Mail`,"menu.system.storage":`Storage`,"menu.system.config":`Site Config`,"menu.system.ai":`AI`,"menu.xin-admin":`XinAdmin`},wn={"login.username":`Username`,"login.password":`Password`,"login.usernamePlaceholder":`admin`,"login.passwordPlaceholder":`123456`,"login.usernameRequired":`Please enter your username!`,"login.passwordRequired":`Please enter your password!`,"login.remember":`Remember me`,"login.forgotPassword":`Forgot password`,"login.otherLogin":`Other login methods`,"login.success":`Login successful!`,"login.alreadyLoggedIn":`Already logged in, redirecting!`},Tn={"dashboard.analysis.salesAmount":`Sales`,"dashboard.analysis.orderCount":`Orders`,"dashboard.analysis.purchaseAmount":`Purchases`,"dashboard.analysis.receivable":`Receivable`,"dashboard.analysis.today":`Today`,"dashboard.analysis.thisWeek":`Last 7 days`,"dashboard.analysis.vsLastWeek":`vs last week`,"dashboard.analysis.totalBillAmount":`Total billed`,"dashboard.analysis.receivedAmount":`Received`,"dashboard.analysis.salesTrend":`Sales Trend (Last 30 Days)`,"dashboard.analysis.amountAxis":`Amount`,"dashboard.analysis.ordersAxis":`Orders`,"dashboard.analysis.emptyTrend":`No orders in the last 30 days`,"dashboard.analysis.orderStatusDistribution":`Order Status`,"dashboard.analysis.orderUnit":``,"dashboard.analysis.categorySales":`Sales by Category`,"dashboard.analysis.emptyCategory":`No sales data`,"dashboard.analysis.topProducts":`Top 10 Products`,"dashboard.analysis.rank":`Rank`,"dashboard.analysis.productName":`Product`,"dashboard.analysis.quantity":`Qty`,"dashboard.analysis.amount":`Amount`,"dashboard.analysis.topStores":`Top 10 Stores`,"dashboard.analysis.storeName":`Store`,"dashboard.analysis.reconOverview":`Reconciliation & Payment`,"dashboard.analysis.billProgress":`Bill Payment Progress`,"dashboard.analysis.pendingPaymentReview":`Payments to Review`,"dashboard.analysis.pendingPaymentTip":`Payment vouchers submitted by stores, pending review`,"dashboard.analysis.billUnit":``,"dashboard.analysis.latestOrders":`Latest Orders`,"dashboard.analysis.orderNo":`Order No.`,"dashboard.analysis.store":`Store`,"dashboard.analysis.orderDate":`Date`,"dashboard.analysis.status":`Status`,"dashboard.analysis.archivesStores":`Active Stores`,"dashboard.analysis.archivesProducts":`On-sale Products`,"dashboard.analysis.archivesSuppliers":`Suppliers`},En={"dashboard.completion":`Completion`,"dashboard.vs.lastWeek":`vs last week`,"dashboard.monitor.helpService":`Help Service`,"dashboard.monitor.propertyFee":`Property Fee`,"dashboard.monitor.alarmEvents":`Alarm Events`,"dashboard.monitor.otherEvents":`Other Events`,"dashboard.monitor.todoList":`To-Do List`,"dashboard.monitor.myFocus":`My Focus`,"dashboard.monitor.all":`All`,"dashboard.monitor.propertyOrder":`Property Orders`,"dashboard.monitor.repairOrder":`Repair Orders`,"dashboard.monitor.fireSafety":`Fire Safety`,"dashboard.monitor.paidService":`Paid Services`,"dashboard.monitor.publicService":`Public Services`},Dn={"dashboard.workplace.greeting.morning":`Good Morning`,"dashboard.workplace.greeting.afternoon":`Good Afternoon`,"dashboard.workplace.greeting.evening":`Good Evening`,"dashboard.workplace.welcome":`Welcome back!`,"dashboard.workplace.today":`Today is`,"dashboard.workplace.myProjects":`My Projects`,"dashboard.workplace.myTeams":`My Teams`,"dashboard.workplace.latestActivities":`Latest Activities`,"dashboard.workplace.notifications":`Notifications`,"dashboard.workplace.appStore":`App Store`,"dashboard.workplace.appStore.desc":`Application distribution and management platform`,"dashboard.workplace.mallSystem":`Mall System`,"dashboard.workplace.mallSystem.desc":`Enterprise e-commerce solution`,"dashboard.workplace.collaboration":`Collaboration`,"dashboard.workplace.collaboration.desc":`Team collaboration and communication tools`,"dashboard.workplace.docCenter":`Document Center`,"dashboard.workplace.docCenter.desc":`Enterprise knowledge management and document collaboration`,"dashboard.workplace.badge.new":`New`,"dashboard.workplace.status.inProgress":`In Progress`,"dashboard.workplace.status.completed":`Completed`,"dashboard.workplace.status.planning":`Planning`,"dashboard.workplace.progress":`Progress`,"dashboard.workplace.members":`Members`,"dashboard.workplace.people":`people`,"dashboard.workplace.recentVisits":`Recent Visits`,"dashboard.workplace.location":`Local`,"dashboard.workplace.project1.name":`Enterprise Management System`,"dashboard.workplace.project1.desc":`Enterprise backend management system based on React and AntDesign`,"dashboard.workplace.project2.name":`Mobile H5 Application`,"dashboard.workplace.project2.desc":`Mobile e-commerce application developed with Vue3`,"dashboard.workplace.project3.name":`Data Visualization Platform`,"dashboard.workplace.project3.desc":`Big data visualization and analysis platform based on ECharts`,"dashboard.workplace.project4.name":`System Upgrade Notice`,"dashboard.workplace.project4.desc":`System will be upgraded and maintained from 2:00-4:00 AM this Friday`,"dashboard.workplace.project5.name":`Team Invitation`,"dashboard.workplace.project5.desc":`You have been invited to join the "New Product R&D" project team`,"dashboard.workplace.project6.name":`Task Reminder`,"dashboard.workplace.project6.desc":`You have 3 tasks that are about to expire, please handle them in time`},On={"system.info.title":`System Info`,"system.info.basic.title":`System Basic Info`,"system.info.project.title":`Project Address`,"system.info.changelog.title":`Changelog`,"system.info.author.title":`Author Introduction`,"system.info.desc.title":`System Description`,"system.info.join":`Join the community for updates and support`,"system.info.label.name":`System Name`,"system.info.label.version":`Version`,"system.info.label.build":`Build Tool`,"system.info.label.frontend":`Frontend Framework`,"system.info.label.ui":`UI Framework`,"system.info.label.css":`CSS Framework`,"system.info.label.router":`Router Management`,"system.info.label.state":`State Management`,"system.info.label.ts":`TypeScript`,"system.info.link.github":`GitHub Repository`,"system.info.link.docs":`Online Documentation`,"system.info.link.demo":`Demo Address`,"system.info.link.issues":`Issues & Feedback`,"system.info.log.content":`Refactored project modules based on React 19, Vite 7, ReactRouter 7, zustand 5, and TypeScript`,"system.info.author.name":`XinAdmin Team`,"system.info.author.role":`Enterprise-level Admin Solution Provider`,"system.info.contact.github":`GitHub`,"system.info.contact.group":`QQ Group`,"system.info.contact.discuss":`Discussions`,"system.info.desc.content":`XinAdmin is an enterprise-level admin template based on Ant Design design specifications, adopting the latest frontend tech stack including React 19, Vite 7, ReactRouter 7, zustand 5, and TypeScript. Core Features: ✨ Cutting-edge Stack - React 19 + Vite 7 + TypeScript 5.8 diff --git a/public/index.html b/public/index.html index 72eacd8..1245853 100644 --- a/public/index.html +++ b/public/index.html @@ -5,7 +5,7 @@ XinAdmin - + diff --git a/tests/Feature/BillExportTest.php b/tests/Feature/BillExportTest.php index f2c0806..3ae4211 100644 --- a/tests/Feature/BillExportTest.php +++ b/tests/Feature/BillExportTest.php @@ -12,8 +12,8 @@ use App\Models\StoreOrderItemModel; use Maatwebsite\Excel\Facades\Excel; /** - * 门店账单合并导出:跨账单按商品合并明细(加权平均单价)/ 一级分类过滤 / - * 配送费与附加金额全额汇总 / ids 校验 / 权限拦截 / 分类下无明细拒绝 + * 门店账单单独导出:账单内按商品合并明细(加权平均单价)/ 一级分类过滤 / + * 费用行取账单自身字段 / 权限拦截 / 账单不存在 / 分类下无明细拒绝 / 小程序端本店口径 */ class BillExportTest extends ProcurementTestCase { @@ -60,43 +60,44 @@ class BillExportTest extends ProcurementTestCase ]); } - /** 跨账单合并:同商品数量累加、单价加权平均,配送费/附加/总金额全额汇总 */ - public function test_export_merges_items_across_bills(): void + /** 单独导出:账单内同商品合并(数量累加、单价加权平均),费用行取账单自身字段 */ + public function test_export_merges_items_within_bill(): void { - $this->freezeTime(); - $root = ProductCategoryModel::create(['name' => '蔬菜', 'parent_id' => 0, 'sort' => 0, 'status' => 1]); $store = StoreModel::factory()->create(); $productA = ProductModel::factory()->create(['category_id' => $root->id]); $productB = ProductModel::factory()->create(['category_id' => $root->id]); - $bill1 = $this->makeBill($store); - $bill2 = $this->makeBill($store, ['after_sale' => '-8.00']); - // 同一商品跨账单:10×2.00 + 6×3.00 → 数量 16、金额 38.00、加权单价 2.37 - $this->makeItem($bill1, $productA, 10, '2.00'); - $this->makeItem($bill2, $productA, 6, '3.00'); - $this->makeItem($bill2, $productB, 4, '5.00'); + $bill = $this->makeBill($store, ['after_sale' => '-8.00']); + // 同一商品两条明细:10×2.00 + 6×3.00 → 数量 16、金额 38.00、加权单价 2.37 + $this->makeItem($bill, $productA, 10, '2.00'); + $this->makeItem($bill, $productA, 6, '3.00'); + $this->makeItem($bill, $productB, 4, '5.00'); $this->actingAsSysUser(); Excel::fake(); - $this->get("/recon/bill/export?ids={$bill1->id},{$bill2->id}")->assertOk(); + $this->get("/recon/bill/{$bill->id}/export")->assertOk(); Excel::assertDownloaded( - '门店账单_' . now()->format('Ymd_His') . '.xlsx', - static function (BillExport $export) use ($productA, $productB): bool { + '门店账单_' . $bill->bill_no . '.xlsx', + static function (BillExport $export) use ($bill, $productA, $productB): bool { $rows = $export->collection()->values(); - // 标题1 + 范围2 + 空行1 + 列头1 + 明细2 + 合计5 = 12 行 - if ($rows->count() !== 12) { + // 标题1 + 范围1 + 空行1 + 列头1 + 明细2 + 合计5 = 11 行 + if ($rows->count() !== 11) { + return false; + } + // 标题行含账单号 + if (! str_contains((string) $rows[0][0], $bill->bill_no)) { return false; } - $details = $rows->slice(5, 2)->values(); + $details = $rows->slice(4, 2)->values(); $rowA = $details->firstWhere(1, $productA->name); $rowB = $details->firstWhere(1, $productB->name); if ($rowA === null || $rowB === null) { return false; } - // 跨账单同商品合并:数量 16、加权单价 2.37、金额 38.00 + // 账单内同商品合并:数量 16、加权单价 2.37、金额 38.00 if ((float) $rowA[4] !== 2.37 || (int) $rowA[5] !== 16 || (float) $rowA[7] !== 38.0) { return false; } @@ -104,31 +105,29 @@ class BillExportTest extends ProcurementTestCase return false; } - $summary = $rows->slice(7)->values(); - // 合计:数量 20、商品金额 58.00;配送费 20.00;附加 60.00(筐 4 / 托盘 2);售后 -8.00;总金额 130.00 + $summary = $rows->slice(6)->values(); + // 合计:数量 20、商品金额 58.00;配送费 10.00;附加 30.00(筐 2 / 托盘 1);售后 -8.00;总金额 90.00 if ((int) $summary[0][5] !== 20 || (float) $summary[0][7] !== 58.0) { return false; } - if ($summary[1][0] !== '配送费合计' || (float) $summary[1][7] !== 20.0) { + if ($summary[1][0] !== '配送费' || (float) $summary[1][7] !== 10.0) { return false; } - if (! str_contains((string) $summary[2][0], '筐 4 个 / 周转托盘 2 个') || (float) $summary[2][7] !== 60.0) { + if (! str_contains((string) $summary[2][0], '筐 2 个 / 周转托盘 1 个') || (float) $summary[2][7] !== 30.0) { return false; } - if (! str_contains((string) $summary[3][0], '售后金额合计') || (float) $summary[3][7] !== -8.0) { + if (! str_contains((string) $summary[3][0], '售后金额') || (float) $summary[3][7] !== -8.0) { return false; } - return (float) $summary[4][7] === 130.0; + return (float) $summary[4][7] === 90.0; } ); } - /** 一级分类过滤:子分类商品归入根分类,其他分类商品忽略;费用行仍全额汇总 */ + /** 一级分类过滤:子分类商品归入根分类,其他分类商品忽略;费用行仍全额计入 */ public function test_export_filters_by_root_category(): void { - $this->freezeTime(); - $vegRoot = ProductCategoryModel::create(['name' => '蔬菜', 'parent_id' => 0, 'sort' => 0, 'status' => 1]); $vegChild = ProductCategoryModel::create(['name' => '叶菜类', 'parent_id' => $vegRoot->id, 'sort' => 0, 'status' => 1]); $meatRoot = ProductCategoryModel::create(['name' => '肉禽蛋', 'parent_id' => 0, 'sort' => 1, 'status' => 1]); @@ -143,23 +142,23 @@ class BillExportTest extends ProcurementTestCase $this->actingAsSysUser(); Excel::fake(); - $this->get("/recon/bill/export?ids={$bill->id}&category_id={$vegRoot->id}")->assertOk(); + $this->get("/recon/bill/{$bill->id}/export?category_id={$vegRoot->id}")->assertOk(); Excel::assertDownloaded( - '门店账单_' . now()->format('Ymd_His') . '.xlsx', + '门店账单_' . $bill->bill_no . '.xlsx', static function (BillExport $export) use ($veg): bool { $rows = $export->collection()->values(); // 范围行标注所选分类 - if (! str_contains((string) $rows[2][0], '分类:蔬菜')) { + if (! str_contains((string) $rows[1][0], '分类:蔬菜')) { return false; } // 明细仅剩蔬菜(子分类归入根分类),肉禽被忽略 - $detail = $rows->slice(5, 1)->values()->first(); + $detail = $rows->slice(4, 1)->values()->first(); if ($detail === null || $detail[1] !== $veg->name) { return false; } - $summary = $rows->slice(6)->values(); + $summary = $rows->slice(5)->values(); // 商品金额合计 20.00(仅蔬菜);配送费 10.00 / 附加 30.00 / 售后 0.00 全额;总金额 60.00 if ((float) $summary[0][7] !== 20.0) { return false; @@ -186,7 +185,7 @@ class BillExportTest extends ProcurementTestCase $this->makeItem($bill, $meat, 5, '20.00'); $this->actingAsSysUser(); - $this->get("/recon/bill/export?ids={$bill->id}&category_id={$vegRoot->id}") + $this->get("/recon/bill/{$bill->id}/export?category_id={$vegRoot->id}") ->assertJsonPath('success', false); } @@ -202,30 +201,22 @@ class BillExportTest extends ProcurementTestCase // 仅持有查询权限的用户 $this->actingAsSysUser(['recon.bill.query']); - $response = $this->get("/recon/bill/export?ids={$bill->id}"); + $response = $this->get("/recon/bill/{$bill->id}/export"); $this->assertFalse($response->json('success'), '缺少权限点应被拦截'); } - /** ids 缺失 / 超 100 张 / 账单不存在 → 拒绝 */ - public function test_export_invalid_ids_rejected(): void + /** 账单不存在 → 拒绝 */ + public function test_export_bill_not_found_rejected(): void { $this->actingAsSysUser(); - $this->get('/recon/bill/export') - ->assertJsonPath('success', false); - - $this->get('/recon/bill/export?ids=' . implode(',', range(1, 101))) - ->assertJsonPath('success', false); - - $this->get('/recon/bill/export?ids=99999') + $this->get('/recon/bill/99999/export') ->assertJsonPath('success', false); } - /** 小程序端导出:强制本店过滤,混入他店账单整批拒绝 */ + /** 小程序端导出:强制本店过滤,他店账单拒绝 */ public function test_mini_export_scoped_to_own_store(): void { - $this->freezeTime(); - $root = ProductCategoryModel::create(['name' => '蔬菜', 'parent_id' => 0, 'sort' => 0, 'status' => 1]); $storeA = StoreModel::factory()->create(); $storeB = StoreModel::factory()->create(); @@ -234,28 +225,23 @@ class BillExportTest extends ProcurementTestCase $billA = $this->makeBill($storeA); $billB = $this->makeBill($storeB); $this->makeItem($billA, $product, 10, '2.00'); - $this->makeItem($billB, $product, 5, '20.00'); $this->actingAsMiniStore($storeA); // 本店账单正常导出 Excel::fake(); - $this->get("/mini/bill/export?ids={$billA->id}")->assertOk(); + $this->get("/mini/bill/{$billA->id}/export")->assertOk(); Excel::assertDownloaded( - '门店账单_' . now()->format('Ymd_His') . '.xlsx', + '门店账单_' . $billA->bill_no . '.xlsx', static function (BillExport $export): bool { $rows = $export->collection()->values(); - // 明细仅本店账单的 1 行(他店账单未混入) - return $rows->count() === 11; + // 标题1 + 范围1 + 空行1 + 列头1 + 明细1 + 合计5 = 10 行 + return $rows->count() === 10; } ); - // 混入他店账单 → 张数不匹配整批拒绝 - $this->get("/mini/bill/export?ids={$billA->id},{$billB->id}") - ->assertJsonPath('success', false); - - // 仅他店账单 → 本店口径查无账单 - $this->get("/mini/bill/export?ids={$billB->id}") + // 他店账单 → 本店口径查无账单 + $this->get("/mini/bill/{$billB->id}/export") ->assertJsonPath('success', false); } } diff --git a/web/api/recon/bill.ts b/web/api/recon/bill.ts index 485f238..02b7d65 100644 --- a/web/api/recon/bill.ts +++ b/web/api/recon/bill.ts @@ -19,11 +19,7 @@ export async function payBill(id: number, data: { paid_at: string; pay_remark?: }); } -/** 合并导出账单:勾选账单跨账单按商品合并明细,可按一级分类过滤 */ -export async function exportBills(ids: number[], categoryId: number) { - return downloadBlob( - '/recon/bill/export', - { ids: ids.join(','), category_id: categoryId }, - '门店账单.xlsx' - ); +/** 单独导出账单:账单内明细按商品合并为一个 Excel */ +export async function exportBill(id: number) { + return downloadBlob(`/recon/bill/${id}/export`, {}, '门店账单.xlsx'); } diff --git a/web/pages/recon/bill.tsx b/web/pages/recon/bill.tsx index 9edcbd5..65f255a 100644 --- a/web/pages/recon/bill.tsx +++ b/web/pages/recon/bill.tsx @@ -8,7 +8,6 @@ import { Input, message, Modal, - Select, Table, Tag, Typography, @@ -25,9 +24,8 @@ import type { import type { IBill, IBillDetail, IBillGoodsItem, IBillOrder } from '@/domain/iBill.ts'; import { BILL_STATUS_MAP } from '@/domain/iBill.ts'; import { STORE_ORDER_STATUS_MAP } from '@/domain/iStoreOrder.ts'; -import { exportBills, getBillDetail, payBill } from '@/api/recon/bill.ts'; +import { exportBill, getBillDetail, payBill } from '@/api/recon/bill.ts'; import { getStoreOptions } from '@/api/customer/store.ts'; -import { getCategoryTree } from '@/api/product/category.ts'; import type IStore from '@/domain/iStore.ts'; import AuthButton from '@/components/AuthButton'; @@ -55,20 +53,11 @@ const BillPage: React.FC = () => { const [paySaving, setPaySaving] = useState(false); const [payForm] = Form.useForm(); - // 合并导出(勾选账单跨账单按商品合并明细,可按一级分类过滤) - const [selectedRowKeys, setSelectedRowKeys] = useState([]); - const [exportOpen, setExportOpen] = useState(false); - const [exporting, setExporting] = useState(false); - const [categoryId, setCategoryId] = useState(0); - const [topCategories, setTopCategories] = useState<{ value: number; label: string }[]>([]); + // 单独导出(每行一张账单,账单内明细按商品合并) + const [exportingId, setExportingId] = useState(null); useEffect(() => { getStoreOptions().then((res) => setStores(res.data.data ?? [])); - getCategoryTree().then((res) => - setTopCategories( - (res.data.data ?? []).map((c) => ({ value: c.id!, label: c.name ?? '' })), - ), - ); }, []); const openDetail = async (id: number) => { @@ -107,17 +96,16 @@ const BillPage: React.FC = () => { } }; - /** 提交合并导出:下载失败时 downloadBlob 内部已提示,保留勾选便于重试 */ - const handleExport = async () => { - if (selectedRowKeys.length === 0) { + /** 单独导出:下载失败时 downloadBlob 内部已提示 */ + const handleExport = async (record: IBill) => { + if (!record.id) { return; } - setExporting(true); + setExportingId(record.id); try { - await exportBills(selectedRowKeys, categoryId); - setExportOpen(false); + await exportBill(record.id); } finally { - setExporting(false); + setExportingId(null); } }; @@ -328,6 +316,16 @@ const BillPage: React.FC = () => { icon={} onClick={() => openDetail(record.id!)} />, + + - , dom.columnSetting, dom.hideBorder, dom.reload, @@ -374,7 +358,7 @@ const BillPage: React.FC = () => { 门店账单 采购单完成后在「采购单」页生成,每个门店单独一张;账单总金额 = 商品金额 + 配送费 + 附加金额(周转筐/托盘)+ 售后金额(可正负); - 勾选多张账单可合并导出为一个 Excel(明细跨账单按商品合并,可按一级分类过滤)。 + 每行可单独导出为一个 Excel(账单内明细按商品合并)。 {...tableProps} /> @@ -484,32 +468,6 @@ const BillPage: React.FC = () => { - - {/* 合并导出:勾选账单跨账单按商品合并明细,可按一级分类过滤 */} - setExportOpen(false)} - onOk={handleExport} - confirmLoading={exporting} - okText="导出" - destroyOnHidden - > -
- 已选 {selectedRowKeys.length} 张账单,导出为一个 - Excel:商品明细跨账单按商品合并,表尾汇总配送费、附加金额与总金额; - 选择分类后仅导出该一级分类下的商品明细(配送费/附加金额仍全额汇总)。 -
-
- -