const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-9PRMimni.js","assets/index-CZ_CrH4_.css"])))=>i.map(i=>d[i]);
import { ea as ie, eb as ce, d as z, a4 as f, ec as ue, c as y, o as v, N as V, br as $, ed as le, w as c, j as i, z as re, U as _e, h as U, a9 as pe, F as de, M as me, i as C, E as ge, l as p, v as E, r as g, ay as x, ee as ve, c6 as fe, B as he, D as A, k as ye, dA as B, x as ke, y as be, aB as Pe, cC as we, aI as Ie, p as Se, A as xe, G as Ce, ef as ze, aG as O, aA as Le, ac as Ne, __tla as __tla_0 } from "./index-9PRMimni.js";
let We;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })()
]).then(async ()=>{
    const $e = {
        value: {
            type: String,
            default: ""
        },
        width: {
            type: String,
            default: "220px"
        },
        contentWidth: {
            type: String,
            default: "440px"
        }
    }, T = {
        antd: Object.keys(ce).map((n)=>`antd:${n}`),
        ionicons5: Object.keys(ie).map((n)=>`ionicons5:${n}`)
    }, j = z({
        __name: "Icon",
        props: {
            icon: {
                type: String,
                required: !0
            }
        },
        setup (n) {
            const d = n;
            function l(e) {
                return e.indexOf(":") != -1 ? e.split(":")[1] : e;
            }
            function s(e) {
                return e.indexOf(":") != -1 ? e.split(":")[0] : e;
            }
            const _ = f(()=>ue(async ()=>{
                    const e = s(d.icon);
                    if (e === "") {
                        console.error("Icons are not within the agreed scope");
                        return;
                    }
                    const u = l(d.icon);
                    if (e === "antd") return (await $(()=>import("./index-9PRMimni.js").then(async (m)=>{
                            await m.__tla;
                            return m;
                        }).then((a)=>a.eb), __vite__mapDeps([0,1])))[u];
                    if (e === "ionicons5") return (await $(()=>import("./index-9PRMimni.js").then(async (m)=>{
                            await m.__tla;
                            return m;
                        }).then((a)=>a.ea), __vite__mapDeps([0,1])))[u];
                }));
            return (e, u)=>{
                const a = V;
                return v(), y(a, {
                    component: _.value
                }, null, 8, [
                    "component"
                ]);
            };
        }
    }), Ae = [
        "onClick"
    ], Be = z({
        __name: "IconItem",
        props: {
            list: {
                type: Array,
                default: ()=>[]
            },
            value: {
                type: String,
                default: ""
            }
        },
        emits: [
            "update:value"
        ],
        setup (n, { emit: d }) {
            const l = d, s = n, _ = f(()=>Object.freeze(s.list));
            function e(u) {
                l("update:value", u);
            }
            return (u, a)=>{
                const m = me, k = _e, b = re, P = le;
                return v(), y(P, {
                    class: "icon-list"
                }, {
                    default: c(()=>[
                            i(b, {
                                tag: "div",
                                class: "i-picker-icons"
                            }, {
                                default: c(()=>[
                                        i(k, {
                                            "x-gap": "6",
                                            "y-gap": "6",
                                            cols: 8
                                        }, {
                                            default: c(()=>[
                                                    (v(!0), U(de, null, pe(_.value, (h)=>(v(), y(m, {
                                                            key: h
                                                        }, {
                                                            default: c(()=>[
                                                                    C("div", {
                                                                        class: ge([
                                                                            "icon-item",
                                                                            {
                                                                                "icon-item-on": h === n.value
                                                                            }
                                                                        ]),
                                                                        onClick: (I)=>e(h)
                                                                    }, [
                                                                        (v(), y(p(j), {
                                                                            icon: h,
                                                                            key: h,
                                                                            size: 20
                                                                        }, null, 8, [
                                                                            "icon"
                                                                        ]))
                                                                    ], 10, Ae)
                                                                ]),
                                                            _: 2
                                                        }, 1024))), 128))
                                                ]),
                                            _: 1
                                        })
                                    ]),
                                _: 1
                            })
                        ]),
                    _: 1
                });
            };
        }
    }), Oe = E(Be, [
        [
            "__scopeId",
            "data-v-16fe4959"
        ]
    ]);
    function Te(n, d, l) {
        const s = (d - 1) * Number(l);
        return s + Number(l) >= n.length ? n.slice(s, n.length) : n.slice(s, s + Number(l));
    }
    function Ve(n, d) {
        const l = g(1), s = g(d), _ = f(()=>Te(p(n), p(l), p(s))), e = f(()=>p(n).length);
        function u(m) {
            l.value = m;
        }
        function a(m) {
            s.value = m;
        }
        return {
            setCurrentPage: u,
            getTotal: e,
            setPageSize: a,
            getPaginationList: _
        };
    }
    let Ue, Ee, je;
    Ue = {
        key: 0,
        class: "i-picker-search"
    };
    Ee = {
        class: "flex justify-center mt-6 picker-pagination"
    };
    je = z({
        __name: "IconPicker",
        props: {
            ...$e
        },
        emits: [
            "update:value"
        ],
        setup (n, { emit: d }) {
            const l = d, s = g("ionicons5"), _ = g(!1), e = g(!1), u = g(""), a = g(), m = g(1), k = g(60), b = (t)=>f(()=>t.filter((o)=>M(o, u.value)));
            let P = b(T.ionicons5);
            x(u, ()=>{
                P = b(T.ionicons5).value;
            });
            const h = (t)=>Ve(t, k.value), { getPaginationList: I, getTotal: D, setCurrentPage: L, setPageSize: W } = h(P);
            function G(t) {
                m.value = t, L(t);
            }
            function R(t) {
                k.value = t, W(t);
            }
            const w = f(()=>a.value), S = n, F = f(()=>({
                    width: S.width
                })), q = f(()=>({
                    width: S.contentWidth
                }));
            x(()=>S.value, (t)=>{
                t && (a.value = `ionicons5:${t}`);
            }, {
                immediate: !0
            }), x(()=>a.value, (t)=>{
                t && l("update:value", t.split(":")[1]);
            }, {
                immediate: !0
            });
            function M(t, o) {
                return t.toLowerCase().includes(o.toLowerCase());
            }
            function H() {
                return e.value = !0, !0;
            }
            function J() {
                m.value = 1, L(1), Ne(()=>{
                    e.value = !1;
                });
            }
            return (t, o)=>{
                const K = he, N = V, Q = ye, X = Ie, Y = we, Z = Pe, ee = be, ne = ke, te = Ce, oe = ze, ae = Le, se = ve;
                return v(), y(se, null, {
                    default: c(()=>[
                            i(K, null, fe({
                                _: 2
                            }, [
                                a.value ? {
                                    name: "icon",
                                    fn: c(()=>[
                                            (v(), y(p(j), {
                                                icon: w.value,
                                                key: w.value
                                            }, null, 8, [
                                                "icon"
                                            ]))
                                        ]),
                                    key: "0"
                                } : void 0
                            ]), 1024),
                            i(ae, {
                                placeholder: "请选择图标",
                                style: O(F.value),
                                "consistent-menu-width": !1,
                                value: w.value,
                                "onUpdate:value": o[5] || (o[5] = (r)=>w.value = r),
                                class: "i-select"
                            }, {
                                empty: c(()=>[
                                        C("div", {
                                            class: "i-picker",
                                            style: O(q.value)
                                        }, [
                                            _.value ? (v(), U("div", Ue, [
                                                i(Q, {
                                                    placeholder: "可输入单词搜索图标哦~",
                                                    value: u.value,
                                                    "onUpdate:value": o[0] || (o[0] = (r)=>u.value = r),
                                                    clearable: ""
                                                }, {
                                                    suffix: c(()=>[
                                                            i(N, {
                                                                component: p(B)
                                                            }, null, 8, [
                                                                "component"
                                                            ])
                                                        ]),
                                                    _: 1
                                                }, 8, [
                                                    "value"
                                                ])
                                            ])) : A("", !0),
                                            i(ne, {
                                                type: "line",
                                                value: s.value,
                                                "onUpdate:value": [
                                                    o[3] || (o[3] = (r)=>s.value = r),
                                                    J
                                                ],
                                                class: "i-picker-tab",
                                                onBeforeLeave: H
                                            }, {
                                                suffix: c(()=>[
                                                        i(X, {
                                                            trigger: "hover"
                                                        }, {
                                                            trigger: c(()=>[
                                                                    i(N, {
                                                                        component: p(B),
                                                                        size: 22,
                                                                        class: "cursor-pointer",
                                                                        onClick: o[1] || (o[1] = (r)=>_.value = !_.value),
                                                                        depth: 3
                                                                    }, null, 8, [
                                                                        "component"
                                                                    ])
                                                                ]),
                                                            default: c(()=>[
                                                                    Se(" " + xe(_.value ? "隐藏" : "显示") + "搜索 ", 1)
                                                                ]),
                                                            _: 1
                                                        })
                                                    ]),
                                                default: c(()=>[
                                                        i(ee, {
                                                            name: "ionicons5",
                                                            tab: "ionicons5",
                                                            "display-directive": "show:lazy"
                                                        }, {
                                                            default: c(()=>[
                                                                    i(Z, {
                                                                        show: e.value,
                                                                        description: "加载中..."
                                                                    }, {
                                                                        default: c(()=>[
                                                                                i(Oe, {
                                                                                    list: p(I),
                                                                                    value: a.value,
                                                                                    "onUpdate:value": o[2] || (o[2] = (r)=>a.value = r)
                                                                                }, null, 8, [
                                                                                    "list",
                                                                                    "value"
                                                                                ]),
                                                                                p(I).length ? A("", !0) : (v(), y(Y, {
                                                                                    key: 0
                                                                                }))
                                                                            ]),
                                                                        _: 1
                                                                    }, 8, [
                                                                        "show"
                                                                    ])
                                                                ]),
                                                            _: 1
                                                        })
                                                    ]),
                                                _: 1
                                            }, 8, [
                                                "value"
                                            ]),
                                            i(te, {
                                                class: "mt-4 mb-4"
                                            }),
                                            C("div", Ee, [
                                                i(oe, {
                                                    "show-size-picker": "",
                                                    "page-sizes": [
                                                        60,
                                                        120,
                                                        240
                                                    ],
                                                    page: m.value,
                                                    "onUpdate:page": [
                                                        o[4] || (o[4] = (r)=>m.value = r),
                                                        G
                                                    ],
                                                    pageSize: k.value,
                                                    "show-total": (r)=>`共 ${r} 个`,
                                                    "item-count": p(D),
                                                    size: "small",
                                                    "onUpdate:pageSize": R
                                                }, null, 8, [
                                                    "page",
                                                    "pageSize",
                                                    "show-total",
                                                    "item-count"
                                                ])
                                            ])
                                        ], 4)
                                    ]),
                                _: 1
                            }, 8, [
                                "style",
                                "value"
                            ])
                        ]),
                    _: 1
                });
            };
        }
    });
    We = E(je, [
        [
            "__scopeId",
            "data-v-ed96a068"
        ]
    ]);
});
export { We as I, __tla };
