import { isMobileDevice } from '@things-factory/utils'

export default function route(page) {
  switch (page) {
    case '':
      return isMobileDevice() ? '/menu-list' : '/dashboard'

    case 'dashboard':
      import('./pages/board/dashboard')
      return page

    /**
     * Master Menus Section
     */

    case 'transport_vehicle':
      import('./pages/master/transport-vehicle')
      return page

    case 'transport_driver':
      import('./pages/master/transport-driver')
      return page

    case 'warehouses':
      import('./pages/master/warehouse-list')
      return page

    case 'locations':
      import('./pages/master/location-list')
      return page

    case 'workers':
      import('./pages/master/worker-list')
      return page

    case 'pallets':
      import('./pages/master/pallet-list')
      return page

    case 'products':
      import('./pages/master/product/product-list')
      return page

    case 'totes':
      import('./pages/master/tote-list')
      return page

    /**
     * Order Menus Section
     */
    case 'create_arrival_notice':
      import('./pages/order/arrival-notice/create-arrival-notice')
      return page

    case 'duplicate_arrival_notice':
      import('./pages/order/arrival-notice/duplicate-arrival-notice')
      return page

    case 'arrival_notices':
      import('./pages/order/arrival-notice/arrival-notice-list')
      return page

    case 'arrival_notice_detail':
      import('./pages/order/arrival-notice/arrival-notice-detail')
      return page

    case 'arrival_notice_requests':
      import('./pages/order/arrival-notice/arrival-notice-requests')
      return page

    // case 'receive_arrival_notice':
    //   import('./pages/order/arrival-notice/receive-arrival-notice')
    //   return page

    // case 'rejected_arrival_notice':
    //   import('./pages/order/arrival-notice/rejected-arrival-notice')
    //   return page

    // case 'check_arrived_notice':
    //   import('./pages/order/arrival-notice/check-arrived-notice')
    //   return page

    // case 'assign_buffer_location':
    //   import('./pages/order/arrival-notice/assign-buffer-location')
    //   return page

    case 'create_release_order':
      import('./pages/order/release-order/create-release-order')
      return page

    case 'create_b2c_release_order':
      import('./pages/order/release-order/b2c/create-b2c-release-order')

    case 'b2b_orders':
      import('./pages/order/release-order/b2b/b2b-order-list')
      return page

    case 'release_order_detail':
      import('./pages/order/release-order/release-order-detail')
      return page

    case 'b2c_release_order_detail':
      import('./pages/order/release-order/b2c/b2c-release-order-detail')
      return page

    case 'b2b_order_requests':
      import('./pages/order/release-order/b2b/b2b-order-requests')
      return page

    case 'b2c_order_requests':
      import('./pages/order/release-order/b2c/b2c-order-requests')
      return page

    case 'rejected_release_order':
      import('./pages/order/release-order/rejected-release-order')
      return page

    case 'vas_orders':
      import('./pages/order/vas-order/vas-order-list')
      return page

    case 'vas_requests':
      import('./pages/order/vas-order/vas-order-requests')
      return page

    case 'create_vas_order':
      import('./pages/order/vas-order/create-vas-order')
      return page

    case 'vas_order_detail':
      import('./pages/order/vas-order/vas-order-detail')
      return page

    case 'receive_vas_order':
      import('./pages/order/vas-order/receive-vas-order')
      return page

    case 'create_delivery_order':
      import('./pages/order/transport-order/create-delivery-order')
      return page

    case 'delivery_orders':
      import('./pages/order/transport-order/delivery-order-list')
      return page

    case 'print_delivery_note':
      import('./pages/order/transport-order/print-delivery-note')
      return page

    case 'view_delivery_note':
      import('./pages/order/transport-order/view-delivery-note')
      return page

    case 'transfer_order_requests':
      import('./pages/order/transfer-order/transfer-order-requests')
      return page

    case 'transfer_order_detail':
      import('./pages/order/transfer-order/transfer-order-detail')
      return page

    case 'receive_transfer_order_request':
      import('./pages/order/transfer-order/receive-transfer-order-request')
      return page

    case 'rejected_transfer_order':
      import('./pages/order/transfer-order/rejected-transfer-order')
      return page

    case 'create_return_order':
      import('./pages/order/return-order/create-return-order')
      return page

    case 'return_order_detail':
      import('./pages/order/return-order/return-order-detail')
      return page

    case 'return_orders':
      import('./pages/order/return-order/return-order-list')
      return page

    case 'return_order_requests':
      import('./pages/order/return-order/return-order-requests')
      return page

    case 'receive_return_order_requests':
      import('./pages/order/return-order/receive-return-order-requests')
      return page

    case 'rejected_return_order':
      import('./pages/order/return-order/rejected-return-order')
      return page

    case 'check_return_order':
      import('./pages/order/return-order/check-return-order')
      return page

    case 'return_order_assign_buffer_location':
      import('./pages/order/return-order/return-order-assign-buffer-location')
      return page

    case 'bulk_print_packing_list':
      import('./pages/order/release-order/bulk-print-packing-list')
      return page

    case 'preview_print_packing_list':
      import('./pages/order/release-order/preview-print-packing-list')
      return page

    case 'create_loading_manifest':
      import('./pages/manifest/create-loading-manifest')
      return page

    case 'loading_manifest_list':
      import('./pages/manifest/loading-manifest-list')
      return page

    case 'loading_manifest_detail':
      import('./pages/manifest/loading-manifest-detail')
      return page

    case 'existing_manifest_list':
      import('./pages/manifest/existing-manifest-list')
      return page
    /**
     * GRN Menus Section
     */
    case 'received_note_list':
      import('./pages/order/goods-received-note/received-note-list')
      return page

    case 'received_note_detail':
      import('./pages/order/goods-received-note/received-note-detail')
      return page

    case 'received_note':
      import('./pages/order/goods-received-note/customer-received-note')
      return page

    case 'customer_grn_list':
      import('./pages/order/goods-received-note/customer-grn-list')
      return page

    /**
     * Billing Menus Section
     */
    case 'create_claim_chit':
      import('./pages/billing/claim-chit/create-claim-chit')
      return page

    case 'claim_chit_list':
      import('./pages/billing/claim-chit/claim-chit-list')
      return page

    case 'claim_chit_detail':
      import('./pages/billing/claim-chit/claim-chit-detail')
      return page

    /**
     * Inventory Menus Section
     */
    case 'onhand_inventory':
      import('./pages/inventory/onhand-inventory')
      return page

    case 'inventory_by_product':
      import('./pages/inventory/inventory-by-product')
      return page

    case 'inventory_histories':
      import('./pages/inventory/inventory-history')
      return page

    case 'inventory_adjustment':
      import('./pages/inventory/inventory-adjustment')
      return page

    case 'inventory_adjustment_approval':
      import('./pages/inventory/inventory-adjustment-approval')
      return page

    case 'non_loaded_inventory':
      import('./pages/inventory/non-loaded-inventory')
      return page

    case 'create_cycle_count':
      import('./pages/inventory-check/create-cycle-count')
      return page

    case 'inventory_check_list':
      import('./pages/inventory-check/inventory-check-list')
      return page

    case 'cycle_count_worksheet_list':
      import('./pages/inventory-check/cycle-count-worksheet-list')
      return page

    case 'worksheet_cycle_count':
      import('./pages/inventory-check/worksheet-cycle-count')
      return page

    case 'inspecting_product':
      import('./pages/inventory-check/inspecting-product')
      return page

    case 'cycle_count_report':
      import('./pages/inventory-check/cycle-count-report')
      return page

    case 'cycle_count_review':
      import('./pages/inventory-check/cycle-count-review')
      return page

    case 'job_sheets':
      import('./pages/report/job-sheet-list')
      return page

    case 'job_sheet_report':
      import('./pages/report/job-sheet-report')
      return page

    /**
     * System Menus Section
     */
    case 'location_sorting_rule':
      import('./pages/system/location-sorting-rule')
      return page

    /**
     * Inbound Menus Section
     */
    case 'inbound_worksheets':
      import('./pages/inbound/inbound-worksheet')
      return page

    case 'external_return_worksheets':
      import('./pages/inbound/external-return-worksheet')
      return page

    case 'putaway':
      import('./pages/inbound/putaway/putaway-product')
      return page

    case 'worksheet_unloading':
      import('./pages/inbound/worksheet-unloading')
      return page

    case 'worksheet_putaway':
      import('./pages/inbound/putaway/worksheet-putaway')
      return page

    case 'worksheet_unloading_return':
      import('./pages/inbound/worksheet-unloading-return')
      return page

    case 'worksheet_putaway_return':
      import('./pages/inbound/putaway/worksheet-putaway-return')
      return page

    //vas
    case 'worksheet_vas':
      import('./pages/vas/worksheet-vas')
      return page

    case 'worksheet_ref_vas':
      import('./pages/vas/worksheet-ref-vas')
      return page

    case 'unloading':
      if (isMobileDevice()) {
        const urlParams = new URLSearchParams(window.location.search)
        const hasParams = urlParams.has('orderType') && urlParams.has('orderNo')
        
        if (!hasParams) {
          import('./pages/inbound/unload-product-landing-page')
          return 'unloading_landing'
        }
      }
      import('./pages/inbound/unload-product')
      return page

    case 'unloading_landing':
      import('./pages/inbound/unload-product-landing-page')
      return page

    case 'execute_vas':
      import('./pages/vas/execute-vas')
      return page

    case 'vas_execution':
      import('./pages/vas/vas-execution-page')
      return page

    case 'vas_worksheets':
      import('./pages/vas/vas-worksheet-list')
      return page

    case 'print_product_label':
      import('./pages/vas/print-product-label')
      return page

    case 'inbound_reusable_pallet':
      import('./pages/inbound/inbound-reusable-pallet')
      return page

    /**
     * Adjustment Menus Section
     */
    case 'transfer_inventory':
      import('./pages/adjustment/transfer-inventory')
      return page

    /**
     * Outbound Menus Section
     */
    case 'single_outbound_worksheets':
      import('./pages/outbound/single-outbound-worksheet')
      return page

    case 'merged_outbound_worksheets':
      import('./pages/outbound/merged-outbound-worksheet')
      return page

    case 'packing_worksheet_list':
      import('./pages/outbound/packing-worksheet-list')
      return page

    case 'worksheet_picking':
      import('./pages/outbound/worksheet-picking')
      return page

    case 'worksheet_batch_picking':
      import('./pages/outbound/worksheet-batch-picking')
      return page

    case 'worksheet_zone_picking':
      import('./pages/outbound/worksheet-zone-picking')
      return page

    case 'worksheet_packing':
      import('./pages/outbound/worksheet-packing')
      return page

    case 'worksheet_loading':
      import('./pages/outbound/worksheet-loading')
      return page

    case 'worksheet_sorting':
      import('./pages/outbound/worksheet-sorting')
      return page

    case 'worksheet_return':
      import('./pages/outbound/worksheet-return')
      return page

    case 'picking':
      import('./pages/outbound/picking-product')
      return page

    case 'picking_v2':
      import('./pages/outbound/picking-v2/picking')
      return page

    case 'packing':
      import('./pages/outbound/packing-product')
      return page

    case 'sorting':
      import('./pages/outbound/sorting-product')
      return page

    case 'loading':
      import('./pages/outbound/loading-product')
      return page

    case 'loading_v2':
      import('./pages/outbound/loading-v2/loading')
      return page

    case 'zone_worksheets':
      import('./pages/outbound/zone-worksheet')
      return page
    /**
     * Report Menus Section
     */
    case 'inventory_report':
      import('./pages/report/inventory-report')
      return page

    case 'inventory_summary_report':
      import('./pages/report/inventory-summary-report')
      return page

    case 'volume_summary_report':
      import('./pages/report/volume-summary-report')
      return page

    case 'inventory_pallet_report':
      import('./pages/report/inventory-pallet-report')
      return page

    case 'inventory_pallet_storage_report':
      import('./pages/report/inventory-pallet-storage-report')
      return page

    case 'inbound_order_details_report':
      import('./pages/report/inbound-order-details-report')
      return page

    case 'outbound_order_details_report':
      import('./pages/report/outbound-order-details-report')
      return page

    case 'product_label_report':
      import('./pages/report/product-label-report')
      return page

    case 'inbound_serial_number_report':
      import('./pages/report/inbound-serial-number-report')
      return page

    case 'outbound_serial_number_report':
      import('./pages/report/outbound-serial-number-report')
      return page

    case 'costing_report':
      import('./pages/report/costing-report')
      return page

    case 'release_inventory_report':
      import('./pages/report/release-inventory-report')
      return page

    case 'loading_qc_report':
      import('./pages/report/tote-loading-qc-report')
      return page

    case 'order_vas_report':
      import('./pages/report/order-vas-report')
      return page

    case 'vas_report':
      import('./pages/report/vas-report')
      return page

    case 'shortage_report':
      import('./pages/report/shortage-report')
      return page

    case 'analysis_picking_packing_report':
      import('./pages/report/analysis-picking-packing-report')
      return page

    case 'manifest_report':
      import('./pages/report/manifest-report')
      return page

    case 'replenishment_report':
      import('./pages/report/replenishment-report')
      return page

    case 'billing_module_report':
      import('./pages/report/billing-module-report')
      return page

    /**
     * Custom ELCCL Menus Section
     */
    case 'elccl_daily_collection_report':
      import('./pages/report/custom-elccl/elccl-daily-collection-report')
      return page

    case 'elccl_inventory_summary_report':
      import('./pages/report/custom-elccl/elccl-inventory-summary-report')
      return page

    case 'elccl_inventory_report':
      import('./pages/report/custom-elccl/elccl-inventory-report')
      return page

    case 'elccl_inventory_pallet_detail_report':
      import('./pages/report/custom-elccl/elccl-inventory-pallet-detail-report')
      return page

    case 'elccl_daily_order_inventory_report':
      import('./pages/report/custom-elccl/elccl-daily-order-inventory-report')
      return page

    case 'elccl_delivery_order_summary':
      import('./pages/report/custom-elccl/elccl-delivery-order-summary')
      return page

    /**
     * Support
     */
    case 'inventory_comparison':
      import('./pages/support/inventory-comparison')
      return page

    /** Custom VAS */
    case 'reverse_kitting_orders':
      import('./pages/order/reverse-kitting-order/reverse-kitting-order-list')
      return page

    case 'reverse_kitting_order_detail':
      import('./pages/order/reverse-kitting-order/reverse-kitting-order-detail')
      return page

    case 'execute_reverse_kitting':
      import('./pages/vas/reverse-kitting/execute-reverse-kitting')
      return page

    /* Bulk Operations */
    case 'bulk_operation':
      import('./pages/bulk-operation/bulk-operation')
      return page

    case 'draft_release_goods':
      import('./pages/order/draft-release-good/draft-release-good-list')
      return page

    case 'draft_release_good_detail':
      import('./pages/order/draft-release-good/draft-release-good-detail')
      return page

    /* Replenishment */
    case 'replenishment':
      import('./pages/replenishment/replenishment')
      return page

    case 'replenishment_detail':
      import('./pages/replenishment/replenishment-detail')
      return page

    case 'replenishment_worksheet_list':
      import('./pages/replenishment/replenishment-worksheet-list')
      return page

    case 'worksheet_replenishment':
      import('./pages/replenishment/worksheet-replenishment')
      return page
  }
}
