@quicktvui/naddons 1.0.0-rc.1 → 1.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/components/GridTabs/GridTabs.vue.d.ts +6 -0
  2. package/dist/components/GridTabs/useGridTabs.d.ts +1 -0
  3. package/dist/components/HsvBackground/HsvBackground.vue.d.ts +7 -19
  4. package/dist/components/HsvBackground/index.d.ts +9 -2
  5. package/dist/components/NaButton/NaButton.vue.d.ts +24 -0
  6. package/dist/components/NaButton/NaButtonBase.vue.d.ts +60 -0
  7. package/dist/components/NaButton/index.d.ts +13 -0
  8. package/dist/components/NaCheckbox/NaCheckbox.vue.d.ts +108 -0
  9. package/dist/components/NaCheckbox/index.d.ts +13 -0
  10. package/dist/components/NaCheckboxGroup/NaCheckboxGroup.vue.d.ts +103 -0
  11. package/dist/components/NaCheckboxGroup/index.d.ts +13 -0
  12. package/dist/components/NaInputView/NaInputView.vue.d.ts +42 -0
  13. package/dist/components/NaInputView/NaInputViewBase.vue.d.ts +46 -0
  14. package/dist/components/NaInputView/index.d.ts +13 -0
  15. package/dist/components/NaRadioGroup/NaRadioGroup.vue.d.ts +103 -0
  16. package/dist/components/NaRadioGroup/index.d.ts +13 -0
  17. package/dist/components/NaSettingSwitch/NaSettingSwitch.vue.d.ts +111 -0
  18. package/dist/components/NaSettingSwitch/index.d.ts +6 -0
  19. package/dist/components/NaSwitcher/NaSwitcher.vue.d.ts +50 -0
  20. package/dist/components/NaSwitcher/index.d.ts +13 -0
  21. package/dist/core/AddonProvider.d.ts +13 -0
  22. package/dist/index.d.ts +28 -1
  23. package/dist/modules/AddonEnvModule.d.ts +4 -0
  24. package/dist/modules/ExtraUIConfigModule.d.ts +7 -0
  25. package/dist/modules/GridTabsConfigModule.d.ts +7 -0
  26. package/dist/naddons.cjs.js +1 -1
  27. package/dist/naddons.es.js +1469 -702
  28. package/dist/style.css +1 -0
  29. package/dist/types/index.d.ts +50 -0
  30. package/package.json +1 -1
@@ -0,0 +1,111 @@
1
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ title: {
3
+ type: StringConstructor;
4
+ default: string;
5
+ };
6
+ subtitle: {
7
+ type: StringConstructor;
8
+ default: string;
9
+ };
10
+ modelValue: {
11
+ type: BooleanConstructor;
12
+ default: boolean;
13
+ };
14
+ textOn: {
15
+ type: StringConstructor;
16
+ default: string;
17
+ };
18
+ textOff: {
19
+ type: StringConstructor;
20
+ default: string;
21
+ };
22
+ titleTextSize: {
23
+ type: NumberConstructor;
24
+ default: number;
25
+ };
26
+ subtitleTextSize: {
27
+ type: NumberConstructor;
28
+ default: number;
29
+ };
30
+ stateTextSize: {
31
+ type: NumberConstructor;
32
+ default: number;
33
+ };
34
+ disabled: {
35
+ type: BooleanConstructor;
36
+ default: boolean;
37
+ };
38
+ width: {
39
+ type: (NumberConstructor | StringConstructor)[];
40
+ default: number;
41
+ };
42
+ height: {
43
+ type: (NumberConstructor | StringConstructor)[];
44
+ default: number;
45
+ };
46
+ }>, {
47
+ checked: import("vue").Ref<boolean, boolean>;
48
+ handleCheckedChange: (e: any) => void;
49
+ mergedStyle: import("vue").ComputedRef<any>;
50
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
51
+ title: {
52
+ type: StringConstructor;
53
+ default: string;
54
+ };
55
+ subtitle: {
56
+ type: StringConstructor;
57
+ default: string;
58
+ };
59
+ modelValue: {
60
+ type: BooleanConstructor;
61
+ default: boolean;
62
+ };
63
+ textOn: {
64
+ type: StringConstructor;
65
+ default: string;
66
+ };
67
+ textOff: {
68
+ type: StringConstructor;
69
+ default: string;
70
+ };
71
+ titleTextSize: {
72
+ type: NumberConstructor;
73
+ default: number;
74
+ };
75
+ subtitleTextSize: {
76
+ type: NumberConstructor;
77
+ default: number;
78
+ };
79
+ stateTextSize: {
80
+ type: NumberConstructor;
81
+ default: number;
82
+ };
83
+ disabled: {
84
+ type: BooleanConstructor;
85
+ default: boolean;
86
+ };
87
+ width: {
88
+ type: (NumberConstructor | StringConstructor)[];
89
+ default: number;
90
+ };
91
+ height: {
92
+ type: (NumberConstructor | StringConstructor)[];
93
+ default: number;
94
+ };
95
+ }>> & Readonly<{
96
+ onChange?: ((...args: any[]) => any) | undefined;
97
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
98
+ }>, {
99
+ title: string;
100
+ disabled: boolean;
101
+ width: string | number;
102
+ height: string | number;
103
+ modelValue: boolean;
104
+ textOn: string;
105
+ textOff: string;
106
+ subtitle: string;
107
+ titleTextSize: number;
108
+ subtitleTextSize: number;
109
+ stateTextSize: number;
110
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
111
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import { App } from 'vue';
2
+ import NaSettingSwitch from './NaSettingSwitch.vue';
3
+ export declare const NaSettingSwitchPlugin: {
4
+ install(app: App): void;
5
+ };
6
+ export { NaSettingSwitch };
@@ -0,0 +1,50 @@
1
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
2
+ checked?: boolean | undefined;
3
+ disabled?: boolean | undefined;
4
+ title?: string | undefined;
5
+ textOn?: string | undefined;
6
+ textOff?: string | undefined;
7
+ subtitle?: string | undefined;
8
+ subtitleColor?: string | undefined;
9
+ titleColor?: string | undefined;
10
+ focusTitleColor?: string | undefined;
11
+ titleTextSize?: any;
12
+ subtitleTextSize?: any;
13
+ stateTextSize?: any;
14
+ }>>, {
15
+ getNativeNode: () => any;
16
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
17
+ onCheckedChange: (payload?: any) => void;
18
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
19
+ checked?: boolean | undefined;
20
+ disabled?: boolean | undefined;
21
+ title?: string | undefined;
22
+ textOn?: string | undefined;
23
+ textOff?: string | undefined;
24
+ subtitle?: string | undefined;
25
+ subtitleColor?: string | undefined;
26
+ titleColor?: string | undefined;
27
+ focusTitleColor?: string | undefined;
28
+ titleTextSize?: any;
29
+ subtitleTextSize?: any;
30
+ stateTextSize?: any;
31
+ }>>> & Readonly<{
32
+ onOnCheckedChange?: ((payload?: any) => any) | undefined;
33
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
34
+ default?(_: {}): any;
35
+ }>;
36
+ export default _default;
37
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
38
+ type __VLS_TypePropsToRuntimeProps<T> = {
39
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
40
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
41
+ } : {
42
+ type: import('vue').PropType<T[K]>;
43
+ required: true;
44
+ };
45
+ };
46
+ type __VLS_WithTemplateSlots<T, S> = T & {
47
+ new (): {
48
+ $slots: S;
49
+ };
50
+ };
@@ -0,0 +1,13 @@
1
+ import type { App } from 'vue';
2
+ import NaSwitcher from './NaSwitcher.vue';
3
+ export declare const NaSwitcherPlugin: {
4
+ install: (app: App) => void;
5
+ };
6
+ export { NaSwitcher };
7
+ export default NaSwitcherPlugin;
8
+ declare module 'vue' {
9
+ interface GlobalComponents {
10
+ NaSwitcher: typeof NaSwitcher;
11
+ 'qt-na-switcher': typeof NaSwitcher;
12
+ }
13
+ }
@@ -39,3 +39,16 @@ export declare function useAddonEnv(): AddonEnv;
39
39
  * @param config 全局配置对象 (如 { themeConfig: { placeholderColor: '#282A32', glowColor: '#000000', outerBorderColor: '#FFFFFF' } })
40
40
  */
41
41
  export declare function initGridTabsGlobalConfig(config: Record<string, any>): Promise<boolean>;
42
+ /**
43
+ * 初始化 ExtraUI 的全局主题配置。
44
+ * 允许设置全局的 primaryColor、focusBorderColor、cornerRadius 等,避免每个组件重复配置。
45
+ *
46
+ * @param config 全局配置对象 (如 { primaryColor: '#007AFF', cornerRadius: 8, focusBorderColor: '#FFFFFF' })
47
+ */
48
+ export declare function initExtraUIGlobalTheme(config: Record<string, any>): Promise<boolean>;
49
+ /**
50
+ * 一键设置全局主题(联合配置)
51
+ * 供业务层在启动时调用,一键同时配置 extra-ui、glint 以及 grid-tabs 的主题参数
52
+ * @param themeConfig 统一的主题配置参数
53
+ */
54
+ export declare function initGlobalTheme(themeConfig: Record<string, any>): Promise<boolean>;
package/dist/index.d.ts CHANGED
@@ -6,7 +6,14 @@ import { PortalPoolPlugin, PortalPool } from './components/PortalPool';
6
6
  import { PortalItemPlugin, PortalItem } from './components/PortalItem';
7
7
  import { HsvBackgroundPlugin, HsvBackground } from './components/HsvBackground';
8
8
  import { SvgImagePlugin, SvgImage } from './components/SvgImage';
9
- export { GridTabsPlugin, GridTabs, KeyboardPlugin, Keyboard, PortalPoolPlugin, PortalPool, PortalItemPlugin, PortalItem, HsvBackgroundPlugin, HsvBackground, SvgImagePlugin, SvgImage };
9
+ import { NaButtonPlugin, NaButton } from './components/NaButton';
10
+ import { NaCheckboxPlugin, NaCheckbox } from './components/NaCheckbox';
11
+ import { NaRadioGroupPlugin, NaRadioGroup } from './components/NaRadioGroup';
12
+ import { NaCheckboxGroupPlugin, NaCheckboxGroup } from './components/NaCheckboxGroup';
13
+ import { NaSwitcherPlugin, NaSwitcher } from './components/NaSwitcher';
14
+ import { NaSettingSwitchPlugin, NaSettingSwitch } from './components/NaSettingSwitch';
15
+ import { NaInputViewPlugin, NaInputView } from './components/NaInputView';
16
+ export { GridTabsPlugin, GridTabs, KeyboardPlugin, Keyboard, PortalPoolPlugin, PortalPool, PortalItemPlugin, PortalItem, HsvBackgroundPlugin, HsvBackground, SvgImagePlugin, SvgImage, NaButtonPlugin, NaButton, NaCheckboxPlugin, NaCheckbox, NaRadioGroupPlugin, NaRadioGroup, NaCheckboxGroupPlugin, NaCheckboxGroup, NaSwitcherPlugin, NaSwitcher, NaSettingSwitchPlugin, NaSettingSwitch, NaInputViewPlugin, NaInputView };
10
17
  export { withAsyncPlugin, QuickTVUINAddonsConfig } from './core/withAsyncPlugin';
11
18
  export * from './core/AddonProvider';
12
19
  import { App } from 'vue';
@@ -29,6 +36,16 @@ declare module '@vue/runtime-core' {
29
36
  'qt-hsv-background': typeof HsvBackground;
30
37
  SvgImage: typeof SvgImage;
31
38
  'qt-svg-image': typeof SvgImage;
39
+ NaRadioGroup: typeof NaRadioGroup;
40
+ 'qt-na-radio-group': typeof NaRadioGroup;
41
+ NaCheckboxGroup: typeof NaCheckboxGroup;
42
+ 'qt-na-checkbox-group': typeof NaCheckboxGroup;
43
+ NaSwitcher: typeof NaSwitcher;
44
+ 'qt-na-switcher': typeof NaSwitcher;
45
+ NaSettingSwitch: typeof NaSettingSwitch;
46
+ 'qt-na-setting-switch': typeof NaSettingSwitch;
47
+ NaInputView: typeof NaInputView;
48
+ 'qt-na-input-view': typeof NaInputView;
32
49
  }
33
50
  }
34
51
  declare module 'vue' {
@@ -46,5 +63,15 @@ declare module 'vue' {
46
63
  'qt-hsv-background': typeof HsvBackground;
47
64
  SvgImage: typeof SvgImage;
48
65
  'qt-svg-image': typeof SvgImage;
66
+ NaRadioGroup: typeof NaRadioGroup;
67
+ 'qt-na-radio-group': typeof NaRadioGroup;
68
+ NaCheckboxGroup: typeof NaCheckboxGroup;
69
+ 'qt-na-checkbox-group': typeof NaCheckboxGroup;
70
+ NaSwitcher: typeof NaSwitcher;
71
+ 'qt-na-switcher': typeof NaSwitcher;
72
+ NaSettingSwitch: typeof NaSettingSwitch;
73
+ 'qt-na-setting-switch': typeof NaSettingSwitch;
74
+ NaInputView: typeof NaInputView;
75
+ 'qt-na-input-view': typeof NaInputView;
49
76
  }
50
77
  }
@@ -0,0 +1,4 @@
1
+ export declare const AddonEnvModule: {
2
+ getBuiltInVersions(): Promise<any>;
3
+ };
4
+ export default AddonEnvModule;
@@ -0,0 +1,7 @@
1
+ export declare const ExtraUIConfigModule: {
2
+ /**
3
+ * 前端调用此方法,传入 JSON 字符串配置以更新 ExtraUI 的主题
4
+ */
5
+ setThemeConfig(jsonConfig: Record<string, any> | string): Promise<any>;
6
+ };
7
+ export default ExtraUIConfigModule;
@@ -0,0 +1,7 @@
1
+ export declare const GridTabsConfigModule: {
2
+ /**
3
+ * 前端调用此方法,传入 JSON 字符串配置
4
+ */
5
+ setDefaultConfig(jsonConfig: Record<string, any> | string): Promise<any>;
6
+ };
7
+ export default GridTabsConfigModule;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("vue"),A=require("@extscreen/es3-vue"),j=require("@extscreen/es3-core"),oe="QtGridTabs",B=c.defineComponent({__name:"GridTabs",props:{protocolVersion:{},pageSpec:{},tabsData:{},actionPayload:{}},emits:["onTabSelected","onTabNeedsData","onLoadMore","onScroll","onScrollStateChanged","onItemPresence","onTabFocused","onItemClick","onItemLongClick","onItemFocused","onProtocolMismatch"],setup(o,{expose:d}){const u=c.ref(),r=q(),y=oe+"_Plugin",f=(r.isPluginActive?y:oe).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase().replace(/^-/,""),v=D(f,r.pluginPackageName||"com.quicktvui.plugin.glintui");return d({getNativeNode:()=>{var a,l;return((l=(a=u.value)==null?void 0:a.getNativeNode)==null?void 0:l.call(a))||u.value},dispatchAction:(...a)=>{var s,P;const l=((P=(s=u.value)==null?void 0:s.getNativeNode)==null?void 0:P.call(s))||u.value;if(l)if(a.length>0){let h=a[0];typeof h=="object"&&(h=JSON.stringify(h)),A.Native.callUIFunction(l,"dispatchAction",[h])}else A.Native.callUIFunction(l,"dispatchAction",a)},scrollToTop:(...a)=>{var s,P;const l=((P=(s=u.value)==null?void 0:s.getNativeNode)==null?void 0:P.call(s))||u.value;l&&A.Native.callUIFunction(l,"scrollToTop",a)},getFocusState:(...a)=>{var s,P;const l=((P=(s=u.value)==null?void 0:s.getNativeNode)==null?void 0:P.call(s))||u.value;l&&A.Native.callUIFunction(l,"getFocusState",a)},getItemRect:(...a)=>{var s,P;const l=((P=(s=u.value)==null?void 0:s.getNativeNode)==null?void 0:P.call(s))||u.value;l&&A.Native.callUIFunction(l,"getItemRect",a)},requestFocus:(...a)=>{var s,P;const l=((P=(s=u.value)==null?void 0:s.getNativeNode)==null?void 0:P.call(s))||u.value;l&&A.Native.callUIFunction(l,"requestFocus",a)}}),(a,l)=>(c.openBlock(),c.createBlock(c.unref(v),c.mergeProps({ref_key:"nativeRef",ref:u,protocolVersion:o.protocolVersion,pageSpec:o.pageSpec,tabsData:o.tabsData,actionPayload:o.actionPayload,onOnTabSelected:l[0]||(l[0]=s=>a.$emit("onTabSelected",s.nativeEvent)),onOnTabNeedsData:l[1]||(l[1]=s=>a.$emit("onTabNeedsData",s.nativeEvent)),onOnLoadMore:l[2]||(l[2]=s=>a.$emit("onLoadMore",s.nativeEvent)),onOnScroll:l[3]||(l[3]=s=>a.$emit("onScroll",s.nativeEvent)),onOnScrollStateChanged:l[4]||(l[4]=s=>a.$emit("onScrollStateChanged",s.nativeEvent)),onOnItemPresence:l[5]||(l[5]=s=>a.$emit("onItemPresence",s.nativeEvent)),onOnTabFocused:l[6]||(l[6]=s=>a.$emit("onTabFocused",s.nativeEvent)),onOnItemClick:l[7]||(l[7]=s=>a.$emit("onItemClick",s.nativeEvent)),onOnItemLongClick:l[8]||(l[8]=s=>a.$emit("onItemLongClick",s.nativeEvent)),onOnItemFocused:l[9]||(l[9]=s=>a.$emit("onItemFocused",s.nativeEvent)),onOnProtocolMismatch:l[10]||(l[10]=s=>a.$emit("onProtocolMismatch",s.nativeEvent))},a.$attrs),{default:c.withCtx(()=>[c.renderSlot(a.$slots,"default")]),_:3},16,["protocolVersion","pageSpec","tabsData","actionPayload"]))}});let K;var ce;try{const o=require("@extscreen/es3-vue");K=o.registerElement||((ce=o.default)==null?void 0:ce.registerElement)}catch{}const ge={install:o=>{if(!globalThis.__QtGridTabs_registered)if(K){const d=(u,r)=>{K(u,{component:{name:r?"QtGridTabs_Plugin":"QtGridTabs",processEventData(y,b){const f=y.handler||y,v=b||(f==null?void 0:f.nativeParams)||{};return f&&(f.nativeEvent=v),f}}})};d("qt-grid-tabs",!1),d("qt-grid-tabs-plugin",!0),d("QtGridTabs",!1),d("QtGridTabs_Plugin",!0),d("gt-tabs",!1),d("gt-tabs-plugin",!0),globalThis.__QtGridTabs_registered=!0,console.log("[@quicktvui/naddons] Successfully registered Native tag:","QtGridTabs")}else console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");o.component("GridTabs",B),o.component("qt-grid-tabs",B),o.component("gt-tabs",B)}};function Ee(o,d){const u=c.ref(""),r=d?JSON.parse(JSON.stringify(d)):{},y=c.shallowRef([]),b=c.shallowRef([]);let f=!1,v=!1;const a="__virtual_single_tab__";let l="",s=!1;const P=c.ref({}),h=t=>{const e=Array.isArray(t)?t:[t];if(v&&o.value){if(typeof o.value.dispatchAction=="function"){console.log("[useGridTabs] Calling Wrapper dispatchAction directly"),o.value.dispatchAction(e);return}let n=o.value;typeof o.value.getNativeNode=="function"?n=o.value.getNativeNode()||o.value:o.value.nativeRef&&(n=o.value.nativeRef),n?(console.log("[useGridTabs] Calling Native callUIFunction dispatchAction fallback"),A.Native.callUIFunction(n,"dispatchAction",[JSON.stringify(e)])):console.warn("[useGridTabs] Native target is null or undefined, cannot call dispatchAction")}},G=(t,e)=>{if(!t)return!1;let n=!0;return t.id||(console.error(`[useGridTabs] ❌ 数据格式错误 (${e}): 卡片缺失必填字段 'id'。每个卡片必须有唯一标识才能进行后续更新!`,t),n=!1),t.viewType||(console.error(`[useGridTabs] ❌ 数据格式错误 (${e}): 卡片缺失必填字段 'viewType' (id: ${t.id||"未知"})。必须指定 Native 注册的视图类型或 Portal 标识!`,t),n=!1),n},$=(t,e)=>{if(!t)return!1;let n=!0;return t.tabId||(console.error(`[useGridTabs] ❌ 数据格式错误 (${e}): Tab 缺失必填字段 'tabId'。每个 Tab 必须有唯一标识!`,t),n=!1),(t.title===void 0||t.title===null)&&console.warn(`[useGridTabs] ⚠️ 数据格式警告 (${e}): Tab 缺失 'title' 字段 (tabId: ${t.tabId||"未知"}),导航栏可能显示为空。`,t),n},R=(t,e)=>{if(!t||t.length===0)return;F.clear();const n=t[0].hasOwnProperty("tabId")||t[0].hasOwnProperty("items")&&Array.isArray(t[0].items);f=e==="1d",e==="1d"&&n?console.error("[useGridTabs] ❌ 赋值错误: 你正在向 `items.value` (一维瀑布流) 赋值二维 Tabs 数据结构!请改用 `tabs.value = ...`"):e==="2d"&&!n&&console.error("[useGridTabs] ❌ 赋值错误: 你正在向 `tabs.value` (二维导航) 赋值一维卡片列表数据结构!请改用 `items.value = ...`"),e==="1d"?t.forEach((i,g)=>G(i,`items.value[${g}]`)):t.forEach((i,g)=>{$(i,`tabs.value[${g}]`),i.items&&Array.isArray(i.items)&&i.items.forEach((m,p)=>G(m,`tabs.value[${g}].items[${p}]`))}),v=!0,T()},F=new Set,T=(t="unknown")=>{if(!v){console.warn("[useGridTabs] triggerRootUpdate skipped because isInitialized is false");return}let e={protocolVersion:"1.28.0",gridBasis:(r==null?void 0:r.gridBasis)??30,unitType:(r==null?void 0:r.unitType)??"px",contentConfig:(r==null?void 0:r.contentConfig)??(r==null?void 0:r.layoutConfig)??{box:{padding:[0,60,60,60]},navContentGapNormal:0,itemGap:24},navConfig:(r==null?void 0:r.navConfig)??{dock:"left",mode:"fixed",renderType:"smart-hybrid",box:{size:[200,0]},expandedBox:{size:[300,0]}},cacheConfig:(r==null?void 0:r.cacheConfig)??{offscreenPageLimit:1,prefetchOffset:2,preLoadEnabled:!1,strategy:"data_priority"},animationConfig:(r==null?void 0:r.animationConfig)??{duration:300,easing:"ease-out"},interactionStrategy:(r==null?void 0:r.interactionStrategy)??{defaultFocus:"nav",interceptBack:!0,backMode:"home-first",autoScrollToTop:!0,edgeScrollProtection:.5},focusConfig:(r==null?void 0:r.focusConfig)??{boundaryLock:{left:!1,right:!1,top:!1,bottom:!1}},themeConfig:r==null?void 0:r.themeConfig,referenceResolution:(r==null?void 0:r.referenceResolution)??{w:1920,h:1080}},n=[];f?(e.navConfig={...e.navConfig,renderType:"none"},n=[{tabId:a,title:"Virtual Tab",hidden:!0,items:b.value}]):n=y.value;const i=JSON.stringify({page_spec:e,tabs:n});if(u.value==="")console.log(`[useGridTabs] triggerRootUpdate: Initializing tabsDataStr (length=${i.length})`),u.value=i,l=i;else{if(l===i){console.log("[useGridTabs] triggerRootUpdate: Data unchanged, skipping RELOAD_TABS");return}console.log(`[useGridTabs] triggerRootUpdate: Sending RELOAD_TABS action directly to Native (length=${i.length})`),u.value=i,l=i,h({op:"RELOAD_TABS",payload:{pageSpec:e,page_spec:e,tabs:n}})}},N=t=>{if(!t||typeof t!="object"||t.__isGridTabsProxy)return t;t.content&&typeof t.content=="object"&&!t.content.__isGridTabsProxy&&(t.content=new Proxy(t.content,{set(n,i,g,m){const p=Reflect.set(n,i,g,m);return t.id&&v&&h({op:"UPDATE_ITEM",itemId:t.id,payload:t}),p}}),Object.defineProperty(t.content,"__isGridTabsProxy",{value:!0,enumerable:!1}),Object.defineProperty(t.content,"__v_skip",{value:!0,enumerable:!1})),t.subItems&&Array.isArray(t.subItems)&&!t.subItems.__isGridTabsProxy&&(t.subItems=S(t.subItems,t.id),Object.defineProperty(t.subItems,"__isGridTabsProxy",{value:!0,enumerable:!1}),Object.defineProperty(t.subItems,"__v_skip",{value:!0,enumerable:!1}));const e=new Proxy(t,{set(n,i,g,m){const p=Reflect.set(n,i,g,m);return n.id&&v&&!s&&h({op:"UPDATE_ITEM",itemId:n.id,payload:n}),p}});return Object.defineProperty(e,"__isGridTabsProxy",{value:!0,enumerable:!1}),Object.defineProperty(e,"__v_skip",{value:!0,enumerable:!1}),e},S=(t,e)=>{for(let n=0;n<t.length;n++)t[n]=N(t[n]);return new Proxy(t,{get(n,i,g){return i==="push"?(...m)=>{m.forEach((x,U)=>G(x,`push(${U})`)),v||console.error("[useGridTabs] ❌ 时机错误: 在底层还未完成初始化时调用了 push()。请先对 items.value 或 tabs.value 进行全量赋值!");const p=m.map(x=>N(x)),I=Array.prototype.push.apply(n,p);return s||h({op:"APPEND_SUB_ITEMS",itemId:e,payload:{subItems:p}}),I}:i==="unshift"?(...m)=>{m.forEach((x,U)=>G(x,`unshift(${U})`)),v||console.error("[useGridTabs] ❌ 时机错误: 在底层还未完成初始化时调用了 unshift()。请先对 items.value 或 tabs.value 进行全量赋值!");const p=m.map(x=>N(x)),I=Array.prototype.unshift.apply(n,p);return v&&p.length>0&&!s&&h({op:"PREPEND_SUB_ITEMS",itemId:e,payload:{subItems:p}}),I}:i==="splice"?(...m)=>{const p=m.length>=2&&m[0]===0&&m[1]===n.length,I=Array.prototype.splice.apply(n,m);return v&&p&&e!==a?s||h({op:"CLEAR_SUB_ITEMS",itemId:e}):v&&(s||T("items array spliced")),I}:Reflect.get(n,i,g)},set(n,i,g,m){if(i!=="length"&&!isNaN(Number(i))){v||console.error(`[useGridTabs] ❌ 时机错误: 在底层还未完成初始化时直接修改了索引 [${String(i)}]。请先对 items.value 或 tabs.value 进行全量赋值!`),G(g,`索引赋值 [${String(i)}]`);const p=N(g),I=Reflect.set(n,i,p,m);return p&&p.id&&!s&&h({op:"UPDATE_ITEM",itemId:p.id,payload:p}),I}return Reflect.set(n,i,g,m)}})},k=t=>(t.items&&Array.isArray(t.items)&&!t.items.__isGridTabsProxy&&(t.items=S(t.items,t.tabId),Object.defineProperty(t.items,"__isGridTabsProxy",{value:!0,enumerable:!1})),new Proxy(t,{set(e,n,i,g){if(n==="items"){let p=i;return Array.isArray(i)&&!i.__isGridTabsProxy&&(p=S(i,e.tabId),Object.defineProperty(p,"__isGridTabsProxy",{value:!0,enumerable:!1})),Reflect.set(e,n,p,g)}else if(n==="loadState"){const p=Reflect.set(e,n,i,g);return v&&e.tabId&&!s&&h({op:"UPDATE_TAB_STATE",itemId:e.tabId,payload:{loadState:i}}),p}return Reflect.set(e,n,i,g)}})),C=t=>{const e=t.map(n=>k(n));return new Proxy(e,{set(n,i,g,m){if(i!=="length"&&!isNaN(Number(i))){let p=g;g.__isGridTabsProxy||(p=k(g),Object.defineProperty(p,"__isGridTabsProxy",{value:!0,enumerable:!1}));const I=Reflect.set(n,i,p,m);return T(),I}return Reflect.set(n,i,g,m)}})};c.watch(y,(t,e)=>{if(console.log("[useGridTabs] watch(tabs) triggered:",{newTabs:t,isInitialized:v}),!t||t.length===0){u.value="",l="",v=!1;return}if(t.__isGridTabsProxy)console.log("[useGridTabs] newTabs is ALREADY a proxy, triggering root update"),T();else{console.log("[useGridTabs] newTabs is NOT a proxy, performing full deduceModeAndInitialize & wrapping");const n=C(t);Object.defineProperty(n,"__isGridTabsProxy",{value:!0,enumerable:!1}),R(n,"2d"),y.value=n}},{flush:"sync",deep:!1}),c.watch(b,(t,e)=>{if(console.log("[useGridTabs] watch(items) triggered:",{newItems:t,isInitialized:v}),!t||t.length===0){u.value="",l="",v=!1;return}if(t.__isGridTabsProxy)console.log("[useGridTabs] newItems is ALREADY a proxy, triggering root update"),T();else{console.log("[useGridTabs] newItems is NOT a proxy, performing full deduceModeAndInitialize & wrapping");const n=S(t,a);Object.defineProperty(n,"__isGridTabsProxy",{value:!0,enumerable:!1}),R(n,"1d"),b.value=n}},{flush:"sync",deep:!1});const E={},w=()=>{console.log("[useGridTabs] resetInitialization called manually"),v=!1,F.clear();for(const t in E)delete E[t]},O=t=>{if(!t||t.length===0){u.value="",v=!1;return}t[0].hasOwnProperty("tabId")||t[0].hasOwnProperty("items")&&Array.isArray(t[0].items)?y.value=t:b.value=t},_=t=>{P.value=t},M=c.computed(()=>({tabsData:u.value,onTabNeedsData:async(...t)=>{let e=t[0];if(e&&e.nativeEvent&&(e=e.nativeEvent),!P.value.onTabNeedsData)return;const{tabId:n,index:i,reason:g}=e;if(F.has(n)){console.log(`[useGridTabs] onTabNeedsData SKIP: tabId=${n} 已经发起过请求,防止死循环`);return}F.add(n);try{const m=await P.value.onTabNeedsData(n,i,g);if(m&&Array.isArray(m))if(E[n]=1,m.length>0){const p=y.value.find(I=>I.tabId===n);p&&(p.items?p.items.length>0&&p.items.splice(0,p.items.length):p.items=[],p.items.push(...m),p.loadState="ready",h({op:"UPDATE_TAB_STATE",itemId:n,payload:{loadState:"ready"}}))}else console.warn(`[useGridTabs] ⚠️ 警告: onTabNeedsData(tabId="${n}") 返回了空数组 []!`),console.warn("👉 如果你已经在此函数内手动调用了 push() 来追加数据,请在最后 return null 或 undefined。"),console.warn("👉 如果该 Tab 确实没有数据,返回 [] 可能会导致底层的 Header 等已有元素被清空,请注意检查。"),console.warn("👉 框架已为您拦截此次空数组覆盖,保留了当前的 DOM 结构。")}catch(m){console.error("[useGridTabs] onTabNeedsData 执行失败:",m),F.delete(n)}},onLoadMore:async(...t)=>{let e=t[0];if(e&&e.nativeEvent&&(e=e.nativeEvent),!P.value.onLoadMore)return;const{tabId:n,itemId:i}=e,m=(E[n]||1)+1;console.log(`[useGridTabs] 拦截到底层 onLoadMore,强行接管页码: tabId=${n}, pageNo=${m}`);try{const p=await P.value.onLoadMore(n,m,i);if(p&&Array.isArray(p))if(p.length>0)if(E[n]=m,f)b.value.push(...p);else{const I=y.value.find(x=>x.tabId===n);I&&I.items&&I.items.push(...p)}else console.warn(`[useGridTabs] ⚠️ 警告: onLoadMore(tabId="${n}", pageNo="${m}") 返回了空数组 []!`),console.warn('👉 如果这是你的最后一页数据,推荐在卡片列表中追加一个 type="no_more" 的 footer 卡片,而不是仅仅返回空。'),console.warn("👉 框架已忽略本次空数据追加,且不会自增页码。")}catch(p){console.error("[useGridTabs] onLoadMore 业务层请求失败:",p)}},onItemPresence:(...t)=>{let e=t[0];if(console.log("[useGridTabs] ⚡️ bindings caught onItemPresence:",e),P.value.onItemPresence)try{let n=typeof e=="string"?e:(e==null?void 0:e.nativeEvent)||e;n&&typeof n.data=="string"&&(n=n.data);const i=typeof n=="string"?JSON.parse(n):n;i&&i.type==="VIEW_PRESENCE_BATCH"&&Array.isArray(i.payload)?i.payload.forEach(g=>{g.itemId&&typeof g.itemId=="string"&&g.itemId.startsWith("fallback_pos_")&&console.warn(`[useGridTabs] ⚠️ 警告:检测到列表项曝光 (index=${g.index}),但未配置 itemId。请检查传入的 items 数组,务必为每个数据项指定唯一的 itemId,否则底层无法准确进行去重与曝光上报。`),P.value.onItemPresence(g)}):P.value.onItemPresence(i)}catch(n){console.error("[useGridTabs] Failed to parse onItemPresence event payload:",n),P.value.onItemPresence(e)}},onTabSelected:(...t)=>{let e=t[0];e&&e.nativeEvent&&(e=e.nativeEvent),P.value.onTabSelected&&P.value.onTabSelected(e)},onItemClick:(...t)=>{let e=t[0];if(console.log("[useGridTabs] RAW onItemClick intercepted from Native:",e),e&&e.nativeEvent&&(e=e.nativeEvent),P.value.onItemClick)try{let n=typeof e=="string"?e:(e==null?void 0:e.data)||e;const i=typeof n=="string"?JSON.parse(n):n;P.value.onItemClick(i)}catch(n){console.error("[useGridTabs] Failed to parse onItemClick event payload:",n),P.value.onItemClick(e)}else console.warn("[useGridTabs] onItemClick triggered but NO callback registered in callbacksRef!")},onItemLongClick:(...t)=>{let e=t[0];if(console.log("[useGridTabs] RAW onItemLongClick intercepted from Native:",e),typeof e=="number"&&t.length>=3&&typeof t[1]=="string"&&(e=t[2]),e&&e.nativeEvent&&(e=e.nativeEvent),P.value.onItemLongClick)try{let n=typeof e=="string"?e:(e==null?void 0:e.data)||e;const i=typeof n=="string"?JSON.parse(n):n;P.value.onItemLongClick(i)}catch(n){console.error("[useGridTabs] Failed to parse onItemLongClick event payload:",n),P.value.onItemLongClick(e)}},onItemFocused:(...t)=>{let e=t[0];if(e&&e.nativeEvent&&(e=e.nativeEvent),P.value.onItemFocused)try{let n=typeof e=="string"?e:(e==null?void 0:e.data)||e;const i=typeof n=="string"?JSON.parse(n):n;P.value.onItemFocused(i)}catch(n){console.error("[useGridTabs] Failed to parse onItemFocused event payload:",n),P.value.onItemFocused(e)}},onTabFocused:(...t)=>{let e=t[0];e&&e.nativeEvent&&(e=e.nativeEvent),P.value.onTabFocused&&P.value.onTabFocused(e)},onScroll:(...t)=>{let e=t[0];if(e&&e.nativeEvent&&(e=e.nativeEvent),P.value.onScroll)try{const n=(e==null?void 0:e.data)||e;P.value.onScroll(n)}catch{P.value.onScroll(e)}},onScrollStateChanged:(...t)=>{let e=t[0];if(e&&e.nativeEvent&&(e=e.nativeEvent),P.value.onScrollStateChanged)try{const n=(e==null?void 0:e.data)||e;P.value.onScrollStateChanged(n)}catch{P.value.onScrollStateChanged(e)}}}));return{tabsDataStr:u,bindings:M,tabs:y,items:b,initData:O,setCallbacks:_,updateItem:(t,e)=>{if(!v){console.error("[useGridTabs] ❌ 时机错误: 尚未初始化数据,无法调用 updateItem");return}h({op:"UPDATE_ITEM",itemId:t,payload:e}),s=!0;try{if(f){const n=b.value.find(i=>i.id===t);n&&Object.assign(n,e)}else for(const n of y.value)if(n.items){const i=n.items.find(g=>g.id===t);if(i){Object.assign(i,e);break}}}finally{s=!1}},deleteItem:(t,e=!0)=>{if(v){h({op:"DELETE_ITEM",itemId:t,payload:{animated:e}}),s=!0;try{if(f){const n=b.value.findIndex(i=>i.id===t);n!==-1&&b.value.splice(n,1)}else for(const n of y.value)if(n.items){const i=n.items.findIndex(g=>g.id===t);if(i!==-1){n.items.splice(i,1);break}}}finally{s=!1}}},prependItems:(t,e)=>{if(v){h({op:"PREPEND_SUB_ITEMS",itemId:t,payload:{subItems:e}}),s=!0;try{if(f)b.value.unshift(...e);else{const n=y.value.find(i=>i.tabId===t);n&&n.items&&n.items.unshift(...e)}}finally{s=!1}}},clearItems:t=>{if(v){h({op:"CLEAR_SUB_ITEMS",itemId:t}),s=!0;try{if(f)b.value.splice(0,b.value.length);else{const e=y.value.find(n=>n.tabId===t);e&&e.items&&e.items.splice(0,e.items.length)}}finally{s=!1}}},moveItem:(t,e,n)=>{if(v){h({op:"MOVE_ITEM",itemId:t,payload:{targetPosition:e,anchorItemId:n}}),s=!0;try{const i=g=>{const m=g.findIndex(I=>I.id===t),p=g.findIndex(I=>I.id===n);if(m!==-1&&p!==-1){const I=g.splice(m,1)[0],x=g.findIndex(Ne=>Ne.id===n),U=e==="after"?x+1:x;g.splice(U,0,I)}};if(f)i(b.value);else for(const g of y.value)g.items&&i(g.items)}finally{s=!1}}},replaceItem:(t,e)=>{if(v){h({op:"REPLACE_ITEM",itemId:t,payload:e}),s=!0;try{if(f){const n=b.value.findIndex(i=>i.id===t);n!==-1&&(b.value[n]=e)}else for(const n of y.value)if(n.items){const i=n.items.findIndex(g=>g.id===t);if(i!==-1){n.items[i]=e;break}}}finally{s=!1}}},dispatchAction:h,resetInitialization:w,getFocusState:async()=>new Promise((t,e)=>{let n=o.value;typeof o.value.getNativeNode=="function"?n=o.value.getNativeNode()||o.value:o.value.nativeRef&&(n=o.value.nativeRef),console.log("[useGridTabs] getFocusState called, nativeTarget:",n);const i=g=>{if(console.log("[useGridTabs] getFocusState callback received:",g),g&&g.isSuccess!==void 0&&g.result!==void 0){t(g.result);return}try{const m=typeof g=="string"?JSON.parse(g):g;t(m)}catch(m){e(m)}};typeof A.Native.callUIFunction=="function"?(console.log('[useGridTabs] Executing Native.callUIFunction("getFocusState") with callback as 4th arg'),A.Native.callUIFunction(n,"getFocusState",[],i)):(console.error("[useGridTabs] Native.callUIFunction is not available"),e(new Error("Native.callUIFunction is not available")))}),getItemRect:async t=>new Promise((e,n)=>{let i=o.value;typeof o.value.getNativeNode=="function"?i=o.value.getNativeNode()||o.value:o.value.nativeRef&&(i=o.value.nativeRef),console.log(`[useGridTabs] getItemRect called for itemId=${t}, nativeTarget:`,i);const g=m=>{if(console.log(`[useGridTabs] getItemRect callback received for itemId=${t}:`,m),m&&m.isSuccess!==void 0&&m.result!==void 0){e(m.result);return}try{const p=typeof m=="string"?JSON.parse(m):m;e(p)}catch(p){n(p)}};typeof A.Native.callUIFunction=="function"?(console.log('[useGridTabs] Executing Native.callUIFunction("getItemRect") with itemId and callback as 4th arg'),A.Native.callUIFunction(i,"getItemRect",[t],g)):(console.error("[useGridTabs] Native.callUIFunction is not available"),n(new Error("Native.callUIFunction is not available")))}),requestFocus:t=>{let e=o.value;typeof o.value.getNativeNode=="function"?e=o.value.getNativeNode()||o.value:o.value.nativeRef&&(e=o.value.nativeRef),A.Native.callUIFunction(e,"requestFocus",[t])},updatePageSpec:t=>{if(!v)return;const e=Object.assign({},JSON.parse(u.value).page_spec,t);t.layout&&(e.navConfig=Object.assign({},e.navConfig,t.layout)),t.navConfig&&(e.navConfig=Object.assign({},e.navConfig,t.navConfig)),t.contentConfig&&(e.contentConfig=Object.assign({},e.contentConfig,t.contentConfig)),r&&Object.assign(r,e),h({op:"RELOAD_TABS",payload:{pageSpec:e,page_spec:e,tabs:y.value}});const n=JSON.parse(u.value);n.page_spec=e,u.value=JSON.stringify(n),l=u.value},reloadAll:(t,e)=>{r&&(Object.keys(r).forEach(n=>delete r[n]),Object.assign(r,t)),y.value=e,h({op:"RELOAD_TABS",payload:{pageSpec:t,page_spec:t,tabs:e}})},scrollToTop:()=>{let t=o.value;typeof o.value.getNativeNode=="function"?t=o.value.getNativeNode()||o.value:o.value.nativeRef&&(t=o.value.nativeRef),A.Native.callUIFunction(t,"scrollToTop",[])}}}const ae="QtKeyboard",V=c.defineComponent({__name:"Keyboard",props:{backgroundColor:{},backgroundGradient:{},textColor:{},weakTextColor:{},focusBackgroundColor:{},focusTextColor:{},placeholder:{},textFullKeyboard:{},textT9Keyboard:{},keyboardType:{},textClear:{},textDelete:{},currentInput:{},autofocus:{type:Boolean},rememberKeyboardType:{type:Boolean}},emits:["onInputChanged","onKeyPressed"],setup(o,{expose:d}){const u=c.ref(),r=q(),y=ae+"_Plugin",f=(r.isPluginActive?y:ae).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase().replace(/^-/,""),v=D(f,r.pluginPackageName||"com.quicktvui.plugin.extraui","com.quicktvui.plugin.extraui.ExtraUIPluginApp");return d({getNativeNode:()=>{var a,l;return((l=(a=u.value)==null?void 0:a.getNativeNode)==null?void 0:l.call(a))||u.value},requestFocus:(...a)=>{var s,P;const l=((P=(s=u.value)==null?void 0:s.getNativeNode)==null?void 0:P.call(s))||u.value;l&&A.Native.callUIFunction(l,"requestFocus",a)}}),(a,l)=>(c.openBlock(),c.createBlock(c.unref(v),c.mergeProps({ref_key:"nativeRef",ref:u,backgroundColor:o.backgroundColor,backgroundGradient:o.backgroundGradient,textColor:o.textColor,weakTextColor:o.weakTextColor,focusBackgroundColor:o.focusBackgroundColor,focusTextColor:o.focusTextColor,placeholder:o.placeholder,textFullKeyboard:o.textFullKeyboard,textT9Keyboard:o.textT9Keyboard,keyboardType:o.keyboardType,textClear:o.textClear,textDelete:o.textDelete,currentInput:o.currentInput,autofocus:o.autofocus,rememberKeyboardType:o.rememberKeyboardType,onOnInputChanged:l[0]||(l[0]=s=>a.$emit("onInputChanged",s.nativeEvent)),onOnKeyPressed:l[1]||(l[1]=s=>a.$emit("onKeyPressed",s.nativeEvent))},a.$attrs),{default:c.withCtx(()=>[c.renderSlot(a.$slots,"default")]),_:3},16,["backgroundColor","backgroundGradient","textColor","weakTextColor","focusBackgroundColor","focusTextColor","placeholder","textFullKeyboard","textT9Keyboard","keyboardType","textClear","textDelete","currentInput","autofocus","rememberKeyboardType"]))}});let W;var ue;try{const o=require("@extscreen/es3-vue");W=o.registerElement||((ue=o.default)==null?void 0:ue.registerElement)}catch{}const pe={install:o=>{if(!globalThis.__QtKeyboard_registered)if(W){const d=(u,r)=>{W(u,{component:{name:r?"QtKeyboard_Plugin":"QtKeyboard",processEventData(y,b){const f=y.handler||y,v=b||(f==null?void 0:f.nativeParams)||{};return f&&(f.nativeEvent=v),f}}})};d("qt-keyboard",!1),d("qt-keyboard-plugin",!0),d("QtKeyboard",!1),d("QtKeyboard_Plugin",!0),globalThis.__QtKeyboard_registered=!0,console.log("[@quicktvui/naddons] Successfully registered Native tag:","QtKeyboard")}else console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");o.component("Keyboard",V),o.component("qt-keyboard",V)}},ie="QtPortalPool",z=c.defineComponent({__name:"PortalPool",setup(o,{expose:d}){const u=c.ref(),r=q(),y=ie+"_Plugin",f=(r.isPluginActive?y:ie).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase().replace(/^-/,""),v=D(f,r.pluginPackageName||"com.quicktvui.plugin.glintui");return d({getNativeNode:()=>{var a,l;return((l=(a=u.value)==null?void 0:a.getNativeNode)==null?void 0:l.call(a))||u.value}}),(a,l)=>(c.openBlock(),c.createBlock(c.unref(v),c.mergeProps({ref_key:"nativeRef",ref:u},a.$attrs),{default:c.withCtx(()=>[c.renderSlot(a.$slots,"default")]),_:3},16))}});let J;var de;try{const o=require("@extscreen/es3-vue");J=o.registerElement||((de=o.default)==null?void 0:de.registerElement)}catch{}const me={install:o=>{if(!globalThis.__QtPortalPool_registered)if(J){const d=(u,r)=>{J(u,{component:{name:r?"QtPortalPool_Plugin":"QtPortalPool",processEventData(y,b){const f=y.handler||y,v=b||(f==null?void 0:f.nativeParams)||{};return f&&(f.nativeEvent=v),f}}})};d("qt-portal-pool",!1),d("qt-portal-pool-plugin",!0),d("QtPortalPool",!1),d("QtPortalPool_Plugin",!0),globalThis.__QtPortalPool_registered=!0,console.log("[@quicktvui/naddons] Successfully registered Native tag:","QtPortalPool")}else console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");o.component("PortalPool",z),o.component("qt-portal-pool",z)}},se="QtPortalItem",Z=c.defineComponent({__name:"PortalItem",props:{portalId:{}},setup(o,{expose:d}){const u=c.ref(),r=q(),y=se+"_Plugin",f=(r.isPluginActive?y:se).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase().replace(/^-/,""),v=D(f,r.pluginPackageName||"com.quicktvui.plugin.glintui");return d({getNativeNode:()=>{var a,l;return((l=(a=u.value)==null?void 0:a.getNativeNode)==null?void 0:l.call(a))||u.value}}),(a,l)=>(c.openBlock(),c.createBlock(c.unref(v),c.mergeProps({ref_key:"nativeRef",ref:u,portalId:o.portalId},a.$attrs),{default:c.withCtx(()=>[c.renderSlot(a.$slots,"default")]),_:3},16,["portalId"]))}});let H;var fe;try{const o=require("@extscreen/es3-vue");H=o.registerElement||((fe=o.default)==null?void 0:fe.registerElement)}catch{}const be={install:o=>{if(!globalThis.__QtPortalItem_registered)if(H){const d=(u,r)=>{H(u,{component:{name:r?"QtPortalItem_Plugin":"QtPortalItem",processEventData(y,b){const f=y.handler||y,v=b||(f==null?void 0:f.nativeParams)||{};return f&&(f.nativeEvent=v),f}}})};d("qt-portal-item",!1),d("qt-portal-item-plugin",!0),d("QtPortalItem",!1),d("QtPortalItem_Plugin",!0),globalThis.__QtPortalItem_registered=!0,console.log("[@quicktvui/naddons] Successfully registered Native tag:","QtPortalItem")}else console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");o.component("PortalItem",Z),o.component("qt-portal-item",Z)}},le="QtHsvBackground",Y=c.defineComponent({__name:"HsvBackground",props:{hue:{default:-2}},setup(o,{expose:d}){const u=c.ref(),r=q(),y=le+"_Plugin",f=(r.isPluginActive?y:le).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase().replace(/^-/,""),v=D(f,r.pluginPackageName||"com.quicktvui.plugin.glintui");return d({getNativeNode:()=>{var a,l;return((l=(a=u.value)==null?void 0:a.getNativeNode)==null?void 0:l.call(a))||u.value}}),(a,l)=>(c.openBlock(),c.createBlock(c.unref(v),c.mergeProps({ref_key:"nativeRef",ref:u,hue:o.hue},a.$attrs),{default:c.withCtx(()=>[c.renderSlot(a.$slots,"default")]),_:3},16,["hue"]))}}),ye={install(o){o.component("qt-hsv-background",Y),o.component("HsvBackground",Y)}},re="QtSvgImage",X=c.defineComponent({__name:"SvgImage",props:{src:{},tintColor:{}},setup(o,{expose:d}){const u=c.ref(),r=q(),y=re+"_Plugin",f=(r.isPluginActive?y:re).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase().replace(/^-/,""),v=D(f,r.pluginPackageName||"com.quicktvui.plugin.extraui","com.quicktvui.plugin.extraui.ExtraUIPluginApp");return d({getNativeNode:()=>{var a,l;return((l=(a=u.value)==null?void 0:a.getNativeNode)==null?void 0:l.call(a))||u.value}}),(a,l)=>(c.openBlock(),c.createBlock(c.unref(v),c.mergeProps({ref_key:"nativeRef",ref:u,src:o.src,tintColor:o.tintColor},a.$attrs),{default:c.withCtx(()=>[c.renderSlot(a.$slots,"default")]),_:3},16,["src","tintColor"]))}});let ee;var ve;try{const o=require("@extscreen/es3-vue");ee=o.registerElement||((ve=o.default)==null?void 0:ve.registerElement)}catch{}const Pe={install:o=>{if(!globalThis.__QtSvgImage_registered)if(ee){const d=(u,r)=>{ee(u,{component:{name:r?"QtSvgImage_Plugin":"QtSvgImage",processEventData(y,b){const f=y.handler||y,v=b||(f==null?void 0:f.nativeParams)||{};return f&&(f.nativeEvent=v),f}}})};d("qt-svg-image",!1),d("qt-svg-image-plugin",!0),d("QtSvgImage",!1),d("QtSvgImage_Plugin",!0),globalThis.__QtSvgImage_registered=!0,console.log("[@quicktvui/naddons] Successfully registered Native tag:","QtSvgImage")}else console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");o.component("SvgImage",X),o.component("qt-svg-image",X)}},Te={skipPluginCheck:!1},Q=new Set;function D(o,d,u){return c.defineComponent({name:`${o}AsyncWrapper`,inheritAttrs:!1,props:{skipPluginCheck:{type:Boolean,default:!1}},setup(r,{slots:y,attrs:b,expose:f}){const v=c.ref("loading"),a=c.ref(""),l=c.ref(),s=globalThis.__VUE_INSTANCE__;f({getNativeNode:()=>{let T=l.value;return!T&&s&&s.vnode&&s.vnode.el&&(T=s.vnode.el,T.childNodes&&T.childNodes.length>0&&(T=T.childNodes[0])),T},nativeRef:l});let G=null,$=null;try{G=j.useES(),$=j.useESPlugin()}catch(T){console.warn("[withAsyncPlugin] 获取 useES 或 useESPlugin 失败,可能处于非 ES 环境。",T)}const R=async()=>{if(!G||typeof G.isComponentRegistered!="function")return console.log("[withAsyncPlugin] es.isComponentRegistered 不可用"),!1;try{const T=await G.isComponentRegistered(o);if(console.log(`[withAsyncPlugin] isComponentRegistered('${o}') 返回:`,T),T===!0||T&&typeof T=="object"&&(T.registered===!0||T.isRegistered===!0))return!0;try{const N=await A.Native.callNativeWithPromise("ExtendModule","getCoreSDKInfo");if(N&&N.core_version){const S=N.core_version;console.log(`[withAsyncPlugin] 当前引擎核心版本: ${S}`);const k=S.split(".").map(C=>parseInt(C,10));if(k.length>=3&&!isNaN(k[0])&&!isNaN(k[1])&&!isNaN(k[2]))if(k[0]*1e6+k[1]*1e3+k[2]>=1011205){console.log(`[withAsyncPlugin] 引擎 >= 1.11.205,使用 ExtendModule 检查 Controller: ${o}`);const E=o.split("-").map(_=>_.charAt(0).toUpperCase()+_.slice(1)).join("");console.log(`[withAsyncPlugin] 同时检查原名和驼峰名: ${o}, ${E}`);const[w,O]=await Promise.all([A.Native.callNativeWithPromise("ExtendModule","isComponentRegistered",o).catch(()=>!1),A.Native.callNativeWithPromise("ExtendModule","isComponentRegistered",E).catch(()=>!1)]);if(console.log(`[withAsyncPlugin] ExtendModule.isComponentRegistered 返回: [${w}, ${O}]`),w===!0||O===!0)return!0}else console.log(`[withAsyncPlugin] 引擎版本 ${S} < 1.11.205,跳过 ExtendModule 检查`);else console.log(`[withAsyncPlugin] 无法解析引擎版本号: ${S}`)}}catch(N){console.log("[withAsyncPlugin] 获取引擎版本或检查 Controller 失败:",N)}return!1}catch(T){return console.warn("[withAsyncPlugin] 检查组件注册状态异常:",T),!1}},F=async()=>{if(Te.skipPluginCheck||r.skipPluginCheck){console.log(`[withAsyncPlugin] 跳过 ${o} 插件检查 (skipPluginCheck = true)`),v.value="ready";return}if(!d){v.value="ready";return}const T=await R();if(console.log(`[withAsyncPlugin] 拦截检查 - ${o} 是否已注册:`,T),T||Q.has(d)){v.value="ready",Q.add(d),console.log("[withAsyncPlugin] 组件已注册,跳过安装流程");return}if(!$){console.warn(`[withAsyncPlugin] 无法获取 useESPlugin 实例,可能处于内置 AAR 环境或非插件环境,尝试直接渲染 ${o}`),v.value="ready";return}console.log(`[withAsyncPlugin] 开始动态安装插件: ${d}`);try{await new Promise((N,S)=>{let k;const C={onPluginInstallSuccess(E,w,O){E===d&&(clearTimeout(k),$.removeListener(C),console.log(`[withAsyncPlugin] 安装成功 pkg=${E} 状态码=${w}`),w==1003||w==1001?(u?(console.log(`[withAsyncPlugin] 触发反射初始化: ${u}`),A.Native.callNative("EsNativeModule","callReflect",{entry:{from:u,method:"setup"}})):console.log("[withAsyncPlugin] 安装成功,跳过反射初始化(无 pluginInitClass)"),N()):S(new Error(`安装失败 pkg=${E} status=${w} msg=${O}`)))},onPluginInstallError(E,w,O){E===d&&(clearTimeout(k),$.removeListener(C),S(new Error(`安装失败 pkg=${E} status=${w} msg=${O}`)))}};$.addListener({pkg:d},C),k=setTimeout(()=>{$.removeListener(C),S(new Error(`插件安装超时: ${d}`))},8e3),typeof $.installPlugin=="function"?$.installPlugin({pkg:d}):typeof $.install=="function"?$.install(d):S(new Error("当前运行时不支持 install / installPlugin"))}),await c.nextTick(),Q.add(d),v.value="ready"}catch(N){console.error("[withAsyncPlugin] 插件加载失败:",N),a.value=(N==null?void 0:N.message)||String(N),v.value="error"}};return c.onMounted(()=>{F()}),()=>{const T={display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",...b.style||{}};b.width!==void 0&&!T.width&&(T.width=typeof b.width=="number"?`${b.width}px`:b.width),b.height!==void 0&&!T.height&&(T.height=typeof b.height=="number"?`${b.height}px`:b.height);const N=b.class?`qt-plugin-container ${b.class}`:"qt-plugin-container",S={class:N,style:T,clipChildren:!1,clipPadding:!1,clipToPadding:!1};if(v.value==="loading")return c.h("div",S,[c.h("div",{style:{color:"white",fontSize:"30px"}},"插件加载中...")]);if(v.value==="error")return c.h("div",S,[c.h("div",{style:{color:"white",fontSize:"30px",backgroundColor:"rgba(255,0,0,0.5)"}},`插件加载失败: ${a.value}`)]);const k={},C={};for(const[_,M]of Object.entries(b))if(_.startsWith("on")&&typeof M=="function"){let L=_;_.startsWith("onOn")&&(L="on"+_.slice(4)),C[L]=M}else if(_.startsWith("on")&&Array.isArray(M)){let L=_;_.startsWith("onOn")&&(L="on"+_.slice(4)),C[L]=M}else _.startsWith("onOn")||(k[_]=M);const E={...k,...C,class:N,style:T,ref:_=>{l.value=_}},w=E.tabsData||"",O=E.actionPayload||"";return console.log("[withAsyncPlugin] 最终准备传递给 h() 的属性键集合:",Object.keys(E),"tabsData.length=",w.length,"actionPayload.length=",O.length),c.h(o,E,y.default?y.default():[])}}})}const ne=Symbol("AddonEnvContext"),he={isPluginActive:!1,nameSuffix:"",pluginPackageName:"com.quicktvui.plugin.glintui",builtInVersions:{}};async function Ae(o="com.quicktvui.plugin.glintui",d="_Plugin"){const u=j.useES();let r={};try{const a=await A.Native.callNativeModule("AddonEnvModule","getBuiltInVersions",[]);a&&typeof a=="object"&&(r=a)}catch(a){console.warn("[AddonProvider] Failed to fetch built-in versions from AddonEnvModule",a)}const y=`QtGridTabs${d}`,b=u.isComponentRegistered(y),f=b instanceof Promise?await b:b,v={isPluginActive:f,nameSuffix:f?d:"",pluginPackageName:f?`${o}.ext`:o,builtInVersions:r};return console.info("[AddonProvider] Environment initialized:",v),v}let te=c.ref(he);function Se(o){te.value=o,c.provide(ne,te)}function q(){var o;return((o=c.inject(ne,te))==null?void 0:o.value)||he}async function ke(o){console.log("[AddonProvider] Sending GridTabs global config to Native:",o);try{const d=await A.Native.callNativeWithPromise("GridTabsConfigModule","setDefaultConfig",JSON.stringify(o));return console.log("[AddonProvider] Received response from Native:",d),!!(d&&d.success)}catch(d){return console.error("[AddonProvider] Failed to initialize GridTabs global config:",d),!1}}const Ie={install:o=>{o.use(ge),o.use(pe),o.use(me),o.use(be),o.use(ye),o.use(Pe)}};exports.ADDON_ENV_CONTEXT_KEY=ne;exports.GridTabs=B;exports.GridTabsPlugin=ge;exports.HsvBackground=Y;exports.HsvBackgroundPlugin=ye;exports.Keyboard=V;exports.KeyboardPlugin=pe;exports.PortalItem=Z;exports.PortalItemPlugin=be;exports.PortalPool=z;exports.PortalPoolPlugin=me;exports.QuickTVUINAddons=Ie;exports.QuickTVUINAddonsConfig=Te;exports.SvgImage=X;exports.SvgImagePlugin=Pe;exports.default=Ie;exports.initAddonEnv=Ae;exports.initGridTabsGlobalConfig=ke;exports.provideAddonEnv=Se;exports.useAddonEnv=q;exports.useGridTabs=Ee;exports.withAsyncPlugin=D;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),T=require("@extscreen/es3-vue"),V=require("@extscreen/es3-core"),be="QtGridTabs",_=a.defineComponent({__name:"GridTabs",props:{protocolVersion:{},pageSpec:{},tabsData:{},actionPayload:{}},emits:["onTabSelected","onTabClick","onTabNeedsData","onLoadMore","onScroll","onScrollStateChanged","onItemPresence","onTabFocused","onItemClick","onItemLongClick","onItemFocused","onProtocolMismatch"],setup(e,{expose:l}){const d=a.ref(),c=O(),v=be+"_Plugin",r=(c.isPluginActive?v:be).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase().replace(/^-/,""),s=G(r,c.pluginPackageName||"com.quicktvui.plugin.glintui");return l({getNativeNode:()=>{var i,u;return((u=(i=d.value)==null?void 0:i.getNativeNode)==null?void 0:u.call(i))||d.value},dispatchAction:(...i)=>{var g,p;const u=((p=(g=d.value)==null?void 0:g.getNativeNode)==null?void 0:p.call(g))||d.value;if(u)if(i.length>0){let k=i[0];typeof k=="object"&&(k=JSON.stringify(k)),T.Native.callUIFunction(u,"dispatchAction",[k])}else T.Native.callUIFunction(u,"dispatchAction",i)},scrollToTop:(...i)=>{var g,p;const u=((p=(g=d.value)==null?void 0:g.getNativeNode)==null?void 0:p.call(g))||d.value;u&&T.Native.callUIFunction(u,"scrollToTop",i)},getFocusState:(...i)=>{var g,p;const u=((p=(g=d.value)==null?void 0:g.getNativeNode)==null?void 0:p.call(g))||d.value;u&&T.Native.callUIFunction(u,"getFocusState",i)},getItemRect:(...i)=>{var g,p;const u=((p=(g=d.value)==null?void 0:g.getNativeNode)==null?void 0:p.call(g))||d.value;u&&T.Native.callUIFunction(u,"getItemRect",i)},requestFocus:(...i)=>{var g,p;const u=((p=(g=d.value)==null?void 0:g.getNativeNode)==null?void 0:p.call(g))||d.value;u&&T.Native.callUIFunction(u,"requestFocus",i)}}),(i,u)=>(a.openBlock(),a.createBlock(a.unref(s),a.mergeProps({ref_key:"nativeRef",ref:d,protocolVersion:e.protocolVersion,pageSpec:e.pageSpec,tabsData:e.tabsData,actionPayload:e.actionPayload,onOnTabSelected:u[0]||(u[0]=g=>i.$emit("onTabSelected",g.nativeEvent)),onOnTabClick:u[1]||(u[1]=g=>i.$emit("onTabClick",g.nativeEvent)),onOnTabNeedsData:u[2]||(u[2]=g=>i.$emit("onTabNeedsData",g.nativeEvent)),onOnLoadMore:u[3]||(u[3]=g=>i.$emit("onLoadMore",g.nativeEvent)),onOnScroll:u[4]||(u[4]=g=>i.$emit("onScroll",g.nativeEvent)),onOnScrollStateChanged:u[5]||(u[5]=g=>i.$emit("onScrollStateChanged",g.nativeEvent)),onOnItemPresence:u[6]||(u[6]=g=>i.$emit("onItemPresence",g.nativeEvent)),onOnTabFocused:u[7]||(u[7]=g=>i.$emit("onTabFocused",g.nativeEvent)),onOnItemClick:u[8]||(u[8]=g=>i.$emit("onItemClick",g.nativeEvent)),onOnItemLongClick:u[9]||(u[9]=g=>i.$emit("onItemLongClick",g.nativeEvent)),onOnItemFocused:u[10]||(u[10]=g=>i.$emit("onItemFocused",g.nativeEvent)),onOnProtocolMismatch:u[11]||(u[11]=g=>i.$emit("onProtocolMismatch",g.nativeEvent))},i.$attrs),{default:a.withCtx(()=>[a.renderSlot(i.$slots,"default")]),_:3},16,["protocolVersion","pageSpec","tabsData","actionPayload"]))}});let U;var Pe;try{const e=require("@extscreen/es3-vue");U=e.registerElement||((Pe=e.default)==null?void 0:Pe.registerElement)}catch{}const Qe={install:e=>{if(!globalThis.__QtGridTabs_registered)if(U){const l=(d,c)=>{U(d,{component:{name:c?"QtGridTabs_Plugin":"QtGridTabs",processEventData(v,m){const r=v.handler||v,s=m||(r==null?void 0:r.nativeParams)||{};return r&&(r.nativeEvent=s),r}}})};l("qt-grid-tabs",!1),l("qt-grid-tabs-plugin",!0),l("QtGridTabs",!1),l("QtGridTabs_Plugin",!0),l("gt-tabs",!1),l("gt-tabs-plugin",!0),globalThis.__QtGridTabs_registered=!0,console.log("[@quicktvui/naddons] Successfully registered Native tag:","QtGridTabs")}else console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");e.component("GridTabs",_),e.component("qt-grid-tabs",_),e.component("gt-tabs",_)}};function tt(e,l){const d=a.ref(""),c=l?JSON.parse(JSON.stringify(l)):{},v=a.shallowRef([]),m=a.shallowRef([]);let r=!1,s=!1;const i="__virtual_single_tab__";let u="",g=!1;const p=a.ref({}),k=o=>{const t=Array.isArray(o)?o:[o];if(s&&e.value){if(typeof e.value.dispatchAction=="function"){console.log("[useGridTabs] Calling Wrapper dispatchAction directly"),e.value.dispatchAction(t);return}let n=e.value;typeof e.value.getNativeNode=="function"?n=e.value.getNativeNode()||e.value:e.value.nativeRef&&(n=e.value.nativeRef),n?(console.log("[useGridTabs] Calling Native callUIFunction dispatchAction fallback"),T.Native.callUIFunction(n,"dispatchAction",[JSON.stringify(t)])):console.warn("[useGridTabs] Native target is null or undefined, cannot call dispatchAction")}},q=(o,t)=>{if(!o)return!1;let n=!0;return o.id||(console.error(`[useGridTabs] ❌ 数据格式错误 (${t}): 卡片缺失必填字段 'id'。每个卡片必须有唯一标识才能进行后续更新!`,o),n=!1),o.viewType||(console.error(`[useGridTabs] ❌ 数据格式错误 (${t}): 卡片缺失必填字段 'viewType' (id: ${o.id||"未知"})。必须指定 Native 注册的视图类型或 Portal 标识!`,o),n=!1),n},B=(o,t)=>{if(!o)return!1;let n=!0;return o.tabId||(console.error(`[useGridTabs] ❌ 数据格式错误 (${t}): Tab 缺失必填字段 'tabId'。每个 Tab 必须有唯一标识!`,o),n=!1),(o.title===void 0||o.title===null)&&console.warn(`[useGridTabs] ⚠️ 数据格式警告 (${t}): Tab 缺失 'title' 字段 (tabId: ${o.tabId||"未知"}),导航栏可能显示为空。`,o),n},D=(o,t)=>{if(!o||o.length===0)return;R.clear();const n=o[0].hasOwnProperty("tabId")||o[0].hasOwnProperty("items")&&Array.isArray(o[0].items);r=t==="1d",t==="1d"&&n?console.error("[useGridTabs] ❌ 赋值错误: 你正在向 `items.value` (一维瀑布流) 赋值二维 Tabs 数据结构!请改用 `tabs.value = ...`"):t==="2d"&&!n&&console.error("[useGridTabs] ❌ 赋值错误: 你正在向 `tabs.value` (二维导航) 赋值一维卡片列表数据结构!请改用 `items.value = ...`"),t==="1d"?o.forEach((f,b)=>q(f,`items.value[${b}]`)):o.forEach((f,b)=>{B(f,`tabs.value[${b}]`),f.items&&Array.isArray(f.items)&&f.items.forEach((h,y)=>q(h,`tabs.value[${b}].items[${y}]`))}),s=!0,C()},R=new Set,C=(o="unknown")=>{if(!s){console.warn("[useGridTabs] triggerRootUpdate skipped because isInitialized is false");return}let t={protocolVersion:"1.28.0",gridBasis:(c==null?void 0:c.gridBasis)??30,unitType:(c==null?void 0:c.unitType)??"px",contentConfig:(c==null?void 0:c.contentConfig)??(c==null?void 0:c.layoutConfig)??{box:{padding:[0,60,60,60]},navContentGapNormal:0,itemGap:24},navConfig:(c==null?void 0:c.navConfig)??{dock:"left",mode:"fixed",renderType:"smart-hybrid",box:{size:[200,0]},expandedBox:{size:[300,0]}},cacheConfig:(c==null?void 0:c.cacheConfig)??{offscreenPageLimit:1,prefetchOffset:2,preLoadEnabled:!1,strategy:"data_priority"},animationConfig:(c==null?void 0:c.animationConfig)??{duration:300,easing:"ease-out"},interactionStrategy:(c==null?void 0:c.interactionStrategy)??{defaultFocus:"nav",interceptBack:!0,backMode:"home-first",autoScrollToTop:!0,edgeScrollProtection:.5},focusConfig:(c==null?void 0:c.focusConfig)??{boundaryLock:{left:!1,right:!1,top:!1,bottom:!1}},themeConfig:c==null?void 0:c.themeConfig,referenceResolution:(c==null?void 0:c.referenceResolution)??{w:1920,h:1080}},n=[];r?(t.navConfig={...t.navConfig,renderType:"none"},n=[{tabId:i,title:"Virtual Tab",hidden:!0,items:m.value}]):n=v.value;const f=JSON.stringify({page_spec:t,tabs:n});if(d.value==="")console.log(`[useGridTabs] triggerRootUpdate: Initializing tabsDataStr (length=${f.length})`),d.value=f,u=f;else{if(u===f){console.log("[useGridTabs] triggerRootUpdate: Data unchanged, skipping RELOAD_TABS");return}console.log(`[useGridTabs] triggerRootUpdate: Sending RELOAD_TABS action directly to Native (length=${f.length})`),d.value=f,u=f,k({op:"RELOAD_TABS",payload:{pageSpec:t,page_spec:t,tabs:n}})}},I=o=>{if(!o||typeof o!="object"||o.__isGridTabsProxy)return o;o.content&&typeof o.content=="object"&&!o.content.__isGridTabsProxy&&(o.content=new Proxy(o.content,{set(n,f,b,h){const y=Reflect.set(n,f,b,h);return o.id&&s&&k({op:"UPDATE_ITEM",itemId:o.id,payload:o}),y}}),Object.defineProperty(o.content,"__isGridTabsProxy",{value:!0,enumerable:!1}),Object.defineProperty(o.content,"__v_skip",{value:!0,enumerable:!1})),o.subItems&&Array.isArray(o.subItems)&&!o.subItems.__isGridTabsProxy&&(o.subItems=P(o.subItems,o.id),Object.defineProperty(o.subItems,"__isGridTabsProxy",{value:!0,enumerable:!1}),Object.defineProperty(o.subItems,"__v_skip",{value:!0,enumerable:!1}));const t=new Proxy(o,{set(n,f,b,h){const y=Reflect.set(n,f,b,h);return n.id&&s&&!g&&k({op:"UPDATE_ITEM",itemId:n.id,payload:n}),y}});return Object.defineProperty(t,"__isGridTabsProxy",{value:!0,enumerable:!1}),Object.defineProperty(t,"__v_skip",{value:!0,enumerable:!1}),t},P=(o,t)=>{for(let n=0;n<o.length;n++)o[n]=I(o[n]);return new Proxy(o,{get(n,f,b){return f==="push"?(...h)=>{h.forEach(($,M)=>q($,`push(${M})`)),s||console.error("[useGridTabs] ❌ 时机错误: 在底层还未完成初始化时调用了 push()。请先对 items.value 或 tabs.value 进行全量赋值!");const y=h.map($=>I($)),N=Array.prototype.push.apply(n,y);return g||k({op:"APPEND_SUB_ITEMS",itemId:t,payload:{subItems:y}}),N}:f==="unshift"?(...h)=>{h.forEach(($,M)=>q($,`unshift(${M})`)),s||console.error("[useGridTabs] ❌ 时机错误: 在底层还未完成初始化时调用了 unshift()。请先对 items.value 或 tabs.value 进行全量赋值!");const y=h.map($=>I($)),N=Array.prototype.unshift.apply(n,y);return s&&y.length>0&&!g&&k({op:"PREPEND_SUB_ITEMS",itemId:t,payload:{subItems:y}}),N}:f==="splice"?(...h)=>{const y=h.length>=2&&h[0]===0&&h[1]===n.length,N=Array.prototype.splice.apply(n,h);return s&&y&&t!==i?g||k({op:"CLEAR_SUB_ITEMS",itemId:t}):s&&(g||C("items array spliced")),N}:Reflect.get(n,f,b)},set(n,f,b,h){if(f!=="length"&&!isNaN(Number(f))){s||console.error(`[useGridTabs] ❌ 时机错误: 在底层还未完成初始化时直接修改了索引 [${String(f)}]。请先对 items.value 或 tabs.value 进行全量赋值!`),q(b,`索引赋值 [${String(f)}]`);const y=I(b),N=Reflect.set(n,f,y,h);return y&&y.id&&!g&&k({op:"UPDATE_ITEM",itemId:y.id,payload:y}),N}return Reflect.set(n,f,b,h)}})},E=o=>(o.items&&Array.isArray(o.items)&&!o.items.__isGridTabsProxy&&(o.items=P(o.items,o.tabId),Object.defineProperty(o.items,"__isGridTabsProxy",{value:!0,enumerable:!1})),new Proxy(o,{set(t,n,f,b){if(n==="items"){let y=f;return Array.isArray(f)&&!f.__isGridTabsProxy&&(y=P(f,t.tabId),Object.defineProperty(y,"__isGridTabsProxy",{value:!0,enumerable:!1})),Reflect.set(t,n,y,b)}else if(n==="loadState"){const y=Reflect.set(t,n,f,b);return s&&t.tabId&&!g&&k({op:"UPDATE_TAB_STATE",itemId:t.tabId,payload:{loadState:f}}),y}return Reflect.set(t,n,f,b)}})),w=o=>{const t=o.map(n=>E(n));return new Proxy(t,{set(n,f,b,h){if(f!=="length"&&!isNaN(Number(f))){let y=b;b.__isGridTabsProxy||(y=E(b),Object.defineProperty(y,"__isGridTabsProxy",{value:!0,enumerable:!1}));const N=Reflect.set(n,f,y,h);return C(),N}return Reflect.set(n,f,b,h)}})};a.watch(v,(o,t)=>{if(console.log("[useGridTabs] watch(tabs) triggered:",{newTabs:o,isInitialized:s}),!o||o.length===0){d.value="",u="",s=!1;return}if(o.__isGridTabsProxy)console.log("[useGridTabs] newTabs is ALREADY a proxy, triggering root update"),C();else{console.log("[useGridTabs] newTabs is NOT a proxy, performing full deduceModeAndInitialize & wrapping");const n=w(o);Object.defineProperty(n,"__isGridTabsProxy",{value:!0,enumerable:!1}),D(n,"2d"),v.value=n}},{flush:"sync",deep:!1}),a.watch(m,(o,t)=>{if(console.log("[useGridTabs] watch(items) triggered:",{newItems:o,isInitialized:s}),!o||o.length===0){d.value="",u="",s=!1;return}if(o.__isGridTabsProxy)console.log("[useGridTabs] newItems is ALREADY a proxy, triggering root update"),C();else{console.log("[useGridTabs] newItems is NOT a proxy, performing full deduceModeAndInitialize & wrapping");const n=P(o,i);Object.defineProperty(n,"__isGridTabsProxy",{value:!0,enumerable:!1}),D(n,"1d"),m.value=n}},{flush:"sync",deep:!1});const S={},A=()=>{console.log("[useGridTabs] resetInitialization called manually"),s=!1,R.clear();for(const o in S)delete S[o]},Q=o=>{if(!o||o.length===0){d.value="",s=!1;return}o[0].hasOwnProperty("tabId")||o[0].hasOwnProperty("items")&&Array.isArray(o[0].items)?v.value=o:m.value=o},x=o=>{p.value=o},z=a.computed(()=>({tabsData:d.value,onTabNeedsData:async(...o)=>{let t=o[0];if(t&&t.nativeEvent&&(t=t.nativeEvent),!p.value.onTabNeedsData)return;const{tabId:n,index:f,reason:b}=t;if(R.has(n)){console.log(`[useGridTabs] onTabNeedsData SKIP: tabId=${n} 已经发起过请求,防止死循环`);return}R.add(n);try{const h=await p.value.onTabNeedsData(n,f,b);if(h&&Array.isArray(h))if(S[n]=1,h.length>0){const y=v.value.find(N=>N.tabId===n);y&&(y.items?y.items.length>0&&y.items.splice(0,y.items.length):y.items=[],y.items.push(...h),y.loadState="ready",k({op:"UPDATE_TAB_STATE",itemId:n,payload:{loadState:"ready"}}))}else console.warn(`[useGridTabs] ⚠️ 警告: onTabNeedsData(tabId="${n}") 返回了空数组 []!`),console.warn("👉 如果你已经在此函数内手动调用了 push() 来追加数据,请在最后 return null 或 undefined。"),console.warn("👉 如果该 Tab 确实没有数据,返回 [] 可能会导致底层的 Header 等已有元素被清空,请注意检查。"),console.warn("👉 框架已为您拦截此次空数组覆盖,保留了当前的 DOM 结构。")}catch(h){console.error("[useGridTabs] onTabNeedsData 执行失败:",h),R.delete(n)}},onLoadMore:async(...o)=>{let t=o[0];if(t&&t.nativeEvent&&(t=t.nativeEvent),!p.value.onLoadMore)return;const{tabId:n,itemId:f}=t,h=(S[n]||1)+1;console.log(`[useGridTabs] 拦截到底层 onLoadMore,强行接管页码: tabId=${n}, pageNo=${h}`);try{const y=await p.value.onLoadMore(n,h,f);if(y&&Array.isArray(y))if(y.length>0)if(S[n]=h,r)m.value.push(...y);else{const N=v.value.find($=>$.tabId===n);N&&N.items&&N.items.push(...y)}else console.warn(`[useGridTabs] ⚠️ 警告: onLoadMore(tabId="${n}", pageNo="${h}") 返回了空数组 []!`),console.warn('👉 如果这是你的最后一页数据,推荐在卡片列表中追加一个 type="no_more" 的 footer 卡片,而不是仅仅返回空。'),console.warn("👉 框架已忽略本次空数据追加,且不会自增页码。")}catch(y){console.error("[useGridTabs] onLoadMore 业务层请求失败:",y)}},onItemPresence:(...o)=>{let t=o[0];if(console.log("[useGridTabs] ⚡️ bindings caught onItemPresence:",t),p.value.onItemPresence)try{let n=typeof t=="string"?t:(t==null?void 0:t.nativeEvent)||t;n&&typeof n.data=="string"&&(n=n.data);const f=typeof n=="string"?JSON.parse(n):n;f&&f.type==="VIEW_PRESENCE_BATCH"&&Array.isArray(f.payload)?f.payload.forEach(b=>{b.itemId&&typeof b.itemId=="string"&&b.itemId.startsWith("fallback_pos_")&&console.warn(`[useGridTabs] ⚠️ 警告:检测到列表项曝光 (index=${b.index}),但未配置 itemId。请检查传入的 items 数组,务必为每个数据项指定唯一的 itemId,否则底层无法准确进行去重与曝光上报。`),p.value.onItemPresence(b)}):p.value.onItemPresence(f)}catch(n){console.error("[useGridTabs] Failed to parse onItemPresence event payload:",n),p.value.onItemPresence(t)}},onTabSelected:(...o)=>{let t=o[0];t&&t.nativeEvent&&(t=t.nativeEvent),p.value.onTabSelected&&p.value.onTabSelected(t)},onTabClick:(...o)=>{let t=o[0];t&&t.nativeEvent&&(t=t.nativeEvent),p.value.onTabClick&&p.value.onTabClick(t)},onItemClick:(...o)=>{let t=o[0];if(console.log("[useGridTabs] RAW onItemClick intercepted from Native:",t),t&&t.nativeEvent&&(t=t.nativeEvent),p.value.onItemClick)try{let n=typeof t=="string"?t:(t==null?void 0:t.data)||t;const f=typeof n=="string"?JSON.parse(n):n;p.value.onItemClick(f)}catch(n){console.error("[useGridTabs] Failed to parse onItemClick event payload:",n),p.value.onItemClick(t)}else console.warn("[useGridTabs] onItemClick triggered but NO callback registered in callbacksRef!")},onItemLongClick:(...o)=>{let t=o[0];if(console.log("[useGridTabs] RAW onItemLongClick intercepted from Native:",t),typeof t=="number"&&o.length>=3&&typeof o[1]=="string"&&(t=o[2]),t&&t.nativeEvent&&(t=t.nativeEvent),p.value.onItemLongClick)try{let n=typeof t=="string"?t:(t==null?void 0:t.data)||t;const f=typeof n=="string"?JSON.parse(n):n;p.value.onItemLongClick(f)}catch(n){console.error("[useGridTabs] Failed to parse onItemLongClick event payload:",n),p.value.onItemLongClick(t)}},onItemFocused:(...o)=>{let t=o[0];if(t&&t.nativeEvent&&(t=t.nativeEvent),p.value.onItemFocused)try{let n=typeof t=="string"?t:(t==null?void 0:t.data)||t;const f=typeof n=="string"?JSON.parse(n):n;p.value.onItemFocused(f)}catch(n){console.error("[useGridTabs] Failed to parse onItemFocused event payload:",n),p.value.onItemFocused(t)}},onTabFocused:(...o)=>{let t=o[0];t&&t.nativeEvent&&(t=t.nativeEvent),p.value.onTabFocused&&p.value.onTabFocused(t)},onScroll:(...o)=>{let t=o[0];if(t&&t.nativeEvent&&(t=t.nativeEvent),p.value.onScroll)try{const n=(t==null?void 0:t.data)||t;p.value.onScroll(n)}catch{p.value.onScroll(t)}},onScrollStateChanged:(...o)=>{let t=o[0];if(t&&t.nativeEvent&&(t=t.nativeEvent),p.value.onScrollStateChanged)try{const n=(t==null?void 0:t.data)||t;p.value.onScrollStateChanged(n)}catch{p.value.onScrollStateChanged(t)}}}));return{tabsDataStr:d,bindings:z,tabs:v,items:m,initData:Q,setCallbacks:x,updateItem:(o,t)=>{if(!s){console.error("[useGridTabs] ❌ 时机错误: 尚未初始化数据,无法调用 updateItem");return}k({op:"UPDATE_ITEM",itemId:o,payload:t}),g=!0;try{if(r){const n=m.value.find(f=>f.id===o);n&&Object.assign(n,t)}else for(const n of v.value)if(n.items){const f=n.items.find(b=>b.id===o);if(f){Object.assign(f,t);break}}}finally{g=!1}},deleteItem:(o,t=!0)=>{if(s){k({op:"DELETE_ITEM",itemId:o,payload:{animated:t}}),g=!0;try{if(r){const n=m.value.findIndex(f=>f.id===o);n!==-1&&m.value.splice(n,1)}else for(const n of v.value)if(n.items){const f=n.items.findIndex(b=>b.id===o);if(f!==-1){n.items.splice(f,1);break}}}finally{g=!1}}},prependItems:(o,t)=>{if(s){k({op:"PREPEND_SUB_ITEMS",itemId:o,payload:{subItems:t}}),g=!0;try{if(r)m.value.unshift(...t);else{const n=v.value.find(f=>f.tabId===o);n&&n.items&&n.items.unshift(...t)}}finally{g=!1}}},clearItems:o=>{if(s){k({op:"CLEAR_SUB_ITEMS",itemId:o}),g=!0;try{if(r)m.value.splice(0,m.value.length);else{const t=v.value.find(n=>n.tabId===o);t&&t.items&&t.items.splice(0,t.items.length)}}finally{g=!1}}},moveItem:(o,t,n)=>{if(s){k({op:"MOVE_ITEM",itemId:o,payload:{targetPosition:t,anchorItemId:n}}),g=!0;try{const f=b=>{const h=b.findIndex(N=>N.id===o),y=b.findIndex(N=>N.id===n);if(h!==-1&&y!==-1){const N=b.splice(h,1)[0],$=b.findIndex(et=>et.id===n),M=t==="after"?$+1:$;b.splice(M,0,N)}};if(r)f(m.value);else for(const b of v.value)b.items&&f(b.items)}finally{g=!1}}},replaceItem:(o,t)=>{if(s){k({op:"REPLACE_ITEM",itemId:o,payload:t}),g=!0;try{if(r){const n=m.value.findIndex(f=>f.id===o);n!==-1&&(m.value[n]=t)}else for(const n of v.value)if(n.items){const f=n.items.findIndex(b=>b.id===o);if(f!==-1){n.items[f]=t;break}}}finally{g=!1}}},dispatchAction:k,resetInitialization:A,getFocusState:async()=>new Promise((o,t)=>{let n=e.value;typeof e.value.getNativeNode=="function"?n=e.value.getNativeNode()||e.value:e.value.nativeRef&&(n=e.value.nativeRef),console.log("[useGridTabs] getFocusState called, nativeTarget:",n);const f=b=>{if(console.log("[useGridTabs] getFocusState callback received:",b),b&&b.isSuccess!==void 0&&b.result!==void 0){o(b.result);return}try{const h=typeof b=="string"?JSON.parse(b):b;o(h)}catch(h){t(h)}};typeof T.Native.callUIFunction=="function"?(console.log('[useGridTabs] Executing Native.callUIFunction("getFocusState") with callback as 4th arg'),T.Native.callUIFunction(n,"getFocusState",[],f)):(console.error("[useGridTabs] Native.callUIFunction is not available"),t(new Error("Native.callUIFunction is not available")))}),getItemRect:async o=>new Promise((t,n)=>{let f=e.value;typeof e.value.getNativeNode=="function"?f=e.value.getNativeNode()||e.value:e.value.nativeRef&&(f=e.value.nativeRef),console.log(`[useGridTabs] getItemRect called for itemId=${o}, nativeTarget:`,f);const b=h=>{if(console.log(`[useGridTabs] getItemRect callback received for itemId=${o}:`,h),h&&h.isSuccess!==void 0&&h.result!==void 0){t(h.result);return}try{const y=typeof h=="string"?JSON.parse(h):h;t(y)}catch(y){n(y)}};typeof T.Native.callUIFunction=="function"?(console.log('[useGridTabs] Executing Native.callUIFunction("getItemRect") with itemId and callback as 4th arg'),T.Native.callUIFunction(f,"getItemRect",[o],b)):(console.error("[useGridTabs] Native.callUIFunction is not available"),n(new Error("Native.callUIFunction is not available")))}),requestFocus:o=>{let t=e.value;typeof e.value.getNativeNode=="function"?t=e.value.getNativeNode()||e.value:e.value.nativeRef&&(t=e.value.nativeRef),T.Native.callUIFunction(t,"requestFocus",[o])},updatePageSpec:o=>{if(!s)return;const t=Object.assign({},JSON.parse(d.value).page_spec,o);o.layout&&(t.navConfig=Object.assign({},t.navConfig,o.layout)),o.navConfig&&(t.navConfig=Object.assign({},t.navConfig,o.navConfig)),o.contentConfig&&(t.contentConfig=Object.assign({},t.contentConfig,o.contentConfig)),c&&Object.assign(c,t),k({op:"RELOAD_TABS",payload:{pageSpec:t,page_spec:t,tabs:v.value}});const n=JSON.parse(d.value);n.page_spec=t,d.value=JSON.stringify(n),u=d.value},reloadAll:(o,t)=>{c&&(Object.keys(c).forEach(n=>delete c[n]),Object.assign(c,o)),v.value=t,k({op:"RELOAD_TABS",payload:{pageSpec:o,page_spec:o,tabs:t}})},scrollToTop:()=>{let o=e.value;typeof e.value.getNativeNode=="function"?o=e.value.getNativeNode()||e.value:e.value.nativeRef&&(o=e.value.nativeRef),T.Native.callUIFunction(o,"scrollToTop",[])}}}const ye="QtKeyboard",W=a.defineComponent({__name:"Keyboard",props:{backgroundColor:{},backgroundGradient:{},textColor:{},weakTextColor:{},focusBackgroundColor:{},focusTextColor:{},placeholder:{},textFullKeyboard:{},textT9Keyboard:{},keyboardType:{},textClear:{},textDelete:{},currentInput:{},autofocus:{type:Boolean},rememberKeyboardType:{type:Boolean}},emits:["onInputChanged","onKeyPressed"],setup(e,{expose:l}){const d=a.ref(),c=O(),v=ye+"_Plugin",r=(c.isPluginActive?v:ye).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase().replace(/^-/,""),s=G(r,c.pluginPackageName||"com.quicktvui.plugin.extraui","com.quicktvui.plugin.extraui.ExtraUIPluginApp");return l({getNativeNode:()=>{var i,u;return((u=(i=d.value)==null?void 0:i.getNativeNode)==null?void 0:u.call(i))||d.value},requestFocus:(...i)=>{var g,p;const u=((p=(g=d.value)==null?void 0:g.getNativeNode)==null?void 0:p.call(g))||d.value;u&&T.Native.callUIFunction(u,"requestFocus",i)}}),(i,u)=>(a.openBlock(),a.createBlock(a.unref(s),a.mergeProps({ref_key:"nativeRef",ref:d,backgroundColor:e.backgroundColor,backgroundGradient:e.backgroundGradient,textColor:e.textColor,weakTextColor:e.weakTextColor,focusBackgroundColor:e.focusBackgroundColor,focusTextColor:e.focusTextColor,placeholder:e.placeholder,textFullKeyboard:e.textFullKeyboard,textT9Keyboard:e.textT9Keyboard,keyboardType:e.keyboardType,textClear:e.textClear,textDelete:e.textDelete,currentInput:e.currentInput,autofocus:e.autofocus,rememberKeyboardType:e.rememberKeyboardType,onOnInputChanged:u[0]||(u[0]=g=>i.$emit("onInputChanged",g.nativeEvent)),onOnKeyPressed:u[1]||(u[1]=g=>i.$emit("onKeyPressed",g.nativeEvent))},i.$attrs),{default:a.withCtx(()=>[a.renderSlot(i.$slots,"default")]),_:3},16,["backgroundColor","backgroundGradient","textColor","weakTextColor","focusBackgroundColor","focusTextColor","placeholder","textFullKeyboard","textT9Keyboard","keyboardType","textClear","textDelete","currentInput","autofocus","rememberKeyboardType"]))}});let j;var Ee;try{const e=require("@extscreen/es3-vue");j=e.registerElement||((Ee=e.default)==null?void 0:Ee.registerElement)}catch{}const Re={install:e=>{if(!globalThis.__QtKeyboard_registered)if(j){const l=(d,c)=>{j(d,{component:{name:c?"QtKeyboard_Plugin":"QtKeyboard",processEventData(v,m){const r=v.handler||v,s=m||(r==null?void 0:r.nativeParams)||{};return r&&(r.nativeEvent=s),r}}})};l("qt-keyboard",!1),l("qt-keyboard-plugin",!0),l("QtKeyboard",!1),l("QtKeyboard_Plugin",!0),globalThis.__QtKeyboard_registered=!0,console.log("[@quicktvui/naddons] Successfully registered Native tag:","QtKeyboard")}else console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");e.component("Keyboard",W),e.component("qt-keyboard",W)}},he="QtPortalPool",K=a.defineComponent({__name:"PortalPool",setup(e,{expose:l}){const d=a.ref(),c=O(),v=he+"_Plugin",r=(c.isPluginActive?v:he).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase().replace(/^-/,""),s=G(r,c.pluginPackageName||"com.quicktvui.plugin.glintui");return l({getNativeNode:()=>{var i,u;return((u=(i=d.value)==null?void 0:i.getNativeNode)==null?void 0:u.call(i))||d.value}}),(i,u)=>(a.openBlock(),a.createBlock(a.unref(s),a.mergeProps({ref_key:"nativeRef",ref:d,style:{position:"absolute"},absolute:!0},i.$attrs),{default:a.withCtx(()=>[a.renderSlot(i.$slots,"default")]),_:3},16))}});let H;var xe;try{const e=require("@extscreen/es3-vue");H=e.registerElement||((xe=e.default)==null?void 0:xe.registerElement)}catch{}const ze={install:e=>{if(!globalThis.__QtPortalPool_registered)if(H){const l=(d,c)=>{H(d,{component:{name:c?"QtPortalPool_Plugin":"QtPortalPool",processEventData(v,m){const r=v.handler||v,s=m||(r==null?void 0:r.nativeParams)||{};return r&&(r.nativeEvent=s),r}}})};l("qt-portal-pool",!1),l("qt-portal-pool-plugin",!0),l("QtPortalPool",!1),l("QtPortalPool_Plugin",!0),globalThis.__QtPortalPool_registered=!0,console.log("[@quicktvui/naddons] Successfully registered Native tag:","QtPortalPool")}else console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");e.component("PortalPool",K),e.component("qt-portal-pool",K)}},pe="QtPortalItem",Z=a.defineComponent({__name:"PortalItem",props:{portalId:{}},setup(e,{expose:l}){const d=a.ref(),c=O(),v=pe+"_Plugin",r=(c.isPluginActive?v:pe).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase().replace(/^-/,""),s=G(r,c.pluginPackageName||"com.quicktvui.plugin.glintui");return l({getNativeNode:()=>{var i,u;return((u=(i=d.value)==null?void 0:i.getNativeNode)==null?void 0:u.call(i))||d.value}}),(i,u)=>(a.openBlock(),a.createBlock(a.unref(s),a.mergeProps({ref_key:"nativeRef",ref:d,style:{position:"absolute"},absolute:!0,portalId:e.portalId},i.$attrs),{default:a.withCtx(()=>[a.renderSlot(i.$slots,"default")]),_:3},16,["portalId"]))}});let J;var we;try{const e=require("@extscreen/es3-vue");J=e.registerElement||((we=e.default)==null?void 0:we.registerElement)}catch{}const Fe={install:e=>{if(!globalThis.__QtPortalItem_registered)if(J){const l=(d,c)=>{J(d,{component:{name:c?"QtPortalItem_Plugin":"QtPortalItem",processEventData(v,m){const r=v.handler||v,s=m||(r==null?void 0:r.nativeParams)||{};return r&&(r.nativeEvent=s),r}}})};l("qt-portal-item",!1),l("qt-portal-item-plugin",!0),l("QtPortalItem",!1),l("QtPortalItem_Plugin",!0),globalThis.__QtPortalItem_registered=!0,console.log("[@quicktvui/naddons] Successfully registered Native tag:","QtPortalItem")}else console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");e.component("PortalItem",Z),e.component("qt-portal-item",Z)}},Ce="QtHsvBackground",X=a.defineComponent({__name:"HsvBackground",props:{hue:{},hueDuration:{}},setup(e,{expose:l}){const d=a.ref(),c=O(),v=Ce+"_Plugin",r=(c.isPluginActive?v:Ce).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase().replace(/^-/,""),s=G(r,c.pluginPackageName||"com.quicktvui.plugin.glintui");return l({getNativeNode:()=>{var i,u;return((u=(i=d.value)==null?void 0:i.getNativeNode)==null?void 0:u.call(i))||d.value}}),(i,u)=>(a.openBlock(),a.createBlock(a.unref(s),a.mergeProps({ref_key:"nativeRef",ref:d,hue:e.hue,hueDuration:e.hueDuration},i.$attrs),{default:a.withCtx(()=>[a.renderSlot(i.$slots,"default")]),_:3},16,["hue","hueDuration"]))}});let Y;var Ae;try{const e=require("@extscreen/es3-vue");Y=e.registerElement||((Ae=e.default)==null?void 0:Ae.registerElement)}catch{}const Me={install:e=>{if(!globalThis.__QtHsvBackground_registered)if(Y){const l=(d,c)=>{Y(d,{component:{name:c?"QtHsvBackground_Plugin":"QtHsvBackground",processEventData(v,m){const r=v.handler||v,s=m||(r==null?void 0:r.nativeParams)||{};return r&&(r.nativeEvent=s),r}}})};l("qt-hsv-background",!1),l("qt-hsv-background-plugin",!0),l("QtHsvBackground",!1),l("QtHsvBackground_Plugin",!0),globalThis.__QtHsvBackground_registered=!0,console.log("[@quicktvui/naddons] Successfully registered Native tag:","QtHsvBackground")}else console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");e.component("HsvBackground",X),e.component("qt-hsv-background",X)}},ke="QtSvgImage",ee=a.defineComponent({__name:"SvgImage",props:{src:{},tintColor:{}},setup(e,{expose:l}){const d=a.ref(),c=O(),v=ke+"_Plugin",r=(c.isPluginActive?v:ke).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase().replace(/^-/,""),s=G(r,c.pluginPackageName||"com.quicktvui.plugin.extraui","com.quicktvui.plugin.extraui.ExtraUIPluginApp");return l({getNativeNode:()=>{var i,u;return((u=(i=d.value)==null?void 0:i.getNativeNode)==null?void 0:u.call(i))||d.value}}),(i,u)=>(a.openBlock(),a.createBlock(a.unref(s),a.mergeProps({ref_key:"nativeRef",ref:d,src:e.src,tintColor:e.tintColor},i.$attrs),{default:a.withCtx(()=>[a.renderSlot(i.$slots,"default")]),_:3},16,["src","tintColor"]))}});let te;var Be;try{const e=require("@extscreen/es3-vue");te=e.registerElement||((Be=e.default)==null?void 0:Be.registerElement)}catch{}const De={install:e=>{if(!globalThis.__QtSvgImage_registered)if(te){const l=(d,c)=>{te(d,{component:{name:c?"QtSvgImage_Plugin":"QtSvgImage",processEventData(v,m){const r=v.handler||v,s=m||(r==null?void 0:r.nativeParams)||{};return r&&(r.nativeEvent=s),r}}})};l("qt-svg-image",!1),l("qt-svg-image-plugin",!0),l("QtSvgImage",!1),l("QtSvgImage_Plugin",!0),globalThis.__QtSvgImage_registered=!0,console.log("[@quicktvui/naddons] Successfully registered Native tag:","QtSvgImage")}else console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");e.component("SvgImage",ee),e.component("qt-svg-image",ee)}},Ne="QtNaButton",ot=a.defineComponent({__name:"NaButtonBase",props:{text:{},icon:{},iconSize:{},iconSpace:{},layoutDirection:{},fontSize:{},maxLines:{},textColor:{},focusTextColor:{},backgroundColor:{},focusBackgroundColor:{},normalBorderWidth:{},normalBorderColor:{},focusBorderColor:{},cornerRadius:{},focusScale:{},enableFocusBorder:{type:Boolean}},emits:["onButtonCustomEvent"],setup(e,{expose:l}){const d=a.ref(),c=O(),v=Ne+"_Plugin",r=(c.isPluginActive?v:Ne).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase().replace(/^-/,""),s=G(r,c.pluginPackageName||"com.quicktvui.plugin.extraui","com.quicktvui.plugin.extraui.ExtraUIPluginApp");return l({getNativeNode:()=>{var i,u;return((u=(i=d.value)==null?void 0:i.getNativeNode)==null?void 0:u.call(i))||d.value}}),(i,u)=>(a.openBlock(),a.createBlock(a.unref(s),a.mergeProps({ref_key:"nativeRef",ref:d,text:e.text,icon:e.icon,iconSize:e.iconSize,iconSpace:e.iconSpace,layoutDirection:e.layoutDirection,fontSize:e.fontSize,maxLines:e.maxLines,textColor:e.textColor,focusTextColor:e.focusTextColor,backgroundColor:e.backgroundColor,focusBackgroundColor:e.focusBackgroundColor,normalBorderWidth:e.normalBorderWidth,normalBorderColor:e.normalBorderColor,focusBorderColor:e.focusBorderColor,cornerRadius:e.cornerRadius,focusScale:e.focusScale,enableFocusBorder:e.enableFocusBorder,onOnButtonCustomEvent:u[0]||(u[0]=g=>i.$emit("onButtonCustomEvent",g.nativeEvent))},i.$attrs),{default:a.withCtx(()=>[a.renderSlot(i.$slots,"default")]),_:3},16,["text","icon","iconSize","iconSpace","layoutDirection","fontSize","maxLines","textColor","focusTextColor","backgroundColor","focusBackgroundColor","normalBorderWidth","normalBorderColor","focusBorderColor","cornerRadius","focusScale","enableFocusBorder"]))}}),oe=a.defineComponent({__name:"NaButton",props:{width:{},height:{}},setup(e){const l=e,d=a.computed(()=>({width:typeof l.width=="number"?`${l.width}px`:l.width,height:typeof l.height=="number"?`${l.height}px`:l.height}));return(c,v)=>(a.openBlock(),a.createBlock(ot,a.mergeProps(c.$attrs,{style:d.value}),{default:a.withCtx(()=>[a.renderSlot(c.$slots,"default")]),_:3},16,["style"]))}});let ne;var $e;try{const e=require("@extscreen/es3-vue");ne=e.registerElement||(($e=e.default)==null?void 0:$e.registerElement)}catch{}const _e={install:e=>{if(!globalThis.__QtNaButton_registered)if(ne){const l=(d,c)=>{ne(d,{component:{name:c?"QtNaButton_Plugin":"QtNaButton",processEventData(v,m){const r=v.handler||v,s=m||(r==null?void 0:r.nativeParams)||{};return r&&(r.nativeEvent=s),r}}})};l("qt-na-button",!1),l("qt-na-button-plugin",!0),l("QtNaButton",!1),l("QtNaButton_Plugin",!0),globalThis.__QtNaButton_registered=!0,console.log("[@quicktvui/naddons] Successfully registered Native tag:","QtNaButton")}else console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");e.component("NaButton",oe),e.component("qt-na-button",oe)}},Ie="QtNaCheckbox",ae=a.defineComponent({__name:"NaCheckbox",props:{text:{},checked:{type:Boolean},disabled:{type:Boolean},checkedIcon:{},uncheckedIcon:{},iconSize:{},iconSpace:{},layoutDirection:{},gravity:{},paddingX:{},showBackground:{type:Boolean},fontSize:{},textColor:{},focusTextColor:{},checkedTextColor:{},focusCheckedTextColor:{},disabledTextColor:{},iconColor:{},focusIconColor:{},checkedIconColor:{},focusCheckedIconColor:{},disabledIconColor:{},iconInnerColor:{},focusIconInnerColor:{},checkedIconInnerColor:{},focusCheckedIconInnerColor:{},disabledIconInnerColor:{},focusMode:{},bgColor:{},focusBgColor:{},checkedBgColor:{},focusCheckedBgColor:{},disabledBgColor:{},borderColor:{},focusBorderColor:{},checkedBorderColor:{},focusCheckedBorderColor:{},disabledBorderColor:{},cornerRadius:{},focusScale:{},type:{}},emits:["onCheckedChange"],setup(e,{expose:l}){const d=a.ref(),c=O(),v=Ie+"_Plugin",r=(c.isPluginActive?v:Ie).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase().replace(/^-/,""),s=G(r,c.pluginPackageName||"");return l({getNativeNode:()=>{var i,u;return((u=(i=d.value)==null?void 0:i.getNativeNode)==null?void 0:u.call(i))||d.value}}),(i,u)=>(a.openBlock(),a.createBlock(a.unref(s),a.mergeProps({ref_key:"nativeRef",ref:d,text:e.text,checked:e.checked,disabled:e.disabled,checkedIcon:e.checkedIcon,uncheckedIcon:e.uncheckedIcon,iconSize:e.iconSize,iconSpace:e.iconSpace,layoutDirection:e.layoutDirection,gravity:e.gravity,paddingX:e.paddingX,showBackground:e.showBackground,fontSize:e.fontSize,textColor:e.textColor,focusTextColor:e.focusTextColor,checkedTextColor:e.checkedTextColor,focusCheckedTextColor:e.focusCheckedTextColor,disabledTextColor:e.disabledTextColor,iconColor:e.iconColor,focusIconColor:e.focusIconColor,checkedIconColor:e.checkedIconColor,focusCheckedIconColor:e.focusCheckedIconColor,disabledIconColor:e.disabledIconColor,iconInnerColor:e.iconInnerColor,focusIconInnerColor:e.focusIconInnerColor,checkedIconInnerColor:e.checkedIconInnerColor,focusCheckedIconInnerColor:e.focusCheckedIconInnerColor,disabledIconInnerColor:e.disabledIconInnerColor,focusMode:e.focusMode,bgColor:e.bgColor,focusBgColor:e.focusBgColor,checkedBgColor:e.checkedBgColor,focusCheckedBgColor:e.focusCheckedBgColor,disabledBgColor:e.disabledBgColor,borderColor:e.borderColor,focusBorderColor:e.focusBorderColor,checkedBorderColor:e.checkedBorderColor,focusCheckedBorderColor:e.focusCheckedBorderColor,disabledBorderColor:e.disabledBorderColor,cornerRadius:e.cornerRadius,focusScale:e.focusScale,type:e.type,onOnCheckedChange:u[0]||(u[0]=g=>i.$emit("onCheckedChange",g.nativeEvent))},i.$attrs),{default:a.withCtx(()=>[a.renderSlot(i.$slots,"default")]),_:3},16,["text","checked","disabled","checkedIcon","uncheckedIcon","iconSize","iconSpace","layoutDirection","gravity","paddingX","showBackground","fontSize","textColor","focusTextColor","checkedTextColor","focusCheckedTextColor","disabledTextColor","iconColor","focusIconColor","checkedIconColor","focusCheckedIconColor","disabledIconColor","iconInnerColor","focusIconInnerColor","checkedIconInnerColor","focusCheckedIconInnerColor","disabledIconInnerColor","focusMode","bgColor","focusBgColor","checkedBgColor","focusCheckedBgColor","disabledBgColor","borderColor","focusBorderColor","checkedBorderColor","focusCheckedBorderColor","disabledBorderColor","cornerRadius","focusScale","type"]))}});let ie;var Ge;try{const e=require("@extscreen/es3-vue");ie=e.registerElement||((Ge=e.default)==null?void 0:Ge.registerElement)}catch{}const Le={install:e=>{if(!globalThis.__QtNaCheckbox_registered)if(ie){const l=(d,c)=>{ie(d,{component:{name:c?"QtNaCheckbox_Plugin":"QtNaCheckbox",processEventData(v,m){const r=v.handler||v,s=m||(r==null?void 0:r.nativeParams)||{};return r&&(r.nativeEvent=s),r}}})};l("qt-na-checkbox",!1),l("qt-na-checkbox-plugin",!0),l("QtNaCheckbox",!1),l("QtNaCheckbox_Plugin",!0),globalThis.__QtNaCheckbox_registered=!0,console.log("[@quicktvui/naddons] Successfully registered Native tag:","QtNaCheckbox")}else console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");e.component("NaCheckbox",ae),e.component("qt-na-checkbox",ae)}},nt=a.defineComponent({name:"NaRadioGroup",props:{modelValue:{type:[String,Number,Boolean],default:""},options:{type:Array,default:()=>[]},direction:{type:String,default:"row"},itemWidth:{type:Number,default:void 0},itemHeight:{type:Number,default:void 0},itemGap:{type:Number,default:20},gravity:{type:String,default:"center"},showBackground:{type:Boolean,default:!0}},emits:["update:modelValue","change"],setup(e,{emit:l}){return{groupStyle:a.computed(()=>({display:"flex",flexDirection:e.direction,alignItems:"center"})),getItemStyle:(m,r)=>{var i;const s={...((i=m.props)==null?void 0:i.style)||{}};return e.itemWidth!==void 0&&(s.width=e.itemWidth),e.itemHeight!==void 0&&(s.height=e.itemHeight),r!==e.options.length-1&&(e.direction==="row"?s.marginRight=e.itemGap:s.marginBottom=e.itemGap),s},onItemClick:m=>{m.disabled||(l("update:modelValue",m.value),l("change",m.value))}}}});const ve=(e,l)=>{const d=e.__vccOpts||e;for(const[c,v]of l)d[c]=v;return d};function at(e,l,d,c,v,m){const r=a.resolveComponent("qt-na-checkbox");return a.openBlock(),a.createElementBlock("div",{class:"na-radio-group",style:a.normalizeStyle(e.groupStyle)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.options,(s,i)=>(a.openBlock(),a.createBlock(r,a.mergeProps({key:i,type:"radio",checked:e.modelValue===s.value,text:s.label,gravity:e.gravity,showBackground:e.showBackground,disabled:s.disabled},{ref_for:!0},s.props,{style:e.getItemStyle(s,i),onClick:u=>e.onItemClick(s)}),null,16,["checked","text","gravity","showBackground","disabled","style","onClick"]))),128))],4)}const le=ve(nt,[["render",at],["__scopeId","data-v-448252ff"]]),Ve={install:e=>{e.component("NaRadioGroup",le),e.component("qt-na-radio-group",le)}},it=a.defineComponent({name:"NaCheckboxGroup",props:{modelValue:{type:Array,default:()=>[]},options:{type:Array,default:()=>[]},direction:{type:String,default:"row"},itemWidth:{type:Number,default:void 0},itemHeight:{type:Number,default:void 0},itemGap:{type:Number,default:20},gravity:{type:String,default:"center"},showBackground:{type:Boolean,default:!0}},emits:["update:modelValue","change"],setup(e,{emit:l}){return{groupStyle:a.computed(()=>({display:"flex",flexDirection:e.direction,alignItems:"center"})),getItemStyle:(m,r)=>{var i;const s={...((i=m.props)==null?void 0:i.style)||{}};return e.itemWidth!==void 0&&(s.width=e.itemWidth),e.itemHeight!==void 0&&(s.height=e.itemHeight),r!==e.options.length-1&&(e.direction==="row"?s.marginRight=e.itemGap:s.marginBottom=e.itemGap),s},onItemClick:m=>{if(m.disabled)return;const r=[...e.modelValue],s=r.indexOf(m.value);s>-1?r.splice(s,1):r.push(m.value),l("update:modelValue",r),l("change",r)}}}});function lt(e,l,d,c,v,m){const r=a.resolveComponent("qt-na-checkbox");return a.openBlock(),a.createElementBlock("div",{class:"na-checkbox-group",style:a.normalizeStyle(e.groupStyle)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.options,(s,i)=>(a.openBlock(),a.createBlock(r,a.mergeProps({key:i,type:"checkbox",checked:e.modelValue.includes(s.value),text:s.label,gravity:e.gravity,showBackground:e.showBackground,disabled:s.disabled},{ref_for:!0},s.props,{style:e.getItemStyle(s,i),onClick:u=>e.onItemClick(s)}),null,16,["checked","text","gravity","showBackground","disabled","style","onClick"]))),128))],4)}const re=ve(it,[["render",lt],["__scopeId","data-v-cf6a4eaa"]]),Ue={install:e=>{e.component("NaCheckboxGroup",re),e.component("qt-na-checkbox-group",re)}},Te="QtNaSwitcher",se=a.defineComponent({__name:"NaSwitcher",props:{checked:{type:Boolean},disabled:{type:Boolean},title:{},textOn:{},textOff:{},subtitle:{},subtitleColor:{},titleColor:{},focusTitleColor:{},titleTextSize:{},subtitleTextSize:{},stateTextSize:{}},emits:["onCheckedChange"],setup(e,{expose:l}){const d=a.ref(),c=O(),v=Te+"_Plugin",r=(c.isPluginActive?v:Te).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase().replace(/^-/,""),s=G(r,c.pluginPackageName||"");return l({getNativeNode:()=>{var i,u;return((u=(i=d.value)==null?void 0:i.getNativeNode)==null?void 0:u.call(i))||d.value}}),(i,u)=>(a.openBlock(),a.createBlock(a.unref(s),a.mergeProps({ref_key:"nativeRef",ref:d,checked:e.checked,disabled:e.disabled,title:e.title,textOn:e.textOn,textOff:e.textOff,subtitle:e.subtitle,subtitleColor:e.subtitleColor,titleColor:e.titleColor,focusTitleColor:e.focusTitleColor,titleTextSize:e.titleTextSize,subtitleTextSize:e.subtitleTextSize,stateTextSize:e.stateTextSize,onOnCheckedChange:u[0]||(u[0]=g=>i.$emit("onCheckedChange",g.nativeEvent))},i.$attrs),{default:a.withCtx(()=>[a.renderSlot(i.$slots,"default")]),_:3},16,["checked","disabled","title","textOn","textOff","subtitle","subtitleColor","titleColor","focusTitleColor","titleTextSize","subtitleTextSize","stateTextSize"]))}});let ce;var Oe;try{const e=require("@extscreen/es3-vue");ce=e.registerElement||((Oe=e.default)==null?void 0:Oe.registerElement)}catch{}const We={install:e=>{if(!globalThis.__QtNaSwitcher_registered)if(ce){const l=(d,c)=>{ce(d,{component:{name:c?"QtNaSwitcher_Plugin":"QtNaSwitcher",processEventData(v,m){const r=v.handler||v,s=m||(r==null?void 0:r.nativeParams)||{};return r&&(r.nativeEvent=s),r}}})};l("qt-na-switcher",!1),l("qt-na-switcher-plugin",!0),l("QtNaSwitcher",!1),l("QtNaSwitcher_Plugin",!0),globalThis.__QtNaSwitcher_registered=!0,console.log("[@quicktvui/naddons] Successfully registered Native tag:","QtNaSwitcher")}else console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");e.component("NaSwitcher",se),e.component("qt-na-switcher",se)}},rt=a.defineComponent({name:"NaSettingSwitch",props:{title:{type:String,default:""},subtitle:{type:String,default:""},modelValue:{type:Boolean,default:!1},textOn:{type:String,default:"打开"},textOff:{type:String,default:"关闭"},titleTextSize:{type:Number,default:28},subtitleTextSize:{type:Number,default:22},stateTextSize:{type:Number,default:24},disabled:{type:Boolean,default:!1},width:{type:[Number,String],default:800},height:{type:[Number,String],default:100}},emits:["update:modelValue","change"],setup(e,{emit:l,attrs:d}){const c=a.ref(e.modelValue);a.watch(()=>e.modelValue,s=>{c.value=s});const v=s=>{const i=s.checked;c.value=i,l("update:modelValue",i),l("change",i)},m=a.computed(()=>typeof e.width=="number"?`${e.width}px`:e.width),r=a.computed(()=>{const s=d.style||{},i=e.subtitle?(typeof e.height=="number"?e.height:parseInt(e.height))+30:e.height;return{width:m.value,height:typeof i=="number"?`${i}px`:i,...s}});return{checked:c,handleCheckedChange:v,mergedStyle:r}}});function st(e,l,d,c,v,m){const r=a.resolveComponent("qt-na-switcher");return a.openBlock(),a.createBlock(r,{class:"na-setting-switch",style:a.normalizeStyle(e.mergedStyle),title:e.title,subtitle:e.subtitle,checked:e.checked,textOn:e.textOn,textOff:e.textOff,titleTextSize:e.titleTextSize,subtitleTextSize:e.subtitleTextSize,stateTextSize:e.stateTextSize,disabled:e.disabled,onOnCheckedChange:e.handleCheckedChange},null,8,["style","title","subtitle","checked","textOn","textOff","titleTextSize","subtitleTextSize","stateTextSize","disabled","onOnCheckedChange"])}const ue=ve(rt,[["render",st]]),je={install(e){e.component("NaSettingSwitch",ue),e.component("qt-na-setting-switch",ue)}},Se="QtNaInputView",ct=a.defineComponent({__name:"NaInputViewBase",props:{text:{},placeholder:{},type:{},status:{},disabled:{type:Boolean},inputSize:{},cursorVisible:{type:Boolean},useSystemKeyboard:{type:Boolean},trailingIcon:{}},emits:["onInputClick","onChange"],setup(e,{expose:l}){const d=a.ref(),c=O(),v=Se+"_Plugin",r=(c.isPluginActive?v:Se).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase().replace(/^-/,""),s=G(r,c.pluginPackageName||"com.quicktvui.plugin.extraui","com.quicktvui.plugin.extraui.ExtraUIPluginApp");return l({getNativeNode:()=>{var i,u;return((u=(i=d.value)==null?void 0:i.getNativeNode)==null?void 0:u.call(i))||d.value}}),(i,u)=>(a.openBlock(),a.createBlock(a.unref(s),a.mergeProps({ref_key:"nativeRef",ref:d,text:e.text,placeholder:e.placeholder,type:e.type,status:e.status,disabled:e.disabled,inputSize:e.inputSize,cursorVisible:e.cursorVisible,useSystemKeyboard:e.useSystemKeyboard,trailingIcon:e.trailingIcon,onOnInputClick:u[0]||(u[0]=g=>i.$emit("onInputClick",g.nativeEvent)),onOnChange:u[1]||(u[1]=g=>i.$emit("onChange",g.nativeEvent))},i.$attrs),{default:a.withCtx(()=>[a.renderSlot(i.$slots,"default")]),_:3},16,["text","placeholder","type","status","disabled","inputSize","cursorVisible","useSystemKeyboard","trailingIcon"]))}}),de=a.defineComponent({__name:"NaInputView",props:{inputSize:{default:"medium"}},emits:["onInputClick","onChange"],setup(e,{emit:l}){const d=l,c=e,v=a.computed(()=>{let s=60;return c.inputSize==="large"?s=70:c.inputSize==="small"&&(s=50),{height:`${s}px`}}),m=s=>{d("onInputClick",s)},r=s=>{d("onChange",s)};return(s,i)=>(a.openBlock(),a.createBlock(ct,a.mergeProps(s.$attrs,{style:v.value,inputSize:e.inputSize,onOnInputClick:m,onOnChange:r}),{default:a.withCtx(()=>[a.renderSlot(s.$slots,"default")]),_:3},16,["style","inputSize"]))}});let ge;var qe;try{const e=require("@extscreen/es3-vue");ge=e.registerElement||((qe=e.default)==null?void 0:qe.registerElement)}catch{}const Ke={install:e=>{if(!globalThis.__QtNaInputView_registered)if(ge){const l=(d,c)=>{ge(d,{component:{name:c?"QtNaInputView_Plugin":"QtNaInputView",processEventData(v,m){const r=v.handler||v,s=m||(r==null?void 0:r.nativeParams)||{};return r&&(r.nativeEvent=s),r}}})};l("qt-na-input-view",!1),l("qt-na-input-view-plugin",!0),l("QtNaInputView",!1),l("QtNaInputView_Plugin",!0),globalThis.__QtNaInputView_registered=!0,console.log("[@quicktvui/naddons] Successfully registered Native tag:","QtNaInputView")}else console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");e.component("NaInputView",de),e.component("qt-na-input-view",de)}},He={skipPluginCheck:!1},L=new Set;function G(e,l,d){return a.defineComponent({name:`${e}AsyncWrapper`,inheritAttrs:!1,props:{skipPluginCheck:{type:Boolean,default:!1}},setup(c,{slots:v,attrs:m,expose:r}){const s=a.ref("loading"),i=a.ref(""),u=a.ref(),g=globalThis.__VUE_INSTANCE__;r({getNativeNode:()=>{let C=u.value;return!C&&g&&g.vnode&&g.vnode.el&&(C=g.vnode.el,C.childNodes&&C.childNodes.length>0&&(C=C.childNodes[0])),C},nativeRef:u});let q=null,B=null;try{q=V.useES(),B=V.useESPlugin()}catch(C){console.warn("[withAsyncPlugin] 获取 useES 或 useESPlugin 失败,可能处于非 ES 环境。",C)}const D=async()=>{if(!q||typeof q.isComponentRegistered!="function")return console.log("[withAsyncPlugin] es.isComponentRegistered 不可用"),!1;try{const C=await q.isComponentRegistered(e);if(console.log(`[withAsyncPlugin] isComponentRegistered('${e}') 返回:`,C),C===!0||C&&typeof C=="object"&&(C.registered===!0||C.isRegistered===!0))return!0;try{const I=await T.Native.callNativeWithPromise("ExtendModule","getCoreSDKInfo");if(I&&I.core_version){const P=I.core_version;console.log(`[withAsyncPlugin] 当前引擎核心版本: ${P}`);const E=P.split(".").map(w=>parseInt(w,10));if(E.length>=3&&!isNaN(E[0])&&!isNaN(E[1])&&!isNaN(E[2]))if(E[0]*1e6+E[1]*1e3+E[2]>=1011205){console.log(`[withAsyncPlugin] 引擎 >= 1.11.205,使用 ExtendModule 检查 Controller: ${e}`);const S=e.split("-").map(x=>x.charAt(0).toUpperCase()+x.slice(1)).join("");console.log(`[withAsyncPlugin] 同时检查原名和驼峰名: ${e}, ${S}`);const[A,Q]=await Promise.all([T.Native.callNativeWithPromise("ExtendModule","isComponentRegistered",e).catch(()=>!1),T.Native.callNativeWithPromise("ExtendModule","isComponentRegistered",S).catch(()=>!1)]);if(console.log(`[withAsyncPlugin] ExtendModule.isComponentRegistered 返回: [${A}, ${Q}]`),A===!0||Q===!0)return!0}else console.log(`[withAsyncPlugin] 引擎版本 ${P} < 1.11.205,跳过 ExtendModule 检查`);else console.log(`[withAsyncPlugin] 无法解析引擎版本号: ${P}`)}}catch(I){console.log("[withAsyncPlugin] 获取引擎版本或检查 Controller 失败:",I)}return!1}catch(C){return console.warn("[withAsyncPlugin] 检查组件注册状态异常:",C),!1}},R=async()=>{if(He.skipPluginCheck||c.skipPluginCheck){console.log(`[withAsyncPlugin] 跳过 ${e} 插件检查 (skipPluginCheck = true)`),s.value="ready";return}if(!l){s.value="ready";return}const C=await D();if(console.log(`[withAsyncPlugin] 拦截检查 - ${e} 是否已注册:`,C),C||L.has(l)){s.value="ready",L.add(l),console.log("[withAsyncPlugin] 组件已注册,跳过安装流程");return}if(!B){console.warn(`[withAsyncPlugin] 无法获取 useESPlugin 实例,可能处于内置 AAR 环境或非插件环境,尝试直接渲染 ${e}`),s.value="ready";return}console.log(`[withAsyncPlugin] 开始动态安装插件: ${l}`);try{await new Promise((I,P)=>{let E;const w={onPluginInstallSuccess(S,A,Q){S===l&&(clearTimeout(E),B.removeListener(w),console.log(`[withAsyncPlugin] 安装成功 pkg=${S} 状态码=${A}`),A==1003||A==1001?(d?(console.log(`[withAsyncPlugin] 触发反射初始化: ${d}`),T.Native.callNative("EsNativeModule","callReflect",{entry:{from:d,method:"setup"}})):console.log("[withAsyncPlugin] 安装成功,跳过反射初始化(无 pluginInitClass)"),I()):P(new Error(`安装失败 pkg=${S} status=${A} msg=${Q}`)))},onPluginInstallError(S,A,Q){S===l&&(clearTimeout(E),B.removeListener(w),P(new Error(`安装失败 pkg=${S} status=${A} msg=${Q}`)))}};B.addListener({pkg:l},w),E=setTimeout(()=>{B.removeListener(w),P(new Error(`插件安装超时: ${l}`))},8e3),typeof B.installPlugin=="function"?B.installPlugin({pkg:l}):typeof B.install=="function"?B.install(l):P(new Error("当前运行时不支持 install / installPlugin"))}),await a.nextTick(),L.add(l),s.value="ready"}catch(I){console.error("[withAsyncPlugin] 插件加载失败:",I),i.value=(I==null?void 0:I.message)||String(I),s.value="error"}};return a.onMounted(()=>{R()}),()=>{const C={display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",...m.style||{}};m.width!==void 0&&!C.width&&(C.width=typeof m.width=="number"?`${m.width}px`:m.width),m.height!==void 0&&!C.height&&(C.height=typeof m.height=="number"?`${m.height}px`:m.height);const I=m.class?`qt-plugin-container ${m.class}`:"qt-plugin-container",P={class:I,style:C,clipChildren:!1,clipPadding:!1,clipToPadding:!1};if(s.value==="loading")return a.h("div",P,[a.h("div",{style:{color:"white",fontSize:"30px"}},"插件加载中...")]);if(s.value==="error")return a.h("div",P,[a.h("div",{style:{color:"white",fontSize:"30px",backgroundColor:"rgba(255,0,0,0.5)"}},`插件加载失败: ${i.value}`)]);const E={},w={};for(const[x,z]of Object.entries(m))if(x.startsWith("on")&&typeof z=="function"){let F=x;x.startsWith("onOn")&&(F="on"+x.slice(4)),w[F]=z}else if(x.startsWith("on")&&Array.isArray(z)){let F=x;x.startsWith("onOn")&&(F="on"+x.slice(4)),w[F]=z}else x.startsWith("onOn")||(E[x]=z);const S={...E,...w,class:I,style:C,ref:x=>{u.value=x}},A=S.tabsData||"",Q=S.actionPayload||"";return console.log("[withAsyncPlugin] 最终准备传递给 h() 的属性键集合:",Object.keys(S),"tabsData.length=",A.length,"actionPayload.length=",Q.length),a.h(e,S,v.default?v.default():[])}}})}const me=Symbol("AddonEnvContext"),Ze={isPluginActive:!1,nameSuffix:"",pluginPackageName:"com.quicktvui.plugin.glintui",builtInVersions:{}};async function ut(e="com.quicktvui.plugin.glintui",l="_Plugin"){const d=V.useES();let c={};try{const i=await T.Native.callNativeModule("AddonEnvModule","getBuiltInVersions",[]);i&&typeof i=="object"&&(c=i)}catch(i){console.warn("[AddonProvider] Failed to fetch built-in versions from AddonEnvModule",i)}const v=`QtGridTabs${l}`,m=d.isComponentRegistered(v),r=m instanceof Promise?await m:m,s={isPluginActive:r,nameSuffix:r?l:"",pluginPackageName:r?`${e}.ext`:e,builtInVersions:c};return console.info("[AddonProvider] Environment initialized:",s),s}let fe=a.ref(Ze);function dt(e){fe.value=e,a.provide(me,fe)}function O(){var e;return((e=a.inject(me,fe))==null?void 0:e.value)||Ze}async function Je(e){console.log("[AddonProvider] Sending GridTabs global config to Native:",e);try{const l=await T.Native.callNativeWithPromise("GridTabsConfigModule","setDefaultConfig",JSON.stringify(e));return console.log("[AddonProvider] Received response from Native:",l),!!(l&&l.success)}catch(l){return console.error("[AddonProvider] Failed to initialize GridTabs global config:",l),!1}}async function Xe(e){console.log("[AddonProvider] Sending ExtraUI global theme config to Native:",e);try{const l=await T.Native.callNativeWithPromise("ExtraUIConfigModule","setThemeConfig",JSON.stringify(e));return console.log("[AddonProvider] Received ExtraUI theme response from Native:",l),!!(l&&l.success)}catch(l){return console.error("[AddonProvider] Failed to initialize ExtraUI global theme config:",l),!1}}async function gt(e){console.log("[AddonProvider] Initializing global theme across all modules:",e);const l=await Xe(e),d=await Je({themeConfig:{placeholderColor:e.placeholderColor,glowColor:e.glowColor||e.focusBackgroundColor,outerBorderColor:e.outerBorderColor||e.focusBorderColor,innerBorderColor:e.innerBorderColor,enableElevationShadow:e.enableElevationShadow,cornerRadius:e.cornerRadius,buttonCornerRadius:e.buttonCornerRadius,primaryTextColor:e.primaryTextColor,secondaryTextColor:e.secondaryTextColor,focusTextColor:e.focusTextColor,selectedTextColor:e.selectedTextColor,selectedBackgroundColor:e.selectedBackgroundColor,focusBackgroundColor:e.focusBackgroundColor,buttonNormalBackgroundColor:e.buttonNormalBackgroundColor}});return l&&d}const Ye={install:e=>{e.use(Qe),e.use(Re),e.use(ze),e.use(Fe),e.use(Me),e.use(De),e.use(_e),e.use(Le),e.use(Ve),e.use(Ue),e.use(We),e.use(je),e.use(Ke)}};exports.ADDON_ENV_CONTEXT_KEY=me;exports.GridTabs=_;exports.GridTabsPlugin=Qe;exports.HsvBackground=X;exports.HsvBackgroundPlugin=Me;exports.Keyboard=W;exports.KeyboardPlugin=Re;exports.NaButton=oe;exports.NaButtonPlugin=_e;exports.NaCheckbox=ae;exports.NaCheckboxGroup=re;exports.NaCheckboxGroupPlugin=Ue;exports.NaCheckboxPlugin=Le;exports.NaInputView=de;exports.NaInputViewPlugin=Ke;exports.NaRadioGroup=le;exports.NaRadioGroupPlugin=Ve;exports.NaSettingSwitch=ue;exports.NaSettingSwitchPlugin=je;exports.NaSwitcher=se;exports.NaSwitcherPlugin=We;exports.PortalItem=Z;exports.PortalItemPlugin=Fe;exports.PortalPool=K;exports.PortalPoolPlugin=ze;exports.QuickTVUINAddons=Ye;exports.QuickTVUINAddonsConfig=He;exports.SvgImage=ee;exports.SvgImagePlugin=De;exports.default=Ye;exports.initAddonEnv=ut;exports.initExtraUIGlobalTheme=Xe;exports.initGlobalTheme=gt;exports.initGridTabsGlobalConfig=Je;exports.provideAddonEnv=dt;exports.useAddonEnv=O;exports.useGridTabs=tt;exports.withAsyncPlugin=G;