From 3d1ec9c833ce9dfa2c7282a27538581699e67cda Mon Sep 17 00:00:00 2001 From: liu <2302563948@qq.com> Date: Sun, 13 Sep 2026 01:46:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=84=A6=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .phpunit.result.cache | 2 +- .../Purchase/PurchaseOrderController.php | 4 +- app/Models/PurchaseOrderModel.php | 3 +- public/assets/goods-DDrxLa-h.js | 1 + public/assets/goods-NJpnvO3k.js | 1 - .../{index-CrAEpRIR.js => index-_7W4DmEA.js} | 4 +- public/assets/order-B3HrmGhw.js | 1 - public/assets/order-CzJfBGxK.js | 1 + public/index.html | 2 +- tests/Feature/PurchaseEditTest.php | 12 ++--- web/domain/iPurchaseOrder.ts | 2 + web/pages/product/goods.tsx | 14 ++++-- web/pages/purchase/order.tsx | 45 ++++++++++++++----- 13 files changed, 65 insertions(+), 27 deletions(-) create mode 100644 public/assets/goods-DDrxLa-h.js delete mode 100644 public/assets/goods-NJpnvO3k.js rename public/assets/{index-CrAEpRIR.js => index-_7W4DmEA.js} (99%) delete mode 100644 public/assets/order-B3HrmGhw.js create mode 100644 public/assets/order-CzJfBGxK.js diff --git a/.phpunit.result.cache b/.phpunit.result.cache index 5c31fc1..f9b5a34 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.104,"Tests\\Feature\\PurchaseEditTest::test_update_cell_syncs_order_item_and_totals":0.13,"Tests\\Feature\\PurchaseEditTest::test_update_row_cost_syncs_all_order_items":0.135,"Tests\\Feature\\PurchaseEditTest::test_update_row_weight_distributed_by_quantity":0.032,"Tests\\Feature\\PurchaseEditTest::test_update_row_requires_at_least_one_field":0.115,"Tests\\Feature\\PurchaseEditTest::test_update_cell_rejects_negative_quantity":0.14,"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.112,"Tests\\Feature\\PurchaseEditTest::test_update_row_syncs_to_product_catalog":0.019,"Tests\\Feature\\PurchaseEditTest::test_cell_detail_returns_items_with_order_info":0.143,"Tests\\Feature\\PurchaseEditTest::test_cell_detail_rejects_missing_params":0.124,"Tests\\Feature\\PurchaseEditTest::test_update_cell_weight_cascades_totals":0.146,"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.135,"Tests\\Feature\\PurchaseEditTest::test_store_summary_returns_aggregated_items":0.123,"Tests\\Feature\\PurchaseEditTest::test_store_summary_aggregates_multiple_orders_with_weighted_price":0.08,"Tests\\Feature\\PurchaseEditTest::test_store_summary_rejects_missing_or_invalid_params":0.116,"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.105,"Tests\\Feature\\PurchaseEditTest::test_store_item_add_creates_item_and_recalculates":0.14,"Tests\\Feature\\PurchaseEditTest::test_store_item_update_merges_multi_order_rows":0.11,"Tests\\Feature\\PurchaseEditTest::test_store_item_remove_deletes_and_recalculates":0.117,"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.151,"Tests\\Feature\\PurchaseEditTest::test_update_row_without_cost_change_keeps_item_price":0.144,"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.116,"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.111,"Tests\\Feature\\PurchaseEditTest::test_item_check_allowed_when_purchase_completed":0.139,"Tests\\Feature\\PurchaseEditTest::test_item_check_toggle_validates_purchase_and_product":0.111,"Tests\\Feature\\PurchaseEditTest::test_item_check_batch_marks_and_clears":0.156,"Tests\\Feature\\PurchaseEditTest::test_item_check_batch_validates_and_ignores_unknown_products":0.113,"Tests\\Feature\\PurchaseEditTest::test_list_includes_bill_product_amount":0.136,"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.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 diff --git a/app/Http/Controllers/Purchase/PurchaseOrderController.php b/app/Http/Controllers/Purchase/PurchaseOrderController.php index e95b2cd..f48cadd 100644 --- a/app/Http/Controllers/Purchase/PurchaseOrderController.php +++ b/app/Http/Controllers/Purchase/PurchaseOrderController.php @@ -58,7 +58,9 @@ class PurchaseOrderController extends BaseController $data = $this->buildSearch($params, PurchaseOrderModel::query() ->with('operator:id,nickname') // 应付商品金额 = Σ 已生成门店账单的商品金额(实际口径;未生成账单为 null) - ->withSum('bills as bill_product_amount', 'product_amount')) + ->withSum('bills as bill_product_amount', 'product_amount') + // 账单总金额 = Σ 已生成门店账单的总金额(商品+配送费+附加+售后;未生成账单为 null) + ->withSum('bills as bill_total_amount', 'total_amount')) ->orderBy('purchase_date', 'desc') ->orderBy('id', 'desc') ->paginate($pageSize) diff --git a/app/Models/PurchaseOrderModel.php b/app/Models/PurchaseOrderModel.php index b30879b..0bd264c 100644 --- a/app/Models/PurchaseOrderModel.php +++ b/app/Models/PurchaseOrderModel.php @@ -44,8 +44,9 @@ class PurchaseOrderModel extends Model 'actual_amount' => 'decimal:2', 'operator_id' => 'integer', 'created_at' => 'datetime:Y-m-d H:i:s', - // 列表 withSum 聚合属性(应付商品金额;无账单时保持 null) + // 列表 withSum 聚合属性(应付商品金额/账单总金额;无账单时保持 null) 'bill_product_amount' => 'decimal:2', + 'bill_total_amount' => 'decimal:2', ]; /** diff --git a/public/assets/goods-DDrxLa-h.js b/public/assets/goods-DDrxLa-h.js new file mode 100644 index 0000000..2f6aa30 --- /dev/null +++ b/public/assets/goods-DDrxLa-h.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"./typography-DRFhazK9.js";import{L as i,V as a,c as o,y as s}from"./lodash-DzOfPy0f.js";import{t as c}from"./alert-DuXzwpQC.js";import{n as ee,t as te}from"./table-BXi9q3AE.js";import{t as l}from"./space-Cu4QVMgQ.js";import{t as u}from"./button-BILozH6U.js";import{l as d}from"./XinForm-BPDYdeax.js";import{t as ne}from"./card-DU2T2-YW.js";import{t as re}from"./modal-g8Q5gNCx.js";import{t as ie}from"./image-CTRBNpBE.js";import{t as ae}from"./input-CHcsaDtX.js";import{r as f}from"./PictureOutlined-CB8Pr7jP.js";import{t as p}from"./tag-DBV1bHre.js";import{t as oe}from"./DeleteOutlined-DwOvobSM.js";import{t as se}from"./upload-oMV5VJeJ.js";import{t as ce}from"./DownloadOutlined-DJY9Mu8c.js";import{t as le}from"./UploadOutlined-NadwXvrl.js";import{t as ue}from"./XinTable-DOLiJ5rL.js";import{t as m}from"./AuthButton-DvrpreK4.js";import{t as de}from"./iProduct-l9WpLyUD.js";import{a as fe,i as h,n as pe,r as me,s as he,t as ge}from"./goods-DPA1smJU.js";import{n as _e}from"./category-MmrJkdbs.js";import{t as ve}from"./supplier-BstAcwv7.js";var g=e(t(),1),_=n(),{Title:v,Text:y}=r,b=e=>Math.round(e*100)/100,x=e=>e.target.select(),S=e=>e.map(e=>({...e,disabled:!!e.children?.length,children:e.children?.length?S(e.children):e.children})),C=e=>e.map(e=>({...e,selectable:!e.children?.length,children:e.children?.length?C(e.children):e.children})),w=()=>{let[e,t]=(0,g.useState)([]),[n,r]=(0,g.useState)([]),w=(0,g.useMemo)(()=>S(n),[n]),ye=(0,g.useMemo)(()=>C(n),[n]),[T,E]=(0,g.useState)(void 0),D=(0,g.useRef)(null);(0,g.useEffect)(()=>{k([]),D.current?.reset()},[T]);let[O,k]=(0,g.useState)([]),[A,j]=(0,g.useState)(!1),M=()=>{window.$modal?.confirm({title:`确定要删除选中的 ${O.length} 件商品吗?`,okText:`删除`,okButtonProps:{danger:!0},cancelText:`取消`,onOk:async()=>{j(!0);try{await ge(O),f.success(`批量删除成功`),k([]),await D.current?.reload()}finally{j(!1)}}})},[N,P]=(0,g.useState)(!1),[be,F]=(0,g.useState)(!1),[xe,I]=(0,g.useState)(!1),[Se,L]=(0,g.useState)([]),[R,z]=(0,g.useState)(1),[B,V]=(0,g.useState)(20),[Ce,we]=(0,g.useState)(0),[H,Te]=(0,g.useState)([]),[U,Ee]=(0,g.useState)(``),[W,De]=(0,g.useState)(void 0),G=(0,g.useRef)({}),[Oe,K]=(0,g.useState)(!1),[ke,q]=(0,g.useState)(!1),[J,Y]=(0,g.useState)(null),[Ae,X]=(0,g.useState)(!1),[Z,Q]=(0,g.useState)([]),je=async()=>{K(!0);try{await h(T?{category_id:T}:{})}finally{K(!1)}},Me=async()=>{if(J){X(!0),Q([]);try{await he(J),q(!1),Y(null),D.current?.reset()}catch(e){let t=e?.data?.data?.errors;Array.isArray(t)&&Q(t)}finally{X(!1)}}};(0,g.useEffect)(()=>{ve().then(e=>t(e.data.data??[])),_e().then(e=>r(e.data.data??[]))},[]);let $=async(e=U,t=W,n=R,r=B)=>{F(!0);try{let i=await fe({keyword:e||void 0,category_id:t,page:n,pageSize:r}),a=i.data.data?.rows??[],o=i.data.data?.levels??[],s=a.map(e=>{let t=G.current[e.id];if(t===void 0)return e;let n={...e,cost_price:t},r=Number(t??0);return o.forEach(e=>{e.id!=null&&(n[`price_${e.id}`]=r>0?b(r*(1+Number(e.percent??0)/100)):null)}),n});L(s),we(i.data.data?.total??0),Te(o)}finally{F(!1)}},Ne=()=>{P(!0),z(1),V(20),$(``,void 0,1,20)},Pe=(e,t)=>{G.current[e]=t,L(n=>n.map(n=>{if(n.id!==e)return n;let r={...n,cost_price:t},i=Number(t??0);return H.forEach(e=>{e.id!=null&&(r[`price_${e.id}`]=i>0?b(i*(1+Number(e.percent??0)/100)):null)}),r}))},Fe=async()=>{let e=[];if(Object.entries(G.current).forEach(([t,n])=>{n!=null&&e.push({product_id:Number(t),cost_price:n})}),e.length===0){f.info(`没有需要保存的价格调整`);return}I(!0);try{await pe(e),f.success(`已更新 ${e.length} 件商品成本价,各等级售价已按上浮比例联动,受影响门店将收到通知`),G.current={},await $()}finally{I(!1)}},Ie=[{title:`商品`,dataIndex:`name`,fixed:`left`,width:160,render:(e,t)=>(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`div`,{className:`font-medium`,children:e}),(0,_.jsxs)(y,{type:`secondary`,className:`text-xs`,children:[t.spec,t.unit?` / ${t.unit}`:``]})]})},{title:`成本价`,key:`cost_price`,fixed:`left`,width:130,render:(e,t)=>(0,_.jsx)(a,{size:`small`,min:0,precision:2,prefix:`¥`,value:t.cost_price,onChange:e=>Pe(t.id,e),className:`w-32`})},...H.map(e=>({title:e.name,key:`price_${e.id}`,width:150,render:(t,n)=>{let r=n[`price_${e.id}`];return(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`div`,{children:r==null?(0,_.jsx)(y,{type:`secondary`,children:`未设成本价`}):`¥${r}`}),(0,_.jsxs)(`div`,{className:`text-xs text-gray-400`,children:[`成本上浮 `,Number(e.percent??0),`%`]})]})}}))],Le={api:`/product/goods`,columns:[{title:`商品名称`,align:`center`,dataIndex:`name`,valueType:`text`,colProps:{span:24},required:!0,fieldProps:{onFocus:x},render:(e,t)=>(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`div`,{className:`mb-1.5`,children:t.name}),(0,_.jsx)(`div`,{className:`text-[#999] text-[12px]`,children:t.remark})]}),rules:[{required:!0,message:`请输入商品名称`}]},{title:`商品图片`,dataIndex:`image_ids`,valueType:`image`,fieldProps:{action:`/product/goods/upload`,maxWidth:3e3,maxHeight:3e3,maxSize:10,mode:`multiple`,maxCount:5,changeType:`id`},render:(e,t)=>!t.images_arr||t.images_arr?.length<=0?`-`:(0,_.jsx)(l,{wrap:!1,children:t.images_arr.map(e=>(0,_.jsx)(ie,{src:e.preview_url,width:60,height:60,style:{objectFit:`cover`,borderRadius:4}},e.id))}),align:`center`,hideInSearch:!0,colProps:{span:24}},{title:`商品描述`,dataIndex:`remark`,valueType:`text`,hideInSearch:!0,hideInTable:!0,colProps:{span:24},fieldProps:{onFocus:x}},{title:`成本价`,dataIndex:`cost_price`,valueType:`digit`,hideInSearch:!0,align:`center`,tooltip:`各等级售价 = 成本价 × (100 + 等级上浮比例) / 100`,fieldProps:{min:0,precision:2,prefix:`¥`,onFocus:x},render:(e,t)=>Number(t.cost_price??0)>0?`¥${t.cost_price}`:(0,_.jsx)(y,{type:`secondary`,children:`未设置`})},{title:`规格/包规`,dataIndex:`spec`,valueType:`text`,hideInSearch:!0,align:`center`,fieldProps:{onFocus:x}},{title:`单位`,dataIndex:`unit`,valueType:`text`,hideInSearch:!0,initialValue:`斤`,align:`center`,fieldProps:{onFocus:x}},{title:`单价单位`,dataIndex:`price_unit`,valueType:`text`,hideInTable:!0,hideInSearch:!0,initialValue:`元/斤`,fieldProps:{placeholder:`如:元/斤、元/箱`,maxLength:20,onFocus:x}},{title:`排序`,dataIndex:`sort`,valueType:`digit`,hideInSearch:!0,fieldProps:{min:0,onFocus:x},align:`center`},{title:`分类`,dataIndex:`category_id`,valueType:`treeSelect`,required:!0,align:`center`,rules:[{required:!0,message:`请选择分类`}],fieldProps:{treeData:w,fieldNames:{label:`name`,value:`id`,children:`children`},treeDefaultExpandAll:!0,showSearch:!0,treeNodeFilterProp:`name`,placeholder:`选择末级分类`},hideInSearch:!0,render:(e,t)=>t.category?(0,_.jsx)(p,{color:`cyan`,children:t.category.name}):`-`},{title:`供应商`,dataIndex:`supplier_id`,valueType:`select`,hideInSearch:!0,align:`center`,fieldProps:{options:e.map(e=>({label:e.name,value:e.id})),showSearch:!0,optionFilterProp:`label`,allowClear:!0,placeholder:`默认供应商(可选)`},render:(e,t)=>t.supplier?.name??`-`},{title:`市场`,dataIndex:`market`,valueType:`text`,align:`center`,fieldProps:{placeholder:`市场名称,如:新发地`,maxLength:50,allowClear:!0,onFocus:x},render:(e,t)=>t.market||`-`},{title:`状态`,dataIndex:`status`,valueType:`radioButton`,initialValue:1,fieldProps:{options:[{value:1,label:`上架`},{value:0,label:`下架`}]},render:(e,t)=>{let n=de[t.status??1];return(0,_.jsx)(p,{color:n?.color,children:n?.text})},align:`center`},{title:`图文详情`,dataIndex:`content`,valueType:`richText`,hideInSearch:!0,hideInTable:!0,colProps:{span:24},fieldProps:{height:400,groupId:11,placeholder:`输入商品图文详情,支持插入图片`}},{title:`等级价格`,dataIndex:`prices`,hideInForm:!0,hideInSearch:!0,width:420,align:`center`,render:(e,t)=>(0,_.jsx)(l,{wrap:!0,children:t.prices?.length?t.prices.map(e=>(0,_.jsxs)(p,{color:`geekblue`,title:`按成本价上浮 ${e.percent??0}%`,children:[e.level?.name??`等级${e.level_id}`,(0,_.jsxs)(`span`,{style:{color:`red`,marginLeft:5},children:[`¥`,e.price??`未设定`]})]},e.level_id)):`-`})},{title:`创建时间`,dataIndex:`created_at`,hideInForm:!0,hideInSearch:!0,align:`center`}],rowKey:`id`,accessName:`product.goods`,tableRef:D,scroll:{x:1200},actionBarRender:e=>[e.add,e.search,(0,_.jsx)(m,{auth:`product.goods.delete`,children:(0,_.jsxs)(u,{danger:!0,icon:(0,_.jsx)(oe,{}),disabled:O.length===0,loading:A,onClick:M,children:[`批量删除`,O.length>0?` (${O.length})`:``]})},`batchDelete`),(0,_.jsx)(u,{icon:(0,_.jsx)(o,{}),onClick:Ne,children:`价格矩阵`},`matrix`),(0,_.jsx)(m,{auth:`product.goods.export`,children:(0,_.jsx)(u,{icon:(0,_.jsx)(ce,{}),loading:Oe,onClick:je,children:`导出`})},`export`),(0,_.jsx)(m,{auth:`product.goods.import`,children:(0,_.jsx)(u,{icon:(0,_.jsx)(le,{}),onClick:()=>q(!0),children:`导入`})},`import`),e.keywordSearch],formProps:{grid:!0,colProps:{span:12},rowProps:{gutter:20},layout:`vertical`},requestParams:e=>({...e,category_id:T}),rowSelection:{selectedRowKeys:O,onChange:e=>k(e.map(Number))},modalProps:{width:800,centered:!0,classNames:{body:`overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden h-[80vh]`}}};return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(`div`,{className:`mb-5`,children:[(0,_.jsx)(v,{level:3,children:`商品列表`}),(0,_.jsx)(y,{type:`secondary`,children:`商品售价按客户等级上浮比例自动换算(成本价 × (100 + 上浮比例) / 100);「价格矩阵」支持批量调整成本价,调价后自动通知受影响门店。`})]}),(0,_.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,_.jsxs)(ne,{style:{width:200},title:`商品分类`,children:[(0,_.jsx)(`div`,{className:`cursor-pointer rounded-2xl mb-2 px-2 h-6 leading-6 ${T===void 0?`bg-blue-50`:`hover:bg-gray-50`}`,onClick:()=>{E(void 0)},children:`全部商品`}),(0,_.jsx)(ee,{showLine:!0,blockNode:!0,onSelect:e=>E(Number(e[0])),treeData:ye,selectedKeys:T?[T]:void 0,fieldNames:{title:`name`,key:`id`,children:`children`}})]}),(0,_.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,_.jsx)(ue,{...Le})})]}),(0,_.jsxs)(re,{title:`导入商品`,open:ke,onCancel:()=>q(!1),onOk:Me,okText:`开始导入`,okButtonProps:{disabled:!J},confirmLoading:Ae,destroyOnHidden:!0,width:560,children:[(0,_.jsxs)(`div`,{className:`mb-3`,children:[(0,_.jsx)(y,{type:`secondary`,children:`列格式:品名*、分类*(末级分类,支持「父分类/子分类」路径)、供应商(不存在自动创建)、市场、 规格/包规、单位(默认斤)、成本价、排序、库存、保质期、状态(上架/下架)、备注。 导入一律新增商品;整表校验,任何一行有错则全部不导入。`}),(0,_.jsx)(u,{type:`link`,className:`px-0`,onClick:me,children:`下载导入模板`})]}),(0,_.jsxs)(se.Dragger,{accept:`.xlsx,.xls`,maxCount:1,beforeUpload:e=>(Y(e),Q([]),!1),onRemove:()=>{Y(null),Q([])},children:[(0,_.jsx)(`p`,{className:`ant-upload-drag-icon`,children:(0,_.jsx)(s,{})}),(0,_.jsx)(`p`,{className:`ant-upload-text`,children:`点击或拖拽 Excel 文件到此区域`}),(0,_.jsx)(`p`,{className:`ant-upload-hint`,children:`仅支持 .xlsx / .xls,单次最多 1000 行`})]}),Z.length>0&&(0,_.jsx)(c,{className:`mt-3`,type:`error`,showIcon:!0,message:`共 ${Z.length} 处错误,修正后请重新导入`,description:(0,_.jsx)(`ul`,{className:`max-h-48 overflow-y-auto pl-4 mb-0 list-disc`,children:Z.map((e,t)=>(0,_.jsxs)(`li`,{children:[`第 `,e.row,` 行:`,e.message]},t))})})]}),(0,_.jsxs)(i,{title:`价格矩阵 · 批量调价`,open:N,onClose:()=>P(!1),size:1200,extra:(0,_.jsxs)(l,{children:[(0,_.jsx)(u,{onClick:()=>$(),children:`刷新`}),(0,_.jsx)(u,{type:`primary`,loading:xe,onClick:Fe,children:`保存调价`})]}),children:[(0,_.jsxs)(l,{className:`mb-4`,wrap:!0,children:[(0,_.jsx)(d,{style:{width:180},placeholder:`按分类筛选`,allowClear:!0,treeDefaultExpandAll:!0,fieldNames:{label:`name`,value:`id`,children:`children`},treeData:n,value:W,onChange:e=>{De(e),z(1),$(U,e,1,B)}}),(0,_.jsx)(ae.Search,{style:{width:240},placeholder:`搜索品名/规格`,allowClear:!0,value:U,onChange:e=>Ee(e.target.value),onSearch:e=>{z(1),$(e,W,1,B)}}),(0,_.jsx)(y,{type:`secondary`,children:`等级列按上浮比例自动换算,仅成本价可编辑`})]}),(0,_.jsx)(te,{rowKey:`id`,size:`small`,loading:be,columns:Ie,dataSource:Se,pagination:{current:R,pageSize:B,total:Ce,showSizeChanger:!0,pageSizeOptions:[20,50,100],showTotal:e=>`共 ${e} 件商品`,onChange:(e,t)=>{z(e),V(t),$(U,W,e,t)}},scroll:{x:H.length*150+290}})]})]})};export{w as default}; \ No newline at end of file diff --git a/public/assets/goods-NJpnvO3k.js b/public/assets/goods-NJpnvO3k.js deleted file mode 100644 index c4ba1c6..0000000 --- a/public/assets/goods-NJpnvO3k.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"./typography-DRFhazK9.js";import{L as i,V as a,c as o,y as s}from"./lodash-DzOfPy0f.js";import{t as c}from"./alert-DuXzwpQC.js";import{n as ee,t as te}from"./table-BXi9q3AE.js";import{t as l}from"./space-Cu4QVMgQ.js";import{t as u}from"./button-BILozH6U.js";import{l as ne}from"./XinForm-BPDYdeax.js";import{t as re}from"./card-DU2T2-YW.js";import{t as ie}from"./modal-g8Q5gNCx.js";import{t as ae}from"./image-CTRBNpBE.js";import{t as oe}from"./input-CHcsaDtX.js";import{r as d}from"./PictureOutlined-CB8Pr7jP.js";import{t as f}from"./tag-DBV1bHre.js";import{t as se}from"./DeleteOutlined-DwOvobSM.js";import{t as ce}from"./upload-oMV5VJeJ.js";import{t as le}from"./DownloadOutlined-DJY9Mu8c.js";import{t as p}from"./UploadOutlined-NadwXvrl.js";import{t as ue}from"./XinTable-DOLiJ5rL.js";import{t as m}from"./AuthButton-DvrpreK4.js";import{t as h}from"./iProduct-l9WpLyUD.js";import{a as de,i as fe,n as pe,r as me,s as he,t as ge}from"./goods-DPA1smJU.js";import{n as g}from"./category-MmrJkdbs.js";import{t as _e}from"./supplier-BstAcwv7.js";var _=e(t(),1),v=n(),{Title:ve,Text:y}=r,b=e=>Math.round(e*100)/100,x=e=>e.map(e=>({...e,disabled:!!e.children?.length,children:e.children?.length?x(e.children):e.children})),S=e=>e.map(e=>({...e,selectable:!e.children?.length,children:e.children?.length?S(e.children):e.children})),C=()=>{let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)([]),C=(0,_.useMemo)(()=>x(n),[n]),ye=(0,_.useMemo)(()=>S(n),[n]),[w,T]=(0,_.useState)(void 0),E=(0,_.useRef)(null);(0,_.useEffect)(()=>{O([]),E.current?.reset()},[w]);let[D,O]=(0,_.useState)([]),[k,A]=(0,_.useState)(!1),j=()=>{window.$modal?.confirm({title:`确定要删除选中的 ${D.length} 件商品吗?`,okText:`删除`,okButtonProps:{danger:!0},cancelText:`取消`,onOk:async()=>{A(!0);try{await ge(D),d.success(`批量删除成功`),O([]),await E.current?.reload()}finally{A(!1)}}})},[M,N]=(0,_.useState)(!1),[P,F]=(0,_.useState)(!1),[be,I]=(0,_.useState)(!1),[xe,L]=(0,_.useState)([]),[R,z]=(0,_.useState)(1),[B,V]=(0,_.useState)(20),[Se,Ce]=(0,_.useState)(0),[H,we]=(0,_.useState)([]),[U,Te]=(0,_.useState)(``),[W,Ee]=(0,_.useState)(void 0),G=(0,_.useRef)({}),[De,K]=(0,_.useState)(!1),[Oe,q]=(0,_.useState)(!1),[J,Y]=(0,_.useState)(null),[ke,X]=(0,_.useState)(!1),[Z,Q]=(0,_.useState)([]),Ae=async()=>{K(!0);try{await fe(w?{category_id:w}:{})}finally{K(!1)}},je=async()=>{if(J){X(!0),Q([]);try{await he(J),q(!1),Y(null),E.current?.reset()}catch(e){let t=e?.data?.data?.errors;Array.isArray(t)&&Q(t)}finally{X(!1)}}};(0,_.useEffect)(()=>{_e().then(e=>t(e.data.data??[])),g().then(e=>r(e.data.data??[]))},[]);let $=async(e=U,t=W,n=R,r=B)=>{F(!0);try{let i=await de({keyword:e||void 0,category_id:t,page:n,pageSize:r}),a=i.data.data?.rows??[],o=i.data.data?.levels??[],s=a.map(e=>{let t=G.current[e.id];if(t===void 0)return e;let n={...e,cost_price:t},r=Number(t??0);return o.forEach(e=>{e.id!=null&&(n[`price_${e.id}`]=r>0?b(r*(1+Number(e.percent??0)/100)):null)}),n});L(s),Ce(i.data.data?.total??0),we(o)}finally{F(!1)}},Me=()=>{N(!0),z(1),V(20),$(``,void 0,1,20)},Ne=(e,t)=>{G.current[e]=t,L(n=>n.map(n=>{if(n.id!==e)return n;let r={...n,cost_price:t},i=Number(t??0);return H.forEach(e=>{e.id!=null&&(r[`price_${e.id}`]=i>0?b(i*(1+Number(e.percent??0)/100)):null)}),r}))},Pe=async()=>{let e=[];if(Object.entries(G.current).forEach(([t,n])=>{n!=null&&e.push({product_id:Number(t),cost_price:n})}),e.length===0){d.info(`没有需要保存的价格调整`);return}I(!0);try{await pe(e),d.success(`已更新 ${e.length} 件商品成本价,各等级售价已按上浮比例联动,受影响门店将收到通知`),G.current={},await $()}finally{I(!1)}},Fe=[{title:`商品`,dataIndex:`name`,fixed:`left`,width:160,render:(e,t)=>(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`div`,{className:`font-medium`,children:e}),(0,v.jsxs)(y,{type:`secondary`,className:`text-xs`,children:[t.spec,t.unit?` / ${t.unit}`:``]})]})},{title:`成本价`,key:`cost_price`,fixed:`left`,width:130,render:(e,t)=>(0,v.jsx)(a,{size:`small`,min:0,precision:2,prefix:`¥`,value:t.cost_price,onChange:e=>Ne(t.id,e),className:`w-32`})},...H.map(e=>({title:e.name,key:`price_${e.id}`,width:150,render:(t,n)=>{let r=n[`price_${e.id}`];return(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`div`,{children:r==null?(0,v.jsx)(y,{type:`secondary`,children:`未设成本价`}):`¥${r}`}),(0,v.jsxs)(`div`,{className:`text-xs text-gray-400`,children:[`成本上浮 `,Number(e.percent??0),`%`]})]})}}))],Ie={api:`/product/goods`,columns:[{title:`商品名称`,align:`center`,dataIndex:`name`,valueType:`text`,colProps:{span:24},required:!0,render:(e,t)=>(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`div`,{className:`mb-1.5`,children:t.name}),(0,v.jsx)(`div`,{className:`text-[#999] text-[12px]`,children:t.remark})]}),rules:[{required:!0,message:`请输入商品名称`}]},{title:`商品图片`,dataIndex:`image_ids`,valueType:`image`,fieldProps:{action:`/product/goods/upload`,maxWidth:3e3,maxHeight:3e3,maxSize:10,mode:`multiple`,maxCount:5,changeType:`id`},render:(e,t)=>!t.images_arr||t.images_arr?.length<=0?`-`:(0,v.jsx)(l,{wrap:!1,children:t.images_arr.map(e=>(0,v.jsx)(ae,{src:e.preview_url,width:60,height:60,style:{objectFit:`cover`,borderRadius:4}},e.id))}),align:`center`,hideInSearch:!0,colProps:{span:24}},{title:`商品描述`,dataIndex:`remark`,valueType:`text`,hideInSearch:!0,hideInTable:!0,colProps:{span:24}},{title:`成本价`,dataIndex:`cost_price`,valueType:`digit`,hideInSearch:!0,align:`center`,tooltip:`各等级售价 = 成本价 × (100 + 等级上浮比例) / 100`,fieldProps:{min:0,precision:2,prefix:`¥`},render:(e,t)=>Number(t.cost_price??0)>0?`¥${t.cost_price}`:(0,v.jsx)(y,{type:`secondary`,children:`未设置`})},{title:`规格/包规`,dataIndex:`spec`,valueType:`text`,hideInSearch:!0,align:`center`},{title:`单位`,dataIndex:`unit`,valueType:`text`,hideInSearch:!0,initialValue:`斤`,align:`center`},{title:`单价单位`,dataIndex:`price_unit`,valueType:`text`,hideInTable:!0,hideInSearch:!0,initialValue:`元/斤`,fieldProps:{placeholder:`如:元/斤、元/箱`,maxLength:20}},{title:`排序`,dataIndex:`sort`,valueType:`digit`,hideInSearch:!0,fieldProps:{min:0},align:`center`},{title:`分类`,dataIndex:`category_id`,valueType:`treeSelect`,required:!0,align:`center`,rules:[{required:!0,message:`请选择分类`}],fieldProps:{treeData:C,fieldNames:{label:`name`,value:`id`,children:`children`},treeDefaultExpandAll:!0,showSearch:!0,treeNodeFilterProp:`name`,placeholder:`选择末级分类`},hideInSearch:!0,render:(e,t)=>t.category?(0,v.jsx)(f,{color:`cyan`,children:t.category.name}):`-`},{title:`供应商`,dataIndex:`supplier_id`,valueType:`select`,hideInSearch:!0,align:`center`,fieldProps:{options:e.map(e=>({label:e.name,value:e.id})),showSearch:!0,optionFilterProp:`label`,allowClear:!0,placeholder:`默认供应商(可选)`},render:(e,t)=>t.supplier?.name??`-`},{title:`市场`,dataIndex:`market`,valueType:`text`,align:`center`,fieldProps:{placeholder:`市场名称,如:新发地`,maxLength:50,allowClear:!0},render:(e,t)=>t.market||`-`},{title:`状态`,dataIndex:`status`,valueType:`radioButton`,initialValue:1,fieldProps:{options:[{value:1,label:`上架`},{value:0,label:`下架`}]},render:(e,t)=>{let n=h[t.status??1];return(0,v.jsx)(f,{color:n?.color,children:n?.text})},align:`center`},{title:`图文详情`,dataIndex:`content`,valueType:`richText`,hideInSearch:!0,hideInTable:!0,colProps:{span:24},fieldProps:{height:400,groupId:11,placeholder:`输入商品图文详情,支持插入图片`}},{title:`等级价格`,dataIndex:`prices`,hideInForm:!0,hideInSearch:!0,width:420,align:`center`,render:(e,t)=>(0,v.jsx)(l,{wrap:!0,children:t.prices?.length?t.prices.map(e=>(0,v.jsxs)(f,{color:`geekblue`,title:`按成本价上浮 ${e.percent??0}%`,children:[e.level?.name??`等级${e.level_id}`,(0,v.jsxs)(`span`,{style:{color:`red`,marginLeft:5},children:[`¥`,e.price??`未设定`]})]},e.level_id)):`-`})},{title:`创建时间`,dataIndex:`created_at`,hideInForm:!0,hideInSearch:!0,align:`center`}],rowKey:`id`,accessName:`product.goods`,tableRef:E,scroll:{x:1200},actionBarRender:e=>[e.add,e.search,(0,v.jsx)(m,{auth:`product.goods.delete`,children:(0,v.jsxs)(u,{danger:!0,icon:(0,v.jsx)(se,{}),disabled:D.length===0,loading:k,onClick:j,children:[`批量删除`,D.length>0?` (${D.length})`:``]})},`batchDelete`),(0,v.jsx)(u,{icon:(0,v.jsx)(o,{}),onClick:Me,children:`价格矩阵`},`matrix`),(0,v.jsx)(m,{auth:`product.goods.export`,children:(0,v.jsx)(u,{icon:(0,v.jsx)(le,{}),loading:De,onClick:Ae,children:`导出`})},`export`),(0,v.jsx)(m,{auth:`product.goods.import`,children:(0,v.jsx)(u,{icon:(0,v.jsx)(p,{}),onClick:()=>q(!0),children:`导入`})},`import`),e.keywordSearch],formProps:{grid:!0,colProps:{span:12},rowProps:{gutter:20},layout:`vertical`},requestParams:e=>({...e,category_id:w}),rowSelection:{selectedRowKeys:D,onChange:e=>O(e.map(Number))},modalProps:{width:800,centered:!0,classNames:{body:`overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden h-[80vh]`}}};return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`div`,{className:`mb-5`,children:[(0,v.jsx)(ve,{level:3,children:`商品列表`}),(0,v.jsx)(y,{type:`secondary`,children:`商品售价按客户等级上浮比例自动换算(成本价 × (100 + 上浮比例) / 100);「价格矩阵」支持批量调整成本价,调价后自动通知受影响门店。`})]}),(0,v.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,v.jsxs)(re,{style:{width:200},title:`商品分类`,children:[(0,v.jsx)(`div`,{className:`cursor-pointer rounded-2xl mb-2 px-2 h-6 leading-6 ${w===void 0?`bg-blue-50`:`hover:bg-gray-50`}`,onClick:()=>{T(void 0)},children:`全部商品`}),(0,v.jsx)(ee,{showLine:!0,blockNode:!0,onSelect:e=>T(Number(e[0])),treeData:ye,selectedKeys:w?[w]:void 0,fieldNames:{title:`name`,key:`id`,children:`children`}})]}),(0,v.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,v.jsx)(ue,{...Ie})})]}),(0,v.jsxs)(ie,{title:`导入商品`,open:Oe,onCancel:()=>q(!1),onOk:je,okText:`开始导入`,okButtonProps:{disabled:!J},confirmLoading:ke,destroyOnHidden:!0,width:560,children:[(0,v.jsxs)(`div`,{className:`mb-3`,children:[(0,v.jsx)(y,{type:`secondary`,children:`列格式:品名*、分类*(末级分类,支持「父分类/子分类」路径)、供应商(不存在自动创建)、市场、 规格/包规、单位(默认斤)、成本价、排序、库存、保质期、状态(上架/下架)、备注。 导入一律新增商品;整表校验,任何一行有错则全部不导入。`}),(0,v.jsx)(u,{type:`link`,className:`px-0`,onClick:me,children:`下载导入模板`})]}),(0,v.jsxs)(ce.Dragger,{accept:`.xlsx,.xls`,maxCount:1,beforeUpload:e=>(Y(e),Q([]),!1),onRemove:()=>{Y(null),Q([])},children:[(0,v.jsx)(`p`,{className:`ant-upload-drag-icon`,children:(0,v.jsx)(s,{})}),(0,v.jsx)(`p`,{className:`ant-upload-text`,children:`点击或拖拽 Excel 文件到此区域`}),(0,v.jsx)(`p`,{className:`ant-upload-hint`,children:`仅支持 .xlsx / .xls,单次最多 1000 行`})]}),Z.length>0&&(0,v.jsx)(c,{className:`mt-3`,type:`error`,showIcon:!0,message:`共 ${Z.length} 处错误,修正后请重新导入`,description:(0,v.jsx)(`ul`,{className:`max-h-48 overflow-y-auto pl-4 mb-0 list-disc`,children:Z.map((e,t)=>(0,v.jsxs)(`li`,{children:[`第 `,e.row,` 行:`,e.message]},t))})})]}),(0,v.jsxs)(i,{title:`价格矩阵 · 批量调价`,open:M,onClose:()=>N(!1),size:1200,extra:(0,v.jsxs)(l,{children:[(0,v.jsx)(u,{onClick:()=>$(),children:`刷新`}),(0,v.jsx)(u,{type:`primary`,loading:be,onClick:Pe,children:`保存调价`})]}),children:[(0,v.jsxs)(l,{className:`mb-4`,wrap:!0,children:[(0,v.jsx)(ne,{style:{width:180},placeholder:`按分类筛选`,allowClear:!0,treeDefaultExpandAll:!0,fieldNames:{label:`name`,value:`id`,children:`children`},treeData:n,value:W,onChange:e=>{Ee(e),z(1),$(U,e,1,B)}}),(0,v.jsx)(oe.Search,{style:{width:240},placeholder:`搜索品名/规格`,allowClear:!0,value:U,onChange:e=>Te(e.target.value),onSearch:e=>{z(1),$(e,W,1,B)}}),(0,v.jsx)(y,{type:`secondary`,children:`等级列按上浮比例自动换算,仅成本价可编辑`})]}),(0,v.jsx)(te,{rowKey:`id`,size:`small`,loading:P,columns:Fe,dataSource:xe,pagination:{current:R,pageSize:B,total:Se,showSizeChanger:!0,pageSizeOptions:[20,50,100],showTotal:e=>`共 ${e} 件商品`,onChange:(e,t)=>{z(e),V(t),$(U,W,e,t)}},scroll:{x:H.length*150+290}})]})]})};export{C as default}; \ No newline at end of file diff --git a/public/assets/index-CrAEpRIR.js b/public/assets/index-_7W4DmEA.js similarity index 99% rename from public/assets/index-CrAEpRIR.js rename to public/assets/index-_7W4DmEA.js index ebb7840..54bebb1 100644 --- a/public/assets/index-CrAEpRIR.js +++ b/public/assets/index-_7W4DmEA.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-NJpnvO3k.js","assets/alert-DuXzwpQC.js","assets/supplier-BstAcwv7.js","assets/order-B3HrmGhw.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-NJpnvO3k.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-B3HrmGhw.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-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. Core Features: ✨ Cutting-edge Stack - React 19 + Vite 7 + TypeScript 5.8 diff --git a/public/assets/order-B3HrmGhw.js b/public/assets/order-B3HrmGhw.js deleted file mode 100644 index 9ac26cf..0000000 --- a/public/assets/order-B3HrmGhw.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"./typography-DRFhazK9.js";import{L as i,V as a,a as o,k as ee}from"./lodash-DzOfPy0f.js";import{t as te}from"./tooltip-SaeG1Uv7.js";import{t as ne}from"./PlusOutlined-B8K2rG8r.js";import{t as s}from"./table-BXi9q3AE.js";import{t as c}from"./space-Cu4QVMgQ.js";import{h as re}from"./style-BmYds38x.js";import{t as l}from"./button-BILozH6U.js";import{r as u}from"./DoubleRightOutlined-Blfli1UU.js";import{t as d}from"./empty-_1ZFK8yy.js";import{s as ie}from"./XinForm-BPDYdeax.js";import{t as ae}from"./radio-CxFl70_7.js";import{n as oe}from"./card-DU2T2-YW.js";import{t as se}from"./spin-CfJYIffX.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 ce}from"./CopyOutlined-pYq9KfGb.js";import{r as g}from"./PictureOutlined-CB8Pr7jP.js";import{t as le}from"./popconfirm-DyseZgpU.js";import{t as _}from"./tag-DBV1bHre.js";import{t as ue}from"./DeleteOutlined-DwOvobSM.js";import{t as v}from"./DownloadOutlined-DJY9Mu8c.js";import{t as de}from"./XinTable-DOLiJ5rL.js";import{t as y}from"./AuthButton-DvrpreK4.js";import{o as fe}from"./goods-DPA1smJU.js";import{a as pe,c as me,d as he,f as ge,i as _e,l as b,m as ve,n as ye,o as be,p as xe,r as Se,t as Ce,u as we}from"./order-C6L8DsOz.js";import{n as x,t as Te}from"./iPurchaseOrder-Dn-laOqY.js";import{t as Ee}from"./supplier-BstAcwv7.js";import{t as De}from"./useAuth-AiNV0bRw.js";var S=e(t(),1),C=n(),{Title:Oe,Text:w}=r,ke={product_name:`品名`,supplier_id:`供应商`,product_spec:`包规`,unit:`单位`,cost_price:`成本`},Ae=(e,t)=>{let n=parseFloat(t);return Number.isFinite(n)&&n>0?e/n:e},je=(e,t)=>Math.trunc(e*(100+t))/100,Me=()=>{let e=(0,S.useRef)(null),{auth:t}=De(),[n,r]=(0,S.useState)(!1),[Me,Ne]=(0,S.useState)(1200),[T,E]=(0,S.useState)(null),[Pe,Fe]=(0,S.useState)(!1),[Ie,Le]=(0,S.useState)(!1),[D,O]=(0,S.useState)(new Set),[Re,ze]=(0,S.useState)(!1),[Be,Ve]=(0,S.useState)([]),[k,He]=(0,S.useState)(`items`),[A,Ue]=(0,S.useState)(0),[j,We]=(0,S.useState)(null),[Ge,Ke]=(0,S.useState)(!1),[qe,M]=(0,S.useState)(!1),[Je,Ye]=(0,S.useState)(!1),[Xe]=m.useForm(),[Ze,Qe]=(0,S.useState)([]),[N,P]=(0,S.useState)(null),[$e,et]=(0,S.useState)(!1),[F]=m.useForm(),[I,L]=(0,S.useState)(0),[R,tt]=(0,S.useState)(``),[z,nt]=(0,S.useState)({}),[rt,it]=(0,S.useState)(!1),[at,ot]=(0,S.useState)(0),[st,B]=(0,S.useState)(!1),[ct,lt]=(0,S.useState)(`current`),[ut,V]=(0,S.useState)(!1),[dt,ft]=(0,S.useState)(`current`),H=(0,S.useMemo)(()=>{let e=new Map;return(T?.items??[]).forEach(t=>{t.supplier_id>0&&t.supplier?.name&&e.set(t.supplier_id,t.supplier.name)}),Array.from(e,([e,t])=>({id:e,name:t}))},[T?.items]),pt=(0,S.useMemo)(()=>{let e=new Set;return(T?.items??[]).forEach(t=>{t.supplier_id===I&&t.market&&e.add(t.market)}),Array.from(e)},[T?.items,I]),U=(0,S.useMemo)(()=>!T||I<=0?[]:T.items.filter(e=>e.supplier_id===I).filter(e=>R===``||(e.market??``)===R).map(e=>({product_id:e.product_id,product_name:e.product_name,product_spec:e.product_spec,unit:e.unit,market:e.market,cost_price:String(e.cost_price),quantity:e.quantity,weight:String(e.weight),amount:(e.quantity*Number(e.cost_price)).toFixed(2)})),[T,I,R]),mt=(0,S.useMemo)(()=>{let e=new Set;return(T?.items??[]).forEach(t=>{t.market&&e.add(t.market)}),Array.from(e)},[T?.items]),W=(0,S.useMemo)(()=>{let e=z.supplier,t=z.market;return(T?.items??[]).filter(t=>!e?.length||e.includes(t.supplier_id)).filter(e=>!t?.length||t.includes(e.market??``))},[T?.items,z]),[ht,G]=(0,S.useState)(!1),[K,q]=(0,S.useState)(null),[gt,_t]=(0,S.useState)(!1),[vt,yt]=(0,S.useState)(!1),[J]=m.useForm(),bt=m.useWatch(`stores`,J)??[],Y=(K?.stores??[]).map((e,t)=>{let n=bt[t]??{},r=Number(n.delivery_fee??0),i=Number(e.level_percent??0),a=je(Number(n.after_sale??0),i),o=Number(n.box_num??0)*Number(e.box_price)+Number(n.tray_num??0)*Number(e.tray_price);return{added:o,afterSale:a,total:Number(e.product_amount)+r+o+a}}),xt=(K?.stores??[]).length>0&&K.stores.every(e=>e.bill!==null);(0,S.useEffect)(()=>{Ee().then(e=>Ve(e.data.data??[]))},[]),(0,S.useEffect)(()=>{T&&T.stores.length>0&&Ue(e=>T.stores.some(t=>t.id===e)?e:T.stores[0].id)},[T]),(0,S.useEffect)(()=>{H.length>0?L(e=>H.some(t=>t.id===e)?e:H[0].id):L(0)},[H]),(0,S.useEffect)(()=>{n&&k===`stores`&&T&&A>0&&Et()},[n,k,A,T?.purchase.id]),(0,S.useEffect)(()=>{O(new Set(T?.checked_product_ids??[]))},[T]);let St=async e=>{if(!T)return;let t=!D.has(e);O(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r});try{await ge(T.purchase.id,e)}catch{O(n=>{let r=new Set(n);return t?r.delete(e):r.add(e),r})}},X=(0,S.useMemo)(()=>W.map(e=>e.product_id),[W]),Z=X.length>0&&X.every(e=>D.has(e)),Ct=async()=>{if(!T||X.length===0||Re)return;let e=!Z;O(t=>{let n=new Set(t);return X.forEach(t=>{e?n.add(t):n.delete(t)}),n}),ze(!0);try{await ye(T.purchase.id,X,e)}catch{O(t=>{let n=new Set(t);return X.forEach(t=>{e?n.delete(t):n.add(t)}),n})}finally{ze(!1)}},wt=async e=>{Fe(!0);try{let t=await b(e);E(t.data.data??null)}finally{Fe(!1)}},Tt=async e=>{He(`items`),We(null),nt({}),r(!0),await wt(e)},Et=async()=>{if(!(!T||A<=0)){Ke(!0);try{let e=await we(T.purchase.id,A);We(e.data.data??null)}finally{Ke(!1)}}},Dt=async()=>{await Et(),T&&await wt(T.purchase.id),await e.current?.reload()},Ot=()=>{Xe.resetFields(),M(!0),Ze.length===0&&fe().then(e=>Qe(e.data.data??[]))},kt=async e=>{if(!(!T||A<=0)){Ye(!0);try{await Ce(T.purchase.id,A,e),g.success(`已添加单品,订货单与采购单汇总已重算`),M(!1),await Dt()}finally{Ye(!1)}}},At=e=>{P(e),F.setFieldsValue({quantity:e.quantity,price:Number(e.price??0),weight:Number(e.weight??0)})},jt=async e=>{if(!(!T||!N||A<=0)){et(!0);try{await ve(T.purchase.id,A,N.product_id,e),g.success(`单品已更新,订货单与采购单汇总已重算`),P(null),await Dt()}finally{et(!1)}}},Mt=async e=>{!T||A<=0||(await he(T.purchase.id,A,e.product_id),g.success(`已移除单品,订货单与采购单汇总已重算`),await Dt())},Nt=T?.purchase.status===0&&t(`purchase.order.update`),Q=async(t,n,r)=>{if(!T)return;let i={product_name:t.product_name,supplier_id:t.supplier_id,product_spec:t.product_spec,unit:t.unit,cost_price:Number(t.cost_price)};if(n===`cost_price`){let e=Number(r);if(r===``||!Number.isFinite(e)||e<0){g.warning(`成本无效,已取消修改`);return}if(e===Number(t.cost_price))return;i.cost_price=e}else if(n===`supplier_id`){let e=Number(r);if(e===t.supplier_id)return;i.supplier_id=e}else{let e=String(r).trim();if(!e){g.warning(`${ke[n]}不能为空,已取消修改`);return}if(e===t[n])return;i[n]=e}if(i.supplier_id<=0){g.warning(`请先通过供应商单元格为该商品设置供应商`);return}let a=await xe(T.purchase.id,t.product_id,i);g.success(`已更新 ${a.data.data?.count??0} 条订货明细`);let o=await b(T.purchase.id);E(o.data.data??null),await e.current?.reload()},Pt=async(t,n,r)=>{if(!T)return;let i=Number(r);if(r.trim()===``||!Number.isInteger(i)||i<0){g.warning(`订货量无效,已取消修改`);return}if(i===t.cells[n])return;await ve(T.purchase.id,n,t.product_id,{quantity:i});let a=await b(T.purchase.id);E(a.data.data??null),g.success(`订货量已更新,订货单与采购单汇总已重算`),await e.current?.reload()},$=(e,t,n)=>Nt?t===`supplier_id`?(0,C.jsx)(u,{size:`small`,className:`w-full`,value:e.supplier_id>0?e.supplier_id:void 0,placeholder:`选择供应商`,showSearch:{optionFilterProp:`label`},options:Be.map(e=>({value:e.id,label:e.name})),onChange:n=>void Q(e,t,n)}):t===`cost_price`?(0,C.jsx)(a,{size:`small`,min:0,precision:2,prefix:`¥`,className:`w-full`,defaultValue:Number(e.cost_price),onPressEnter:n=>void Q(e,t,n.target.value),onBlur:n=>void Q(e,t,n.target.value)},`${e.product_id}-cost-${e.cost_price}`):(0,C.jsx)(h,{size:`small`,style:{textAlign:`center`},defaultValue:e[t],maxLength:t===`unit`?20:100,onPressEnter:n=>void Q(e,t,n.target.value),onBlur:n=>void Q(e,t,n.target.value)},`${e.product_id}-${t}-${e[t]}`):n,Ft=async e=>{G(!0),_t(!0),q(null);try{let t=(await me(e)).data.data??null;q(t),J.setFieldsValue({stores:(t?.stores??[]).map(e=>({store_id:e.store_id,delivery_fee:e.bill?Number(e.bill.delivery_fee):0,box_num:e.bill?e.bill.box_num:0,tray_num:e.bill?e.bill.tray_num:0,after_sale:e.bill?Number(e.bill.after_sale):0,remark:e.bill?.remark??``}))})}finally{_t(!1)}},It=async t=>{if(K){yt(!0);try{let n=await be(K.purchase.id,t.stores);g.success(`已生成 ${n.data.data?.count??0} 张门店账单,采购单订单已关联`),G(!1),q(null),await e.current?.reload(),T&&T.purchase.id===K.purchase.id&&await wt(T.purchase.id)}finally{yt(!1)}}},Lt=async t=>{Le(!0);try{await ie(`/purchase/order/${t}/finish`,{status:3}),g.success(`采购单已标记完成`),await e.current?.reload()}finally{Le(!1)}},Rt=()=>{let e=[{title:`品名`,dataIndex:`product_name`,width:160,align:`center`,fixed:`left`,ellipsis:!0,render:(e,t)=>$(t,`product_name`,t.product_name)},{title:`供应商`,dataIndex:`supplier`,width:110,align:`center`,fixed:`left`,filters:H.map(e=>({text:e.name,value:e.id})),filteredValue:z.supplier??null,onFilter:(e,t)=>t.supplier_id===Number(e),render:(e,t)=>$(t,`supplier_id`,t.supplier?.name??`-`)},{title:(0,C.jsxs)(c,{size:4,children:[(0,C.jsx)(`span`,{children:`市场`}),(0,C.jsx)(te,{title:`${Z?`取消全选`:`全选对账`}(仅作用于当前筛选显示的 ${X.length} 行)`,children:(0,C.jsx)(l,{size:`small`,shape:`circle`,style:{minWidth:16,height:16,width:16},icon:(0,C.jsx)(re,{}),color:Z?`green`:`default`,variant:Z?`solid`:`outlined`,loading:Re,disabled:X.length===0,onClick:()=>void Ct()})})]}),fixed:`left`,dataIndex:`market`,width:90,align:`center`,filters:mt.map(e=>({text:e,value:e})),filteredValue:z.market??null,onFilter:(e,t)=>(t.market??``)===e,render:(e,t)=>{let n=D.has(t.product_id);return(0,C.jsxs)(c,{size:4,children:[(0,C.jsx)(`span`,{children:e||`-`}),(0,C.jsx)(l,{size:`small`,shape:`circle`,style:{minWidth:16,height:16,width:16},icon:(0,C.jsx)(re,{}),color:n?`green`:`default`,variant:n?`solid`:`outlined`,onClick:()=>void St(t.product_id)})]})}},{title:`单价`,key:`retail_price`,width:90,align:`center`,render:(e,t)=>{let n=Number(t.quantity??0);return n<=0?(0,C.jsx)(w,{type:`secondary`,children:`-`}):`¥${Ae(Number(t.amount??0)/n,t.product_spec??``).toFixed(2)}`}},{title:`包规`,dataIndex:`product_spec`,align:`center`,width:90,render:(e,t)=>$(t,`product_spec`,e||`-`)},{title:`单位`,dataIndex:`unit`,width:90,align:`center`,render:(e,t)=>$(t,`unit`,e||`-`)},{title:`成本`,dataIndex:`cost_price`,width:120,align:`center`,render:(e,t)=>$(t,`cost_price`,`¥${Number(e).toFixed(2)}`)},{title:`合计数量`,key:`total_quantity`,width:110,align:`center`,render:(e,t)=>(0,C.jsx)(w,{strong:!0,children:t.quantity})}],t=(T?.stores??[]).map(e=>({title:(0,C.jsx)(`span`,{className:`text-[red]`,children:e.name}),key:`store-${e.id}`,align:`center`,render:(t,n)=>{let r=n.cells[e.id];return r===void 0?(0,C.jsx)(w,{type:`secondary`,children:`-`}):Nt?(0,C.jsx)(a,{size:`small`,min:0,styles:{input:{textAlign:`center`},root:{width:80}},precision:0,className:`w-full`,defaultValue:r,onPressEnter:t=>void Pt(n,e.id,t.target.value),onBlur:t=>void Pt(n,e.id,t.target.value)},`${n.product_id}-${e.id}-${r}`):r}}));return[...e,...t]},zt=()=>{let e=T?.stores??[],t=W,n=e.map(e=>t.reduce((t,n)=>t+(n.cells[e.id]??0)*Number(n.cost_price),0)),r=t.reduce((e,t)=>e+Number(t.quantity),0),i=n.reduce((e,t)=>e+t,0);return(0,C.jsxs)(s.Summary.Row,{children:[(0,C.jsx)(s.Summary.Cell,{index:0,colSpan:7,align:`center`,children:(0,C.jsxs)(c,{size:16,children:[(0,C.jsx)(w,{strong:!0,children:`成本统计(按门店)`}),(0,C.jsxs)(w,{strong:!0,type:`danger`,children:[`总计 ¥`,i.toFixed(2)]})]})}),(0,C.jsx)(s.Summary.Cell,{index:7,align:`center`,children:(0,C.jsx)(w,{strong:!0,children:r})}),n.map((t,n)=>(0,C.jsx)(s.Summary.Cell,{index:8+n,align:`center`,children:(0,C.jsxs)(w,{strong:!0,children:[`¥`,t.toFixed(2)]})},e[n].id))]})},Bt=[{title:`商品`,dataIndex:`product_name`,width:160,align:`center`},{title:`市场`,dataIndex:`market`,width:90,align:`center`,render:e=>e||`-`},{title:`单价`,key:`retail_price`,width:130,align:`center`,render:(e,t)=>`¥${Ae(Number(t.price),t.product_spec).toFixed(2)}`},{title:`包规`,dataIndex:`product_spec`,width:90,align:`center`,render:e=>e||`-`},{title:`单位`,dataIndex:`unit`,width:90,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,C.jsx)(w,{strong:!0,children:e})},{title:`重量`,dataIndex:`weight`,width:90,align:`center`,render:e=>`${e||`-`}斤`},{title:`预计金额`,dataIndex:`amount`,width:110,align:`center`,render:e=>(0,C.jsxs)(w,{strong:!0,children:[`¥`,Number(e).toFixed(2)]})},{title:`操作`,key:`action`,width:130,align:`center`,render:(e,t)=>T?.purchase.status===0?(0,C.jsxs)(c,{size:0,children:[(0,C.jsx)(y,{auth:`purchase.order.update`,children:(0,C.jsx)(l,{type:`link`,size:`small`,icon:(0,C.jsx)(ce,{}),onClick:()=>At(t),children:`编辑`})}),(0,C.jsx)(y,{auth:`purchase.order.update`,children:(0,C.jsx)(le,{title:`移除该单品?`,description:`将从「${j?.store?.name??`该门店`}」采购明细中移除「${t.product_name}」`,onConfirm:()=>Mt(t),children:(0,C.jsx)(l,{type:`link`,size:`small`,danger:!0,icon:(0,C.jsx)(ue,{}),children:`移除`})})})]}):(0,C.jsx)(w,{type:`secondary`,children:`-`})}],Vt=()=>{let e=j?.items??[],t=e.reduce((e,t)=>e+Number(t.quantity),0),n=e.reduce((e,t)=>e+Number(t.amount),0),r=e.reduce((e,t)=>e+Number(t.weight),0);return(0,C.jsxs)(s.Summary.Row,{children:[(0,C.jsx)(s.Summary.Cell,{index:0,colSpan:6,align:`center`,children:(0,C.jsx)(w,{strong:!0,children:`合计`})}),(0,C.jsx)(s.Summary.Cell,{index:6,align:`center`,children:(0,C.jsx)(w,{strong:!0,children:t})}),(0,C.jsx)(s.Summary.Cell,{index:7,align:`center`,children:(0,C.jsxs)(w,{strong:!0,children:[r.toFixed(3),`斤`]})}),(0,C.jsx)(s.Summary.Cell,{index:8,align:`center`,children:(0,C.jsxs)(w,{strong:!0,type:`danger`,children:[`¥`,n.toFixed(2)]})}),(0,C.jsx)(s.Summary.Cell,{index:9,align:`center`,children:(0,C.jsx)(w,{strong:!0,children:`-`})})]})},Ht=[{title:`品名`,dataIndex:`product_name`,width:180,align:`center`},{title:`市场`,dataIndex:`market`,width:100,align:`center`,render:e=>e||`-`},{title:`包规`,dataIndex:`product_spec`,width:110,align:`center`,render:e=>e||`-`},{title:`单位`,dataIndex:`unit`,width:90,align:`center`,render:e=>e||`-`},{title:`成本价`,dataIndex:`cost_price`,width:110,align:`center`,render:e=>`¥${Number(e).toFixed(2)}`},{title:`数量`,dataIndex:`quantity`,width:100,align:`center`,render:e=>(0,C.jsx)(w,{strong:!0,children:e})},{title:`重量`,dataIndex:`weight`,width:110,align:`center`,render:e=>`${Number(e).toFixed(3)}斤`},{title:`金额`,dataIndex:`amount`,width:120,align:`center`,render:e=>(0,C.jsxs)(w,{strong:!0,children:[`¥`,Number(e).toFixed(2)]})}],Ut=()=>{let e=U.reduce((e,t)=>e+Number(t.quantity),0),t=U.reduce((e,t)=>e+Number(t.weight),0),n=U.reduce((e,t)=>e+Number(t.amount),0);return(0,C.jsxs)(s.Summary.Row,{children:[(0,C.jsx)(s.Summary.Cell,{index:0,colSpan:5,align:`center`,children:(0,C.jsx)(w,{strong:!0,children:`合计`})}),(0,C.jsx)(s.Summary.Cell,{index:5,align:`center`,children:(0,C.jsx)(w,{strong:!0,children:e})}),(0,C.jsx)(s.Summary.Cell,{index:6,align:`center`,children:(0,C.jsxs)(w,{strong:!0,children:[t.toFixed(3),`斤`]})}),(0,C.jsx)(s.Summary.Cell,{index:7,align:`center`,children:(0,C.jsxs)(w,{strong:!0,type:`danger`,children:[`¥`,n.toFixed(2)]})})]})},Wt=[{title:`门店`,dataIndex:`store_name`,width:140,align:`center`},{title:`账单号`,dataIndex:`bill_no`,width:180,align:`center`,render:e=>(0,C.jsx)(w,{copyable:{text:e},children:e})},{title:`账单日期`,dataIndex:`bill_date`,width:110,align:`center`},{title:`商品金额`,dataIndex:`product_amount`,width:110,align:`center`,render:e=>`¥${Number(e).toFixed(2)}`},{title:`配送费`,dataIndex:`delivery_fee`,width:100,align:`center`,render:e=>`¥${Number(e).toFixed(2)}`},{title:`周转筐`,key:`box`,width:110,align:`center`,render:(e,t)=>`${t.box_num} × ¥${Number(t.box_price).toFixed(2)}`},{title:`周转托盘`,key:`tray`,width:110,align:`center`,render:(e,t)=>`${t.tray_num} × ¥${Number(t.tray_price).toFixed(2)}`},{title:`附加金额`,dataIndex:`added_amount`,width:100,align:`center`,render:e=>`¥${Number(e).toFixed(2)}`},{title:`账单总金额`,dataIndex:`total_amount`,width:120,align:`center`,render:e=>(0,C.jsxs)(w,{strong:!0,type:`danger`,children:[`¥`,Number(e).toFixed(2)]})},{title:`支付状态`,dataIndex:`status`,width:100,align:`center`,render:e=>{let t=Te[Number(e??0)];return(0,C.jsx)(_,{color:t?.color,children:t?.text})}}],Gt=()=>{let e=T?.bills??[],t=e.reduce((e,t)=>e+Number(t.product_amount),0),n=e.reduce((e,t)=>e+Number(t.delivery_fee),0),r=e.reduce((e,t)=>e+Number(t.added_amount),0),i=e.reduce((e,t)=>e+Number(t.total_amount),0);return(0,C.jsxs)(s.Summary.Row,{children:[(0,C.jsx)(s.Summary.Cell,{index:0,colSpan:3,align:`center`,children:(0,C.jsx)(w,{strong:!0,children:`合计`})}),(0,C.jsx)(s.Summary.Cell,{index:3,align:`center`,children:(0,C.jsxs)(w,{strong:!0,children:[`¥`,t.toFixed(2)]})}),(0,C.jsx)(s.Summary.Cell,{index:4,align:`center`,children:(0,C.jsxs)(w,{strong:!0,children:[`¥`,n.toFixed(2)]})}),(0,C.jsx)(s.Summary.Cell,{index:5,colSpan:2,align:`center`,children:(0,C.jsx)(w,{strong:!0,children:`-`})}),(0,C.jsx)(s.Summary.Cell,{index:7,align:`center`,children:(0,C.jsxs)(w,{strong:!0,children:[`¥`,r.toFixed(2)]})}),(0,C.jsx)(s.Summary.Cell,{index:8,align:`center`,children:(0,C.jsxs)(w,{strong:!0,type:`danger`,children:[`¥`,i.toFixed(2)]})}),(0,C.jsx)(s.Summary.Cell,{index:9,align:`center`,children:(0,C.jsx)(w,{strong:!0,children:`-`})})]})},Kt=[{title:`采购单号`,dataIndex:`purchase_no`,valueType:`text`,hideInForm:!0,align:`center`,width:260,render:(e,t)=>(0,C.jsx)(w,{copyable:{text:t.purchase_no},children:t.purchase_no})},{title:`采购日期`,dataIndex:`purchase_date`,valueType:`date`,align:`center`,hideInForm:!0,render:(e,t)=>t.purchase_date},{title:`预估成本`,dataIndex:`estimate_amount`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>`¥${t.estimate_amount}`},{title:`实际成本`,dataIndex:`actual_amount`,hideInSearch:!0,valueType:`digit`,fieldProps:{min:0,precision:3,placeholder:`请输入单价`},align:`center`,render:(e,t)=>Number(t.actual_amount)>0?(0,C.jsxs)(w,{strong:!0,children:[`¥`,t.actual_amount]}):(0,C.jsx)(w,{type:`secondary`,children:`未录入`})},{title:`应付商品金额`,dataIndex:`bill_product_amount`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>t.bill_product_amount==null?(0,C.jsx)(w,{type:`secondary`,children:`未生成账单`}):(0,C.jsxs)(w,{strong:!0,type:`danger`,children:[`¥`,Number(t.bill_product_amount).toFixed(2)]})},{title:`总件数`,dataIndex:`total_quantity`,hideInForm:!0,hideInSearch:!0,align:`center`},{title:`备注`,dataIndex:`remark`,valueType:`textarea`,hideInTable:!0,hideInSearch:!0},{title:`总重量`,dataIndex:`total_weight`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>`${t.total_weight}斤`},{title:`状态`,dataIndex:`status`,valueType:`select`,hideInForm:!0,fieldProps:{options:Object.entries(x).map(([e,t])=>({value:Number(e),label:t.text}))},render:(e,t)=>{let n=x[t.status??0];return(0,C.jsx)(_,{color:n?.color,children:n?.text})},align:`center`},{title:`制单人`,dataIndex:`operator`,hideInForm:!0,hideInSearch:!0,render:(e,t)=>t.operator?.nickname??`-`,align:`center`}];return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`div`,{className:`mb-5`,children:[(0,C.jsx)(Oe,{level:3,children:`采购单`}),(0,C.jsx)(w,{type:`secondary`,children:`在「门店订单」页勾选已接单订单合并生成采购单;采购单支持修改订单信息。`})]}),(0,C.jsx)(de,{api:`/purchase/order`,columns:Kt,rowKey:`id`,accessName:`purchase.order`,tableRef:e,operateRender:(e,t)=>[e.status===0?t.edit:null,(0,C.jsx)(l,{size:`small`,icon:(0,C.jsx)(o,{}),type:`primary`,onClick:()=>Tt(e.id)},`detail`),e.status===0?(0,C.jsx)(y,{auth:`purchase.order.update`,children:(0,C.jsx)(le,{title:`确认该采购单已完成?`,description:`已完成采购单将锁定,不能再修改订单信息`,onConfirm:()=>Lt(e.id),children:(0,C.jsx)(l,{type:`primary`,size:`small`,variant:`solid`,color:`green`,loading:Ie,children:`完成采购`})})}):(0,C.jsx)(y,{auth:`purchase.order.bill`,children:(0,C.jsx)(l,{type:`primary`,size:`small`,variant:`solid`,color:`orange`,icon:(0,C.jsx)(ee,{}),onClick:()=>Ft(e.id),children:`生成账单`})})],operateProps:{width:300},formProps:!1}),(0,C.jsx)(i,{title:T?`采购单 ${T.purchase.purchase_no}`:`采购单详情`,open:n,onClose:()=>r(!1),size:Me,resizable:{onResize:e=>Ne(e)},loading:Pe,children:T&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Oe,{level:5,className:`mb-3!`,children:`采购单信息`}),(0,C.jsxs)(p,{column:3,size:`small`,bordered:!0,children:[(0,C.jsx)(p.Item,{label:`采购日期`,children:T.purchase.purchase_date}),(0,C.jsx)(p.Item,{label:`状态`,children:(0,C.jsx)(_,{color:x[T.purchase.status??0]?.color,children:x[T.purchase.status??0]?.text})}),(0,C.jsx)(p.Item,{label:`制单人`,children:T.purchase.operator?.nickname??`-`}),(0,C.jsxs)(p.Item,{label:`预估成本`,children:[`¥`,T.purchase.estimate_amount]}),(0,C.jsxs)(p.Item,{label:`实际成本`,children:[`¥`,T.purchase.actual_amount]}),(0,C.jsx)(p.Item,{label:`总件数`,children:T.purchase.total_quantity}),(0,C.jsx)(p.Item,{label:`总重量`,children:T.purchase.total_weight}),(0,C.jsx)(p.Item,{label:`创建时间`,span:2,children:T.purchase.created_at}),(0,C.jsx)(p.Item,{label:`备注`,span:3,children:T.purchase.remark})]}),(0,C.jsx)(oe,{activeKey:k,onChange:He,className:`mt-3!`,items:[{key:`items`,label:`商品明细`},{key:`stores`,label:`门店购买详情`},{key:`suppliers`,label:`供应商采购明细`},{key:`bills`,label:`门店账单`}]}),k===`stores`?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-2`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(w,{children:`选择门店:`}),(0,C.jsx)(u,{value:A||void 0,onChange:e=>Ue(e),placeholder:`选择门店`,className:`w-60!`,showSearch:!0,optionFilterProp:`label`,options:T.stores.map(e=>({value:e.id,label:e.name}))})]}),(0,C.jsxs)(c,{children:[T.purchase.status===0&&(0,C.jsx)(y,{auth:`purchase.order.update`,children:(0,C.jsx)(l,{icon:(0,C.jsx)(ne,{}),onClick:Ot,children:`新增单品`})}),(0,C.jsx)(y,{auth:`purchase.order.export`,children:(0,C.jsx)(l,{type:`primary`,ghost:!0,icon:(0,C.jsx)(v,{}),onClick:()=>{lt(`current`),B(!0)},children:`导出`})})]})]}),(0,C.jsx)(se,{spinning:Ge,children:j&&j.items.length>0?(0,C.jsx)(s,{rowKey:`product_id`,size:`small`,bordered:!0,columns:Bt,dataSource:j.items,pagination:!1,scroll:{x:`max-content`},summary:Vt}):!Ge&&(0,C.jsx)(d,{image:d.PRESENTED_IMAGE_SIMPLE,description:`该门店在此采购单中无采购商品`,className:`py-8!`})})]}):k===`suppliers`?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-2`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(w,{children:`选择供应商:`}),(0,C.jsx)(u,{value:I||void 0,onChange:e=>{L(e),tt(``)},placeholder:`选择供应商`,className:`w-60!`,showSearch:!0,optionFilterProp:`label`,options:H.map(e=>({value:e.id,label:e.name}))}),(0,C.jsx)(w,{children:`市场:`}),(0,C.jsx)(u,{value:R,onChange:tt,className:`w-40!`,options:[{value:``,label:`全部市场`},...pt.map(e=>({value:e,label:e}))]})]}),(0,C.jsx)(y,{auth:`purchase.order.export`,children:(0,C.jsx)(l,{type:`primary`,ghost:!0,icon:(0,C.jsx)(v,{}),onClick:()=>{ft(`current`),V(!0)},children:`导出`})})]}),U.length>0?(0,C.jsx)(s,{rowKey:`product_id`,size:`small`,bordered:!0,columns:Ht,dataSource:U,pagination:!1,scroll:{x:`max-content`},summary:Ut}):(0,C.jsx)(d,{image:d.PRESENTED_IMAGE_SIMPLE,description:`该供应商在此采购单中无采购明细`,className:`py-8!`})]}):k===`bills`?T.bills.length>0?(0,C.jsx)(s,{rowKey:`id`,size:`small`,bordered:!0,columns:Wt,dataSource:T.bills,pagination:!1,scroll:{x:`max-content`},summary:Gt}):(0,C.jsx)(d,{image:d.PRESENTED_IMAGE_SIMPLE,description:T.purchase.status===0?`采购单完成后可在列表操作列生成账单`:`该采购单暂未生成账单`,className:`py-8!`}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(c,{style:{marginBottom:20},children:[(0,C.jsx)(y,{auth:`purchase.order.export`,children:(0,C.jsx)(l,{type:`primary`,ghost:!0,icon:(0,C.jsx)(v,{}),onClick:()=>{ot(0),it(!0)},children:`导出`})},`export`),(0,C.jsxs)(w,{type:`secondary`,className:`text-xs`,children:[`已对账 `,X.filter(e=>D.has(e)).length,`/`,X.length]}),Nt&&(0,C.jsx)(w,{type:`secondary`,className:`text-xs`,children:`修改保存将同步该商品全部订货明细与商品档案,成本变化时各门店单价按等级上浮自动重算`})]}),(0,C.jsx)(s,{rowKey:`product_id`,size:`small`,bordered:!0,columns:Rt(),dataSource:T.items,onChange:(e,t)=>nt(t),pagination:!1,scroll:{x:900+T?.stores.length*100,y:500},summary:zt})]})]})}),(0,C.jsx)(f,{title:K?`生成账单 · ${K.purchase.purchase_no}`:`生成账单`,open:ht,onCancel:()=>{G(!1),q(null)},onOk:()=>J.submit(),confirmLoading:vt,okText:`确认生成`,okButtonProps:{disabled:xt},width:1280,destroyOnHidden:!0,children:(0,C.jsx)(se,{spinning:gt,children:K&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`div`,{className:`py-2 text-gray-500`,children:[`每个门店单独生成一张账单;商品金额由订单汇总不可修改,请填写各门店的配送费、周转筐/托盘数量(正数=压筐附加金额,负数=回筐抵扣金额)、售后金额(可正负,按客户等级上浮比例折算后计入总金额:如输入 15、上浮 1% 则实收 15.15)与备注(可选,随账单存档)。`,xt?`该采购单已全部生成账单,仅可查看。`:`生成后采购单中的全部订单将关联到对应门店账单。`]}),(0,C.jsx)(m,{form:J,layout:`vertical`,onFinish:It,children:(0,C.jsx)(m.List,{name:`stores`,children:e=>(0,C.jsxs)(`div`,{className:`overflow-hidden rounded border border-gray-200`,children:[(0,C.jsxs)(`div`,{className:`flex bg-gray-50 px-4 py-2 text-sm text-gray-500`,children:[(0,C.jsx)(`div`,{className:`w-40 shrink-0`,children:`门店`}),(0,C.jsx)(`div`,{className:`w-28 shrink-0 text-center`,children:`商品金额`}),(0,C.jsx)(`div`,{className:`w-32 shrink-0 text-center`,children:`配送费(元)`}),(0,C.jsxs)(`div`,{className:`w-32 shrink-0 text-center`,children:[(0,C.jsx)(`div`,{children:`周转筐`}),(0,C.jsxs)(`div`,{children:[`(¥`,K.stores[0]?.box_price??`0.00`,`/个)`]})]}),(0,C.jsxs)(`div`,{className:`w-32 shrink-0 text-center`,children:[(0,C.jsx)(`div`,{children:`周转托盘`}),(0,C.jsxs)(`div`,{children:[`(¥`,K.stores[0]?.tray_price??`0.00`,`/个)`]})]}),(0,C.jsxs)(`div`,{className:`w-50 shrink-0 text-center`,children:[(0,C.jsx)(`div`,{children:`售后金额`}),(0,C.jsx)(`div`,{children:`(元,按等级上浮)`})]}),(0,C.jsx)(`div`,{className:`w-36 shrink-0 text-center`,children:`备注`}),(0,C.jsx)(`div`,{className:`w-28 shrink-0 text-center`,children:`附加金额`}),(0,C.jsx)(`div`,{className:`flex-1 text-center`,children:`账单总金额`})]}),e.map(e=>{let t=K.stores[e.name],n=t?.bill!=null;return(0,C.jsxs)(`div`,{className:`flex items-center border-t border-gray-100 px-4 py-2`,children:[(0,C.jsxs)(`div`,{className:`w-40 shrink-0 pr-2 text-sm`,children:[(0,C.jsx)(`div`,{children:t?.store_name??`-`}),(0,C.jsxs)(`div`,{className:`text-xs text-gray-400`,children:[t?.order_count??0,` 笔订单`,n&&(0,C.jsx)(_,{className:`ml-1!`,color:`success`,children:`已生成`})]}),(0,C.jsx)(`div`,{className:`text-xs text-gray-400`,children:t?.level_name?`${t.level_name} +${Number(t.level_percent??0)}%`:`无等级(不上浮)`})]}),(0,C.jsx)(`div`,{className:`w-28 shrink-0 text-center`,children:(0,C.jsxs)(w,{strong:!0,children:[`¥`,t?.product_amount??`0.00`]})}),(0,C.jsx)(m.Item,{name:[e.name,`store_id`],hidden:!0,children:(0,C.jsx)(h,{})}),(0,C.jsx)(m.Item,{className:`m-0! w-32 shrink-0 px-1! flex justify-center`,name:[e.name,`delivery_fee`],rules:[{required:!0,message:`请输入配送费`}],children:(0,C.jsx)(a,{className:`w-full`,min:0,precision:2,disabled:n,placeholder:`配送费`})}),(0,C.jsx)(m.Item,{className:`m-0! w-32 shrink-0 px-1! flex justify-center`,name:[e.name,`box_num`],rules:[{required:!0,message:`请输入周转筐数量`}],children:(0,C.jsx)(a,{className:`w-full`,precision:0,disabled:n,placeholder:`正压负回`})}),(0,C.jsx)(m.Item,{className:`m-0! w-32 shrink-0 px-1! flex justify-center`,name:[e.name,`tray_num`],rules:[{required:!0,message:`请输入周转托盘数量`}],children:(0,C.jsx)(a,{className:`w-full`,precision:0,disabled:n,placeholder:`正压负回`})}),(0,C.jsx)(`div`,{className:`w-50 shrink-0 px-1! flex justify-center`,children:(0,C.jsxs)(c.Compact,{block:!0,children:[(0,C.jsx)(c.Addon,{children:(0,C.jsxs)(`div`,{className:`text-xs text-orange-500 text-center`,children:[`实收 ¥`,Y[e.name]?.afterSale.toFixed(2)]})}),(0,C.jsx)(m.Item,{className:`m-0!`,name:[e.name,`after_sale`],children:(0,C.jsx)(a,{className:`w-full`,precision:2,prefix:`¥`,disabled:n,placeholder:`可正负,计入总额`})})]})}),(0,C.jsx)(m.Item,{className:`m-0! w-36 shrink-0 px-1!`,name:[e.name,`remark`],children:(0,C.jsx)(h,{maxLength:255,disabled:n,placeholder:`备注(可选)`})}),(0,C.jsxs)(`div`,{className:`w-28 shrink-0 text-center`,children:[`¥`,(n?Number(t.bill.added_amount):Y[e.name]?.added??0).toFixed(2)]}),(0,C.jsxs)(`div`,{className:`flex-1 text-center`,children:[(0,C.jsxs)(w,{strong:!0,type:`danger`,children:[`¥`,(n?Number(t.bill.total_amount):Y[e.name]?.total??0).toFixed(2)]}),n&&(0,C.jsx)(`div`,{className:`text-xs text-gray-400`,children:t.bill.bill_no})]})]},e.key)})]})})})]})})}),(0,C.jsxs)(f,{title:`新增单品 · ${j?.store?.name??``}`,open:qe,onCancel:()=>M(!1),onOk:()=>Xe.submit(),confirmLoading:Je,okText:`添加`,destroyOnHidden:!0,children:[(0,C.jsx)(`div`,{className:`py-2 text-gray-500`,children:`单品将挂靠到该门店在此采购单中的最新一笔订单;单价按门店等级上浮比例自动换算。`}),(0,C.jsxs)(m,{form:Xe,layout:`vertical`,onFinish:kt,children:[(0,C.jsx)(m.Item,{label:`商品`,name:`product_id`,rules:[{required:!0,message:`请选择商品`}],children:(0,C.jsx)(u,{showSearch:{optionFilterProp:`label`},placeholder:`搜索并选择商品`,options:Ze.map(e=>({value:e.id,label:`${e.name}${e.spec?`(${e.spec})`:``}`}))})}),(0,C.jsx)(m.Item,{label:`采购数量`,name:`quantity`,rules:[{required:!0,message:`请输入采购数量`}],children:(0,C.jsx)(a,{className:`w-full`,min:1,precision:0,placeholder:`请输入采购数量(包数)`})}),(0,C.jsx)(m.Item,{label:`称重(斤,可选)`,name:`weight`,children:(0,C.jsx)(a,{className:`w-full`,min:0,precision:3,placeholder:`请输入称重`})})]})]}),(0,C.jsxs)(f,{title:N?`编辑「${N.product_name}」`:`编辑单品`,open:N!==null,onCancel:()=>P(null),onOk:()=>F.submit(),confirmLoading:$e,okText:`保存`,destroyOnHidden:!0,children:[(0,C.jsx)(`div`,{className:`py-2 text-gray-500`,children:`修改保存后,系统将自动重算明细金额、订货单与采购单汇总。`}),(0,C.jsxs)(m,{form:F,layout:`vertical`,onFinish:jt,children:[(0,C.jsx)(m.Item,{label:`单价(元)`,name:`price`,rules:[{required:!0,message:`请输入单价`}],children:(0,C.jsx)(a,{className:`w-full`,min:0,precision:2,placeholder:`请输入单价`})}),(0,C.jsx)(m.Item,{label:`采购数量`,name:`quantity`,rules:[{required:!0,message:`请输入采购数量`}],children:(0,C.jsx)(a,{className:`w-full`,min:0,precision:0,placeholder:`请输入采购数量`})}),(0,C.jsx)(m.Item,{label:`称重(斤)`,name:`weight`,rules:[{required:!0,message:`请输入称重`}],children:(0,C.jsx)(a,{className:`w-full`,min:0,precision:3,placeholder:`请输入称重`})})]})]}),(0,C.jsxs)(f,{title:`导出商品明细`,open:rt,onCancel:()=>it(!1),onOk:()=>{T&&Se(T.purchase.id,at>0?at:void 0),it(!1)},okText:`导出`,destroyOnHidden:!0,children:[(0,C.jsx)(`div`,{className:`py-2 text-gray-500`,children:`导出系统全部商品行(无订货的商品数量为 0),门店列附数量合计与突出颜色。`}),(0,C.jsxs)(`div`,{className:`flex items-center gap-2 py-2`,children:[(0,C.jsx)(w,{children:`供应商:`}),(0,C.jsx)(u,{value:at,onChange:ot,className:`flex-1`,options:[{value:0,label:`全部供应商`},...H.map(e=>({value:e.id,label:e.name}))]})]})]}),(0,C.jsx)(f,{title:`导出门店购买详情`,open:st,onCancel:()=>B(!1),onOk:()=>{T&&_e(T.purchase.id,ct===`current`&&A>0?A:void 0),B(!1)},okText:`导出`,destroyOnHidden:!0,children:(0,C.jsx)(ae.Group,{className:`py-2`,value:ct,onChange:e=>lt(e.target.value),options:[{value:`current`,label:`当前门店(${T?.stores.find(e=>e.id===A)?.name??`-`})`},{value:`all`,label:`全部门店(合并为一个 XLSX,每门店一个工作表)`}]})}),(0,C.jsxs)(f,{title:`导出供应商采购明细`,open:ut,onCancel:()=>V(!1),onOk:()=>{T&&pe(T.purchase.id,dt===`current`&&I>0?I:void 0),V(!1)},okText:`导出`,destroyOnHidden:!0,children:[(0,C.jsx)(`div`,{className:`py-2 text-gray-500`,children:`导出 XLSX 按「供应商 × 市场」拆分工作表,列序:品名、汇总、市场、各门店明细,有数据的单元格突出显示。`}),(0,C.jsx)(ae.Group,{className:`py-2`,value:dt,onChange:e=>ft(e.target.value),options:[{value:`current`,label:`当前供应商(${H.find(e=>e.id===I)?.name??`-`})`},{value:`all`,label:`全部供应商(合并为一个 XLSX,每供应商×市场一个工作表)`}]})]})]})};export{Me as default}; \ No newline at end of file diff --git a/public/assets/order-CzJfBGxK.js b/public/assets/order-CzJfBGxK.js new file mode 100644 index 0000000..fa6dc7a --- /dev/null +++ b/public/assets/order-CzJfBGxK.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"./typography-DRFhazK9.js";import{L as i,V as a,a as o,k as ee}from"./lodash-DzOfPy0f.js";import{t as te}from"./tooltip-SaeG1Uv7.js";import{t as ne}from"./PlusOutlined-B8K2rG8r.js";import{t as s}from"./table-BXi9q3AE.js";import{t as c}from"./space-Cu4QVMgQ.js";import{h as re}from"./style-BmYds38x.js";import{t as l}from"./button-BILozH6U.js";import{r as u}from"./DoubleRightOutlined-Blfli1UU.js";import{t as d}from"./empty-_1ZFK8yy.js";import{s as ie}from"./XinForm-BPDYdeax.js";import{t as ae}from"./radio-CxFl70_7.js";import{n as oe}from"./card-DU2T2-YW.js";import{t as se}from"./spin-CfJYIffX.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 ce}from"./CopyOutlined-pYq9KfGb.js";import{r as g}from"./PictureOutlined-CB8Pr7jP.js";import{t as le}from"./popconfirm-DyseZgpU.js";import{t as _}from"./tag-DBV1bHre.js";import{t as ue}from"./DeleteOutlined-DwOvobSM.js";import{t as v}from"./DownloadOutlined-DJY9Mu8c.js";import{t as de}from"./XinTable-DOLiJ5rL.js";import{t as y}from"./AuthButton-DvrpreK4.js";import{o as fe}from"./goods-DPA1smJU.js";import{a as pe,c as me,d as he,f as ge,i as _e,l as ve,m as ye,n as be,o as xe,p as Se,r as Ce,t as we,u as Te}from"./order-C6L8DsOz.js";import{n as b,t as Ee}from"./iPurchaseOrder-Dn-laOqY.js";import{t as De}from"./supplier-BstAcwv7.js";import{t as Oe}from"./useAuth-AiNV0bRw.js";var x=e(t(),1),S=n(),{Title:ke,Text:C}=r,Ae={product_name:`品名`,supplier_id:`供应商`,product_spec:`包规`,unit:`单位`,cost_price:`成本`},je=(e,t)=>{let n=parseFloat(t);return Number.isFinite(n)&&n>0?e/n:e},Me=(e,t)=>Math.trunc(e*(100+t))/100,w=e=>e.target.select(),Ne=()=>{let e=(0,x.useRef)(null),{auth:t}=Oe(),[n,r]=(0,x.useState)(!1),[Ne,Pe]=(0,x.useState)(1200),[T,E]=(0,x.useState)(null),[Fe,Ie]=(0,x.useState)(!1),[Le,Re]=(0,x.useState)(!1),[D,O]=(0,x.useState)(new Set),[ze,Be]=(0,x.useState)(!1),[Ve,He]=(0,x.useState)([]),[k,Ue]=(0,x.useState)(`items`),[A,We]=(0,x.useState)(0),[j,Ge]=(0,x.useState)(null),[Ke,qe]=(0,x.useState)(!1),[Je,M]=(0,x.useState)(!1),[Ye,Xe]=(0,x.useState)(!1),[N]=m.useForm(),[Ze,Qe]=(0,x.useState)([]),[P,F]=(0,x.useState)(null),[$e,et]=(0,x.useState)(!1),[tt]=m.useForm(),[I,L]=(0,x.useState)(0),[R,nt]=(0,x.useState)(``),[z,rt]=(0,x.useState)({}),[it,B]=(0,x.useState)(!1),[V,at]=(0,x.useState)(0),[ot,H]=(0,x.useState)(!1),[st,ct]=(0,x.useState)(`current`),[lt,U]=(0,x.useState)(!1),[ut,dt]=(0,x.useState)(`current`),W=(0,x.useMemo)(()=>{let e=new Map;return(T?.items??[]).forEach(t=>{t.supplier_id>0&&t.supplier?.name&&e.set(t.supplier_id,t.supplier.name)}),Array.from(e,([e,t])=>({id:e,name:t}))},[T?.items]),ft=(0,x.useMemo)(()=>{let e=new Set;return(T?.items??[]).forEach(t=>{t.supplier_id===I&&t.market&&e.add(t.market)}),Array.from(e)},[T?.items,I]),G=(0,x.useMemo)(()=>!T||I<=0?[]:T.items.filter(e=>e.supplier_id===I).filter(e=>R===``||(e.market??``)===R).map(e=>({product_id:e.product_id,product_name:e.product_name,product_spec:e.product_spec,unit:e.unit,market:e.market,cost_price:String(e.cost_price),quantity:e.quantity,weight:String(e.weight),amount:(e.quantity*Number(e.cost_price)).toFixed(2)})),[T,I,R]),pt=(0,x.useMemo)(()=>{let e=new Set;return(T?.items??[]).forEach(t=>{t.market&&e.add(t.market)}),Array.from(e)},[T?.items]),mt=(0,x.useMemo)(()=>{let e=z.supplier,t=z.market;return(T?.items??[]).filter(t=>!e?.length||e.includes(t.supplier_id)).filter(e=>!t?.length||t.includes(e.market??``))},[T?.items,z]),[ht,gt]=(0,x.useState)(!1),[K,q]=(0,x.useState)(null),[_t,vt]=(0,x.useState)(!1),[yt,bt]=(0,x.useState)(!1),[J]=m.useForm(),xt=m.useWatch(`stores`,J)??[],St=(K?.stores??[]).map((e,t)=>{let n=xt[t]??{},r=Number(n.delivery_fee??0),i=Number(e.level_percent??0),a=Me(Number(n.after_sale??0),i),o=Number(n.box_num??0)*Number(e.box_price)+Number(n.tray_num??0)*Number(e.tray_price);return{added:o,afterSale:a,total:Number(e.product_amount)+r+o+a}}),Ct=(K?.stores??[]).length>0&&K.stores.every(e=>e.bill!==null);(0,x.useEffect)(()=>{De().then(e=>He(e.data.data??[]))},[]),(0,x.useEffect)(()=>{T&&T.stores.length>0&&We(e=>T.stores.some(t=>t.id===e)?e:T.stores[0].id)},[T]),(0,x.useEffect)(()=>{W.length>0?L(e=>W.some(t=>t.id===e)?e:W[0].id):L(0)},[W]),(0,x.useEffect)(()=>{n&&k===`stores`&&T&&A>0&&Ot()},[n,k,A,T?.purchase.id]),(0,x.useEffect)(()=>{O(new Set(T?.checked_product_ids??[]))},[T]);let wt=async e=>{if(!T)return;let t=!D.has(e);O(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r});try{await ge(T.purchase.id,e)}catch{O(n=>{let r=new Set(n);return t?r.delete(e):r.add(e),r})}},Y=(0,x.useMemo)(()=>mt.map(e=>e.product_id),[mt]),X=Y.length>0&&Y.every(e=>D.has(e)),Tt=async()=>{if(!T||Y.length===0||ze)return;let e=!X;O(t=>{let n=new Set(t);return Y.forEach(t=>{e?n.add(t):n.delete(t)}),n}),Be(!0);try{await be(T.purchase.id,Y,e)}catch{O(t=>{let n=new Set(t);return Y.forEach(t=>{e?n.delete(t):n.add(t)}),n})}finally{Be(!1)}},Et=async e=>{Ie(!0);try{let t=await ve(e);E(t.data.data??null)}finally{Ie(!1)}},Dt=async e=>{Ue(`items`),Ge(null),rt({}),r(!0),await Et(e)},Ot=async()=>{if(!(!T||A<=0)){qe(!0);try{let e=await Te(T.purchase.id,A);Ge(e.data.data??null)}finally{qe(!1)}}},kt=async()=>{await Ot(),T&&await Et(T.purchase.id),await e.current?.reload()},At=()=>{N.resetFields(),M(!0),Ze.length===0&&fe().then(e=>Qe(e.data.data??[]))},jt=async e=>{if(!(!T||A<=0)){Xe(!0);try{await we(T.purchase.id,A,e),g.success(`已添加单品,订货单与采购单汇总已重算`),M(!1),await kt()}finally{Xe(!1)}}},Mt=e=>{F(e),tt.setFieldsValue({quantity:e.quantity,price:Number(e.price??0),weight:Number(e.weight??0)})},Nt=async e=>{if(!(!T||!P||A<=0)){et(!0);try{await ye(T.purchase.id,A,P.product_id,e),g.success(`单品已更新,订货单与采购单汇总已重算`),F(null),await kt()}finally{et(!1)}}},Pt=async e=>{!T||A<=0||(await he(T.purchase.id,A,e.product_id),g.success(`已移除单品,订货单与采购单汇总已重算`),await kt())},Z=T?.purchase.status===0&&t(`purchase.order.update`),Q=async(t,n,r)=>{if(!T)return;let i={product_name:t.product_name,supplier_id:t.supplier_id,product_spec:t.product_spec,unit:t.unit,cost_price:Number(t.cost_price)};if(n===`cost_price`){let e=Number(r);if(r===``||!Number.isFinite(e)||e<0){g.warning(`成本无效,已取消修改`);return}if(e===Number(t.cost_price))return;i.cost_price=e}else if(n===`supplier_id`){let e=Number(r);if(e===t.supplier_id)return;i.supplier_id=e}else{let e=String(r).trim();if(!e){g.warning(`${Ae[n]}不能为空,已取消修改`);return}if(e===t[n])return;i[n]=e}if(i.supplier_id<=0){g.warning(`请先通过供应商单元格为该商品设置供应商`);return}let a=await Se(T.purchase.id,t.product_id,i);g.success(`已更新 ${a.data.data?.count??0} 条订货明细`);let o=await ve(T.purchase.id);E(o.data.data??null),await e.current?.reload()},Ft=async(t,n,r)=>{if(!T)return;let i=Number(r);if(r.trim()===``||!Number.isInteger(i)||i<0){g.warning(`订货量无效,已取消修改`);return}if(i===t.cells[n])return;await ye(T.purchase.id,n,t.product_id,{quantity:i});let a=await ve(T.purchase.id);E(a.data.data??null),g.success(`订货量已更新,订货单与采购单汇总已重算`),await e.current?.reload()},$=(e,t,n)=>Z?t===`supplier_id`?(0,S.jsx)(u,{size:`small`,className:`w-full`,value:e.supplier_id>0?e.supplier_id:void 0,placeholder:`选择供应商`,showSearch:{optionFilterProp:`label`},options:Ve.map(e=>({value:e.id,label:e.name})),onChange:n=>void Q(e,t,n)}):t===`cost_price`?(0,S.jsx)(a,{size:`small`,min:0,precision:2,prefix:`¥`,className:`w-full`,defaultValue:Number(e.cost_price),onFocus:w,onPressEnter:n=>void Q(e,t,n.target.value),onBlur:n=>void Q(e,t,n.target.value)},`${e.product_id}-cost-${e.cost_price}`):(0,S.jsx)(h,{size:`small`,style:{textAlign:`center`},defaultValue:e[t],maxLength:t===`unit`?20:100,onFocus:w,onPressEnter:n=>void Q(e,t,n.target.value),onBlur:n=>void Q(e,t,n.target.value)},`${e.product_id}-${t}-${e[t]}`):n,It=async e=>{gt(!0),vt(!0),q(null);try{let t=(await me(e)).data.data??null;q(t),J.setFieldsValue({stores:(t?.stores??[]).map(e=>({store_id:e.store_id,delivery_fee:e.bill?Number(e.bill.delivery_fee):0,box_num:e.bill?e.bill.box_num:0,tray_num:e.bill?e.bill.tray_num:0,after_sale:e.bill?Number(e.bill.after_sale):0,remark:e.bill?.remark??``}))})}finally{vt(!1)}},Lt=async t=>{if(K){bt(!0);try{let n=await xe(K.purchase.id,t.stores);g.success(`已生成 ${n.data.data?.count??0} 张门店账单,采购单订单已关联`),gt(!1),q(null),await e.current?.reload(),T&&T.purchase.id===K.purchase.id&&await Et(T.purchase.id)}finally{bt(!1)}}},Rt=async t=>{Re(!0);try{await ie(`/purchase/order/${t}/finish`,{status:3}),g.success(`采购单已标记完成`),await e.current?.reload()}finally{Re(!1)}},zt=()=>{let e=[{title:`品名`,dataIndex:`product_name`,width:160,align:`center`,fixed:`left`,ellipsis:!0,render:(e,t)=>$(t,`product_name`,t.product_name)},{title:`供应商`,dataIndex:`supplier`,width:110,align:`center`,fixed:`left`,filters:W.map(e=>({text:e.name,value:e.id})),filteredValue:z.supplier??null,onFilter:(e,t)=>t.supplier_id===Number(e),render:(e,t)=>$(t,`supplier_id`,t.supplier?.name??`-`)},{title:(0,S.jsxs)(c,{size:4,children:[(0,S.jsx)(`span`,{children:`市场`}),(0,S.jsx)(te,{title:`${X?`取消全选`:`全选对账`}(仅作用于当前筛选显示的 ${Y.length} 行)`,children:(0,S.jsx)(l,{size:`small`,shape:`circle`,style:{minWidth:16,height:16,width:16},icon:(0,S.jsx)(re,{}),color:X?`green`:`default`,variant:X?`solid`:`outlined`,loading:ze,disabled:Y.length===0,onClick:()=>void Tt()})})]}),fixed:`left`,dataIndex:`market`,width:90,align:`center`,filters:pt.map(e=>({text:e,value:e})),filteredValue:z.market??null,onFilter:(e,t)=>(t.market??``)===e,render:(e,t)=>{let n=D.has(t.product_id);return(0,S.jsxs)(c,{size:4,children:[(0,S.jsx)(`span`,{children:e||`-`}),(0,S.jsx)(l,{size:`small`,shape:`circle`,style:{minWidth:16,height:16,width:16},icon:(0,S.jsx)(re,{}),color:n?`green`:`default`,variant:n?`solid`:`outlined`,onClick:()=>void wt(t.product_id)})]})}},{title:`单价`,key:`retail_price`,width:90,align:`center`,render:(e,t)=>{let n=Number(t.quantity??0);return n<=0?(0,S.jsx)(C,{type:`secondary`,children:`-`}):`¥${je(Number(t.amount??0)/n,t.product_spec??``).toFixed(2)}`}},{title:`包规`,dataIndex:`product_spec`,align:`center`,width:90,render:(e,t)=>$(t,`product_spec`,e||`-`)},{title:`单位`,dataIndex:`unit`,width:90,align:`center`,render:(e,t)=>$(t,`unit`,e||`-`)},{title:`成本`,dataIndex:`cost_price`,width:120,align:`center`,render:(e,t)=>$(t,`cost_price`,`¥${Number(e).toFixed(2)}`)},{title:`合计数量`,key:`total_quantity`,width:110,align:`center`,render:(e,t)=>(0,S.jsx)(C,{strong:!0,children:t.quantity})}],t=(T?.stores??[]).map(e=>({title:(0,S.jsx)(`span`,{className:`text-[red]`,children:e.name}),key:`store-${e.id}`,align:`center`,render:(t,n)=>{let r=n.cells[e.id];return r===void 0?(0,S.jsx)(C,{type:`secondary`,children:`-`}):Z?(0,S.jsx)(a,{size:`small`,min:0,styles:{input:{textAlign:`center`},root:{width:80}},precision:0,className:`w-full`,defaultValue:r,onFocus:w,onPressEnter:t=>void Ft(n,e.id,t.target.value),onBlur:t=>void Ft(n,e.id,t.target.value)},`${n.product_id}-${e.id}-${r}`):r}}));return[...e,...t]},Bt=()=>{let e=T?.stores??[],t=mt,n=e.map(e=>t.reduce((t,n)=>t+(n.cells[e.id]??0)*Number(n.cost_price),0)),r=t.reduce((e,t)=>e+Number(t.quantity),0),i=n.reduce((e,t)=>e+t,0);return(0,S.jsxs)(s.Summary.Row,{children:[(0,S.jsx)(s.Summary.Cell,{index:0,colSpan:7,align:`center`,children:(0,S.jsxs)(c,{size:16,children:[(0,S.jsx)(C,{strong:!0,children:`成本统计(按门店)`}),(0,S.jsxs)(C,{strong:!0,type:`danger`,children:[`总计 ¥`,i.toFixed(2)]})]})}),(0,S.jsx)(s.Summary.Cell,{index:7,align:`center`,children:(0,S.jsx)(C,{strong:!0,children:r})}),n.map((t,n)=>(0,S.jsx)(s.Summary.Cell,{index:8+n,align:`center`,children:(0,S.jsxs)(C,{strong:!0,children:[`¥`,t.toFixed(2)]})},e[n].id))]})},Vt=[{title:`商品`,dataIndex:`product_name`,width:160,align:`center`},{title:`市场`,dataIndex:`market`,width:90,align:`center`,render:e=>e||`-`},{title:`单价`,key:`retail_price`,width:130,align:`center`,render:(e,t)=>`¥${je(Number(t.price),t.product_spec).toFixed(2)}`},{title:`包规`,dataIndex:`product_spec`,width:90,align:`center`,render:e=>e||`-`},{title:`单位`,dataIndex:`unit`,width:90,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,S.jsx)(C,{strong:!0,children:e})},{title:`重量`,dataIndex:`weight`,width:90,align:`center`,render:e=>`${e||`-`}斤`},{title:`预计金额`,dataIndex:`amount`,width:110,align:`center`,render:e=>(0,S.jsxs)(C,{strong:!0,children:[`¥`,Number(e).toFixed(2)]})},{title:`操作`,key:`action`,width:130,align:`center`,render:(e,t)=>T?.purchase.status===0?(0,S.jsxs)(c,{size:0,children:[(0,S.jsx)(y,{auth:`purchase.order.update`,children:(0,S.jsx)(l,{type:`link`,size:`small`,icon:(0,S.jsx)(ce,{}),onClick:()=>Mt(t),children:`编辑`})}),(0,S.jsx)(y,{auth:`purchase.order.update`,children:(0,S.jsx)(le,{title:`移除该单品?`,description:`将从「${j?.store?.name??`该门店`}」采购明细中移除「${t.product_name}」`,onConfirm:()=>Pt(t),children:(0,S.jsx)(l,{type:`link`,size:`small`,danger:!0,icon:(0,S.jsx)(ue,{}),children:`移除`})})})]}):(0,S.jsx)(C,{type:`secondary`,children:`-`})}],Ht=()=>{let e=j?.items??[],t=e.reduce((e,t)=>e+Number(t.quantity),0),n=e.reduce((e,t)=>e+Number(t.amount),0),r=e.reduce((e,t)=>e+Number(t.weight),0);return(0,S.jsxs)(s.Summary.Row,{children:[(0,S.jsx)(s.Summary.Cell,{index:0,colSpan:6,align:`center`,children:(0,S.jsx)(C,{strong:!0,children:`合计`})}),(0,S.jsx)(s.Summary.Cell,{index:6,align:`center`,children:(0,S.jsx)(C,{strong:!0,children:t})}),(0,S.jsx)(s.Summary.Cell,{index:7,align:`center`,children:(0,S.jsxs)(C,{strong:!0,children:[r.toFixed(3),`斤`]})}),(0,S.jsx)(s.Summary.Cell,{index:8,align:`center`,children:(0,S.jsxs)(C,{strong:!0,type:`danger`,children:[`¥`,n.toFixed(2)]})}),(0,S.jsx)(s.Summary.Cell,{index:9,align:`center`,children:(0,S.jsx)(C,{strong:!0,children:`-`})})]})},Ut=[{title:`品名`,dataIndex:`product_name`,width:180,align:`center`},{title:`市场`,dataIndex:`market`,width:100,align:`center`,render:e=>e||`-`},{title:`包规`,dataIndex:`product_spec`,width:110,align:`center`,render:e=>e||`-`},{title:`单位`,dataIndex:`unit`,width:90,align:`center`,render:e=>e||`-`},{title:`成本价`,dataIndex:`cost_price`,width:110,align:`center`,render:e=>`¥${Number(e).toFixed(2)}`},{title:`数量`,dataIndex:`quantity`,width:100,align:`center`,render:e=>(0,S.jsx)(C,{strong:!0,children:e})},{title:`重量`,dataIndex:`weight`,width:110,align:`center`,render:e=>`${Number(e).toFixed(3)}斤`},{title:`金额`,dataIndex:`amount`,width:120,align:`center`,render:e=>(0,S.jsxs)(C,{strong:!0,children:[`¥`,Number(e).toFixed(2)]})}],Wt=()=>{let e=G.reduce((e,t)=>e+Number(t.quantity),0),t=G.reduce((e,t)=>e+Number(t.weight),0),n=G.reduce((e,t)=>e+Number(t.amount),0);return(0,S.jsxs)(s.Summary.Row,{children:[(0,S.jsx)(s.Summary.Cell,{index:0,colSpan:5,align:`center`,children:(0,S.jsx)(C,{strong:!0,children:`合计`})}),(0,S.jsx)(s.Summary.Cell,{index:5,align:`center`,children:(0,S.jsx)(C,{strong:!0,children:e})}),(0,S.jsx)(s.Summary.Cell,{index:6,align:`center`,children:(0,S.jsxs)(C,{strong:!0,children:[t.toFixed(3),`斤`]})}),(0,S.jsx)(s.Summary.Cell,{index:7,align:`center`,children:(0,S.jsxs)(C,{strong:!0,type:`danger`,children:[`¥`,n.toFixed(2)]})})]})},Gt=[{title:`门店`,dataIndex:`store_name`,width:140,align:`center`},{title:`账单号`,dataIndex:`bill_no`,width:180,align:`center`,render:e=>(0,S.jsx)(C,{copyable:{text:e},children:e})},{title:`账单日期`,dataIndex:`bill_date`,width:110,align:`center`},{title:`商品金额`,dataIndex:`product_amount`,width:110,align:`center`,render:e=>`¥${Number(e).toFixed(2)}`},{title:`配送费`,dataIndex:`delivery_fee`,width:100,align:`center`,render:e=>`¥${Number(e).toFixed(2)}`},{title:`周转筐`,key:`box`,width:110,align:`center`,render:(e,t)=>`${t.box_num} × ¥${Number(t.box_price).toFixed(2)}`},{title:`周转托盘`,key:`tray`,width:110,align:`center`,render:(e,t)=>`${t.tray_num} × ¥${Number(t.tray_price).toFixed(2)}`},{title:`附加金额`,dataIndex:`added_amount`,width:100,align:`center`,render:e=>`¥${Number(e).toFixed(2)}`},{title:`账单总金额`,dataIndex:`total_amount`,width:120,align:`center`,render:e=>(0,S.jsxs)(C,{strong:!0,type:`danger`,children:[`¥`,Number(e).toFixed(2)]})},{title:`支付状态`,dataIndex:`status`,width:100,align:`center`,render:e=>{let t=Ee[Number(e??0)];return(0,S.jsx)(_,{color:t?.color,children:t?.text})}}],Kt=()=>{let e=T?.bills??[],t=e.reduce((e,t)=>e+Number(t.product_amount),0),n=e.reduce((e,t)=>e+Number(t.delivery_fee),0),r=e.reduce((e,t)=>e+Number(t.added_amount),0),i=e.reduce((e,t)=>e+Number(t.total_amount),0);return(0,S.jsxs)(s.Summary.Row,{children:[(0,S.jsx)(s.Summary.Cell,{index:0,colSpan:3,align:`center`,children:(0,S.jsx)(C,{strong:!0,children:`合计`})}),(0,S.jsx)(s.Summary.Cell,{index:3,align:`center`,children:(0,S.jsxs)(C,{strong:!0,children:[`¥`,t.toFixed(2)]})}),(0,S.jsx)(s.Summary.Cell,{index:4,align:`center`,children:(0,S.jsxs)(C,{strong:!0,children:[`¥`,n.toFixed(2)]})}),(0,S.jsx)(s.Summary.Cell,{index:5,colSpan:2,align:`center`,children:(0,S.jsx)(C,{strong:!0,children:`-`})}),(0,S.jsx)(s.Summary.Cell,{index:7,align:`center`,children:(0,S.jsxs)(C,{strong:!0,children:[`¥`,r.toFixed(2)]})}),(0,S.jsx)(s.Summary.Cell,{index:8,align:`center`,children:(0,S.jsxs)(C,{strong:!0,type:`danger`,children:[`¥`,i.toFixed(2)]})}),(0,S.jsx)(s.Summary.Cell,{index:9,align:`center`,children:(0,S.jsx)(C,{strong:!0,children:`-`})})]})},qt=[{title:`采购单号`,dataIndex:`purchase_no`,valueType:`text`,hideInForm:!0,align:`center`,width:260,render:(e,t)=>(0,S.jsx)(C,{copyable:{text:t.purchase_no},children:t.purchase_no})},{title:`采购日期`,dataIndex:`purchase_date`,valueType:`date`,align:`center`,hideInForm:!0,render:(e,t)=>t.purchase_date},{title:`预估成本`,dataIndex:`estimate_amount`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>`¥${t.estimate_amount}`},{title:`实际成本`,dataIndex:`actual_amount`,hideInTable:!0,hideInSearch:!0,valueType:`digit`,fieldProps:{min:0,precision:3,placeholder:`请输入单价`,onFocus:w},align:`center`},{title:`账单总金额`,dataIndex:`bill_total_amount`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>t.bill_total_amount==null?(0,S.jsx)(C,{type:`secondary`,children:`未生成账单`}):(0,S.jsxs)(C,{strong:!0,type:`danger`,children:[`¥`,Number(t.bill_total_amount).toFixed(2)]})},{title:`商品金额`,dataIndex:`bill_product_amount`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>t.bill_product_amount==null?(0,S.jsx)(C,{type:`secondary`,children:`未生成账单`}):(0,S.jsxs)(C,{strong:!0,type:`danger`,children:[`¥`,Number(t.bill_product_amount).toFixed(2)]})},{title:`总件数`,dataIndex:`total_quantity`,hideInForm:!0,hideInSearch:!0,align:`center`},{title:`备注`,dataIndex:`remark`,valueType:`textarea`,hideInTable:!0,hideInSearch:!0,fieldProps:{onFocus:w}},{title:`总重量`,dataIndex:`total_weight`,hideInForm:!0,hideInSearch:!0,align:`center`,render:(e,t)=>`${t.total_weight}斤`},{title:`状态`,dataIndex:`status`,valueType:`select`,hideInForm:!0,fieldProps:{options:Object.entries(b).map(([e,t])=>({value:Number(e),label:t.text}))},render:(e,t)=>{let n=b[t.status??0];return(0,S.jsx)(_,{color:n?.color,children:n?.text})},align:`center`},{title:`制单人`,dataIndex:`operator`,hideInForm:!0,hideInSearch:!0,render:(e,t)=>t.operator?.nickname??`-`,align:`center`}];return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`mb-5`,children:[(0,S.jsx)(ke,{level:3,children:`采购单`}),(0,S.jsx)(C,{type:`secondary`,children:`在「门店订单」页勾选已接单订单合并生成采购单;采购单支持修改订单信息。`})]}),(0,S.jsx)(de,{api:`/purchase/order`,columns:qt,rowKey:`id`,accessName:`purchase.order`,tableRef:e,operateRender:(e,t)=>[e.status===0?t.edit:null,(0,S.jsx)(l,{size:`small`,icon:(0,S.jsx)(o,{}),type:`primary`,onClick:()=>Dt(e.id)},`detail`),e.status===0?(0,S.jsx)(y,{auth:`purchase.order.update`,children:(0,S.jsx)(le,{title:`确认该采购单已完成?`,description:`已完成采购单将锁定,不能再修改订单信息`,onConfirm:()=>Rt(e.id),children:(0,S.jsx)(l,{type:`primary`,size:`small`,variant:`solid`,color:`green`,loading:Le,children:`完成采购`})})}):(0,S.jsx)(y,{auth:`purchase.order.bill`,children:(0,S.jsx)(l,{type:`primary`,size:`small`,variant:`solid`,color:`orange`,icon:(0,S.jsx)(ee,{}),onClick:()=>It(e.id),children:`生成账单`})})],operateProps:{width:300},formProps:!1}),(0,S.jsx)(i,{title:T?`采购单 ${T.purchase.purchase_no}`:`采购单详情`,open:n,onClose:()=>r(!1),size:Ne,resizable:{onResize:e=>Pe(e)},loading:Fe,children:T&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(ke,{level:5,className:`mb-3!`,children:`采购单信息`}),(0,S.jsxs)(p,{column:3,size:`small`,bordered:!0,children:[(0,S.jsx)(p.Item,{label:`采购日期`,children:T.purchase.purchase_date}),(0,S.jsx)(p.Item,{label:`状态`,children:(0,S.jsx)(_,{color:b[T.purchase.status??0]?.color,children:b[T.purchase.status??0]?.text})}),(0,S.jsx)(p.Item,{label:`制单人`,children:T.purchase.operator?.nickname??`-`}),(0,S.jsxs)(p.Item,{label:`预估成本`,children:[`¥`,T.purchase.estimate_amount]}),(0,S.jsxs)(p.Item,{label:`实际成本`,children:[`¥`,T.purchase.actual_amount]}),(0,S.jsx)(p.Item,{label:`总件数`,children:T.purchase.total_quantity}),(0,S.jsx)(p.Item,{label:`总重量`,children:T.purchase.total_weight}),(0,S.jsx)(p.Item,{label:`创建时间`,span:2,children:T.purchase.created_at}),(0,S.jsx)(p.Item,{label:`备注`,span:3,children:T.purchase.remark})]}),(0,S.jsx)(oe,{activeKey:k,onChange:Ue,className:`mt-3!`,items:[{key:`items`,label:`商品明细`},{key:`stores`,label:`门店购买详情`},{key:`suppliers`,label:`供应商采购明细`},{key:`bills`,label:`门店账单`}]}),k===`stores`?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-2`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(C,{children:`选择门店:`}),(0,S.jsx)(u,{value:A||void 0,onChange:e=>We(e),placeholder:`选择门店`,className:`w-60!`,showSearch:!0,optionFilterProp:`label`,options:T.stores.map(e=>({value:e.id,label:e.name}))})]}),(0,S.jsxs)(c,{children:[T.purchase.status===0&&(0,S.jsx)(y,{auth:`purchase.order.update`,children:(0,S.jsx)(l,{icon:(0,S.jsx)(ne,{}),onClick:At,children:`新增单品`})}),(0,S.jsx)(y,{auth:`purchase.order.export`,children:(0,S.jsx)(l,{type:`primary`,ghost:!0,icon:(0,S.jsx)(v,{}),onClick:()=>{ct(`current`),H(!0)},children:`导出`})})]})]}),(0,S.jsx)(se,{spinning:Ke,children:j&&j.items.length>0?(0,S.jsx)(s,{rowKey:`product_id`,size:`small`,bordered:!0,columns:Vt,dataSource:j.items,pagination:!1,scroll:{x:`max-content`},summary:Ht}):!Ke&&(0,S.jsx)(d,{image:d.PRESENTED_IMAGE_SIMPLE,description:`该门店在此采购单中无采购商品`,className:`py-8!`})})]}):k===`suppliers`?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-2`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(C,{children:`选择供应商:`}),(0,S.jsx)(u,{value:I||void 0,onChange:e=>{L(e),nt(``)},placeholder:`选择供应商`,className:`w-60!`,showSearch:!0,optionFilterProp:`label`,options:W.map(e=>({value:e.id,label:e.name}))}),(0,S.jsx)(C,{children:`市场:`}),(0,S.jsx)(u,{value:R,onChange:nt,className:`w-40!`,options:[{value:``,label:`全部市场`},...ft.map(e=>({value:e,label:e}))]})]}),(0,S.jsx)(y,{auth:`purchase.order.export`,children:(0,S.jsx)(l,{type:`primary`,ghost:!0,icon:(0,S.jsx)(v,{}),onClick:()=>{dt(`current`),U(!0)},children:`导出`})})]}),G.length>0?(0,S.jsx)(s,{rowKey:`product_id`,size:`small`,bordered:!0,columns:Ut,dataSource:G,pagination:!1,scroll:{x:`max-content`},summary:Wt}):(0,S.jsx)(d,{image:d.PRESENTED_IMAGE_SIMPLE,description:`该供应商在此采购单中无采购明细`,className:`py-8!`})]}):k===`bills`?T.bills.length>0?(0,S.jsx)(s,{rowKey:`id`,size:`small`,bordered:!0,columns:Gt,dataSource:T.bills,pagination:!1,scroll:{x:`max-content`},summary:Kt}):(0,S.jsx)(d,{image:d.PRESENTED_IMAGE_SIMPLE,description:T.purchase.status===0?`采购单完成后可在列表操作列生成账单`:`该采购单暂未生成账单`,className:`py-8!`}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(c,{style:{marginBottom:20},children:[(0,S.jsx)(y,{auth:`purchase.order.export`,children:(0,S.jsx)(l,{type:`primary`,ghost:!0,icon:(0,S.jsx)(v,{}),onClick:()=>{at(0),B(!0)},children:`导出`})},`export`),(0,S.jsxs)(C,{type:`secondary`,className:`text-xs`,children:[`已对账 `,Y.filter(e=>D.has(e)).length,`/`,Y.length]}),Z&&(0,S.jsx)(C,{type:`secondary`,className:`text-xs`,children:`修改保存将同步该商品全部订货明细与商品档案,成本变化时各门店单价按等级上浮自动重算`})]}),(0,S.jsx)(s,{rowKey:`product_id`,size:`small`,bordered:!0,columns:zt(),dataSource:T.items,onChange:(e,t)=>rt(t),pagination:!1,scroll:{x:900+T?.stores.length*100,y:500},summary:Bt})]})]})}),(0,S.jsx)(f,{title:K?`生成账单 · ${K.purchase.purchase_no}`:`生成账单`,open:ht,onCancel:()=>{gt(!1),q(null)},onOk:()=>J.submit(),confirmLoading:yt,okText:`确认生成`,okButtonProps:{disabled:Ct},width:1280,destroyOnHidden:!0,children:(0,S.jsx)(se,{spinning:_t,children:K&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`py-2 text-gray-500`,children:[`每个门店单独生成一张账单;商品金额由订单汇总不可修改,请填写各门店的配送费、周转筐/托盘数量(正数=压筐附加金额,负数=回筐抵扣金额)、售后金额(可正负,按客户等级上浮比例折算后计入总金额:如输入 15、上浮 1% 则实收 15.15)与备注(可选,随账单存档)。`,Ct?`该采购单已全部生成账单,仅可查看。`:`生成后采购单中的全部订单将关联到对应门店账单。`]}),(0,S.jsx)(m,{form:J,layout:`vertical`,onFinish:Lt,children:(0,S.jsx)(m.List,{name:`stores`,children:e=>(0,S.jsxs)(`div`,{className:`overflow-hidden rounded border border-gray-200`,children:[(0,S.jsxs)(`div`,{className:`flex bg-gray-50 px-4 py-2 text-sm text-gray-500`,children:[(0,S.jsx)(`div`,{className:`w-40 shrink-0`,children:`门店`}),(0,S.jsx)(`div`,{className:`w-28 shrink-0 text-center`,children:`商品金额`}),(0,S.jsx)(`div`,{className:`w-32 shrink-0 text-center`,children:`配送费(元)`}),(0,S.jsxs)(`div`,{className:`w-32 shrink-0 text-center`,children:[(0,S.jsx)(`div`,{children:`周转筐`}),(0,S.jsxs)(`div`,{children:[`(¥`,K.stores[0]?.box_price??`0.00`,`/个)`]})]}),(0,S.jsxs)(`div`,{className:`w-32 shrink-0 text-center`,children:[(0,S.jsx)(`div`,{children:`周转托盘`}),(0,S.jsxs)(`div`,{children:[`(¥`,K.stores[0]?.tray_price??`0.00`,`/个)`]})]}),(0,S.jsxs)(`div`,{className:`w-50 shrink-0 text-center`,children:[(0,S.jsx)(`div`,{children:`售后金额`}),(0,S.jsx)(`div`,{children:`(元,按等级上浮)`})]}),(0,S.jsx)(`div`,{className:`w-36 shrink-0 text-center`,children:`备注`}),(0,S.jsx)(`div`,{className:`w-28 shrink-0 text-center`,children:`附加金额`}),(0,S.jsx)(`div`,{className:`flex-1 text-center`,children:`账单总金额`})]}),e.map(e=>{let t=K.stores[e.name],n=t?.bill!=null;return(0,S.jsxs)(`div`,{className:`flex items-center border-t border-gray-100 px-4 py-2`,children:[(0,S.jsxs)(`div`,{className:`w-40 shrink-0 pr-2 text-sm`,children:[(0,S.jsx)(`div`,{children:t?.store_name??`-`}),(0,S.jsxs)(`div`,{className:`text-xs text-gray-400`,children:[t?.order_count??0,` 笔订单`,n&&(0,S.jsx)(_,{className:`ml-1!`,color:`success`,children:`已生成`})]}),(0,S.jsx)(`div`,{className:`text-xs text-gray-400`,children:t?.level_name?`${t.level_name} +${Number(t.level_percent??0)}%`:`无等级(不上浮)`})]}),(0,S.jsx)(`div`,{className:`w-28 shrink-0 text-center`,children:(0,S.jsxs)(C,{strong:!0,children:[`¥`,t?.product_amount??`0.00`]})}),(0,S.jsx)(m.Item,{name:[e.name,`store_id`],hidden:!0,children:(0,S.jsx)(h,{})}),(0,S.jsx)(m.Item,{className:`m-0! w-32 shrink-0 px-1! flex justify-center`,name:[e.name,`delivery_fee`],rules:[{required:!0,message:`请输入配送费`}],children:(0,S.jsx)(a,{className:`w-full`,min:0,precision:2,disabled:n,placeholder:`配送费`,onFocus:w})}),(0,S.jsx)(m.Item,{className:`m-0! w-32 shrink-0 px-1! flex justify-center`,name:[e.name,`box_num`],rules:[{required:!0,message:`请输入周转筐数量`}],children:(0,S.jsx)(a,{className:`w-full`,precision:0,disabled:n,placeholder:`正压负回`,onFocus:w})}),(0,S.jsx)(m.Item,{className:`m-0! w-32 shrink-0 px-1! flex justify-center`,name:[e.name,`tray_num`],rules:[{required:!0,message:`请输入周转托盘数量`}],children:(0,S.jsx)(a,{className:`w-full`,precision:0,disabled:n,placeholder:`正压负回`,onFocus:w})}),(0,S.jsx)(`div`,{className:`w-50 shrink-0 px-1! flex justify-center`,children:(0,S.jsxs)(c.Compact,{block:!0,children:[(0,S.jsx)(c.Addon,{children:(0,S.jsxs)(`div`,{className:`text-xs text-orange-500 text-center`,children:[`实收 ¥`,St[e.name]?.afterSale.toFixed(2)]})}),(0,S.jsx)(m.Item,{className:`m-0!`,name:[e.name,`after_sale`],children:(0,S.jsx)(a,{className:`w-full`,precision:2,prefix:`¥`,disabled:n,placeholder:`可正负,计入总额`,onFocus:w})})]})}),(0,S.jsx)(m.Item,{className:`m-0! w-36 shrink-0 px-1!`,name:[e.name,`remark`],children:(0,S.jsx)(h,{maxLength:255,disabled:n,placeholder:`备注(可选)`,onFocus:w})}),(0,S.jsxs)(`div`,{className:`w-28 shrink-0 text-center`,children:[`¥`,(n?Number(t.bill.added_amount):St[e.name]?.added??0).toFixed(2)]}),(0,S.jsxs)(`div`,{className:`flex-1 text-center`,children:[(0,S.jsxs)(C,{strong:!0,type:`danger`,children:[`¥`,(n?Number(t.bill.total_amount):St[e.name]?.total??0).toFixed(2)]}),n&&(0,S.jsx)(`div`,{className:`text-xs text-gray-400`,children:t.bill.bill_no})]})]},e.key)})]})})})]})})}),(0,S.jsxs)(f,{title:`新增单品 · ${j?.store?.name??``}`,open:Je,onCancel:()=>M(!1),onOk:()=>N.submit(),confirmLoading:Ye,okText:`添加`,destroyOnHidden:!0,children:[(0,S.jsx)(`div`,{className:`py-2 text-gray-500`,children:`单品将挂靠到该门店在此采购单中的最新一笔订单;单价按门店等级上浮比例自动换算。`}),(0,S.jsxs)(m,{form:N,layout:`vertical`,onFinish:jt,children:[(0,S.jsx)(m.Item,{label:`商品`,name:`product_id`,rules:[{required:!0,message:`请选择商品`}],children:(0,S.jsx)(u,{showSearch:{optionFilterProp:`label`},placeholder:`搜索并选择商品`,options:Ze.map(e=>({value:e.id,label:`${e.name}${e.spec?`(${e.spec})`:``}`}))})}),(0,S.jsx)(m.Item,{label:`采购数量`,name:`quantity`,rules:[{required:!0,message:`请输入采购数量`}],children:(0,S.jsx)(a,{className:`w-full`,min:1,precision:0,placeholder:`请输入采购数量(包数)`,onFocus:w})}),(0,S.jsx)(m.Item,{label:`称重(斤,可选)`,name:`weight`,children:(0,S.jsx)(a,{className:`w-full`,min:0,precision:3,placeholder:`请输入称重`,onFocus:w})})]})]}),(0,S.jsxs)(f,{title:P?`编辑「${P.product_name}」`:`编辑单品`,open:P!==null,onCancel:()=>F(null),onOk:()=>tt.submit(),confirmLoading:$e,okText:`保存`,destroyOnHidden:!0,children:[(0,S.jsx)(`div`,{className:`py-2 text-gray-500`,children:`修改保存后,系统将自动重算明细金额、订货单与采购单汇总。`}),(0,S.jsxs)(m,{form:tt,layout:`vertical`,onFinish:Nt,children:[(0,S.jsx)(m.Item,{label:`单价(元)`,name:`price`,rules:[{required:!0,message:`请输入单价`}],children:(0,S.jsx)(a,{className:`w-full`,min:0,precision:2,placeholder:`请输入单价`,onFocus:w})}),(0,S.jsx)(m.Item,{label:`采购数量`,name:`quantity`,rules:[{required:!0,message:`请输入采购数量`}],children:(0,S.jsx)(a,{className:`w-full`,min:0,precision:0,placeholder:`请输入采购数量`,onFocus:w})}),(0,S.jsx)(m.Item,{label:`称重(斤)`,name:`weight`,rules:[{required:!0,message:`请输入称重`}],children:(0,S.jsx)(a,{className:`w-full`,min:0,precision:3,placeholder:`请输入称重`,onFocus:w})})]})]}),(0,S.jsxs)(f,{title:`导出商品明细`,open:it,onCancel:()=>B(!1),onOk:()=>{T&&Ce(T.purchase.id,V>0?V:void 0),B(!1)},okText:`导出`,destroyOnHidden:!0,children:[(0,S.jsx)(`div`,{className:`py-2 text-gray-500`,children:`导出系统全部商品行(无订货的商品数量为 0),门店列附数量合计与突出颜色。`}),(0,S.jsxs)(`div`,{className:`flex items-center gap-2 py-2`,children:[(0,S.jsx)(C,{children:`供应商:`}),(0,S.jsx)(u,{value:V,onChange:at,className:`flex-1`,options:[{value:0,label:`全部供应商`},...W.map(e=>({value:e.id,label:e.name}))]})]})]}),(0,S.jsx)(f,{title:`导出门店购买详情`,open:ot,onCancel:()=>H(!1),onOk:()=>{T&&_e(T.purchase.id,st===`current`&&A>0?A:void 0),H(!1)},okText:`导出`,destroyOnHidden:!0,children:(0,S.jsx)(ae.Group,{className:`py-2`,value:st,onChange:e=>ct(e.target.value),options:[{value:`current`,label:`当前门店(${T?.stores.find(e=>e.id===A)?.name??`-`})`},{value:`all`,label:`全部门店(合并为一个 XLSX,每门店一个工作表)`}]})}),(0,S.jsxs)(f,{title:`导出供应商采购明细`,open:lt,onCancel:()=>U(!1),onOk:()=>{T&&pe(T.purchase.id,ut===`current`&&I>0?I:void 0),U(!1)},okText:`导出`,destroyOnHidden:!0,children:[(0,S.jsx)(`div`,{className:`py-2 text-gray-500`,children:`导出 XLSX 按「供应商 × 市场」拆分工作表,列序:品名、汇总、市场、各门店明细,有数据的单元格突出显示。`}),(0,S.jsx)(ae.Group,{className:`py-2`,value:ut,onChange:e=>dt(e.target.value),options:[{value:`current`,label:`当前供应商(${W.find(e=>e.id===I)?.name??`-`})`},{value:`all`,label:`全部供应商(合并为一个 XLSX,每供应商×市场一个工作表)`}]})]})]})};export{Ne as default}; \ No newline at end of file diff --git a/public/index.html b/public/index.html index 4f3facc..72eacd8 100644 --- a/public/index.html +++ b/public/index.html @@ -5,7 +5,7 @@ XinAdmin - + diff --git a/tests/Feature/PurchaseEditTest.php b/tests/Feature/PurchaseEditTest.php index 796b5e1..6cd285a 100644 --- a/tests/Feature/PurchaseEditTest.php +++ b/tests/Feature/PurchaseEditTest.php @@ -750,19 +750,21 @@ class PurchaseEditTest extends ProcurementTestCase // 未生成账单 → null $this->getJson('/purchase/order') - ->assertJsonPath('data.data.0.bill_product_amount', null); + ->assertJsonPath('data.data.0.bill_product_amount', null) + ->assertJsonPath('data.data.0.bill_total_amount', null); // 完成采购单并生成两店账单(各店商品金额 = 数量 × 等级价 10.00) $purchase->update(['status' => PurchaseOrderModel::STATUS_COMPLETED]); $this->postJson("/purchase/order/{$purchase->id}/bill", [ 'stores' => [ - ['store_id' => $stores[0]->id, 'delivery_fee' => 0, 'box_num' => 0, 'tray_num' => 0], - ['store_id' => $stores[1]->id, 'delivery_fee' => 0, 'box_num' => 0, 'tray_num' => 0], + ['store_id' => $stores[0]->id, 'delivery_fee' => 5, 'box_num' => 0, 'tray_num' => 0], + ['store_id' => $stores[1]->id, 'delivery_fee' => 3, 'box_num' => 0, 'tray_num' => 0], ], ])->assertJsonPath('success', true); - // 列表回显:2×10.00 + 3×10.00 = 50.00 + // 列表回显:商品金额 2×10.00 + 3×10.00 = 50.00;账单总金额 50.00 + 配送费 8.00 = 58.00 $this->getJson('/purchase/order') - ->assertJsonPath('data.data.0.bill_product_amount', '50.00'); + ->assertJsonPath('data.data.0.bill_product_amount', '50.00') + ->assertJsonPath('data.data.0.bill_total_amount', '58.00'); } } diff --git a/web/domain/iPurchaseOrder.ts b/web/domain/iPurchaseOrder.ts index 42ceca0..36f9400 100644 --- a/web/domain/iPurchaseOrder.ts +++ b/web/domain/iPurchaseOrder.ts @@ -76,6 +76,8 @@ export default interface IPurchaseOrder { actual_amount?: string; /** 应付商品金额 = Σ 已生成门店账单的商品金额(列表接口附;未生成账单为 null) */ bill_product_amount?: string | null; + /** 账单总金额 = Σ 已生成门店账单的总金额(商品+配送费+附加+售后;未生成账单为 null) */ + bill_total_amount?: string | null; operator_id?: number; operator?: { id: number; nickname: string }; remark?: string; diff --git a/web/pages/product/goods.tsx b/web/pages/product/goods.tsx index 445bd6d..0345f7c 100644 --- a/web/pages/product/goods.tsx +++ b/web/pages/product/goods.tsx @@ -37,6 +37,9 @@ const { Title, Text } = Typography; /** 四舍五入保留两位 */ const round2 = (v: number) => Math.round(v * 100) / 100; +/** 输入框聚焦时全选已有内容,方便直接键入覆盖(文本 Input / 数字 InputNumber 通用) */ +const selectAllOnFocus = (e: React.FocusEvent) => e.target.select(); + /** 商品表单用分类树:有子分类的节点禁选(商品只能挂在末级分类上) */ const markParentDisabled = (nodes: IProductCategoryTree[]): IProductCategoryTree[] => nodes.map((node) => ({ @@ -309,6 +312,7 @@ const ProductGoodsPage: React.FC = () => { valueType: 'text', colProps: { span: 24 }, required: true, + fieldProps: { onFocus: selectAllOnFocus }, render: (_, record) => { return (
@@ -359,6 +363,7 @@ const ProductGoodsPage: React.FC = () => { hideInSearch: true, hideInTable: true, colProps: { span: 24 }, + fieldProps: { onFocus: selectAllOnFocus }, }, { title: '成本价', @@ -367,7 +372,7 @@ const ProductGoodsPage: React.FC = () => { hideInSearch: true, align: 'center', tooltip: '各等级售价 = 成本价 × (100 + 等级上浮比例) / 100', - fieldProps: { min: 0, precision: 2, prefix: '¥' }, + fieldProps: { min: 0, precision: 2, prefix: '¥', onFocus: selectAllOnFocus }, render: (_, record) => { const cost = Number(record.cost_price ?? 0); return cost > 0 ? `¥${record.cost_price}` : 未设置; @@ -379,6 +384,7 @@ const ProductGoodsPage: React.FC = () => { valueType: 'text', hideInSearch: true, align: "center", + fieldProps: { onFocus: selectAllOnFocus }, }, { title: '单位', @@ -387,6 +393,7 @@ const ProductGoodsPage: React.FC = () => { hideInSearch: true, initialValue: '斤', align: "center", + fieldProps: { onFocus: selectAllOnFocus }, }, { title: '单价单位', @@ -395,14 +402,14 @@ const ProductGoodsPage: React.FC = () => { hideInTable: true, hideInSearch: true, initialValue: '元/斤', - fieldProps: { placeholder: '如:元/斤、元/箱', maxLength: 20 }, + fieldProps: { placeholder: '如:元/斤、元/箱', maxLength: 20, onFocus: selectAllOnFocus }, }, { title: '排序', dataIndex: 'sort', valueType: 'digit', hideInSearch: true, - fieldProps: { min: 0 }, + fieldProps: { min: 0, onFocus: selectAllOnFocus }, align: 'center', }, { @@ -448,6 +455,7 @@ const ProductGoodsPage: React.FC = () => { placeholder: '市场名称,如:新发地', maxLength: 50, allowClear: true, + onFocus: selectAllOnFocus, }, render: (_, record) => record.market || '-', }, diff --git a/web/pages/purchase/order.tsx b/web/pages/purchase/order.tsx index 35a03c3..270e1cd 100644 --- a/web/pages/purchase/order.tsx +++ b/web/pages/purchase/order.tsx @@ -90,6 +90,9 @@ const calcUnitRefPrice = (total: number, spec: string): number => { const calcLevelAmount = (amount: number, percent: number): number => Math.trunc(amount * (100 + percent)) / 100; +/** 输入框聚焦时全选已有内容,方便直接键入覆盖(Input / InputNumber / TextArea 通用) */ +const selectAllOnFocus = (e: React.FocusEvent) => e.target.select(); + /** * 采购单管理(C1 在门店订单页合并生成 / C2-C3 导出 / C4 明细矩阵修改) * 采购单无独立明细表,明细直接溯源门店订货明细:商品行 × 门店列 @@ -560,6 +563,7 @@ const PurchaseOrderPage: React.FC = () => { prefix="¥" className="w-full" defaultValue={Number(row.cost_price)} + onFocus={selectAllOnFocus} onPressEnter={(e) => void handleInlineSave(row, dataIndex, (e.target as HTMLInputElement).value)} onBlur={(e) => void handleInlineSave(row, dataIndex, e.target.value)} /> @@ -573,6 +577,7 @@ const PurchaseOrderPage: React.FC = () => { style={{ textAlign: 'center' }} defaultValue={row[dataIndex]} maxLength={dataIndex === 'unit' ? 20 : 100} + onFocus={selectAllOnFocus} onPressEnter={(e) => void handleInlineSave(row, dataIndex, (e.target as HTMLInputElement).value)} onBlur={(e) => void handleInlineSave(row, dataIndex, e.target.value)} /> @@ -770,6 +775,7 @@ const PurchaseOrderPage: React.FC = () => { precision={0} className="w-full" defaultValue={quantity} + onFocus={selectAllOnFocus} onPressEnter={(e) => void handleStoreCellSave(row, store.id, (e.target as HTMLInputElement).value)} onBlur={(e) => void handleStoreCellSave(row, store.id, e.target.value)} /> @@ -1092,23 +1098,32 @@ const PurchaseOrderPage: React.FC = () => { { title: '实际成本', dataIndex: 'actual_amount', + hideInTable: true, hideInSearch: true, valueType: "digit", fieldProps: { min: 0, precision: 3, - placeholder: "请输入单价" + placeholder: "请输入单价", + onFocus: selectAllOnFocus, }, align: 'center', + }, + { + title: '账单总金额', + dataIndex: 'bill_total_amount', + hideInForm: true, + hideInSearch: true, + align: 'center', render: (_, record) => - Number(record.actual_amount) > 0 ? ( - ¥{record.actual_amount} + record.bill_total_amount != null ? ( + ¥{Number(record.bill_total_amount).toFixed(2)} ) : ( - 未录入 + 未生成账单 ), }, { - title: '应付商品金额', + title: '商品金额', dataIndex: 'bill_product_amount', hideInForm: true, hideInSearch: true, @@ -1132,7 +1147,10 @@ const PurchaseOrderPage: React.FC = () => { dataIndex: 'remark', valueType: "textarea", hideInTable: true, - hideInSearch: true + hideInSearch: true, + fieldProps: { + onFocus: selectAllOnFocus, + }, }, { title: '总重量', @@ -1528,6 +1546,7 @@ const PurchaseOrderPage: React.FC = () => { precision={2} disabled={billed} placeholder="配送费" + onFocus={selectAllOnFocus} /> { precision={0} disabled={billed} placeholder="正压负回" + onFocus={selectAllOnFocus} /> { precision={0} disabled={billed} placeholder="正压负回" + onFocus={selectAllOnFocus} />
@@ -1571,6 +1592,7 @@ const PurchaseOrderPage: React.FC = () => { prefix={'¥'} disabled={billed} placeholder="可正负,计入总额" + onFocus={selectAllOnFocus} /> @@ -1584,6 +1606,7 @@ const PurchaseOrderPage: React.FC = () => { maxLength={255} disabled={billed} placeholder="备注(可选)" + onFocus={selectAllOnFocus} />
@@ -1641,10 +1664,10 @@ const PurchaseOrderPage: React.FC = () => { name="quantity" rules={[{ required: true, message: '请输入采购数量' }]} > - + - + @@ -1668,17 +1691,17 @@ const PurchaseOrderPage: React.FC = () => { name="price" rules={[{ required: true, message: '请输入单价' }]} > - + - + - +