package com.dong.maxhap.nestedlib3

import androidx.compose.foundation.layout.*
import androidx.compose.material.*
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp

@Stable
data class StableData469_1(
    val id: Int = 469001,
    val name: String = "Stable_469_1",
    val value: Double = 469.1,
    val isActive: Boolean = true,    val tags: List<String> = listOf("tag1", "tag2", "tag3"),
    val metadata: Map<String, String> = mapOf("key1" to "value1", "key2" to "value2"),
    val nestedData: NestedStableData469_1? = null
)

@Stable
data class NestedStableData469_1(
    val subId: Int = 46901,
    val description: String = "Nested stable data for page 469, item 1",
    val count: Int = 100,
    val isEnabled: Boolean = false
)

@Stable
data class StableData469_2(
    val id: Int = 469002,
    val name: String = "Stable_469_2",
    val value: Double = 469.2,
    val isActive: Boolean = true,    val tags: List<String> = listOf("tag1", "tag2", "tag3"),
    val metadata: Map<String, String> = mapOf("key1" to "value1", "key2" to "value2"),
    val nestedData: NestedStableData469_2? = null
)

@Stable
data class NestedStableData469_2(
    val subId: Int = 46902,
    val description: String = "Nested stable data for page 469, item 2",
    val count: Int = 200,
    val isEnabled: Boolean = true
)

@Stable
data class StableData469_3(
    val id: Int = 469003,
    val name: String = "Stable_469_3",
    val value: Double = 469.3,
    val isActive: Boolean = true,    val tags: List<String> = listOf("tag1", "tag2", "tag3"),
    val metadata: Map<String, String> = mapOf("key1" to "value1", "key2" to "value2"),
    val nestedData: NestedStableData469_3? = null
)

@Stable
data class NestedStableData469_3(
    val subId: Int = 46903,
    val description: String = "Nested stable data for page 469, item 3",
    val count: Int = 300,
    val isEnabled: Boolean = false
)

@Stable
data class StableData469_4(
    val id: Int = 469004,
    val name: String = "Stable_469_4",
    val value: Double = 469.4,
    val isActive: Boolean = true,    val tags: List<String> = listOf("tag1", "tag2", "tag3"),
    val metadata: Map<String, String> = mapOf("key1" to "value1", "key2" to "value2"),
    val nestedData: NestedStableData469_4? = null
)

@Stable
data class NestedStableData469_4(
    val subId: Int = 46904,
    val description: String = "Nested stable data for page 469, item 4",
    val count: Int = 400,
    val isEnabled: Boolean = true
)

@Stable
data class StableData469_5(
    val id: Int = 469005,
    val name: String = "Stable_469_5",
    val value: Double = 469.5,
    val isActive: Boolean = true,    val tags: List<String> = listOf("tag1", "tag2", "tag3"),
    val metadata: Map<String, String> = mapOf("key1" to "value1", "key2" to "value2"),
    val nestedData: NestedStableData469_5? = null
)

@Stable
data class NestedStableData469_5(
    val subId: Int = 46905,
    val description: String = "Nested stable data for page 469, item 5",
    val count: Int = 500,
    val isEnabled: Boolean = false
)

@Stable
data class StableData469_6(
    val id: Int = 469006,
    val name: String = "Stable_469_6",
    val value: Double = 469.6,
    val isActive: Boolean = true,    val tags: List<String> = listOf("tag1", "tag2", "tag3"),
    val metadata: Map<String, String> = mapOf("key1" to "value1", "key2" to "value2"),
    val nestedData: NestedStableData469_6? = null
)

@Stable
data class NestedStableData469_6(
    val subId: Int = 46906,
    val description: String = "Nested stable data for page 469, item 6",
    val count: Int = 600,
    val isEnabled: Boolean = true
)

@Stable
data class StableData469_7(
    val id: Int = 469007,
    val name: String = "Stable_469_7",
    val value: Double = 469.7,
    val isActive: Boolean = true,    val tags: List<String> = listOf("tag1", "tag2", "tag3"),
    val metadata: Map<String, String> = mapOf("key1" to "value1", "key2" to "value2"),
    val nestedData: NestedStableData469_7? = null
)

@Stable
data class NestedStableData469_7(
    val subId: Int = 46907,
    val description: String = "Nested stable data for page 469, item 7",
    val count: Int = 700,
    val isEnabled: Boolean = false
)

@Stable
data class StableData469_8(
    val id: Int = 469008,
    val name: String = "Stable_469_8",
    val value: Double = 469.8,
    val isActive: Boolean = true,    val tags: List<String> = listOf("tag1", "tag2", "tag3"),
    val metadata: Map<String, String> = mapOf("key1" to "value1", "key2" to "value2"),
    val nestedData: NestedStableData469_8? = null
)

@Stable
data class NestedStableData469_8(
    val subId: Int = 46908,
    val description: String = "Nested stable data for page 469, item 8",
    val count: Int = 800,
    val isEnabled: Boolean = true
)

@Composable
internal fun NestedPage469() {
    var showNextPage by remember { mutableStateOf(false) }
    val stableData1 by remember { mutableStateOf(StableData469_1()) }
    val stableData2 by remember { mutableStateOf(StableData469_2()) }
    val stableData3 by remember { mutableStateOf(StableData469_3()) }
    val stableData4 by remember { mutableStateOf(StableData469_4()) }

    
    
    

    var showNextPage469 by remember { mutableStateOf(false) }

    if (showNextPage469) {
        NestedPage470()
        return
    }

    Column(
        modifier = Modifier
            .fillMaxSize()
            .padding(16.dp),
        horizontalAlignment = Alignment.CenterHorizontally,
        verticalArrangement = Arrangement.Center
    ) {
        Text(
            text = "第469层页面 (nestedlib3)",
            fontSize = 24.sp,
            fontWeight = FontWeight.Bold,
            color = Color(0xFF1000000),
            modifier = Modifier.padding(bottom = 20.dp)
        )
        Text(
            text = "这是第4681行内容",
            fontSize = 14.sp,
            color = Color(217, 215, 103),
            modifier = Modifier.padding(vertical = 3.dp)
        )
        Text(
            text = "这是第4682行内容",
            fontSize = 14.sp,
            color = Color(234, 246, 150),
            modifier = Modifier.padding(vertical = 3.dp)
        )
        Text(
            text = "这是第4683行内容",
            fontSize = 14.sp,
            color = Color(251, 21, 197),
            modifier = Modifier.padding(vertical = 3.dp)
        )
        Text(
            text = "这是第4684行内容",
            fontSize = 14.sp,
            color = Color(12, 52, 244),
            modifier = Modifier.padding(vertical = 3.dp)
        )
        Text(
            text = "这是第4685行内容",
            fontSize = 14.sp,
            color = Color(29, 83, 35),
            modifier = Modifier.padding(vertical = 3.dp)
        )
        Text(
            text = "这是第4686行内容",
            fontSize = 14.sp,
            color = Color(46, 114, 82),
            modifier = Modifier.padding(vertical = 3.dp)
        )
        Text(
            text = "这是第4687行内容",
            fontSize = 14.sp,
            color = Color(63, 145, 129),
            modifier = Modifier.padding(vertical = 3.dp)
        )
        Text(
            text = "这是第4688行内容",
            fontSize = 14.sp,
            color = Color(80, 176, 176),
            modifier = Modifier.padding(vertical = 3.dp)
        )
        Text(
            text = "这是第4689行内容",
            fontSize = 14.sp,
            color = Color(97, 207, 223),
            modifier = Modifier.padding(vertical = 3.dp)
        )
        Text(
            text = "这是第4690行内容",
            fontSize = 14.sp,
            color = Color(114, 238, 14),
            modifier = Modifier.padding(vertical = 3.dp)
        )

        Spacer(modifier = Modifier.height(25.dp))
        // 显示@Stable数据信息
        Text(
            text = "StableData469_1: ID=${stableData1.id}, Name=${stableData1.name}",
            fontSize = 12.sp,
            color = Color.Gray,
            modifier = Modifier.padding(vertical = 2.dp)
        )
        Text(
            text = "NestedStableData469_1: ID=${stableData2.id}, Name=${stableData2.name}",
            fontSize = 12.sp,
            color = Color.Gray,
            modifier = Modifier.padding(vertical = 2.dp)
        )
        Text(
            text = "NestedStableData469_2: ID=${stableData3.id}, Name=${stableData3.name}",
            fontSize = 12.sp,
            color = Color.Gray,
            modifier = Modifier.padding(vertical = 2.dp)
        )

        Button(
            onClick = { showNextPage469 = true },
            modifier = Modifier
                .fillMaxWidth()
                .height(45.dp),
            colors = ButtonDefaults.buttonColors(
                backgroundColor = Color(0xFF2196F3)
            )
        ) {
            Text(
                text = "进入同库第470层",
                fontSize = 16.sp,
                fontWeight = FontWeight.Medium,
                color = Color.White
            )
        }
    }
}
