@file:Suppress("UNCHECKED_CAST", "USELESS_CAST", "INAPPLICABLE_JVM_NAME", "UNUSED_ANONYMOUS_PARAMETER", "SENSELESS_COMPARISON", "NAME_SHADOWING", "UNNECESSARY_NOT_NULL_ASSERTION")
package uni.UNIHelloUniAppX
import io.dcloud.uniapp.*
import io.dcloud.uniapp.extapi.*
import io.dcloud.uniapp.framework.*
import io.dcloud.uniapp.runtime.*
import io.dcloud.uniapp.vue.*
import io.dcloud.uniapp.vue.shared.*
import io.dcloud.unicloud.*
import io.dcloud.uts.*
import io.dcloud.uts.Map
import io.dcloud.uts.Set
import io.dcloud.uts.UTSAndroid
import kotlin.properties.Delegates
open class GenUniModulesUniCollapseComponentsUniCollapseUniCollapse : VueComponent {
    constructor(__ins: ComponentInternalInstance) : super(__ins) {}
    open var accordion: Boolean by `$props`
    companion object {
        @Suppress("UNUSED_PARAMETER", "UNUSED_VARIABLE")
        var setup: (__props: GenUniModulesUniCollapseComponentsUniCollapseUniCollapse) -> Any? = fun(__props): Any? {
            val __ins = getCurrentInstance()!!
            val _ctx = __ins.proxy as GenUniModulesUniCollapseComponentsUniCollapseUniCollapse
            val _cache = __ins.renderCache
            val props = __props
            var childNodes = _uA<ItemChildType>()
            fun gen_registerChild_fn(child: ItemChildType) {
                val existIndex = childNodes.findIndex(fun(item: ItemChildType): Boolean {
                    return item.elId == child.elId
                }
                )
                if (existIndex == -1) {
                    childNodes.push(child)
                }
            }
            val registerChild = ::gen_registerChild_fn
            fun gen_unregisterChild_fn(elId: String) {
                childNodes = childNodes.filter(fun(item: ItemChildType): Boolean {
                    return item.elId != elId
                }
                )
            }
            val unregisterChild = ::gen_unregisterChild_fn
            fun gen_toggle_fn(elId: String) {
                if (props.accordion && childNodes.length > 0) {
                    childNodes.forEach(fun(item: ItemChildType){
                        val isOpen = item.is_open.value as Boolean
                        if (isOpen && item.elId != elId) {
                            item.is_open.value = false
                            item.openOrClose(false)
                        }
                    }
                    )
                }
            }
            val toggle = ::gen_toggle_fn
            provide(UNI_COLLAPSE_REGISTER_CHILD, registerChild)
            provide(UNI_COLLAPSE_UNREGISTER_CHILD, unregisterChild)
            provide(UNI_COLLAPSE_CHILD_TOGGLE, toggle)
            return fun(): Any? {
                return _cE("view", null, _uA(
                    renderSlot(_ctx.`$slots`, "default")
                ))
            }
        }
        var name = "UniCollapse"
        val styles: Map<String, Map<String, Map<String, Any>>> by lazy {
            _nCS(_uA())
        }
        var inheritAttrs = true
        var inject: Map<String, Map<String, Any?>> = _uM()
        var emits: Map<String, Any?> = _uM()
        var props = _nP(_uM("accordion" to _uM("type" to "Boolean", "required" to false, "default" to true)))
        var propsNeedCastKeys = _uA(
            "accordion"
        )
        var components: Map<String, CreateVueComponent> = _uM()
    }
}
