@quicktvui/qtx 0.9.0-alpha.5 → 0.9.0-alpha.7
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.
- package/README.md +1 -1
- package/dist/components/QtxChannelNav/types.d.ts +5 -1
- package/dist/components/QtxList/QtxList.vue.d.ts +3 -0
- package/dist/components/QtxList/types.d.ts +8 -0
- package/dist/core/back-chain.d.ts +28 -0
- package/dist/qtx.cjs.js +1 -1
- package/dist/qtx.es.js +94 -9
- package/package.json +1 -1
- package/plugin/qtx-clip-inject.cjs +10 -1
- package/plugin/vite.mjs +2 -1
- package/plugin/webpack.cjs +2 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ QuickTVUI 官方扩展库:Vue 3 侧的 `qtx-*` 原生高性能组件封装,
|
|
|
6
6
|
|
|
7
7
|
> 用 qtx 开发 TV 应用所需的组件、页面与设计规范
|
|
8
8
|
|
|
9
|
-
> 当前版本 **`0.9.0-alpha.
|
|
9
|
+
> 当前版本 **`0.9.0-alpha.7`**(0.9 预发布阶段):用于第三方在真实 TV 场景试用并反馈。**本阶段允许破坏性变更,不承诺向下兼容**;先用一个真实项目完整验证后再发 `1.0.0`。
|
|
10
10
|
|
|
11
11
|
> **给 AI / 接入方**:先读同包内 `AI_CONTRACT.md`(《给 AI 的接入契约》)。它给出宿主依赖、真实脚手架命令、完整 `main.ts` + `App.vue` + 双页路由示例与装机链路;仅凭包内两份 md 可完成 qtx 接入与最小双页应用,平台原生 `qt-*` 组件 / 播放器 / 高级路由能力仍需读平台资料(见下)。qtx 是 **QuickTVUI 平台之上的扩展库**:渲染器、焦点、按键、路由、生命周期与播放器由平台提供,平台前置资料(项目根 `AGENTS.md` 与 `node_modules/@quicktvui/ai/rules/.docs/`)由平台模板项目提供,**不随本 npm 包分发**。
|
|
12
12
|
|
|
@@ -114,8 +114,12 @@ export interface QtxChannelNavProps {
|
|
|
114
114
|
initialActiveKey?: string;
|
|
115
115
|
/** 初始焦点位置(频道 key);优先于 defaultFocusKey,留空时回退到 defaultFocusKey / active */
|
|
116
116
|
initialFocusKey?: string;
|
|
117
|
+
/** 焦点是否属于频道栏;传 false 时清除焦点态(白色胶囊消失、选中项保持纯白文字)并忽略方向键与受控 focusedKey,避免内容区左右键误切 Tab。默认 true */
|
|
118
|
+
focusWithin?: boolean;
|
|
117
119
|
/** 关闭「返回先归位」:默认开启归位,写该属性则按返回直接交给页面处理 */
|
|
118
120
|
disableBackToInitial?: boolean;
|
|
121
|
+
/** 关闭三段式返回的第①段(列表滚离顶部时先回顶);默认开启。关闭后按返回直接进入频道归位 */
|
|
122
|
+
disableBackToTop?: boolean;
|
|
119
123
|
/** 复用池容量上限(1~128),默认 16;长列表调大可减少创建次数 */
|
|
120
124
|
maxPoolSize?: number;
|
|
121
125
|
}
|
|
@@ -229,7 +233,7 @@ export interface QtxChannelNavExpose {
|
|
|
229
233
|
getActiveKey(): Promise<string>;
|
|
230
234
|
/** 读取初始选中位置(频道 key) */
|
|
231
235
|
getInitialActiveKey(): Promise<string>;
|
|
232
|
-
/**
|
|
236
|
+
/** 三段式返回(同步,供 onBackPressed 使用):列表回顶 → 频道归位 → 交还页面;返回本次是否消费 */
|
|
233
237
|
handleBack(): boolean;
|
|
234
238
|
/** 读取当前获焦频道 key */
|
|
235
239
|
getFocusedKey(): Promise<string>;
|
|
@@ -6,6 +6,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
|
|
|
6
6
|
gutter: number;
|
|
7
7
|
itemHeight: number;
|
|
8
8
|
loadingTail: boolean;
|
|
9
|
+
state: string;
|
|
9
10
|
}>>, {
|
|
10
11
|
getNativeNode: () => any;
|
|
11
12
|
updateItem(index: number, patch: Partial<QtxListItem>): Promise<void>;
|
|
@@ -51,6 +52,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
|
|
|
51
52
|
gutter: number;
|
|
52
53
|
itemHeight: number;
|
|
53
54
|
loadingTail: boolean;
|
|
55
|
+
state: string;
|
|
54
56
|
}>>> & Readonly<{
|
|
55
57
|
"onItem-click"?: ((...args: any[]) => any) | undefined;
|
|
56
58
|
"onItem-focus"?: ((...args: any[]) => any) | undefined;
|
|
@@ -62,6 +64,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
|
|
|
62
64
|
"onPortal-viewport-enter"?: ((...args: any[]) => any) | undefined;
|
|
63
65
|
"onPortal-viewport-leave"?: ((...args: any[]) => any) | undefined;
|
|
64
66
|
}>, {
|
|
67
|
+
state: string;
|
|
65
68
|
keyField: string;
|
|
66
69
|
columns: number;
|
|
67
70
|
direction: "horizontal" | "vertical";
|
|
@@ -25,6 +25,14 @@ export interface QtxListProps {
|
|
|
25
25
|
pageEnabled?: boolean;
|
|
26
26
|
/** B2-1:loading 尾卡开关(C 方案)。开启时 load-more 触发自动显示尾卡、数据到达自动隐藏;默认关闭 */
|
|
27
27
|
loadingTail?: boolean;
|
|
28
|
+
/** 内容状态:ready 用 items;loading / empty / error 由组件内部生成状态行。同一列表换 items,不切换节点类型,业务无需在 qtx-tab-content 里写 v-if。默认 ready */
|
|
29
|
+
state?: 'ready' | 'loading' | 'empty' | 'error' | string;
|
|
30
|
+
/** state=empty 时显示文本,默认「暂无内容」 */
|
|
31
|
+
emptyText?: string;
|
|
32
|
+
/** state=loading 时显示文本,默认「加载中…」 */
|
|
33
|
+
loadingText?: string;
|
|
34
|
+
/** state=error 时显示文本,默认「加载失败,点击重试」 */
|
|
35
|
+
errorText?: string;
|
|
28
36
|
/** 初始焦点行索引(默认 0) */
|
|
29
37
|
initialFocusIndex?: number;
|
|
30
38
|
/**
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 三段式返回的 JS 侧状态镜像(qtx-channel-nav / qtx-tabs / qtx-list 共用)。
|
|
3
|
+
*
|
|
4
|
+
* 页面 `onBackPressed()` 必须同步返回,不能 await native 的 Promise,因此:
|
|
5
|
+
* - native 只在「列表跨过滚动阈值」时把布尔状态镜像过来(见 QtxListView.attachBackScrollTracker);
|
|
6
|
+
* - 判定与消费全在 JS 侧同步完成,回顶动作本身异步 fire-and-forget。
|
|
7
|
+
*
|
|
8
|
+
* 活跃列表用「最近一次上报已滚离顶部的实例」表示:用户正在滚动的列表必然是
|
|
9
|
+
* 当前可见 Tab 的列表;切 Tab 由 QtxTabs 调 resetBackChain() 清空,避免旧 Tab
|
|
10
|
+
* 的滚动状态串到新 Tab。qtx-list 不需要知道自己属于哪个 linkId / tabKey,
|
|
11
|
+
* 因此这里不要求 provide/inject,也不改页面接线。
|
|
12
|
+
*/
|
|
13
|
+
export interface BackChainEntry {
|
|
14
|
+
scrolled: boolean;
|
|
15
|
+
scrollToTop: () => void;
|
|
16
|
+
}
|
|
17
|
+
/** 每个 qtx-list 实例在 setup 期注册一次,卸载时反注册 */
|
|
18
|
+
export declare function registerBackChainList(scrollToTop: () => void): BackChainEntry;
|
|
19
|
+
export declare function unregisterBackChainList(entry: BackChainEntry): void;
|
|
20
|
+
/** native 上报的滚动状态翻转 */
|
|
21
|
+
export declare function setBackChainScrolled(entry: BackChainEntry, scrolled: boolean): void;
|
|
22
|
+
/** 切 Tab 时清空:新 Tab 的列表状态由它自己首次上报接管 */
|
|
23
|
+
export declare function resetBackChain(): void;
|
|
24
|
+
/**
|
|
25
|
+
* 返回链第 ① 段:列表滚离顶部则回顶并消费本次返回。
|
|
26
|
+
* 由 qtx-channel-nav 的 handleBack() 调用,页面接线保持不变。
|
|
27
|
+
*/
|
|
28
|
+
export declare function consumeBackToTop(): boolean;
|
package/dist/qtx.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.create;var e,t,o,n,a,i,l,r,s,c,u,d,p,v,f,g,m,h,y,x,b,C=Object.defineProperty,I=(Object.getOwnPropertyDescriptor,Object.getOwnPropertyNames,Object.getPrototypeOf,Object.prototype.hasOwnProperty,(e,t,o)=>(((e,t,o)=>{t in e?C(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o})(e,"symbol"!=typeof t?t+"":t,o),o));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const k=require("vue"),S=require("@extscreen/es3-vue"),N=require("@extscreen/es3-core"),_=k.defineComponent({inheritAttrs:!1,__name:"QtxGridTabs",setup(e,{expose:t}){const o=k.ref(),n=To("qtx-grid-tabs");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(e,t)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o},e.$attrs),{default:k.withCtx(()=>[k.renderSlot(e.$slots,"default")]),_:3},16))}});let T;try{const t=require("@extscreen/es3-vue");T=t.registerElement||(null==(e=t.default)?void 0:e.registerElement)}catch(Mo){}const w={install:e=>{if(!globalThis.__QtxGridTabs_registered)if(T){const e=e=>{T(e,{component:{name:"QtxGridTabs",eventNamesMap:new Map([]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-grid-tabs"),e("QtxGridTabs"),globalThis.__QtxGridTabs_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxGridTabs",_),e.component("qtx-grid-tabs",_)}};const P="\0qtx:",B=/\u0000qtx:([^\u0001]*)\u0001/g,E=new Set(["div","qt-view","qt-text","span","qt-image"]),F=new Set(["width","height","marginTop","marginBottom","marginLeft","marginRight","paddingTop","paddingBottom","paddingLeft","paddingRight","fontSize","borderRadius","backgroundColor","color","textColor","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","borderWidth","borderColor","flexDirection","alignItems","justifyContent","textAlign","fontWeight","resizeMode","numberOfLines","ellipsizeMode","positionType","left","top","right","bottom","focusBackgroundColor","focusColor"]),q=new Set(["toUpperCase","toLowerCase","trim"]);function $(e,t,o){return new Proxy(function(){},{ownKeys:()=>["0","1","length"],getOwnPropertyDescriptor:(n,a)=>"length"===a?{value:2,configurable:!0,enumerable:!1,writable:!0}:"0"===a||"1"===a?{value:$(e,t?t+".$each":"$each",o),configurable:!0,enumerable:!0,writable:!0}:void 0,get(n,a){if(a===Symbol.toPrimitive||"toString"===a||"valueOf"===a)return()=>P+t+"";if("toJSON"===a)return;if(a===Symbol.iterator){e.accessedPaths.add(t||"__root__");let n=0;const a=t?`${t}.$each`:"$each";return()=>({next:()=>n++<2?{value:$(e,a,o),done:!1}:{value:void 0,done:!0}})}if("string"!=typeof a)return;const i=t?`${t}.${a}`:a;return e.accessedPaths.add(i),o&&o.has(i)?o.get(i):$(e,i,o)},apply(n,a,i){e.functionCalls.add(t);const l=t.split(".").pop()||"";if(0===i.length&&q.has(l))return P+t+"";if(["map","filter","slice","concat"].includes(l)&&"function"==typeof i[0]){const n=t+".$each",a=i[0],l=$(e,n,o),r=$(e,n,o);return[a(l,0,null),a(r,1,null)]}if("forEach"===l&&"function"==typeof i[0]){const n=t+".$each";return i[0]($(e,n,o),0,null),void i[0]($(e,n,o),1,null)}return P+t+""}})}function O(e){return"string"==typeof e&&e.includes(P)}function A(e){if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return null;if("object"==typeof e||"function"==typeof e)try{const t=String(e);return t.includes(P)?t:null}catch(Mo){return null}return null}function L(e){const t=[];let o;for(B.lastIndex=0;null!==(o=B.exec(e));)t.push({index:o.index,text:o[0],path:o[1]});if(0===t.length)return null;if(1===t.length&&e===t[0].text)return Q(t[0].path);const n=[];let a=0;for(const l of t){const t=e.slice(a,l.index);t&&n.push({k:"lit",v:t});const o=Q(l.path);o&&n.push(o),a=l.index+l.text.length}const i=e.slice(a);return i&&n.push({k:"lit",v:i}),{k:"concat",s:n}}function Q(e){const t=e.split("."),o=t[t.length-1];return t.length>1&&q.has(o)?{k:"fmt",f:o,a:[{k:"path",p:t.slice(0,-1).join(".")}]}:{k:"path",p:e}}function R(e,t){let o;for(B.lastIndex=0;null!==(o=B.exec(e));){const e=o[1].split(".");if(!(e.length>1&&q.has(e[e.length-1]))&&t.functionCalls.has(o[1]))return!0}return!1}function M(e,t){return`__t1_${e}_${t}`}function U(e,t,o,n,a){e.binds[t]={k:"path",p:M(e.id,t)},e.tier=1,o.push({nodeId:e.id,prop:t}),n.push({level:"warn",nodeId:e.id,reason:"t1_degraded",detail:`属性 ${t} ${a},标记 T1:binds 指向影子字段 ${M(e.id,t)}`,fix:"数据下发/更新前由 JS 预投影正确值(§8.2);滚动期零 JS 参与;v2 编译期提取后走正源"})}function D(e,t){if("number"==typeof t){if(/color$/i.test(e)){return"#"+(t>>>0).toString(16).padStart(8,"0").slice(2)}return t}if("string"==typeof t){const e=/^(-?\d+(?:\.\d+)?)px$/.exec(t.trim());return e?parseFloat(e[1]):t}}function G(){const e=[];"undefined"!=typeof global&&e.push(global),"undefined"!=typeof globalThis&&e.push(globalThis);for(const t of e)try{const e=t.__QTX_STYLE_SNAPSHOT__;if(Array.isArray(e)&&e.length>0)return e}catch(Mo){}for(const t of e)try{const e=t.__HIPPY_VUE_STYLES__;if(Array.isArray(e)&&e.length>0)return e;if(e&&"object"==typeof e)return e}catch(Mo){}return[]}function z(e){const t=G(),o=String(e||"").split(/\s+/).filter(Boolean);if(!o.length||!t.length)return[];const n=[];for(const a of t){const e=a.selectors||[];for(const t of e){const e=/^\.([A-Za-z0-9_-]+)/.exec(String(t).trim());if(e&&o.includes(e[1]))for(const t of a.declarations||[])t&&"declaration"===t.type&&t.property&&n.push([t.property,t.value])}}return n}function V(e,t){return"symbol"==typeof e&&String(e.description)===t}const j="v-txt";let K=0;function W(e,t,o,n,a,i=[],l=!1){if(!e)return null;const r=e.type;if(V(r,"v-fgt")||V(r,"v-cmt")){let r=null;for(const s of X(e)){const e=W(s,t,o,n,a,i,l);e&&!r&&(r=e)}return r}let s=null;if("string"==typeof r)s=r;else{const e="object"==typeof r&&null!==r?String(r.name||r.__name||""):"";e&&E.has(e)&&(s=e)}if(!s)return a.push({level:"warn",nodeId:t||"root",reason:"custom_component",detail:`检测到非原生标签子树(${Z(r)}),M2 spike 不支持捕获`,fix:"spike 期请用 div/qt-text/qt-image 直接书写卡片;自定义组件支持随 M3 Portal 降级落地"}),null;if(!E.has(s))return a.push({level:"error",nodeId:t||"root",reason:"tag_out_of_vocabulary",detail:`标签 <${s}> 不在 §3.1 封闭集内`,fix:"使用 div / qt-view / qt-text / span / qt-image"}),null;const c="n"+K++,u={id:c,pid:t,tag:s,tier:0,layout:{},props:{},binds:{},events:[]},d=e.props||{},p=new Set;for(const f of Object.keys(d)){if("ref"===f||"key"===f)continue;const e=d[f];if("style"===f)J(u,e,p,a);else if("class"===f){const t=A(e);if(null!==t&&O(t)){const e=L(t);e&&(u.binds.class=e,a.push({level:"warn",nodeId:c,reason:"dynamic_class",detail:`动态 class 捕获为绑定 ${JSON.stringify(e)}`,fix:"原生按值选样式;样式表映射完善后此诊断消除"}))}const o=z(e);0===G().length?a.push({level:"warn",nodeId:c,reason:"stylesheet_invisible",detail:"平台样式表 __HIPPY_VUE_STYLES__ 不可达,class 样式无法捕获",fix:"运行环境检查(globalThis/global/self 均无样式表)"}):0===o.length?a.push({level:"warn",nodeId:c,reason:"class_unresolved",detail:`class "${e}" 在平台样式表中无匹配规则`,fix:"确认类名拼写,或样式写在 <style> 中(scoped 亦可)"}):H(u,o,p,a)}else{const t=A(e);if(O(t))if(R(t,o))U(u,f,i,a,"含方法调用");else{const e=L(t);e?(u.binds[f]=e,Y(e,p)):(u.tier=1,a.push({level:"warn",nodeId:c,reason:"unrecoverable_binding",detail:`属性 ${f} 的绑定无法恢复为描述符:${t}`,fix:'改写为路径/插值/无参格式化器形式(如 :text="item.title")'}))}else"function"==typeof e?"onClick"===f?u.events.push("click"):"onFocus"===f&&u.events.push("focus"):null!==e&&"object"!=typeof e&&"function"!=typeof e?"number"==typeof e&&Number.isNaN(e)&&!l?U(u,f,i,a,"哨兵算术 NaN"):u.props[f]=e:null!==e&&a.push({level:"warn",nodeId:c,reason:"static_object_prop",detail:`属性 ${f} 为对象/复杂值,spike 不支持静态冻结`,fix:"改为简单原始值属性或绑定表达式"})}}if(Array.isArray(e.dirs))for(const f of e.dirs){if(!f||void 0===f.value)continue;const e=A(f.value);if(null!==e&&O(e)){const t=L(e);t&&(u.binds.visibility=t,a.push({level:"warn",nodeId:c,reason:"vshow_captured",detail:`v-show 捕获为 visibility 绑定 ${JSON.stringify(t)}`,fix:"原生按 truthy 显示/GONE 隐藏;若实际是其他指令请改用显式绑定"}))}else!1===f.value&&(u.binds.visibility={k:"lit",v:!1})}const v=function(e){const t=e.children;if("string"==typeof t)return t;if(Array.isArray(t)){const e=[];for(const o of t)"string"==typeof o?e.push(o):o&&V(o.type,j)&&"string"==typeof o.children&&e.push(o.children);return e.length?e.join(""):null}return null}(e);if(null!==v)if(O(v))if(R(v,o))U(u,"text",i,a,"含方法调用");else{const e=L(v);e&&(u.binds.text=e,Y(e,p))}else u.props.text=v;n.push(u);for(const f of X(e))W(f,c,o,n,a,i,l);return c}function H(e,t,o,n){for(const[a,i]of t){const t="string"==typeof i?i:A(i);if(null!==t&&O(t)){const i=L(t);i?(e.binds[a]=i,Y(i,o)):n.push({level:"warn",nodeId:e.id,reason:"unrecoverable_style",detail:`样式 ${a} 绑定无法恢复:${t}`,fix:'动态样式改用简单路径绑定(如 :style="{ color: item.color }")'});continue}if("focus-scale"===a||"focusScale"===a){const t=D(a,i);void 0!==t&&(e.layout.focusScale=t);continue}if(a.startsWith("focus")){const t=D(a,i);if(void 0!==t){e.focusStyle||(e.focusStyle={}),e.focusStyle[a]=t;continue}}if(F.has(a)){const t=D(a,i);if(void 0!==t){e.layout[a]=t;continue}}n.push({level:"warn",nodeId:e.id,reason:"style_out_of_subset",detail:`样式 ${a}: ${String(i)} 不在 M2 布局子集内`,fix:"使用 width/height/margin*/padding*/fontSize/backgroundColor/flexDirection 等子集键"})}}function J(e,t,o,n){const a=[],i=Array.isArray(t)?t:[t];for(const l of i)if(l&&"object"==typeof l)for(const e of Object.keys(l))a.push([e,l[e]]);for(const[l,r]of a){const t="string"==typeof r?r:A(r);if(null!==t&&O(t)){const a=L(t);a?(e.binds[l]=a,Y(a,o)):n.push({level:"warn",nodeId:e.id,reason:"unrecoverable_style",detail:`样式 ${l} 绑定无法恢复:${t}`,fix:'动态样式改用简单路径绑定(如 :style="{ color: item.color }")'});continue}if(F.has(l)){const t=D(l,r);if(void 0!==t){e.layout[l]=t;continue}}n.push({level:"warn",nodeId:e.id,reason:"style_out_of_subset",detail:`样式 ${l}: ${String(r)} 不在 M2 布局子集内`,fix:"使用 width/height/margin*/padding*/fontSize/backgroundColor/flexDirection 等子集键"})}}function Y(e,t){if(!e||"object"!=typeof e)return;"path"===e.k&&"string"==typeof e.p&&t.add(e.p);const o=e=>{Array.isArray(e)?e.forEach(o):e&&"object"==typeof e&&Y(e,t)};o(e.a),o(e.s),o(e.l),o(e.r),o(e.c),o(e.t),o(e.e)}function X(e){const t=e.children;if(!t)return[];if(Array.isArray(t))return t;if("object"==typeof t&&t.default){const e="function"==typeof t.default?t.default():t.default;return Array.isArray(e)?e:[e]}return[]}function Z(e){return String("object"==typeof e&&null!==e?e.name||e.__name||"anonymous-component":e)}function ee(e){let t=5381;for(let o=0;o<e.length;o++)t=(t<<5)+t+e.charCodeAt(o)>>>0;return t.toString(16).padStart(8,"0").slice(-8)}function te(e){const t=e=>Object.keys(e).sort().map(t=>`${t}:${JSON.stringify(e[t])}`).join(",");return`{${e.tag}|${e.tier}|L:${t(e.layout)}|P:${t(e.props)}|B:${t(e.binds)}|E:${e.events.join(",")}}`}function oe(e,t,o=!1){const n={accessedPaths:new Set,functionCalls:new Set},a=[],i=[],l=[];K=0;try{const r=e({item:$(n,"",t),index:$(n,"$index")}),s=Array.isArray(r)?r:[r];let c=null;for(const e of s){const t=W(e,null,n,i,a,l,o);t&&!c&&(c=t)}if(!c||0===i.length)return null;const u=new Set;for(const e of i)re(e.binds,u);return{nodes:i,rootId:c,accessed:n.accessedPaths,bound:u,diagnostics:a,t1Props:l,functionCalls:n.functionCalls}}catch(Mo){return a.push({level:"error",nodeId:"root",reason:"capture_crashed",detail:String(Mo),fix:"检查 #item 插槽是否存在渲染期副作用"}),null}}function ne(e){return e.map(te).join(";")}function ae(e,t){return{viewType:"tpl:"+ee(e.nodes.map(te).join(";")),discriminators:[],rootId:e.rootId,nodes:e.nodes,discs:t}}function ie(e,t=[]){const o=[],n=new Map,a=oe(e);if(!a)return o.push({level:"error",nodeId:"root",reason:"empty_template",detail:"未捕获到任何模板节点",fix:"确认 #item 插槽渲染原生标签子树"}),{templates:[],diagnostics:o,unaccountedPaths:[],t1Evaluator:null};o.push(...a.diagnostics);for(const g of a.t1Props)n.set(g.nodeId+"."+g.prop,g);const i=[ae(a,[])],l=new Set([ne(a.nodes)]),r=[...a.accessed].filter(e=>!(e.includes(".")||a.bound.has(e)||le(e)||(e=>{for(const t of a.functionCalls)if(t===e||t.startsWith(e+"."))return!0;return!1})(e))),s=new Set(a.accessed),c=new Set(a.bound),u=new Set(a.functionCalls),d=new Set,p=e=>{for(const t of u)if(t===e||t.startsWith(e+"."))return!0;return!1};for(let g=0;g<3;g++){const a=[...s].filter(e=>!(e.includes(".")||c.has(e)||le(e)||p(e))).filter(e=>!d.has(e));if(0===a.length)break;let r=!1;for(const p of a){d.add(p);const a=new Set,v=new Set;for(const e of t){if(e&&"object"==typeof e&&p in e){const t=e[p];null!==t&&"object"!=typeof t&&v.add(t)}if(v.size>=6)break}const f=[[]];for(const e of i)e.discs&&e.discs.length>0&&!e.discs.some(e=>e.path===p)&&f.push(e.discs.map(e=>({...e})));for(const t of v)for(const d of f){if(i.length>=8)break;if(d.some(e=>e.path===p))continue;const v=new Map;for(const e of d)v.set(e.path,e.value);v.set(p,t);const f=oe(e,v);if(!f)continue;o.push(...f.diagnostics);for(const e of f.t1Props)n.set(e.nodeId+"."+e.prop,e);for(const e of f.accessed)s.add(e);for(const e of f.bound)c.add(e);for(const e of f.functionCalls)u.add(e);const g=ne(f.nodes);l.has(g)||(l.add(g),i.push(ae(f,[...d,{path:p,value:t}])),r=!0,a.add(t))}a.size>0&&a.size<v.size&&o.push({level:"warn",nodeId:"root",reason:"disc_value_gap",detail:`字段 ${p} 判别值覆盖 ${a.size}/${v.size},未覆盖值将落入默认模板`,fix:`若是范围条件(如 ${p} > n)请改写为等值判别或离散标记字段;或等待 v2 编译期提取`})}if(!r)break}de(a.nodes,o);for(const g of i)de(g.nodes,o);for(let g=0;g<i.length;g++){const e=i[g];for(let t=e.nodes.length-1;t>=0;t--)null!=e.nodes[t].repeat&&e.nodes.splice(t,1)}if(!i.some(e=>e.nodes.some(e=>e.repeat))&&t.length>0){const n=t.find(e=>e&&"object"==typeof e&&Object.values(e).some(e=>Array.isArray(e)&&e.length>=2&&e[0]&&"object"==typeof e[0]));n&&function(e,t,o,n){const a=oe(e,new Map(Object.entries(t)),!0);if(!a)return;for(let i=0;i+1<a.nodes.length;){const e=a.nodes[i],l=a.nodes[i+1];if(e.pid!==l.pid||e.tag!==l.tag||JSON.stringify(e.layout)!==JSON.stringify(l.layout)){i++;continue}const r=pe(t,e.props&&e.props.text);if(!r){i++;continue}const s=t[r],c=Object.keys(s[0]||{}).find(t=>String(s[0][t])===String(e.props&&e.props.text));if(!c){i++;continue}const u={...e,tag:"qt-text"===e.tag||"span"===e.tag?e.tag:"qt-text",binds:{text:{k:"path",p:`$each.${c}`}}};u.props={...e.props},delete u.props.text,u.repeat={list:{k:"path",p:r},key:null},u.id=`r${u.id}`;let d=o.nodes.length;for(let t=o.nodes.length-1;t>=0;t--)if(o.nodes[t].id===u.pid){d=t+1;break}o.nodes.splice(d,0,u),n.push({level:"warn",nodeId:e.id,reason:"vfor_real_collapsed",detail:`v-for 样本通道折叠:${r}[]${c}`,fix:"v2 编译期提取后走正源"}),i++}}(e,n,a,o)}{const e=new Set,t=[];for(const n of o){const o=n.reason+"|"+n.nodeId+"|"+n.detail;e.has(o)||(e.add(o),t.push(n))}o.length=0,o.push(...t)}const v=[...a.accessed].filter(e=>!(e=>{for(const t of a.bound)if(t===e||t.startsWith(e+".")||t.startsWith(e+".toFixed"))return!0;return!1})(e)&&r.indexOf(e)<0&&!p(e)),f=n.size>0?function(e,t){return o=>{if(!o||"object"!=typeof o)return null;let n=null;try{n=oe(e,new Map(Object.entries(o)),!0)}catch(Mo){return null}if(!n)return null;const a={};for(const{nodeId:e,prop:i}of t){const t=n.nodes.find(t=>t.id===e),o=t&&t.props?t.props[i]:void 0;void 0===o||"number"==typeof o&&Number.isNaN(o)?a[M(e,i)]=null:a[M(e,i)]=o}return a}}(e,[...n.values()]):null;return{templates:i,diagnostics:o,unaccountedPaths:v,t1Evaluator:f}}function le(e){return e.includes("(")}function re(e,t){for(const o of Object.values(e))Y(o,t)}function se(e,t,o,n){const a={},i={itemId:(null!=e[t]?String(e[t]):"")||"row_"+se.seq++,viewType:o,span:1,content:a};for(const[l,r]of Object.entries(e))l!==t&&("__span"!==l?"__aspectRatio"!==l?a[l]=r:"number"==typeof r&&r>0&&(i.aspectRatio=r):"number"==typeof r&&Number.isInteger(r)&&r>=1&&(i.span=r));return n&&Object.assign(a,n),i}function ce(e,t){const o=e.filter(e=>e.discs&&e.discs.length>0).sort((e,t)=>{var o,n;return((null==(o=t.discs)?void 0:o.length)||0)-((null==(n=e.discs)?void 0:n.length)||0)});for(const n of o)if(n.discs.every(e=>t[e.path]===e.value))return n.viewType;return(e.find(e=>!e.discs||0===e.discs.length)||e[0]).viewType}function ue(e){return JSON.stringify([e.tag,e.layout,e.binds,e.props])}function de(e,t){var o;for(let n=0;n+1<e.length;){const a=e[n],i=e[n+1];if(a.pid===i.pid&&ue(a)===ue(i)){let i=null;for(const e of Object.values(a.binds||{})){const t=null==e?void 0:e.p;if(t&&t.includes(".$each")){i=t.split(".$each")[0];for(const e of[".map",".forEach",".filter",".slice",".concat"])if(i.endsWith(e)){i=i.slice(0,-e.length);break}break}}if(!i){n++;continue}const l=((null==(o=Object.values(a.binds||{}).find(e=>{const t=null==e?void 0:e.p;return t&&t.includes(".$each")}))?void 0:o.p)||"").split(".$each")[0],r={...a,binds:{}};"qt-text"!==r.tag&&"span"!==r.tag&&(r.tag="qt-text");for(const[e,t]of Object.entries(a.binds||{})){const o=null==t?void 0:t.p;r.binds[e]=o&&l&&o.startsWith(l+".$each")?{k:"path",p:"$each"+o.slice((l+".$each").length)}:t}for(r.repeat={list:{k:"path",p:i},key:null},e.splice(n,2,r);n+1<e.length&&e[n+1].pid===r.pid&&ue(e[n+1])===ue(a);)e.splice(n+1,1);t.push({level:"warn",nodeId:r.id,reason:"repeat_collapsed",detail:`v-for 子列表折叠为 repeat 节点(list=${i})`,fix:"原生 bind 期克隆支持落地后此诊断消除"})}else n++}}function pe(e,t){if(null==t)return null;for(const[o,n]of Object.entries(e))if(Array.isArray(n)&&n.length>=2&&n[0]&&"object"==typeof n[0]&&Object.values(n[0]).some(e=>String(e)===String(t)))return o;return null}se.seq=0;const ve=["banner","theme_card","tool_card"],fe="qtx-glint-items/src/main/java/com/quicktvui/qtx/glint/factory/",ge="qtx-glint-items/src/main/java/com/quicktvui/qtx/glint/view/",me={poster:"主图地址(优先)",image:"主图地址(次选,ImageItemFactory 常用)",imgUrl:"主图地址(SDUI 协议别名,末选)",title:"主标题",subtitle:"副标题",floatTitle:"悬浮主标题(posterType=text_float 时生效)",floatSubtitle:"悬浮副标题",posterType:"海报形态(如 text_float)",scaleType:"图片缩放形态",badge:"角标对象",coord:"绝对定位坐标,可含 z 层级"},he={id:"glint",name:"Glint",description:"qtx 当前内置的 TV 风格:复用 qtx-glint-items 的原生卡片工厂,视觉与 grid-tabs 完全一致。",installer:"com.quicktvui.qtx.glint.GlintStyleInstaller.install()",rendering:"native",itemTypes:{header:{viewType:"header",label:"版块标题",description:"版块起始处的结构分割;当前原生实现只渲染一行主标题,且整行不可获焦。",fields:{title:"主标题(原生唯一读取字段)"},required:["title"],protocolOnly:["subTitle","showMore","tag"],factory:"GlintSectionHeaderItemFactory",nativeSources:[fe+"GlintSectionHeaderItemFactory.java"]},poster:{viewType:"poster",label:"标准海报卡片",description:"业务核心展示单元:主图、双行文本、悬浮标题、角标与缩放形态。",fields:me,required:[],requiredAnyOf:[["poster","image","imgUrl"]],protocolOnly:["score","rating","progress","subTitle","url"],factory:"GlintPosterItemFactory",nativeSources:[fe+"GlintPosterItemFactory.java",ge+"GlintPosterView.java"]},image:{viewType:"image",label:"基础图片素材",description:"纯视觉素材;复用 GlintPosterView.bindData(),字段与 poster 相同。",fields:{...me},required:[],requiredAnyOf:[["poster","image","imgUrl"]],protocolOnly:["url","score"],factory:"GlintImageItemFactory",nativeSources:[fe+"GlintImageItemFactory.java",ge+"GlintPosterView.java"]},text:{viewType:"text",label:"状态化文本",description:"通用文本展示;注意原生读取的是 title,不是 SDUI 协议的 text。",fields:{title:"显示文本(原生读取字段)",textSize:"字号",textColor:"文本颜色",maxLines:"最大行数",bgColor:"占位背景色(Color.parseColor,非法值静默忽略)",background:"背景图",poster:"海报图",badge:"角标对象"},required:[],requiredAnyOf:[["title"]],protocolOnly:["text","fontSize","normalStyle","focusStyle","borderRadius"],factory:"GlintTextItemFactory",nativeSources:[fe+"GlintTextItemFactory.java",ge+"GlintTextView.java"]},spacer:{viewType:"spacer",label:"物理间距",description:"网格占位;content 为空,跨列由行级 span 决定。当前原生实现固定 100px 高。",fields:{},required:[],factory:"SpacerFactory",nativeSources:["qtx-grid-tabs/src/main/java/com/quicktvui/qtx/tabs/factory/SpacerFactory.java"]},banner:{viewType:"banner",label:"轮播横幅",description:"首页顶部运营位;content 只需 banners 数组,子项字段由 GlintBannerView 读取。",fields:{banners:"轮播数据数组(必填,元素字段见 nestedFields)"},required:["banners"],protocolOnly:["image","title","tag","background"],nestedFields:{title:"主标题",subtitle:"副标题",poster:"主图",imageUrl:"图片地址",tag:"角标",appTag:"应用角标",appIcon:"应用图标",buttonText:"按钮文案",type:"内容类型",mediaType:"媒体类型",mediaUrl:"媒体地址",videoUrl:"视频地址",bgColor:"背景色",clickPayload:"点击透传数据"},factory:"GlintBannerItemFactory",nativeSources:[fe+"GlintBannerItemFactory.java",ge+"GlintBannerView.java"]},theme_card:{viewType:"theme_card",label:"主题卡片",description:"专题 / 合集入口,原生扩展类型。",fields:{title:"标题",subtitle:"副标题",icon:"图标地址",bgColor:"卡片背景色"},required:[],protocolOnly:["image","badge","tag"],factory:"GlintThemeCardItemFactory",nativeSources:[fe+"GlintThemeCardItemFactory.java"]},tool_card:{viewType:"tool_card",label:"工具卡片",description:"设置 / 工具入口,原生扩展类型。",fields:{icon:"图标地址",title:"标题",desc:"描述",tag:"标签",bgColor:"卡片背景色"},required:[],factory:"GlintToolItemFactory",nativeSources:[fe+"GlintToolItemFactory.java"]},app_icon:{viewType:"app_icon",label:"应用图标",description:"应用入口图标,原生扩展类型。",fields:{icon:"图标地址",title:"应用名",rating:"评分",price:"价格"},required:[],factory:"GlintAppIconItemFactory",nativeSources:[fe+"GlintAppIconItemFactory.java"]}}},ye=he.itemTypes,xe={...he,itemTypes:Object.fromEntries(Object.entries(ye).filter(([e])=>!ve.includes(e)))},be={poster:{scaleType:"center_crop"},image:{scaleType:"center_crop"},text:{textSize:24,maxLines:1},app_icon:{},header:{},spacer:{}},Ce={id:"compact",name:"Compact",description:"紧凑版字段预设:复用 glint 原生工厂,统一收紧字号、行数与缩放形态;非独立视觉体系。",installer:xe.installer,rendering:"preset",basedOn:xe.id,itemTypes:Object.fromEntries(Object.entries(xe.itemTypes).map(([e,t])=>[e,{...t,defaults:be[e]||{}}]))},Ie=new Map;function ke(e="glint"){const t=Ie.get(e);if(!t)throw new Error(`[qtx] 未注册的风格包 "${e}",已注册:${[...Ie.keys()].join(", ")}`);return t}function Se(){const e=new Set;for(const t of Ie.values())for(const o of Object.values(t.itemTypes))e.add(o.viewType);return[...e].sort()}function Ne(e){return Se().includes(e)}function _e(e,t={},o={}){const n=ke(o.pack),a=n.itemTypes[e]||Object.values(n.itemTypes).find(t=>t.viewType===e);if(!a)throw new Error(`[qtx] 风格包 "${n.id}" 未注册 item 类型 "${e}",可用:${Object.keys(n.itemTypes).join(", ")}`);const i={...a.defaults||{},...t};for(const r of a.required)if(null==i[r])throw new Error(`[qtx] ${e} 缺少必填字段 "${r}"`);for(const r of a.requiredAnyOf||[])if(!r.some(e=>null!=i[e]))throw new Error(`[qtx] ${e} 缺少必填字段(任选其一):${r.join(" / ")}`);const l={...i,viewType:a.viewType};return null!=o.id&&(l[o.keyField||"id"]=o.id),Number.isInteger(o.span)&&o.span>=1&&(l.__span=o.span),"number"==typeof o.aspectRatio&&o.aspectRatio>0&&(l.__aspectRatio=o.aspectRatio),l}function Te(e=[],t={}){const{pack:o,typeField:n="type",keyField:a="id"}=t;return e.map((e,t)=>{if("string"==typeof e.viewType&&Ne(e.viewType))return e;const i=e[n];if("string"!=typeof i||!i)throw new Error(`[qtx] styledRows 第 ${t} 行缺少 "${n}" 字段(或提供已注册的 viewType)`);const l={};for(const[o,r]of Object.entries(e))o!==n&&o!==a&&"span"!==o&&"aspectRatio"!==o&&"viewType"!==o&&(l[o]=r);return _e(i,l,{id:e[a]??t,keyField:a,pack:o,span:"number"==typeof e.span?e.span:void 0,aspectRatio:"number"==typeof e.aspectRatio?e.aspectRatio:void 0})})}function we(e){const t=e&&e.viewType;return"string"==typeof t&&t&&"__disc__"!==t&&Ne(t)?t:null}Ie.set(xe.id,xe),Ie.set(Ce.id,Ce);const Pe=k.defineComponent({inheritAttrs:!1,__name:"QtxListBase",setup(e,{expose:t}){const o=k.ref(),n=To("qtx-list");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(e,t)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o},e.$attrs),{default:k.withCtx(()=>[k.renderSlot(e.$slots,"default")]),_:3},16))}}),Be=k.defineComponent({name:"QtxList",inheritAttrs:!1,props:{items:{},columns:{default:1},keyField:{default:"id"},direction:{default:"vertical"},itemHeight:{default:0},itemAspectRatio:{},gutter:{default:0},pageEnabled:{type:Boolean},loadingTail:{type:Boolean,default:!1},initialFocusIndex:{},initData:{}},emits:["item-click","item-focus","nested-item-click","nested-item-focus","capture-diagnostics","onItemEvent","load-more","portal-viewport-enter","portal-viewport-leave"],setup(e,{expose:t,emit:o}){let n=0;const a=++n,i=e,l=o,r=k.ref(null),s=k.useSlots(),c=k.useAttrs();let u="",d=[],p=[],v=null,f=!1,g=!1,m=0,h=null,y=null;function x(){return h??i.items??[]}async function b(e){var t;let o;try{o=ie(e,(i.items||[]).slice(0,24))}catch(Mo){return I.value="capture CRASH "+String(Mo),!1}const n=function(e,t){if(!e||!Array.isArray(e.templates))return[];const o=new Map;for(const l of e.templates)for(const e of l.discs||[])e&&e.path&&(o.has(e.path)||o.set(e.path,new Set),o.get(e.path).add(e.value));if(0===o.size)return[];const n=new Map,a=(e,t)=>{let o=e;for(const n of t.split(".")){if(null==o||"object"!=typeof o)return;o=o[n]}return o};for(const l of t)for(const[e,t]of o){const o=a(l,e);void 0===o||t.has(o)||(n.has(e)||n.set(e,new Set),n.get(e).add(o))}const i=[];for(const[l,r]of n)for(const e of r)i.push({level:"warn",reason:"disc_sample_gap",detail:`判别字段 ${l} 的值 ${JSON.stringify(e)} 不在捕获样本(前 24 行)内——该值行将按默认模板渲染`,fix:"把该值对应的行提前到首屏 24 行内;或改用编译路径(v2 默认,asset 构建);或改等值判别字段"});return i}(o,i.items||[]);return n.length&&o.diagnostics.push(...n),I.value="captured "+o.templates.length+" tpl",l("capture-diagnostics",o.diagnostics),o.diagnostics.length&&console.warn("[qtx-list] 捕获诊断:",o.diagnostics),d=o.templates,p=o.templates,v=o.t1Evaluator||null,u=(null==(t=o.templates[0])?void 0:t.viewType)||"",!0}k.onMounted(async()=>{I.value="awaiting ready";try{await No()}catch(Mo){return void(I.value="ready FAILED "+String(Mo))}const e=c.tplKey||c["tpl-key"],t=e?(globalThis.__QTX_TPL__||{})[e]:null,o=t?t.templates&&t.templates.length>0?t.templates:[t]:[];if(o.length>0&&o[0].nodes&&o[0].nodes.length>0)return I.value="compiled tpl (v2)",f=!0,d=o,p=o,u=o[0].viewType||"",v=null,_(),Q((i.items||[]).slice()),C.value=!0,B(),l("capture-diagnostics",[{level:"info",reason:"compiled_template",detail:"v2 编译期模板路径已生效;运行时捕获未执行,T1 影子字段不适用",fix:"无需改写;若需运行时捕获诊断,请移除 tpl-key 或关闭编译期提取"}]),void D.emit("qtx-list-ready",{api:z,columns:i.columns,instanceId:a});I.value="ready ok, capturing";const n=s.item;if("function"!=typeof n)return void console.warn("[qtx-list] 缺少 #item 插槽");const r=0===(i.items||[]).length;await b(n)&&(r&&(g=!0,l("capture-diagnostics",[{level:"warn",reason:"empty_sample_capture",detail:"挂载时 items 为空——判别分支未枚举,当前仅基础模板;首次数据到达将自动重新捕获",fix:"首屏提供非空数据;或等待自动重捕获(数据到达后模板自动补全)"}])),_(),Q((i.items||[]).slice()),C.value=!0,B(),D.emit("qtx-list-ready",{api:z,columns:i.columns,instanceId:a}))}),k.watch(()=>(i.items||[]).length,e=>{!g||e<=0||(g=!1,(async()=>{const e=s.item;if("function"!=typeof e)return;await b(e)&&T()})())});const C=k.ref(!1),I=k.ref("qtx-list: mounted"),S=k.ref("");function _(){S.value=JSON.stringify({templates:d,items:F((i.items||[]).slice(0,48))})}async function T(e){m+=1;const t=((null==e?void 0:e.override)??x()).slice();Q(t),await k.nextTick();const o=w>=0?Math.min(w,t.length-1):-1;w=-1;const n=JSON.stringify({templates:d,items:F(t)}),a=d.some(e=>e&&Array.isArray(e.nested)&&e.nested.length>0),i=0===t.length||!a;if(0===t.length&&null==q)for(let r=0;r<10&&null==q;r++)await new Promise(e=>setTimeout(e,50));const l=!!i&&await async function(e,t,o){if(null==q)return!1;try{const{Native:n}=await(import("@extscreen/es3-vue")),a=await n.callNativeWithPromise("EsNativeModule","callReflect",{entry:{from:$,method:"setItems",params:[q,e,t?"true":"false",String(o)]}});return("string"==typeof a?a:String((a&&(a.result??a.data))??"")).includes("OK")}catch(Mo){return!1}}(n,!!(null==e?void 0:e.scrollTop),o);l||(S.value=n,P.value="",C.value=!1,await k.nextTick(),C.value=!0,o>=0&&setTimeout(()=>async function(e){if(null==q)return;try{const{Native:t}=await(import("@extscreen/es3-vue"));await t.callNativeWithPromise("EsNativeModule","callReflect",{entry:{from:$,method:"focus",params:[q,String(e)]}})}catch(Mo){console.warn("[qtx-list] focus reflect failed:",Mo)}}(o),500))}let w=-1;const P=k.ref("");function B(){const e=x().slice(),t=++m;let o=0;const n=()=>{if(t!==m)return;const a=48+500*o;a>=e.length||(o+=1,P.value=JSON.stringify({seq:o,subItems:F(e.slice(a,a+500))}),setTimeout(n,50))};n()}const E=new Map;function F(e){return e.map(e=>{const t=we(e)||(f?"__disc__":p.length>1?ce(p,e):u||"tpl:none"),o=v?v(e):null,n=se(e,i.keyField,t,o);return E.set(String(n.itemId),t),n})}let q=null;const $="com.quicktvui.qtx.list.QtxListCommandHub";function O(e,t){if(Array.isArray(e)){for(const o of e)O(o,t);return}if(!e||"object"!=typeof e)return;const o=e;if("path"!==o.k||"string"!=typeof o.p)for(const n of["l","r","c","a","b"])void 0!==o[n]&&O(o[n],t);else t.add(o.p.split(".")[0])}async function A(e){if(null==q)return!1;try{const{Native:t}=await(import("@extscreen/es3-vue")),o=await t.callNativeWithPromise("EsNativeModule","callReflect",{entry:{from:$,method:"dispatch",params:[q,JSON.stringify(e)]}}),n="string"==typeof o?o:String((o&&(o.result??o.data))??JSON.stringify(o));return!n.includes("ERR")&&n.includes("OK")}catch(Mo){return!1}}let L=[];function Q(e){L=e.slice()}let R=null;function M(){null==R&&(R=setTimeout(()=>{R=null,function(){if(!C.value)return;if(null!==h)return;const e=x();if(e===L)return;const t=L;let o=e.length>t.length;if(o)for(let n=0;n<t.length;n++)if(e[n]!==t[n]){o=!1;break}if(o){const o=e.slice(t.length);return Q(e),void(u&&o.length&&A([{op:"APPEND_SUB_ITEMS",itemId:"__qtx_list__",payload:{subItems:F(o)}}]).then(e=>{e||T()}))}if(e.length===t.length){let o=!0;for(let n=0;n<e.length;n++)if(e[n]!==t[n]){o=!1;break}if(o)return}T()}()},0))}function U(e){const t=(null==e?void 0:e.nativeEvent)||e||{},o=t.event;if("node-ready"===o)return q=String(t.itemId),void Oo(q);const n=null!=t.itemId?String(t.itemId):"";if("portal-viewport-enter"===o||"portal-viewport-leave"===o)return l("onItemEvent",t),void l(o,{key:n,position:Number(t.position??-1)});if(n.includes("#")&&("item-click"===o||"item-focus"===o)){const e=n.indexOf("#"),a=n.slice(0,e),r=Number(n.slice(e+1)),s=x().findIndex(e=>String(e[i.keyField])===a);let c=null;if(null!=t.content)try{c=JSON.parse(t.content)}catch{}return l("onItemEvent",t),void l("item-click"===o?"nested-item-click":"nested-item-focus",{row:x()[s],rowIndex:s,item:c,index:r,itemId:n})}if("nested-load-more"===o){const e=x().findIndex(e=>String(e[i.keyField])===n);return l("onItemEvent",t),void l("load-more",{itemId:n,position:e})}const a=Number(t.position??-1),r={item:x()[a],index:a,nodeId:t.nodeId};l("onItemEvent",t),"item-click"===o?l("item-click",r):"item-focus"===o?l("item-focus",r):"load-more"===o&&l("load-more",{itemId:t.itemId,position:a})}k.watch(()=>i.items,()=>{if(null!==h){if(i.items===y)return;h=null,y=null}M()},{deep:!0});const D=N.useESEventBus();function G(e,t){return h=(e||[]).slice(),y=i.items,T({scrollTop:t,override:h})}const z={getNativeNode:function(){var e;const t=r.value,o=(null==(e=null==t?void 0:t.getNativeNode)?void 0:e.call(t))||t;return(null==o?void 0:o.$el)||o},async updateItem(e,t){const o=x()[e];if(!o)return;const n=null!=o[i.keyField]?String(o[i.keyField]):`row_${e}`,a=v?v({...o,...t}):null,l=a?{...t,...a}:t,r={...o,...t};if(f){const e=new Set;for(const t of p)O(t.discriminators,e);if(Object.keys(t).some(t=>e.has(t)))return void T()}else{if((p.length>1?ce(p,r):u||"tpl:none")!==(E.get(n)||u))return void T()}if(null==q)for(let i=0;i<10&&null==q;i++)await new Promise(e=>setTimeout(e,50));await A([{op:"UPDATE_ITEM",itemId:n,payload:{content:l}}])||T()},async addListData(e){if(!u)return;Q(x().slice());await A([{op:"APPEND_SUB_ITEMS",itemId:"__qtx_list__",payload:{subItems:F(e)}}])||T()},prependItems(e){T({scrollTop:!0})},async removeItem(e){if(!x()[e])return;const t=e+1<x().length?e+1:e-1;let o=!1;t>=0&&(o=await async function(e){if(null==q)return!1;try{const{Native:t}=await(import("@extscreen/es3-vue")),o=await t.callNativeWithPromise("EsNativeModule","callReflect",{entry:{from:$,method:"requestFocus",params:[q,String(e)]}}),n="string"==typeof o?o:String((o&&(o.result??o.data))??"");return n.includes("OK")&&!n.includes("outside")}catch(Mo){return!1}}(t)),w=o?e:-1,T()},moveItemBefore(e,t){T()},clearItems:()=>G([],!0),async scrollToIndex(e,t=!1){if(null!=q)try{const{Native:o}=await(import("@extscreen/es3-vue"));await o.callNativeWithPromise("EsNativeModule","callReflect",{entry:{from:$,method:"scrollTo",params:[q,String(e),t?"true":"false"]}})}catch(Mo){console.warn("[qtx-list] scroll reflect failed:",Mo)}else console.warn("[qtx-list] node-ready 未握手,scroll 丢弃")},async setLoading(e){if(null==q)for(let t=0;t<10&&null==q;t++)await new Promise(e=>setTimeout(e,50));if(null!=q)try{const{Native:t}=await(import("@extscreen/es3-vue"));await t.callNativeWithPromise("EsNativeModule","callReflect",{entry:{from:$,method:"setLoading",params:[q,e?"true":"false"]}})}catch(Mo){console.warn("[qtx-list] setLoading reflect failed:",Mo)}else console.warn("[qtx-list] node-ready 未握手,setLoading 丢弃")},async focusItem(e){if(null==q)for(let t=0;t<10&&null==q;t++)await new Promise(e=>setTimeout(e,50));if(null!=q)try{const{Native:t}=await(import("@extscreen/es3-vue"));await t.callNativeWithPromise("EsNativeModule","callReflect",{entry:{from:$,method:"focus",params:[q,String(e)]}})}catch(Mo){console.warn("[qtx-list] focusItem reflect failed:",Mo)}else console.warn("[qtx-list] node-ready 未握手,focusItem 丢弃")},setListData:e=>G(e,!0),refresh(){T()},dispatchAction(e){T()}};return t(z),(t,o)=>{const n=k.resolveComponent("qtx-relocate-pool");return k.openBlock(),k.createElementBlock(k.Fragment,null,[k.createVNode(Pe,k.mergeProps({ref_key:"baseRef",ref:r},t.$attrs,{columns:e.columns,direction:e.direction,gutter:e.gutter,itemHeight:e.itemHeight,loadingTail:e.loadingTail,initData:C.value?S.value:"",appendData:C.value?P.value:"",onItemEvent:U}),null,16,["columns","direction","gutter","itemHeight","loadingTail","initData","appendData"]),k.createVNode(n,{class:"qtx-portal-zone"},{default:k.withCtx(()=>[k.renderSlot(t.$slots,"portals")]),_:3})],64)}}}),Ee={style:{width:"400px",height:"200px"}},Fe=k.defineComponent({name:"QtxStyledList",inheritAttrs:!1,props:{items:{},pack:{default:"glint"},typeField:{default:"type"},keyField:{default:"id"},columns:{default:1},direction:{default:"vertical"},gutter:{default:0},itemHeight:{},itemAspectRatio:{},pageEnabled:{type:Boolean},loadingTail:{type:Boolean,default:!1},initialFocusIndex:{}},setup(e,{expose:t}){const o=e,n=k.ref(null),a=k.computed(()=>Te(o.items||[],{pack:o.pack,typeField:o.typeField,keyField:o.keyField})),i=(e,...t)=>{var o,a;return null==(a=null==(o=n.value)?void 0:o[e])?void 0:a.call(o,...t)},l=e=>Te(e,{pack:o.pack,typeField:o.typeField,keyField:o.keyField});return t({getNativeNode:()=>i("getNativeNode"),updateItem:(e,t)=>{var n;const a=null==(n=o.items)?void 0:n[e];a&&i("updateItem",e,l([{...a,...t}])[0])},addListData:e=>i("addListData",l(e)),prependItems:e=>i("prependItems",l(e)),removeItem:e=>i("removeItem",e),moveItemBefore:(e,t)=>i("moveItemBefore",e,t),clearItems:()=>i("clearItems"),scrollToIndex:(e,t)=>i("scrollToIndex",e,t),setLoading:e=>i("setLoading",e),focusItem:e=>i("focusItem",e),setListData:e=>i("setListData",l(e)),refresh:()=>i("refresh"),dispatchAction:e=>i("dispatchAction",e)}),(t,o)=>{const i=k.resolveComponent("qt-text");return k.openBlock(),k.createBlock(Be,k.mergeProps({ref_key:"listRef",ref:n},t.$attrs,{items:a.value,columns:e.columns,keyField:e.keyField,direction:e.direction,gutter:e.gutter,itemHeight:e.itemHeight,itemAspectRatio:e.itemAspectRatio,pageEnabled:e.pageEnabled,loadingTail:e.loadingTail,initialFocusIndex:e.initialFocusIndex}),{item:k.withCtx(()=>[k.createElementVNode("div",Ee,[k.createVNode(i,{width:400,height:60,text:"内置样式行"})])]),portals:k.withCtx(()=>[k.renderSlot(t.$slots,"portals")]),_:3},16,["items","columns","keyField","direction","gutter","itemHeight","itemAspectRatio","pageEnabled","loadingTail","initialFocusIndex"])}}}),qe=k.defineComponent({inheritAttrs:!1,__name:"QtxKeyboard",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:t}){const o=k.ref(),n=To("qtx-keyboard");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value},requestFocus:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"requestFocus",e)}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,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:a[0]||(a[0]=e=>t.$emit("onInputChanged",e.nativeEvent)),onOnKeyPressed:a[1]||(a[1]=e=>t.$emit("onKeyPressed",e.nativeEvent))},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["backgroundColor","backgroundGradient","textColor","weakTextColor","focusBackgroundColor","focusTextColor","placeholder","textFullKeyboard","textT9Keyboard","keyboardType","textClear","textDelete","currentInput","autofocus","rememberKeyboardType"]))}});let $e;try{const e=require("@extscreen/es3-vue");$e=e.registerElement||(null==(t=e.default)?void 0:t.registerElement)}catch(Mo){}const Oe={install:e=>{if(!globalThis.__QtxKeyboard_registered)if($e){const e=e=>{$e(e,{component:{name:"QtxKeyboard",eventNamesMap:new Map([["onInputChanged","onInputChanged"],["onKeyPressed","onKeyPressed"]]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-keyboard"),e("QtxKeyboard"),globalThis.__QtxKeyboard_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxKeyboard",qe),e.component("qtx-keyboard",qe)}},Ae=k.defineComponent({inheritAttrs:!1,__name:"QtxNumericKeyboard",props:{maxLength:{}},emits:["onNumberPressed"],setup(e,{expose:t}){const o=k.ref(),n=To("qtx-numeric-keyboard");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,maxLength:e.maxLength,onOnNumberPressed:a[0]||(a[0]=e=>t.$emit("onNumberPressed",e.nativeEvent))},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["maxLength"]))}});let Le;try{const e=require("@extscreen/es3-vue");Le=e.registerElement||(null==(o=e.default)?void 0:o.registerElement)}catch(Mo){}const Qe={install:e=>{if(!globalThis.__QtxNumericKeyboard_registered)if(Le){const e=e=>{Le(e,{component:{name:"QtxNumericKeyboard",eventNamesMap:new Map([["onNumberPressed","onNumberPressed"]]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-numeric-keyboard"),e("QtxNumericKeyboard"),globalThis.__QtxNumericKeyboard_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxNumericKeyboard",Ae),e.component("qtx-numeric-keyboard",Ae)}},Re=k.defineComponent({inheritAttrs:!1,__name:"QtxPortalPool",setup(e,{expose:t}){const o=k.ref(),n=To("qtx-portal-pool");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(e,t)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,style:{position:"absolute"},absolute:!0},e.$attrs),{default:k.withCtx(()=>[k.renderSlot(e.$slots,"default")]),_:3},16))}});let Me;try{const e=require("@extscreen/es3-vue");Me=e.registerElement||(null==(n=e.default)?void 0:n.registerElement)}catch(Mo){}const Ue={install:e=>{if(!globalThis.__QtxPortalPool_registered)if(Me){const e=e=>{Me(e,{component:{name:"QtxPortalPool",eventNamesMap:new Map([]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-portal-pool"),e("QtxPortalPool"),globalThis.__QtxPortalPool_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxPortalPool",Re),e.component("qtx-portal-pool",Re)}},De=k.defineComponent({inheritAttrs:!1,__name:"QtxPortalItem",props:{portalId:{}},setup(e,{expose:t}){const o=k.ref(),n=To("qtx-portal-item");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,style:{position:"absolute"},absolute:!0,portalId:e.portalId||""},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["portalId"]))}});let Ge;try{const e=require("@extscreen/es3-vue");Ge=e.registerElement||(null==(a=e.default)?void 0:a.registerElement)}catch(Mo){}const ze={install:e=>{if(!globalThis.__QtxPortalItem_registered)if(Ge){const e=e=>{Ge(e,{component:{name:"QtxPortalItem",eventNamesMap:new Map([]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-portal-item"),e("QtxPortalItem"),globalThis.__QtxPortalItem_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxPortalItem",De),e.component("qtx-portal-item",De)}},Ve=k.defineComponent({inheritAttrs:!1,__name:"QtxHsvBackground",props:{hue:{},hueDuration:{}},setup(e,{expose:t}){const o=k.ref(),n=To("qtx-hsv-background");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,hue:e.hue,hueDuration:e.hueDuration},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["hue","hueDuration"]))}});let je;try{const e=require("@extscreen/es3-vue");je=e.registerElement||(null==(i=e.default)?void 0:i.registerElement)}catch(Mo){}const Ke={install:e=>{if(!globalThis.__QtxHsvBackground_registered)if(je){const e=e=>{je(e,{component:{name:"QtxHsvBackground",eventNamesMap:new Map([]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-hsv-background"),e("QtxHsvBackground"),globalThis.__QtxHsvBackground_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxHsvBackground",Ve),e.component("qtx-hsv-background",Ve)}},We=k.defineComponent({inheritAttrs:!1,__name:"QtxSvgImage",props:{src:{},tintColor:{}},setup(e,{expose:t}){const o=k.ref(),n=To("qtx-svg-image");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,src:e.src||"",tintColor:e.tintColor||""},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["src","tintColor"]))}});let He;try{const e=require("@extscreen/es3-vue");He=e.registerElement||(null==(l=e.default)?void 0:l.registerElement)}catch(Mo){}const Je={install:e=>{if(!globalThis.__QtxSvgImage_registered)if(He){const e=e=>{He(e,{component:{name:"QtxSvgImage",eventNamesMap:new Map([]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-svg-image"),e("QtxSvgImage"),globalThis.__QtxSvgImage_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxSvgImage",We),e.component("qtx-svg-image",We)}},Ye=k.defineComponent({inheritAttrs:!1,__name:"QtxButtonBase",props:{text:{},icon:{},iconSize:{},iconSpace:{},layoutDirection:{},fontSize:{},maxLines:{},textColor:{},focusTextColor:{},backgroundColor:{},focusBackgroundColor:{},normalBorderWidth:{},normalBorderColor:{},focusBorderColor:{},cornerRadius:{},focusScale:{},enableFocusBorder:{type:Boolean},autofocus:{type:Boolean},contentPadding:{}},emits:["onButtonCustomEvent"],setup(e,{expose:t}){const o=k.ref(),n=To("qtx-button");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,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,autofocus:e.autofocus,contentPadding:e.contentPadding,onOnButtonCustomEvent:a[0]||(a[0]=e=>t.$emit("onButtonCustomEvent",e.nativeEvent))},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["text","icon","iconSize","iconSpace","layoutDirection","fontSize","maxLines","textColor","focusTextColor","backgroundColor","focusBackgroundColor","normalBorderWidth","normalBorderColor","focusBorderColor","cornerRadius","focusScale","enableFocusBorder","autofocus","contentPadding"]))}}),Xe=k.defineComponent({inheritAttrs:!1,__name:"QtxButton",props:{width:{},height:{}},setup(e){const t=e,o=k.useAttrs(),n=k.computed(()=>{const e={};void 0!==t.width&&(e.width="number"==typeof t.width?`${t.width}px`:t.width),void 0!==t.height&&(e.height="number"==typeof t.height?`${t.height}px`:t.height);const n=o.style||{};return{...e,..."object"==typeof n?n:{}}});return(e,t)=>(k.openBlock(),k.createBlock(Ye,k.mergeProps(e.$attrs,{style:n.value}),{default:k.withCtx(()=>[k.renderSlot(e.$slots,"default")]),_:3},16,["style"]))}});let Ze;try{const e=require("@extscreen/es3-vue");Ze=e.registerElement||(null==(r=e.default)?void 0:r.registerElement)}catch(Mo){}const et={install:e=>{if(!globalThis.__QtxButton_registered)if(Ze){const e=e=>{Ze(e,{component:{name:"QtxButton",eventNamesMap:new Map([["onButtonCustomEvent","onButtonCustomEvent"]]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-button"),e("QtxButton"),globalThis.__QtxButton_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxButton",Xe),e.component("qtx-button",Xe)}},tt=k.defineComponent({inheritAttrs:!1,__name:"QtxCheckbox",props:{autofocus:{type:Boolean},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:t}){const o=k.ref(),n=To("qtx-checkbox");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,autofocus:e.autofocus,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:a[0]||(a[0]=e=>t.$emit("onCheckedChange",e.nativeEvent))},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["autofocus","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 ot;try{const e=require("@extscreen/es3-vue");ot=e.registerElement||(null==(s=e.default)?void 0:s.registerElement)}catch(Mo){}const nt={install:e=>{if(!globalThis.__QtxCheckbox_registered)if(ot){const e=e=>{ot(e,{component:{name:"QtxCheckbox",eventNamesMap:new Map([["onCheckedChange","onCheckedChange"]]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-checkbox"),e("QtxCheckbox"),globalThis.__QtxCheckbox_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxCheckbox",tt),e.component("qtx-checkbox",tt)}},at=(e,t)=>{const o=e.__vccOpts||e;for(const[n,a]of t)o[n]=a;return o};const it=at(k.defineComponent({name:"QtxRadioGroup",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:t})=>({groupStyle:k.computed(()=>({display:"flex",flexDirection:e.direction,alignItems:"center"})),getItemStyle:(t,o)=>{var n;const a={...(null==(n=t.props)?void 0:n.style)||{}};return void 0!==e.itemWidth&&(a.width=e.itemWidth),void 0!==e.itemHeight&&(a.height=e.itemHeight),o!==e.options.length-1&&("row"===e.direction?a.marginRight=e.itemGap:a.marginBottom=e.itemGap),a},onItemClick:e=>{e.disabled||(t("update:modelValue",e.value),t("change",e.value))}})}),[["render",function(e,t,o,n,a,i){const l=k.resolveComponent("qtx-checkbox");return k.openBlock(),k.createElementBlock("div",{class:"na-radio-group",style:k.normalizeStyle(e.groupStyle)},[(k.openBlock(!0),k.createElementBlock(k.Fragment,null,k.renderList(e.options,(t,o)=>(k.openBlock(),k.createBlock(l,k.mergeProps({key:o,type:"radio",checked:e.modelValue===t.value,text:t.label,gravity:e.gravity,showBackground:e.showBackground,disabled:t.disabled},{ref_for:!0},t.props,{style:e.getItemStyle(t,o),onClick:o=>e.onItemClick(t)}),null,16,["checked","text","gravity","showBackground","disabled","style","onClick"]))),128))],4)}],["__scopeId","data-v-cea6e7c9"]]),lt={install:e=>{e.component("QtxRadioGroup",it),e.component("qtx-radio-group",it)}};const rt=at(k.defineComponent({name:"QtxCheckboxGroup",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:t})=>({groupStyle:k.computed(()=>({display:"flex",flexDirection:e.direction,alignItems:"center"})),getItemStyle:(t,o)=>{var n;const a={...(null==(n=t.props)?void 0:n.style)||{}};return void 0!==e.itemWidth&&(a.width=e.itemWidth),void 0!==e.itemHeight&&(a.height=e.itemHeight),o!==e.options.length-1&&("row"===e.direction?a.marginRight=e.itemGap:a.marginBottom=e.itemGap),a},onItemClick:o=>{if(o.disabled)return;const n=[...e.modelValue],a=n.indexOf(o.value);a>-1?n.splice(a,1):n.push(o.value),t("update:modelValue",n),t("change",n)}})}),[["render",function(e,t,o,n,a,i){const l=k.resolveComponent("qtx-checkbox");return k.openBlock(),k.createElementBlock("div",{class:"na-checkbox-group",style:k.normalizeStyle(e.groupStyle)},[(k.openBlock(!0),k.createElementBlock(k.Fragment,null,k.renderList(e.options,(t,o)=>(k.openBlock(),k.createBlock(l,k.mergeProps({key:o,type:"checkbox",checked:e.modelValue.includes(t.value),text:t.label,gravity:e.gravity,showBackground:e.showBackground,disabled:t.disabled},{ref_for:!0},t.props,{style:e.getItemStyle(t,o),onClick:o=>e.onItemClick(t)}),null,16,["checked","text","gravity","showBackground","disabled","style","onClick"]))),128))],4)}],["__scopeId","data-v-3e75ffbd"]]),st={install:e=>{e.component("QtxCheckboxGroup",rt),e.component("qtx-checkbox-group",rt)}},ct=k.defineComponent({inheritAttrs:!1,__name:"QtxSwitcher",props:{autofocus:{type:Boolean},checked:{type:Boolean},disabled:{type:Boolean},title:{},textOn:{},textOff:{},subtitle:{},subtitleColor:{},titleColor:{},focusTitleColor:{},titleTextSize:{},subtitleTextSize:{},stateTextSize:{}},emits:["onCheckedChange"],setup(e,{expose:t}){const o=k.ref(),n=To("qtx-switcher");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,autofocus:e.autofocus,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:a[0]||(a[0]=e=>t.$emit("onCheckedChange",e.nativeEvent))},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["autofocus","checked","disabled","title","textOn","textOff","subtitle","subtitleColor","titleColor","focusTitleColor","titleTextSize","subtitleTextSize","stateTextSize"]))}});let ut;try{const e=require("@extscreen/es3-vue");ut=e.registerElement||(null==(c=e.default)?void 0:c.registerElement)}catch(Mo){}const dt={install:e=>{if(!globalThis.__QtxSwitcher_registered)if(ut){const e=e=>{ut(e,{component:{name:"QtxSwitcher",eventNamesMap:new Map([["onCheckedChange","onCheckedChange"]]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-switcher"),e("QtxSwitcher"),globalThis.__QtxSwitcher_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxSwitcher",ct),e.component("qtx-switcher",ct)}};const pt=at(k.defineComponent({name:"QtxSettingSwitch",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:t,attrs:o}){const n=k.ref(e.modelValue);k.watch(()=>e.modelValue,e=>{n.value=e});const a=k.computed(()=>"number"==typeof e.width?`${e.width}px`:e.width),i=k.computed(()=>{const t=o.style||{},n=e.subtitle?("number"==typeof e.height?e.height:parseInt(e.height))+30:e.height;return{width:a.value,height:"number"==typeof n?`${n}px`:n,...t}});return{checked:n,handleCheckedChange:e=>{const o=e.checked;n.value=o,t("update:modelValue",o),t("change",o)},mergedStyle:i}}}),[["render",function(e,t,o,n,a,i){const l=k.resolveComponent("qtx-switcher");return k.openBlock(),k.createBlock(l,{class:"na-setting-switch",style:k.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"])}]]),vt={install(e){e.component("QtxSettingSwitch",pt),e.component("qtx-setting-switch",pt)}},ft=k.defineComponent({inheritAttrs:!1,__name:"QtxCollapseMenuGroupBase",props:{icon:{},title:{},titleColor:{},titleSelectedColor:{},titleSize:{},expanded:{type:Boolean},data:{}},emits:["onFocus"],setup(e,{expose:t}){const o=k.ref(),n=To("qtx-collapse-menu-group");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,icon:e.icon||"",title:e.title||"",titleColor:e.titleColor||"",titleSelectedColor:e.titleSelectedColor||"",titleSize:e.titleSize,expanded:e.expanded,data:e.data,onOnFocus:a[0]||(a[0]=e=>t.$emit("onFocus",e.nativeEvent))},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["icon","title","titleColor","titleSelectedColor","titleSize","expanded","data"]))}}),gt=k.defineComponent({inheritAttrs:!1,__name:"QtxCollapseMenuGroup",setup(e){const t=k.useAttrs(),o=k.computed(()=>({...t.style||{}}));return(e,t)=>(k.openBlock(),k.createBlock(ft,k.mergeProps({style:o.value},e.$attrs),{default:k.withCtx(()=>[k.renderSlot(e.$slots,"default")]),_:3},16,["style"]))}});let mt;try{const e=require("@extscreen/es3-vue");mt=e.registerElement||(null==(u=e.default)?void 0:u.registerElement)}catch(Mo){}const ht={install:e=>{if(!globalThis.__QtxCollapseMenuGroup_registered)if(mt){const e=e=>{mt(e,{component:{name:"QtxCollapseMenuGroup",eventNamesMap:new Map([["onFocus","onFocus"]]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-collapse-menu-group"),e("QtxCollapseMenuGroup"),globalThis.__QtxCollapseMenuGroup_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxCollapseMenuGroup",gt),e.component("qtx-collapse-menu-group",gt)}},yt=k.defineComponent({inheritAttrs:!1,__name:"QtxCollapseMenuListBase",props:{data:{},defaultExpandedIndex:{},defaultFocus:{type:Boolean}},emits:["onItemFocus"],setup(e,{expose:t}){const o=k.ref(),n=To("qtx-collapse-menu-list");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,data:e.data,defaultExpandedIndex:e.defaultExpandedIndex,defaultFocus:e.defaultFocus,onOnItemFocus:a[0]||(a[0]=e=>t.$emit("onItemFocus",e.nativeEvent))},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["data","defaultExpandedIndex","defaultFocus"]))}}),xt=k.defineComponent({inheritAttrs:!1,__name:"QtxCollapseMenuList",setup(e,{expose:t}){const o=k.useAttrs(),n=k.ref(),a=k.computed(()=>({...o.style||{}}));return t({expandIndex:(e,t=!1)=>{n.value&&S.Native.callUIFunction(n.value.getNativeNode(),"expandIndex",[e,t])},getNativeNode:()=>{var e,t;return null==(t=null==(e=n.value)?void 0:e.getNativeNode)?void 0:t.call(e)}}),(e,t)=>(k.openBlock(),k.createBlock(yt,k.mergeProps({ref_key:"baseRef",ref:n,style:a.value},e.$attrs),{default:k.withCtx(()=>[k.renderSlot(e.$slots,"default")]),_:3},16,["style"]))}});let bt;try{const e=require("@extscreen/es3-vue");bt=e.registerElement||(null==(d=e.default)?void 0:d.registerElement)}catch(Mo){}const Ct={install:e=>{if(!globalThis.__QtxCollapseMenuList_registered)if(bt){const e=e=>{bt(e,{component:{name:"QtxCollapseMenuList",eventNamesMap:new Map([["onItemFocus","onItemFocus"]]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-collapse-menu-list"),e("QtxCollapseMenuList"),globalThis.__QtxCollapseMenuList_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxCollapseMenuList",xt),e.component("qtx-collapse-menu-list",xt)}},It=k.defineComponent({inheritAttrs:!1,__name:"QtxInputViewBase",props:{text:{},placeholder:{},type:{},status:{},disabled:{type:Boolean},inputSize:{},cursorVisible:{type:Boolean},useSystemKeyboard:{type:Boolean},trailingIcon:{}},emits:["onInputClick","onChange"],setup(e,{expose:t}){const o=k.ref(),n=To("qtx-input-view");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,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:a[0]||(a[0]=e=>t.$emit("onInputClick",e.nativeEvent)),onOnChange:a[1]||(a[1]=e=>t.$emit("onChange",e.nativeEvent))},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["text","placeholder","type","status","disabled","inputSize","cursorVisible","useSystemKeyboard","trailingIcon"]))}}),kt=k.defineComponent({inheritAttrs:!1,__name:"QtxInputView",props:{inputSize:{default:"medium"}},emits:["onInputClick","onChange"],setup(e,{emit:t}){const o=t,n=e,a=k.computed(()=>{let e=60;return"large"===n.inputSize?e=70:"small"===n.inputSize&&(e=50),{height:`${e}px`}}),i=e=>{o("onInputClick",e)},l=e=>{o("onChange",e)};return(t,o)=>(k.openBlock(),k.createBlock(It,k.mergeProps(t.$attrs,{style:a.value,inputSize:e.inputSize,onOnInputClick:i,onOnChange:l}),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["style","inputSize"]))}});let St;try{const e=require("@extscreen/es3-vue");St=e.registerElement||(null==(p=e.default)?void 0:p.registerElement)}catch(Mo){}const Nt={install:e=>{if(!globalThis.__QtxInputView_registered)if(St){const e=e=>{St(e,{component:{name:"QtxInputView",eventNamesMap:new Map([["onInputClick","onInputClick"],["onChange","onChange"]]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-input-view"),e("QtxInputView"),globalThis.__QtxInputView_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxInputView",kt),e.component("qtx-input-view",kt)}},_t=k.defineComponent({inheritAttrs:!1,__name:"QtxDatePicker",props:{initialDate:{}},emits:["onDateChanged"],setup(e,{expose:t}){const o=k.ref(),n=To("qtx-date-picker");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,initialDate:e.initialDate||"",onOnDateChanged:a[0]||(a[0]=e=>t.$emit("onDateChanged",e.nativeEvent))},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["initialDate"]))}});let Tt;try{const e=require("@extscreen/es3-vue");Tt=e.registerElement||(null==(v=e.default)?void 0:v.registerElement)}catch(Mo){}const wt={install:e=>{if(!globalThis.__QtxDatePicker_registered)if(Tt){const e=e=>{Tt(e,{component:{name:"QtxDatePicker",eventNamesMap:new Map([["onDateChanged","onDateChanged"]]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-date-picker"),e("QtxDatePicker"),globalThis.__QtxDatePicker_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxDatePicker",_t),e.component("qtx-date-picker",_t)}},Pt=k.defineComponent({inheritAttrs:!1,__name:"QtxRatingBar",props:{numStars:{},rating:{},stepSize:{},isIndicator:{type:Boolean}},emits:["onRatingChanged"],setup(e,{expose:t}){const o=k.ref(),n=To("qtx-rating-bar");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,numStars:e.numStars,rating:e.rating,stepSize:e.stepSize,isIndicator:e.isIndicator,onOnRatingChanged:a[0]||(a[0]=e=>t.$emit("onRatingChanged",e.nativeEvent))},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["numStars","rating","stepSize","isIndicator"]))}});let Bt;try{const e=require("@extscreen/es3-vue");Bt=e.registerElement||(null==(f=e.default)?void 0:f.registerElement)}catch(Mo){}const Et={install:e=>{if(!globalThis.__QtxRatingBar_registered)if(Bt){const e=e=>{Bt(e,{component:{name:"QtxRatingBar",eventNamesMap:new Map([["onRatingChanged","onRatingChanged"]]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-rating-bar"),e("QtxRatingBar"),globalThis.__QtxRatingBar_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxRatingBar",Pt),e.component("qtx-rating-bar",Pt)}};let Ft;try{const e=require("@extscreen/es3-vue");Ft=e.registerElement||(null==(g=e.default)?void 0:g.registerElement)}catch(Mo){}const qt={install:e=>{if(!globalThis.__QtxList_registered)if(Ft){const e=e=>{Ft(e,{component:{name:"QtxList",eventNamesMap:new Map([]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-list"),e("QtxList"),globalThis.__QtxList_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxList",Be),e.component("qtx-list",Be)}},$t=k.defineComponent({name:"QtxTabs",inheritAttrs:!1,props:{active:{},offscreen:{},maxInstances:{},animationDuration:{},animationDirection:{},linkId:{}},emits:["change"],setup(e,{expose:t}){const o=k.ref(),n=To("qtx-tabs");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value},changeTab:e=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"changeTab",[e])}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o},t.$attrs,{active:e.active,offscreen:e.offscreen,"max-instances":e.maxInstances,"animation-duration":e.animationDuration,"animation-direction":e.animationDirection,"link-id":e.linkId}),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["active","offscreen","max-instances","animation-duration","animation-direction","link-id"]))}}),Ot=k.defineComponent({name:"QtxTabContent",inheritAttrs:!1,props:{tabKey:{}},setup(e,{expose:t}){const o=k.ref(),n=To("qtx-tab-content");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o},t.$attrs,{tabKey:e.tabKey}),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["tabKey"]))}});let At;try{const e=require("@extscreen/es3-vue");At=e.registerElement||(null==(m=e.default)?void 0:m.registerElement)}catch(Mo){}function Lt(e,t){At(e,{component:{name:t,processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})}const Qt={install:e=>{globalThis.__QtxTabs_registered||(At?(Lt("qtx-tabs","QtxTabs"),Lt("QtxTabs","QtxTabs"),Lt("qtx-tab-content","QtxTabContent"),Lt("QtxTabContent","QtxTabContent"),globalThis.__QtxTabs_registered=!0):console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue"))}},Rt=k.defineComponent({inheritAttrs:!1,__name:"QtxPosterBase",props:{poster:{},image:{},imgUrl:{},localSrc:{},fallbackSrc:{},scaleType:{},title:{},subtitle:{},floatTitle:{},floatSubtitle:{},posterType:{},textSize:{},textColor:{},maxLines:{},badge:{},aspectRatio:{},cornerRadius:{},coord:{},state:{},placeholderColor:{},loadingDelayMs:{},focusable:{type:Boolean},focusScale:{},focusBorder:{type:Boolean},focusGlow:{type:Boolean},elevationShadow:{type:Boolean},clickPayload:{},focusPayload:{}},emits:["onClick","onFocus","onBlur","onLongClick","onImageLoadStart","onImageLoadSuccess","onImageLoadError","onStateChange","onBind","onRecycle","onPatch","onBadgeClick"],setup(e,{expose:t}){const o=k.ref(),n=To("qtx-poster");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value},setImageSource:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setImageSource",e)},setTitle:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setTitle",e)},setSubtitle:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setSubtitle",e)},setBadge:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setBadge",e)},setPosterType:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setPosterType",e)},setAspectRatio:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setAspectRatio",e)},setLoadingState:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setLoadingState",e)},applyPatch:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"applyPatch",e)},cancelImageLoad:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"cancelImageLoad",e)},clear:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"clear",e)},recycle:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"recycle",e)},requestFocus:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"requestFocus",e)},getState:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"getState",e)}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,poster:e.poster||"",image:e.image||"",imgUrl:e.imgUrl||"",localSrc:e.localSrc||"",fallbackSrc:e.fallbackSrc||"",scaleType:e.scaleType||"",title:e.title||"",subtitle:e.subtitle||"",floatTitle:e.floatTitle||"",floatSubtitle:e.floatSubtitle||"",posterType:e.posterType||"",textSize:e.textSize,textColor:e.textColor||"",maxLines:e.maxLines,badge:e.badge,aspectRatio:e.aspectRatio,cornerRadius:e.cornerRadius,coord:e.coord,state:e.state||"",placeholderColor:e.placeholderColor||"",loadingDelayMs:e.loadingDelayMs,focusable:e.focusable,focusScale:e.focusScale,focusBorder:e.focusBorder,focusGlow:e.focusGlow,elevationShadow:e.elevationShadow,clickPayload:e.clickPayload,focusPayload:e.focusPayload,onOnClick:a[0]||(a[0]=e=>t.$emit("onClick",e.nativeEvent)),onOnFocus:a[1]||(a[1]=e=>t.$emit("onFocus",e.nativeEvent)),onOnBlur:a[2]||(a[2]=e=>t.$emit("onBlur",e.nativeEvent)),onOnLongClick:a[3]||(a[3]=e=>t.$emit("onLongClick",e.nativeEvent)),onOnImageLoadStart:a[4]||(a[4]=e=>t.$emit("onImageLoadStart",e.nativeEvent)),onOnImageLoadSuccess:a[5]||(a[5]=e=>t.$emit("onImageLoadSuccess",e.nativeEvent)),onOnImageLoadError:a[6]||(a[6]=e=>t.$emit("onImageLoadError",e.nativeEvent)),onOnStateChange:a[7]||(a[7]=e=>t.$emit("onStateChange",e.nativeEvent)),onOnBind:a[8]||(a[8]=e=>t.$emit("onBind",e.nativeEvent)),onOnRecycle:a[9]||(a[9]=e=>t.$emit("onRecycle",e.nativeEvent)),onOnPatch:a[10]||(a[10]=e=>t.$emit("onPatch",e.nativeEvent)),onOnBadgeClick:a[11]||(a[11]=e=>t.$emit("onBadgeClick",e.nativeEvent))},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["poster","image","imgUrl","localSrc","fallbackSrc","scaleType","title","subtitle","floatTitle","floatSubtitle","posterType","textSize","textColor","maxLines","badge","aspectRatio","cornerRadius","coord","state","placeholderColor","loadingDelayMs","focusable","focusScale","focusBorder","focusGlow","elevationShadow","clickPayload","focusPayload"]))}}),Mt=k.defineComponent({inheritAttrs:!1,__name:"QtxPoster",props:{poster:{},image:{},imgUrl:{},localSrc:{},fallbackSrc:{},scaleType:{},title:{},subtitle:{},floatTitle:{},floatSubtitle:{},posterType:{},textSize:{},textColor:{},maxLines:{},badge:{},aspectRatio:{},cornerRadius:{},coord:{},state:{},placeholderColor:{},loadingDelayMs:{},focusable:{type:Boolean},focusScale:{},focusBorder:{type:Boolean},focusGlow:{type:Boolean},elevationShadow:{type:Boolean},clickPayload:{},focusPayload:{},width:{},height:{}},emits:["click","focus","blur","longClick","imageLoadStart","imageLoadSuccess","imageLoadError","stateChange","bind","recycle","patch","badgeClick"],setup(e,{expose:t,emit:o}){const n=e,a=o,i=k.ref(null),l=k.useAttrs(),r=k.computed(()=>{const e={};void 0!==n.width&&(e.width="number"==typeof n.width?`${n.width}px`:n.width),void 0!==n.height&&(e.height="number"==typeof n.height?`${n.height}px`:n.height);const t=l.style||{};return{...e,..."object"==typeof t?t:{}}});return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=i.value)?void 0:e.getNativeNode)?void 0:t.call(e))||i.value},setImageSource:(e,t)=>{var o,n;const a=(null==(n=null==(o=i.value)?void 0:o.getNativeNode)?void 0:n.call(o))||i.value;a&&S.Native.callUIFunction(a,"setImageSource",[e,t])},setTitle:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"setTitle",[e])},setSubtitle:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"setSubtitle",[e])},setBadge:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"setBadge",[e])},setPosterType:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"setPosterType",[e])},setAspectRatio:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"setAspectRatio",[e])},setLoadingState:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"setLoadingState",[e])},applyPatch:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"applyPatch",[e])},cancelImageLoad:()=>{var e,t;const o=(null==(t=null==(e=i.value)?void 0:e.getNativeNode)?void 0:t.call(e))||i.value;o&&S.Native.callUIFunction(o,"cancelImageLoad",[])},clear:()=>{var e,t;const o=(null==(t=null==(e=i.value)?void 0:e.getNativeNode)?void 0:t.call(e))||i.value;o&&S.Native.callUIFunction(o,"clear",[])},recycle:()=>{var e,t;const o=(null==(t=null==(e=i.value)?void 0:e.getNativeNode)?void 0:t.call(e))||i.value;o&&S.Native.callUIFunction(o,"recycle",[])},requestFocus:()=>new Promise(e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;if(!n)return void e("");let a=!1;const l=t=>{a||(a=!0,e(String(t??"")))};setTimeout(()=>l(""),1200),S.Native.callUIFunction(n,"requestFocus",[],l)}),getState:()=>new Promise(e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;if(!n)return void e({});let a=!1;const l=t=>{a||(a=!0,e(t||{}))};setTimeout(()=>l({}),1200),S.Native.callUIFunction(n,"getState",[],l)})}),(t,o)=>(k.openBlock(),k.createBlock(Rt,k.mergeProps({ref_key:"baseRef",ref:i},{...k.unref(l),...n},{width:e.width,height:e.height,style:r.value,onOnClick:o[0]||(o[0]=e=>a("click",e)),onOnFocus:o[1]||(o[1]=e=>a("focus",e)),onOnBlur:o[2]||(o[2]=e=>a("blur",e)),onOnLongClick:o[3]||(o[3]=e=>a("longClick",e)),onOnImageLoadStart:o[4]||(o[4]=e=>a("imageLoadStart",e)),onOnImageLoadSuccess:o[5]||(o[5]=e=>a("imageLoadSuccess",e)),onOnImageLoadError:o[6]||(o[6]=e=>a("imageLoadError",e)),onOnStateChange:o[7]||(o[7]=e=>a("stateChange",e)),onOnBind:o[8]||(o[8]=e=>a("bind",e)),onOnRecycle:o[9]||(o[9]=e=>a("recycle",e)),onOnPatch:o[10]||(o[10]=e=>a("patch",e)),onOnBadgeClick:o[11]||(o[11]=e=>a("badgeClick",e))}),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["width","height","style"]))}});let Ut;try{const e=require("@extscreen/es3-vue");Ut=e.registerElement||(null==(h=e.default)?void 0:h.registerElement)}catch(Mo){}const Dt={install:e=>{if(!globalThis.__QtxPoster_registered)if(Ut){const e=e=>{Ut(e,{component:{name:"QtxPoster",eventNamesMap:new Map([["onClick","onClick"],["onFocus","onFocus"],["onBlur","onBlur"],["onLongClick","onLongClick"],["onImageLoadStart","onImageLoadStart"],["onImageLoadSuccess","onImageLoadSuccess"],["onImageLoadError","onImageLoadError"],["onStateChange","onStateChange"],["onBind","onBind"],["onRecycle","onRecycle"],["onPatch","onPatch"],["onBadgeClick","onBadgeClick"]]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-poster"),e("QtxPoster"),globalThis.__QtxPoster_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxPoster",Mt),e.component("qtx-poster",Mt)}},Gt=k.defineComponent({inheritAttrs:!1,__name:"QtxAppIconBase",props:{icon:{},image:{},imgUrl:{},localIcon:{},resName:{},resId:{},filePath:{},assetPath:{},packageName:{},fallbackIcon:{},iconScaleType:{},iconCornerRadius:{},variant:{},banner:{},title:{},appLabel:{},rating:{},price:{},installState:{},progress:{},appTag:{},buttonText:{},aspectRatio:{},cornerRadius:{},span:{},state:{},placeholderColor:{},loadingDelayMs:{},focusable:{type:Boolean},focusScale:{},focusBorder:{type:Boolean},focusGlow:{type:Boolean},clickPayload:{},focusPayload:{},actionPayload:{}},emits:["onClick","onFocus","onBlur","onLongClick","onIconResolved","onIconLoadError","onInstallStateChange","onProgressChange","onBannerAction","onVariantChange","onStateChange","onBind","onRecycle","onPatch","onImageLoadStart","onImageLoadSuccess","onImageLoadError"],setup(e,{expose:t}){const o=k.ref(),n=To("qtx-app-icon");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value},setAppIcon:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setAppIcon",e)},setLocalIcon:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setLocalIcon",e)},setIconUrl:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setIconUrl",e)},setVariant:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setVariant",e)},setBannerData:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setBannerData",e)},setInstallState:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setInstallState",e)},setProgress:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setProgress",e)},setRatingAndPrice:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setRatingAndPrice",e)},setLabel:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setLabel",e)},applyPatch:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"applyPatch",e)},clearIconCache:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"clearIconCache",e)},requestFocus:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"requestFocus",e)},clear:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"clear",e)},recycle:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"recycle",e)},getState:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"getState",e)},cancelImageLoad:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"cancelImageLoad",e)}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,icon:e.icon||"",image:e.image||"",imgUrl:e.imgUrl||"",localIcon:e.localIcon||"",resName:e.resName||"",resId:e.resId,filePath:e.filePath||"",assetPath:e.assetPath||"",packageName:e.packageName||"",fallbackIcon:e.fallbackIcon||"",iconScaleType:e.iconScaleType||"",iconCornerRadius:e.iconCornerRadius,variant:e.variant||"",banner:e.banner,title:e.title||"",appLabel:e.appLabel||"",rating:e.rating,price:e.price||"",installState:e.installState||"",progress:e.progress,appTag:e.appTag||"",buttonText:e.buttonText||"",aspectRatio:e.aspectRatio,cornerRadius:e.cornerRadius,span:e.span,state:e.state||"",placeholderColor:e.placeholderColor||"",loadingDelayMs:e.loadingDelayMs,focusable:e.focusable,focusScale:e.focusScale,focusBorder:e.focusBorder,focusGlow:e.focusGlow,clickPayload:e.clickPayload,focusPayload:e.focusPayload,actionPayload:e.actionPayload,onOnClick:a[0]||(a[0]=e=>t.$emit("onClick",e.nativeEvent)),onOnFocus:a[1]||(a[1]=e=>t.$emit("onFocus",e.nativeEvent)),onOnBlur:a[2]||(a[2]=e=>t.$emit("onBlur",e.nativeEvent)),onOnLongClick:a[3]||(a[3]=e=>t.$emit("onLongClick",e.nativeEvent)),onOnIconResolved:a[4]||(a[4]=e=>t.$emit("onIconResolved",e.nativeEvent)),onOnIconLoadError:a[5]||(a[5]=e=>t.$emit("onIconLoadError",e.nativeEvent)),onOnInstallStateChange:a[6]||(a[6]=e=>t.$emit("onInstallStateChange",e.nativeEvent)),onOnProgressChange:a[7]||(a[7]=e=>t.$emit("onProgressChange",e.nativeEvent)),onOnBannerAction:a[8]||(a[8]=e=>t.$emit("onBannerAction",e.nativeEvent)),onOnVariantChange:a[9]||(a[9]=e=>t.$emit("onVariantChange",e.nativeEvent)),onOnStateChange:a[10]||(a[10]=e=>t.$emit("onStateChange",e.nativeEvent)),onOnBind:a[11]||(a[11]=e=>t.$emit("onBind",e.nativeEvent)),onOnRecycle:a[12]||(a[12]=e=>t.$emit("onRecycle",e.nativeEvent)),onOnPatch:a[13]||(a[13]=e=>t.$emit("onPatch",e.nativeEvent)),onOnImageLoadStart:a[14]||(a[14]=e=>t.$emit("onImageLoadStart",e.nativeEvent)),onOnImageLoadSuccess:a[15]||(a[15]=e=>t.$emit("onImageLoadSuccess",e.nativeEvent)),onOnImageLoadError:a[16]||(a[16]=e=>t.$emit("onImageLoadError",e.nativeEvent))},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["icon","image","imgUrl","localIcon","resName","resId","filePath","assetPath","packageName","fallbackIcon","iconScaleType","iconCornerRadius","variant","banner","title","appLabel","rating","price","installState","progress","appTag","buttonText","aspectRatio","cornerRadius","span","state","placeholderColor","loadingDelayMs","focusable","focusScale","focusBorder","focusGlow","clickPayload","focusPayload","actionPayload"]))}}),zt=k.defineComponent({inheritAttrs:!1,__name:"QtxAppIcon",props:{icon:{},image:{},imgUrl:{},localIcon:{},resName:{},resId:{},filePath:{},assetPath:{},packageName:{},fallbackIcon:{},iconScaleType:{},iconCornerRadius:{},variant:{},banner:{},title:{},appLabel:{},rating:{},price:{},installState:{},progress:{},appTag:{},buttonText:{},aspectRatio:{},cornerRadius:{},span:{},state:{},placeholderColor:{},loadingDelayMs:{},focusable:{type:Boolean},focusScale:{},focusBorder:{type:Boolean},focusGlow:{type:Boolean},clickPayload:{},focusPayload:{},actionPayload:{},width:{},height:{}},emits:["click","focus","blur","longClick","iconResolved","iconLoadError","installStateChange","progressChange","bannerAction","variantChange","stateChange","bind","recycle","patch","imageLoadStart","imageLoadSuccess","imageLoadError"],setup(e,{expose:t,emit:o}){const n=e,a=o,i=k.ref(null),l=k.useAttrs(),r=k.computed(()=>{const e={};void 0!==n.width&&(e.width="number"==typeof n.width?`${n.width}px`:n.width),void 0!==n.height&&(e.height="number"==typeof n.height?`${n.height}px`:n.height);const t=l.style||{};return{...e,..."object"==typeof t?t:{}}});return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=i.value)?void 0:e.getNativeNode)?void 0:t.call(e))||i.value},setAppIcon:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"setAppIcon",[e])},setLocalIcon:(e,t)=>{var o,n;const a=(null==(n=null==(o=i.value)?void 0:o.getNativeNode)?void 0:n.call(o))||i.value;a&&S.Native.callUIFunction(a,"setLocalIcon",[e,t])},setIconUrl:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"setIconUrl",[e])},setVariant:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"setVariant",[e])},setBannerData:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"setBannerData",[e])},setInstallState:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"setInstallState",[e])},setProgress:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"setProgress",[e])},setRatingAndPrice:(e,t)=>{var o,n;const a=(null==(n=null==(o=i.value)?void 0:o.getNativeNode)?void 0:n.call(o))||i.value;a&&S.Native.callUIFunction(a,"setRatingAndPrice",[e,t])},setLabel:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"setLabel",[e])},applyPatch:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"applyPatch",[e])},clearIconCache:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"clearIconCache",[e])},requestFocus:()=>new Promise(e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;if(!n)return void e("");let a=!1;const l=t=>{a||(a=!0,e(String(t??"")))};setTimeout(()=>l(""),1200),S.Native.callUIFunction(n,"requestFocus",[],l)}),clear:()=>{var e,t;const o=(null==(t=null==(e=i.value)?void 0:e.getNativeNode)?void 0:t.call(e))||i.value;o&&S.Native.callUIFunction(o,"clear",[])},recycle:()=>{var e,t;const o=(null==(t=null==(e=i.value)?void 0:e.getNativeNode)?void 0:t.call(e))||i.value;o&&S.Native.callUIFunction(o,"recycle",[])},getState:()=>new Promise(e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;if(!n)return void e({});let a=!1;const l=t=>{a||(a=!0,e(t||{}))};setTimeout(()=>l({}),1200),S.Native.callUIFunction(n,"getState",[],l)}),cancelImageLoad:()=>{var e,t;const o=(null==(t=null==(e=i.value)?void 0:e.getNativeNode)?void 0:t.call(e))||i.value;o&&S.Native.callUIFunction(o,"cancelImageLoad",[])}}),(t,o)=>(k.openBlock(),k.createBlock(Gt,k.mergeProps({ref_key:"baseRef",ref:i},{...k.unref(l),...n},{width:e.width,height:e.height,style:r.value,onOnClick:o[0]||(o[0]=e=>a("click",e)),onOnFocus:o[1]||(o[1]=e=>a("focus",e)),onOnBlur:o[2]||(o[2]=e=>a("blur",e)),onOnLongClick:o[3]||(o[3]=e=>a("longClick",e)),onOnIconResolved:o[4]||(o[4]=e=>a("iconResolved",e)),onOnIconLoadError:o[5]||(o[5]=e=>a("iconLoadError",e)),onOnInstallStateChange:o[6]||(o[6]=e=>a("installStateChange",e)),onOnProgressChange:o[7]||(o[7]=e=>a("progressChange",e)),onOnBannerAction:o[8]||(o[8]=e=>a("bannerAction",e)),onOnVariantChange:o[9]||(o[9]=e=>a("variantChange",e)),onOnStateChange:o[10]||(o[10]=e=>a("stateChange",e)),onOnBind:o[11]||(o[11]=e=>a("bind",e)),onOnRecycle:o[12]||(o[12]=e=>a("recycle",e)),onOnPatch:o[13]||(o[13]=e=>a("patch",e)),onOnImageLoadStart:o[14]||(o[14]=e=>a("imageLoadStart",e)),onOnImageLoadSuccess:o[15]||(o[15]=e=>a("imageLoadSuccess",e)),onOnImageLoadError:o[16]||(o[16]=e=>a("imageLoadError",e))}),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["width","height","style"]))}});let Vt;try{const e=require("@extscreen/es3-vue");Vt=e.registerElement||(null==(y=e.default)?void 0:y.registerElement)}catch(Mo){}const jt={install:e=>{if(!globalThis.__QtxAppIcon_registered)if(Vt){const e=e=>{Vt(e,{component:{name:"QtxAppIcon",eventNamesMap:new Map([["onClick","onClick"],["onFocus","onFocus"],["onBlur","onBlur"],["onLongClick","onLongClick"],["onIconResolved","onIconResolved"],["onIconLoadError","onIconLoadError"],["onInstallStateChange","onInstallStateChange"],["onProgressChange","onProgressChange"],["onBannerAction","onBannerAction"],["onVariantChange","onVariantChange"],["onStateChange","onStateChange"],["onBind","onBind"],["onRecycle","onRecycle"],["onPatch","onPatch"],["onImageLoadStart","onImageLoadStart"],["onImageLoadSuccess","onImageLoadSuccess"],["onImageLoadError","onImageLoadError"]]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-app-icon"),e("QtxAppIcon"),globalThis.__QtxAppIcon_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxAppIcon",zt),e.component("qtx-app-icon",zt)}},Kt=k.defineComponent({inheritAttrs:!1,__name:"QtxChannelNavBase",props:{items:{},active:{},orientation:{},itemWidth:{},itemHeight:{},gap:{},paddingLeft:{},paddingTop:{},paddingRight:{},paddingBottom:{},reverseLayout:{type:Boolean},iconPosition:{},itemPadding:{},iconMargin:{},focusedKey:{},gravity:{},align:{},crossAlign:{},fontSize:{},borderRadius:{},iconSize:{},focusBorderWidth:{},normalBg:{},normalText:{},focusBg:{},focusText:{},focusBorderColor:{},selectedBg:{},selectedText:{},disabledBg:{},disabledText:{},indicator:{},indicatorColor:{},indicatorSize:{},badgeBg:{},badgeText:{},scrollMode:{},smoothScroll:{type:Boolean},focusable:{type:Boolean},selectOnFocus:{type:Boolean},focusMemory:{type:Boolean},defaultFocusKey:{},maxPoolSize:{}},emits:["onChange","onFocus","onBlur","onLongClick","onScroll"],setup(e,{expose:t}){const o=k.ref(),n=To("qtx-channel-nav");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value},setActive:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setActive",e)},getActiveKey:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"getActiveKey",e)},getFocusedKey:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"getFocusedKey",e)},requestFocus:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"requestFocus",e)},clearFocus:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"clearFocus",e)},getState:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"getState",e)},scrollToKey:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"scrollToKey",e)},updateItems:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"updateItems",e)},setOrientation:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setOrientation",e)},setStyle:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setStyle",e)},getItemCount:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"getItemCount",e)},getItemAt:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"getItemAt",e)},getScrollState:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"getScrollState",e)}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,items:e.items,active:e.active||"",orientation:e.orientation||"",itemWidth:e.itemWidth,itemHeight:e.itemHeight,gap:e.gap,paddingLeft:e.paddingLeft,paddingTop:e.paddingTop,paddingRight:e.paddingRight,paddingBottom:e.paddingBottom,reverseLayout:e.reverseLayout,iconPosition:e.iconPosition||"",itemPadding:e.itemPadding,iconMargin:e.iconMargin,focusedKey:e.focusedKey||"",gravity:e.gravity||"",align:e.align||"",crossAlign:e.crossAlign||"",fontSize:e.fontSize,borderRadius:e.borderRadius,iconSize:e.iconSize,focusBorderWidth:e.focusBorderWidth,normalBg:e.normalBg||"",normalText:e.normalText||"",focusBg:e.focusBg||"",focusText:e.focusText||"",focusBorderColor:e.focusBorderColor||"",selectedBg:e.selectedBg||"",selectedText:e.selectedText||"",disabledBg:e.disabledBg||"",disabledText:e.disabledText||"",indicator:e.indicator||"",indicatorColor:e.indicatorColor||"",indicatorSize:e.indicatorSize,badgeBg:e.badgeBg||"",badgeText:e.badgeText||"",scrollMode:e.scrollMode||"",smoothScroll:e.smoothScroll,focusable:e.focusable,selectOnFocus:e.selectOnFocus,focusMemory:e.focusMemory,defaultFocusKey:e.defaultFocusKey||"",maxPoolSize:e.maxPoolSize,onOnChange:a[0]||(a[0]=e=>t.$emit("onChange",e.nativeEvent)),onOnFocus:a[1]||(a[1]=e=>t.$emit("onFocus",e.nativeEvent)),onOnBlur:a[2]||(a[2]=e=>t.$emit("onBlur",e.nativeEvent)),onOnLongClick:a[3]||(a[3]=e=>t.$emit("onLongClick",e.nativeEvent)),onOnScroll:a[4]||(a[4]=e=>t.$emit("onScroll",e.nativeEvent))},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["items","active","orientation","itemWidth","itemHeight","gap","paddingLeft","paddingTop","paddingRight","paddingBottom","reverseLayout","iconPosition","itemPadding","iconMargin","focusedKey","gravity","align","crossAlign","fontSize","borderRadius","iconSize","focusBorderWidth","normalBg","normalText","focusBg","focusText","focusBorderColor","selectedBg","selectedText","disabledBg","disabledText","indicator","indicatorColor","indicatorSize","badgeBg","badgeText","scrollMode","smoothScroll","focusable","selectOnFocus","focusMemory","defaultFocusKey","maxPoolSize"]))}}),Wt=k.defineComponent({name:"QtxChannelNav",inheritAttrs:!1,props:{items:{},active:{},orientation:{},itemWidth:{},itemHeight:{},gap:{},itemPadding:{},iconMargin:{},focusedKey:{},paddingLeft:{},paddingTop:{},paddingRight:{},paddingBottom:{},reverseLayout:{type:Boolean},iconPosition:{},gravity:{},align:{},crossAlign:{},width:{},height:{},fontSize:{},borderRadius:{},iconSize:{},focusBorderWidth:{},normalBg:{},normalText:{},focusBg:{},focusText:{},focusBorderColor:{},selectedBg:{},selectedText:{},disabledBg:{},disabledText:{},indicator:{},indicatorColor:{},indicatorSize:{},badgeBg:{},badgeText:{},scrollMode:{},smoothScroll:{type:Boolean},focusable:{type:Boolean},selectOnFocus:{type:Boolean},linkId:{},focusMemory:{type:Boolean},defaultFocusKey:{},initialActiveKey:{},initialFocusKey:{},disableBackToInitial:{type:Boolean},maxPoolSize:{}},emits:["change","update:active","focus","blur","longClick","scroll"],setup(e,{expose:t,emit:o}){const n=e,a=k.useAttrs(),i=k.ref(null);let l=n.active||"",r=n.initialActiveKey||n.active||"";k.watch(()=>n.active,e=>{const t=e||"";t&&(l=t),!r&&t&&(r=t)});const s=o,c=k.computed(()=>{const e="number"==typeof n.width?`${n.width}px`:n.width,t="number"==typeof n.height?`${n.height}px`:n.height,o=a.style||{};return"string"==typeof o?`${o};width:${e||"100%"};height:${t||"auto"}`:{...o,width:e||"100%",height:t||"auto"}});function u(e){var t;return null==e?"":"string"==typeof e?e:String(e.key??(null==(t=e.nativeEvent)?void 0:t.key)??"")}function d(e){return null==e||"string"==typeof e?{key:u(e),position:-1}:{key:String(e.key??""),position:Number(e.position??-1),previous:null==e.previous?void 0:String(e.previous),source:null==e.source?void 0:String(e.source),item:e.item}}function p(e){const t=u(e);t&&(l=t),s("change",t,d(e)),s("update:active",t),t&&S.Native.callUIFunction(h(),"setActiveSilent",[t])}function v(e){s("focus",u(e),d(e))}function f(e){s("blur",u(e),d(e))}function g(e){s("longClick",u(e),d(e))}function m(e){s("scroll",{first:Number((null==e?void 0:e.first)??-1),last:Number((null==e?void 0:e.last)??-1)})}function h(){var e,t;return(null==(t=null==(e=i.value)?void 0:e.getNativeNode)?void 0:t.call(e))||i.value}function y(e,t){const o=h();o&&S.Native.callUIFunction(o,e,t)}function x(e,t,o){return new Promise(n=>{const a=h();if(!a)return void n(o);let i=!1;const l=e=>{i||(i=!0,n(e??o))};setTimeout(()=>l(o),1200),S.Native.callUIFunction(a,e,t,l)})}const b={active:"",focused:"",orientation:"horizontal",count:0,generation:0,scrollMode:"center",iconPosition:"left",indicator:"none",reverseLayout:!1,selectOnFocus:!1,focusMemory:!0,focusable:!0,smoothScroll:!0,poolSize:16,itemWidth:160,itemHeight:72,itemPadding:16,iconMargin:12,align:"start",crossAlign:"start",alignLeading:0,alignBetween:0,alignCross:0};return t({getNativeNode:()=>h(),setActive(e){y("setActive",[e])},getActiveKey:()=>x("getActiveKey",[],""),getInitialActiveKey:()=>x("getInitialActiveKey",[],""),handleBack:function(){if(n.disableBackToInitial)return!1;const e=n.initialActiveKey||r;return!(!e||l===e)&&(y("setActive",[e,"back"]),!0)},getFocusedKey:()=>x("getFocusedKey",[],""),requestFocus:()=>x("requestFocus",[],""),clearFocus:()=>x("clearFocus",[],""),getState:()=>x("getState",[],b),scrollToKey:e=>x("scrollToKey",[e],""),updateItems:e=>x("updateItems",[e],""),setOrientation:e=>x("setOrientation",[e],""),setStyle:e=>x("setStyle",[e],""),getItemCount:()=>x("getItemCount",[],0),getItemAt:e=>x("getItemAt",[e],{key:"",label:""}),getScrollState:()=>x("getScrollState",[],b)}),(t,o)=>(k.openBlock(),k.createBlock(Kt,k.mergeProps({ref_key:"baseRef",ref:i},{...k.unref(a),...n},{width:e.width,height:e.height,style:c.value,onOnChange:p,onOnFocus:v,onOnBlur:f,onOnLongClick:g,onOnScroll:m}),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["width","height","style"]))}});let Ht;try{const e=require("@extscreen/es3-vue");Ht=e.registerElement||(null==(x=e.default)?void 0:x.registerElement)}catch(Mo){}const Jt={install:e=>{if(!globalThis.__QtxChannelNav_registered)if(Ht){const e=e=>{Ht(e,{component:{name:"QtxChannelNav",eventNamesMap:new Map([["onChange","onChange"],["onFocus","onFocus"],["onBlur","onBlur"],["onLongClick","onLongClick"],["onScroll","onScroll"]]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-channel-nav"),e("QtxChannelNav"),globalThis.__QtxChannelNav_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxChannelNav",Wt),e.component("qtx-channel-nav",Wt)}},Yt="1.28.0";class Xt extends Error{constructor(e,t,o,n="core"){super(`[qtx] ${t}`),I(this,"code"),I(this,"capability"),I(this,"detail"),this.name="QtxInstallError",this.code=e,this.capability=n,this.detail=o}}const Zt=["version","env","config","list","core"];function eo(e){const t=(e||"").split(/[.\-+]/).slice(0,3).map(e=>parseInt(e,10)||0);for(;t.length<3;)t.push(0);return 1e6*t[0]+1e3*t[1]+t[2]}function to(e,t){return eo(e)>=eo(t)}async function oo(e,t=3e3){try{const o=await Promise.race([S.Native.callNativeWithPromise(e,"getVersionInfo"),new Promise((e,o)=>setTimeout(()=>o(new Error("probe timeout")),t))]);return o&&"object"==typeof o&&(o.pluginVersion||o.protocolVersion)?{pluginVersion:String(o.pluginVersion||o.protocolVersion||""),protocolVersion:o.protocolVersion?String(o.protocolVersion):void 0,components:o.components||void 0,mode:"plugin"===o.mode?"plugin":"embedded"}:null}catch(Mo){return null}}const no="onESPluginStateChanged";function ao(e,t){return new Promise((o,n)=>{const a=S.EventBus,i=S.Native;let l,r=!1;function s(e){r||(r=!0,function(){l&&clearTimeout(l);try{a.$off(no,c)}catch(Mo){}}(),e())}function c(t){t&&t.pkg===e.pkg&&(!1!==t.success?1002!==t.status&&s(()=>o()):s(()=>n(new Xt("INSTALL_FAILED","core"===e.ns?`插件安装失败 status=${t.status} msg=${t.msg??""}`:`能力 ${e.ns} 插件安装失败(pkg=${e.pkg})status=${t.status} msg=${t.msg??""}`,void 0,e.ns))))}try{a.$on(no,c)}catch(Mo){return void n(new Xt("INSTALL_FAILED","core"===e.ns?"无法订阅宿主插件状态事件(EventBus 不可用)":`能力 ${e.ns} 无法订阅宿主插件状态事件(EventBus 不可用)`,void 0,e.ns))}l=setTimeout(()=>{oo(e.versionModule).then(a=>{a&&"plugin"===a.mode?s(()=>o()):s(()=>n(new Xt("TIMEOUT","core"===e.ns?`插件安装超时(${t}ms)`:`能力 ${e.ns} 插件安装超时(${t}ms,pkg=${e.pkg})`,void 0,e.ns)))})},t);try{i.callNative("ESPluginModule","install",[{pkg:e.pkg}])}catch(Mo){s(()=>n(new Xt("INSTALL_FAILED",`插件安装指令下发失败:${Mo instanceof Error?Mo.message:String(Mo)}`,void 0,e.ns)))}})}async function io(e){try{await Promise.race([S.Native.callNativeWithPromise("EsNativeModule","callReflect",{entry:{from:`${e.pkg}.QtxPluginApp`,method:"setup"}}),new Promise(e=>setTimeout(e,3e3))])}catch(Mo){console.warn("[qtx] callReflect init skipped:",Mo)}}const lo=[{ns:"core",pkg:"com.quicktvui.plugin.qtx",module:"QtxPluginApp",versionModule:"QtxVersionModule",minVersion:""},{ns:"version",pkg:"com.quicktvui.plugin.qtx",module:"QtxVersionModule",versionModule:"QtxVersionModule",minVersion:""},{ns:"env",pkg:"com.quicktvui.plugin.qtx",module:"AddonEnvModule",versionModule:"QtxVersionModule",minVersion:""},{ns:"config.gridTabs",pkg:"com.quicktvui.plugin.qtx",module:"GridTabsConfigModule",versionModule:"QtxVersionModule",minVersion:""},{ns:"config.extraUI",pkg:"com.quicktvui.plugin.qtx",module:"ExtraUIConfigModule",versionModule:"QtxVersionModule",minVersion:""}],ro=new Map;function so(e){ro.set(e.ns,e)}for(const Uo of lo)so(Uo);const co=ro,uo=/^[a-z][a-z0-9]*(?:\.[a-z][a-z0-9]*)*$/;function po(e){if(!e||"string"!=typeof e.ns||!uo.test(e.ns))throw new Error(`[qtx] 非法能力命名空间 ns=${e&&e.ns}(应为小写点分单词,如 'file')`);const t=e.ns.split(".")[0];if(Zt.indexOf(t)>=0)throw new Error(`[qtx] 命名空间 qtx.${e.ns} 的根段 "${t}" 已保留(${Zt.join("/")}),能力域不得占用`);if(ro.has(e.ns))throw new Error(`[qtx] 能力命名空间 qtx.${e.ns} 已注册(pkg=${ro.get(e.ns).pkg})`);if(!e.pkg||!e.module||!e.versionModule)throw new Error(`[qtx] 能力 qtx.${e.ns} 注册缺少 pkg/module/versionModule 字段`);if(!e.minVersion)throw new Error(`[qtx] 能力 qtx.${e.ns} 的 minVersion 必须由 qtx-cli generate 写入字面量(与类型同源,禁止手改)`);return ro.set(e.ns,e),e}const vo=new Map,fo=new Map;function go(e,t){const o=fo.get(e);if(o)return Promise.resolve(o);let n=vo.get(e);if(!n){const o=ro.get(e);if(!o)return Promise.reject(new Xt("UNKNOWN_CAPABILITY",`未注册的能力命名空间 qtx.${e}(已注册:${Array.from(ro.keys()).map(e=>`qtx.${e}`).join(", ")})`,void 0,e));n=async function(e,t){const o="core"===e.ns,n=t.minVersion||e.minVersion||"0.9.0-alpha.5",a=o?t.minProtocolVersion||Yt:void 0,i=t.upgrade||"auto",l=t.timeout||8e3;let r=await oo(e.versionModule);if(r||(await new Promise(e=>setTimeout(e,800)),r=await oo(e.versionModule)),!r&&("auto"===i&&(await ao(e,l),await io(e),r=await oo(e.versionModule)),!r))throw new Xt("PROBE_FAILED",o?`插件未安装且未自动安装(upgrade=${i})。请安装 plugin-qtx(${e.pkg})或改用内嵌 AAR(com.quicktvui:qtx)`:`能力 ${e.ns} 的插件未安装且未自动安装(upgrade=${i},pkg=${e.pkg},版本模块=${e.versionModule},要求 >= ${n})`,{minPluginVersion:n,minProtocolVersion:a},e.ns);if("embedded"===r.mode)return r;const s=to(r.pluginVersion,n),c=!o||to(r.protocolVersion||"",a||"0.0.0");if(!s||!c){if("auto"===i){await ao(e,l),await io(e);const t=await oo(e.versionModule);t&&(r=t)}if(!to(r.pluginVersion,n))throw new Xt("VERSION_TOO_LOW",o?`插件版本过低:plugin=${r.pluginVersion},本库要求 >= ${n}。请升级 plugin-qtx`:`能力 ${e.ns} 插件版本过低:plugin=${r.pluginVersion},本库要求 >= ${n}(pkg=${e.pkg})。请升级对应能力插件`,{...r,minPluginVersion:n,minProtocolVersion:a},e.ns);if(o&&!to(r.protocolVersion||"",a||"0.0.0"))throw new Xt("PROTOCOL_MISMATCH",`指令协议不兼容:插件 protocol=${r.protocolVersion},本库要求 >= ${a}(plugin=${r.pluginVersion})。请升级 plugin-qtx 或降级 @quicktvui/qtx`,{...r,minPluginVersion:n,minProtocolVersion:a},e.ns)}return r}(o,t||{}).then(t=>(fo.set(e,t),t),t=>{throw vo.delete(e),t}),vo.set(e,n)}return n}function mo(e){return fo.get(e)||null}const ho=new Set(["then","catch","finally","toJSON","constructor","prototype","__proto__","valueOf","toString","toLocaleString","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","inspect","nodeType","tagName","name","length","caller","arguments"]),yo=new Set(["ready","preheat","getInfo"]);function xo(e){return null!==e&&"object"==typeof e?JSON.stringify(e):e}function bo(e){const t=new Map,o={ready:()=>go(e),preheat:()=>go(e).then(()=>{}),getInfo:()=>mo(e)};return new Proxy({},{get(n,a,i){if("symbol"!=typeof a){if(yo.has(a))return o[a];if(!ho.has(a))return(o=>{let n=t.get(o);return n||(n=(...t)=>{const n=ro.get(e);return n?go(e).then(()=>S.Native.callNativeWithPromise(n.module,o,...t.map(xo))):Promise.reject(new Xt("UNKNOWN_CAPABILITY",`未注册的能力命名空间 qtx.${e}`,void 0,e))},t.set(o,n)),n})(a)}},has:(e,t)=>"string"==typeof t&&!ho.has(t)})}function Co(e){return!!e&&"object"==typeof e}function Io(e){for(const t of Array.from(ro.keys())){if("core"===t)continue;const o=t.split(".");let n=e;for(let e=0;e<o.length-1;e++){const t=o[e];Object.prototype.hasOwnProperty.call(n,t)&&Co(n[t])||(n[t]={}),n=n[t]}const a=o[o.length-1];Object.prototype.hasOwnProperty.call(n,a)||Object.defineProperty(n,a,{configurable:!0,enumerable:!0,get:()=>bo(t)})}}function ko(e){return{pluginVersion:e.pluginVersion,protocolVersion:e.protocolVersion||"",components:e.components||{},mode:e.mode}}function So(e){return go("core",function(e){return{minVersion:null==e?void 0:e.minPluginVersion,minProtocolVersion:null==e?void 0:e.minProtocolVersion,upgrade:null==e?void 0:e.upgrade,timeout:null==e?void 0:e.timeout}}(e)).then(ko)}function No(e){return So(e)}const _o=[300,800,1600,3e3];function To(e){return k.defineComponent({name:`${e}Gate`,inheritAttrs:!1,setup(t,{slots:o,attrs:n,expose:a}){const i=k.ref("loading"),l=k.ref(""),r=k.ref(null);let s,c=0;const u=()=>{void 0!==s&&(clearTimeout(s),s=void 0)},d=(t=!1)=>{t&&(u(),c=0),i.value="loading",l.value="",No().then(()=>{i.value="ready"}).catch(t=>{if(c<_o.length){const t=_o[c];return c+=1,console.warn(`[QTX-GATE] ${e} bootstrap failed, retry ${c}/${_o.length} in ${t}ms`),void(s=setTimeout(()=>d(),t))}i.value="error",l.value=t instanceof Error?t.message:String(t)})};return k.onMounted(()=>d(!0)),k.onUnmounted(u),a({getNativeNode:()=>r.value}),()=>"ready"===i.value?k.h(e,{ref:r,...n},o):"error"===i.value?k.h("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"8px",backgroundColor:"#2B2B2B",borderRadius:"4px",width:"100%",height:"100%"},onClick:()=>d(!0)},[k.h("qt-text",{text:`${l.value}(点击重试)`,style:{fontSize:"14px",color:"#FF6B6B",textAlign:"center"}})]):k.h("div",{style:{width:"100%",height:"100%",backgroundColor:"#2E2E2E",borderRadius:"4px"},...n},[])}})}const wo=bo("config.gridTabs"),Po=bo("config.extraUI");async function Bo(e){try{const t=await wo.setDefaultConfig(e);return!(!t||!t.success)}catch(t){return console.error("[qtx] Failed to initialize GridTabs global config:",t),!1}}async function Eo(e){try{const t=await Po.setThemeConfig(e);return!(!t||!t.success)}catch(t){return console.error("[qtx] Failed to initialize ExtraUI global theme:",t),!1}}const Fo="com.quicktvui.qtx.list.QtxListCommandHub";let qo=null;const $o=[];function Oo(e){if(qo=e,null!=e&&$o.length>0){const e=$o.splice(0);for(const{key:t,nodeId:o}of e)Ao(t,o)}}async function Ao(e,t){if(null==qo)return $o.some(o=>o.key===e&&o.nodeId===t)||$o.push({key:e,nodeId:t}),console.warn("[qtx-portal] registerPortalLive: 列表 viewId 未就绪,挂起 key="+e),!1;try{const o=await S.Native.callNativeWithPromise("EsNativeModule","callReflect",{entry:{from:Fo,method:"registerPortal",params:[qo,e,String(t)]}});return("string"==typeof o?o:String((o&&(o.result??o.data))??JSON.stringify(o))).includes("OK")}catch(Mo){return console.warn("[qtx-portal] registerPortalLive failed:",Mo),!1}}const Lo={mounted(e,t){const o=t.value,n=function(e){if(null==e)return null;if("number"==typeof e.nodeId)return e.nodeId;if(null!=e.$el&&"number"==typeof e.$el.nodeId)return e.$el.nodeId;if("function"==typeof e.getNativeNode)try{const t=e.getNativeNode();if(t&&"number"==typeof t.nodeId)return t.nodeId}catch(Mo){}return null}(e);null!=o&&null!=n?(e.__qtxPortalKey=o,Ao(String(o),n)):console.warn("[qtx-portal] v-portal-to 无法捕获 nodeId, key=",o,e)},unmounted(e){delete e.__qtxPortalKey}};let Qo;po({ns:"file",pkg:"com.quicktvui.plugin.qtx.file",module:"QtxFileModule",versionModule:"QtxFileVersionModule",minVersion:"0.1.0"}),bo("file");try{const e=require("@extscreen/es3-vue");Qo=e.registerElement||(null==(b=e.default)?void 0:b.registerElement)}catch(Mo){}const Ro={version:bo("version"),env:bo("env"),config:{gridTabs:bo("config.gridTabs"),extraUI:bo("config.extraUI")},install:e=>{e.directive("portal-to",Lo),!globalThis.__QtxRelocatePool_registered&&Qo&&(Qo("qtx-relocate-pool",{component:{name:"QtxRelocatePool",processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}}),globalThis.__QtxRelocatePool_registered=!0);try{const e="undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:{};!e.__QTX_STYLE_SNAPSHOT__&&Array.isArray(e.__HIPPY_VUE_STYLES__)&&(e.__QTX_STYLE_SNAPSHOT__=e.__HIPPY_VUE_STYLES__.slice())}catch(Mo){}e.use(w),e.use(Oe),e.use(Qe),e.use(Ue),e.use(ze),e.use(Ke),e.use(Je),e.use(et),e.use(nt),e.use(lt),e.use(st),e.use(dt),e.use(vt),e.use(ht),e.use(Ct),e.use(Nt),e.use(wt),e.use(Et),e.use(qt),e.use(Qt),e.use(Dt),e.use(jt),e.use(Jt),So().catch(e=>{console.error(e instanceof Error?e.message:e)})}};Io(Ro),exports.CAPABILITIES=co,exports.QTX_CHANNEL_NAV_EVENTS=["change","update:active","focus","blur","longClick","scroll"],exports.QTX_LIST_EVENTS=["item-click","item-focus","item-bind","item-unbind","load-more"],exports.QtxAppIcon=zt,exports.QtxAppIconPlugin=jt,exports.QtxButton=Xe,exports.QtxButtonPlugin=et,exports.QtxChannelNav=Wt,exports.QtxChannelNavPlugin=Jt,exports.QtxCheckbox=tt,exports.QtxCheckboxGroup=rt,exports.QtxCheckboxGroupPlugin=st,exports.QtxCheckboxPlugin=nt,exports.QtxCollapseMenuGroup=gt,exports.QtxCollapseMenuGroupPlugin=ht,exports.QtxCollapseMenuList=xt,exports.QtxCollapseMenuListPlugin=Ct,exports.QtxDatePicker=_t,exports.QtxDatePickerPlugin=wt,exports.QtxGridTabs=_,exports.QtxGridTabsPlugin=w,exports.QtxHsvBackground=Ve,exports.QtxHsvBackgroundPlugin=Ke,exports.QtxInputView=kt,exports.QtxInputViewPlugin=Nt,exports.QtxInstallError=Xt,exports.QtxKeyboard=qe,exports.QtxKeyboardPlugin=Oe,exports.QtxList=Be,exports.QtxListPlugin=qt,exports.QtxNumericKeyboard=Ae,exports.QtxNumericKeyboardPlugin=Qe,exports.QtxPortalItem=De,exports.QtxPortalItemPlugin=ze,exports.QtxPortalPool=Re,exports.QtxPortalPoolPlugin=Ue,exports.QtxPoster=Mt,exports.QtxPosterPlugin=Dt,exports.QtxRadioGroup=it,exports.QtxRadioGroupPlugin=lt,exports.QtxRatingBar=Pt,exports.QtxRatingBarPlugin=Et,exports.QtxSettingSwitch=pt,exports.QtxSettingSwitchPlugin=vt,exports.QtxStyledList=Fe,exports.QtxSvgImage=We,exports.QtxSvgImagePlugin=Je,exports.QtxSwitcher=ct,exports.QtxSwitcherPlugin=dt,exports.QtxTabContent=Ot,exports.QtxTabs=$t,exports.QtxTabsPlugin=Qt,exports.RESERVED_NAMESPACE_ROOTS=Zt,exports.attachCapabilityNamespaces=Io,exports.captureItemTemplate=ie,exports.compactStylePack=Ce,exports.createQtxGate=To,exports.default=Ro,exports.defineCapability=bo,exports.ensureCapability=go,exports.ensureQtxReady=No,exports.getCapabilityInfo=mo,exports.getCapabilitySpec=function(e){return ro.get(e)||null},exports.getPortalListViewId=function(){return qo},exports.getQtxReadyInfo=function(){const e=mo("core");return e?ko(e):null},exports.getStylePack=ke,exports.glintStylePack=xe,exports.initExtraUIGlobalTheme=Eo,exports.initGlobalTheme=async function(e){const t=await Eo(e),o=await Bo({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 t&&o},exports.initGridTabsGlobalConfig=Bo,exports.installQtx=So,exports.isKnownPresetViewType=Ne,exports.isVersionAtLeast=function(e,t){return to(e,t)},exports.listPresetViewTypes=Se,exports.listStylePacks=function(){return[...Ie.values()]},exports.presetItem=_e,exports.qtx=Ro,exports.registerCapability=po,exports.registerPortalLive=Ao,exports.registerStylePack=function(e){if(!e||!e.id||!e.itemTypes)throw new Error("[qtx] 风格包必须包含 id 与 itemTypes");Ie.set(e.id,{...e,rendering:e.rendering||"native"})},exports.resolvePresetViewType=we,exports.setPortalListViewId=Oo,exports.styledRows=Te,exports.useGridTabs=function(e,t){const o=k.ref(""),n=t?JSON.parse(JSON.stringify(t)):{},a=k.shallowRef([]),i=k.shallowRef([]);let l=!1,r=!1;const s="__virtual_single_tab__";let c="",u=!1;const d=k.ref({}),p=t=>{const o=Array.isArray(t)?t:[t];if(r&&e.value){if("function"==typeof e.value.dispatchAction)return void e.value.dispatchAction(o);let t=e.value;"function"==typeof e.value.getNativeNode?t=e.value.getNativeNode()||e.value:e.value.nativeRef&&(t=e.value.nativeRef),t?S.Native.callUIFunction(t,"dispatchAction",[JSON.stringify(o)]):console.warn("[useGridTabs] Native target is null or undefined, cannot call dispatchAction")}},v=(e,t)=>{if(!e)return!1;let o=!0;return e.id||(console.error(`[useGridTabs] ❌ 数据格式错误 (${t}): 卡片缺失必填字段 'id'。每个卡片必须有唯一标识才能进行后续更新!`,e),o=!1),e.viewType||(console.error(`[useGridTabs] ❌ 数据格式错误 (${t}): 卡片缺失必填字段 'viewType' (id: ${e.id||"未知"})。必须指定 Native 注册的视图类型或 Portal 标识!`,e),o=!1),o},f=(e,t)=>{if(!e||0===e.length)return;g.clear();const o=e[0].hasOwnProperty("tabId")||e[0].hasOwnProperty("items")&&Array.isArray(e[0].items);l="1d"===t,"1d"===t&&o?console.error("[useGridTabs] ❌ 赋值错误: 你正在向 `items.value` (一维瀑布流) 赋值二维 Tabs 数据结构!请改用 `tabs.value = ...`"):"2d"!==t||o||console.error("[useGridTabs] ❌ 赋值错误: 你正在向 `tabs.value` (二维导航) 赋值一维卡片列表数据结构!请改用 `items.value = ...`"),"1d"===t?e.forEach((e,t)=>v(e,`items.value[${t}]`)):e.forEach((e,t)=>{((e,t)=>{if(!e)return!1;let o=!0;e.tabId||(console.error(`[useGridTabs] ❌ 数据格式错误 (${t}): Tab 缺失必填字段 'tabId'。每个 Tab 必须有唯一标识!`,e),o=!1),void 0!==e.title&&null!==e.title||console.warn(`[useGridTabs] ⚠️ 数据格式警告 (${t}): Tab 缺失 'title' 字段 (tabId: ${e.tabId||"未知"}),导航栏可能显示为空。`,e)})(e,`tabs.value[${t}]`),e.items&&Array.isArray(e.items)&&e.items.forEach((e,o)=>v(e,`tabs.value[${t}].items[${o}]`))}),r=!0,m()},g=new Set,m=(e="unknown")=>{if(!r)return void console.warn("[useGridTabs] triggerRootUpdate skipped because isInitialized is false");let t={protocolVersion:"1.28.0",gridBasis:(null==n?void 0:n.gridBasis)??30,unitType:(null==n?void 0:n.unitType)??"px",contentConfig:(null==n?void 0:n.contentConfig)??(null==n?void 0:n.layoutConfig)??{box:{padding:[0,60,60,60]},navContentGapNormal:0,itemGap:24},navConfig:(null==n?void 0:n.navConfig)??{dock:"left",mode:"fixed",renderType:"smart-hybrid",box:{size:[200,0]},expandedBox:{size:[300,0]}},cacheConfig:(null==n?void 0:n.cacheConfig)??{offscreenPageLimit:1,prefetchOffset:2,preLoadEnabled:!1,strategy:"data_priority"},animationConfig:(null==n?void 0:n.animationConfig)??{duration:300,easing:"ease-out"},interactionStrategy:(null==n?void 0:n.interactionStrategy)??{defaultFocus:"nav",interceptBack:!0,backMode:"home-first",autoScrollToTop:!0,edgeScrollProtection:.5},focusConfig:(null==n?void 0:n.focusConfig)??{boundaryLock:{left:!1,right:!1,top:!1,bottom:!1}},themeConfig:null==n?void 0:n.themeConfig,referenceResolution:(null==n?void 0:n.referenceResolution)??{w:1920,h:1080}},u=[];l?(t.navConfig={...t.navConfig,renderType:"none"},u=[{tabId:s,title:"Virtual Tab",hidden:!0,items:i.value}]):u=a.value;const d=JSON.stringify({page_spec:t,tabs:u});if(""===o.value)o.value=d,c=d;else{if(c===d)return;o.value=d,c=d,p({op:"RELOAD_TABS",payload:{pageSpec:t,page_spec:t,tabs:u}})}},h=e=>{if(!e||"object"!=typeof e)return e;if(e.__isGridTabsProxy)return e;e.content&&"object"==typeof e.content&&!e.content.__isGridTabsProxy&&(e.content=new Proxy(e.content,{set(t,o,n,a){const i=Reflect.set(t,o,n,a);return e.id&&r&&p({op:"UPDATE_ITEM",itemId:e.id,payload:e}),i}}),Object.defineProperty(e.content,"__isGridTabsProxy",{value:!0,enumerable:!1}),Object.defineProperty(e.content,"__v_skip",{value:!0,enumerable:!1})),e.subItems&&Array.isArray(e.subItems)&&!e.subItems.__isGridTabsProxy&&(e.subItems=y(e.subItems,e.id),Object.defineProperty(e.subItems,"__isGridTabsProxy",{value:!0,enumerable:!1}),Object.defineProperty(e.subItems,"__v_skip",{value:!0,enumerable:!1}));const t=new Proxy(e,{set(e,t,o,n){const a=Reflect.set(e,t,o,n);return e.id&&r&&!u&&p({op:"UPDATE_ITEM",itemId:e.id,payload:e}),a}});return Object.defineProperty(t,"__isGridTabsProxy",{value:!0,enumerable:!1}),Object.defineProperty(t,"__v_skip",{value:!0,enumerable:!1}),t},y=(e,t)=>{for(let o=0;o<e.length;o++)e[o]=h(e[o]);return new Proxy(e,{get:(e,o,n)=>"push"===o?(...o)=>{o.forEach((e,t)=>v(e,`push(${t})`)),r||console.error("[useGridTabs] ❌ 时机错误: 在底层还未完成初始化时调用了 push()。请先对 items.value 或 tabs.value 进行全量赋值!");const n=o.map(e=>h(e)),a=Array.prototype.push.apply(e,n);return u||p({op:"APPEND_SUB_ITEMS",itemId:t,payload:{subItems:n}}),a}:"unshift"===o?(...o)=>{o.forEach((e,t)=>v(e,`unshift(${t})`)),r||console.error("[useGridTabs] ❌ 时机错误: 在底层还未完成初始化时调用了 unshift()。请先对 items.value 或 tabs.value 进行全量赋值!");const n=o.map(e=>h(e)),a=Array.prototype.unshift.apply(e,n);return r&&n.length>0&&!u&&p({op:"PREPEND_SUB_ITEMS",itemId:t,payload:{subItems:n}}),a}:"splice"===o?(...o)=>{const n=o.length>=2&&0===o[0]&&o[1]===e.length,a=Array.prototype.splice.apply(e,o);return r&&n&&t!==s?u||p({op:"CLEAR_SUB_ITEMS",itemId:t}):r&&(u||m("items array spliced")),a}:Reflect.get(e,o,n),set(e,t,o,n){if("length"!==t&&!isNaN(Number(t))){r||console.error(`[useGridTabs] ❌ 时机错误: 在底层还未完成初始化时直接修改了索引 [${String(t)}]。请先对 items.value 或 tabs.value 进行全量赋值!`),v(o,`索引赋值 [${String(t)}]`);const a=h(o),i=Reflect.set(e,t,a,n);return a&&a.id&&!u&&p({op:"UPDATE_ITEM",itemId:a.id,payload:a}),i}return Reflect.set(e,t,o,n)}})},x=e=>(e.items&&Array.isArray(e.items)&&!e.items.__isGridTabsProxy&&(e.items=y(e.items,e.tabId),Object.defineProperty(e.items,"__isGridTabsProxy",{value:!0,enumerable:!1})),new Proxy(e,{set(e,t,o,n){if("items"===t){let a=o;Array.isArray(o)&&!o.__isGridTabsProxy&&(a=y(o,e.tabId),Object.defineProperty(a,"__isGridTabsProxy",{value:!0,enumerable:!1}));return Reflect.set(e,t,a,n)}if("loadState"===t){const a=Reflect.set(e,t,o,n);return r&&e.tabId&&!u&&p({op:"UPDATE_TAB_STATE",itemId:e.tabId,payload:{loadState:o}}),a}return Reflect.set(e,t,o,n)}}));k.watch(a,(e,t)=>{if(!e||0===e.length)return o.value="",c="",void(r=!1);if(e.__isGridTabsProxy)m();else{const t=(e=>{const t=e.map(e=>x(e));return new Proxy(t,{set(e,t,o,n){if("length"!==t&&!isNaN(Number(t))){let a=o;o.__isGridTabsProxy||(a=x(o),Object.defineProperty(a,"__isGridTabsProxy",{value:!0,enumerable:!1}));const i=Reflect.set(e,t,a,n);return m(),i}return Reflect.set(e,t,o,n)}})})(e);Object.defineProperty(t,"__isGridTabsProxy",{value:!0,enumerable:!1}),f(t,"2d"),a.value=t}},{flush:"sync",deep:!1}),k.watch(i,(e,t)=>{if(!e||0===e.length)return o.value="",c="",void(r=!1);if(e.__isGridTabsProxy)m();else{const t=y(e,s);Object.defineProperty(t,"__isGridTabsProxy",{value:!0,enumerable:!1}),f(t,"1d"),i.value=t}},{flush:"sync",deep:!1});const b={},C=k.computed(()=>({tabsData:o.value,onTabNeedsData:async(...e)=>{let t=e[0];if(t&&t.nativeEvent&&(t=t.nativeEvent),!d.value.onTabNeedsData)return;const{tabId:o,index:n,reason:i}=t;if(!g.has(o)){g.add(o);try{const e=await d.value.onTabNeedsData(o,n,i);if(e&&Array.isArray(e))if(b[o]=1,e.length>0){const t=a.value.find(e=>e.tabId===o);t&&(t.items?t.items.length>0&&t.items.splice(0,t.items.length):t.items=[],t.items.push(...e),t.loadState="ready",p({op:"UPDATE_TAB_STATE",itemId:o,payload:{loadState:"ready"}}))}else console.warn(`[useGridTabs] ⚠️ 警告: onTabNeedsData(tabId="${o}") 返回了空数组 []!`),console.warn("👉 如果你已经在此函数内手动调用了 push() 来追加数据,请在最后 return null 或 undefined。"),console.warn("👉 如果该 Tab 确实没有数据,返回 [] 可能会导致底层的 Header 等已有元素被清空,请注意检查。"),console.warn("👉 框架已为您拦截此次空数组覆盖,保留了当前的 DOM 结构。")}catch(l){console.error("[useGridTabs] onTabNeedsData 执行失败:",l),g.delete(o)}}},onLoadMore:async(...e)=>{let t=e[0];if(t&&t.nativeEvent&&(t=t.nativeEvent),!d.value.onLoadMore)return;const{tabId:o,itemId:n}=t,r=(b[o]||1)+1;try{const e=await d.value.onLoadMore(o,r,n);if(e&&Array.isArray(e))if(e.length>0)if(b[o]=r,l)i.value.push(...e);else{const t=a.value.find(e=>e.tabId===o);t&&t.items&&t.items.push(...e)}else console.warn(`[useGridTabs] ⚠️ 警告: onLoadMore(tabId="${o}", pageNo="${r}") 返回了空数组 []!`),console.warn('👉 如果这是你的最后一页数据,推荐在卡片列表中追加一个 type="no_more" 的 footer 卡片,而不是仅仅返回空。'),console.warn("👉 框架已忽略本次空数据追加,且不会自增页码。")}catch(s){console.error("[useGridTabs] onLoadMore 业务层请求失败:",s)}},onItemPresence:(...e)=>{let t=e[0];if(d.value.onItemPresence)try{let e="string"==typeof t?t:(null==t?void 0:t.nativeEvent)||t;e&&"string"==typeof e.data&&(e=e.data);const o="string"==typeof e?JSON.parse(e):e;o&&"VIEW_PRESENCE_BATCH"===o.type&&Array.isArray(o.payload)?o.payload.forEach(e=>{e.itemId&&"string"==typeof e.itemId&&e.itemId.startsWith("fallback_pos_")&&console.warn(`[useGridTabs] ⚠️ 警告:检测到列表项曝光 (index=${e.index}),但未配置 itemId。请检查传入的 items 数组,务必为每个数据项指定唯一的 itemId,否则底层无法准确进行去重与曝光上报。`),d.value.onItemPresence(e)}):d.value.onItemPresence(o)}catch(o){console.error("[useGridTabs] Failed to parse onItemPresence event payload:",o),d.value.onItemPresence(t)}},onTabSelected:(...e)=>{let t=e[0];t&&t.nativeEvent&&(t=t.nativeEvent),d.value.onTabSelected&&d.value.onTabSelected(t)},onTabClick:(...e)=>{let t=e[0];t&&t.nativeEvent&&(t=t.nativeEvent),d.value.onTabClick&&d.value.onTabClick(t)},onItemClick:(...e)=>{let t=e[0];if(t&&t.nativeEvent&&(t=t.nativeEvent),d.value.onItemClick)try{let e="string"==typeof t?t:(null==t?void 0:t.data)||t;const n="string"==typeof e?JSON.parse(e):e;if(n&&"string"==typeof n.clickPayload)try{n.clickPayload=JSON.parse(n.clickPayload)}catch(o){console.warn("Failed to parse clickPayload:",o)}if(n&&"string"==typeof n.focusPayload)try{n.focusPayload=JSON.parse(n.focusPayload)}catch(o){console.warn("Failed to parse focusPayload:",o)}d.value.onItemClick(n)}catch(o){console.error("[useGridTabs] Failed to parse onItemClick event payload:",o),d.value.onItemClick(t)}else console.warn("[useGridTabs] onItemClick triggered but NO callback registered in callbacksRef!")},onItemLongClick:(...e)=>{let t=e[0];if("number"==typeof t&&e.length>=3&&"string"==typeof e[1]&&(t=e[2]),t&&t.nativeEvent&&(t=t.nativeEvent),d.value.onItemLongClick)try{let e="string"==typeof t?t:(null==t?void 0:t.data)||t;const n="string"==typeof e?JSON.parse(e):e;if(n&&"string"==typeof n.clickPayload)try{n.clickPayload=JSON.parse(n.clickPayload)}catch(o){}if(n&&"string"==typeof n.focusPayload)try{n.focusPayload=JSON.parse(n.focusPayload)}catch(o){}d.value.onItemLongClick(n)}catch(o){console.error("[useGridTabs] Failed to parse onItemLongClick event payload:",o),d.value.onItemLongClick(t)}},onItemFocused:(...e)=>{let t=e[0];if(t&&t.nativeEvent&&(t=t.nativeEvent),d.value.onItemFocused)try{let e="string"==typeof t?t:(null==t?void 0:t.data)||t;const n="string"==typeof e?JSON.parse(e):e;if(n&&"string"==typeof n.clickPayload)try{n.clickPayload=JSON.parse(n.clickPayload)}catch(o){}if(n&&"string"==typeof n.focusPayload)try{n.focusPayload=JSON.parse(n.focusPayload)}catch(o){}d.value.onItemFocused(n)}catch(o){console.error("[useGridTabs] Failed to parse onItemFocused event payload:",o),d.value.onItemFocused(t)}},onTabFocused:(...e)=>{let t=e[0];t&&t.nativeEvent&&(t=t.nativeEvent),d.value.onTabFocused&&d.value.onTabFocused(t)},onScroll:(...e)=>{let t=e[0];if(t&&t.nativeEvent&&(t=t.nativeEvent),d.value.onScroll)try{const e=(null==t?void 0:t.data)||t;d.value.onScroll(e)}catch(o){d.value.onScroll(t)}},onScrollStateChanged:(...e)=>{let t=e[0];if(t&&t.nativeEvent&&(t=t.nativeEvent),d.value.onScrollStateChanged)try{const e=(null==t?void 0:t.data)||t;d.value.onScrollStateChanged(e)}catch(o){d.value.onScrollStateChanged(t)}}}));return{tabsDataStr:o,bindings:C,tabs:a,items:i,initData:e=>{if(!e||0===e.length)return o.value="",void(r=!1);e[0].hasOwnProperty("tabId")||e[0].hasOwnProperty("items")&&Array.isArray(e[0].items)?a.value=e:i.value=e},setCallbacks:e=>{d.value=e},updateItem:(e,t)=>{if(r){p({op:"UPDATE_ITEM",itemId:e,payload:t}),u=!0;try{if(l){const o=i.value.find(t=>t.id===e);o&&Object.assign(o,t)}else for(const o of a.value)if(o.items){const n=o.items.find(t=>t.id===e);if(n){Object.assign(n,t);break}}}finally{u=!1}}else console.error("[useGridTabs] ❌ 时机错误: 尚未初始化数据,无法调用 updateItem")},deleteItem:(e,t=!0)=>{if(r){p({op:"DELETE_ITEM",itemId:e,payload:{animated:t}}),u=!0;try{if(l){const t=i.value.findIndex(t=>t.id===e);-1!==t&&i.value.splice(t,1)}else for(const t of a.value)if(t.items){const o=t.items.findIndex(t=>t.id===e);if(-1!==o){t.items.splice(o,1);break}}}finally{u=!1}}},prependItems:(e,t)=>{if(r){p({op:"PREPEND_SUB_ITEMS",itemId:e,payload:{subItems:t}}),u=!0;try{if(l)i.value.unshift(...t);else{const o=a.value.find(t=>t.tabId===e);o&&o.items&&o.items.unshift(...t)}}finally{u=!1}}},clearItems:e=>{if(r){p({op:"CLEAR_SUB_ITEMS",itemId:e}),u=!0;try{if(l)i.value.splice(0,i.value.length);else{const t=a.value.find(t=>t.tabId===e);t&&t.items&&t.items.splice(0,t.items.length)}}finally{u=!1}}},moveItem:(e,t,o)=>{if(r){p({op:"MOVE_ITEM",itemId:e,payload:{targetPosition:t,anchorItemId:o}}),u=!0;try{const n=n=>{const a=n.findIndex(t=>t.id===e),i=n.findIndex(e=>e.id===o);if(-1!==a&&-1!==i){const e=n.splice(a,1)[0],i=n.findIndex(e=>e.id===o),l="after"===t?i+1:i;n.splice(l,0,e)}};if(l)n(i.value);else for(const e of a.value)e.items&&n(e.items)}finally{u=!1}}},replaceItem:(e,t)=>{if(r){p({op:"REPLACE_ITEM",itemId:e,payload:t}),u=!0;try{if(l){const o=i.value.findIndex(t=>t.id===e);-1!==o&&(i.value[o]=t)}else for(const o of a.value)if(o.items){const n=o.items.findIndex(t=>t.id===e);if(-1!==n){o.items[n]=t;break}}}finally{u=!1}}},dispatchAction:p,resetInitialization:()=>{r=!1,g.clear();for(const e in b)delete b[e]},getFocusState:async()=>new Promise((t,o)=>{let n=e.value;"function"==typeof e.value.getNativeNode?n=e.value.getNativeNode()||e.value:e.value.nativeRef&&(n=e.value.nativeRef);const a=e=>{if(e&&void 0!==e.isSuccess&&void 0!==e.result)t(e.result);else try{const o="string"==typeof e?JSON.parse(e):e;t(o)}catch(Mo){o(Mo)}};"function"==typeof S.Native.callUIFunction?S.Native.callUIFunction(n,"getFocusState",[],a):(console.error("[useGridTabs] Native.callUIFunction is not available"),o(new Error("Native.callUIFunction is not available")))}),getItemRect:async t=>new Promise((o,n)=>{let a=e.value;"function"==typeof e.value.getNativeNode?a=e.value.getNativeNode()||e.value:e.value.nativeRef&&(a=e.value.nativeRef);const i=e=>{if(e&&void 0!==e.isSuccess&&void 0!==e.result)o(e.result);else try{const t="string"==typeof e?JSON.parse(e):e;o(t)}catch(Mo){n(Mo)}};"function"==typeof S.Native.callUIFunction?S.Native.callUIFunction(a,"getItemRect",[t],i):(console.error("[useGridTabs] Native.callUIFunction is not available"),n(new Error("Native.callUIFunction is not available")))}),requestFocus:t=>{let o=e.value;"function"==typeof e.value.getNativeNode?o=e.value.getNativeNode()||e.value:e.value.nativeRef&&(o=e.value.nativeRef),S.Native.callUIFunction(o,"requestFocus",[t])},updatePageSpec:e=>{if(!r)return;const t=Object.assign({},JSON.parse(o.value).page_spec,e);e.layout&&(t.navConfig=Object.assign({},t.navConfig,e.layout)),e.navConfig&&(t.navConfig=Object.assign({},t.navConfig,e.navConfig)),e.contentConfig&&(t.contentConfig=Object.assign({},t.contentConfig,e.contentConfig)),n&&Object.assign(n,t),p({op:"RELOAD_TABS",payload:{pageSpec:t,page_spec:t,tabs:a.value}});const i=JSON.parse(o.value);i.page_spec=t,o.value=JSON.stringify(i),c=o.value},reloadAll:(e,t)=>{n&&(Object.keys(n).forEach(e=>delete n[e]),Object.assign(n,e)),a.value=t,p({op:"RELOAD_TABS",payload:{pageSpec:e,page_spec:e,tabs:t}})},scrollToTop:()=>{let t=e.value;"function"==typeof e.value.getNativeNode?t=e.value.getNativeNode()||e.value:e.value.nativeRef&&(t=e.value.nativeRef),S.Native.callUIFunction(t,"scrollToTop",[])}}},exports.vPortalTo=Lo;
|
|
1
|
+
"use strict";Object.create;var e,t,o,n,a,i,l,r,s,c,u,d,p,v,f,g,m,h,y,x,b,C=Object.defineProperty,I=(Object.getOwnPropertyDescriptor,Object.getOwnPropertyNames,Object.getPrototypeOf,Object.prototype.hasOwnProperty,(e,t,o)=>(((e,t,o)=>{t in e?C(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o})(e,"symbol"!=typeof t?t+"":t,o),o));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const k=require("vue"),S=require("@extscreen/es3-vue"),N=require("@extscreen/es3-core"),_=k.defineComponent({inheritAttrs:!1,__name:"QtxGridTabs",setup(e,{expose:t}){const o=k.ref(),n=Po("qtx-grid-tabs");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(e,t)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o},e.$attrs),{default:k.withCtx(()=>[k.renderSlot(e.$slots,"default")]),_:3},16))}});let T;try{const t=require("@extscreen/es3-vue");T=t.registerElement||(null==(e=t.default)?void 0:e.registerElement)}catch(Do){}const w={install:e=>{if(!globalThis.__QtxGridTabs_registered)if(T){const e=e=>{T(e,{component:{name:"QtxGridTabs",eventNamesMap:new Map([]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-grid-tabs"),e("QtxGridTabs"),globalThis.__QtxGridTabs_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxGridTabs",_),e.component("qtx-grid-tabs",_)}};const P="\0qtx:",B=/\u0000qtx:([^\u0001]*)\u0001/g,E=new Set(["div","qt-view","qt-text","span","qt-image"]),F=new Set(["width","height","marginTop","marginBottom","marginLeft","marginRight","paddingTop","paddingBottom","paddingLeft","paddingRight","fontSize","borderRadius","backgroundColor","color","textColor","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","borderWidth","borderColor","flexDirection","alignItems","justifyContent","textAlign","fontWeight","resizeMode","numberOfLines","ellipsizeMode","positionType","left","top","right","bottom","focusBackgroundColor","focusColor"]),q=new Set(["toUpperCase","toLowerCase","trim"]);function $(e,t,o){return new Proxy(function(){},{ownKeys:()=>["0","1","length"],getOwnPropertyDescriptor:(n,a)=>"length"===a?{value:2,configurable:!0,enumerable:!1,writable:!0}:"0"===a||"1"===a?{value:$(e,t?t+".$each":"$each",o),configurable:!0,enumerable:!0,writable:!0}:void 0,get(n,a){if(a===Symbol.toPrimitive||"toString"===a||"valueOf"===a)return()=>P+t+"";if("toJSON"===a)return;if(a===Symbol.iterator){e.accessedPaths.add(t||"__root__");let n=0;const a=t?`${t}.$each`:"$each";return()=>({next:()=>n++<2?{value:$(e,a,o),done:!1}:{value:void 0,done:!0}})}if("string"!=typeof a)return;const i=t?`${t}.${a}`:a;return e.accessedPaths.add(i),o&&o.has(i)?o.get(i):$(e,i,o)},apply(n,a,i){e.functionCalls.add(t);const l=t.split(".").pop()||"";if(0===i.length&&q.has(l))return P+t+"";if(["map","filter","slice","concat"].includes(l)&&"function"==typeof i[0]){const n=t+".$each",a=i[0],l=$(e,n,o),r=$(e,n,o);return[a(l,0,null),a(r,1,null)]}if("forEach"===l&&"function"==typeof i[0]){const n=t+".$each";return i[0]($(e,n,o),0,null),void i[0]($(e,n,o),1,null)}return P+t+""}})}function O(e){return"string"==typeof e&&e.includes(P)}function A(e){if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return null;if("object"==typeof e||"function"==typeof e)try{const t=String(e);return t.includes(P)?t:null}catch(Do){return null}return null}function L(e){const t=[];let o;for(B.lastIndex=0;null!==(o=B.exec(e));)t.push({index:o.index,text:o[0],path:o[1]});if(0===t.length)return null;if(1===t.length&&e===t[0].text)return Q(t[0].path);const n=[];let a=0;for(const l of t){const t=e.slice(a,l.index);t&&n.push({k:"lit",v:t});const o=Q(l.path);o&&n.push(o),a=l.index+l.text.length}const i=e.slice(a);return i&&n.push({k:"lit",v:i}),{k:"concat",s:n}}function Q(e){const t=e.split("."),o=t[t.length-1];return t.length>1&&q.has(o)?{k:"fmt",f:o,a:[{k:"path",p:t.slice(0,-1).join(".")}]}:{k:"path",p:e}}function R(e,t){let o;for(B.lastIndex=0;null!==(o=B.exec(e));){const e=o[1].split(".");if(!(e.length>1&&q.has(e[e.length-1]))&&t.functionCalls.has(o[1]))return!0}return!1}function M(e,t){return`__t1_${e}_${t}`}function U(e,t,o,n,a){e.binds[t]={k:"path",p:M(e.id,t)},e.tier=1,o.push({nodeId:e.id,prop:t}),n.push({level:"warn",nodeId:e.id,reason:"t1_degraded",detail:`属性 ${t} ${a},标记 T1:binds 指向影子字段 ${M(e.id,t)}`,fix:"数据下发/更新前由 JS 预投影正确值(§8.2);滚动期零 JS 参与;v2 编译期提取后走正源"})}function D(e,t){if("number"==typeof t){if(/color$/i.test(e)){return"#"+(t>>>0).toString(16).padStart(8,"0").slice(2)}return t}if("string"==typeof t){const e=/^(-?\d+(?:\.\d+)?)px$/.exec(t.trim());return e?parseFloat(e[1]):t}}function G(){const e=[];"undefined"!=typeof global&&e.push(global),"undefined"!=typeof globalThis&&e.push(globalThis);for(const t of e)try{const e=t.__QTX_STYLE_SNAPSHOT__;if(Array.isArray(e)&&e.length>0)return e}catch(Do){}for(const t of e)try{const e=t.__HIPPY_VUE_STYLES__;if(Array.isArray(e)&&e.length>0)return e;if(e&&"object"==typeof e)return e}catch(Do){}return[]}function z(e){const t=G(),o=String(e||"").split(/\s+/).filter(Boolean);if(!o.length||!t.length)return[];const n=[];for(const a of t){const e=a.selectors||[];for(const t of e){const e=/^\.([A-Za-z0-9_-]+)/.exec(String(t).trim());if(e&&o.includes(e[1]))for(const t of a.declarations||[])t&&"declaration"===t.type&&t.property&&n.push([t.property,t.value])}}return n}function V(e,t){return"symbol"==typeof e&&String(e.description)===t}const j="v-txt";let K=0;function W(e,t,o,n,a,i=[],l=!1){if(!e)return null;const r=e.type;if(V(r,"v-fgt")||V(r,"v-cmt")){let r=null;for(const s of X(e)){const e=W(s,t,o,n,a,i,l);e&&!r&&(r=e)}return r}let s=null;if("string"==typeof r)s=r;else{const e="object"==typeof r&&null!==r?String(r.name||r.__name||""):"";e&&E.has(e)&&(s=e)}if(!s)return a.push({level:"warn",nodeId:t||"root",reason:"custom_component",detail:`检测到非原生标签子树(${Z(r)}),M2 spike 不支持捕获`,fix:"spike 期请用 div/qt-text/qt-image 直接书写卡片;自定义组件支持随 M3 Portal 降级落地"}),null;if(!E.has(s))return a.push({level:"error",nodeId:t||"root",reason:"tag_out_of_vocabulary",detail:`标签 <${s}> 不在 §3.1 封闭集内`,fix:"使用 div / qt-view / qt-text / span / qt-image"}),null;const c="n"+K++,u={id:c,pid:t,tag:s,tier:0,layout:{},props:{},binds:{},events:[]},d=e.props||{},p=new Set;for(const f of Object.keys(d)){if("ref"===f||"key"===f)continue;const e=d[f];if("style"===f)J(u,e,p,a);else if("class"===f){const t=A(e);if(null!==t&&O(t)){const e=L(t);e&&(u.binds.class=e,a.push({level:"warn",nodeId:c,reason:"dynamic_class",detail:`动态 class 捕获为绑定 ${JSON.stringify(e)}`,fix:"原生按值选样式;样式表映射完善后此诊断消除"}))}const o=z(e);0===G().length?a.push({level:"warn",nodeId:c,reason:"stylesheet_invisible",detail:"平台样式表 __HIPPY_VUE_STYLES__ 不可达,class 样式无法捕获",fix:"运行环境检查(globalThis/global/self 均无样式表)"}):0===o.length?a.push({level:"warn",nodeId:c,reason:"class_unresolved",detail:`class "${e}" 在平台样式表中无匹配规则`,fix:"确认类名拼写,或样式写在 <style> 中(scoped 亦可)"}):H(u,o,p,a)}else{const t=A(e);if(O(t))if(R(t,o))U(u,f,i,a,"含方法调用");else{const e=L(t);e?(u.binds[f]=e,Y(e,p)):(u.tier=1,a.push({level:"warn",nodeId:c,reason:"unrecoverable_binding",detail:`属性 ${f} 的绑定无法恢复为描述符:${t}`,fix:'改写为路径/插值/无参格式化器形式(如 :text="item.title")'}))}else"function"==typeof e?"onClick"===f?u.events.push("click"):"onFocus"===f&&u.events.push("focus"):null!==e&&"object"!=typeof e&&"function"!=typeof e?"number"==typeof e&&Number.isNaN(e)&&!l?U(u,f,i,a,"哨兵算术 NaN"):u.props[f]=e:null!==e&&a.push({level:"warn",nodeId:c,reason:"static_object_prop",detail:`属性 ${f} 为对象/复杂值,spike 不支持静态冻结`,fix:"改为简单原始值属性或绑定表达式"})}}if(Array.isArray(e.dirs))for(const f of e.dirs){if(!f||void 0===f.value)continue;const e=A(f.value);if(null!==e&&O(e)){const t=L(e);t&&(u.binds.visibility=t,a.push({level:"warn",nodeId:c,reason:"vshow_captured",detail:`v-show 捕获为 visibility 绑定 ${JSON.stringify(t)}`,fix:"原生按 truthy 显示/GONE 隐藏;若实际是其他指令请改用显式绑定"}))}else!1===f.value&&(u.binds.visibility={k:"lit",v:!1})}const v=function(e){const t=e.children;if("string"==typeof t)return t;if(Array.isArray(t)){const e=[];for(const o of t)"string"==typeof o?e.push(o):o&&V(o.type,j)&&"string"==typeof o.children&&e.push(o.children);return e.length?e.join(""):null}return null}(e);if(null!==v)if(O(v))if(R(v,o))U(u,"text",i,a,"含方法调用");else{const e=L(v);e&&(u.binds.text=e,Y(e,p))}else u.props.text=v;n.push(u);for(const f of X(e))W(f,c,o,n,a,i,l);return c}function H(e,t,o,n){for(const[a,i]of t){const t="string"==typeof i?i:A(i);if(null!==t&&O(t)){const i=L(t);i?(e.binds[a]=i,Y(i,o)):n.push({level:"warn",nodeId:e.id,reason:"unrecoverable_style",detail:`样式 ${a} 绑定无法恢复:${t}`,fix:'动态样式改用简单路径绑定(如 :style="{ color: item.color }")'});continue}if("focus-scale"===a||"focusScale"===a){const t=D(a,i);void 0!==t&&(e.layout.focusScale=t);continue}if(a.startsWith("focus")){const t=D(a,i);if(void 0!==t){e.focusStyle||(e.focusStyle={}),e.focusStyle[a]=t;continue}}if(F.has(a)){const t=D(a,i);if(void 0!==t){e.layout[a]=t;continue}}n.push({level:"warn",nodeId:e.id,reason:"style_out_of_subset",detail:`样式 ${a}: ${String(i)} 不在 M2 布局子集内`,fix:"使用 width/height/margin*/padding*/fontSize/backgroundColor/flexDirection 等子集键"})}}function J(e,t,o,n){const a=[],i=Array.isArray(t)?t:[t];for(const l of i)if(l&&"object"==typeof l)for(const e of Object.keys(l))a.push([e,l[e]]);for(const[l,r]of a){const t="string"==typeof r?r:A(r);if(null!==t&&O(t)){const a=L(t);a?(e.binds[l]=a,Y(a,o)):n.push({level:"warn",nodeId:e.id,reason:"unrecoverable_style",detail:`样式 ${l} 绑定无法恢复:${t}`,fix:'动态样式改用简单路径绑定(如 :style="{ color: item.color }")'});continue}if(F.has(l)){const t=D(l,r);if(void 0!==t){e.layout[l]=t;continue}}n.push({level:"warn",nodeId:e.id,reason:"style_out_of_subset",detail:`样式 ${l}: ${String(r)} 不在 M2 布局子集内`,fix:"使用 width/height/margin*/padding*/fontSize/backgroundColor/flexDirection 等子集键"})}}function Y(e,t){if(!e||"object"!=typeof e)return;"path"===e.k&&"string"==typeof e.p&&t.add(e.p);const o=e=>{Array.isArray(e)?e.forEach(o):e&&"object"==typeof e&&Y(e,t)};o(e.a),o(e.s),o(e.l),o(e.r),o(e.c),o(e.t),o(e.e)}function X(e){const t=e.children;if(!t)return[];if(Array.isArray(t))return t;if("object"==typeof t&&t.default){const e="function"==typeof t.default?t.default():t.default;return Array.isArray(e)?e:[e]}return[]}function Z(e){return String("object"==typeof e&&null!==e?e.name||e.__name||"anonymous-component":e)}function ee(e){let t=5381;for(let o=0;o<e.length;o++)t=(t<<5)+t+e.charCodeAt(o)>>>0;return t.toString(16).padStart(8,"0").slice(-8)}function te(e){const t=e=>Object.keys(e).sort().map(t=>`${t}:${JSON.stringify(e[t])}`).join(",");return`{${e.tag}|${e.tier}|L:${t(e.layout)}|P:${t(e.props)}|B:${t(e.binds)}|E:${e.events.join(",")}}`}function oe(e,t,o=!1){const n={accessedPaths:new Set,functionCalls:new Set},a=[],i=[],l=[];K=0;try{const r=e({item:$(n,"",t),index:$(n,"$index")}),s=Array.isArray(r)?r:[r];let c=null;for(const e of s){const t=W(e,null,n,i,a,l,o);t&&!c&&(c=t)}if(!c||0===i.length)return null;const u=new Set;for(const e of i)re(e.binds,u);return{nodes:i,rootId:c,accessed:n.accessedPaths,bound:u,diagnostics:a,t1Props:l,functionCalls:n.functionCalls}}catch(Do){return a.push({level:"error",nodeId:"root",reason:"capture_crashed",detail:String(Do),fix:"检查 #item 插槽是否存在渲染期副作用"}),null}}function ne(e){return e.map(te).join(";")}function ae(e,t){return{viewType:"tpl:"+ee(e.nodes.map(te).join(";")),discriminators:[],rootId:e.rootId,nodes:e.nodes,discs:t}}function ie(e,t=[]){const o=[],n=new Map,a=oe(e);if(!a)return o.push({level:"error",nodeId:"root",reason:"empty_template",detail:"未捕获到任何模板节点",fix:"确认 #item 插槽渲染原生标签子树"}),{templates:[],diagnostics:o,unaccountedPaths:[],t1Evaluator:null};o.push(...a.diagnostics);for(const g of a.t1Props)n.set(g.nodeId+"."+g.prop,g);const i=[ae(a,[])],l=new Set([ne(a.nodes)]),r=[...a.accessed].filter(e=>!(e.includes(".")||a.bound.has(e)||le(e)||(e=>{for(const t of a.functionCalls)if(t===e||t.startsWith(e+"."))return!0;return!1})(e))),s=new Set(a.accessed),c=new Set(a.bound),u=new Set(a.functionCalls),d=new Set,p=e=>{for(const t of u)if(t===e||t.startsWith(e+"."))return!0;return!1};for(let g=0;g<3;g++){const a=[...s].filter(e=>!(e.includes(".")||c.has(e)||le(e)||p(e))).filter(e=>!d.has(e));if(0===a.length)break;let r=!1;for(const p of a){d.add(p);const a=new Set,v=new Set;for(const e of t){if(e&&"object"==typeof e&&p in e){const t=e[p];null!==t&&"object"!=typeof t&&v.add(t)}if(v.size>=6)break}const f=[[]];for(const e of i)e.discs&&e.discs.length>0&&!e.discs.some(e=>e.path===p)&&f.push(e.discs.map(e=>({...e})));for(const t of v)for(const d of f){if(i.length>=8)break;if(d.some(e=>e.path===p))continue;const v=new Map;for(const e of d)v.set(e.path,e.value);v.set(p,t);const f=oe(e,v);if(!f)continue;o.push(...f.diagnostics);for(const e of f.t1Props)n.set(e.nodeId+"."+e.prop,e);for(const e of f.accessed)s.add(e);for(const e of f.bound)c.add(e);for(const e of f.functionCalls)u.add(e);const g=ne(f.nodes);l.has(g)||(l.add(g),i.push(ae(f,[...d,{path:p,value:t}])),r=!0,a.add(t))}a.size>0&&a.size<v.size&&o.push({level:"warn",nodeId:"root",reason:"disc_value_gap",detail:`字段 ${p} 判别值覆盖 ${a.size}/${v.size},未覆盖值将落入默认模板`,fix:`若是范围条件(如 ${p} > n)请改写为等值判别或离散标记字段;或等待 v2 编译期提取`})}if(!r)break}de(a.nodes,o);for(const g of i)de(g.nodes,o);for(let g=0;g<i.length;g++){const e=i[g];for(let t=e.nodes.length-1;t>=0;t--)null!=e.nodes[t].repeat&&e.nodes.splice(t,1)}if(!i.some(e=>e.nodes.some(e=>e.repeat))&&t.length>0){const n=t.find(e=>e&&"object"==typeof e&&Object.values(e).some(e=>Array.isArray(e)&&e.length>=2&&e[0]&&"object"==typeof e[0]));n&&function(e,t,o,n){const a=oe(e,new Map(Object.entries(t)),!0);if(!a)return;for(let i=0;i+1<a.nodes.length;){const e=a.nodes[i],l=a.nodes[i+1];if(e.pid!==l.pid||e.tag!==l.tag||JSON.stringify(e.layout)!==JSON.stringify(l.layout)){i++;continue}const r=pe(t,e.props&&e.props.text);if(!r){i++;continue}const s=t[r],c=Object.keys(s[0]||{}).find(t=>String(s[0][t])===String(e.props&&e.props.text));if(!c){i++;continue}const u={...e,tag:"qt-text"===e.tag||"span"===e.tag?e.tag:"qt-text",binds:{text:{k:"path",p:`$each.${c}`}}};u.props={...e.props},delete u.props.text,u.repeat={list:{k:"path",p:r},key:null},u.id=`r${u.id}`;let d=o.nodes.length;for(let t=o.nodes.length-1;t>=0;t--)if(o.nodes[t].id===u.pid){d=t+1;break}o.nodes.splice(d,0,u),n.push({level:"warn",nodeId:e.id,reason:"vfor_real_collapsed",detail:`v-for 样本通道折叠:${r}[]${c}`,fix:"v2 编译期提取后走正源"}),i++}}(e,n,a,o)}{const e=new Set,t=[];for(const n of o){const o=n.reason+"|"+n.nodeId+"|"+n.detail;e.has(o)||(e.add(o),t.push(n))}o.length=0,o.push(...t)}const v=[...a.accessed].filter(e=>!(e=>{for(const t of a.bound)if(t===e||t.startsWith(e+".")||t.startsWith(e+".toFixed"))return!0;return!1})(e)&&r.indexOf(e)<0&&!p(e)),f=n.size>0?function(e,t){return o=>{if(!o||"object"!=typeof o)return null;let n=null;try{n=oe(e,new Map(Object.entries(o)),!0)}catch(Do){return null}if(!n)return null;const a={};for(const{nodeId:e,prop:i}of t){const t=n.nodes.find(t=>t.id===e),o=t&&t.props?t.props[i]:void 0;void 0===o||"number"==typeof o&&Number.isNaN(o)?a[M(e,i)]=null:a[M(e,i)]=o}return a}}(e,[...n.values()]):null;return{templates:i,diagnostics:o,unaccountedPaths:v,t1Evaluator:f}}function le(e){return e.includes("(")}function re(e,t){for(const o of Object.values(e))Y(o,t)}function se(e,t,o,n){const a={},i={itemId:(null!=e[t]?String(e[t]):"")||"row_"+se.seq++,viewType:o,span:1,content:a};for(const[l,r]of Object.entries(e))l!==t&&("__span"!==l?"__aspectRatio"!==l?a[l]=r:"number"==typeof r&&r>0&&(i.aspectRatio=r):"number"==typeof r&&Number.isInteger(r)&&r>=1&&(i.span=r));return n&&Object.assign(a,n),i}function ce(e,t){const o=e.filter(e=>e.discs&&e.discs.length>0).sort((e,t)=>{var o,n;return((null==(o=t.discs)?void 0:o.length)||0)-((null==(n=e.discs)?void 0:n.length)||0)});for(const n of o)if(n.discs.every(e=>t[e.path]===e.value))return n.viewType;return(e.find(e=>!e.discs||0===e.discs.length)||e[0]).viewType}function ue(e){return JSON.stringify([e.tag,e.layout,e.binds,e.props])}function de(e,t){var o;for(let n=0;n+1<e.length;){const a=e[n],i=e[n+1];if(a.pid===i.pid&&ue(a)===ue(i)){let i=null;for(const e of Object.values(a.binds||{})){const t=null==e?void 0:e.p;if(t&&t.includes(".$each")){i=t.split(".$each")[0];for(const e of[".map",".forEach",".filter",".slice",".concat"])if(i.endsWith(e)){i=i.slice(0,-e.length);break}break}}if(!i){n++;continue}const l=((null==(o=Object.values(a.binds||{}).find(e=>{const t=null==e?void 0:e.p;return t&&t.includes(".$each")}))?void 0:o.p)||"").split(".$each")[0],r={...a,binds:{}};"qt-text"!==r.tag&&"span"!==r.tag&&(r.tag="qt-text");for(const[e,t]of Object.entries(a.binds||{})){const o=null==t?void 0:t.p;r.binds[e]=o&&l&&o.startsWith(l+".$each")?{k:"path",p:"$each"+o.slice((l+".$each").length)}:t}for(r.repeat={list:{k:"path",p:i},key:null},e.splice(n,2,r);n+1<e.length&&e[n+1].pid===r.pid&&ue(e[n+1])===ue(a);)e.splice(n+1,1);t.push({level:"warn",nodeId:r.id,reason:"repeat_collapsed",detail:`v-for 子列表折叠为 repeat 节点(list=${i})`,fix:"原生 bind 期克隆支持落地后此诊断消除"})}else n++}}function pe(e,t){if(null==t)return null;for(const[o,n]of Object.entries(e))if(Array.isArray(n)&&n.length>=2&&n[0]&&"object"==typeof n[0]&&Object.values(n[0]).some(e=>String(e)===String(t)))return o;return null}se.seq=0;const ve=["banner","theme_card","tool_card"],fe="qtx-glint-items/src/main/java/com/quicktvui/qtx/glint/factory/",ge="qtx-glint-items/src/main/java/com/quicktvui/qtx/glint/view/",me={poster:"主图地址(优先)",image:"主图地址(次选,ImageItemFactory 常用)",imgUrl:"主图地址(SDUI 协议别名,末选)",title:"主标题",subtitle:"副标题",floatTitle:"悬浮主标题(posterType=text_float 时生效)",floatSubtitle:"悬浮副标题",posterType:"海报形态(如 text_float)",scaleType:"图片缩放形态",badge:"角标对象",coord:"绝对定位坐标,可含 z 层级"},he={id:"glint",name:"Glint",description:"qtx 当前内置的 TV 风格:复用 qtx-glint-items 的原生卡片工厂,视觉与 grid-tabs 完全一致。",installer:"com.quicktvui.qtx.glint.GlintStyleInstaller.install()",rendering:"native",itemTypes:{header:{viewType:"header",label:"版块标题",description:"版块起始处的结构分割;当前原生实现只渲染一行主标题,且整行不可获焦。",fields:{title:"主标题(原生唯一读取字段)"},required:["title"],protocolOnly:["subTitle","showMore","tag"],factory:"GlintSectionHeaderItemFactory",nativeSources:[fe+"GlintSectionHeaderItemFactory.java"]},poster:{viewType:"poster",label:"标准海报卡片",description:"业务核心展示单元:主图、双行文本、悬浮标题、角标与缩放形态。",fields:me,required:[],requiredAnyOf:[["poster","image","imgUrl"]],protocolOnly:["score","rating","progress","subTitle","url"],factory:"GlintPosterItemFactory",nativeSources:[fe+"GlintPosterItemFactory.java",ge+"GlintPosterView.java"]},image:{viewType:"image",label:"基础图片素材",description:"纯视觉素材;复用 GlintPosterView.bindData(),字段与 poster 相同。",fields:{...me},required:[],requiredAnyOf:[["poster","image","imgUrl"]],protocolOnly:["url","score"],factory:"GlintImageItemFactory",nativeSources:[fe+"GlintImageItemFactory.java",ge+"GlintPosterView.java"]},text:{viewType:"text",label:"状态化文本",description:"通用文本展示;注意原生读取的是 title,不是 SDUI 协议的 text。",fields:{title:"显示文本(原生读取字段)",textSize:"字号",textColor:"文本颜色",maxLines:"最大行数",bgColor:"占位背景色(Color.parseColor,非法值静默忽略)",background:"背景图",poster:"海报图",badge:"角标对象"},required:[],requiredAnyOf:[["title"]],protocolOnly:["text","fontSize","normalStyle","focusStyle","borderRadius"],factory:"GlintTextItemFactory",nativeSources:[fe+"GlintTextItemFactory.java",ge+"GlintTextView.java"]},spacer:{viewType:"spacer",label:"物理间距",description:"网格占位;content 为空,跨列由行级 span 决定。当前原生实现固定 100px 高。",fields:{},required:[],factory:"SpacerFactory",nativeSources:["qtx-grid-tabs/src/main/java/com/quicktvui/qtx/tabs/factory/SpacerFactory.java"]},banner:{viewType:"banner",label:"轮播横幅",description:"首页顶部运营位;content 只需 banners 数组,子项字段由 GlintBannerView 读取。",fields:{banners:"轮播数据数组(必填,元素字段见 nestedFields)"},required:["banners"],protocolOnly:["image","title","tag","background"],nestedFields:{title:"主标题",subtitle:"副标题",poster:"主图",imageUrl:"图片地址",tag:"角标",appTag:"应用角标",appIcon:"应用图标",buttonText:"按钮文案",type:"内容类型",mediaType:"媒体类型",mediaUrl:"媒体地址",videoUrl:"视频地址",bgColor:"背景色",clickPayload:"点击透传数据"},factory:"GlintBannerItemFactory",nativeSources:[fe+"GlintBannerItemFactory.java",ge+"GlintBannerView.java"]},theme_card:{viewType:"theme_card",label:"主题卡片",description:"专题 / 合集入口,原生扩展类型。",fields:{title:"标题",subtitle:"副标题",icon:"图标地址",bgColor:"卡片背景色"},required:[],protocolOnly:["image","badge","tag"],factory:"GlintThemeCardItemFactory",nativeSources:[fe+"GlintThemeCardItemFactory.java"]},tool_card:{viewType:"tool_card",label:"工具卡片",description:"设置 / 工具入口,原生扩展类型。",fields:{icon:"图标地址",title:"标题",desc:"描述",tag:"标签",bgColor:"卡片背景色"},required:[],factory:"GlintToolItemFactory",nativeSources:[fe+"GlintToolItemFactory.java"]},app_icon:{viewType:"app_icon",label:"应用图标",description:"应用入口图标,原生扩展类型。",fields:{icon:"图标地址",title:"应用名",rating:"评分",price:"价格"},required:[],factory:"GlintAppIconItemFactory",nativeSources:[fe+"GlintAppIconItemFactory.java"]}}},ye=he.itemTypes,xe={...he,itemTypes:Object.fromEntries(Object.entries(ye).filter(([e])=>!ve.includes(e)))},be={poster:{scaleType:"center_crop"},image:{scaleType:"center_crop"},text:{textSize:24,maxLines:1},app_icon:{},header:{},spacer:{}},Ce={id:"compact",name:"Compact",description:"紧凑版字段预设:复用 glint 原生工厂,统一收紧字号、行数与缩放形态;非独立视觉体系。",installer:xe.installer,rendering:"preset",basedOn:xe.id,itemTypes:Object.fromEntries(Object.entries(xe.itemTypes).map(([e,t])=>[e,{...t,defaults:be[e]||{}}]))},Ie=new Map;function ke(e="glint"){const t=Ie.get(e);if(!t)throw new Error(`[qtx] 未注册的风格包 "${e}",已注册:${[...Ie.keys()].join(", ")}`);return t}function Se(){const e=new Set;for(const t of Ie.values())for(const o of Object.values(t.itemTypes))e.add(o.viewType);return[...e].sort()}function Ne(e){return Se().includes(e)}function _e(e,t={},o={}){const n=ke(o.pack),a=n.itemTypes[e]||Object.values(n.itemTypes).find(t=>t.viewType===e);if(!a)throw new Error(`[qtx] 风格包 "${n.id}" 未注册 item 类型 "${e}",可用:${Object.keys(n.itemTypes).join(", ")}`);const i={...a.defaults||{},...t};for(const r of a.required)if(null==i[r])throw new Error(`[qtx] ${e} 缺少必填字段 "${r}"`);for(const r of a.requiredAnyOf||[])if(!r.some(e=>null!=i[e]))throw new Error(`[qtx] ${e} 缺少必填字段(任选其一):${r.join(" / ")}`);const l={...i,viewType:a.viewType};return null!=o.id&&(l[o.keyField||"id"]=o.id),Number.isInteger(o.span)&&o.span>=1&&(l.__span=o.span),"number"==typeof o.aspectRatio&&o.aspectRatio>0&&(l.__aspectRatio=o.aspectRatio),l}function Te(e=[],t={}){const{pack:o,typeField:n="type",keyField:a="id"}=t;return e.map((e,t)=>{if("string"==typeof e.viewType&&Ne(e.viewType))return e;const i=e[n];if("string"!=typeof i||!i)throw new Error(`[qtx] styledRows 第 ${t} 行缺少 "${n}" 字段(或提供已注册的 viewType)`);const l={};for(const[o,r]of Object.entries(e))o!==n&&o!==a&&"span"!==o&&"aspectRatio"!==o&&"viewType"!==o&&(l[o]=r);return _e(i,l,{id:e[a]??t,keyField:a,pack:o,span:"number"==typeof e.span?e.span:void 0,aspectRatio:"number"==typeof e.aspectRatio?e.aspectRatio:void 0})})}function we(e){const t=e&&e.viewType;return"string"==typeof t&&t&&"__disc__"!==t&&Ne(t)?t:null}Ie.set(xe.id,xe),Ie.set(Ce.id,Ce);const Pe=k.defineComponent({inheritAttrs:!1,__name:"QtxListBase",setup(e,{expose:t}){const o=k.ref(),n=Po("qtx-list");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(e,t)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o},e.$attrs),{default:k.withCtx(()=>[k.renderSlot(e.$slots,"default")]),_:3},16))}}),Be=new Set;let Ee=null;const Fe=k.defineComponent({name:"QtxList",inheritAttrs:!1,props:{items:{},columns:{default:1},keyField:{default:"id"},direction:{default:"vertical"},itemHeight:{default:0},itemAspectRatio:{},gutter:{default:0},pageEnabled:{type:Boolean},loadingTail:{type:Boolean,default:!1},state:{default:"ready"},emptyText:{},loadingText:{},errorText:{},initialFocusIndex:{},initData:{}},emits:["item-click","item-focus","nested-item-click","nested-item-focus","capture-diagnostics","onItemEvent","load-more","portal-viewport-enter","portal-viewport-leave"],setup(e,{expose:t,emit:o}){let n=0;const a=++n;const i=function(e){const t={scrolled:!1,scrollToTop:e};return Be.add(t),t}(function(){j.scrollToIndex(0)});k.onUnmounted(()=>{return e=i,Be.delete(e),void(Ee===e&&(Ee=null));var e});const l=e,r=o,s=k.ref(null),c=k.useSlots(),u=k.useAttrs();let d="",p=[],v=[],f=null,g=!1,m=!1,h=0,y=null,x=null;const b=k.computed(()=>{const e=l.state||"ready";if("ready"===e)return[];return Te([{id:"__qtx_state__",type:"text",title:"loading"===e?l.loadingText||"加载中…":"empty"===e?l.emptyText||"暂无内容":l.errorText||"加载失败,点击重试",span:l.columns||1}])});function C(){return l.state&&"ready"!==l.state?b.value:y??l.items??[]}async function I(e){var t;let o;try{o=ie(e,(l.items||[]).slice(0,24))}catch(Do){return _.value="capture CRASH "+String(Do),!1}const n=function(e,t){if(!e||!Array.isArray(e.templates))return[];const o=new Map;for(const l of e.templates)for(const e of l.discs||[])e&&e.path&&(o.has(e.path)||o.set(e.path,new Set),o.get(e.path).add(e.value));if(0===o.size)return[];const n=new Map,a=(e,t)=>{let o=e;for(const n of t.split(".")){if(null==o||"object"!=typeof o)return;o=o[n]}return o};for(const l of t)for(const[e,t]of o){const o=a(l,e);void 0===o||t.has(o)||(n.has(e)||n.set(e,new Set),n.get(e).add(o))}const i=[];for(const[l,r]of n)for(const e of r)i.push({level:"warn",reason:"disc_sample_gap",detail:`判别字段 ${l} 的值 ${JSON.stringify(e)} 不在捕获样本(前 24 行)内——该值行将按默认模板渲染`,fix:"把该值对应的行提前到首屏 24 行内;或改用编译路径(v2 默认,asset 构建);或改等值判别字段"});return i}(o,l.items||[]);return n.length&&o.diagnostics.push(...n),_.value="captured "+o.templates.length+" tpl",r("capture-diagnostics",o.diagnostics),o.diagnostics.length&&console.warn("[qtx-list] 捕获诊断:",o.diagnostics),p=o.templates,v=o.templates,f=o.t1Evaluator||null,d=(null==(t=o.templates[0])?void 0:t.viewType)||"",!0}k.onMounted(async()=>{_.value="awaiting ready";try{await To()}catch(Do){return void(_.value="ready FAILED "+String(Do))}const e=u.tplKey||u["tpl-key"],t=e?(globalThis.__QTX_TPL__||{})[e]:null,o=t?t.templates&&t.templates.length>0?t.templates:[t]:[];if(o.length>0&&o[0].nodes&&o[0].nodes.length>0)return _.value="compiled tpl (v2)",g=!0,p=o,v=o,d=o[0].viewType||"",f=null,w(),M((l.items||[]).slice()),S.value=!0,F(),r("capture-diagnostics",[{level:"info",reason:"compiled_template",detail:"v2 编译期模板路径已生效;运行时捕获未执行,T1 影子字段不适用",fix:"无需改写;若需运行时捕获诊断,请移除 tpl-key 或关闭编译期提取"}]),void z.emit("qtx-list-ready",{api:j,columns:l.columns,instanceId:a});_.value="ready ok, capturing";const n=c.item;if("function"!=typeof n)return void console.warn("[qtx-list] 缺少 #item 插槽");const i=0===(l.items||[]).length;await I(n)&&(i&&(m=!0,r("capture-diagnostics",[{level:"warn",reason:"empty_sample_capture",detail:"挂载时 items 为空——判别分支未枚举,当前仅基础模板;首次数据到达将自动重新捕获",fix:"首屏提供非空数据;或等待自动重捕获(数据到达后模板自动补全)"}])),w(),M((l.items||[]).slice()),S.value=!0,F(),z.emit("qtx-list-ready",{api:j,columns:l.columns,instanceId:a}))}),k.watch(()=>(l.items||[]).length,e=>{!m||e<=0||(m=!1,(async()=>{const e=c.item;if("function"!=typeof e)return;await I(e)&&P()})())});const S=k.ref(!1),_=k.ref("qtx-list: mounted");k.watch(()=>[l.state,l.emptyText,l.loadingText,l.errorText],()=>{S.value&&P()});const T=k.ref("");function w(){T.value=JSON.stringify({templates:p,items:$(C().slice(0,48))})}async function P(e){h+=1;const t=((null==e?void 0:e.override)??C()).slice();M(t),await k.nextTick();const o=B>=0?Math.min(B,t.length-1):-1;B=-1;const n=JSON.stringify({templates:p,items:$(t)}),a=p.some(e=>e&&Array.isArray(e.nested)&&e.nested.length>0),i=0===t.length||!a;if(0===t.length&&null==O)for(let r=0;r<10&&null==O;r++)await new Promise(e=>setTimeout(e,50));const l=!!i&&await async function(e,t,o){if(null==O)return!1;try{const{Native:n}=await(import("@extscreen/es3-vue")),a=await n.callNativeWithPromise("EsNativeModule","callReflect",{entry:{from:A,method:"setItems",params:[O,e,t?"true":"false",String(o)]}});return("string"==typeof a?a:String((a&&(a.result??a.data))??"")).includes("OK")}catch(Do){return!1}}(n,!!(null==e?void 0:e.scrollTop),o);l||(T.value=n,E.value="",S.value=!1,await k.nextTick(),S.value=!0,o>=0&&setTimeout(()=>async function(e){if(null==O)return;try{const{Native:t}=await(import("@extscreen/es3-vue"));await t.callNativeWithPromise("EsNativeModule","callReflect",{entry:{from:A,method:"focus",params:[O,String(e)]}})}catch(Do){console.warn("[qtx-list] focus reflect failed:",Do)}}(o),500))}let B=-1;const E=k.ref("");function F(){const e=C().slice(),t=++h;let o=0;const n=()=>{if(t!==h)return;const a=48+500*o;a>=e.length||(o+=1,E.value=JSON.stringify({seq:o,subItems:$(e.slice(a,a+500))}),setTimeout(n,50))};n()}const q=new Map;function $(e){return e.map(e=>{const t=we(e)||(g?"__disc__":v.length>1?ce(v,e):d||"tpl:none"),o=f?f(e):null,n=se(e,l.keyField,t,o);return q.set(String(n.itemId),t),n})}let O=null;const A="com.quicktvui.qtx.list.QtxListCommandHub";function L(e,t){if(Array.isArray(e)){for(const o of e)L(o,t);return}if(!e||"object"!=typeof e)return;const o=e;if("path"!==o.k||"string"!=typeof o.p)for(const n of["l","r","c","a","b"])void 0!==o[n]&&L(o[n],t);else t.add(o.p.split(".")[0])}async function Q(e){if(null==O)return!1;try{const{Native:t}=await(import("@extscreen/es3-vue")),o=await t.callNativeWithPromise("EsNativeModule","callReflect",{entry:{from:A,method:"dispatch",params:[O,JSON.stringify(e)]}}),n="string"==typeof o?o:String((o&&(o.result??o.data))??JSON.stringify(o));return!n.includes("ERR")&&n.includes("OK")}catch(Do){return!1}}let R=[];function M(e){R=e.slice()}let U=null;function D(){null==U&&(U=setTimeout(()=>{U=null,function(){if(!S.value)return;if(null!==y)return;const e=C();if(e===R)return;const t=R;let o=e.length>t.length;if(o)for(let n=0;n<t.length;n++)if(e[n]!==t[n]){o=!1;break}if(o){const o=e.slice(t.length);return M(e),void(d&&o.length&&Q([{op:"APPEND_SUB_ITEMS",itemId:"__qtx_list__",payload:{subItems:$(o)}}]).then(e=>{e||P()}))}if(e.length===t.length){let o=!0;for(let n=0;n<e.length;n++)if(e[n]!==t[n]){o=!1;break}if(o)return}P()}()},0))}function G(e){const t=(null==e?void 0:e.nativeEvent)||e||{},o=t.event;if("node-ready"===o)return O=String(t.itemId),void Lo(O);const n=null!=t.itemId?String(t.itemId):"";if("__qtx_scroll_state__"===o)return s="1"===n,(a=i).scrolled=s,void(s?Ee=a:Ee===a&&(Ee=null));var a,s;if("portal-viewport-enter"===o||"portal-viewport-leave"===o)return r("onItemEvent",t),void r(o,{key:n,position:Number(t.position??-1)});if(n.includes("#")&&("item-click"===o||"item-focus"===o)){const e=n.indexOf("#"),a=n.slice(0,e),i=Number(n.slice(e+1)),s=C().findIndex(e=>String(e[l.keyField])===a);let c=null;if(null!=t.content)try{c=JSON.parse(t.content)}catch{}return r("onItemEvent",t),void r("item-click"===o?"nested-item-click":"nested-item-focus",{row:C()[s],rowIndex:s,item:c,index:i,itemId:n})}if("nested-load-more"===o){const e=C().findIndex(e=>String(e[l.keyField])===n);return r("onItemEvent",t),void r("load-more",{itemId:n,position:e})}const c=Number(t.position??-1),u={item:C()[c],index:c,nodeId:t.nodeId};r("onItemEvent",t),"item-click"===o?r("item-click",u):"item-focus"===o?r("item-focus",u):"load-more"===o&&r("load-more",{itemId:t.itemId,position:c})}k.watch(()=>l.items,()=>{if(null!==y){if(l.items===x)return;y=null,x=null}D()},{deep:!0});const z=N.useESEventBus();function V(e,t){return y=(e||[]).slice(),x=l.items,P({scrollTop:t,override:y})}const j={getNativeNode:function(){var e;const t=s.value,o=(null==(e=null==t?void 0:t.getNativeNode)?void 0:e.call(t))||t;return(null==o?void 0:o.$el)||o},async updateItem(e,t){const o=C()[e];if(!o)return;const n=null!=o[l.keyField]?String(o[l.keyField]):`row_${e}`,a=f?f({...o,...t}):null,i=a?{...t,...a}:t,r={...o,...t};if(g){const e=new Set;for(const t of v)L(t.discriminators,e);if(Object.keys(t).some(t=>e.has(t)))return void P()}else{if((v.length>1?ce(v,r):d||"tpl:none")!==(q.get(n)||d))return void P()}if(null==O)for(let l=0;l<10&&null==O;l++)await new Promise(e=>setTimeout(e,50));await Q([{op:"UPDATE_ITEM",itemId:n,payload:{content:i}}])||P()},async addListData(e){if(!d)return;M(C().slice());await Q([{op:"APPEND_SUB_ITEMS",itemId:"__qtx_list__",payload:{subItems:$(e)}}])||P()},prependItems(e){P({scrollTop:!0})},async removeItem(e){if(!C()[e])return;const t=e+1<C().length?e+1:e-1;let o=!1;t>=0&&(o=await async function(e){if(null==O)return!1;try{const{Native:t}=await(import("@extscreen/es3-vue")),o=await t.callNativeWithPromise("EsNativeModule","callReflect",{entry:{from:A,method:"requestFocus",params:[O,String(e)]}}),n="string"==typeof o?o:String((o&&(o.result??o.data))??"");return n.includes("OK")&&!n.includes("outside")}catch(Do){return!1}}(t)),B=o?e:-1,P()},moveItemBefore(e,t){P()},clearItems:()=>V([],!0),async scrollToIndex(e,t=!1){if(null!=O)try{const{Native:o}=await(import("@extscreen/es3-vue"));await o.callNativeWithPromise("EsNativeModule","callReflect",{entry:{from:A,method:"scrollTo",params:[O,String(e),t?"true":"false"]}})}catch(Do){console.warn("[qtx-list] scroll reflect failed:",Do)}else console.warn("[qtx-list] node-ready 未握手,scroll 丢弃")},async setLoading(e){if(null==O)for(let t=0;t<10&&null==O;t++)await new Promise(e=>setTimeout(e,50));if(null!=O)try{const{Native:t}=await(import("@extscreen/es3-vue"));await t.callNativeWithPromise("EsNativeModule","callReflect",{entry:{from:A,method:"setLoading",params:[O,e?"true":"false"]}})}catch(Do){console.warn("[qtx-list] setLoading reflect failed:",Do)}else console.warn("[qtx-list] node-ready 未握手,setLoading 丢弃")},async focusItem(e){if(null==O)for(let t=0;t<10&&null==O;t++)await new Promise(e=>setTimeout(e,50));if(null!=O)try{const{Native:t}=await(import("@extscreen/es3-vue"));await t.callNativeWithPromise("EsNativeModule","callReflect",{entry:{from:A,method:"focus",params:[O,String(e)]}})}catch(Do){console.warn("[qtx-list] focusItem reflect failed:",Do)}else console.warn("[qtx-list] node-ready 未握手,focusItem 丢弃")},setListData:e=>V(e,!0),refresh(){P()},dispatchAction(e){P()}};return t(j),(t,o)=>{const n=k.resolveComponent("qtx-relocate-pool");return k.openBlock(),k.createElementBlock(k.Fragment,null,[k.createVNode(Pe,k.mergeProps({ref_key:"baseRef",ref:s},t.$attrs,{columns:e.columns,direction:e.direction,gutter:e.gutter,itemHeight:e.itemHeight,loadingTail:e.loadingTail,initData:S.value?T.value:"",appendData:S.value?E.value:"",onItemEvent:G}),null,16,["columns","direction","gutter","itemHeight","loadingTail","initData","appendData"]),k.createVNode(n,{class:"qtx-portal-zone"},{default:k.withCtx(()=>[k.renderSlot(t.$slots,"portals")]),_:3})],64)}}}),qe={style:{width:"400px",height:"200px"}},$e=k.defineComponent({name:"QtxStyledList",inheritAttrs:!1,props:{items:{},pack:{default:"glint"},typeField:{default:"type"},keyField:{default:"id"},columns:{default:1},direction:{default:"vertical"},gutter:{default:0},itemHeight:{},itemAspectRatio:{},pageEnabled:{type:Boolean},loadingTail:{type:Boolean,default:!1},initialFocusIndex:{}},setup(e,{expose:t}){const o=e,n=k.ref(null),a=k.computed(()=>Te(o.items||[],{pack:o.pack,typeField:o.typeField,keyField:o.keyField})),i=(e,...t)=>{var o,a;return null==(a=null==(o=n.value)?void 0:o[e])?void 0:a.call(o,...t)},l=e=>Te(e,{pack:o.pack,typeField:o.typeField,keyField:o.keyField});return t({getNativeNode:()=>i("getNativeNode"),updateItem:(e,t)=>{var n;const a=null==(n=o.items)?void 0:n[e];a&&i("updateItem",e,l([{...a,...t}])[0])},addListData:e=>i("addListData",l(e)),prependItems:e=>i("prependItems",l(e)),removeItem:e=>i("removeItem",e),moveItemBefore:(e,t)=>i("moveItemBefore",e,t),clearItems:()=>i("clearItems"),scrollToIndex:(e,t)=>i("scrollToIndex",e,t),setLoading:e=>i("setLoading",e),focusItem:e=>i("focusItem",e),setListData:e=>i("setListData",l(e)),refresh:()=>i("refresh"),dispatchAction:e=>i("dispatchAction",e)}),(t,o)=>{const i=k.resolveComponent("qt-text");return k.openBlock(),k.createBlock(Fe,k.mergeProps({ref_key:"listRef",ref:n},t.$attrs,{items:a.value,columns:e.columns,keyField:e.keyField,direction:e.direction,gutter:e.gutter,itemHeight:e.itemHeight,itemAspectRatio:e.itemAspectRatio,pageEnabled:e.pageEnabled,loadingTail:e.loadingTail,initialFocusIndex:e.initialFocusIndex}),{item:k.withCtx(()=>[k.createElementVNode("div",qe,[k.createVNode(i,{width:400,height:60,text:"内置样式行"})])]),portals:k.withCtx(()=>[k.renderSlot(t.$slots,"portals")]),_:3},16,["items","columns","keyField","direction","gutter","itemHeight","itemAspectRatio","pageEnabled","loadingTail","initialFocusIndex"])}}}),Oe=k.defineComponent({inheritAttrs:!1,__name:"QtxKeyboard",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:t}){const o=k.ref(),n=Po("qtx-keyboard");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value},requestFocus:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"requestFocus",e)}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,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:a[0]||(a[0]=e=>t.$emit("onInputChanged",e.nativeEvent)),onOnKeyPressed:a[1]||(a[1]=e=>t.$emit("onKeyPressed",e.nativeEvent))},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["backgroundColor","backgroundGradient","textColor","weakTextColor","focusBackgroundColor","focusTextColor","placeholder","textFullKeyboard","textT9Keyboard","keyboardType","textClear","textDelete","currentInput","autofocus","rememberKeyboardType"]))}});let Ae;try{const e=require("@extscreen/es3-vue");Ae=e.registerElement||(null==(t=e.default)?void 0:t.registerElement)}catch(Do){}const Le={install:e=>{if(!globalThis.__QtxKeyboard_registered)if(Ae){const e=e=>{Ae(e,{component:{name:"QtxKeyboard",eventNamesMap:new Map([["onInputChanged","onInputChanged"],["onKeyPressed","onKeyPressed"]]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-keyboard"),e("QtxKeyboard"),globalThis.__QtxKeyboard_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxKeyboard",Oe),e.component("qtx-keyboard",Oe)}},Qe=k.defineComponent({inheritAttrs:!1,__name:"QtxNumericKeyboard",props:{maxLength:{}},emits:["onNumberPressed"],setup(e,{expose:t}){const o=k.ref(),n=Po("qtx-numeric-keyboard");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,maxLength:e.maxLength,onOnNumberPressed:a[0]||(a[0]=e=>t.$emit("onNumberPressed",e.nativeEvent))},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["maxLength"]))}});let Re;try{const e=require("@extscreen/es3-vue");Re=e.registerElement||(null==(o=e.default)?void 0:o.registerElement)}catch(Do){}const Me={install:e=>{if(!globalThis.__QtxNumericKeyboard_registered)if(Re){const e=e=>{Re(e,{component:{name:"QtxNumericKeyboard",eventNamesMap:new Map([["onNumberPressed","onNumberPressed"]]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-numeric-keyboard"),e("QtxNumericKeyboard"),globalThis.__QtxNumericKeyboard_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxNumericKeyboard",Qe),e.component("qtx-numeric-keyboard",Qe)}},Ue=k.defineComponent({inheritAttrs:!1,__name:"QtxPortalPool",setup(e,{expose:t}){const o=k.ref(),n=Po("qtx-portal-pool");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(e,t)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,style:{position:"absolute"},absolute:!0},e.$attrs),{default:k.withCtx(()=>[k.renderSlot(e.$slots,"default")]),_:3},16))}});let De;try{const e=require("@extscreen/es3-vue");De=e.registerElement||(null==(n=e.default)?void 0:n.registerElement)}catch(Do){}const Ge={install:e=>{if(!globalThis.__QtxPortalPool_registered)if(De){const e=e=>{De(e,{component:{name:"QtxPortalPool",eventNamesMap:new Map([]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-portal-pool"),e("QtxPortalPool"),globalThis.__QtxPortalPool_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxPortalPool",Ue),e.component("qtx-portal-pool",Ue)}},ze=k.defineComponent({inheritAttrs:!1,__name:"QtxPortalItem",props:{portalId:{}},setup(e,{expose:t}){const o=k.ref(),n=Po("qtx-portal-item");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,style:{position:"absolute"},absolute:!0,portalId:e.portalId||""},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["portalId"]))}});let Ve;try{const e=require("@extscreen/es3-vue");Ve=e.registerElement||(null==(a=e.default)?void 0:a.registerElement)}catch(Do){}const je={install:e=>{if(!globalThis.__QtxPortalItem_registered)if(Ve){const e=e=>{Ve(e,{component:{name:"QtxPortalItem",eventNamesMap:new Map([]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-portal-item"),e("QtxPortalItem"),globalThis.__QtxPortalItem_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxPortalItem",ze),e.component("qtx-portal-item",ze)}},Ke=k.defineComponent({inheritAttrs:!1,__name:"QtxHsvBackground",props:{hue:{},hueDuration:{}},setup(e,{expose:t}){const o=k.ref(),n=Po("qtx-hsv-background");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,hue:e.hue,hueDuration:e.hueDuration},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["hue","hueDuration"]))}});let We;try{const e=require("@extscreen/es3-vue");We=e.registerElement||(null==(i=e.default)?void 0:i.registerElement)}catch(Do){}const He={install:e=>{if(!globalThis.__QtxHsvBackground_registered)if(We){const e=e=>{We(e,{component:{name:"QtxHsvBackground",eventNamesMap:new Map([]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-hsv-background"),e("QtxHsvBackground"),globalThis.__QtxHsvBackground_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxHsvBackground",Ke),e.component("qtx-hsv-background",Ke)}},Je=k.defineComponent({inheritAttrs:!1,__name:"QtxSvgImage",props:{src:{},tintColor:{}},setup(e,{expose:t}){const o=k.ref(),n=Po("qtx-svg-image");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,src:e.src||"",tintColor:e.tintColor||""},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["src","tintColor"]))}});let Ye;try{const e=require("@extscreen/es3-vue");Ye=e.registerElement||(null==(l=e.default)?void 0:l.registerElement)}catch(Do){}const Xe={install:e=>{if(!globalThis.__QtxSvgImage_registered)if(Ye){const e=e=>{Ye(e,{component:{name:"QtxSvgImage",eventNamesMap:new Map([]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-svg-image"),e("QtxSvgImage"),globalThis.__QtxSvgImage_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxSvgImage",Je),e.component("qtx-svg-image",Je)}},Ze=k.defineComponent({inheritAttrs:!1,__name:"QtxButtonBase",props:{text:{},icon:{},iconSize:{},iconSpace:{},layoutDirection:{},fontSize:{},maxLines:{},textColor:{},focusTextColor:{},backgroundColor:{},focusBackgroundColor:{},normalBorderWidth:{},normalBorderColor:{},focusBorderColor:{},cornerRadius:{},focusScale:{},enableFocusBorder:{type:Boolean},autofocus:{type:Boolean},contentPadding:{}},emits:["onButtonCustomEvent"],setup(e,{expose:t}){const o=k.ref(),n=Po("qtx-button");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,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,autofocus:e.autofocus,contentPadding:e.contentPadding,onOnButtonCustomEvent:a[0]||(a[0]=e=>t.$emit("onButtonCustomEvent",e.nativeEvent))},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["text","icon","iconSize","iconSpace","layoutDirection","fontSize","maxLines","textColor","focusTextColor","backgroundColor","focusBackgroundColor","normalBorderWidth","normalBorderColor","focusBorderColor","cornerRadius","focusScale","enableFocusBorder","autofocus","contentPadding"]))}}),et=k.defineComponent({inheritAttrs:!1,__name:"QtxButton",props:{width:{},height:{}},setup(e){const t=e,o=k.useAttrs(),n=k.computed(()=>{const e={};void 0!==t.width&&(e.width="number"==typeof t.width?`${t.width}px`:t.width),void 0!==t.height&&(e.height="number"==typeof t.height?`${t.height}px`:t.height);const n=o.style||{};return{...e,..."object"==typeof n?n:{}}});return(e,t)=>(k.openBlock(),k.createBlock(Ze,k.mergeProps(e.$attrs,{style:n.value}),{default:k.withCtx(()=>[k.renderSlot(e.$slots,"default")]),_:3},16,["style"]))}});let tt;try{const e=require("@extscreen/es3-vue");tt=e.registerElement||(null==(r=e.default)?void 0:r.registerElement)}catch(Do){}const ot={install:e=>{if(!globalThis.__QtxButton_registered)if(tt){const e=e=>{tt(e,{component:{name:"QtxButton",eventNamesMap:new Map([["onButtonCustomEvent","onButtonCustomEvent"]]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-button"),e("QtxButton"),globalThis.__QtxButton_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxButton",et),e.component("qtx-button",et)}},nt=k.defineComponent({inheritAttrs:!1,__name:"QtxCheckbox",props:{autofocus:{type:Boolean},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:t}){const o=k.ref(),n=Po("qtx-checkbox");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,autofocus:e.autofocus,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:a[0]||(a[0]=e=>t.$emit("onCheckedChange",e.nativeEvent))},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["autofocus","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 at;try{const e=require("@extscreen/es3-vue");at=e.registerElement||(null==(s=e.default)?void 0:s.registerElement)}catch(Do){}const it={install:e=>{if(!globalThis.__QtxCheckbox_registered)if(at){const e=e=>{at(e,{component:{name:"QtxCheckbox",eventNamesMap:new Map([["onCheckedChange","onCheckedChange"]]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-checkbox"),e("QtxCheckbox"),globalThis.__QtxCheckbox_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxCheckbox",nt),e.component("qtx-checkbox",nt)}},lt=(e,t)=>{const o=e.__vccOpts||e;for(const[n,a]of t)o[n]=a;return o};const rt=lt(k.defineComponent({name:"QtxRadioGroup",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:t})=>({groupStyle:k.computed(()=>({display:"flex",flexDirection:e.direction,alignItems:"center"})),getItemStyle:(t,o)=>{var n;const a={...(null==(n=t.props)?void 0:n.style)||{}};return void 0!==e.itemWidth&&(a.width=e.itemWidth),void 0!==e.itemHeight&&(a.height=e.itemHeight),o!==e.options.length-1&&("row"===e.direction?a.marginRight=e.itemGap:a.marginBottom=e.itemGap),a},onItemClick:e=>{e.disabled||(t("update:modelValue",e.value),t("change",e.value))}})}),[["render",function(e,t,o,n,a,i){const l=k.resolveComponent("qtx-checkbox");return k.openBlock(),k.createElementBlock("div",{class:"na-radio-group",style:k.normalizeStyle(e.groupStyle)},[(k.openBlock(!0),k.createElementBlock(k.Fragment,null,k.renderList(e.options,(t,o)=>(k.openBlock(),k.createBlock(l,k.mergeProps({key:o,type:"radio",checked:e.modelValue===t.value,text:t.label,gravity:e.gravity,showBackground:e.showBackground,disabled:t.disabled},{ref_for:!0},t.props,{style:e.getItemStyle(t,o),onClick:o=>e.onItemClick(t)}),null,16,["checked","text","gravity","showBackground","disabled","style","onClick"]))),128))],4)}],["__scopeId","data-v-cea6e7c9"]]),st={install:e=>{e.component("QtxRadioGroup",rt),e.component("qtx-radio-group",rt)}};const ct=lt(k.defineComponent({name:"QtxCheckboxGroup",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:t})=>({groupStyle:k.computed(()=>({display:"flex",flexDirection:e.direction,alignItems:"center"})),getItemStyle:(t,o)=>{var n;const a={...(null==(n=t.props)?void 0:n.style)||{}};return void 0!==e.itemWidth&&(a.width=e.itemWidth),void 0!==e.itemHeight&&(a.height=e.itemHeight),o!==e.options.length-1&&("row"===e.direction?a.marginRight=e.itemGap:a.marginBottom=e.itemGap),a},onItemClick:o=>{if(o.disabled)return;const n=[...e.modelValue],a=n.indexOf(o.value);a>-1?n.splice(a,1):n.push(o.value),t("update:modelValue",n),t("change",n)}})}),[["render",function(e,t,o,n,a,i){const l=k.resolveComponent("qtx-checkbox");return k.openBlock(),k.createElementBlock("div",{class:"na-checkbox-group",style:k.normalizeStyle(e.groupStyle)},[(k.openBlock(!0),k.createElementBlock(k.Fragment,null,k.renderList(e.options,(t,o)=>(k.openBlock(),k.createBlock(l,k.mergeProps({key:o,type:"checkbox",checked:e.modelValue.includes(t.value),text:t.label,gravity:e.gravity,showBackground:e.showBackground,disabled:t.disabled},{ref_for:!0},t.props,{style:e.getItemStyle(t,o),onClick:o=>e.onItemClick(t)}),null,16,["checked","text","gravity","showBackground","disabled","style","onClick"]))),128))],4)}],["__scopeId","data-v-3e75ffbd"]]),ut={install:e=>{e.component("QtxCheckboxGroup",ct),e.component("qtx-checkbox-group",ct)}},dt=k.defineComponent({inheritAttrs:!1,__name:"QtxSwitcher",props:{autofocus:{type:Boolean},checked:{type:Boolean},disabled:{type:Boolean},title:{},textOn:{},textOff:{},subtitle:{},subtitleColor:{},titleColor:{},focusTitleColor:{},titleTextSize:{},subtitleTextSize:{},stateTextSize:{}},emits:["onCheckedChange"],setup(e,{expose:t}){const o=k.ref(),n=Po("qtx-switcher");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,autofocus:e.autofocus,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:a[0]||(a[0]=e=>t.$emit("onCheckedChange",e.nativeEvent))},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["autofocus","checked","disabled","title","textOn","textOff","subtitle","subtitleColor","titleColor","focusTitleColor","titleTextSize","subtitleTextSize","stateTextSize"]))}});let pt;try{const e=require("@extscreen/es3-vue");pt=e.registerElement||(null==(c=e.default)?void 0:c.registerElement)}catch(Do){}const vt={install:e=>{if(!globalThis.__QtxSwitcher_registered)if(pt){const e=e=>{pt(e,{component:{name:"QtxSwitcher",eventNamesMap:new Map([["onCheckedChange","onCheckedChange"]]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-switcher"),e("QtxSwitcher"),globalThis.__QtxSwitcher_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxSwitcher",dt),e.component("qtx-switcher",dt)}};const ft=lt(k.defineComponent({name:"QtxSettingSwitch",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:t,attrs:o}){const n=k.ref(e.modelValue);k.watch(()=>e.modelValue,e=>{n.value=e});const a=k.computed(()=>"number"==typeof e.width?`${e.width}px`:e.width),i=k.computed(()=>{const t=o.style||{},n=e.subtitle?("number"==typeof e.height?e.height:parseInt(e.height))+30:e.height;return{width:a.value,height:"number"==typeof n?`${n}px`:n,...t}});return{checked:n,handleCheckedChange:e=>{const o=e.checked;n.value=o,t("update:modelValue",o),t("change",o)},mergedStyle:i}}}),[["render",function(e,t,o,n,a,i){const l=k.resolveComponent("qtx-switcher");return k.openBlock(),k.createBlock(l,{class:"na-setting-switch",style:k.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"])}]]),gt={install(e){e.component("QtxSettingSwitch",ft),e.component("qtx-setting-switch",ft)}},mt=k.defineComponent({inheritAttrs:!1,__name:"QtxCollapseMenuGroupBase",props:{icon:{},title:{},titleColor:{},titleSelectedColor:{},titleSize:{},expanded:{type:Boolean},data:{}},emits:["onFocus"],setup(e,{expose:t}){const o=k.ref(),n=Po("qtx-collapse-menu-group");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,icon:e.icon||"",title:e.title||"",titleColor:e.titleColor||"",titleSelectedColor:e.titleSelectedColor||"",titleSize:e.titleSize,expanded:e.expanded,data:e.data,onOnFocus:a[0]||(a[0]=e=>t.$emit("onFocus",e.nativeEvent))},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["icon","title","titleColor","titleSelectedColor","titleSize","expanded","data"]))}}),ht=k.defineComponent({inheritAttrs:!1,__name:"QtxCollapseMenuGroup",setup(e){const t=k.useAttrs(),o=k.computed(()=>({...t.style||{}}));return(e,t)=>(k.openBlock(),k.createBlock(mt,k.mergeProps({style:o.value},e.$attrs),{default:k.withCtx(()=>[k.renderSlot(e.$slots,"default")]),_:3},16,["style"]))}});let yt;try{const e=require("@extscreen/es3-vue");yt=e.registerElement||(null==(u=e.default)?void 0:u.registerElement)}catch(Do){}const xt={install:e=>{if(!globalThis.__QtxCollapseMenuGroup_registered)if(yt){const e=e=>{yt(e,{component:{name:"QtxCollapseMenuGroup",eventNamesMap:new Map([["onFocus","onFocus"]]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-collapse-menu-group"),e("QtxCollapseMenuGroup"),globalThis.__QtxCollapseMenuGroup_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxCollapseMenuGroup",ht),e.component("qtx-collapse-menu-group",ht)}},bt=k.defineComponent({inheritAttrs:!1,__name:"QtxCollapseMenuListBase",props:{data:{},defaultExpandedIndex:{},defaultFocus:{type:Boolean}},emits:["onItemFocus"],setup(e,{expose:t}){const o=k.ref(),n=Po("qtx-collapse-menu-list");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,data:e.data,defaultExpandedIndex:e.defaultExpandedIndex,defaultFocus:e.defaultFocus,onOnItemFocus:a[0]||(a[0]=e=>t.$emit("onItemFocus",e.nativeEvent))},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["data","defaultExpandedIndex","defaultFocus"]))}}),Ct=k.defineComponent({inheritAttrs:!1,__name:"QtxCollapseMenuList",setup(e,{expose:t}){const o=k.useAttrs(),n=k.ref(),a=k.computed(()=>({...o.style||{}}));return t({expandIndex:(e,t=!1)=>{n.value&&S.Native.callUIFunction(n.value.getNativeNode(),"expandIndex",[e,t])},getNativeNode:()=>{var e,t;return null==(t=null==(e=n.value)?void 0:e.getNativeNode)?void 0:t.call(e)}}),(e,t)=>(k.openBlock(),k.createBlock(bt,k.mergeProps({ref_key:"baseRef",ref:n,style:a.value},e.$attrs),{default:k.withCtx(()=>[k.renderSlot(e.$slots,"default")]),_:3},16,["style"]))}});let It;try{const e=require("@extscreen/es3-vue");It=e.registerElement||(null==(d=e.default)?void 0:d.registerElement)}catch(Do){}const kt={install:e=>{if(!globalThis.__QtxCollapseMenuList_registered)if(It){const e=e=>{It(e,{component:{name:"QtxCollapseMenuList",eventNamesMap:new Map([["onItemFocus","onItemFocus"]]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-collapse-menu-list"),e("QtxCollapseMenuList"),globalThis.__QtxCollapseMenuList_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxCollapseMenuList",Ct),e.component("qtx-collapse-menu-list",Ct)}},St=k.defineComponent({inheritAttrs:!1,__name:"QtxInputViewBase",props:{text:{},placeholder:{},type:{},status:{},disabled:{type:Boolean},inputSize:{},cursorVisible:{type:Boolean},useSystemKeyboard:{type:Boolean},trailingIcon:{}},emits:["onInputClick","onChange"],setup(e,{expose:t}){const o=k.ref(),n=Po("qtx-input-view");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,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:a[0]||(a[0]=e=>t.$emit("onInputClick",e.nativeEvent)),onOnChange:a[1]||(a[1]=e=>t.$emit("onChange",e.nativeEvent))},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["text","placeholder","type","status","disabled","inputSize","cursorVisible","useSystemKeyboard","trailingIcon"]))}}),Nt=k.defineComponent({inheritAttrs:!1,__name:"QtxInputView",props:{inputSize:{default:"medium"}},emits:["onInputClick","onChange"],setup(e,{emit:t}){const o=t,n=e,a=k.computed(()=>{let e=60;return"large"===n.inputSize?e=70:"small"===n.inputSize&&(e=50),{height:`${e}px`}}),i=e=>{o("onInputClick",e)},l=e=>{o("onChange",e)};return(t,o)=>(k.openBlock(),k.createBlock(St,k.mergeProps(t.$attrs,{style:a.value,inputSize:e.inputSize,onOnInputClick:i,onOnChange:l}),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["style","inputSize"]))}});let _t;try{const e=require("@extscreen/es3-vue");_t=e.registerElement||(null==(p=e.default)?void 0:p.registerElement)}catch(Do){}const Tt={install:e=>{if(!globalThis.__QtxInputView_registered)if(_t){const e=e=>{_t(e,{component:{name:"QtxInputView",eventNamesMap:new Map([["onInputClick","onInputClick"],["onChange","onChange"]]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-input-view"),e("QtxInputView"),globalThis.__QtxInputView_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxInputView",Nt),e.component("qtx-input-view",Nt)}},wt=k.defineComponent({inheritAttrs:!1,__name:"QtxDatePicker",props:{initialDate:{}},emits:["onDateChanged"],setup(e,{expose:t}){const o=k.ref(),n=Po("qtx-date-picker");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,initialDate:e.initialDate||"",onOnDateChanged:a[0]||(a[0]=e=>t.$emit("onDateChanged",e.nativeEvent))},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["initialDate"]))}});let Pt;try{const e=require("@extscreen/es3-vue");Pt=e.registerElement||(null==(v=e.default)?void 0:v.registerElement)}catch(Do){}const Bt={install:e=>{if(!globalThis.__QtxDatePicker_registered)if(Pt){const e=e=>{Pt(e,{component:{name:"QtxDatePicker",eventNamesMap:new Map([["onDateChanged","onDateChanged"]]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-date-picker"),e("QtxDatePicker"),globalThis.__QtxDatePicker_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxDatePicker",wt),e.component("qtx-date-picker",wt)}},Et=k.defineComponent({inheritAttrs:!1,__name:"QtxRatingBar",props:{numStars:{},rating:{},stepSize:{},isIndicator:{type:Boolean}},emits:["onRatingChanged"],setup(e,{expose:t}){const o=k.ref(),n=Po("qtx-rating-bar");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,numStars:e.numStars,rating:e.rating,stepSize:e.stepSize,isIndicator:e.isIndicator,onOnRatingChanged:a[0]||(a[0]=e=>t.$emit("onRatingChanged",e.nativeEvent))},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["numStars","rating","stepSize","isIndicator"]))}});let Ft;try{const e=require("@extscreen/es3-vue");Ft=e.registerElement||(null==(f=e.default)?void 0:f.registerElement)}catch(Do){}const qt={install:e=>{if(!globalThis.__QtxRatingBar_registered)if(Ft){const e=e=>{Ft(e,{component:{name:"QtxRatingBar",eventNamesMap:new Map([["onRatingChanged","onRatingChanged"]]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-rating-bar"),e("QtxRatingBar"),globalThis.__QtxRatingBar_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxRatingBar",Et),e.component("qtx-rating-bar",Et)}};let $t;try{const e=require("@extscreen/es3-vue");$t=e.registerElement||(null==(g=e.default)?void 0:g.registerElement)}catch(Do){}const Ot={install:e=>{if(!globalThis.__QtxList_registered)if($t){const e=e=>{$t(e,{component:{name:"QtxList",eventNamesMap:new Map([]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-list"),e("QtxList"),globalThis.__QtxList_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxList",Fe),e.component("qtx-list",Fe)}},At=k.defineComponent({name:"QtxTabs",inheritAttrs:!1,props:{active:{},offscreen:{},maxInstances:{},animationDuration:{},animationDirection:{},linkId:{}},emits:["change"],setup(e,{expose:t}){const o=k.ref(),n=Po("qtx-tabs"),a=e;return k.watch(()=>a.active,()=>{Be.forEach(e=>{e.scrolled=!1}),Ee=null}),t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value},changeTab:e=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"changeTab",[e])}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o},t.$attrs,{active:e.active,offscreen:e.offscreen,"max-instances":e.maxInstances,"animation-duration":e.animationDuration,"animation-direction":e.animationDirection,"link-id":e.linkId}),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["active","offscreen","max-instances","animation-duration","animation-direction","link-id"]))}}),Lt=k.defineComponent({name:"QtxTabContent",inheritAttrs:!1,props:{tabKey:{}},setup(e,{expose:t}){const o=k.ref(),n=Po("qtx-tab-content");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o},t.$attrs,{tabKey:e.tabKey}),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["tabKey"]))}});let Qt;try{const e=require("@extscreen/es3-vue");Qt=e.registerElement||(null==(m=e.default)?void 0:m.registerElement)}catch(Do){}function Rt(e,t){Qt(e,{component:{name:t,processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})}const Mt={install:e=>{globalThis.__QtxTabs_registered||(Qt?(Rt("qtx-tabs","QtxTabs"),Rt("QtxTabs","QtxTabs"),Rt("qtx-tab-content","QtxTabContent"),Rt("QtxTabContent","QtxTabContent"),globalThis.__QtxTabs_registered=!0):console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue"))}},Ut=k.defineComponent({inheritAttrs:!1,__name:"QtxPosterBase",props:{poster:{},image:{},imgUrl:{},localSrc:{},fallbackSrc:{},scaleType:{},title:{},subtitle:{},floatTitle:{},floatSubtitle:{},posterType:{},textSize:{},textColor:{},maxLines:{},badge:{},aspectRatio:{},cornerRadius:{},coord:{},state:{},placeholderColor:{},loadingDelayMs:{},focusable:{type:Boolean},focusScale:{},focusBorder:{type:Boolean},focusGlow:{type:Boolean},elevationShadow:{type:Boolean},clickPayload:{},focusPayload:{}},emits:["onClick","onFocus","onBlur","onLongClick","onImageLoadStart","onImageLoadSuccess","onImageLoadError","onStateChange","onBind","onRecycle","onPatch","onBadgeClick"],setup(e,{expose:t}){const o=k.ref(),n=Po("qtx-poster");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value},setImageSource:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setImageSource",e)},setTitle:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setTitle",e)},setSubtitle:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setSubtitle",e)},setBadge:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setBadge",e)},setPosterType:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setPosterType",e)},setAspectRatio:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setAspectRatio",e)},setLoadingState:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setLoadingState",e)},applyPatch:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"applyPatch",e)},cancelImageLoad:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"cancelImageLoad",e)},clear:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"clear",e)},recycle:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"recycle",e)},requestFocus:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"requestFocus",e)},getState:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"getState",e)}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,poster:e.poster||"",image:e.image||"",imgUrl:e.imgUrl||"",localSrc:e.localSrc||"",fallbackSrc:e.fallbackSrc||"",scaleType:e.scaleType||"",title:e.title||"",subtitle:e.subtitle||"",floatTitle:e.floatTitle||"",floatSubtitle:e.floatSubtitle||"",posterType:e.posterType||"",textSize:e.textSize,textColor:e.textColor||"",maxLines:e.maxLines,badge:e.badge,aspectRatio:e.aspectRatio,cornerRadius:e.cornerRadius,coord:e.coord,state:e.state||"",placeholderColor:e.placeholderColor||"",loadingDelayMs:e.loadingDelayMs,focusable:e.focusable,focusScale:e.focusScale,focusBorder:e.focusBorder,focusGlow:e.focusGlow,elevationShadow:e.elevationShadow,clickPayload:e.clickPayload,focusPayload:e.focusPayload,onOnClick:a[0]||(a[0]=e=>t.$emit("onClick",e.nativeEvent)),onOnFocus:a[1]||(a[1]=e=>t.$emit("onFocus",e.nativeEvent)),onOnBlur:a[2]||(a[2]=e=>t.$emit("onBlur",e.nativeEvent)),onOnLongClick:a[3]||(a[3]=e=>t.$emit("onLongClick",e.nativeEvent)),onOnImageLoadStart:a[4]||(a[4]=e=>t.$emit("onImageLoadStart",e.nativeEvent)),onOnImageLoadSuccess:a[5]||(a[5]=e=>t.$emit("onImageLoadSuccess",e.nativeEvent)),onOnImageLoadError:a[6]||(a[6]=e=>t.$emit("onImageLoadError",e.nativeEvent)),onOnStateChange:a[7]||(a[7]=e=>t.$emit("onStateChange",e.nativeEvent)),onOnBind:a[8]||(a[8]=e=>t.$emit("onBind",e.nativeEvent)),onOnRecycle:a[9]||(a[9]=e=>t.$emit("onRecycle",e.nativeEvent)),onOnPatch:a[10]||(a[10]=e=>t.$emit("onPatch",e.nativeEvent)),onOnBadgeClick:a[11]||(a[11]=e=>t.$emit("onBadgeClick",e.nativeEvent))},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["poster","image","imgUrl","localSrc","fallbackSrc","scaleType","title","subtitle","floatTitle","floatSubtitle","posterType","textSize","textColor","maxLines","badge","aspectRatio","cornerRadius","coord","state","placeholderColor","loadingDelayMs","focusable","focusScale","focusBorder","focusGlow","elevationShadow","clickPayload","focusPayload"]))}}),Dt=k.defineComponent({inheritAttrs:!1,__name:"QtxPoster",props:{poster:{},image:{},imgUrl:{},localSrc:{},fallbackSrc:{},scaleType:{},title:{},subtitle:{},floatTitle:{},floatSubtitle:{},posterType:{},textSize:{},textColor:{},maxLines:{},badge:{},aspectRatio:{},cornerRadius:{},coord:{},state:{},placeholderColor:{},loadingDelayMs:{},focusable:{type:Boolean},focusScale:{},focusBorder:{type:Boolean},focusGlow:{type:Boolean},elevationShadow:{type:Boolean},clickPayload:{},focusPayload:{},width:{},height:{}},emits:["click","focus","blur","longClick","imageLoadStart","imageLoadSuccess","imageLoadError","stateChange","bind","recycle","patch","badgeClick"],setup(e,{expose:t,emit:o}){const n=e,a=o,i=k.ref(null),l=k.useAttrs(),r=k.computed(()=>{const e={};void 0!==n.width&&(e.width="number"==typeof n.width?`${n.width}px`:n.width),void 0!==n.height&&(e.height="number"==typeof n.height?`${n.height}px`:n.height);const t=l.style||{};return{...e,..."object"==typeof t?t:{}}});return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=i.value)?void 0:e.getNativeNode)?void 0:t.call(e))||i.value},setImageSource:(e,t)=>{var o,n;const a=(null==(n=null==(o=i.value)?void 0:o.getNativeNode)?void 0:n.call(o))||i.value;a&&S.Native.callUIFunction(a,"setImageSource",[e,t])},setTitle:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"setTitle",[e])},setSubtitle:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"setSubtitle",[e])},setBadge:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"setBadge",[e])},setPosterType:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"setPosterType",[e])},setAspectRatio:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"setAspectRatio",[e])},setLoadingState:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"setLoadingState",[e])},applyPatch:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"applyPatch",[e])},cancelImageLoad:()=>{var e,t;const o=(null==(t=null==(e=i.value)?void 0:e.getNativeNode)?void 0:t.call(e))||i.value;o&&S.Native.callUIFunction(o,"cancelImageLoad",[])},clear:()=>{var e,t;const o=(null==(t=null==(e=i.value)?void 0:e.getNativeNode)?void 0:t.call(e))||i.value;o&&S.Native.callUIFunction(o,"clear",[])},recycle:()=>{var e,t;const o=(null==(t=null==(e=i.value)?void 0:e.getNativeNode)?void 0:t.call(e))||i.value;o&&S.Native.callUIFunction(o,"recycle",[])},requestFocus:()=>new Promise(e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;if(!n)return void e("");let a=!1;const l=t=>{a||(a=!0,e(String(t??"")))};setTimeout(()=>l(""),1200),S.Native.callUIFunction(n,"requestFocus",[],l)}),getState:()=>new Promise(e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;if(!n)return void e({});let a=!1;const l=t=>{a||(a=!0,e(t||{}))};setTimeout(()=>l({}),1200),S.Native.callUIFunction(n,"getState",[],l)})}),(t,o)=>(k.openBlock(),k.createBlock(Ut,k.mergeProps({ref_key:"baseRef",ref:i},{...k.unref(l),...n},{width:e.width,height:e.height,style:r.value,onOnClick:o[0]||(o[0]=e=>a("click",e)),onOnFocus:o[1]||(o[1]=e=>a("focus",e)),onOnBlur:o[2]||(o[2]=e=>a("blur",e)),onOnLongClick:o[3]||(o[3]=e=>a("longClick",e)),onOnImageLoadStart:o[4]||(o[4]=e=>a("imageLoadStart",e)),onOnImageLoadSuccess:o[5]||(o[5]=e=>a("imageLoadSuccess",e)),onOnImageLoadError:o[6]||(o[6]=e=>a("imageLoadError",e)),onOnStateChange:o[7]||(o[7]=e=>a("stateChange",e)),onOnBind:o[8]||(o[8]=e=>a("bind",e)),onOnRecycle:o[9]||(o[9]=e=>a("recycle",e)),onOnPatch:o[10]||(o[10]=e=>a("patch",e)),onOnBadgeClick:o[11]||(o[11]=e=>a("badgeClick",e))}),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["width","height","style"]))}});let Gt;try{const e=require("@extscreen/es3-vue");Gt=e.registerElement||(null==(h=e.default)?void 0:h.registerElement)}catch(Do){}const zt={install:e=>{if(!globalThis.__QtxPoster_registered)if(Gt){const e=e=>{Gt(e,{component:{name:"QtxPoster",eventNamesMap:new Map([["onClick","onClick"],["onFocus","onFocus"],["onBlur","onBlur"],["onLongClick","onLongClick"],["onImageLoadStart","onImageLoadStart"],["onImageLoadSuccess","onImageLoadSuccess"],["onImageLoadError","onImageLoadError"],["onStateChange","onStateChange"],["onBind","onBind"],["onRecycle","onRecycle"],["onPatch","onPatch"],["onBadgeClick","onBadgeClick"]]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-poster"),e("QtxPoster"),globalThis.__QtxPoster_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxPoster",Dt),e.component("qtx-poster",Dt)}},Vt=k.defineComponent({inheritAttrs:!1,__name:"QtxAppIconBase",props:{icon:{},image:{},imgUrl:{},localIcon:{},resName:{},resId:{},filePath:{},assetPath:{},packageName:{},fallbackIcon:{},iconScaleType:{},iconCornerRadius:{},variant:{},banner:{},title:{},appLabel:{},rating:{},price:{},installState:{},progress:{},appTag:{},buttonText:{},aspectRatio:{},cornerRadius:{},span:{},state:{},placeholderColor:{},loadingDelayMs:{},focusable:{type:Boolean},focusScale:{},focusBorder:{type:Boolean},focusGlow:{type:Boolean},clickPayload:{},focusPayload:{},actionPayload:{}},emits:["onClick","onFocus","onBlur","onLongClick","onIconResolved","onIconLoadError","onInstallStateChange","onProgressChange","onBannerAction","onVariantChange","onStateChange","onBind","onRecycle","onPatch","onImageLoadStart","onImageLoadSuccess","onImageLoadError"],setup(e,{expose:t}){const o=k.ref(),n=Po("qtx-app-icon");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value},setAppIcon:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setAppIcon",e)},setLocalIcon:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setLocalIcon",e)},setIconUrl:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setIconUrl",e)},setVariant:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setVariant",e)},setBannerData:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setBannerData",e)},setInstallState:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setInstallState",e)},setProgress:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setProgress",e)},setRatingAndPrice:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setRatingAndPrice",e)},setLabel:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setLabel",e)},applyPatch:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"applyPatch",e)},clearIconCache:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"clearIconCache",e)},requestFocus:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"requestFocus",e)},clear:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"clear",e)},recycle:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"recycle",e)},getState:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"getState",e)},cancelImageLoad:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"cancelImageLoad",e)}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,icon:e.icon||"",image:e.image||"",imgUrl:e.imgUrl||"",localIcon:e.localIcon||"",resName:e.resName||"",resId:e.resId,filePath:e.filePath||"",assetPath:e.assetPath||"",packageName:e.packageName||"",fallbackIcon:e.fallbackIcon||"",iconScaleType:e.iconScaleType||"",iconCornerRadius:e.iconCornerRadius,variant:e.variant||"",banner:e.banner,title:e.title||"",appLabel:e.appLabel||"",rating:e.rating,price:e.price||"",installState:e.installState||"",progress:e.progress,appTag:e.appTag||"",buttonText:e.buttonText||"",aspectRatio:e.aspectRatio,cornerRadius:e.cornerRadius,span:e.span,state:e.state||"",placeholderColor:e.placeholderColor||"",loadingDelayMs:e.loadingDelayMs,focusable:e.focusable,focusScale:e.focusScale,focusBorder:e.focusBorder,focusGlow:e.focusGlow,clickPayload:e.clickPayload,focusPayload:e.focusPayload,actionPayload:e.actionPayload,onOnClick:a[0]||(a[0]=e=>t.$emit("onClick",e.nativeEvent)),onOnFocus:a[1]||(a[1]=e=>t.$emit("onFocus",e.nativeEvent)),onOnBlur:a[2]||(a[2]=e=>t.$emit("onBlur",e.nativeEvent)),onOnLongClick:a[3]||(a[3]=e=>t.$emit("onLongClick",e.nativeEvent)),onOnIconResolved:a[4]||(a[4]=e=>t.$emit("onIconResolved",e.nativeEvent)),onOnIconLoadError:a[5]||(a[5]=e=>t.$emit("onIconLoadError",e.nativeEvent)),onOnInstallStateChange:a[6]||(a[6]=e=>t.$emit("onInstallStateChange",e.nativeEvent)),onOnProgressChange:a[7]||(a[7]=e=>t.$emit("onProgressChange",e.nativeEvent)),onOnBannerAction:a[8]||(a[8]=e=>t.$emit("onBannerAction",e.nativeEvent)),onOnVariantChange:a[9]||(a[9]=e=>t.$emit("onVariantChange",e.nativeEvent)),onOnStateChange:a[10]||(a[10]=e=>t.$emit("onStateChange",e.nativeEvent)),onOnBind:a[11]||(a[11]=e=>t.$emit("onBind",e.nativeEvent)),onOnRecycle:a[12]||(a[12]=e=>t.$emit("onRecycle",e.nativeEvent)),onOnPatch:a[13]||(a[13]=e=>t.$emit("onPatch",e.nativeEvent)),onOnImageLoadStart:a[14]||(a[14]=e=>t.$emit("onImageLoadStart",e.nativeEvent)),onOnImageLoadSuccess:a[15]||(a[15]=e=>t.$emit("onImageLoadSuccess",e.nativeEvent)),onOnImageLoadError:a[16]||(a[16]=e=>t.$emit("onImageLoadError",e.nativeEvent))},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["icon","image","imgUrl","localIcon","resName","resId","filePath","assetPath","packageName","fallbackIcon","iconScaleType","iconCornerRadius","variant","banner","title","appLabel","rating","price","installState","progress","appTag","buttonText","aspectRatio","cornerRadius","span","state","placeholderColor","loadingDelayMs","focusable","focusScale","focusBorder","focusGlow","clickPayload","focusPayload","actionPayload"]))}}),jt=k.defineComponent({inheritAttrs:!1,__name:"QtxAppIcon",props:{icon:{},image:{},imgUrl:{},localIcon:{},resName:{},resId:{},filePath:{},assetPath:{},packageName:{},fallbackIcon:{},iconScaleType:{},iconCornerRadius:{},variant:{},banner:{},title:{},appLabel:{},rating:{},price:{},installState:{},progress:{},appTag:{},buttonText:{},aspectRatio:{},cornerRadius:{},span:{},state:{},placeholderColor:{},loadingDelayMs:{},focusable:{type:Boolean},focusScale:{},focusBorder:{type:Boolean},focusGlow:{type:Boolean},clickPayload:{},focusPayload:{},actionPayload:{},width:{},height:{}},emits:["click","focus","blur","longClick","iconResolved","iconLoadError","installStateChange","progressChange","bannerAction","variantChange","stateChange","bind","recycle","patch","imageLoadStart","imageLoadSuccess","imageLoadError"],setup(e,{expose:t,emit:o}){const n=e,a=o,i=k.ref(null),l=k.useAttrs(),r=k.computed(()=>{const e={};void 0!==n.width&&(e.width="number"==typeof n.width?`${n.width}px`:n.width),void 0!==n.height&&(e.height="number"==typeof n.height?`${n.height}px`:n.height);const t=l.style||{};return{...e,..."object"==typeof t?t:{}}});return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=i.value)?void 0:e.getNativeNode)?void 0:t.call(e))||i.value},setAppIcon:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"setAppIcon",[e])},setLocalIcon:(e,t)=>{var o,n;const a=(null==(n=null==(o=i.value)?void 0:o.getNativeNode)?void 0:n.call(o))||i.value;a&&S.Native.callUIFunction(a,"setLocalIcon",[e,t])},setIconUrl:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"setIconUrl",[e])},setVariant:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"setVariant",[e])},setBannerData:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"setBannerData",[e])},setInstallState:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"setInstallState",[e])},setProgress:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"setProgress",[e])},setRatingAndPrice:(e,t)=>{var o,n;const a=(null==(n=null==(o=i.value)?void 0:o.getNativeNode)?void 0:n.call(o))||i.value;a&&S.Native.callUIFunction(a,"setRatingAndPrice",[e,t])},setLabel:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"setLabel",[e])},applyPatch:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"applyPatch",[e])},clearIconCache:e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;n&&S.Native.callUIFunction(n,"clearIconCache",[e])},requestFocus:()=>new Promise(e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;if(!n)return void e("");let a=!1;const l=t=>{a||(a=!0,e(String(t??"")))};setTimeout(()=>l(""),1200),S.Native.callUIFunction(n,"requestFocus",[],l)}),clear:()=>{var e,t;const o=(null==(t=null==(e=i.value)?void 0:e.getNativeNode)?void 0:t.call(e))||i.value;o&&S.Native.callUIFunction(o,"clear",[])},recycle:()=>{var e,t;const o=(null==(t=null==(e=i.value)?void 0:e.getNativeNode)?void 0:t.call(e))||i.value;o&&S.Native.callUIFunction(o,"recycle",[])},getState:()=>new Promise(e=>{var t,o;const n=(null==(o=null==(t=i.value)?void 0:t.getNativeNode)?void 0:o.call(t))||i.value;if(!n)return void e({});let a=!1;const l=t=>{a||(a=!0,e(t||{}))};setTimeout(()=>l({}),1200),S.Native.callUIFunction(n,"getState",[],l)}),cancelImageLoad:()=>{var e,t;const o=(null==(t=null==(e=i.value)?void 0:e.getNativeNode)?void 0:t.call(e))||i.value;o&&S.Native.callUIFunction(o,"cancelImageLoad",[])}}),(t,o)=>(k.openBlock(),k.createBlock(Vt,k.mergeProps({ref_key:"baseRef",ref:i},{...k.unref(l),...n},{width:e.width,height:e.height,style:r.value,onOnClick:o[0]||(o[0]=e=>a("click",e)),onOnFocus:o[1]||(o[1]=e=>a("focus",e)),onOnBlur:o[2]||(o[2]=e=>a("blur",e)),onOnLongClick:o[3]||(o[3]=e=>a("longClick",e)),onOnIconResolved:o[4]||(o[4]=e=>a("iconResolved",e)),onOnIconLoadError:o[5]||(o[5]=e=>a("iconLoadError",e)),onOnInstallStateChange:o[6]||(o[6]=e=>a("installStateChange",e)),onOnProgressChange:o[7]||(o[7]=e=>a("progressChange",e)),onOnBannerAction:o[8]||(o[8]=e=>a("bannerAction",e)),onOnVariantChange:o[9]||(o[9]=e=>a("variantChange",e)),onOnStateChange:o[10]||(o[10]=e=>a("stateChange",e)),onOnBind:o[11]||(o[11]=e=>a("bind",e)),onOnRecycle:o[12]||(o[12]=e=>a("recycle",e)),onOnPatch:o[13]||(o[13]=e=>a("patch",e)),onOnImageLoadStart:o[14]||(o[14]=e=>a("imageLoadStart",e)),onOnImageLoadSuccess:o[15]||(o[15]=e=>a("imageLoadSuccess",e)),onOnImageLoadError:o[16]||(o[16]=e=>a("imageLoadError",e))}),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["width","height","style"]))}});let Kt;try{const e=require("@extscreen/es3-vue");Kt=e.registerElement||(null==(y=e.default)?void 0:y.registerElement)}catch(Do){}const Wt={install:e=>{if(!globalThis.__QtxAppIcon_registered)if(Kt){const e=e=>{Kt(e,{component:{name:"QtxAppIcon",eventNamesMap:new Map([["onClick","onClick"],["onFocus","onFocus"],["onBlur","onBlur"],["onLongClick","onLongClick"],["onIconResolved","onIconResolved"],["onIconLoadError","onIconLoadError"],["onInstallStateChange","onInstallStateChange"],["onProgressChange","onProgressChange"],["onBannerAction","onBannerAction"],["onVariantChange","onVariantChange"],["onStateChange","onStateChange"],["onBind","onBind"],["onRecycle","onRecycle"],["onPatch","onPatch"],["onImageLoadStart","onImageLoadStart"],["onImageLoadSuccess","onImageLoadSuccess"],["onImageLoadError","onImageLoadError"]]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-app-icon"),e("QtxAppIcon"),globalThis.__QtxAppIcon_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxAppIcon",jt),e.component("qtx-app-icon",jt)}},Ht=k.defineComponent({inheritAttrs:!1,__name:"QtxChannelNavBase",props:{items:{},active:{},orientation:{},itemWidth:{},itemHeight:{},gap:{},paddingLeft:{},paddingTop:{},paddingRight:{},paddingBottom:{},reverseLayout:{type:Boolean},iconPosition:{},itemPadding:{},iconMargin:{},focusedKey:{},gravity:{},align:{},crossAlign:{},fontSize:{},borderRadius:{},iconSize:{},focusBorderWidth:{},normalBg:{},normalText:{},focusBg:{},focusText:{},focusBorderColor:{},selectedBg:{},selectedText:{},disabledBg:{},disabledText:{},indicator:{},indicatorColor:{},indicatorSize:{},badgeBg:{},badgeText:{},scrollMode:{},smoothScroll:{type:Boolean},focusable:{type:Boolean},selectOnFocus:{type:Boolean},focusMemory:{type:Boolean},defaultFocusKey:{},maxPoolSize:{}},emits:["onChange","onFocus","onBlur","onLongClick","onScroll"],setup(e,{expose:t}){const o=k.ref(),n=Po("qtx-channel-nav");return t({getNativeNode:()=>{var e,t;return(null==(t=null==(e=o.value)?void 0:e.getNativeNode)?void 0:t.call(e))||o.value},setActive:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setActive",e)},getActiveKey:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"getActiveKey",e)},getFocusedKey:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"getFocusedKey",e)},requestFocus:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"requestFocus",e)},clearFocus:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"clearFocus",e)},getState:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"getState",e)},scrollToKey:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"scrollToKey",e)},updateItems:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"updateItems",e)},setOrientation:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setOrientation",e)},setStyle:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"setStyle",e)},getItemCount:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"getItemCount",e)},getItemAt:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"getItemAt",e)},getScrollState:(...e)=>{var t,n;const a=(null==(n=null==(t=o.value)?void 0:t.getNativeNode)?void 0:n.call(t))||o.value;a&&S.Native.callUIFunction(a,"getScrollState",e)}}),(t,a)=>(k.openBlock(),k.createBlock(k.unref(n),k.mergeProps({ref_key:"nativeRef",ref:o,items:e.items,active:e.active||"",orientation:e.orientation||"",itemWidth:e.itemWidth,itemHeight:e.itemHeight,gap:e.gap,paddingLeft:e.paddingLeft,paddingTop:e.paddingTop,paddingRight:e.paddingRight,paddingBottom:e.paddingBottom,reverseLayout:e.reverseLayout,iconPosition:e.iconPosition||"",itemPadding:e.itemPadding,iconMargin:e.iconMargin,focusedKey:e.focusedKey||"",gravity:e.gravity||"",align:e.align||"",crossAlign:e.crossAlign||"",fontSize:e.fontSize,borderRadius:e.borderRadius,iconSize:e.iconSize,focusBorderWidth:e.focusBorderWidth,normalBg:e.normalBg||"",normalText:e.normalText||"",focusBg:e.focusBg||"",focusText:e.focusText||"",focusBorderColor:e.focusBorderColor||"",selectedBg:e.selectedBg||"",selectedText:e.selectedText||"",disabledBg:e.disabledBg||"",disabledText:e.disabledText||"",indicator:e.indicator||"",indicatorColor:e.indicatorColor||"",indicatorSize:e.indicatorSize,badgeBg:e.badgeBg||"",badgeText:e.badgeText||"",scrollMode:e.scrollMode||"",smoothScroll:e.smoothScroll,focusable:e.focusable,selectOnFocus:e.selectOnFocus,focusMemory:e.focusMemory,defaultFocusKey:e.defaultFocusKey||"",maxPoolSize:e.maxPoolSize,onOnChange:a[0]||(a[0]=e=>t.$emit("onChange",e.nativeEvent)),onOnFocus:a[1]||(a[1]=e=>t.$emit("onFocus",e.nativeEvent)),onOnBlur:a[2]||(a[2]=e=>t.$emit("onBlur",e.nativeEvent)),onOnLongClick:a[3]||(a[3]=e=>t.$emit("onLongClick",e.nativeEvent)),onOnScroll:a[4]||(a[4]=e=>t.$emit("onScroll",e.nativeEvent))},t.$attrs),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["items","active","orientation","itemWidth","itemHeight","gap","paddingLeft","paddingTop","paddingRight","paddingBottom","reverseLayout","iconPosition","itemPadding","iconMargin","focusedKey","gravity","align","crossAlign","fontSize","borderRadius","iconSize","focusBorderWidth","normalBg","normalText","focusBg","focusText","focusBorderColor","selectedBg","selectedText","disabledBg","disabledText","indicator","indicatorColor","indicatorSize","badgeBg","badgeText","scrollMode","smoothScroll","focusable","selectOnFocus","focusMemory","defaultFocusKey","maxPoolSize"]))}}),Jt=k.defineComponent({name:"QtxChannelNav",inheritAttrs:!1,props:{items:{},active:{},orientation:{},itemWidth:{},itemHeight:{},gap:{},itemPadding:{},iconMargin:{},focusedKey:{},paddingLeft:{},paddingTop:{},paddingRight:{},paddingBottom:{},reverseLayout:{type:Boolean},iconPosition:{},gravity:{},align:{},crossAlign:{},width:{},height:{},fontSize:{},borderRadius:{},iconSize:{},focusBorderWidth:{},normalBg:{},normalText:{},focusBg:{},focusText:{},focusBorderColor:{},selectedBg:{},selectedText:{},disabledBg:{},disabledText:{},indicator:{},indicatorColor:{},indicatorSize:{},badgeBg:{},badgeText:{},scrollMode:{},smoothScroll:{type:Boolean},focusable:{type:Boolean},selectOnFocus:{type:Boolean},linkId:{},focusMemory:{type:Boolean},defaultFocusKey:{},initialActiveKey:{},initialFocusKey:{},focusWithin:{type:Boolean},disableBackToInitial:{type:Boolean},disableBackToTop:{type:Boolean},maxPoolSize:{}},emits:["change","update:active","focus","blur","longClick","scroll"],setup(e,{expose:t,emit:o}){const n=e,a=k.useAttrs(),i=k.ref(null);let l=n.active||"",r=n.initialActiveKey||n.active||"",s=0;k.watch(()=>n.active,e=>{const t=e||"";t&&(l=t),!r&&t&&(r=t)});const c=o,u=k.computed(()=>{const e="number"==typeof n.width?`${n.width}px`:n.width,t="number"==typeof n.height?`${n.height}px`:n.height,o=a.style||{};return"string"==typeof o?`${o};width:${e||"100%"};height:${t||"auto"}`:{...o,width:e||"100%",height:t||"auto"}});function d(e){var t;return null==e?"":"string"==typeof e?e:String(e.key??(null==(t=e.nativeEvent)?void 0:t.key)??"")}function p(e){return null==e||"string"==typeof e?{key:d(e),position:-1}:{key:String(e.key??""),position:Number(e.position??-1),previous:null==e.previous?void 0:String(e.previous),source:null==e.source?void 0:String(e.source),item:e.item}}function v(e){const t=d(e);t&&(l=t),c("change",t,p(e)),c("update:active",t),t&&S.Native.callUIFunction(y(),"setActiveSilent",[t])}function f(e){c("focus",d(e),p(e))}function g(e){c("blur",d(e),p(e))}function m(e){c("longClick",d(e),p(e))}function h(e){c("scroll",{first:Number((null==e?void 0:e.first)??-1),last:Number((null==e?void 0:e.last)??-1)})}function y(){var e,t;return(null==(t=null==(e=i.value)?void 0:e.getNativeNode)?void 0:t.call(e))||i.value}function x(e,t){const o=y();o&&S.Native.callUIFunction(o,e,t)}function b(e,t,o){return new Promise(n=>{const a=y();if(!a)return void n(o);let i=!1;const l=e=>{i||(i=!0,n(e??o))};setTimeout(()=>l(o),1200),S.Native.callUIFunction(a,e,t,l)})}const C={active:"",focused:"",orientation:"horizontal",count:0,generation:0,scrollMode:"center",iconPosition:"left",indicator:"none",reverseLayout:!1,selectOnFocus:!1,focusMemory:!0,focusable:!0,smoothScroll:!0,poolSize:16,itemWidth:160,itemHeight:72,itemPadding:16,iconMargin:12,align:"start",crossAlign:"start",alignLeading:0,alignBetween:0,alignCross:0};return t({getNativeNode:()=>y(),setActive(e){x("setActive",[e])},getActiveKey:()=>b("getActiveKey",[],""),getInitialActiveKey:()=>b("getInitialActiveKey",[],""),handleBack:function(){const e=Date.now();if(e-s<400)return!1;if(!n.disableBackToTop&&Ee&&Ee.scrolled&&(Ee.scrollToTop(),Ee.scrolled=!1,Ee=null,1))return x("focusBack",[]),s=e,!0;if(n.disableBackToInitial)return!1;const t=n.initialActiveKey||r;return!(!t||l===t)&&(x("setActive",[t,"back"]),s=e,!0)},getFocusedKey:()=>b("getFocusedKey",[],""),requestFocus:()=>b("requestFocus",[],""),clearFocus:()=>b("clearFocus",[],""),getState:()=>b("getState",[],C),scrollToKey:e=>b("scrollToKey",[e],""),updateItems:e=>b("updateItems",[e],""),setOrientation:e=>b("setOrientation",[e],""),setStyle:e=>b("setStyle",[e],""),getItemCount:()=>b("getItemCount",[],0),getItemAt:e=>b("getItemAt",[e],{key:"",label:""}),getScrollState:()=>b("getScrollState",[],C)}),(t,o)=>(k.openBlock(),k.createBlock(Ht,k.mergeProps({ref_key:"baseRef",ref:i},{...k.unref(a),...n},{width:e.width,height:e.height,style:u.value,onOnChange:v,onOnFocus:f,onOnBlur:g,onOnLongClick:m,onOnScroll:h}),{default:k.withCtx(()=>[k.renderSlot(t.$slots,"default")]),_:3},16,["width","height","style"]))}});let Yt;try{const e=require("@extscreen/es3-vue");Yt=e.registerElement||(null==(x=e.default)?void 0:x.registerElement)}catch(Do){}const Xt={install:e=>{if(!globalThis.__QtxChannelNav_registered)if(Yt){const e=e=>{Yt(e,{component:{name:"QtxChannelNav",eventNamesMap:new Map([["onChange","onChange"],["onFocus","onFocus"],["onBlur","onBlur"],["onLongClick","onLongClick"],["onScroll","onScroll"]]),processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}})};e("qtx-channel-nav"),e("QtxChannelNav"),globalThis.__QtxChannelNav_registered=!0}else console.warn("[@quicktvui/qtx] Failed to find registerElement from @extscreen/es3-vue");e.component("QtxChannelNav",Jt),e.component("qtx-channel-nav",Jt)}},Zt="1.28.0";class eo extends Error{constructor(e,t,o,n="core"){super(`[qtx] ${t}`),I(this,"code"),I(this,"capability"),I(this,"detail"),this.name="QtxInstallError",this.code=e,this.capability=n,this.detail=o}}const to=["version","env","config","list","core"];function oo(e){const t=(e||"").split(/[.\-+]/).slice(0,3).map(e=>parseInt(e,10)||0);for(;t.length<3;)t.push(0);return 1e6*t[0]+1e3*t[1]+t[2]}function no(e,t){return oo(e)>=oo(t)}async function ao(e,t=3e3){try{const o=await Promise.race([S.Native.callNativeWithPromise(e,"getVersionInfo"),new Promise((e,o)=>setTimeout(()=>o(new Error("probe timeout")),t))]);return o&&"object"==typeof o&&(o.pluginVersion||o.protocolVersion)?{pluginVersion:String(o.pluginVersion||o.protocolVersion||""),protocolVersion:o.protocolVersion?String(o.protocolVersion):void 0,components:o.components||void 0,mode:"plugin"===o.mode?"plugin":"embedded"}:null}catch(Do){return null}}const io="onESPluginStateChanged";function lo(e,t){return new Promise((o,n)=>{const a=S.EventBus,i=S.Native;let l,r=!1;function s(e){r||(r=!0,function(){l&&clearTimeout(l);try{a.$off(io,c)}catch(Do){}}(),e())}function c(t){t&&t.pkg===e.pkg&&(!1!==t.success?1002!==t.status&&s(()=>o()):s(()=>n(new eo("INSTALL_FAILED","core"===e.ns?`插件安装失败 status=${t.status} msg=${t.msg??""}`:`能力 ${e.ns} 插件安装失败(pkg=${e.pkg})status=${t.status} msg=${t.msg??""}`,void 0,e.ns))))}try{a.$on(io,c)}catch(Do){return void n(new eo("INSTALL_FAILED","core"===e.ns?"无法订阅宿主插件状态事件(EventBus 不可用)":`能力 ${e.ns} 无法订阅宿主插件状态事件(EventBus 不可用)`,void 0,e.ns))}l=setTimeout(()=>{ao(e.versionModule).then(a=>{a&&"plugin"===a.mode?s(()=>o()):s(()=>n(new eo("TIMEOUT","core"===e.ns?`插件安装超时(${t}ms)`:`能力 ${e.ns} 插件安装超时(${t}ms,pkg=${e.pkg})`,void 0,e.ns)))})},t);try{i.callNative("ESPluginModule","install",[{pkg:e.pkg}])}catch(Do){s(()=>n(new eo("INSTALL_FAILED",`插件安装指令下发失败:${Do instanceof Error?Do.message:String(Do)}`,void 0,e.ns)))}})}async function ro(e){try{await Promise.race([S.Native.callNativeWithPromise("EsNativeModule","callReflect",{entry:{from:`${e.pkg}.QtxPluginApp`,method:"setup"}}),new Promise(e=>setTimeout(e,3e3))])}catch(Do){console.warn("[qtx] callReflect init skipped:",Do)}}const so=[{ns:"core",pkg:"com.quicktvui.plugin.qtx",module:"QtxPluginApp",versionModule:"QtxVersionModule",minVersion:""},{ns:"version",pkg:"com.quicktvui.plugin.qtx",module:"QtxVersionModule",versionModule:"QtxVersionModule",minVersion:""},{ns:"env",pkg:"com.quicktvui.plugin.qtx",module:"AddonEnvModule",versionModule:"QtxVersionModule",minVersion:""},{ns:"config.gridTabs",pkg:"com.quicktvui.plugin.qtx",module:"GridTabsConfigModule",versionModule:"QtxVersionModule",minVersion:""},{ns:"config.extraUI",pkg:"com.quicktvui.plugin.qtx",module:"ExtraUIConfigModule",versionModule:"QtxVersionModule",minVersion:""}],co=new Map;function uo(e){co.set(e.ns,e)}for(const Go of so)uo(Go);const po=co,vo=/^[a-z][a-z0-9]*(?:\.[a-z][a-z0-9]*)*$/;function fo(e){if(!e||"string"!=typeof e.ns||!vo.test(e.ns))throw new Error(`[qtx] 非法能力命名空间 ns=${e&&e.ns}(应为小写点分单词,如 'file')`);const t=e.ns.split(".")[0];if(to.indexOf(t)>=0)throw new Error(`[qtx] 命名空间 qtx.${e.ns} 的根段 "${t}" 已保留(${to.join("/")}),能力域不得占用`);if(co.has(e.ns))throw new Error(`[qtx] 能力命名空间 qtx.${e.ns} 已注册(pkg=${co.get(e.ns).pkg})`);if(!e.pkg||!e.module||!e.versionModule)throw new Error(`[qtx] 能力 qtx.${e.ns} 注册缺少 pkg/module/versionModule 字段`);if(!e.minVersion)throw new Error(`[qtx] 能力 qtx.${e.ns} 的 minVersion 必须由 qtx-cli generate 写入字面量(与类型同源,禁止手改)`);return co.set(e.ns,e),e}const go=new Map,mo=new Map;function ho(e,t){const o=mo.get(e);if(o)return Promise.resolve(o);let n=go.get(e);if(!n){const o=co.get(e);if(!o)return Promise.reject(new eo("UNKNOWN_CAPABILITY",`未注册的能力命名空间 qtx.${e}(已注册:${Array.from(co.keys()).map(e=>`qtx.${e}`).join(", ")})`,void 0,e));n=async function(e,t){const o="core"===e.ns,n=t.minVersion||e.minVersion||"0.9.0-alpha.7",a=o?t.minProtocolVersion||Zt:void 0,i=t.upgrade||"auto",l=t.timeout||8e3;let r=await ao(e.versionModule);if(r||(await new Promise(e=>setTimeout(e,800)),r=await ao(e.versionModule)),!r&&("auto"===i&&(await lo(e,l),await ro(e),r=await ao(e.versionModule)),!r))throw new eo("PROBE_FAILED",o?`插件未安装且未自动安装(upgrade=${i})。请安装 plugin-qtx(${e.pkg})或改用内嵌 AAR(com.quicktvui:qtx)`:`能力 ${e.ns} 的插件未安装且未自动安装(upgrade=${i},pkg=${e.pkg},版本模块=${e.versionModule},要求 >= ${n})`,{minPluginVersion:n,minProtocolVersion:a},e.ns);if("embedded"===r.mode)return r;const s=no(r.pluginVersion,n),c=!o||no(r.protocolVersion||"",a||"0.0.0");if(!s||!c){if("auto"===i){await lo(e,l),await ro(e);const t=await ao(e.versionModule);t&&(r=t)}if(!no(r.pluginVersion,n))throw new eo("VERSION_TOO_LOW",o?`插件版本过低:plugin=${r.pluginVersion},本库要求 >= ${n}。请升级 plugin-qtx`:`能力 ${e.ns} 插件版本过低:plugin=${r.pluginVersion},本库要求 >= ${n}(pkg=${e.pkg})。请升级对应能力插件`,{...r,minPluginVersion:n,minProtocolVersion:a},e.ns);if(o&&!no(r.protocolVersion||"",a||"0.0.0"))throw new eo("PROTOCOL_MISMATCH",`指令协议不兼容:插件 protocol=${r.protocolVersion},本库要求 >= ${a}(plugin=${r.pluginVersion})。请升级 plugin-qtx 或降级 @quicktvui/qtx`,{...r,minPluginVersion:n,minProtocolVersion:a},e.ns)}return r}(o,t||{}).then(t=>(mo.set(e,t),t),t=>{throw go.delete(e),t}),go.set(e,n)}return n}function yo(e){return mo.get(e)||null}const xo=new Set(["then","catch","finally","toJSON","constructor","prototype","__proto__","valueOf","toString","toLocaleString","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","inspect","nodeType","tagName","name","length","caller","arguments"]),bo=new Set(["ready","preheat","getInfo"]);function Co(e){return null!==e&&"object"==typeof e?JSON.stringify(e):e}function Io(e){const t=new Map,o={ready:()=>ho(e),preheat:()=>ho(e).then(()=>{}),getInfo:()=>yo(e)};return new Proxy({},{get(n,a,i){if("symbol"!=typeof a){if(bo.has(a))return o[a];if(!xo.has(a))return(o=>{let n=t.get(o);return n||(n=(...t)=>{const n=co.get(e);return n?ho(e).then(()=>S.Native.callNativeWithPromise(n.module,o,...t.map(Co))):Promise.reject(new eo("UNKNOWN_CAPABILITY",`未注册的能力命名空间 qtx.${e}`,void 0,e))},t.set(o,n)),n})(a)}},has:(e,t)=>"string"==typeof t&&!xo.has(t)})}function ko(e){return!!e&&"object"==typeof e}function So(e){for(const t of Array.from(co.keys())){if("core"===t)continue;const o=t.split(".");let n=e;for(let e=0;e<o.length-1;e++){const t=o[e];Object.prototype.hasOwnProperty.call(n,t)&&ko(n[t])||(n[t]={}),n=n[t]}const a=o[o.length-1];Object.prototype.hasOwnProperty.call(n,a)||Object.defineProperty(n,a,{configurable:!0,enumerable:!0,get:()=>Io(t)})}}function No(e){return{pluginVersion:e.pluginVersion,protocolVersion:e.protocolVersion||"",components:e.components||{},mode:e.mode}}function _o(e){return ho("core",function(e){return{minVersion:null==e?void 0:e.minPluginVersion,minProtocolVersion:null==e?void 0:e.minProtocolVersion,upgrade:null==e?void 0:e.upgrade,timeout:null==e?void 0:e.timeout}}(e)).then(No)}function To(e){return _o(e)}const wo=[300,800,1600,3e3];function Po(e){return k.defineComponent({name:`${e}Gate`,inheritAttrs:!1,setup(t,{slots:o,attrs:n,expose:a}){const i=k.ref("loading"),l=k.ref(""),r=k.ref(null);let s,c=0;const u=()=>{void 0!==s&&(clearTimeout(s),s=void 0)},d=(t=!1)=>{t&&(u(),c=0),i.value="loading",l.value="",To().then(()=>{i.value="ready"}).catch(t=>{if(c<wo.length){const t=wo[c];return c+=1,console.warn(`[QTX-GATE] ${e} bootstrap failed, retry ${c}/${wo.length} in ${t}ms`),void(s=setTimeout(()=>d(),t))}i.value="error",l.value=t instanceof Error?t.message:String(t)})};return k.onMounted(()=>d(!0)),k.onUnmounted(u),a({getNativeNode:()=>r.value}),()=>"ready"===i.value?k.h(e,{ref:r,...n},o):"error"===i.value?k.h("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"8px",backgroundColor:"#2B2B2B",borderRadius:"4px",width:"100%",height:"100%"},onClick:()=>d(!0)},[k.h("qt-text",{text:`${l.value}(点击重试)`,style:{fontSize:"14px",color:"#FF6B6B",textAlign:"center"}})]):k.h("div",{style:{width:"100%",height:"100%",backgroundColor:"#2E2E2E",borderRadius:"4px"},...n},[])}})}const Bo=Io("config.gridTabs"),Eo=Io("config.extraUI");async function Fo(e){try{const t=await Bo.setDefaultConfig(e);return!(!t||!t.success)}catch(t){return console.error("[qtx] Failed to initialize GridTabs global config:",t),!1}}async function qo(e){try{const t=await Eo.setThemeConfig(e);return!(!t||!t.success)}catch(t){return console.error("[qtx] Failed to initialize ExtraUI global theme:",t),!1}}const $o="com.quicktvui.qtx.list.QtxListCommandHub";let Oo=null;const Ao=[];function Lo(e){if(Oo=e,null!=e&&Ao.length>0){const e=Ao.splice(0);for(const{key:t,nodeId:o}of e)Qo(t,o)}}async function Qo(e,t){if(null==Oo)return Ao.some(o=>o.key===e&&o.nodeId===t)||Ao.push({key:e,nodeId:t}),console.warn("[qtx-portal] registerPortalLive: 列表 viewId 未就绪,挂起 key="+e),!1;try{const o=await S.Native.callNativeWithPromise("EsNativeModule","callReflect",{entry:{from:$o,method:"registerPortal",params:[Oo,e,String(t)]}});return("string"==typeof o?o:String((o&&(o.result??o.data))??JSON.stringify(o))).includes("OK")}catch(Do){return console.warn("[qtx-portal] registerPortalLive failed:",Do),!1}}const Ro={mounted(e,t){const o=t.value,n=function(e){if(null==e)return null;if("number"==typeof e.nodeId)return e.nodeId;if(null!=e.$el&&"number"==typeof e.$el.nodeId)return e.$el.nodeId;if("function"==typeof e.getNativeNode)try{const t=e.getNativeNode();if(t&&"number"==typeof t.nodeId)return t.nodeId}catch(Do){}return null}(e);null!=o&&null!=n?(e.__qtxPortalKey=o,Qo(String(o),n)):console.warn("[qtx-portal] v-portal-to 无法捕获 nodeId, key=",o,e)},unmounted(e){delete e.__qtxPortalKey}};let Mo;fo({ns:"file",pkg:"com.quicktvui.plugin.qtx.file",module:"QtxFileModule",versionModule:"QtxFileVersionModule",minVersion:"0.1.0"}),Io("file");try{const e=require("@extscreen/es3-vue");Mo=e.registerElement||(null==(b=e.default)?void 0:b.registerElement)}catch(Do){}const Uo={version:Io("version"),env:Io("env"),config:{gridTabs:Io("config.gridTabs"),extraUI:Io("config.extraUI")},install:e=>{e.directive("portal-to",Ro),!globalThis.__QtxRelocatePool_registered&&Mo&&(Mo("qtx-relocate-pool",{component:{name:"QtxRelocatePool",processEventData(e,t){const o=e.handler||e,n=t||(null==o?void 0:o.nativeParams)||{};return o&&(o.nativeEvent=n),o}}}),globalThis.__QtxRelocatePool_registered=!0);try{const e="undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:{};!e.__QTX_STYLE_SNAPSHOT__&&Array.isArray(e.__HIPPY_VUE_STYLES__)&&(e.__QTX_STYLE_SNAPSHOT__=e.__HIPPY_VUE_STYLES__.slice())}catch(Do){}e.use(w),e.use(Le),e.use(Me),e.use(Ge),e.use(je),e.use(He),e.use(Xe),e.use(ot),e.use(it),e.use(st),e.use(ut),e.use(vt),e.use(gt),e.use(xt),e.use(kt),e.use(Tt),e.use(Bt),e.use(qt),e.use(Ot),e.use(Mt),e.use(zt),e.use(Wt),e.use(Xt),_o().catch(e=>{console.error(e instanceof Error?e.message:e)})}};So(Uo),exports.CAPABILITIES=po,exports.QTX_CHANNEL_NAV_EVENTS=["change","update:active","focus","blur","longClick","scroll"],exports.QTX_LIST_EVENTS=["item-click","item-focus","item-bind","item-unbind","load-more"],exports.QtxAppIcon=jt,exports.QtxAppIconPlugin=Wt,exports.QtxButton=et,exports.QtxButtonPlugin=ot,exports.QtxChannelNav=Jt,exports.QtxChannelNavPlugin=Xt,exports.QtxCheckbox=nt,exports.QtxCheckboxGroup=ct,exports.QtxCheckboxGroupPlugin=ut,exports.QtxCheckboxPlugin=it,exports.QtxCollapseMenuGroup=ht,exports.QtxCollapseMenuGroupPlugin=xt,exports.QtxCollapseMenuList=Ct,exports.QtxCollapseMenuListPlugin=kt,exports.QtxDatePicker=wt,exports.QtxDatePickerPlugin=Bt,exports.QtxGridTabs=_,exports.QtxGridTabsPlugin=w,exports.QtxHsvBackground=Ke,exports.QtxHsvBackgroundPlugin=He,exports.QtxInputView=Nt,exports.QtxInputViewPlugin=Tt,exports.QtxInstallError=eo,exports.QtxKeyboard=Oe,exports.QtxKeyboardPlugin=Le,exports.QtxList=Fe,exports.QtxListPlugin=Ot,exports.QtxNumericKeyboard=Qe,exports.QtxNumericKeyboardPlugin=Me,exports.QtxPortalItem=ze,exports.QtxPortalItemPlugin=je,exports.QtxPortalPool=Ue,exports.QtxPortalPoolPlugin=Ge,exports.QtxPoster=Dt,exports.QtxPosterPlugin=zt,exports.QtxRadioGroup=rt,exports.QtxRadioGroupPlugin=st,exports.QtxRatingBar=Et,exports.QtxRatingBarPlugin=qt,exports.QtxSettingSwitch=ft,exports.QtxSettingSwitchPlugin=gt,exports.QtxStyledList=$e,exports.QtxSvgImage=Je,exports.QtxSvgImagePlugin=Xe,exports.QtxSwitcher=dt,exports.QtxSwitcherPlugin=vt,exports.QtxTabContent=Lt,exports.QtxTabs=At,exports.QtxTabsPlugin=Mt,exports.RESERVED_NAMESPACE_ROOTS=to,exports.attachCapabilityNamespaces=So,exports.captureItemTemplate=ie,exports.compactStylePack=Ce,exports.createQtxGate=Po,exports.default=Uo,exports.defineCapability=Io,exports.ensureCapability=ho,exports.ensureQtxReady=To,exports.getCapabilityInfo=yo,exports.getCapabilitySpec=function(e){return co.get(e)||null},exports.getPortalListViewId=function(){return Oo},exports.getQtxReadyInfo=function(){const e=yo("core");return e?No(e):null},exports.getStylePack=ke,exports.glintStylePack=xe,exports.initExtraUIGlobalTheme=qo,exports.initGlobalTheme=async function(e){const t=await qo(e),o=await Fo({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 t&&o},exports.initGridTabsGlobalConfig=Fo,exports.installQtx=_o,exports.isKnownPresetViewType=Ne,exports.isVersionAtLeast=function(e,t){return no(e,t)},exports.listPresetViewTypes=Se,exports.listStylePacks=function(){return[...Ie.values()]},exports.presetItem=_e,exports.qtx=Uo,exports.registerCapability=fo,exports.registerPortalLive=Qo,exports.registerStylePack=function(e){if(!e||!e.id||!e.itemTypes)throw new Error("[qtx] 风格包必须包含 id 与 itemTypes");Ie.set(e.id,{...e,rendering:e.rendering||"native"})},exports.resolvePresetViewType=we,exports.setPortalListViewId=Lo,exports.styledRows=Te,exports.useGridTabs=function(e,t){const o=k.ref(""),n=t?JSON.parse(JSON.stringify(t)):{},a=k.shallowRef([]),i=k.shallowRef([]);let l=!1,r=!1;const s="__virtual_single_tab__";let c="",u=!1;const d=k.ref({}),p=t=>{const o=Array.isArray(t)?t:[t];if(r&&e.value){if("function"==typeof e.value.dispatchAction)return void e.value.dispatchAction(o);let t=e.value;"function"==typeof e.value.getNativeNode?t=e.value.getNativeNode()||e.value:e.value.nativeRef&&(t=e.value.nativeRef),t?S.Native.callUIFunction(t,"dispatchAction",[JSON.stringify(o)]):console.warn("[useGridTabs] Native target is null or undefined, cannot call dispatchAction")}},v=(e,t)=>{if(!e)return!1;let o=!0;return e.id||(console.error(`[useGridTabs] ❌ 数据格式错误 (${t}): 卡片缺失必填字段 'id'。每个卡片必须有唯一标识才能进行后续更新!`,e),o=!1),e.viewType||(console.error(`[useGridTabs] ❌ 数据格式错误 (${t}): 卡片缺失必填字段 'viewType' (id: ${e.id||"未知"})。必须指定 Native 注册的视图类型或 Portal 标识!`,e),o=!1),o},f=(e,t)=>{if(!e||0===e.length)return;g.clear();const o=e[0].hasOwnProperty("tabId")||e[0].hasOwnProperty("items")&&Array.isArray(e[0].items);l="1d"===t,"1d"===t&&o?console.error("[useGridTabs] ❌ 赋值错误: 你正在向 `items.value` (一维瀑布流) 赋值二维 Tabs 数据结构!请改用 `tabs.value = ...`"):"2d"!==t||o||console.error("[useGridTabs] ❌ 赋值错误: 你正在向 `tabs.value` (二维导航) 赋值一维卡片列表数据结构!请改用 `items.value = ...`"),"1d"===t?e.forEach((e,t)=>v(e,`items.value[${t}]`)):e.forEach((e,t)=>{((e,t)=>{if(!e)return!1;let o=!0;e.tabId||(console.error(`[useGridTabs] ❌ 数据格式错误 (${t}): Tab 缺失必填字段 'tabId'。每个 Tab 必须有唯一标识!`,e),o=!1),void 0!==e.title&&null!==e.title||console.warn(`[useGridTabs] ⚠️ 数据格式警告 (${t}): Tab 缺失 'title' 字段 (tabId: ${e.tabId||"未知"}),导航栏可能显示为空。`,e)})(e,`tabs.value[${t}]`),e.items&&Array.isArray(e.items)&&e.items.forEach((e,o)=>v(e,`tabs.value[${t}].items[${o}]`))}),r=!0,m()},g=new Set,m=(e="unknown")=>{if(!r)return void console.warn("[useGridTabs] triggerRootUpdate skipped because isInitialized is false");let t={protocolVersion:"1.28.0",gridBasis:(null==n?void 0:n.gridBasis)??30,unitType:(null==n?void 0:n.unitType)??"px",contentConfig:(null==n?void 0:n.contentConfig)??(null==n?void 0:n.layoutConfig)??{box:{padding:[0,60,60,60]},navContentGapNormal:0,itemGap:24},navConfig:(null==n?void 0:n.navConfig)??{dock:"left",mode:"fixed",renderType:"smart-hybrid",box:{size:[200,0]},expandedBox:{size:[300,0]}},cacheConfig:(null==n?void 0:n.cacheConfig)??{offscreenPageLimit:1,prefetchOffset:2,preLoadEnabled:!1,strategy:"data_priority"},animationConfig:(null==n?void 0:n.animationConfig)??{duration:300,easing:"ease-out"},interactionStrategy:(null==n?void 0:n.interactionStrategy)??{defaultFocus:"nav",interceptBack:!0,backMode:"home-first",autoScrollToTop:!0,edgeScrollProtection:.5},focusConfig:(null==n?void 0:n.focusConfig)??{boundaryLock:{left:!1,right:!1,top:!1,bottom:!1}},themeConfig:null==n?void 0:n.themeConfig,referenceResolution:(null==n?void 0:n.referenceResolution)??{w:1920,h:1080}},u=[];l?(t.navConfig={...t.navConfig,renderType:"none"},u=[{tabId:s,title:"Virtual Tab",hidden:!0,items:i.value}]):u=a.value;const d=JSON.stringify({page_spec:t,tabs:u});if(""===o.value)o.value=d,c=d;else{if(c===d)return;o.value=d,c=d,p({op:"RELOAD_TABS",payload:{pageSpec:t,page_spec:t,tabs:u}})}},h=e=>{if(!e||"object"!=typeof e)return e;if(e.__isGridTabsProxy)return e;e.content&&"object"==typeof e.content&&!e.content.__isGridTabsProxy&&(e.content=new Proxy(e.content,{set(t,o,n,a){const i=Reflect.set(t,o,n,a);return e.id&&r&&p({op:"UPDATE_ITEM",itemId:e.id,payload:e}),i}}),Object.defineProperty(e.content,"__isGridTabsProxy",{value:!0,enumerable:!1}),Object.defineProperty(e.content,"__v_skip",{value:!0,enumerable:!1})),e.subItems&&Array.isArray(e.subItems)&&!e.subItems.__isGridTabsProxy&&(e.subItems=y(e.subItems,e.id),Object.defineProperty(e.subItems,"__isGridTabsProxy",{value:!0,enumerable:!1}),Object.defineProperty(e.subItems,"__v_skip",{value:!0,enumerable:!1}));const t=new Proxy(e,{set(e,t,o,n){const a=Reflect.set(e,t,o,n);return e.id&&r&&!u&&p({op:"UPDATE_ITEM",itemId:e.id,payload:e}),a}});return Object.defineProperty(t,"__isGridTabsProxy",{value:!0,enumerable:!1}),Object.defineProperty(t,"__v_skip",{value:!0,enumerable:!1}),t},y=(e,t)=>{for(let o=0;o<e.length;o++)e[o]=h(e[o]);return new Proxy(e,{get:(e,o,n)=>"push"===o?(...o)=>{o.forEach((e,t)=>v(e,`push(${t})`)),r||console.error("[useGridTabs] ❌ 时机错误: 在底层还未完成初始化时调用了 push()。请先对 items.value 或 tabs.value 进行全量赋值!");const n=o.map(e=>h(e)),a=Array.prototype.push.apply(e,n);return u||p({op:"APPEND_SUB_ITEMS",itemId:t,payload:{subItems:n}}),a}:"unshift"===o?(...o)=>{o.forEach((e,t)=>v(e,`unshift(${t})`)),r||console.error("[useGridTabs] ❌ 时机错误: 在底层还未完成初始化时调用了 unshift()。请先对 items.value 或 tabs.value 进行全量赋值!");const n=o.map(e=>h(e)),a=Array.prototype.unshift.apply(e,n);return r&&n.length>0&&!u&&p({op:"PREPEND_SUB_ITEMS",itemId:t,payload:{subItems:n}}),a}:"splice"===o?(...o)=>{const n=o.length>=2&&0===o[0]&&o[1]===e.length,a=Array.prototype.splice.apply(e,o);return r&&n&&t!==s?u||p({op:"CLEAR_SUB_ITEMS",itemId:t}):r&&(u||m("items array spliced")),a}:Reflect.get(e,o,n),set(e,t,o,n){if("length"!==t&&!isNaN(Number(t))){r||console.error(`[useGridTabs] ❌ 时机错误: 在底层还未完成初始化时直接修改了索引 [${String(t)}]。请先对 items.value 或 tabs.value 进行全量赋值!`),v(o,`索引赋值 [${String(t)}]`);const a=h(o),i=Reflect.set(e,t,a,n);return a&&a.id&&!u&&p({op:"UPDATE_ITEM",itemId:a.id,payload:a}),i}return Reflect.set(e,t,o,n)}})},x=e=>(e.items&&Array.isArray(e.items)&&!e.items.__isGridTabsProxy&&(e.items=y(e.items,e.tabId),Object.defineProperty(e.items,"__isGridTabsProxy",{value:!0,enumerable:!1})),new Proxy(e,{set(e,t,o,n){if("items"===t){let a=o;Array.isArray(o)&&!o.__isGridTabsProxy&&(a=y(o,e.tabId),Object.defineProperty(a,"__isGridTabsProxy",{value:!0,enumerable:!1}));return Reflect.set(e,t,a,n)}if("loadState"===t){const a=Reflect.set(e,t,o,n);return r&&e.tabId&&!u&&p({op:"UPDATE_TAB_STATE",itemId:e.tabId,payload:{loadState:o}}),a}return Reflect.set(e,t,o,n)}}));k.watch(a,(e,t)=>{if(!e||0===e.length)return o.value="",c="",void(r=!1);if(e.__isGridTabsProxy)m();else{const t=(e=>{const t=e.map(e=>x(e));return new Proxy(t,{set(e,t,o,n){if("length"!==t&&!isNaN(Number(t))){let a=o;o.__isGridTabsProxy||(a=x(o),Object.defineProperty(a,"__isGridTabsProxy",{value:!0,enumerable:!1}));const i=Reflect.set(e,t,a,n);return m(),i}return Reflect.set(e,t,o,n)}})})(e);Object.defineProperty(t,"__isGridTabsProxy",{value:!0,enumerable:!1}),f(t,"2d"),a.value=t}},{flush:"sync",deep:!1}),k.watch(i,(e,t)=>{if(!e||0===e.length)return o.value="",c="",void(r=!1);if(e.__isGridTabsProxy)m();else{const t=y(e,s);Object.defineProperty(t,"__isGridTabsProxy",{value:!0,enumerable:!1}),f(t,"1d"),i.value=t}},{flush:"sync",deep:!1});const b={},C=k.computed(()=>({tabsData:o.value,onTabNeedsData:async(...e)=>{let t=e[0];if(t&&t.nativeEvent&&(t=t.nativeEvent),!d.value.onTabNeedsData)return;const{tabId:o,index:n,reason:i}=t;if(!g.has(o)){g.add(o);try{const e=await d.value.onTabNeedsData(o,n,i);if(e&&Array.isArray(e))if(b[o]=1,e.length>0){const t=a.value.find(e=>e.tabId===o);t&&(t.items?t.items.length>0&&t.items.splice(0,t.items.length):t.items=[],t.items.push(...e),t.loadState="ready",p({op:"UPDATE_TAB_STATE",itemId:o,payload:{loadState:"ready"}}))}else console.warn(`[useGridTabs] ⚠️ 警告: onTabNeedsData(tabId="${o}") 返回了空数组 []!`),console.warn("👉 如果你已经在此函数内手动调用了 push() 来追加数据,请在最后 return null 或 undefined。"),console.warn("👉 如果该 Tab 确实没有数据,返回 [] 可能会导致底层的 Header 等已有元素被清空,请注意检查。"),console.warn("👉 框架已为您拦截此次空数组覆盖,保留了当前的 DOM 结构。")}catch(l){console.error("[useGridTabs] onTabNeedsData 执行失败:",l),g.delete(o)}}},onLoadMore:async(...e)=>{let t=e[0];if(t&&t.nativeEvent&&(t=t.nativeEvent),!d.value.onLoadMore)return;const{tabId:o,itemId:n}=t,r=(b[o]||1)+1;try{const e=await d.value.onLoadMore(o,r,n);if(e&&Array.isArray(e))if(e.length>0)if(b[o]=r,l)i.value.push(...e);else{const t=a.value.find(e=>e.tabId===o);t&&t.items&&t.items.push(...e)}else console.warn(`[useGridTabs] ⚠️ 警告: onLoadMore(tabId="${o}", pageNo="${r}") 返回了空数组 []!`),console.warn('👉 如果这是你的最后一页数据,推荐在卡片列表中追加一个 type="no_more" 的 footer 卡片,而不是仅仅返回空。'),console.warn("👉 框架已忽略本次空数据追加,且不会自增页码。")}catch(s){console.error("[useGridTabs] onLoadMore 业务层请求失败:",s)}},onItemPresence:(...e)=>{let t=e[0];if(d.value.onItemPresence)try{let e="string"==typeof t?t:(null==t?void 0:t.nativeEvent)||t;e&&"string"==typeof e.data&&(e=e.data);const o="string"==typeof e?JSON.parse(e):e;o&&"VIEW_PRESENCE_BATCH"===o.type&&Array.isArray(o.payload)?o.payload.forEach(e=>{e.itemId&&"string"==typeof e.itemId&&e.itemId.startsWith("fallback_pos_")&&console.warn(`[useGridTabs] ⚠️ 警告:检测到列表项曝光 (index=${e.index}),但未配置 itemId。请检查传入的 items 数组,务必为每个数据项指定唯一的 itemId,否则底层无法准确进行去重与曝光上报。`),d.value.onItemPresence(e)}):d.value.onItemPresence(o)}catch(o){console.error("[useGridTabs] Failed to parse onItemPresence event payload:",o),d.value.onItemPresence(t)}},onTabSelected:(...e)=>{let t=e[0];t&&t.nativeEvent&&(t=t.nativeEvent),d.value.onTabSelected&&d.value.onTabSelected(t)},onTabClick:(...e)=>{let t=e[0];t&&t.nativeEvent&&(t=t.nativeEvent),d.value.onTabClick&&d.value.onTabClick(t)},onItemClick:(...e)=>{let t=e[0];if(t&&t.nativeEvent&&(t=t.nativeEvent),d.value.onItemClick)try{let e="string"==typeof t?t:(null==t?void 0:t.data)||t;const n="string"==typeof e?JSON.parse(e):e;if(n&&"string"==typeof n.clickPayload)try{n.clickPayload=JSON.parse(n.clickPayload)}catch(o){console.warn("Failed to parse clickPayload:",o)}if(n&&"string"==typeof n.focusPayload)try{n.focusPayload=JSON.parse(n.focusPayload)}catch(o){console.warn("Failed to parse focusPayload:",o)}d.value.onItemClick(n)}catch(o){console.error("[useGridTabs] Failed to parse onItemClick event payload:",o),d.value.onItemClick(t)}else console.warn("[useGridTabs] onItemClick triggered but NO callback registered in callbacksRef!")},onItemLongClick:(...e)=>{let t=e[0];if("number"==typeof t&&e.length>=3&&"string"==typeof e[1]&&(t=e[2]),t&&t.nativeEvent&&(t=t.nativeEvent),d.value.onItemLongClick)try{let e="string"==typeof t?t:(null==t?void 0:t.data)||t;const n="string"==typeof e?JSON.parse(e):e;if(n&&"string"==typeof n.clickPayload)try{n.clickPayload=JSON.parse(n.clickPayload)}catch(o){}if(n&&"string"==typeof n.focusPayload)try{n.focusPayload=JSON.parse(n.focusPayload)}catch(o){}d.value.onItemLongClick(n)}catch(o){console.error("[useGridTabs] Failed to parse onItemLongClick event payload:",o),d.value.onItemLongClick(t)}},onItemFocused:(...e)=>{let t=e[0];if(t&&t.nativeEvent&&(t=t.nativeEvent),d.value.onItemFocused)try{let e="string"==typeof t?t:(null==t?void 0:t.data)||t;const n="string"==typeof e?JSON.parse(e):e;if(n&&"string"==typeof n.clickPayload)try{n.clickPayload=JSON.parse(n.clickPayload)}catch(o){}if(n&&"string"==typeof n.focusPayload)try{n.focusPayload=JSON.parse(n.focusPayload)}catch(o){}d.value.onItemFocused(n)}catch(o){console.error("[useGridTabs] Failed to parse onItemFocused event payload:",o),d.value.onItemFocused(t)}},onTabFocused:(...e)=>{let t=e[0];t&&t.nativeEvent&&(t=t.nativeEvent),d.value.onTabFocused&&d.value.onTabFocused(t)},onScroll:(...e)=>{let t=e[0];if(t&&t.nativeEvent&&(t=t.nativeEvent),d.value.onScroll)try{const e=(null==t?void 0:t.data)||t;d.value.onScroll(e)}catch(o){d.value.onScroll(t)}},onScrollStateChanged:(...e)=>{let t=e[0];if(t&&t.nativeEvent&&(t=t.nativeEvent),d.value.onScrollStateChanged)try{const e=(null==t?void 0:t.data)||t;d.value.onScrollStateChanged(e)}catch(o){d.value.onScrollStateChanged(t)}}}));return{tabsDataStr:o,bindings:C,tabs:a,items:i,initData:e=>{if(!e||0===e.length)return o.value="",void(r=!1);e[0].hasOwnProperty("tabId")||e[0].hasOwnProperty("items")&&Array.isArray(e[0].items)?a.value=e:i.value=e},setCallbacks:e=>{d.value=e},updateItem:(e,t)=>{if(r){p({op:"UPDATE_ITEM",itemId:e,payload:t}),u=!0;try{if(l){const o=i.value.find(t=>t.id===e);o&&Object.assign(o,t)}else for(const o of a.value)if(o.items){const n=o.items.find(t=>t.id===e);if(n){Object.assign(n,t);break}}}finally{u=!1}}else console.error("[useGridTabs] ❌ 时机错误: 尚未初始化数据,无法调用 updateItem")},deleteItem:(e,t=!0)=>{if(r){p({op:"DELETE_ITEM",itemId:e,payload:{animated:t}}),u=!0;try{if(l){const t=i.value.findIndex(t=>t.id===e);-1!==t&&i.value.splice(t,1)}else for(const t of a.value)if(t.items){const o=t.items.findIndex(t=>t.id===e);if(-1!==o){t.items.splice(o,1);break}}}finally{u=!1}}},prependItems:(e,t)=>{if(r){p({op:"PREPEND_SUB_ITEMS",itemId:e,payload:{subItems:t}}),u=!0;try{if(l)i.value.unshift(...t);else{const o=a.value.find(t=>t.tabId===e);o&&o.items&&o.items.unshift(...t)}}finally{u=!1}}},clearItems:e=>{if(r){p({op:"CLEAR_SUB_ITEMS",itemId:e}),u=!0;try{if(l)i.value.splice(0,i.value.length);else{const t=a.value.find(t=>t.tabId===e);t&&t.items&&t.items.splice(0,t.items.length)}}finally{u=!1}}},moveItem:(e,t,o)=>{if(r){p({op:"MOVE_ITEM",itemId:e,payload:{targetPosition:t,anchorItemId:o}}),u=!0;try{const n=n=>{const a=n.findIndex(t=>t.id===e),i=n.findIndex(e=>e.id===o);if(-1!==a&&-1!==i){const e=n.splice(a,1)[0],i=n.findIndex(e=>e.id===o),l="after"===t?i+1:i;n.splice(l,0,e)}};if(l)n(i.value);else for(const e of a.value)e.items&&n(e.items)}finally{u=!1}}},replaceItem:(e,t)=>{if(r){p({op:"REPLACE_ITEM",itemId:e,payload:t}),u=!0;try{if(l){const o=i.value.findIndex(t=>t.id===e);-1!==o&&(i.value[o]=t)}else for(const o of a.value)if(o.items){const n=o.items.findIndex(t=>t.id===e);if(-1!==n){o.items[n]=t;break}}}finally{u=!1}}},dispatchAction:p,resetInitialization:()=>{r=!1,g.clear();for(const e in b)delete b[e]},getFocusState:async()=>new Promise((t,o)=>{let n=e.value;"function"==typeof e.value.getNativeNode?n=e.value.getNativeNode()||e.value:e.value.nativeRef&&(n=e.value.nativeRef);const a=e=>{if(e&&void 0!==e.isSuccess&&void 0!==e.result)t(e.result);else try{const o="string"==typeof e?JSON.parse(e):e;t(o)}catch(Do){o(Do)}};"function"==typeof S.Native.callUIFunction?S.Native.callUIFunction(n,"getFocusState",[],a):(console.error("[useGridTabs] Native.callUIFunction is not available"),o(new Error("Native.callUIFunction is not available")))}),getItemRect:async t=>new Promise((o,n)=>{let a=e.value;"function"==typeof e.value.getNativeNode?a=e.value.getNativeNode()||e.value:e.value.nativeRef&&(a=e.value.nativeRef);const i=e=>{if(e&&void 0!==e.isSuccess&&void 0!==e.result)o(e.result);else try{const t="string"==typeof e?JSON.parse(e):e;o(t)}catch(Do){n(Do)}};"function"==typeof S.Native.callUIFunction?S.Native.callUIFunction(a,"getItemRect",[t],i):(console.error("[useGridTabs] Native.callUIFunction is not available"),n(new Error("Native.callUIFunction is not available")))}),requestFocus:t=>{let o=e.value;"function"==typeof e.value.getNativeNode?o=e.value.getNativeNode()||e.value:e.value.nativeRef&&(o=e.value.nativeRef),S.Native.callUIFunction(o,"requestFocus",[t])},updatePageSpec:e=>{if(!r)return;const t=Object.assign({},JSON.parse(o.value).page_spec,e);e.layout&&(t.navConfig=Object.assign({},t.navConfig,e.layout)),e.navConfig&&(t.navConfig=Object.assign({},t.navConfig,e.navConfig)),e.contentConfig&&(t.contentConfig=Object.assign({},t.contentConfig,e.contentConfig)),n&&Object.assign(n,t),p({op:"RELOAD_TABS",payload:{pageSpec:t,page_spec:t,tabs:a.value}});const i=JSON.parse(o.value);i.page_spec=t,o.value=JSON.stringify(i),c=o.value},reloadAll:(e,t)=>{n&&(Object.keys(n).forEach(e=>delete n[e]),Object.assign(n,e)),a.value=t,p({op:"RELOAD_TABS",payload:{pageSpec:e,page_spec:e,tabs:t}})},scrollToTop:()=>{let t=e.value;"function"==typeof e.value.getNativeNode?t=e.value.getNativeNode()||e.value:e.value.nativeRef&&(t=e.value.nativeRef),S.Native.callUIFunction(t,"scrollToTop",[])}}},exports.vPortalTo=Ro;
|
package/dist/qtx.es.js
CHANGED
|
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
7
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
|
|
8
|
-
import { defineComponent, ref, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot, shallowRef, watch, computed, useSlots, useAttrs, onMounted, nextTick, resolveComponent, createElementBlock, Fragment, createVNode, createElementVNode, normalizeStyle, renderList,
|
|
8
|
+
import { defineComponent, ref, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot, shallowRef, watch, computed, onUnmounted, useSlots, useAttrs, onMounted, nextTick, resolveComponent, createElementBlock, Fragment, createVNode, createElementVNode, normalizeStyle, renderList, h } from "vue";
|
|
9
9
|
import { Native, EventBus } from "@extscreen/es3-vue";
|
|
10
10
|
import { useESEventBus } from "@extscreen/es3-core";
|
|
11
11
|
const __default__$t = {
|
|
@@ -1486,8 +1486,8 @@ function walkVNode(vnode, pid, ctx, nodes, diagnostics, t1Props = [], forEval =
|
|
|
1486
1486
|
}
|
|
1487
1487
|
return id;
|
|
1488
1488
|
}
|
|
1489
|
-
function applyStyleEntries(node,
|
|
1490
|
-
for (const [key, raw] of
|
|
1489
|
+
function applyStyleEntries(node, entries2, consumed, diagnostics) {
|
|
1490
|
+
for (const [key, raw] of entries2) {
|
|
1491
1491
|
const revealed = typeof raw === "string" ? raw : revealValue(raw);
|
|
1492
1492
|
if (revealed !== null && containsSentinel(revealed)) {
|
|
1493
1493
|
const bind = extractBind(revealed);
|
|
@@ -1538,16 +1538,16 @@ function applyStyleEntries(node, entries, consumed, diagnostics) {
|
|
|
1538
1538
|
}
|
|
1539
1539
|
}
|
|
1540
1540
|
function applyStyle(node, style, consumed, diagnostics) {
|
|
1541
|
-
const
|
|
1541
|
+
const entries2 = [];
|
|
1542
1542
|
const styleList = Array.isArray(style) ? style : [style];
|
|
1543
1543
|
for (const item of styleList) {
|
|
1544
1544
|
if (item && typeof item === "object") {
|
|
1545
1545
|
for (const key of Object.keys(item)) {
|
|
1546
|
-
|
|
1546
|
+
entries2.push([key, item[key]]);
|
|
1547
1547
|
}
|
|
1548
1548
|
}
|
|
1549
1549
|
}
|
|
1550
|
-
for (const [key, raw] of
|
|
1550
|
+
for (const [key, raw] of entries2) {
|
|
1551
1551
|
const revealed = typeof raw === "string" ? raw : revealValue(raw);
|
|
1552
1552
|
if (revealed !== null && containsSentinel(revealed)) {
|
|
1553
1553
|
const bind = extractBind(revealed);
|
|
@@ -2322,6 +2322,40 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
2322
2322
|
};
|
|
2323
2323
|
}
|
|
2324
2324
|
});
|
|
2325
|
+
const entries = /* @__PURE__ */ new Set();
|
|
2326
|
+
let active = null;
|
|
2327
|
+
function registerBackChainList(scrollToTop) {
|
|
2328
|
+
const entry = { scrolled: false, scrollToTop };
|
|
2329
|
+
entries.add(entry);
|
|
2330
|
+
return entry;
|
|
2331
|
+
}
|
|
2332
|
+
function unregisterBackChainList(entry) {
|
|
2333
|
+
entries.delete(entry);
|
|
2334
|
+
if (active === entry)
|
|
2335
|
+
active = null;
|
|
2336
|
+
}
|
|
2337
|
+
function setBackChainScrolled(entry, scrolled) {
|
|
2338
|
+
entry.scrolled = scrolled;
|
|
2339
|
+
if (scrolled)
|
|
2340
|
+
active = entry;
|
|
2341
|
+
else if (active === entry)
|
|
2342
|
+
active = null;
|
|
2343
|
+
}
|
|
2344
|
+
function resetBackChain() {
|
|
2345
|
+
entries.forEach((entry) => {
|
|
2346
|
+
entry.scrolled = false;
|
|
2347
|
+
});
|
|
2348
|
+
active = null;
|
|
2349
|
+
}
|
|
2350
|
+
function consumeBackToTop() {
|
|
2351
|
+
if (!active || !active.scrolled)
|
|
2352
|
+
return false;
|
|
2353
|
+
active.scrollToTop();
|
|
2354
|
+
active.scrolled = false;
|
|
2355
|
+
active = null;
|
|
2356
|
+
console.log("[qtx-back-chain] step1 backToTop consumed");
|
|
2357
|
+
return true;
|
|
2358
|
+
}
|
|
2325
2359
|
const __default__$r = {
|
|
2326
2360
|
name: "QtxList",
|
|
2327
2361
|
inheritAttrs: false
|
|
@@ -2338,6 +2372,10 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
2338
2372
|
gutter: { default: 0 },
|
|
2339
2373
|
pageEnabled: { type: Boolean },
|
|
2340
2374
|
loadingTail: { type: Boolean, default: false },
|
|
2375
|
+
state: { default: "ready" },
|
|
2376
|
+
emptyText: {},
|
|
2377
|
+
loadingText: {},
|
|
2378
|
+
errorText: {},
|
|
2341
2379
|
initialFocusIndex: {},
|
|
2342
2380
|
initData: {}
|
|
2343
2381
|
},
|
|
@@ -2355,6 +2393,11 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
2355
2393
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
2356
2394
|
let __qtxListInstanceSeq = 0;
|
|
2357
2395
|
const instanceId = ++__qtxListInstanceSeq;
|
|
2396
|
+
function scrollListToTop() {
|
|
2397
|
+
void listApi.scrollToIndex(0);
|
|
2398
|
+
}
|
|
2399
|
+
const backEntry = registerBackChainList(scrollListToTop);
|
|
2400
|
+
onUnmounted(() => unregisterBackChainList(backEntry));
|
|
2358
2401
|
const props = __props;
|
|
2359
2402
|
const emit = __emit;
|
|
2360
2403
|
const baseRef = ref(null);
|
|
@@ -2369,7 +2412,21 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
2369
2412
|
let pumpGen = 0;
|
|
2370
2413
|
let commandItems = null;
|
|
2371
2414
|
let commandPropsRef = null;
|
|
2415
|
+
const stateRows = computed(() => {
|
|
2416
|
+
const s = props.state || "ready";
|
|
2417
|
+
if (s === "ready")
|
|
2418
|
+
return [];
|
|
2419
|
+
const title = s === "loading" ? props.loadingText || "加载中…" : s === "empty" ? props.emptyText || "暂无内容" : props.errorText || "加载失败,点击重试";
|
|
2420
|
+
return styledRows([{
|
|
2421
|
+
id: "__qtx_state__",
|
|
2422
|
+
type: "text",
|
|
2423
|
+
title,
|
|
2424
|
+
span: props.columns || 1
|
|
2425
|
+
}]);
|
|
2426
|
+
});
|
|
2372
2427
|
function activeItems() {
|
|
2428
|
+
if (props.state && props.state !== "ready")
|
|
2429
|
+
return stateRows.value;
|
|
2373
2430
|
return commandItems ?? props.items ?? [];
|
|
2374
2431
|
}
|
|
2375
2432
|
function diagnoseDiscCoverage(captured, allItems) {
|
|
@@ -2518,13 +2575,21 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
2518
2575
|
);
|
|
2519
2576
|
const ready = ref(false);
|
|
2520
2577
|
const statusText = ref("qtx-list: mounted");
|
|
2578
|
+
watch(
|
|
2579
|
+
() => [props.state, props.emptyText, props.loadingText, props.errorText],
|
|
2580
|
+
() => {
|
|
2581
|
+
if (!ready.value)
|
|
2582
|
+
return;
|
|
2583
|
+
void rebuildAll();
|
|
2584
|
+
}
|
|
2585
|
+
);
|
|
2521
2586
|
const FIRST_SCREEN_BATCH = 48;
|
|
2522
2587
|
const APPEND_BATCH = 500;
|
|
2523
2588
|
const initDataJson = ref("");
|
|
2524
2589
|
function buildInitDataSnapshot() {
|
|
2525
2590
|
initDataJson.value = JSON.stringify({
|
|
2526
2591
|
templates: capturedTemplates,
|
|
2527
|
-
items: rowsJson((
|
|
2592
|
+
items: rowsJson(activeItems().slice(0, FIRST_SCREEN_BATCH))
|
|
2528
2593
|
});
|
|
2529
2594
|
}
|
|
2530
2595
|
async function rebuildAll(opts) {
|
|
@@ -2745,6 +2810,10 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
2745
2810
|
return;
|
|
2746
2811
|
}
|
|
2747
2812
|
const rawItemId = payload.itemId != null ? String(payload.itemId) : "";
|
|
2813
|
+
if (name === "__qtx_scroll_state__") {
|
|
2814
|
+
setBackChainScrolled(backEntry, rawItemId === "1");
|
|
2815
|
+
return;
|
|
2816
|
+
}
|
|
2748
2817
|
if (name === "portal-viewport-enter" || name === "portal-viewport-leave") {
|
|
2749
2818
|
emit("onItemEvent", payload);
|
|
2750
2819
|
emit(name, { key: rawItemId, position: Number(payload.position ?? -1) });
|
|
@@ -4849,6 +4918,10 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
4849
4918
|
setup(__props, { expose: __expose }) {
|
|
4850
4919
|
const nativeRef = ref();
|
|
4851
4920
|
const AsyncWrapper = createQtxGate("qtx-tabs");
|
|
4921
|
+
const props = __props;
|
|
4922
|
+
watch(() => props.active, () => {
|
|
4923
|
+
resetBackChain();
|
|
4924
|
+
});
|
|
4852
4925
|
__expose({
|
|
4853
4926
|
getNativeNode: () => {
|
|
4854
4927
|
var _a2, _b2;
|
|
@@ -6159,7 +6232,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
6159
6232
|
defaultFocusKey: {},
|
|
6160
6233
|
initialActiveKey: {},
|
|
6161
6234
|
initialFocusKey: {},
|
|
6235
|
+
focusWithin: { type: Boolean },
|
|
6162
6236
|
disableBackToInitial: { type: Boolean },
|
|
6237
|
+
disableBackToTop: { type: Boolean },
|
|
6163
6238
|
maxPoolSize: {}
|
|
6164
6239
|
},
|
|
6165
6240
|
emits: ["change", "update:active", "focus", "blur", "longClick", "scroll"],
|
|
@@ -6169,6 +6244,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
6169
6244
|
const baseRef = ref(null);
|
|
6170
6245
|
let currentActive = props.active || "";
|
|
6171
6246
|
let capturedInitial = props.initialActiveKey || props.active || "";
|
|
6247
|
+
let lastBackConsumedAt = 0;
|
|
6172
6248
|
watch(() => props.active, (value) => {
|
|
6173
6249
|
const next = value || "";
|
|
6174
6250
|
if (next)
|
|
@@ -6177,12 +6253,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
6177
6253
|
capturedInitial = next;
|
|
6178
6254
|
});
|
|
6179
6255
|
function handleBack() {
|
|
6256
|
+
const now = Date.now();
|
|
6257
|
+
if (now - lastBackConsumedAt < 400)
|
|
6258
|
+
return false;
|
|
6259
|
+
if (!props.disableBackToTop && consumeBackToTop()) {
|
|
6260
|
+
call("focusBack", []);
|
|
6261
|
+
lastBackConsumedAt = now;
|
|
6262
|
+
return true;
|
|
6263
|
+
}
|
|
6180
6264
|
if (props.disableBackToInitial)
|
|
6181
6265
|
return false;
|
|
6182
6266
|
const initial = props.initialActiveKey || capturedInitial;
|
|
6183
6267
|
if (!initial || currentActive === initial)
|
|
6184
6268
|
return false;
|
|
6185
6269
|
call("setActive", [initial, "back"]);
|
|
6270
|
+
lastBackConsumedAt = now;
|
|
6186
6271
|
return true;
|
|
6187
6272
|
}
|
|
6188
6273
|
const emit = __emit;
|
|
@@ -6550,7 +6635,7 @@ function getCapabilitySpec(ns) {
|
|
|
6550
6635
|
return registry.get(ns) || null;
|
|
6551
6636
|
}
|
|
6552
6637
|
function defaultMainTrackMinVersion() {
|
|
6553
|
-
return "0.9.0-alpha.
|
|
6638
|
+
return "0.9.0-alpha.7";
|
|
6554
6639
|
}
|
|
6555
6640
|
async function runCapabilityBootstrap(spec, options) {
|
|
6556
6641
|
const isCore = spec.ns === "core";
|
|
@@ -6988,7 +7073,7 @@ registerCapability({
|
|
|
6988
7073
|
});
|
|
6989
7074
|
defineCapability("file");
|
|
6990
7075
|
try {
|
|
6991
|
-
console.log(`[qtx] Library loaded. Version: ${"0.9.0-alpha.
|
|
7076
|
+
console.log(`[qtx] Library loaded. Version: ${"0.9.0-alpha.7"}, Build Time: ${"2026/11/18 10:31:20"}`);
|
|
6992
7077
|
} catch (e) {
|
|
6993
7078
|
}
|
|
6994
7079
|
let registerElement;
|
package/package.json
CHANGED
|
@@ -221,6 +221,15 @@ function diagnoseStyleBinding(source, filename) {
|
|
|
221
221
|
return warnings;
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
+
/**
|
|
225
|
+
* Q9 已于 0.9.0-alpha.6 在 TabsTabContentView 的 View 层修复:标准 Vue v-if 切换
|
|
226
|
+
* qtx-tab-content 子节点类型现已被支持。修复前的 [QTX-TABS] 编译期提示随之移除,
|
|
227
|
+
* 保留空实现以兼容已有的 webpack / vite loader 接入。
|
|
228
|
+
*/
|
|
229
|
+
function diagnoseTabContentChildSwitch(_source, _filename) {
|
|
230
|
+
return [];
|
|
231
|
+
}
|
|
232
|
+
|
|
224
233
|
/** 插件入口:可被 Vite transform / webpack pre-loader 直接调用 */
|
|
225
234
|
function qtxClipFix(source, filename) {
|
|
226
235
|
if (process.env.QTX_TPL_NO_CLIP_FIX === '1' || CLIP_FIX_OFF.test(source)) return source;
|
|
@@ -229,5 +238,5 @@ function qtxClipFix(source, filename) {
|
|
|
229
238
|
|
|
230
239
|
module.exports = {
|
|
231
240
|
qtxClipFix, applyClipFix, applyOverflowClipFix, collectStyles, CLIP_FIX_OFF,
|
|
232
|
-
diagnoseStyleBinding,
|
|
241
|
+
diagnoseStyleBinding, diagnoseTabContentChildSwitch,
|
|
233
242
|
};
|
package/plugin/vite.mjs
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import { createRequire } from 'node:module';
|
|
13
13
|
|
|
14
14
|
const require = createRequire(import.meta.url);
|
|
15
|
-
const { qtxClipFix, diagnoseStyleBinding } = require('./qtx-clip-inject.cjs');
|
|
15
|
+
const { qtxClipFix, diagnoseStyleBinding, diagnoseTabContentChildSwitch } = require('./qtx-clip-inject.cjs');
|
|
16
16
|
|
|
17
17
|
export function qtx() {
|
|
18
18
|
return {
|
|
@@ -23,6 +23,7 @@ export function qtx() {
|
|
|
23
23
|
if (!id.endsWith('.vue')) return null;
|
|
24
24
|
if (!code.includes('<template')) return null;
|
|
25
25
|
diagnoseStyleBinding(code, id);
|
|
26
|
+
diagnoseTabContentChildSwitch(code, id);
|
|
26
27
|
const out = qtxClipFix(code, id);
|
|
27
28
|
return out === code ? null : { code: out, map: null };
|
|
28
29
|
},
|
package/plugin/webpack.cjs
CHANGED
|
@@ -16,10 +16,11 @@
|
|
|
16
16
|
*
|
|
17
17
|
* enforce:'pre' 保证在 vue-loader 拆分 SFC 之前处理完整 .vue 源码。
|
|
18
18
|
*/
|
|
19
|
-
const { qtxClipFix, diagnoseStyleBinding } = require('./qtx-clip-inject.cjs');
|
|
19
|
+
const { qtxClipFix, diagnoseStyleBinding, diagnoseTabContentChildSwitch } = require('./qtx-clip-inject.cjs');
|
|
20
20
|
|
|
21
21
|
module.exports = function qtxClipWebpackLoader(source) {
|
|
22
22
|
const filename = (this && this.resourcePath) || 'unknown.vue';
|
|
23
23
|
diagnoseStyleBinding(source, filename);
|
|
24
|
+
diagnoseTabContentChildSwitch(source, filename);
|
|
24
25
|
return qtxClipFix(source, filename);
|
|
25
26
|
};
|