@gkd-kit/inspect 0.0.1741452485523 → 0.0.1741959366014

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/assets/ActionCard.vue_vue_type_script_setup_true_lang-DvR65REU.js +17 -0
  2. package/dist/assets/{ActionCard.vue_vue_type_script_setup_true_lang-BpRyQZ3H.js.map → ActionCard.vue_vue_type_script_setup_true_lang-DvR65REU.js.map} +1 -1
  3. package/dist/assets/{DevicePage-DvJTWC-m.js → DevicePage-DGn4Ctle.js} +2 -2
  4. package/dist/assets/{DevicePage-DvJTWC-m.js.map → DevicePage-DGn4Ctle.js.map} +1 -1
  5. package/dist/assets/{HomePage-CIUQYofW.js → HomePage-7nBT8ew9.js} +2 -2
  6. package/dist/assets/{HomePage-CIUQYofW.js.map → HomePage-7nBT8ew9.js.map} +1 -1
  7. package/dist/assets/{ImportPage-C9wd5TmP.js → ImportPage-BecYCRkh.js} +2 -2
  8. package/dist/assets/{ImportPage-C9wd5TmP.js.map → ImportPage-BecYCRkh.js.map} +1 -1
  9. package/dist/assets/{Input--DiFnDEu.js → Input-BiXX4LCR.js} +2 -2
  10. package/dist/assets/{Input--DiFnDEu.js.map → Input-BiXX4LCR.js.map} +1 -1
  11. package/dist/assets/{SelectorPage-De7uZQn4.js → SelectorPage-C18lMDMv.js} +2 -2
  12. package/dist/assets/{SelectorPage-De7uZQn4.js.map → SelectorPage-C18lMDMv.js.map} +1 -1
  13. package/dist/assets/{SnapshotPage-FGNM-Bya.js → SnapshotPage-iPtU2buw.js} +5 -5
  14. package/dist/assets/{SnapshotPage-FGNM-Bya.js.map → SnapshotPage-iPtU2buw.js.map} +1 -1
  15. package/dist/assets/{SvgPage-7_-e35bg.js → SvgPage-COzM-QJX.js} +2 -2
  16. package/dist/assets/{SvgPage-7_-e35bg.js.map → SvgPage-COzM-QJX.js.map} +1 -1
  17. package/dist/assets/{TrackGraph-DahfH9hz.js → TrackGraph-BjAZact3.js} +6 -87
  18. package/dist/assets/{TrackGraph-DahfH9hz.js.map → TrackGraph-BjAZact3.js.map} +1 -1
  19. package/dist/assets/{_404Page-DMqR9ZF_.js → _404Page-DaVNnDKP.js} +2 -2
  20. package/dist/assets/{_404Page-DMqR9ZF_.js.map → _404Page-DaVNnDKP.js.map} +1 -1
  21. package/dist/assets/chunk-UvhJcnXN.js +3 -0
  22. package/dist/assets/{chunk-8Ew1Cm9Z.js.map → chunk-UvhJcnXN.js.map} +1 -1
  23. package/dist/assets/{dayjs.min-DzeyRwRa.js → dayjs.min-apf2pQT5.js} +2 -2
  24. package/dist/assets/{dayjs.min-DzeyRwRa.js.map → dayjs.min-apf2pQT5.js.map} +1 -1
  25. package/dist/assets/{error-DbIpuzkQ.js → error-C1Qb6YR1.js} +2 -2
  26. package/dist/assets/{error-DbIpuzkQ.js.map → error-C1Qb6YR1.js.map} +1 -1
  27. package/dist/assets/{import-H64c4X44.js → import-DNjeqO8f.js} +2 -2
  28. package/dist/assets/{import-H64c4X44.js.map → import-DNjeqO8f.js.map} +1 -1
  29. package/dist/assets/{index-JhaVQf2b.js → index-Bb4F3D61.js} +7 -36
  30. package/dist/assets/index-Bb4F3D61.js.map +1 -0
  31. package/dist/assets/{index-BaDlwh_N.js → index-DSSU8NoN.js} +3 -3
  32. package/dist/assets/{index-BaDlwh_N.js.map → index-DSSU8NoN.js.map} +1 -1
  33. package/dist/assets/index-_7MJ55_d.css +1 -0
  34. package/dist/assets/{jszip.min-XB5IxByY.js → jszip.min-BshRF2rn.js} +2 -12
  35. package/dist/assets/jszip.min-BshRF2rn.js.map +1 -0
  36. package/dist/assets/{node-DZhUVLW_.js → node-CQaEOu5U.js} +2 -2
  37. package/dist/assets/{node-DZhUVLW_.js.map → node-CQaEOu5U.js.map} +1 -1
  38. package/dist/assets/{snapshot-pmBRRB1f.js → snapshot-BGTbHtGy.js} +2 -2
  39. package/dist/assets/{snapshot-pmBRRB1f.js.map → snapshot-BGTbHtGy.js.map} +1 -1
  40. package/dist/assets/{table-DclGU1yS.js → table-C4-yM-UD.js} +2 -2
  41. package/dist/assets/{table-DclGU1yS.js.map → table-C4-yM-UD.js.map} +1 -1
  42. package/dist/assets/{worker-BZwDflls.js → worker-lNTWuAmw.js} +2 -6
  43. package/dist/assets/{worker-BZwDflls.js.map → worker-lNTWuAmw.js.map} +1 -1
  44. package/dist/index.html +3 -3
  45. package/package.json +1 -1
  46. package/dist/assets/ActionCard.vue_vue_type_script_setup_true_lang-BpRyQZ3H.js +0 -25
  47. package/dist/assets/chunk-8Ew1Cm9Z.js +0 -3
  48. package/dist/assets/index-D-r1D-BB.css +0 -1
  49. package/dist/assets/index-JhaVQf2b.js.map +0 -1
  50. package/dist/assets/jszip.min-XB5IxByY.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{S as A,A as z,a as B,_ as L,d as f}from"./index-BaDlwh_N.js";import{h as V,bL as q,bM as E,aI as F,aJ as M,A as D,aQ as H,q as p,G as J,H as h,I as r,J as a,K as s,F as i,L as c,S as Q,Q as U,M as d,U as G,O as t,aC as K,T as x,R as O}from"./index-JhaVQf2b.js";import{N as P,b as W}from"./node-DZhUVLW_.js";import{_ as $}from"./Input--DiFnDEu.js";const j={flex:"","items-center":"","gap-16px":"","pt-12px":"","px-12px":""},X={flex:"","flex-col":"","items-center":"","p-8px":"",text:"40px/52px"},Y={key:0,"overflow-x-scroll":"","scrollbar-hidden":""},Z={key:1,"whitespace-pre-wrap":""},ee={key:0},te={"bg-red":"",relative:""},oe={key:0},ne={key:1,"pl-20px":""},se={absolute:"","left-0":"","right-0":"","top--12px":"",flex:"","flex-col":"","items-center":"","animate-bounce":"","pointer-events-none":""},re={key:1},ae={key:0,"p-4px":"","bg-red-300":"",gkd_code:""},de=V({__name:"SelectorPage",setup(ie){q(),E();const k=F(),y=M(),T=()=>{const e=String(k.query.gkd||"");if(!e)return e;try{return f.decode(e)}catch{return m(""),""}},m=e=>{y.replace({query:{gkd:e?f.encode(e):void 0}})},u=D(T()),b=H(u,500),l=p(()=>(u.value&&b.value).trim());J(l,()=>{m(l.value)});const _=p(()=>{if(l.value)try{return A.Companion.parseAst(l.value)}catch(e){return e}}),g=p(()=>{if(_.value instanceof z)return _.value}),n=p(()=>{const e=_.value,o=l.value;if(e instanceof B)return{headText:o.substring(0,e.index),errorText:o.substring(e.index,e.index+1),tailText:o.substring(e.index+1),message:e.outMessage}});return(e,o)=>{const v=h("SvgIcon"),N=P,R=h("RouterLink"),w=U,S=W,C=$;return a(),r(O,null,[s("div",j,[i(S,{placement:"right"},{trigger:c(()=>[i(w,{text:""},{icon:c(()=>[i(R,{to:"/",color:"inherit"},{default:c(()=>[i(N,{size:"24"},{default:c(()=>[i(v,{name:"home"})]),_:1})]),_:1})]),_:1})]),default:c(()=>[o[1]||(o[1]=Q(" 回到首页 "))]),_:1}),o[2]||(o[2]=s("div",{flex:"","gap-16px":""},[s("div",{"text-18px":""},"测试选择器"),s("div",null,"语法高亮/错误解析")],-1))]),s("div",X,[i(C,{value:t(u),"onUpdate:value":o[0]||(o[0]=I=>G(u)?u.value=I:null),type:"textarea",placeholder:"请输入选择器",class:"gkd_code py-4px",style:{"--n-font-size":"20px","--n-line-height-textarea":"28px"},autosize:{minRows:3,maxRows:8}},null,8,["value"]),o[3]||(o[3]=s("div",{"h-20px":""},null,-1)),s("div",{"max-w-full":"","mb-8px":"","p-4px":"",gkd_code:"","transition-colors":"",class:K(t(n)?"bg-red-200":"bg-light-600")},[t(g)?(a(),r("div",Y,[i(L,{source:t(l),node:t(g)},null,8,["source","node"])])):t(n)?(a(),r("span",Z,[t(n).headText?(a(),r("span",ee,x(t(n).headText),1)):d("",!0),s("span",te,[t(n).errorText?(a(),r("span",oe,x(t(n).errorText),1)):(a(),r("span",ne)),s("div",se,[i(v,{name:"arrow",class:"text-18px color-dark"})])]),t(n).tailText?(a(),r("span",re,x(t(n).tailText),1)):d("",!0)])):d("",!0)],2),t(n)?(a(),r("div",ae,x(t(n).message),1)):d("",!0)])],64)}}});export{de as default};
2
- //# sourceMappingURL=SelectorPage-De7uZQn4.js.map
1
+ import{S as A,A as z,a as B,_ as L,d as f}from"./index-DSSU8NoN.js";import{h as V,bL as q,bM as E,aI as F,aJ as M,A as D,aQ as H,q as p,G as J,H as h,I as r,J as a,K as s,F as i,L as c,S as Q,Q as U,M as d,U as G,O as t,aC as K,T as x,R as O}from"./index-Bb4F3D61.js";import{N as P,b as W}from"./node-CQaEOu5U.js";import{_ as $}from"./Input-BiXX4LCR.js";const j={flex:"","items-center":"","gap-16px":"","pt-12px":"","px-12px":""},X={flex:"","flex-col":"","items-center":"","p-8px":"",text:"40px/52px"},Y={key:0,"overflow-x-scroll":"","scrollbar-hidden":""},Z={key:1,"whitespace-pre-wrap":""},ee={key:0},te={"bg-red":"",relative:""},oe={key:0},ne={key:1,"pl-20px":""},se={absolute:"","left-0":"","right-0":"","top--12px":"",flex:"","flex-col":"","items-center":"","animate-bounce":"","pointer-events-none":""},re={key:1},ae={key:0,"p-4px":"","bg-red-300":"",gkd_code:""},de=V({__name:"SelectorPage",setup(ie){q(),E();const k=F(),y=M(),T=()=>{const e=String(k.query.gkd||"");if(!e)return e;try{return f.decode(e)}catch{return m(""),""}},m=e=>{y.replace({query:{gkd:e?f.encode(e):void 0}})},u=D(T()),b=H(u,500),l=p(()=>(u.value&&b.value).trim());J(l,()=>{m(l.value)});const _=p(()=>{if(l.value)try{return A.Companion.parseAst(l.value)}catch(e){return e}}),g=p(()=>{if(_.value instanceof z)return _.value}),n=p(()=>{const e=_.value,o=l.value;if(e instanceof B)return{headText:o.substring(0,e.index),errorText:o.substring(e.index,e.index+1),tailText:o.substring(e.index+1),message:e.outMessage}});return(e,o)=>{const v=h("SvgIcon"),N=P,R=h("RouterLink"),w=U,S=W,C=$;return a(),r(O,null,[s("div",j,[i(S,{placement:"right"},{trigger:c(()=>[i(w,{text:""},{icon:c(()=>[i(R,{to:"/",color:"inherit"},{default:c(()=>[i(N,{size:"24"},{default:c(()=>[i(v,{name:"home"})]),_:1})]),_:1})]),_:1})]),default:c(()=>[o[1]||(o[1]=Q(" 回到首页 "))]),_:1}),o[2]||(o[2]=s("div",{flex:"","gap-16px":""},[s("div",{"text-18px":""},"测试选择器"),s("div",null,"语法高亮/错误解析")],-1))]),s("div",X,[i(C,{value:t(u),"onUpdate:value":o[0]||(o[0]=I=>G(u)?u.value=I:null),type:"textarea",placeholder:"请输入选择器",class:"gkd_code py-4px",style:{"--n-font-size":"20px","--n-line-height-textarea":"28px"},autosize:{minRows:3,maxRows:8}},null,8,["value"]),o[3]||(o[3]=s("div",{"h-20px":""},null,-1)),s("div",{"max-w-full":"","mb-8px":"","p-4px":"",gkd_code:"","transition-colors":"",class:K(t(n)?"bg-red-200":"bg-light-600")},[t(g)?(a(),r("div",Y,[i(L,{source:t(l),node:t(g)},null,8,["source","node"])])):t(n)?(a(),r("span",Z,[t(n).headText?(a(),r("span",ee,x(t(n).headText),1)):d("",!0),s("span",te,[t(n).errorText?(a(),r("span",oe,x(t(n).errorText),1)):(a(),r("span",ne)),s("div",se,[i(v,{name:"arrow",class:"text-18px color-dark"})])]),t(n).tailText?(a(),r("span",re,x(t(n).tailText),1)):d("",!0)])):d("",!0)],2),t(n)?(a(),r("div",ae,x(t(n).message),1)):d("",!0)])],64)}}});export{de as default};
2
+ //# sourceMappingURL=SelectorPage-C18lMDMv.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectorPage-De7uZQn4.js","sources":["../../src/views/SelectorPage.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport SelectorText from '@/components/SelectorText.vue';\nimport { useAutoHeight, useAutoWidth } from '@/utils/others';\nimport {\n AstNode,\n Selector,\n GkdException,\n SyntaxException,\n} from '@gkd-kit/selector';\nimport * as base64url from 'universal-base64url';\n\nuseAutoHeight();\nuseAutoWidth();\n\nconst route = useRoute();\nconst router = useRouter();\n\nconst getTextFromRoute = () => {\n const t = String(route.query.gkd || '');\n if (!t) return t;\n try {\n return base64url.decode(t);\n } catch (e) {\n setTextToRoute('');\n return '';\n }\n};\nconst setTextToRoute = (t: string) => {\n router.replace({ query: { gkd: t ? base64url.encode(t) : undefined } });\n};\n\nconst inputText = shallowRef(getTextFromRoute());\nconst lazyText = useDebounce(inputText, 500);\nconst text = computed(() => {\n return (inputText.value && lazyText.value).trim();\n});\nwatch(text, () => {\n setTextToRoute(text.value);\n});\nconst result = computed(() => {\n if (!text.value) return;\n try {\n return Selector.Companion.parseAst(text.value);\n } catch (e) {\n return e as GkdException;\n }\n});\n\nconst ast = computed(() => {\n if (result.value instanceof AstNode) {\n return result.value;\n }\n return undefined;\n});\n\nconst error = computed(() => {\n const e = result.value;\n const t = text.value;\n if (e instanceof SyntaxException) {\n return {\n headText: t.substring(0, e.index),\n errorText: t.substring(e.index, e.index + 1),\n tailText: t.substring(e.index + 1),\n message: e.outMessage,\n };\n }\n return undefined;\n});\n</script>\n<template>\n <div flex items-center gap-16px pt-12px px-12px>\n <NTooltip placement=\"right\">\n <template #trigger>\n <NButton text>\n <template #icon>\n <RouterLink to=\"/\" color=\"inherit\">\n <NIcon size=\"24\">\n <SvgIcon name=\"home\" />\n </NIcon>\n </RouterLink>\n </template>\n </NButton>\n </template>\n 回到首页\n </NTooltip>\n <div flex gap-16px>\n <div text-18px>测试选择器</div>\n <div>语法高亮/错误解析</div>\n </div>\n </div>\n <div flex flex-col items-center p-8px text=\"40px/52px\">\n <NInput\n v-model:value=\"inputText\"\n type=\"textarea\"\n placeholder=\"请输入选择器\"\n class=\"gkd_code py-4px\"\n style=\"--n-font-size: 20px; --n-line-height-textarea: 28px\"\n :autosize=\"{\n minRows: 3,\n maxRows: 8,\n }\"\n />\n <div h-20px></div>\n <div\n max-w-full\n mb-8px\n p-4px\n gkd_code\n transition-colors\n :class=\"error ? `bg-red-200` : `bg-light-600`\"\n >\n <div v-if=\"ast\" overflow-x-scroll scrollbar-hidden>\n <SelectorText :source=\"text\" :node=\"ast\" />\n </div>\n <span v-else-if=\"error\" whitespace-pre-wrap>\n <span v-if=\"error.headText\">{{ error.headText }}</span>\n <span bg-red relative>\n <span v-if=\"error.errorText\">{{ error.errorText }}</span>\n <span v-else pl-20px></span>\n <div\n absolute\n left-0\n right-0\n top--12px\n flex\n flex-col\n items-center\n animate-bounce\n pointer-events-none\n >\n <SvgIcon name=\"arrow\" class=\"text-18px color-dark\" />\n </div>\n </span>\n <span v-if=\"error.tailText\">{{ error.tailText }}</span>\n </span>\n </div>\n <div v-if=\"error\" p-4px bg-red-300 gkd_code>\n {{ error.message }}\n </div>\n </div>\n</template>\n"],"names":["useAutoHeight","useAutoWidth","route","useRoute","router","useRouter","getTextFromRoute","t","base64url.decode","setTextToRoute","base64url.encode","inputText","shallowRef","lazyText","useDebounce","text","computed","watch","result","Selector","ast","AstNode","error","SyntaxException"],"mappings":"44BAWcA,EAAA,EACDC,EAAA,EAEb,MAAMC,EAAQC,EAAS,EACjBC,EAASC,EAAU,EAEnBC,EAAmB,IAAM,CAC7B,MAAMC,EAAI,OAAOL,EAAM,MAAM,KAAO,EAAE,EAClC,GAAA,CAACK,EAAU,OAAAA,EACX,GAAA,CACK,OAAAC,EAAAA,OAAiBD,CAAC,OACf,CACV,OAAAE,EAAe,EAAE,EACV,EAAA,CAEX,EACMA,EAAkBF,GAAc,CACpCH,EAAO,QAAQ,CAAE,MAAO,CAAE,IAAKG,EAAIG,EAAAA,OAAiBH,CAAC,EAAI,MAAU,EAAG,CACxE,EAEMI,EAAYC,EAAWN,GAAkB,EACzCO,EAAWC,EAAYH,EAAW,GAAG,EACrCI,EAAOC,EAAS,KACZL,EAAU,OAASE,EAAS,OAAO,KAAK,CACjD,EACDI,EAAMF,EAAM,IAAM,CAChBN,EAAeM,EAAK,KAAK,CAAA,CAC1B,EACK,MAAAG,EAASF,EAAS,IAAM,CACxB,GAACD,EAAK,MACN,GAAA,CACF,OAAOI,EAAS,UAAU,SAASJ,EAAK,KAAK,QACtC,EAAG,CACH,OAAA,CAAA,CACT,CACD,EAEKK,EAAMJ,EAAS,IAAM,CACrB,GAAAE,EAAO,iBAAiBG,EAC1B,OAAOH,EAAO,KAET,CACR,EAEKI,EAAQN,EAAS,IAAM,CAC3B,MAAM,EAAIE,EAAO,MACXX,EAAIQ,EAAK,MACf,GAAI,aAAaQ,EACR,MAAA,CACL,SAAUhB,EAAE,UAAU,EAAG,EAAE,KAAK,EAChC,UAAWA,EAAE,UAAU,EAAE,MAAO,EAAE,MAAQ,CAAC,EAC3C,SAAUA,EAAE,UAAU,EAAE,MAAQ,CAAC,EACjC,QAAS,EAAE,UACb,CAEK,CACR"}
1
+ {"version":3,"file":"SelectorPage-C18lMDMv.js","sources":["../../src/views/SelectorPage.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport SelectorText from '@/components/SelectorText.vue';\nimport { useAutoHeight, useAutoWidth } from '@/utils/others';\nimport {\n AstNode,\n Selector,\n GkdException,\n SyntaxException,\n} from '@gkd-kit/selector';\nimport * as base64url from 'universal-base64url';\n\nuseAutoHeight();\nuseAutoWidth();\n\nconst route = useRoute();\nconst router = useRouter();\n\nconst getTextFromRoute = () => {\n const t = String(route.query.gkd || '');\n if (!t) return t;\n try {\n return base64url.decode(t);\n } catch (e) {\n setTextToRoute('');\n return '';\n }\n};\nconst setTextToRoute = (t: string) => {\n router.replace({ query: { gkd: t ? base64url.encode(t) : undefined } });\n};\n\nconst inputText = shallowRef(getTextFromRoute());\nconst lazyText = useDebounce(inputText, 500);\nconst text = computed(() => {\n return (inputText.value && lazyText.value).trim();\n});\nwatch(text, () => {\n setTextToRoute(text.value);\n});\nconst result = computed(() => {\n if (!text.value) return;\n try {\n return Selector.Companion.parseAst(text.value);\n } catch (e) {\n return e as GkdException;\n }\n});\n\nconst ast = computed(() => {\n if (result.value instanceof AstNode) {\n return result.value;\n }\n return undefined;\n});\n\nconst error = computed(() => {\n const e = result.value;\n const t = text.value;\n if (e instanceof SyntaxException) {\n return {\n headText: t.substring(0, e.index),\n errorText: t.substring(e.index, e.index + 1),\n tailText: t.substring(e.index + 1),\n message: e.outMessage,\n };\n }\n return undefined;\n});\n</script>\n<template>\n <div flex items-center gap-16px pt-12px px-12px>\n <NTooltip placement=\"right\">\n <template #trigger>\n <NButton text>\n <template #icon>\n <RouterLink to=\"/\" color=\"inherit\">\n <NIcon size=\"24\">\n <SvgIcon name=\"home\" />\n </NIcon>\n </RouterLink>\n </template>\n </NButton>\n </template>\n 回到首页\n </NTooltip>\n <div flex gap-16px>\n <div text-18px>测试选择器</div>\n <div>语法高亮/错误解析</div>\n </div>\n </div>\n <div flex flex-col items-center p-8px text=\"40px/52px\">\n <NInput\n v-model:value=\"inputText\"\n type=\"textarea\"\n placeholder=\"请输入选择器\"\n class=\"gkd_code py-4px\"\n style=\"--n-font-size: 20px; --n-line-height-textarea: 28px\"\n :autosize=\"{\n minRows: 3,\n maxRows: 8,\n }\"\n />\n <div h-20px></div>\n <div\n max-w-full\n mb-8px\n p-4px\n gkd_code\n transition-colors\n :class=\"error ? `bg-red-200` : `bg-light-600`\"\n >\n <div v-if=\"ast\" overflow-x-scroll scrollbar-hidden>\n <SelectorText :source=\"text\" :node=\"ast\" />\n </div>\n <span v-else-if=\"error\" whitespace-pre-wrap>\n <span v-if=\"error.headText\">{{ error.headText }}</span>\n <span bg-red relative>\n <span v-if=\"error.errorText\">{{ error.errorText }}</span>\n <span v-else pl-20px></span>\n <div\n absolute\n left-0\n right-0\n top--12px\n flex\n flex-col\n items-center\n animate-bounce\n pointer-events-none\n >\n <SvgIcon name=\"arrow\" class=\"text-18px color-dark\" />\n </div>\n </span>\n <span v-if=\"error.tailText\">{{ error.tailText }}</span>\n </span>\n </div>\n <div v-if=\"error\" p-4px bg-red-300 gkd_code>\n {{ error.message }}\n </div>\n </div>\n</template>\n"],"names":["useAutoHeight","useAutoWidth","route","useRoute","router","useRouter","getTextFromRoute","t","base64url.decode","setTextToRoute","base64url.encode","inputText","shallowRef","lazyText","useDebounce","text","computed","watch","result","Selector","ast","AstNode","error","SyntaxException"],"mappings":"44BAWcA,EAAA,EACDC,EAAA,EAEb,MAAMC,EAAQC,EAAS,EACjBC,EAASC,EAAU,EAEnBC,EAAmB,IAAM,CAC7B,MAAMC,EAAI,OAAOL,EAAM,MAAM,KAAO,EAAE,EAClC,GAAA,CAACK,EAAU,OAAAA,EACX,GAAA,CACK,OAAAC,EAAAA,OAAiBD,CAAC,OACf,CACV,OAAAE,EAAe,EAAE,EACV,EAAA,CAEX,EACMA,EAAkBF,GAAc,CACpCH,EAAO,QAAQ,CAAE,MAAO,CAAE,IAAKG,EAAIG,EAAAA,OAAiBH,CAAC,EAAI,MAAU,EAAG,CACxE,EAEMI,EAAYC,EAAWN,GAAkB,EACzCO,EAAWC,EAAYH,EAAW,GAAG,EACrCI,EAAOC,EAAS,KACZL,EAAU,OAASE,EAAS,OAAO,KAAK,CACjD,EACDI,EAAMF,EAAM,IAAM,CAChBN,EAAeM,EAAK,KAAK,CAAA,CAC1B,EACK,MAAAG,EAASF,EAAS,IAAM,CACxB,GAACD,EAAK,MACN,GAAA,CACF,OAAOI,EAAS,UAAU,SAASJ,EAAK,KAAK,QACtC,EAAG,CACH,OAAA,CAAA,CACT,CACD,EAEKK,EAAMJ,EAAS,IAAM,CACrB,GAAAE,EAAO,iBAAiBG,EAC1B,OAAOH,EAAO,KAET,CACR,EAEKI,EAAQN,EAAS,IAAM,CAC3B,MAAM,EAAIE,EAAO,MACXX,EAAIQ,EAAK,MACf,GAAI,aAAaQ,EACR,MAAA,CACL,SAAUhB,EAAE,UAAU,EAAG,EAAE,KAAK,EAChC,UAAWA,EAAE,UAAU,EAAE,MAAO,EAAE,MAAQ,CAAC,EAC3C,SAAUA,EAAE,UAAU,EAAE,MAAQ,CAAC,EACjC,QAAS,EAAE,UACb,CAEK,CACR"}
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["https://registry.npmmirror.com/@gkd-kit/inspect/0.0.1741452485523/files/dist/assets/TrackGraph-DahfH9hz.js","https://registry.npmmirror.com/@gkd-kit/inspect/0.0.1741452485523/files/dist/assets/node-DZhUVLW_.js","https://registry.npmmirror.com/@gkd-kit/inspect/0.0.1741452485523/files/dist/assets/index-JhaVQf2b.js","https://registry.npmmirror.com/@gkd-kit/inspect/0.0.1741452485523/files/dist/assets/index-D-r1D-BB.css","https://registry.npmmirror.com/@gkd-kit/inspect/0.0.1741452485523/files/dist/assets/index-BaDlwh_N.js","https://registry.npmmirror.com/@gkd-kit/inspect/0.0.1741452485523/files/dist/assets/index-CdMJYWIX.css"])))=>i.map(i=>d[i]);
2
- import{h as Y,k as T,a as U,g as De,f as H,e as O,b as Z,u as pt,Z as xo,$ as vt,a0 as jt,a1 as ko,d as qt,a2 as Ut,o as ie,q as F,p as ut,m as Me,x as Wt,a3 as Vt,y as ce,a4 as Nn,a5 as Rn,a6 as $n,a7 as wo,t as G,a8 as an,a9 as Co,aa as So,ab as fe,ac as Ue,ad as _o,ae as Pn,af as Ee,ag as No,ah as Ro,ai as $o,c as Po,aj as Do,ak as Io,al as To,s as Kt,V as Eo,am as Ft,N as Lo,l as Ko,an as Fo,B as Nt,ao as Ao,v as Dn,i as zo,ap as At,aq as sn,ar as dn,w as dt,D as Ne,G as Ae,as as et,at as rt,A as J,H as Oe,I as te,J as z,K as I,F as C,Q as lt,L as w,au as ae,M as de,O as i,av as Bo,R as Re,aw as Be,ax as Te,ay as wt,az as Oo,aA as Ht,aB as Mo,aC as ft,aD as Uo,C as Gt,aE as _t,aF as In,aG as Ho,aH as jo,aI as Tn,aJ as En,z as qo,aK as Ln,aL as Wo,aM as He,aN as Ie,T as V,S as ee,aO as Vo,aP as Go,aQ as Yo,U as nt,aR as Qo,aS as Xo,P as Jo,aT as zt,aU as Fe,aV as cn,W as Zo,aW as un,aX as Bt,aY as fn}from"./index-JhaVQf2b.js";import{_ as Ct,U as hn,p as St,w as er,d as pn,F as Ot,G as tr}from"./index-BaDlwh_N.js";import{_ as nr}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{g as Pe,l as or,f as rr,a as lr,b as Yt,N as Qt,c as ht,d as ot,e as vn,h as gn}from"./node-DZhUVLW_.js";import{e as ir,f as ar,g as sr,_ as dr}from"./ActionCard.vue_vue_type_script_setup_true_lang-BpRyQZ3H.js";import{a as cr,b as ur,g as fr}from"./snapshot-pmBRRB1f.js";import{h as tt,C as hr,e as pr,V as vr,c as mn,f as bn,b as gr,N as yn,u as mr,d as br,a as Kn,g as Fn,i as yr,j as xr,_ as kr}from"./dayjs.min-DzeyRwRa.js";import{l as An,e as xn,a as wr}from"./error-DbIpuzkQ.js";import{_ as zn}from"./Input--DiFnDEu.js";import"./chunk-8Ew1Cm9Z.js";function Bn(e){return typeof e=="string"?`s-${e}`:`n-${e}`}const Cr=Y({name:"ChevronLeft",render(){return T("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T("path",{d:"M10.3536 3.14645C10.5488 3.34171 10.5488 3.65829 10.3536 3.85355L6.20711 8L10.3536 12.1464C10.5488 12.3417 10.5488 12.6583 10.3536 12.8536C10.1583 13.0488 9.84171 13.0488 9.64645 12.8536L5.14645 8.35355C4.95118 8.15829 4.95118 7.84171 5.14645 7.64645L9.64645 3.14645C9.84171 2.95118 10.1583 2.95118 10.3536 3.14645Z",fill:"currentColor"}))}}),Sr=Y({name:"Switcher",render(){return T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},T("path",{d:"M12 8l10 8l-10 8z"}))}}),le="0!important",On="-1px!important";function Je(e){return H(`${e}-type`,[O("& +",[U("button",{},[H(`${e}-type`,[Z("border",{borderLeftWidth:le}),Z("state-border",{left:On})])])])])}function Ze(e){return H(`${e}-type`,[O("& +",[U("button",[H(`${e}-type`,[Z("border",{borderTopWidth:le}),Z("state-border",{top:On})])])])])}const _r=U("button-group",`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["https://registry.npmmirror.com/@gkd-kit/inspect/0.0.1741959366014/files/dist/assets/TrackGraph-BjAZact3.js","https://registry.npmmirror.com/@gkd-kit/inspect/0.0.1741959366014/files/dist/assets/node-CQaEOu5U.js","https://registry.npmmirror.com/@gkd-kit/inspect/0.0.1741959366014/files/dist/assets/index-Bb4F3D61.js","https://registry.npmmirror.com/@gkd-kit/inspect/0.0.1741959366014/files/dist/assets/index-_7MJ55_d.css","https://registry.npmmirror.com/@gkd-kit/inspect/0.0.1741959366014/files/dist/assets/index-DSSU8NoN.js","https://registry.npmmirror.com/@gkd-kit/inspect/0.0.1741959366014/files/dist/assets/index-CdMJYWIX.css"])))=>i.map(i=>d[i]);
2
+ import{h as Y,k as T,a as U,g as De,f as H,e as O,b as Z,u as pt,Z as xo,$ as vt,a0 as jt,a1 as ko,d as qt,a2 as Ut,o as ie,q as F,p as ut,m as Me,x as Wt,a3 as Vt,y as ce,a4 as Nn,a5 as Rn,a6 as $n,a7 as wo,t as G,a8 as an,a9 as Co,aa as So,ab as fe,ac as Ue,ad as _o,ae as Pn,af as Ee,ag as No,ah as Ro,ai as $o,c as Po,aj as Do,ak as Io,al as To,s as Kt,V as Eo,am as Ft,N as Lo,l as Ko,an as Fo,B as Nt,ao as Ao,v as Dn,i as zo,ap as At,aq as sn,ar as dn,w as dt,D as Ne,G as Ae,as as et,at as rt,A as J,H as Oe,I as te,J as z,K as I,F as C,Q as lt,L as w,au as ae,M as de,O as i,av as Bo,R as Re,aw as Be,ax as Te,ay as wt,az as Oo,aA as Ht,aB as Mo,aC as ft,aD as Uo,C as Gt,aE as _t,aF as In,aG as Ho,aH as jo,aI as Tn,aJ as En,z as qo,aK as Ln,aL as Wo,aM as He,aN as Ie,T as V,S as ee,aO as Vo,aP as Go,aQ as Yo,U as nt,aR as Qo,aS as Xo,P as Jo,aT as zt,aU as Fe,aV as cn,W as Zo,aW as un,aX as Bt,aY as fn}from"./index-Bb4F3D61.js";import{_ as Ct,U as hn,p as St,w as er,d as pn,F as Ot,G as tr}from"./index-DSSU8NoN.js";import{_ as nr}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{g as Pe,l as or,f as rr,a as lr,b as Yt,N as Qt,c as ht,d as ot,e as vn,h as gn}from"./node-CQaEOu5U.js";import{e as ir,f as ar,g as sr,_ as dr}from"./ActionCard.vue_vue_type_script_setup_true_lang-DvR65REU.js";import{a as cr,b as ur,g as fr}from"./snapshot-BGTbHtGy.js";import{h as tt,C as hr,e as pr,V as vr,c as mn,f as bn,b as gr,N as yn,u as mr,d as br,a as Kn,g as Fn,i as yr,j as xr,_ as kr}from"./dayjs.min-apf2pQT5.js";import{l as An,e as xn,a as wr}from"./error-C1Qb6YR1.js";import{_ as zn}from"./Input-BiXX4LCR.js";import"./chunk-UvhJcnXN.js";function Bn(e){return typeof e=="string"?`s-${e}`:`n-${e}`}const Cr=Y({name:"ChevronLeft",render(){return T("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T("path",{d:"M10.3536 3.14645C10.5488 3.34171 10.5488 3.65829 10.3536 3.85355L6.20711 8L10.3536 12.1464C10.5488 12.3417 10.5488 12.6583 10.3536 12.8536C10.1583 13.0488 9.84171 13.0488 9.64645 12.8536L5.14645 8.35355C4.95118 8.15829 4.95118 7.84171 5.14645 7.64645L9.64645 3.14645C9.84171 2.95118 10.1583 2.95118 10.3536 3.14645Z",fill:"currentColor"}))}}),Sr=Y({name:"Switcher",render(){return T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},T("path",{d:"M12 8l10 8l-10 8z"}))}}),le="0!important",On="-1px!important";function Je(e){return H(`${e}-type`,[O("& +",[U("button",{},[H(`${e}-type`,[Z("border",{borderLeftWidth:le}),Z("state-border",{left:On})])])])])}function Ze(e){return H(`${e}-type`,[O("& +",[U("button",[H(`${e}-type`,[Z("border",{borderTopWidth:le}),Z("state-border",{top:On})])])])])}const _r=U("button-group",`
3
3
  flex-wrap: nowrap;
4
4
  display: inline-flex;
5
5
  position: relative;
@@ -254,7 +254,7 @@ import{h as Y,k as T,a as U,g as De,f as H,e as O,b as Z,u as pt,Z as xo,$ as vt
254
254
  max-width: 100%;
255
255
  `),Z("suffix",`
256
256
  display: inline-flex;
257
- `)]),Z("empty","margin: auto;")]);var rl=function(e,t,a,n){function l(r){return r instanceof a?r:new a(function(h){h(r)})}return new(a||(a=Promise))(function(r,h){function d(c){try{v(n.next(c))}catch(b){h(b)}}function f(c){try{v(n.throw(c))}catch(b){h(b)}}function v(c){c.done?r(c.value):l(c.value).then(d,f)}v((n=n.apply(e,[])).next())})};function wn(e,t,a,n){return{getIsGroup(){return!1},getKey(r){return r[e]},getChildren:n||(r=>r[t]),getDisabled(r){return!!(r[a]||r.checkboxDisabled)}}}const ll={allowCheckingNotLoaded:Boolean,filter:Function,defaultExpandAll:Boolean,expandedKeys:Array,keyField:{type:String,default:"key"},labelField:{type:String,default:"label"},childrenField:{type:String,default:"children"},disabledField:{type:String,default:"disabled"},defaultExpandedKeys:{type:Array,default:()=>[]},indeterminateKeys:Array,renderSwitcherIcon:Function,onUpdateIndeterminateKeys:[Function,Array],"onUpdate:indeterminateKeys":[Function,Array],onUpdateExpandedKeys:[Function,Array],"onUpdate:expandedKeys":[Function,Array],overrideDefaultNodeClickBehavior:Function},il=Object.assign(Object.assign(Object.assign(Object.assign({},Me.props),{accordion:Boolean,showIrrelevantNodes:{type:Boolean,default:!0},data:{type:Array,default:()=>[]},expandOnDragenter:{type:Boolean,default:!0},expandOnClick:Boolean,checkOnClick:{type:[Boolean,Function],default:!1},cancelable:{type:Boolean,default:!0},checkable:Boolean,draggable:Boolean,blockNode:Boolean,blockLine:Boolean,showLine:Boolean,disabled:Boolean,checkedKeys:Array,defaultCheckedKeys:{type:Array,default:()=>[]},selectedKeys:Array,defaultSelectedKeys:{type:Array,default:()=>[]},multiple:Boolean,pattern:{type:String,default:""},onLoad:Function,cascade:Boolean,selectable:{type:Boolean,default:!0},scrollbarProps:Object,indent:{type:Number,default:24},allowDrop:{type:Function,default:Gr},animated:{type:Boolean,default:!0},checkboxPlacement:{type:String,default:"left"},virtualScroll:Boolean,watchProps:Array,renderLabel:Function,renderPrefix:Function,renderSuffix:Function,nodeProps:Function,keyboard:{type:Boolean,default:!0},getChildren:Function,onDragenter:[Function,Array],onDragleave:[Function,Array],onDragend:[Function,Array],onDragstart:[Function,Array],onDragover:[Function,Array],onDrop:[Function,Array],onUpdateCheckedKeys:[Function,Array],"onUpdate:checkedKeys":[Function,Array],onUpdateSelectedKeys:[Function,Array],"onUpdate:selectedKeys":[Function,Array]}),ll),{internalTreeSelect:Boolean,internalScrollable:Boolean,internalScrollablePadding:String,internalRenderEmpty:Function,internalHighlightKeySet:Object,internalUnifySelectCheck:Boolean,internalCheckboxFocusable:{type:Boolean,default:!0},internalFocusable:{type:Boolean,default:!0},checkStrategy:{type:String,default:"all"},leafOnly:Boolean}),al=Y({name:"Tree",props:il,slots:Object,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:a,mergedRtlRef:n}=pt(e),l=vt("Tree",n,t),r=Me("Tree","-tree",ol,Or,e,t),h=ie(null),d=ie(null),f=ie(null);function v(){var o;return(o=f.value)===null||o===void 0?void 0:o.listElRef}function c(){var o;return(o=f.value)===null||o===void 0?void 0:o.itemsElRef}const b=F(()=>{const{filter:o}=e;if(o)return o;const{labelField:k}=e;return(D,L)=>{if(!D.length)return!0;const K=L[k];return typeof K=="string"?K.toLowerCase().includes(D.toLowerCase()):!1}}),$=F(()=>{const{pattern:o}=e;return o?!o.length||!b.value?{filteredTree:e.data,highlightKeySet:null,expandedKeys:void 0}:tl(e.data,b.value,o,e.keyField,e.childrenField):{filteredTree:e.data,highlightKeySet:null,expandedKeys:void 0}}),P=F(()=>mn(e.showIrrelevantNodes?e.data:$.value.filteredTree,wn(e.keyField,e.childrenField,e.disabledField,e.getChildren))),s=Ue(Un,null),m=e.internalTreeSelect?s.dataTreeMate:F(()=>e.showIrrelevantNodes?P.value:mn(e.data,wn(e.keyField,e.childrenField,e.disabledField,e.getChildren))),{watchProps:y}=e,S=ie([]);y!=null&&y.includes("defaultCheckedKeys")?Ne(()=>{S.value=e.defaultCheckedKeys}):S.value=e.defaultCheckedKeys;const N=G(e,"checkedKeys"),_=ut(N,S),p=F(()=>m.value.getCheckedKeys(_.value,{cascade:e.cascade,allowNotLoaded:e.allowCheckingNotLoaded})),u=Zr(e),x=F(()=>p.value.checkedKeys),R=F(()=>{const{indeterminateKeys:o}=e;return o!==void 0?o:p.value.indeterminateKeys}),g=ie([]);y!=null&&y.includes("defaultSelectedKeys")?Ne(()=>{g.value=e.defaultSelectedKeys}):g.value=e.defaultSelectedKeys;const B=G(e,"selectedKeys"),A=ut(B,g),M=ie([]),we=o=>{M.value=e.defaultExpandAll?m.value.getNonLeafKeys():o===void 0?e.defaultExpandedKeys:o};y!=null&&y.includes("defaultExpandedKeys")?Ne(()=>{we(void 0)}):Ne(()=>{we(e.defaultExpandedKeys)});const ne=G(e,"expandedKeys"),j=ut(ne,M),he=F(()=>P.value.getFlattenedNodes(j.value)),{pendingNodeKeyRef:be,handleKeydown:ge}=Yr({props:e,mergedCheckedKeysRef:_,mergedSelectedKeysRef:A,fNodesRef:he,mergedExpandedKeysRef:j,handleCheck:Tt,handleSelect:Et,handleSwitcherClick:tn});let ye=null,$e=null;const q=ie(new Set),it=F(()=>e.internalHighlightKeySet||$.value.highlightKeySet),pe=ut(it,q),E=ie(new Set),W=F(()=>j.value.filter(o=>!E.value.has(o)));let oe=0;const se=ie(null),ve=ie(null),mt=ie(null),bt=ie(null),yt=ie(0),Gn=F(()=>{const{value:o}=ve;return o?o.parent:null});let $t=!1;Ae(G(e,"data"),()=>{$t=!0,et(()=>{$t=!1}),E.value.clear(),be.value=null,st()},{deep:!1});let Pt=!1;const Dt=()=>{Pt=!0,et(()=>{Pt=!1})};let at;Ae(G(e,"pattern"),(o,k)=>{if(e.showIrrelevantNodes)if(at=void 0,o){const{expandedKeys:D,highlightKeySet:L}=el(e.data,e.pattern,e.keyField,e.childrenField,b.value);q.value=L,Dt(),We(D,xe(D),{node:null,action:"filter"})}else q.value=new Set;else if(!o.length)at!==void 0&&(Dt(),We(at,xe(at),{node:null,action:"filter"}));else{k.length||(at=j.value);const{expandedKeys:D}=$.value;D!==void 0&&(Dt(),We(D,xe(D),{node:null,action:"filter"}))}});function Zt(o){return rl(this,void 0,void 0,function*(){const{onLoad:k}=e;if(!k){yield Promise.resolve();return}const{value:D}=E;if(!D.has(o.key)){D.add(o.key);try{(yield k(o.rawNode))===!1&&Ve()}catch(L){console.error(L),Ve()}D.delete(o.key)}})}Ne(()=>{var o;const{value:k}=P;if(!k)return;const{getNode:D}=k;(o=j.value)===null||o===void 0||o.forEach(L=>{const K=D(L);K&&!K.shallowLoaded&&Zt(K)})});const qe=ie(!1),Le=ie([]);Ae(W,(o,k)=>{if(!e.animated||Pt){et(xt);return}if($t)return;const D=dt(r.value.self.nodeHeight),L=new Set(k);let K=null,re=null;for(const X of o)if(!L.has(X)){if(K!==null)return;K=X}const me=new Set(o);for(const X of k)if(!me.has(X)){if(re!==null)return;re=X}if(K===null&&re===null)return;const{virtualScroll:ke}=e,Ye=(ke?f.value.listElRef:h.value).offsetHeight,Qe=Math.ceil(Ye/D)+1;let Ce;if(K!==null&&(Ce=k),re!==null&&(Ce===void 0?Ce=o:Ce=Ce.filter(X=>X!==re)),qe.value=!0,Le.value=P.value.getFlattenedNodes(Ce),K!==null){const X=Le.value.findIndex(Se=>Se.key===K);if(~X){const Se=Le.value[X].children;if(Se){const _e=bn(Se,o);Le.value.splice(X+1,0,{__motion:!0,mode:"expand",height:ke?_e.length*D:void 0,nodes:ke?_e.slice(0,Qe):_e})}}}if(re!==null){const X=Le.value.findIndex(Se=>Se.key===re);if(~X){const Se=Le.value[X].children;if(!Se)return;qe.value=!0;const _e=bn(Se,o);Le.value.splice(X+1,0,{__motion:!0,mode:"collapse",height:ke?_e.length*D:void 0,nodes:ke?_e.slice(0,Qe):_e})}}});const Yn=F(()=>gr(he.value)),Qn=F(()=>qe.value?Le.value:he.value);function xt(){const{value:o}=d;o&&o.sync()}function Xn(){qe.value=!1,e.virtualScroll&&et(xt)}function xe(o){const{getNode:k}=m.value;return o.map(D=>{var L;return((L=k(D))===null||L===void 0?void 0:L.rawNode)||null})}function We(o,k,D){const{"onUpdate:expandedKeys":L,onUpdateExpandedKeys:K}=e;M.value=o,L&&ce(L,o,k,D),K&&ce(K,o,k,D)}function en(o,k,D){const{"onUpdate:checkedKeys":L,onUpdateCheckedKeys:K}=e;S.value=o,K&&ce(K,o,k,D),L&&ce(L,o,k,D)}function Jn(o,k){const{"onUpdate:indeterminateKeys":D,onUpdateIndeterminateKeys:L}=e;D&&ce(D,o,k),L&&ce(L,o,k)}function It(o,k,D){const{"onUpdate:selectedKeys":L,onUpdateSelectedKeys:K}=e;g.value=o,K&&ce(K,o,k,D),L&&ce(L,o,k,D)}function Zn(o){const{onDragenter:k}=e;k&&ce(k,o)}function eo(o){const{onDragleave:k}=e;k&&ce(k,o)}function to(o){const{onDragend:k}=e;k&&ce(k,o)}function no(o){const{onDragstart:k}=e;k&&ce(k,o)}function oo(o){const{onDragover:k}=e;k&&ce(k,o)}function ro(o){const{onDrop:k}=e;k&&ce(k,o)}function st(){lo(),ze()}function lo(){se.value=null}function ze(){yt.value=0,ve.value=null,mt.value=null,bt.value=null,Ve()}function Ve(){ye&&(window.clearTimeout(ye),ye=null),$e=null}function Tt(o,k){if(e.disabled||Ke(o,e.disabledField))return;if(e.internalUnifySelectCheck&&!e.multiple){Et(o);return}const D=k?"check":"uncheck",{checkedKeys:L,indeterminateKeys:K}=m.value[D](o.key,x.value,{cascade:e.cascade,checkStrategy:u.value,allowNotLoaded:e.allowCheckingNotLoaded});en(L,xe(L),{node:o.rawNode,action:D}),Jn(K,xe(K))}function io(o){if(e.disabled)return;const{key:k}=o,{value:D}=j,L=D.findIndex(K=>K===k);if(~L){const K=Array.from(D);K.splice(L,1),We(K,xe(K),{node:o.rawNode,action:"collapse"})}else{const K=P.value.getNode(k);if(!K||K.isLeaf)return;let re;if(e.accordion){const me=new Set(o.siblings.map(({key:ke})=>ke));re=D.filter(ke=>!me.has(ke)),re.push(k)}else re=D.concat(k);We(re,xe(re),{node:o.rawNode,action:"expand"})}}function tn(o){e.disabled||qe.value||io(o)}function Et(o){if(!(e.disabled||!e.selectable)){if(be.value=o.key,e.internalUnifySelectCheck){const{value:{checkedKeys:k,indeterminateKeys:D}}=p;e.multiple?Tt(o,!(k.includes(o.key)||D.includes(o.key))):en([o.key],xe([o.key]),{node:o.rawNode,action:"check"})}if(e.multiple){const k=Array.from(A.value),D=k.findIndex(L=>L===o.key);~D?e.cancelable&&k.splice(D,1):~D||k.push(o.key),It(k,xe(k),{node:o.rawNode,action:~D?"unselect":"select"})}else A.value.includes(o.key)?e.cancelable&&It([],[],{node:o.rawNode,action:"unselect"}):It([o.key],xe([o.key]),{node:o.rawNode,action:"select"})}}function ao(o){if(ye&&(window.clearTimeout(ye),ye=null),o.isLeaf)return;$e=o.key;const k=()=>{if($e!==o.key)return;const{value:D}=mt;if(D&&D.key===o.key&&!j.value.includes(o.key)){const L=j.value.concat(o.key);We(L,xe(L),{node:o.rawNode,action:"expand"})}ye=null,$e=null};o.shallowLoaded?ye=window.setTimeout(()=>{k()},1e3):ye=window.setTimeout(()=>{Zt(o).then(()=>{k()})},1e3)}function so({event:o,node:k}){!e.draggable||e.disabled||Ke(k,e.disabledField)||(nn({event:o,node:k},!1),Zn({event:o,node:k.rawNode}))}function co({event:o,node:k}){!e.draggable||e.disabled||Ke(k,e.disabledField)||eo({event:o,node:k.rawNode})}function uo(o){o.target===o.currentTarget&&ze()}function fo({event:o,node:k}){st(),!(!e.draggable||e.disabled||Ke(k,e.disabledField))&&to({event:o,node:k.rawNode})}function ho({event:o,node:k}){!e.draggable||e.disabled||Ke(k,e.disabledField)||(oe=o.clientX,se.value=k,no({event:o,node:k.rawNode}))}function nn({event:o,node:k},D=!0){var L;if(!e.draggable||e.disabled||Ke(k,e.disabledField))return;const{value:K}=se;if(!K)return;const{allowDrop:re,indent:me}=e;D&&oo({event:o,node:k.rawNode});const ke=o.currentTarget,{height:Ye,top:Qe}=ke.getBoundingClientRect(),Ce=o.clientY-Qe;let X;re({node:k.rawNode,dropPosition:"inside",phase:"drag"})?Ce<=8?X="before":Ce>=Ye-8?X="after":X="inside":Ce<=Ye/2?X="before":X="after";const{value:_e}=Yn;let Q,ue;const Xe=_e(k.key);if(Xe===null){ze();return}let kt=!1;X==="inside"?(Q=k,ue="inside"):X==="before"?k.isFirstChild?(Q=k,ue="before"):(Q=he.value[Xe-1],ue="after"):(Q=k,ue="after"),!Q.isLeaf&&j.value.includes(Q.key)&&(kt=!0,ue==="after"&&(Q=he.value[Xe+1],Q?ue="before":(Q=k,ue="inside")));const rn=Q;if(mt.value=rn,!kt&&K.isLastChild&&K.key===Q.key&&(ue="after"),ue==="after"){let ln=oe-o.clientX,Lt=0;for(;ln>=me/2&&Q.parent!==null&&Q.isLastChild&&Lt<1;)ln-=me,Lt+=1,Q=Q.parent;yt.value=Lt}else yt.value=0;if((K.contains(Q)||ue==="inside"&&((L=K.parent)===null||L===void 0?void 0:L.key)===Q.key)&&!(K.key===rn.key&&K.key===Q.key)){ze();return}if(!re({node:Q.rawNode,dropPosition:ue,phase:"drag"})){ze();return}if(K.key===Q.key)Ve();else if($e!==Q.key)if(ue==="inside"){if(e.expandOnDragenter){if(ao(Q),!Q.shallowLoaded&&$e!==Q.key){st();return}}else if(!Q.shallowLoaded){st();return}}else Ve();else ue!=="inside"&&Ve();bt.value=ue,ve.value=Q}function po({event:o,node:k,dropPosition:D}){if(!e.draggable||e.disabled||Ke(k,e.disabledField))return;const{value:L}=se,{value:K}=ve,{value:re}=bt;if(!(!L||!K||!re)&&e.allowDrop({node:K.rawNode,dropPosition:re,phase:"drag"})&&L.key!==K.key){if(re==="before"){const me=L.getNext({includeDisabled:!0});if(me&&me.key===K.key){ze();return}}if(re==="after"){const me=L.getPrev({includeDisabled:!0});if(me&&me.key===K.key){ze();return}}ro({event:o,node:K.rawNode,dragNode:L.rawNode,dropPosition:D}),st()}}function vo(){xt()}function go(){xt()}function mo(o){var k;if(e.virtualScroll||e.internalScrollable){const{value:D}=d;if(!((k=D==null?void 0:D.containerRef)===null||k===void 0)&&k.contains(o.relatedTarget))return;be.value=null}else{const{value:D}=h;if(D!=null&&D.contains(o.relatedTarget))return;be.value=null}}Ae(be,o=>{var k,D;if(o!==null){if(e.virtualScroll)(k=f.value)===null||k===void 0||k.scrollTo({key:o});else if(e.internalScrollable){const{value:L}=d;if(L===null)return;const K=(D=L.contentRef)===null||D===void 0?void 0:D.querySelector(`[data-key="${Bn(o)}"]`);if(!K)return;L.scrollTo({el:K})}}}),jt(gt,{loadingKeysRef:E,highlightKeySetRef:pe,displayedCheckedKeysRef:x,displayedIndeterminateKeysRef:R,mergedSelectedKeysRef:A,mergedExpandedKeysRef:j,mergedThemeRef:r,mergedCheckStrategyRef:u,nodePropsRef:G(e,"nodeProps"),disabledRef:G(e,"disabled"),checkableRef:G(e,"checkable"),selectableRef:G(e,"selectable"),expandOnClickRef:G(e,"expandOnClick"),onLoadRef:G(e,"onLoad"),draggableRef:G(e,"draggable"),blockLineRef:G(e,"blockLine"),indentRef:G(e,"indent"),cascadeRef:G(e,"cascade"),checkOnClickRef:G(e,"checkOnClick"),checkboxPlacementRef:e.checkboxPlacement,droppingMouseNodeRef:mt,droppingNodeParentRef:Gn,draggingNodeRef:se,droppingPositionRef:bt,droppingOffsetLevelRef:yt,fNodesRef:he,pendingNodeKeyRef:be,showLineRef:G(e,"showLine"),disabledFieldRef:G(e,"disabledField"),internalScrollableRef:G(e,"internalScrollable"),internalCheckboxFocusableRef:G(e,"internalCheckboxFocusable"),internalTreeSelect:e.internalTreeSelect,renderLabelRef:G(e,"renderLabel"),renderPrefixRef:G(e,"renderPrefix"),renderSuffixRef:G(e,"renderSuffix"),renderSwitcherIconRef:G(e,"renderSwitcherIcon"),labelFieldRef:G(e,"labelField"),multipleRef:G(e,"multiple"),overrideDefaultNodeClickBehaviorRef:G(e,"overrideDefaultNodeClickBehavior"),handleSwitcherClick:tn,handleDragEnd:fo,handleDragEnter:so,handleDragLeave:co,handleDragStart:ho,handleDrop:po,handleDragOver:nn,handleSelect:Et,handleCheck:Tt});function bo(o,k){var D,L;typeof o=="number"?(D=f.value)===null||D===void 0||D.scrollTo(o,k||0):(L=f.value)===null||L===void 0||L.scrollTo(o)}const yo={handleKeydown:ge,scrollTo:bo,getCheckedData:()=>{if(!e.checkable)return{keys:[],options:[]};const{checkedKeys:o}=p.value;return{keys:o,options:xe(o)}},getIndeterminateData:()=>{if(!e.checkable)return{keys:[],options:[]};const{indeterminateKeys:o}=p.value;return{keys:o,options:xe(o)}}},on=F(()=>{const{common:{cubicBezierEaseInOut:o},self:{fontSize:k,nodeBorderRadius:D,nodeColorHover:L,nodeColorPressed:K,nodeColorActive:re,arrowColor:me,loadingColor:ke,nodeTextColor:Ye,nodeTextColorDisabled:Qe,dropMarkColor:Ce,nodeWrapperPadding:X,nodeHeight:Se,lineHeight:_e,lineColor:Q}}=r.value,ue=At(X,"top"),Xe=At(X,"bottom"),kt=Dn(dt(Se)-dt(ue)-dt(Xe));return{"--n-arrow-color":me,"--n-loading-color":ke,"--n-bezier":o,"--n-font-size":k,"--n-node-border-radius":D,"--n-node-color-active":re,"--n-node-color-hover":L,"--n-node-color-pressed":K,"--n-node-text-color":Ye,"--n-node-text-color-disabled":Qe,"--n-drop-mark-color":Ce,"--n-node-wrapper-padding":X,"--n-line-offset-top":`-${ue}`,"--n-line-offset-bottom":`-${Xe}`,"--n-node-content-height":kt,"--n-line-height":_e,"--n-line-color":Q}}),Ge=a?Wt("tree",void 0,on,e):void 0;return Object.assign(Object.assign({},yo),{mergedClsPrefix:t,mergedTheme:r,rtlEnabled:l,fNodes:Qn,aip:qe,selfElRef:h,virtualListInstRef:f,scrollbarInstRef:d,handleFocusout:mo,handleDragLeaveTree:uo,handleScroll:vo,getScrollContainer:v,getScrollContent:c,handleAfterEnter:Xn,handleResize:go,cssVars:a?void 0:on,themeClass:Ge==null?void 0:Ge.themeClass,onRender:Ge==null?void 0:Ge.onRender})},render(){var e;const{fNodes:t,internalRenderEmpty:a}=this;if(!t.length&&a)return a();const{mergedClsPrefix:n,blockNode:l,blockLine:r,draggable:h,disabled:d,internalFocusable:f,checkable:v,handleKeydown:c,rtlEnabled:b,handleFocusout:$,scrollbarProps:P}=this,s=f&&!d,m=s?"0":void 0,y=[`${n}-tree`,b&&`${n}-tree--rtl`,v&&`${n}-tree--checkable`,(r||l)&&`${n}-tree--block-node`,r&&`${n}-tree--block-line`],S=_=>"__motion"in _?T(nl,{height:_.height,nodes:_.nodes,clsPrefix:n,mode:_.mode,onAfterEnter:this.handleAfterEnter}):T(jn,{key:_.key,tmNode:_,clsPrefix:n});if(this.virtualScroll){const{mergedTheme:_,internalScrollablePadding:p}=this,u=At(p||"0");return T(sn,Object.assign({},P,{ref:"scrollbarInstRef",onDragleave:h?this.handleDragLeaveTree:void 0,container:this.getScrollContainer,content:this.getScrollContent,class:y,theme:_.peers.Scrollbar,themeOverrides:_.peerOverrides.Scrollbar,tabindex:m,onKeydown:s?c:void 0,onFocusout:s?$:void 0}),{default:()=>{var x;return(x=this.onRender)===null||x===void 0||x.call(this),t.length?T(vr,{ref:"virtualListInstRef",items:this.fNodes,itemSize:dt(_.self.nodeHeight),ignoreItemResize:this.aip,paddingTop:u.top,paddingBottom:u.bottom,class:this.themeClass,style:[this.cssVars,{paddingLeft:u.left,paddingRight:u.right}],onScroll:this.handleScroll,onResize:this.handleResize,showScrollbar:!1,itemResizable:!0},{default:({item:R})=>S(R)}):dn(this.$slots.empty,()=>[T(yn,{class:`${n}-tree__empty`,theme:this.mergedTheme.peers.Empty,themeOverrides:this.mergedTheme.peerOverrides.Empty})])}})}const{internalScrollable:N}=this;return y.push(this.themeClass),(e=this.onRender)===null||e===void 0||e.call(this),N?T(sn,Object.assign({},P,{class:y,tabindex:m,onKeydown:s?c:void 0,onFocusout:s?$:void 0,style:this.cssVars,contentStyle:{padding:this.internalScrollablePadding}}),{default:()=>T("div",{onDragleave:h?this.handleDragLeaveTree:void 0,ref:"selfElRef"},this.fNodes.map(S))}):T("div",{class:y,tabindex:m,ref:"selfElRef",style:this.cssVars,onKeydown:s?c:void 0,onFocusout:s?$:void 0,onDragleave:h?this.handleDragLeaveTree:void 0},t.length?t.map(S):dn(this.$slots.empty,()=>[T(yn,{class:`${n}-tree__empty`,theme:this.mergedTheme.peers.Empty,themeOverrides:this.mergedTheme.peerOverrides.Empty})]))}}),sl={class:"TrackCard",flex:"","flex-col":"","h-full":"","p-12px":"","box-border":"","gap-8px":"","overflow-hidden":""},dl={flex:"","justify-between":"","items-center":""},cl={flex:"","items-center":"","gap-4px":""},ul={"flex-1":"",flex:"","gap-12px":"","overflow-hidden":""},fl={"self-stretch":"",flex:"[2]"},hl={"mb-24px":"","break-all":"","px-4px":"","py-2px":"","leading-20px":"",bg:"#eee",gkd_code:""},pl={flex:"","flex-col":"","gap-12px":""},vl={key:0,flex:"","gap-8px":""},gl=["onClick"],qn=()=>Oo(()=>import("./TrackGraph-DahfH9hz.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),ml=Bo({loader:qn,delay:0});setTimeout(qn,3e3);const bl=Y({__name:"TrackCard",props:{nodes:{},queryResult:{},selector:{},onClose:{type:Function,default:rt}},setup(e){const t=e,a=F(()=>t.queryResult?t.queryResult.unitResults.asJsReadonlyArrayView().concat():[]),n=F(()=>a.value.filter(f=>!f.context.prev)),l=F(()=>a.value.filter(f=>f.context.prev)),r=J([]);Ne(()=>{r.value=l.value});const h=f=>{r.value.includes(f)?r.value=r.value.filter(v=>v!==f):r.value=r.value.concat(f)},d=f=>{const v=f.value;return v instanceof hn&&a.value.some(c=>c.expression===v)&&!f.outChildren.some(c=>c.value instanceof hn)?{outline:"1px solid #00F"}:""};return(f,v)=>{const c=Oe("SvgIcon"),b=lt,$=Xt;return z(),te("div",sl,[I("div",dl,[I("div",cl,[C(c,{name:"path",h:"24px"}),v[0]||(v[0]=I("div",{text:"20px/28px","font-bold":""},"选择器路径视图",-1))]),C(b,{text:"",onClick:f.onClose},{default:w(()=>[C(c,{name:"close",h:"20px"})]),_:1},8,["onClick"])]),I("div",ul,[I("div",fl,[f.nodes.length&&f.queryResult?(z(),ae(i(ml),{key:0,nodes:f.nodes,queryResult:f.queryResult,showUnitResults:i(l),filterUnitResults:i(r),class:"h-[calc(100%-2px)] b-1px b-solid"},null,8,["nodes","queryResult","showUnitResults","filterUnitResults"])):de("",!0),v[1]||(v[1]=I("div",{relative:"","pointer-events-none":"","z-1":""},[I("div",{absolute:"","left-8px":"","bottom-8px":"",text:"12px/14px #6C6E71"}," *为简化视图已隐藏无关节点 ")],-1))]),C($,{class:"self-stretch flex-1"},{default:w(()=>[I("div",hl,[C(Ct,{class:"gkd_code",source:f.selector.source,node:f.selector.ast,getNodeStyle:d},null,8,["source","node"])]),I("div",pl,[i(n).length?(z(),te("div",vl,[(z(!0),te(Re,null,Be(i(n),(P,s)=>(z(),te("div",{key:s,"break-all":"","px-4px":"","py-2px":"",gkd_code:"","b-1px":"","b-solid":"",b:"#ccc"},[C(Ct,{class:"gkd_code",source:f.selector.source,node:f.selector.findAst(P.expression)},null,8,["source","node"])]))),128))])):de("",!0),(z(!0),te(Re,null,Be(i(l),(P,s)=>(z(),te("div",{key:s,"cursor-pointer":"","break-all":"","px-4px":"","py-2px":"",gkd_code:"","b-1px":"","b-solid":"","transition-colors":"",onClick:m=>h(P),style:Te({borderColor:i(wt)[s%i(wt).length],backgroundColor:i(r).includes(P)?"#eee":void 0})},[I("div",{"inline-block":"","align-middle":"","size-16px":"",style:Te({backgroundColor:i(wt)[s%i(wt).length]})},null,4),v[2]||(v[2]=I("span",{"pl-4px":""},null,-1)),C(Ct,{class:"gkd_code",source:f.selector.source,node:f.selector.findAst(P.expression)},null,8,["source","node"])],12,gl))),128))])]),_:1})])])}}}),yl=Y({__name:"TrackModal",props:{data:{},show:{type:Boolean},onUpdateShow:{type:Function,default:rt},onUpdateData:{type:Function,default:rt}},setup(e){const t=e,a=ie(!1),n=ie(0);return Ht(()=>t.show,async()=>{t.show?(a.value=!0,n.value=-1,await new Promise(l=>setTimeout(l,300)),n.value=0):(n.value=1,await new Promise(l=>setTimeout(l,300)),a.value=!1,n.value=0,t.onUpdateData())}),Mo("keyup",l=>{l.key==="Escape"&&t.onUpdateShow(!1)}),(l,r)=>i(a)?(z(),te("div",{key:0,class:ft(["TrackModal",{"track-model-enter":i(n)===-1,"track-model-exit":i(n)===1}]),absolute:"","left-0":"","top-0":"","bg-white":"","z-3000":"",w:"[--gkd-w]",h:"[--gkd-h]"},[l.data?(z(),ae(bl,Uo({key:0},l.data,{onClose:r[0]||(r[0]=h=>l.onUpdateShow(!1))}),null,16)):de("",!0)],2)):de("",!0)}}),xl=nr(yl,[["__scopeId","data-v-66dad45d"]]),Cn=e=>{const t=J(),a={x:0,y:0},n=Gt({...a});let l;const r=c=>{l&&c.preventDefault()},h=c=>{l=c,a.x=n.x,a.y=n.y},d=c=>{if(!l||!t.value)return;const b=c.clientX-l.clientX,$=c.clientY-l.clientY;e(b)&&(n.x=a.x+b),n.y=a.y+$},f=()=>{l=void 0},v=()=>{if(!t.value||!l)return;f();const{top:c,bottom:b,left:$,right:P}=t.value.getBoundingClientRect();(P<0||$>window.innerWidth||b<0||c>window.innerHeight)&&(n.x=a.x,n.y=a.y)};return Nt(()=>{window.addEventListener("pointermove",d),window.addEventListener("pointerup",v),document.addEventListener("selectstart",r)}),_t(()=>{window.removeEventListener("pointermove",d),window.removeEventListener("pointerup",v),document.removeEventListener("selectstart",r),f()}),Ae(t,(c,b)=>{c&&(c.addEventListener("pointerdown",h),c.addEventListener("pointerup",f)),b&&(b.removeEventListener("pointerdown",h),b.removeEventListener("pointerup",f))}),_t(()=>{t.value&&(t.value.removeEventListener("pointerdown",h),t.value.removeEventListener("pointerup",f))}),{target:t,offset:n}};let ct=1e3;const kl=()=>{ct++;const e=J(ct);return{zIndex:e,setTop:()=>{e.value!==ct&&(ct++,e.value=ct)}}},Sn="transition-top,bottom,left,right-500",Rt=Y({__name:"DraggableCard",props:{initialValue:{default:()=>({})},minWidth:{},sizeDraggable:{type:Boolean},show:{type:Boolean,default:!0},class:{}},setup(e){var u,x;const t=e,a=t.initialValue.left!==void 0,n=t.initialValue.top!==void 0,l={x:(u=a?t.initialValue.left:t.initialValue.right)!=null?u:0,y:(x=n?t.initialValue.top:t.initialValue.bottom)!=null?x:0},r=Cn(R=>{const g=(t.initialValue.width||0)+h.offset.x+-r.offset.x-R;return(t.minWidth||0)<g}),h=Cn(R=>{const g=(t.initialValue.width||0)+h.offset.x+R-r.offset.x;return(t.minWidth||0)<g}),d=Gt({...l}),f=F(()=>{const R=(t.initialValue.width||0)+h.offset.x-r.offset.x,g=t.initialValue.width?`width:${R}px;`:"",B=n?`top:${d.y}px;`:`bottom:${d.y}px;`;return a?`left:${d.x-r.offset.x}px;`+B+g:`right:${d.x-h.offset.x}px;`+B+g});let v;const c=J(!1),b=R=>{v=R,l.x=d.x,l.y=d.y,c.value=!1},$=R=>{if(!m.value||!v)return;const g=R.clientX-v.clientX,B=R.clientY-v.clientY;d.x=l.x+(a?g:-g),d.y=l.y+(n?B:-B),c.value=!0},P=()=>{v=void 0},s=J(),m=J(),y=R=>{v&&R.preventDefault()},S=()=>{if(!m.value||!v)return;P();const{top:R,bottom:g,left:B,right:A}=m.value.getBoundingClientRect();if(A<0||B>window.innerWidth||g<0||R>window.innerHeight){d.x=l.x,d.y=l.y;const M=s.value;M&&(M.classList.add(Sn),setTimeout(()=>{M.classList.remove(Sn)},550))}};Nt(()=>{window.addEventListener("pointermove",$),window.addEventListener("pointerup",S),document.addEventListener("selectstart",y)}),_t(()=>{window.removeEventListener("pointermove",$),window.removeEventListener("pointerup",S),document.removeEventListener("selectstart",y),P()}),Ae(m,(R,g)=>{R&&(R.addEventListener("pointerdown",b),R.addEventListener("pointerup",P)),g&&(g.removeEventListener("pointerdown",b),g.removeEventListener("pointerup",P))}),_t(()=>{m.value&&(m.value.removeEventListener("pointerdown",b),m.value.removeEventListener("pointerup",P))});const N=R=>{R instanceof HTMLElement?m.value=R:m.value=void 0},{setTop:_,zIndex:p}=kl();return Ae(()=>t.show,()=>{t.show&&_()}),(R,g)=>(z(),ae(In,{to:"body"},[R.show?(z(),te("div",{key:0,fixed:"",ref_key:"box",ref:s,class:ft(["DraggableCard",t.class]),style:Te([i(f),{zIndex:i(p)}]),onMousedown:g[0]||(g[0]=(...B)=>i(_)&&i(_)(...B))},[Ho(R.$slots,"default",{onRef:N,moved:i(c)}),R.sizeDraggable?(z(),te(Re,{key:0},[I("div",{ref:i(r).target,absolute:"","right-full":"","top-0":"","bottom-0":"","w-5px":"","cursor-ew-resize":""},null,512),I("div",{ref:i(h).target,absolute:"","left-full":"","top-0":"","bottom-0":"","w-5px":"","cursor-ew-resize":""},null,512)],64)):de("",!0)],38)):de("",!0)]))}}),wl=async e=>fetch("https://detect.gkd.li/api/getImportId?id="+e).then(t=>t.json()).catch(()=>0),je=jo("snapshot",()=>{const e=Tn(),t=En(),a=qo(),n=Ln(),{snapshotImportId:l,snapshotImageId:r,importSnapshotId:h}=n,d=J();Ht(()=>e.params.snapshotId,ne=>{d.value=Wo(ne)});const f=F(()=>{if(d.value)return l[d.value]}),v=F(()=>{if(d.value)return r[d.value]}),c=J();Ne(()=>{c.value&&(document.title="快照-"+(Pe(c.value).name||c.value.appId))});const b=J(),$=F(()=>{if(b.value)return URL.createObjectURL(new Blob([b.value],{type:"image/png"}))}),P=J(!1),s=mr(async ne=>{if(P.value=!1,!ne){c.value=void 0,b.value=void 0;return}if(await Promise.all([cr.getItem(ne).then(j=>{c.value=j||void 0}),ur.getItem(ne).then(j=>{b.value=j||void 0})]),!c.value){const j=l[ne]||await wl(ne);if(j&&Number.isSafeInteger(j)){P.value=!0,t.replace({path:"/i/"+j,query:e.query});return}}}),m=F(()=>s.loading);Ht(()=>d.value,s.invoke),Ne(()=>{f.value&&n.inited&&!h[f.value]&&d.value&&(h[f.value]=d.value,fetch("https://detect.gkd.li/api/detectSnapshot?importId="+f.value))});const y=F(()=>fr()&&a.inited&&a.autoUploadImport&&n.inited);Ne(()=>{y.value&&c.value&&!v.value&&ir(c.value),y.value&&c.value&&!f.value&&ar(c.value),y.value&&c.value&&f.value&&sr(c.value.id,f.value)});const S=F(()=>c.value&&a.inited?c.value.nodes.length<=a.maxShowNodeSize?structuredClone(c.value.nodes):structuredClone(c.value.nodes.slice(0,a.maxShowNodeSize)):[]),N=F(()=>{if(S.value.length)return or(S.value)}),_=F(()=>c.value?c.value.nodes.length-a.maxShowNodeSize:0),p=J(),u=J(0),x=J(),R=J(),g=async ne=>{p.value=ne,u.value=Date.now(),await et(),R.value&&!R.value.includes(ne)&&(x.value=void 0,R.value=void 0)};Ne(()=>{N.value&&g(N.value)});const B=ne=>{x.value=ne;const j=rr(S.value,x.value);j.length&&g(j[0]),j.length>1&&(R.value=j)},A=ie(!1),M=J();return{snapshotId:d,snapshot:c,rootNode:N,screenshotUrl:$,loading:m,redirected:P,importId:f,imageId:v,focusNode:p,updateFocusNode:g,focusTime:u,overlapNodes:R,missNodeSize:_,focusPosition:x,updatePosition:B,trackData:M,trackShow:A,showTrack:(ne,j)=>{A.value=!0,M.value={selector:ne,nodes:S.value,queryResult:j}}}}),Cl={absolute:"","top-0":"","right-0":"","pt-4px":"","pr-8px":""},Sl={key:0,flex:"","justify-between":"","items-center":""},_l={flex:"","items-center":"","h-24px":"","px-2px":""},Nl={"max-w-500px":""},Rl=Y({__name:"AttrCard",props:{show:{type:Boolean},onUpdateShow:{type:Function,default:rt}},setup(e){const{focusNode:t}=He(je()),a=F(()=>{const h=t.value;return h?{_id:{desc:"虚拟属性(真机不可用):生成快照访问节点顺序",type:"info",show:!0},_pid:{desc:"虚拟属性(真机不可用):父节点的 _id",type:"info",show:!0},_selector:{desc:"自动生成的选择器, 点击“_selector”可直接复制内容, 用于定位",type:"info",show:!0},depth:{desc:"使用此属性在某些应用上可能造成无限节点错误",type:"info",show:!0},id:{desc:"可快速查找",type:"quickFind",show:!!((h.quickFind||h.idQf)&&h.attr.id)},vid:{desc:"可快速查找",type:"quickFind",show:!!((h.quickFind||h.idQf)&&h.attr.vid)},text:{desc:"可快速查找",type:"quickFind",show:!!((h.quickFind||h.textQf)&&h.attr.text)}}:{}}),n=["text","desc"],l=F(()=>t.value?Object.entries(t.value.attr).map(([h,d])=>{var v,c,b;const f={name:h,value:d,desc:JSON.stringify(d),tip:(v=a.value[h])!=null&&v.show?a.value[h]:void 0};return n.includes(h)?[f,{name:h+".length",value:(c=d==null?void 0:d.length)!=null?c:null,desc:JSON.stringify((b=d==null?void 0:d.length)!=null?b:null),tip:void 0}]:f}).flat():[]),r=F(()=>t.value?lr(t.value):"");return(h,d)=>{const f=Oe("SvgIcon"),v=lt,c=Qt,b=Yt,$=Wr,P=br,s=Vr,m=qr,y=jr;return z(),ae(Rt,{initialValue:{top:40,right:10},class:"box-shadow-dim",show:h.show&&!!i(t)},{default:w(({onRef:S})=>[I("div",Cl,[C(v,{onClick:d[0]||(d[0]=N=>h.onUpdateShow(!h.show)),text:"",title:"最小化"},{icon:w(()=>[C(f,{name:"minus"})]),_:1})]),i(t)?(z(),ae(y,{key:0,size:"small",striped:"",singleLine:!1,class:"gkd_code",themeOverrides:{thPaddingSmall:"1px 3px",tdPaddingSmall:"0px 3px"}},{default:w(()=>[I("thead",null,[I("tr",{ref:S,"cursor-move":""},d[2]||(d[2]=[I("th",null,"Name",-1),I("th",null,"Value",-1)]),512)]),C(m,null,{default:w(()=>[(z(!0),te(Re,null,Be(i(l),N=>(z(),ae(s,{key:N.name},{default:w(()=>[C($,{onClick:_=>i(Ie)(`${N.name}=${N.desc}`)},{default:w(()=>[N.tip?(z(),te("div",Sl,[I("div",null,V(N.name),1),C(b,null,{trigger:w(()=>[C(c,{size:"16"},{default:w(()=>[N.tip.type=="info"?(z(),ae(f,{key:0,name:"info"})):N.tip.type=="quickFind"?(z(),ae(f,{key:1,name:"ok"})):de("",!0)]),_:2},1024)]),default:w(()=>[ee(" "+V(N.tip.desc),1)]),_:2},1024)])):(z(),te(Re,{key:1},[ee(V(N.name),1)],64))]),_:2},1032,["onClick"]),C($,null,{default:w(()=>[C(P,{class:ft(["w-[calc(var(--gkd-w)*0.12)]",{"text-left direction-rtl":N.name=="id","opacity-50":N.value===null}])},{default:w(()=>[ee(V(N.desc),1)]),_:2},1032,["class"])]),_:2},1024)]),_:2},1024))),128)),C(s,null,{default:w(()=>[C($,{colspan:"2"},{default:w(()=>[I("div",_l,[C(b,null,{trigger:w(()=>[C(v,{text:"",onClick:d[1]||(d[1]=N=>i(Ie)(i(r)))},{icon:w(()=>[C(c,{size:"20"},{default:w(()=>[C(f,{name:"path"})]),_:1})]),_:1})]),default:w(()=>[I("div",Nl,V(i(r)),1)]),_:1})])]),_:1})]),_:1})]),_:1})]),_:2},1024)):de("",!0)]),_:1},8,["show"])}}}),$l={bg:"#eee","px-2px":""},Pl=Y({__name:"OverlapCard",setup(e){const t=je(),{focusNode:a,overlapNodes:n,focusPosition:l}=He(t),h=document.documentElement.scrollWidth/100*25.5;return(d,f)=>{const v=lt,c=Kn,b=Vo;return z(),ae(Rt,{initialValue:{top:215,left:h},class:"box-shadow-dim w-420px",show:!!(i(n)&&i(l))},{default:w(({onRef:$})=>[i(n)&&i(l)?(z(),ae(b,{key:0,size:"small",closable:"",onClose:f[0]||(f[0]=P=>n.value=void 0)},{header:w(()=>[I("div",{ref:$,"cursor-move":""},[f[1]||(f[1]=ee(" 位置 ")),I("span",$l,V(`${i(l).x.toFixed(0)},${i(l).y.toFixed()}`),1),ee(" 存在 "+V(i(n).length)+" 个层叠节点 ",1)],512)]),default:w(()=>[C(c,{style:{"max-height":"400px","overflow-y":"scroll","padding-bottom":"10px"},class:"scrollbar-hidden"},{default:w(()=>[(z(!0),te(Re,null,Be(i(n),P=>(z(),ae(v,{key:P.id,onClick:s=>i(t).updateFocusNode(P),size:"small",style:Te(i(ht)(P,i(a)))},{default:w(()=>[ee(V(i(ot)(P)),1)]),_:2},1032,["onClick","style"]))),128))]),_:1})]),_:2},1024)):de("",!0)]),_:1},8,["initialValue","show"])}}}),Jt=Go(),Wn=F(()=>Jt.width.value/100),Vn=F(()=>Math.max(1200,Jt.width.value));F(()=>Math.max(700,Jt.height.value));const Dl={"bg-white":"","b-1px":"","b-solid":"","b-gray-200":"","rounded-4px":"","p-8px":""},Il={flex:"","m-b-4px":"","pr-4px":""},Tl={"min-h-24px":""},El={key:0,"color-red":"","whitespace-pre":""},Ll=Y({__name:"RuleCard",props:{show:{type:Boolean},onUpdateShow:{type:Function,default:rt}},setup(e){const t=je(),a=He(t),{rootNode:n,focusNode:l}=a,r=a.snapshot,h=J(""),d=Yo(h,500),f=s=>{if(s==null)return[];if(typeof s=="string")return[s];if(Array.isArray(s)&&s.every(m=>typeof m=="string"))return s},v=s=>{const m=f(s.matches);if(!m)return"非法格式: matches";const y=f(s.anyMatches);if(!y)return"非法格式: anyMatches";const S=f(s.excludeMatches);if(!S)return"非法格式: excludeMatches";const N=[];for(let g=0;g<m.length;g++){const B=m[g];try{N.push(St(B))}catch(A){const M=A instanceof Error?A.message:String(A);return`非法选择器: matches[${g}]
257
+ `)]),Z("empty","margin: auto;")]);var rl=function(e,t,a,n){function l(r){return r instanceof a?r:new a(function(h){h(r)})}return new(a||(a=Promise))(function(r,h){function d(c){try{v(n.next(c))}catch(b){h(b)}}function f(c){try{v(n.throw(c))}catch(b){h(b)}}function v(c){c.done?r(c.value):l(c.value).then(d,f)}v((n=n.apply(e,[])).next())})};function wn(e,t,a,n){return{getIsGroup(){return!1},getKey(r){return r[e]},getChildren:n||(r=>r[t]),getDisabled(r){return!!(r[a]||r.checkboxDisabled)}}}const ll={allowCheckingNotLoaded:Boolean,filter:Function,defaultExpandAll:Boolean,expandedKeys:Array,keyField:{type:String,default:"key"},labelField:{type:String,default:"label"},childrenField:{type:String,default:"children"},disabledField:{type:String,default:"disabled"},defaultExpandedKeys:{type:Array,default:()=>[]},indeterminateKeys:Array,renderSwitcherIcon:Function,onUpdateIndeterminateKeys:[Function,Array],"onUpdate:indeterminateKeys":[Function,Array],onUpdateExpandedKeys:[Function,Array],"onUpdate:expandedKeys":[Function,Array],overrideDefaultNodeClickBehavior:Function},il=Object.assign(Object.assign(Object.assign(Object.assign({},Me.props),{accordion:Boolean,showIrrelevantNodes:{type:Boolean,default:!0},data:{type:Array,default:()=>[]},expandOnDragenter:{type:Boolean,default:!0},expandOnClick:Boolean,checkOnClick:{type:[Boolean,Function],default:!1},cancelable:{type:Boolean,default:!0},checkable:Boolean,draggable:Boolean,blockNode:Boolean,blockLine:Boolean,showLine:Boolean,disabled:Boolean,checkedKeys:Array,defaultCheckedKeys:{type:Array,default:()=>[]},selectedKeys:Array,defaultSelectedKeys:{type:Array,default:()=>[]},multiple:Boolean,pattern:{type:String,default:""},onLoad:Function,cascade:Boolean,selectable:{type:Boolean,default:!0},scrollbarProps:Object,indent:{type:Number,default:24},allowDrop:{type:Function,default:Gr},animated:{type:Boolean,default:!0},checkboxPlacement:{type:String,default:"left"},virtualScroll:Boolean,watchProps:Array,renderLabel:Function,renderPrefix:Function,renderSuffix:Function,nodeProps:Function,keyboard:{type:Boolean,default:!0},getChildren:Function,onDragenter:[Function,Array],onDragleave:[Function,Array],onDragend:[Function,Array],onDragstart:[Function,Array],onDragover:[Function,Array],onDrop:[Function,Array],onUpdateCheckedKeys:[Function,Array],"onUpdate:checkedKeys":[Function,Array],onUpdateSelectedKeys:[Function,Array],"onUpdate:selectedKeys":[Function,Array]}),ll),{internalTreeSelect:Boolean,internalScrollable:Boolean,internalScrollablePadding:String,internalRenderEmpty:Function,internalHighlightKeySet:Object,internalUnifySelectCheck:Boolean,internalCheckboxFocusable:{type:Boolean,default:!0},internalFocusable:{type:Boolean,default:!0},checkStrategy:{type:String,default:"all"},leafOnly:Boolean}),al=Y({name:"Tree",props:il,slots:Object,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:a,mergedRtlRef:n}=pt(e),l=vt("Tree",n,t),r=Me("Tree","-tree",ol,Or,e,t),h=ie(null),d=ie(null),f=ie(null);function v(){var o;return(o=f.value)===null||o===void 0?void 0:o.listElRef}function c(){var o;return(o=f.value)===null||o===void 0?void 0:o.itemsElRef}const b=F(()=>{const{filter:o}=e;if(o)return o;const{labelField:k}=e;return(D,L)=>{if(!D.length)return!0;const K=L[k];return typeof K=="string"?K.toLowerCase().includes(D.toLowerCase()):!1}}),$=F(()=>{const{pattern:o}=e;return o?!o.length||!b.value?{filteredTree:e.data,highlightKeySet:null,expandedKeys:void 0}:tl(e.data,b.value,o,e.keyField,e.childrenField):{filteredTree:e.data,highlightKeySet:null,expandedKeys:void 0}}),P=F(()=>mn(e.showIrrelevantNodes?e.data:$.value.filteredTree,wn(e.keyField,e.childrenField,e.disabledField,e.getChildren))),s=Ue(Un,null),m=e.internalTreeSelect?s.dataTreeMate:F(()=>e.showIrrelevantNodes?P.value:mn(e.data,wn(e.keyField,e.childrenField,e.disabledField,e.getChildren))),{watchProps:y}=e,S=ie([]);y!=null&&y.includes("defaultCheckedKeys")?Ne(()=>{S.value=e.defaultCheckedKeys}):S.value=e.defaultCheckedKeys;const N=G(e,"checkedKeys"),_=ut(N,S),p=F(()=>m.value.getCheckedKeys(_.value,{cascade:e.cascade,allowNotLoaded:e.allowCheckingNotLoaded})),u=Zr(e),x=F(()=>p.value.checkedKeys),R=F(()=>{const{indeterminateKeys:o}=e;return o!==void 0?o:p.value.indeterminateKeys}),g=ie([]);y!=null&&y.includes("defaultSelectedKeys")?Ne(()=>{g.value=e.defaultSelectedKeys}):g.value=e.defaultSelectedKeys;const B=G(e,"selectedKeys"),A=ut(B,g),M=ie([]),we=o=>{M.value=e.defaultExpandAll?m.value.getNonLeafKeys():o===void 0?e.defaultExpandedKeys:o};y!=null&&y.includes("defaultExpandedKeys")?Ne(()=>{we(void 0)}):Ne(()=>{we(e.defaultExpandedKeys)});const ne=G(e,"expandedKeys"),j=ut(ne,M),he=F(()=>P.value.getFlattenedNodes(j.value)),{pendingNodeKeyRef:be,handleKeydown:ge}=Yr({props:e,mergedCheckedKeysRef:_,mergedSelectedKeysRef:A,fNodesRef:he,mergedExpandedKeysRef:j,handleCheck:Tt,handleSelect:Et,handleSwitcherClick:tn});let ye=null,$e=null;const q=ie(new Set),it=F(()=>e.internalHighlightKeySet||$.value.highlightKeySet),pe=ut(it,q),E=ie(new Set),W=F(()=>j.value.filter(o=>!E.value.has(o)));let oe=0;const se=ie(null),ve=ie(null),mt=ie(null),bt=ie(null),yt=ie(0),Gn=F(()=>{const{value:o}=ve;return o?o.parent:null});let $t=!1;Ae(G(e,"data"),()=>{$t=!0,et(()=>{$t=!1}),E.value.clear(),be.value=null,st()},{deep:!1});let Pt=!1;const Dt=()=>{Pt=!0,et(()=>{Pt=!1})};let at;Ae(G(e,"pattern"),(o,k)=>{if(e.showIrrelevantNodes)if(at=void 0,o){const{expandedKeys:D,highlightKeySet:L}=el(e.data,e.pattern,e.keyField,e.childrenField,b.value);q.value=L,Dt(),We(D,xe(D),{node:null,action:"filter"})}else q.value=new Set;else if(!o.length)at!==void 0&&(Dt(),We(at,xe(at),{node:null,action:"filter"}));else{k.length||(at=j.value);const{expandedKeys:D}=$.value;D!==void 0&&(Dt(),We(D,xe(D),{node:null,action:"filter"}))}});function Zt(o){return rl(this,void 0,void 0,function*(){const{onLoad:k}=e;if(!k){yield Promise.resolve();return}const{value:D}=E;if(!D.has(o.key)){D.add(o.key);try{(yield k(o.rawNode))===!1&&Ve()}catch(L){console.error(L),Ve()}D.delete(o.key)}})}Ne(()=>{var o;const{value:k}=P;if(!k)return;const{getNode:D}=k;(o=j.value)===null||o===void 0||o.forEach(L=>{const K=D(L);K&&!K.shallowLoaded&&Zt(K)})});const qe=ie(!1),Le=ie([]);Ae(W,(o,k)=>{if(!e.animated||Pt){et(xt);return}if($t)return;const D=dt(r.value.self.nodeHeight),L=new Set(k);let K=null,re=null;for(const X of o)if(!L.has(X)){if(K!==null)return;K=X}const me=new Set(o);for(const X of k)if(!me.has(X)){if(re!==null)return;re=X}if(K===null&&re===null)return;const{virtualScroll:ke}=e,Ye=(ke?f.value.listElRef:h.value).offsetHeight,Qe=Math.ceil(Ye/D)+1;let Ce;if(K!==null&&(Ce=k),re!==null&&(Ce===void 0?Ce=o:Ce=Ce.filter(X=>X!==re)),qe.value=!0,Le.value=P.value.getFlattenedNodes(Ce),K!==null){const X=Le.value.findIndex(Se=>Se.key===K);if(~X){const Se=Le.value[X].children;if(Se){const _e=bn(Se,o);Le.value.splice(X+1,0,{__motion:!0,mode:"expand",height:ke?_e.length*D:void 0,nodes:ke?_e.slice(0,Qe):_e})}}}if(re!==null){const X=Le.value.findIndex(Se=>Se.key===re);if(~X){const Se=Le.value[X].children;if(!Se)return;qe.value=!0;const _e=bn(Se,o);Le.value.splice(X+1,0,{__motion:!0,mode:"collapse",height:ke?_e.length*D:void 0,nodes:ke?_e.slice(0,Qe):_e})}}});const Yn=F(()=>gr(he.value)),Qn=F(()=>qe.value?Le.value:he.value);function xt(){const{value:o}=d;o&&o.sync()}function Xn(){qe.value=!1,e.virtualScroll&&et(xt)}function xe(o){const{getNode:k}=m.value;return o.map(D=>{var L;return((L=k(D))===null||L===void 0?void 0:L.rawNode)||null})}function We(o,k,D){const{"onUpdate:expandedKeys":L,onUpdateExpandedKeys:K}=e;M.value=o,L&&ce(L,o,k,D),K&&ce(K,o,k,D)}function en(o,k,D){const{"onUpdate:checkedKeys":L,onUpdateCheckedKeys:K}=e;S.value=o,K&&ce(K,o,k,D),L&&ce(L,o,k,D)}function Jn(o,k){const{"onUpdate:indeterminateKeys":D,onUpdateIndeterminateKeys:L}=e;D&&ce(D,o,k),L&&ce(L,o,k)}function It(o,k,D){const{"onUpdate:selectedKeys":L,onUpdateSelectedKeys:K}=e;g.value=o,K&&ce(K,o,k,D),L&&ce(L,o,k,D)}function Zn(o){const{onDragenter:k}=e;k&&ce(k,o)}function eo(o){const{onDragleave:k}=e;k&&ce(k,o)}function to(o){const{onDragend:k}=e;k&&ce(k,o)}function no(o){const{onDragstart:k}=e;k&&ce(k,o)}function oo(o){const{onDragover:k}=e;k&&ce(k,o)}function ro(o){const{onDrop:k}=e;k&&ce(k,o)}function st(){lo(),ze()}function lo(){se.value=null}function ze(){yt.value=0,ve.value=null,mt.value=null,bt.value=null,Ve()}function Ve(){ye&&(window.clearTimeout(ye),ye=null),$e=null}function Tt(o,k){if(e.disabled||Ke(o,e.disabledField))return;if(e.internalUnifySelectCheck&&!e.multiple){Et(o);return}const D=k?"check":"uncheck",{checkedKeys:L,indeterminateKeys:K}=m.value[D](o.key,x.value,{cascade:e.cascade,checkStrategy:u.value,allowNotLoaded:e.allowCheckingNotLoaded});en(L,xe(L),{node:o.rawNode,action:D}),Jn(K,xe(K))}function io(o){if(e.disabled)return;const{key:k}=o,{value:D}=j,L=D.findIndex(K=>K===k);if(~L){const K=Array.from(D);K.splice(L,1),We(K,xe(K),{node:o.rawNode,action:"collapse"})}else{const K=P.value.getNode(k);if(!K||K.isLeaf)return;let re;if(e.accordion){const me=new Set(o.siblings.map(({key:ke})=>ke));re=D.filter(ke=>!me.has(ke)),re.push(k)}else re=D.concat(k);We(re,xe(re),{node:o.rawNode,action:"expand"})}}function tn(o){e.disabled||qe.value||io(o)}function Et(o){if(!(e.disabled||!e.selectable)){if(be.value=o.key,e.internalUnifySelectCheck){const{value:{checkedKeys:k,indeterminateKeys:D}}=p;e.multiple?Tt(o,!(k.includes(o.key)||D.includes(o.key))):en([o.key],xe([o.key]),{node:o.rawNode,action:"check"})}if(e.multiple){const k=Array.from(A.value),D=k.findIndex(L=>L===o.key);~D?e.cancelable&&k.splice(D,1):~D||k.push(o.key),It(k,xe(k),{node:o.rawNode,action:~D?"unselect":"select"})}else A.value.includes(o.key)?e.cancelable&&It([],[],{node:o.rawNode,action:"unselect"}):It([o.key],xe([o.key]),{node:o.rawNode,action:"select"})}}function ao(o){if(ye&&(window.clearTimeout(ye),ye=null),o.isLeaf)return;$e=o.key;const k=()=>{if($e!==o.key)return;const{value:D}=mt;if(D&&D.key===o.key&&!j.value.includes(o.key)){const L=j.value.concat(o.key);We(L,xe(L),{node:o.rawNode,action:"expand"})}ye=null,$e=null};o.shallowLoaded?ye=window.setTimeout(()=>{k()},1e3):ye=window.setTimeout(()=>{Zt(o).then(()=>{k()})},1e3)}function so({event:o,node:k}){!e.draggable||e.disabled||Ke(k,e.disabledField)||(nn({event:o,node:k},!1),Zn({event:o,node:k.rawNode}))}function co({event:o,node:k}){!e.draggable||e.disabled||Ke(k,e.disabledField)||eo({event:o,node:k.rawNode})}function uo(o){o.target===o.currentTarget&&ze()}function fo({event:o,node:k}){st(),!(!e.draggable||e.disabled||Ke(k,e.disabledField))&&to({event:o,node:k.rawNode})}function ho({event:o,node:k}){!e.draggable||e.disabled||Ke(k,e.disabledField)||(oe=o.clientX,se.value=k,no({event:o,node:k.rawNode}))}function nn({event:o,node:k},D=!0){var L;if(!e.draggable||e.disabled||Ke(k,e.disabledField))return;const{value:K}=se;if(!K)return;const{allowDrop:re,indent:me}=e;D&&oo({event:o,node:k.rawNode});const ke=o.currentTarget,{height:Ye,top:Qe}=ke.getBoundingClientRect(),Ce=o.clientY-Qe;let X;re({node:k.rawNode,dropPosition:"inside",phase:"drag"})?Ce<=8?X="before":Ce>=Ye-8?X="after":X="inside":Ce<=Ye/2?X="before":X="after";const{value:_e}=Yn;let Q,ue;const Xe=_e(k.key);if(Xe===null){ze();return}let kt=!1;X==="inside"?(Q=k,ue="inside"):X==="before"?k.isFirstChild?(Q=k,ue="before"):(Q=he.value[Xe-1],ue="after"):(Q=k,ue="after"),!Q.isLeaf&&j.value.includes(Q.key)&&(kt=!0,ue==="after"&&(Q=he.value[Xe+1],Q?ue="before":(Q=k,ue="inside")));const rn=Q;if(mt.value=rn,!kt&&K.isLastChild&&K.key===Q.key&&(ue="after"),ue==="after"){let ln=oe-o.clientX,Lt=0;for(;ln>=me/2&&Q.parent!==null&&Q.isLastChild&&Lt<1;)ln-=me,Lt+=1,Q=Q.parent;yt.value=Lt}else yt.value=0;if((K.contains(Q)||ue==="inside"&&((L=K.parent)===null||L===void 0?void 0:L.key)===Q.key)&&!(K.key===rn.key&&K.key===Q.key)){ze();return}if(!re({node:Q.rawNode,dropPosition:ue,phase:"drag"})){ze();return}if(K.key===Q.key)Ve();else if($e!==Q.key)if(ue==="inside"){if(e.expandOnDragenter){if(ao(Q),!Q.shallowLoaded&&$e!==Q.key){st();return}}else if(!Q.shallowLoaded){st();return}}else Ve();else ue!=="inside"&&Ve();bt.value=ue,ve.value=Q}function po({event:o,node:k,dropPosition:D}){if(!e.draggable||e.disabled||Ke(k,e.disabledField))return;const{value:L}=se,{value:K}=ve,{value:re}=bt;if(!(!L||!K||!re)&&e.allowDrop({node:K.rawNode,dropPosition:re,phase:"drag"})&&L.key!==K.key){if(re==="before"){const me=L.getNext({includeDisabled:!0});if(me&&me.key===K.key){ze();return}}if(re==="after"){const me=L.getPrev({includeDisabled:!0});if(me&&me.key===K.key){ze();return}}ro({event:o,node:K.rawNode,dragNode:L.rawNode,dropPosition:D}),st()}}function vo(){xt()}function go(){xt()}function mo(o){var k;if(e.virtualScroll||e.internalScrollable){const{value:D}=d;if(!((k=D==null?void 0:D.containerRef)===null||k===void 0)&&k.contains(o.relatedTarget))return;be.value=null}else{const{value:D}=h;if(D!=null&&D.contains(o.relatedTarget))return;be.value=null}}Ae(be,o=>{var k,D;if(o!==null){if(e.virtualScroll)(k=f.value)===null||k===void 0||k.scrollTo({key:o});else if(e.internalScrollable){const{value:L}=d;if(L===null)return;const K=(D=L.contentRef)===null||D===void 0?void 0:D.querySelector(`[data-key="${Bn(o)}"]`);if(!K)return;L.scrollTo({el:K})}}}),jt(gt,{loadingKeysRef:E,highlightKeySetRef:pe,displayedCheckedKeysRef:x,displayedIndeterminateKeysRef:R,mergedSelectedKeysRef:A,mergedExpandedKeysRef:j,mergedThemeRef:r,mergedCheckStrategyRef:u,nodePropsRef:G(e,"nodeProps"),disabledRef:G(e,"disabled"),checkableRef:G(e,"checkable"),selectableRef:G(e,"selectable"),expandOnClickRef:G(e,"expandOnClick"),onLoadRef:G(e,"onLoad"),draggableRef:G(e,"draggable"),blockLineRef:G(e,"blockLine"),indentRef:G(e,"indent"),cascadeRef:G(e,"cascade"),checkOnClickRef:G(e,"checkOnClick"),checkboxPlacementRef:e.checkboxPlacement,droppingMouseNodeRef:mt,droppingNodeParentRef:Gn,draggingNodeRef:se,droppingPositionRef:bt,droppingOffsetLevelRef:yt,fNodesRef:he,pendingNodeKeyRef:be,showLineRef:G(e,"showLine"),disabledFieldRef:G(e,"disabledField"),internalScrollableRef:G(e,"internalScrollable"),internalCheckboxFocusableRef:G(e,"internalCheckboxFocusable"),internalTreeSelect:e.internalTreeSelect,renderLabelRef:G(e,"renderLabel"),renderPrefixRef:G(e,"renderPrefix"),renderSuffixRef:G(e,"renderSuffix"),renderSwitcherIconRef:G(e,"renderSwitcherIcon"),labelFieldRef:G(e,"labelField"),multipleRef:G(e,"multiple"),overrideDefaultNodeClickBehaviorRef:G(e,"overrideDefaultNodeClickBehavior"),handleSwitcherClick:tn,handleDragEnd:fo,handleDragEnter:so,handleDragLeave:co,handleDragStart:ho,handleDrop:po,handleDragOver:nn,handleSelect:Et,handleCheck:Tt});function bo(o,k){var D,L;typeof o=="number"?(D=f.value)===null||D===void 0||D.scrollTo(o,k||0):(L=f.value)===null||L===void 0||L.scrollTo(o)}const yo={handleKeydown:ge,scrollTo:bo,getCheckedData:()=>{if(!e.checkable)return{keys:[],options:[]};const{checkedKeys:o}=p.value;return{keys:o,options:xe(o)}},getIndeterminateData:()=>{if(!e.checkable)return{keys:[],options:[]};const{indeterminateKeys:o}=p.value;return{keys:o,options:xe(o)}}},on=F(()=>{const{common:{cubicBezierEaseInOut:o},self:{fontSize:k,nodeBorderRadius:D,nodeColorHover:L,nodeColorPressed:K,nodeColorActive:re,arrowColor:me,loadingColor:ke,nodeTextColor:Ye,nodeTextColorDisabled:Qe,dropMarkColor:Ce,nodeWrapperPadding:X,nodeHeight:Se,lineHeight:_e,lineColor:Q}}=r.value,ue=At(X,"top"),Xe=At(X,"bottom"),kt=Dn(dt(Se)-dt(ue)-dt(Xe));return{"--n-arrow-color":me,"--n-loading-color":ke,"--n-bezier":o,"--n-font-size":k,"--n-node-border-radius":D,"--n-node-color-active":re,"--n-node-color-hover":L,"--n-node-color-pressed":K,"--n-node-text-color":Ye,"--n-node-text-color-disabled":Qe,"--n-drop-mark-color":Ce,"--n-node-wrapper-padding":X,"--n-line-offset-top":`-${ue}`,"--n-line-offset-bottom":`-${Xe}`,"--n-node-content-height":kt,"--n-line-height":_e,"--n-line-color":Q}}),Ge=a?Wt("tree",void 0,on,e):void 0;return Object.assign(Object.assign({},yo),{mergedClsPrefix:t,mergedTheme:r,rtlEnabled:l,fNodes:Qn,aip:qe,selfElRef:h,virtualListInstRef:f,scrollbarInstRef:d,handleFocusout:mo,handleDragLeaveTree:uo,handleScroll:vo,getScrollContainer:v,getScrollContent:c,handleAfterEnter:Xn,handleResize:go,cssVars:a?void 0:on,themeClass:Ge==null?void 0:Ge.themeClass,onRender:Ge==null?void 0:Ge.onRender})},render(){var e;const{fNodes:t,internalRenderEmpty:a}=this;if(!t.length&&a)return a();const{mergedClsPrefix:n,blockNode:l,blockLine:r,draggable:h,disabled:d,internalFocusable:f,checkable:v,handleKeydown:c,rtlEnabled:b,handleFocusout:$,scrollbarProps:P}=this,s=f&&!d,m=s?"0":void 0,y=[`${n}-tree`,b&&`${n}-tree--rtl`,v&&`${n}-tree--checkable`,(r||l)&&`${n}-tree--block-node`,r&&`${n}-tree--block-line`],S=_=>"__motion"in _?T(nl,{height:_.height,nodes:_.nodes,clsPrefix:n,mode:_.mode,onAfterEnter:this.handleAfterEnter}):T(jn,{key:_.key,tmNode:_,clsPrefix:n});if(this.virtualScroll){const{mergedTheme:_,internalScrollablePadding:p}=this,u=At(p||"0");return T(sn,Object.assign({},P,{ref:"scrollbarInstRef",onDragleave:h?this.handleDragLeaveTree:void 0,container:this.getScrollContainer,content:this.getScrollContent,class:y,theme:_.peers.Scrollbar,themeOverrides:_.peerOverrides.Scrollbar,tabindex:m,onKeydown:s?c:void 0,onFocusout:s?$:void 0}),{default:()=>{var x;return(x=this.onRender)===null||x===void 0||x.call(this),t.length?T(vr,{ref:"virtualListInstRef",items:this.fNodes,itemSize:dt(_.self.nodeHeight),ignoreItemResize:this.aip,paddingTop:u.top,paddingBottom:u.bottom,class:this.themeClass,style:[this.cssVars,{paddingLeft:u.left,paddingRight:u.right}],onScroll:this.handleScroll,onResize:this.handleResize,showScrollbar:!1,itemResizable:!0},{default:({item:R})=>S(R)}):dn(this.$slots.empty,()=>[T(yn,{class:`${n}-tree__empty`,theme:this.mergedTheme.peers.Empty,themeOverrides:this.mergedTheme.peerOverrides.Empty})])}})}const{internalScrollable:N}=this;return y.push(this.themeClass),(e=this.onRender)===null||e===void 0||e.call(this),N?T(sn,Object.assign({},P,{class:y,tabindex:m,onKeydown:s?c:void 0,onFocusout:s?$:void 0,style:this.cssVars,contentStyle:{padding:this.internalScrollablePadding}}),{default:()=>T("div",{onDragleave:h?this.handleDragLeaveTree:void 0,ref:"selfElRef"},this.fNodes.map(S))}):T("div",{class:y,tabindex:m,ref:"selfElRef",style:this.cssVars,onKeydown:s?c:void 0,onFocusout:s?$:void 0,onDragleave:h?this.handleDragLeaveTree:void 0},t.length?t.map(S):dn(this.$slots.empty,()=>[T(yn,{class:`${n}-tree__empty`,theme:this.mergedTheme.peers.Empty,themeOverrides:this.mergedTheme.peerOverrides.Empty})]))}}),sl={class:"TrackCard",flex:"","flex-col":"","h-full":"","p-12px":"","box-border":"","gap-8px":"","overflow-hidden":""},dl={flex:"","justify-between":"","items-center":""},cl={flex:"","items-center":"","gap-4px":""},ul={"flex-1":"",flex:"","gap-12px":"","overflow-hidden":""},fl={"self-stretch":"",flex:"[2]"},hl={"mb-24px":"","break-all":"","px-4px":"","py-2px":"","leading-20px":"",bg:"#eee",gkd_code:""},pl={flex:"","flex-col":"","gap-12px":""},vl={key:0,flex:"","gap-8px":""},gl=["onClick"],qn=()=>Oo(()=>import("./TrackGraph-BjAZact3.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),ml=Bo({loader:qn,delay:0});setTimeout(qn,3e3);const bl=Y({__name:"TrackCard",props:{nodes:{},queryResult:{},selector:{},onClose:{type:Function,default:rt}},setup(e){const t=e,a=F(()=>t.queryResult?t.queryResult.unitResults.asJsReadonlyArrayView().concat():[]),n=F(()=>a.value.filter(f=>!f.context.prev)),l=F(()=>a.value.filter(f=>f.context.prev)),r=J([]);Ne(()=>{r.value=l.value});const h=f=>{r.value.includes(f)?r.value=r.value.filter(v=>v!==f):r.value=r.value.concat(f)},d=f=>{const v=f.value;return v instanceof hn&&a.value.some(c=>c.expression===v)&&!f.outChildren.some(c=>c.value instanceof hn)?{outline:"1px solid #00F"}:""};return(f,v)=>{const c=Oe("SvgIcon"),b=lt,$=Xt;return z(),te("div",sl,[I("div",dl,[I("div",cl,[C(c,{name:"path",h:"24px"}),v[0]||(v[0]=I("div",{text:"20px/28px","font-bold":""},"选择器路径视图",-1))]),C(b,{text:"",onClick:f.onClose},{default:w(()=>[C(c,{name:"close",h:"20px"})]),_:1},8,["onClick"])]),I("div",ul,[I("div",fl,[f.nodes.length&&f.queryResult?(z(),ae(i(ml),{key:0,nodes:f.nodes,queryResult:f.queryResult,showUnitResults:i(l),filterUnitResults:i(r),class:"h-[calc(100%-2px)] b-1px b-solid"},null,8,["nodes","queryResult","showUnitResults","filterUnitResults"])):de("",!0),v[1]||(v[1]=I("div",{relative:"","pointer-events-none":"","z-1":""},[I("div",{absolute:"","left-8px":"","bottom-8px":"",text:"12px/14px #6C6E71"}," *为简化视图已隐藏无关节点 ")],-1))]),C($,{class:"self-stretch flex-1"},{default:w(()=>[I("div",hl,[C(Ct,{class:"gkd_code",source:f.selector.source,node:f.selector.ast,getNodeStyle:d},null,8,["source","node"])]),I("div",pl,[i(n).length?(z(),te("div",vl,[(z(!0),te(Re,null,Be(i(n),(P,s)=>(z(),te("div",{key:s,"break-all":"","px-4px":"","py-2px":"",gkd_code:"","b-1px":"","b-solid":"",b:"#ccc"},[C(Ct,{class:"gkd_code",source:f.selector.source,node:f.selector.findAst(P.expression)},null,8,["source","node"])]))),128))])):de("",!0),(z(!0),te(Re,null,Be(i(l),(P,s)=>(z(),te("div",{key:s,"cursor-pointer":"","break-all":"","px-4px":"","py-2px":"",gkd_code:"","b-1px":"","b-solid":"","transition-colors":"",onClick:m=>h(P),style:Te({borderColor:i(wt)[s%i(wt).length],backgroundColor:i(r).includes(P)?"#eee":void 0})},[I("div",{"inline-block":"","align-middle":"","size-16px":"",style:Te({backgroundColor:i(wt)[s%i(wt).length]})},null,4),v[2]||(v[2]=I("span",{"pl-4px":""},null,-1)),C(Ct,{class:"gkd_code",source:f.selector.source,node:f.selector.findAst(P.expression)},null,8,["source","node"])],12,gl))),128))])]),_:1})])])}}}),yl=Y({__name:"TrackModal",props:{data:{},show:{type:Boolean},onUpdateShow:{type:Function,default:rt},onUpdateData:{type:Function,default:rt}},setup(e){const t=e,a=ie(!1),n=ie(0);return Ht(()=>t.show,async()=>{t.show?(a.value=!0,n.value=-1,await new Promise(l=>setTimeout(l,300)),n.value=0):(n.value=1,await new Promise(l=>setTimeout(l,300)),a.value=!1,n.value=0,t.onUpdateData())}),Mo("keyup",l=>{l.key==="Escape"&&t.onUpdateShow(!1)}),(l,r)=>i(a)?(z(),te("div",{key:0,class:ft(["TrackModal",{"track-model-enter":i(n)===-1,"track-model-exit":i(n)===1}]),absolute:"","left-0":"","top-0":"","bg-white":"","z-3000":"",w:"[--gkd-w]",h:"[--gkd-h]"},[l.data?(z(),ae(bl,Uo({key:0},l.data,{onClose:r[0]||(r[0]=h=>l.onUpdateShow(!1))}),null,16)):de("",!0)],2)):de("",!0)}}),xl=nr(yl,[["__scopeId","data-v-66dad45d"]]),Cn=e=>{const t=J(),a={x:0,y:0},n=Gt({...a});let l;const r=c=>{l&&c.preventDefault()},h=c=>{l=c,a.x=n.x,a.y=n.y},d=c=>{if(!l||!t.value)return;const b=c.clientX-l.clientX,$=c.clientY-l.clientY;e(b)&&(n.x=a.x+b),n.y=a.y+$},f=()=>{l=void 0},v=()=>{if(!t.value||!l)return;f();const{top:c,bottom:b,left:$,right:P}=t.value.getBoundingClientRect();(P<0||$>window.innerWidth||b<0||c>window.innerHeight)&&(n.x=a.x,n.y=a.y)};return Nt(()=>{window.addEventListener("pointermove",d),window.addEventListener("pointerup",v),document.addEventListener("selectstart",r)}),_t(()=>{window.removeEventListener("pointermove",d),window.removeEventListener("pointerup",v),document.removeEventListener("selectstart",r),f()}),Ae(t,(c,b)=>{c&&(c.addEventListener("pointerdown",h),c.addEventListener("pointerup",f)),b&&(b.removeEventListener("pointerdown",h),b.removeEventListener("pointerup",f))}),_t(()=>{t.value&&(t.value.removeEventListener("pointerdown",h),t.value.removeEventListener("pointerup",f))}),{target:t,offset:n}};let ct=1e3;const kl=()=>{ct++;const e=J(ct);return{zIndex:e,setTop:()=>{e.value!==ct&&(ct++,e.value=ct)}}},Sn="transition-top,bottom,left,right-500",Rt=Y({__name:"DraggableCard",props:{initialValue:{default:()=>({})},minWidth:{},sizeDraggable:{type:Boolean},show:{type:Boolean,default:!0},class:{}},setup(e){var u,x;const t=e,a=t.initialValue.left!==void 0,n=t.initialValue.top!==void 0,l={x:(u=a?t.initialValue.left:t.initialValue.right)!=null?u:0,y:(x=n?t.initialValue.top:t.initialValue.bottom)!=null?x:0},r=Cn(R=>{const g=(t.initialValue.width||0)+h.offset.x+-r.offset.x-R;return(t.minWidth||0)<g}),h=Cn(R=>{const g=(t.initialValue.width||0)+h.offset.x+R-r.offset.x;return(t.minWidth||0)<g}),d=Gt({...l}),f=F(()=>{const R=(t.initialValue.width||0)+h.offset.x-r.offset.x,g=t.initialValue.width?`width:${R}px;`:"",B=n?`top:${d.y}px;`:`bottom:${d.y}px;`;return a?`left:${d.x-r.offset.x}px;`+B+g:`right:${d.x-h.offset.x}px;`+B+g});let v;const c=J(!1),b=R=>{v=R,l.x=d.x,l.y=d.y,c.value=!1},$=R=>{if(!m.value||!v)return;const g=R.clientX-v.clientX,B=R.clientY-v.clientY;d.x=l.x+(a?g:-g),d.y=l.y+(n?B:-B),c.value=!0},P=()=>{v=void 0},s=J(),m=J(),y=R=>{v&&R.preventDefault()},S=()=>{if(!m.value||!v)return;P();const{top:R,bottom:g,left:B,right:A}=m.value.getBoundingClientRect();if(A<0||B>window.innerWidth||g<0||R>window.innerHeight){d.x=l.x,d.y=l.y;const M=s.value;M&&(M.classList.add(Sn),setTimeout(()=>{M.classList.remove(Sn)},550))}};Nt(()=>{window.addEventListener("pointermove",$),window.addEventListener("pointerup",S),document.addEventListener("selectstart",y)}),_t(()=>{window.removeEventListener("pointermove",$),window.removeEventListener("pointerup",S),document.removeEventListener("selectstart",y),P()}),Ae(m,(R,g)=>{R&&(R.addEventListener("pointerdown",b),R.addEventListener("pointerup",P)),g&&(g.removeEventListener("pointerdown",b),g.removeEventListener("pointerup",P))}),_t(()=>{m.value&&(m.value.removeEventListener("pointerdown",b),m.value.removeEventListener("pointerup",P))});const N=R=>{R instanceof HTMLElement?m.value=R:m.value=void 0},{setTop:_,zIndex:p}=kl();return Ae(()=>t.show,()=>{t.show&&_()}),(R,g)=>(z(),ae(In,{to:"body"},[R.show?(z(),te("div",{key:0,fixed:"",ref_key:"box",ref:s,class:ft(["DraggableCard",t.class]),style:Te([i(f),{zIndex:i(p)}]),onMousedown:g[0]||(g[0]=(...B)=>i(_)&&i(_)(...B))},[Ho(R.$slots,"default",{onRef:N,moved:i(c)}),R.sizeDraggable?(z(),te(Re,{key:0},[I("div",{ref:i(r).target,absolute:"","right-full":"","top-0":"","bottom-0":"","w-5px":"","cursor-ew-resize":""},null,512),I("div",{ref:i(h).target,absolute:"","left-full":"","top-0":"","bottom-0":"","w-5px":"","cursor-ew-resize":""},null,512)],64)):de("",!0)],38)):de("",!0)]))}}),wl=async e=>fetch("https://detect.gkd.li/api/getImportId?id="+e).then(t=>t.json()).catch(()=>0),je=jo("snapshot",()=>{const e=Tn(),t=En(),a=qo(),n=Ln(),{snapshotImportId:l,snapshotImageId:r,importSnapshotId:h}=n,d=J();Ht(()=>e.params.snapshotId,ne=>{d.value=Wo(ne)});const f=F(()=>{if(d.value)return l[d.value]}),v=F(()=>{if(d.value)return r[d.value]}),c=J();Ne(()=>{c.value&&(document.title="快照-"+(Pe(c.value).name||c.value.appId))});const b=J(),$=F(()=>{if(b.value)return URL.createObjectURL(new Blob([b.value],{type:"image/png"}))}),P=J(!1),s=mr(async ne=>{if(P.value=!1,!ne){c.value=void 0,b.value=void 0;return}if(await Promise.all([cr.getItem(ne).then(j=>{c.value=j||void 0}),ur.getItem(ne).then(j=>{b.value=j||void 0})]),!c.value){const j=l[ne]||await wl(ne);if(j&&Number.isSafeInteger(j)){P.value=!0,t.replace({path:"/i/"+j,query:e.query});return}}}),m=F(()=>s.loading);Ht(()=>d.value,s.invoke),Ne(()=>{f.value&&n.inited&&!h[f.value]&&d.value&&(h[f.value]=d.value,fetch("https://detect.gkd.li/api/detectSnapshot?importId="+f.value))});const y=F(()=>fr()&&a.inited&&a.autoUploadImport&&n.inited);Ne(()=>{y.value&&c.value&&!v.value&&ir(c.value),y.value&&c.value&&!f.value&&ar(c.value),y.value&&c.value&&f.value&&sr(c.value.id,f.value)});const S=F(()=>c.value&&a.inited?c.value.nodes.length<=a.maxShowNodeSize?structuredClone(c.value.nodes):structuredClone(c.value.nodes.slice(0,a.maxShowNodeSize)):[]),N=F(()=>{if(S.value.length)return or(S.value)}),_=F(()=>c.value?c.value.nodes.length-a.maxShowNodeSize:0),p=J(),u=J(0),x=J(),R=J(),g=async ne=>{p.value=ne,u.value=Date.now(),await et(),R.value&&!R.value.includes(ne)&&(x.value=void 0,R.value=void 0)};Ne(()=>{N.value&&g(N.value)});const B=ne=>{x.value=ne;const j=rr(S.value,x.value);j.length&&g(j[0]),j.length>1&&(R.value=j)},A=ie(!1),M=J();return{snapshotId:d,snapshot:c,rootNode:N,screenshotUrl:$,loading:m,redirected:P,importId:f,imageId:v,focusNode:p,updateFocusNode:g,focusTime:u,overlapNodes:R,missNodeSize:_,focusPosition:x,updatePosition:B,trackData:M,trackShow:A,showTrack:(ne,j)=>{A.value=!0,M.value={selector:ne,nodes:S.value,queryResult:j}}}}),Cl={absolute:"","top-0":"","right-0":"","pt-4px":"","pr-8px":""},Sl={key:0,flex:"","justify-between":"","items-center":""},_l={flex:"","items-center":"","h-24px":"","px-2px":""},Nl={"max-w-500px":""},Rl=Y({__name:"AttrCard",props:{show:{type:Boolean},onUpdateShow:{type:Function,default:rt}},setup(e){const{focusNode:t}=He(je()),a=F(()=>{const h=t.value;return h?{_id:{desc:"虚拟属性(真机不可用):生成快照访问节点顺序",type:"info",show:!0},_pid:{desc:"虚拟属性(真机不可用):父节点的 _id",type:"info",show:!0},_selector:{desc:"自动生成的选择器, 点击“_selector”可直接复制内容, 用于定位",type:"info",show:!0},depth:{desc:"使用此属性在某些应用上可能造成无限节点错误",type:"info",show:!0},id:{desc:"可快速查找",type:"quickFind",show:!!((h.quickFind||h.idQf)&&h.attr.id)},vid:{desc:"可快速查找",type:"quickFind",show:!!((h.quickFind||h.idQf)&&h.attr.vid)},text:{desc:"可快速查找",type:"quickFind",show:!!((h.quickFind||h.textQf)&&h.attr.text)}}:{}}),n=["text","desc"],l=F(()=>t.value?Object.entries(t.value.attr).map(([h,d])=>{var v,c,b;const f={name:h,value:d,desc:JSON.stringify(d),tip:(v=a.value[h])!=null&&v.show?a.value[h]:void 0};return n.includes(h)?[f,{name:h+".length",value:(c=d==null?void 0:d.length)!=null?c:null,desc:JSON.stringify((b=d==null?void 0:d.length)!=null?b:null),tip:void 0}]:f}).flat():[]),r=F(()=>t.value?lr(t.value):"");return(h,d)=>{const f=Oe("SvgIcon"),v=lt,c=Qt,b=Yt,$=Wr,P=br,s=Vr,m=qr,y=jr;return z(),ae(Rt,{initialValue:{top:40,right:10},class:"box-shadow-dim",show:h.show&&!!i(t)},{default:w(({onRef:S})=>[I("div",Cl,[C(v,{onClick:d[0]||(d[0]=N=>h.onUpdateShow(!h.show)),text:"",title:"最小化"},{icon:w(()=>[C(f,{name:"minus"})]),_:1})]),i(t)?(z(),ae(y,{key:0,size:"small",striped:"",singleLine:!1,class:"gkd_code",themeOverrides:{thPaddingSmall:"1px 3px",tdPaddingSmall:"0px 3px"}},{default:w(()=>[I("thead",null,[I("tr",{ref:S,"cursor-move":""},d[2]||(d[2]=[I("th",null,"Name",-1),I("th",null,"Value",-1)]),512)]),C(m,null,{default:w(()=>[(z(!0),te(Re,null,Be(i(l),N=>(z(),ae(s,{key:N.name},{default:w(()=>[C($,{onClick:_=>i(Ie)(`${N.name}=${N.desc}`)},{default:w(()=>[N.tip?(z(),te("div",Sl,[I("div",null,V(N.name),1),C(b,null,{trigger:w(()=>[C(c,{size:"16"},{default:w(()=>[N.tip.type=="info"?(z(),ae(f,{key:0,name:"info"})):N.tip.type=="quickFind"?(z(),ae(f,{key:1,name:"ok"})):de("",!0)]),_:2},1024)]),default:w(()=>[ee(" "+V(N.tip.desc),1)]),_:2},1024)])):(z(),te(Re,{key:1},[ee(V(N.name),1)],64))]),_:2},1032,["onClick"]),C($,null,{default:w(()=>[C(P,{class:ft(["w-[calc(var(--gkd-w)*0.12)]",{"text-left direction-rtl":N.name=="id","opacity-50":N.value===null}])},{default:w(()=>[ee(V(N.desc),1)]),_:2},1032,["class"])]),_:2},1024)]),_:2},1024))),128)),C(s,null,{default:w(()=>[C($,{colspan:"2"},{default:w(()=>[I("div",_l,[C(b,null,{trigger:w(()=>[C(v,{text:"",onClick:d[1]||(d[1]=N=>i(Ie)(i(r)))},{icon:w(()=>[C(c,{size:"20"},{default:w(()=>[C(f,{name:"path"})]),_:1})]),_:1})]),default:w(()=>[I("div",Nl,V(i(r)),1)]),_:1})])]),_:1})]),_:1})]),_:1})]),_:2},1024)):de("",!0)]),_:1},8,["show"])}}}),$l={bg:"#eee","px-2px":""},Pl=Y({__name:"OverlapCard",setup(e){const t=je(),{focusNode:a,overlapNodes:n,focusPosition:l}=He(t),h=document.documentElement.scrollWidth/100*25.5;return(d,f)=>{const v=lt,c=Kn,b=Vo;return z(),ae(Rt,{initialValue:{top:215,left:h},class:"box-shadow-dim w-420px",show:!!(i(n)&&i(l))},{default:w(({onRef:$})=>[i(n)&&i(l)?(z(),ae(b,{key:0,size:"small",closable:"",onClose:f[0]||(f[0]=P=>n.value=void 0)},{header:w(()=>[I("div",{ref:$,"cursor-move":""},[f[1]||(f[1]=ee(" 位置 ")),I("span",$l,V(`${i(l).x.toFixed(0)},${i(l).y.toFixed()}`),1),ee(" 存在 "+V(i(n).length)+" 个层叠节点 ",1)],512)]),default:w(()=>[C(c,{style:{"max-height":"400px","overflow-y":"scroll","padding-bottom":"10px"},class:"scrollbar-hidden"},{default:w(()=>[(z(!0),te(Re,null,Be(i(n),P=>(z(),ae(v,{key:P.id,onClick:s=>i(t).updateFocusNode(P),size:"small",style:Te(i(ht)(P,i(a)))},{default:w(()=>[ee(V(i(ot)(P)),1)]),_:2},1032,["onClick","style"]))),128))]),_:1})]),_:2},1024)):de("",!0)]),_:1},8,["initialValue","show"])}}}),Jt=Go(),Wn=F(()=>Jt.width.value/100),Vn=F(()=>Math.max(1200,Jt.width.value));F(()=>Math.max(700,Jt.height.value));const Dl={"bg-white":"","b-1px":"","b-solid":"","b-gray-200":"","rounded-4px":"","p-8px":""},Il={flex:"","m-b-4px":"","pr-4px":""},Tl={"min-h-24px":""},El={key:0,"color-red":"","whitespace-pre":""},Ll=Y({__name:"RuleCard",props:{show:{type:Boolean},onUpdateShow:{type:Function,default:rt}},setup(e){const t=je(),a=He(t),{rootNode:n,focusNode:l}=a,r=a.snapshot,h=J(""),d=Yo(h,500),f=s=>{if(s==null)return[];if(typeof s=="string")return[s];if(Array.isArray(s)&&s.every(m=>typeof m=="string"))return s},v=s=>{const m=f(s.matches);if(!m)return"非法格式: matches";const y=f(s.anyMatches);if(!y)return"非法格式: anyMatches";const S=f(s.excludeMatches);if(!S)return"非法格式: excludeMatches";const N=[];for(let g=0;g<m.length;g++){const B=m[g];try{N.push(St(B))}catch(A){const M=A instanceof Error?A.message:String(A);return`非法选择器: matches[${g}]
258
258
  错误: ${M}`}}const _=N.map(g=>g.querySelectorAll(n.value));if(N.length){const g=_.findIndex(B=>B.length===0);if(g>=0)return`无法匹配: matches[${g}] 查找结果为空`}const p=[];for(let g=0;g<y.length;g++){const B=y[g];try{p.push(St(B))}catch(A){const M=A instanceof Error?A.message:String(A);return`非法选择器: anyMatches[${g}]
259
259
  错误: ${M}`}}const u=p.map(g=>g.querySelectorAll(n.value));if(p.length&&u.every(g=>g.length===0))return"无法匹配: anyMatches 查找结果为空";if(!m.length&&!y.length)return"非法规则: matches 和 anyMatches 至少存在一个";const x=[];for(let g=0;g<S.length;g++){const B=S[g];try{x.push(St(B))}catch(A){const M=A instanceof Error?A.message:String(A);return`非法选择器: excludeMatches[${g}]
260
260
  错误: ${M}`}}const R=x.map(g=>g.querySelectorAll(n.value));if(x.length){const g=R.findIndex(B=>B.length!==0);if(g>=0)return`无法匹配: excludeMatches[${g}] 查找结果不为空`}return _.length?_.at(-1)[0]:u[0][0]},c=s=>typeof s=="object"&&s!==null&&!Array.isArray(s),b=F(()=>{if(!d.value)return"";const s=(()=>{try{return An.parse(d.value)}catch(m){return m}})();if(s instanceof Error)return`非法格式: ${s.message}`;if(!c(s))return"非法格式: 请使用对象格式";if(typeof s.id=="string"){if(s.id!==r.value.appId)return"非法格式: id 不匹配 appId";if(!Array.isArray(s.groups))return"非法格式: groups 不是数组";if(s.groups.length!==1)return"非法格式: groups 长度不为 1";const m=s.groups[0];if(!(m!=null&&m.rules))return"非法格式: groups[0].rules 非法";const y=Array.isArray(m.rules)?m.rules:[m.rules];if(y.length!==1)return"非法格式: groups[0].rules 长度不为 1";const S=typeof y[0]=="string"?{matches:y[0]}:y[0];return c(S)?v(S):"非法格式: rules[0] 非法"}if(s.rules){const m=Array.isArray(s.rules)?s.rules:[s.rules];if(m.length!==1)return"非法格式: rules 长度不为 1";const y=typeof m[0]=="string"?{matches:m[0]}:m[0];return c(y)?v(y):"非法格式: rules[0] 非法"}return v(s)}),$=F(()=>h.value&&d.value&&typeof b.value=="string"?b.value:""),P=F(()=>typeof b.value=="string"?null:b.value);return(s,m)=>{const y=Oe("SvgIcon"),S=lt,N=zn;return z(),ae(Rt,{initialValue:{top:40,right:Math.max(315,12*i(Wn)+135),width:Math.max(480,i(Vn)*.3)},minWidth:300,sizeDraggable:"",class:"box-shadow-dim",show:s.show},{default:w(({onRef:_})=>[I("div",Dl,[I("div",Il,[m[3]||(m[3]=I("div",null,"测试规则",-1)),I("div",{"flex-1":"","cursor-move":"",ref:_},null,512),C(S,{onClick:m[0]||(m[0]=p=>s.onUpdateShow(!s.show)),text:"",title:"最小化"},{icon:w(()=>[C(y,{name:"minus"})]),_:1})]),C(N,{value:i(h),"onUpdate:value":m[1]||(m[1]=p=>nt(h)?h.value=p:null),type:"textarea",placeholder:"请输入单个规则测试",size:"small",class:"gkd_code m-b-4px",autosize:{minRows:10,maxRows:20}},null,8,["value"]),I("div",Tl,[i($)?(z(),te("div",El,V(i($)),1)):i(P)?(z(),ae(S,{key:1,onClick:m[2]||(m[2]=p=>i(t).updateFocusNode(i(P))),size:"small",style:Te(i(ht)(i(P),i(l)))},{default:w(()=>[ee(V(i(ot)(i(P))),1)]),_:1},8,["style"])):de("",!0)])])]),_:1},8,["initialValue","show"])}}}),Kl=["src"],Fl={absolute:"","left-2px":"","top-2px":"","p-1px":"","z-1":"","text-13px":"",class:"leading-[1] bg-[rgba(256,256,256,0.7)]"},Al={key:0,absolute:"","left-2px":"","bottom-2px":"","p-1px":"","z-1":"","text-12px":"",class:"leading-[1] bg-[rgba(256,256,256,0.7)]",flex:"","flex-col":"","flex-items-center":""},zl={key:1,absolute:"","right-2px":"","bottom-2px":"","p-1px":"","z-1":"","text-12px":"",class:"leading-[1] bg-[rgba(256,256,256,0.7)]",flex:"","flex-col":"","flex-items-center":""},Bl=Y({__name:"MiniHoverImg",props:{imgRef:{},imgHover:{type:Boolean},screenshotUrl:{},hoverPosition:{},hoverPositionStyle:{},boxHoverPosition:{},boxHoverPerPosition:{}},setup(e){const t=e,a=Qo(F(()=>t.imgRef));return(n,l)=>(z(),ae(In,{to:"body"},[Rn(I("div",{style:Te({left:i(a).right.value+4+"px",top:i(a).top.value+"px"}),"pointer-events-none":"",fixed:"","overflow-hidden":"","z-2":"","bg-white":"","h-200px":"","w-200px":"","border-1px":"","border-indigo-600":"","border-dashed":""},[I("img",{src:n.screenshotUrl,"object-contain":"",absolute:"","left-0":"","top-0":"",style:Te(n.hoverPositionStyle),"w-1000px":""},null,12,Kl),I("div",Fl,V(`${n.hoverPosition.ox.toFixed(0)},${n.hoverPosition.oy.toFixed(0)}`),1),n.boxHoverPosition?(z(),te("div",Al,[I("div",null,V(n.boxHoverPosition.top.toFixed(0)),1),I("div",null,V(n.boxHoverPosition.left.toFixed(0)+","+n.boxHoverPosition.right.toFixed(0)),1),I("div",null,V(n.boxHoverPosition.bottom.toFixed(0)),1)])):de("",!0),n.boxHoverPerPosition?(z(),te("div",zl,[I("div",null,V(n.boxHoverPerPosition.top),1),I("div",null,V(n.boxHoverPerPosition.left+","+n.boxHoverPerPosition.right),1),I("div",null,V(n.boxHoverPerPosition.bottom),1)])):de("",!0),l[0]||(l[0]=I("div",{class:"top-[calc(50%-1px)] bg-[length:10px_1px]",absolute:"","left-0":"","right-0":"","h-1px":"","bg-repeat-x":"","mix-blend-difference":"",style:{"background-image":`linear-gradient(
@@ -269,5 +269,5 @@ import{h as Y,k as T,a as U,g as De,f as H,e as O,b as Z,u as pt,Z as xo,$ as vt
269
269
  transparent 50%,
270
270
  #fff 50%,
271
271
  #fff 100%
272
- )`,"background-position-y":"1.5px"}},null,-1))],4),[[$n,n.imgHover]])]))}}),Ol={key:0,flex:"","flex-col":"",relative:"","h-full":"","p-2px":"","box-border":"","overflow-hidden":""},Ml=["src"],Ul={"pointer-events-none":"",absolute:"","left-2px":"","top-2px":"",size:"[calc(100%-4px)]"},Hl={absolute:"","z-4":"","pointer-events-none":"","left-0":"","top-0":"","text-12px":"",leading:"100%",flex:"","gap-4px":""},jl={"p-1px":"",bg:"#ffffff70"},ql={"p-1px":"",bg:"#ffffff70"},Wl=Y({__name:"ScreenshotCard",setup(e){const t=je(),{updatePosition:a}=t,n=He(t),{focusNode:l,screenshotUrl:r}=n,h=F(()=>t.snapshot),d=J(),f=J(!1),v=_=>{const p=d.value;if(!p)return;const u=p.getBoundingClientRect(),x=u.width/p.naturalWidth*p.naturalHeight,R=(u.height-x)/2,g=(_.clientX-u.left)/u.width*p.naturalWidth,B=(_.clientY-u.top-R)/x*p.naturalHeight;a({x:g,y:B})},c=_=>`${_*100}%`,b=Xo(d),$=F(()=>{var g;const _=d.value,p=(g=l.value)==null?void 0:g.attr;if(!l.value||!_||!p||!f.value)return"";const u=b.width.value,x=b.height.value,R=u/_.naturalWidth*_.naturalHeight;return{left:`calc(${c(p.left/_.naturalWidth)} - 2px)`,width:`calc(${c((p.right-p.left)/_.naturalWidth)} + 2px)`,top:`calc(${c((p.top/_.naturalHeight*R+(x-R)/2)/x)} - 2px)`,height:`calc(${c((p.bottom-p.top)/_.naturalHeight*R/x)} + 2px)`}}),P=J(!1),s=J({ox:0,oy:0}),m=F(()=>{var x;const _=(x=l.value)==null?void 0:x.attr;if(!_)return;const{ox:p,oy:u}=s.value;return{left:p-_.left,right:_.right-p,top:u-_.top,bottom:_.bottom-u}}),y=F(()=>{var g;if(!((g=l.value)==null?void 0:g.attr)||!m.value)return;const{bottom:p,left:u,right:x,top:R}=m.value;return{left:(u/(x+u)).toFixed(3),right:(x/(x+u)).toFixed(3),top:(R/(R+p)).toFixed(3),bottom:(p/(R+p)).toFixed(3)}}),S=J({left:"0",top:"0"}),N=_=>{const p=d.value;if(!p)return;const u=p.getBoundingClientRect(),x=u.width/p.naturalWidth*p.naturalHeight,R=(u.height-x)/2,g=(_.clientX-u.left)/u.width*p.naturalWidth,B=(_.clientY-u.top-R)/x*p.naturalHeight;s.value={ox:g,oy:B},S.value={left:-(g-.1*p.naturalWidth)/p.naturalWidth*1e3+"px",top:-(B-.1*p.naturalWidth)/p.naturalWidth*1e3+"px"}};return(_,p)=>i(r)?(z(),te("div",Ol,[I("img",{ref_key:"imgRef",ref:d,src:i(r),onClick:v,"cursor-crosshair":"","object-contain":"","h-full":"",class:"max-w-[calc(var(--gkd-w)*0.35)]",onMouseover:p[0]||(p[0]=u=>P.value=!0),onMouseleave:p[1]||(p[1]=u=>P.value=!1),onMousemove:N,onLoad:p[2]||(p[2]=u=>f.value=!0)},null,40,Ml),I("div",Ul,[I("div",{style:Te(i($)),absolute:"","transition-all-300":"","b-1px":"","b-blue":"","b-solid":""},p[3]||(p[3]=[I("div",{absolute:"","left-0":"","top-0":"","bottom-0":"","right-0":"","b-solid":"","b-1px":"","b-red":""},null,-1)]),4)]),I("div",Hl,[I("div",jl,V(`${i(h).screenWidth}x${i(h).screenHeight}`),1),I("div",ql,V(i(Fn)(i(h).id).format("YYYY-MM-DD HH:mm:ss")),1)]),i(d)?(z(),ae(Bl,{key:0,imgHover:i(P),imgRef:i(d),boxHoverPerPosition:i(y),boxHoverPosition:i(m),hoverPositionStyle:i(S),hoverPosition:i(s),screenshotUrl:i(r)},null,8,["imgHover","imgRef","boxHoverPerPosition","boxHoverPosition","hoverPositionStyle","hoverPosition","screenshotUrl"])):de("",!0)])):de("",!0)}}),Vl={"bg-white":"","b-1px":"","b-solid":"","b-gray-200":"","rounded-4px":"","p-8px":""},Gl={flex:"","m-b-4px":"","pr-4px":""},Yl={key:0,underline:"","leading-20px":"","decoration-1":"","m-r-4px":"",gkd_code:"",title:"查询数量"},Ql=["title"],Xl={flex:"","gap-8px":"","flex-wrap":""},Jl=Y({__name:"SearchCard",props:{show:{type:Boolean},onUpdateShow:{type:Function,default:rt}},setup(e){const t=Tn(),{snapshotImportId:a,snapshotImageId:n}=Ln(),l=je(),{updateFocusNode:r}=l,h=He(l),d=h.snapshot,f=h.rootNode,{focusNode:v}=h,c=J(""),b=Gt([]),$=J([]),P=u=>{const x=wr(()=>St(u),g=>typeof g=="string"?g:g instanceof tr?"非法选择器:"+g.outMessage:"非法选择器:"+(g instanceof Error?g.message:g));if(b.find(g=>typeof g.selector=="object"&&g.selector.toString()==x.toString())){Fe.warning("不可重复选择");return}const R=x.querySelectorAllContext(f.value);if(R.length==0){Fe.success("没有选择到节点");return}return Fe.success(`选择到 ${R.length} 个节点`),b.unshift({selector:x,nodes:R.map(g=>g.target),results:R,key:Date.now(),gkd:!0}),R.length},s=u=>{if(b.find(g=>typeof g.selector=="string"&&g.selector.toString()==u)){Fe.warning("不可重复搜索");return}const x=[],R=[f.value];for(;R.length>0;){const g=R.pop();ot(g).includes(u)&&x.push(g),R.push(...[...g.children].reverse())}if(x.length==0){Fe.success("没有搜索到节点");return}return Fe.success(`搜索到 ${x.length} 个节点`),b.unshift({gkd:!1,selector:u,nodes:x,key:Date.now()}),x.length},m=()=>{const u=b[0],x=u.nodes[0];Array.isArray(x)?typeof u.selector=="object"&&r(x):r(x);const R=new Set(b.map(B=>B.key)),g=$.value.filter(B=>R.has(B));g.push(u.key),$.value=g},y=xn(()=>{const u=c.value.trim();if(u){if(N.value){if(!P(u))return}else if(!s(u))return;m()}});Nt(async()=>{await er;let u=0;t.query.gkd&&(u+=P(pn.decode(t.query.gkd))||0),t.query.str&&(u+=s(t.query.str)||0),u>0&&m()});const S=xn(async u=>{var j,he,be;const x=n[d.value.id],R=a[d.value.id],g=R?cn(R):void 0,B=x?Zo(x):void 0,A=u.selector,M=u.nodes[0],we=[((j=M.quickFind)!=null?j:M.idQf)&&M.attr.id&&A.fastQueryList.some(ge=>ge instanceof Ot.Id&&ge.value===M.attr.id),((he=M.quickFind)!=null?he:M.idQf)&&M.attr.vid&&A.fastQueryList.some(ge=>ge instanceof Ot.Vid&&ge.value===M.attr.vid),((be=M.quickFind)!=null?be:M.textQf)&&M.attr.text&&A.fastQueryList.some(ge=>ge instanceof Ot.Text&&ge.value===M.attr.text)].some(Boolean),ne={id:d.value.appId,name:Pe(d.value).name,groups:[{key:1,name:`[ChangeMe]规则名称-${Fn().format("YYYY-MM-DD HH:mm:ss")}`,desc:"[ChangeMe]本规则由GKD网页端审查工具生成",rules:[{fastQuery:we||void 0,activityIds:d.value.activityId,matches:A.toString(),exampleUrls:B,snapshotUrls:g}]}]};Ie(An.stringify(ne,void 0,2))}),N=J(!0),_=F(()=>a[d.value.id]),p=u=>{if(!_.value)return;const x=new URL(cn(a[d.value.id]));typeof u.selector=="object"?x.searchParams.set("gkd",pn.encode(u.selector.toString())):x.searchParams.set("str",u.selector.toString()),Ie(x.toString())};return(u,x)=>{const R=xr,g=Kn,B=yr,A=Oe("SvgIcon"),M=lt,we=zn,ne=kr,j=Rr,he=Qt,be=Xt,ge=Kr,ye=Tr;return z(),ae(Rt,{initialValue:{top:40,right:Math.max(315,12*i(Wn)+135),width:Math.max(480,i(Vn)*.3)},minWidth:300,sizeDraggable:"",class:"box-shadow-dim",show:u.show},{default:w(({onRef:$e})=>[I("div",Vl,[I("div",Gl,[C(B,{value:i(N),"onUpdate:value":x[0]||(x[0]=q=>nt(N)?N.value=q:null)},{default:w(()=>[C(g,null,{default:w(()=>[C(R,{value:!1},{default:w(()=>x[4]||(x[4]=[ee(" 字符搜索 ")])),_:1}),C(R,{value:!0},{default:w(()=>x[5]||(x[5]=[ee(" 选择器查询 ")])),_:1})]),_:1})]),_:1},8,["value"]),I("div",{"flex-1":"","cursor-move":"",ref:$e},null,512),C(M,{onClick:x[1]||(x[1]=q=>u.onUpdateShow(!u.show)),text:"",title:"最小化"},{icon:w(()=>[C(A,{name:"minus"})]),_:1})]),C(ne,null,{default:w(()=>[C(we,{value:i(c),"onUpdate:value":x[2]||(x[2]=q=>nt(c)?c.value=q:null),placeholder:i(N)?"请输入选择器":"请输入字符",onKeyup:Jo(i(y),["enter"]),inputProps:{class:"gkd_code"}},null,8,["value","placeholder","onKeyup"]),C(M,{onClick:i(y)},{icon:w(()=>[C(A,{name:"search"})]),_:1},8,["onClick"])]),_:1}),x[8]||(x[8]=I("div",{"p-5px":""},null,-1)),C(ye,{expandedNames:i($),"onUpdate:expandedNames":x[3]||(x[3]=q=>nt($)?$.value=q:null)},{default:w(()=>[(z(!0),te(Re,null,Be(i(b),(q,it)=>(z(),ae(ge,{key:q.key,name:q.key},{header:w(()=>[q.nodes.length>1?(z(),te("span",Yl,V(q.nodes.length),1)):de("",!0),I("span",{"break-all":"","px-4px":"","leading-20px":"",bg:"#eee",gkd_code:"",title:q.gkd?"选择器":"搜索字符"},[q.gkd?(z(),ae(Ct,{key:0,node:q.selector.ast,source:q.selector.source},null,8,["node","source"])):(z(),te(Re,{key:1},[ee(V(q.selector),1)],64))],8,Ql),x[6]||(x[6]=I("span",{"pl-4px":""},null,-1))]),"header-extra":w(()=>[C(j,null,{default:w(()=>[q.gkd&&q.selector.canCopy?(z(),ae(M,{key:0,size:"small",onClick:zt(pe=>i(S)(q),["stop"]),title:"复制规则"},{icon:w(()=>[C(A,{name:"copy"})]),_:2},1032,["onClick"])):de("",!0),i(_)?(z(),ae(M,{key:1,size:"small",title:q.gkd?"复制查询链接":"复制搜索链接",onClick:zt(pe=>p(q),["stop"])},{icon:w(()=>[C(A,{name:"share"})]),_:2},1032,["title","onClick"])):de("",!0),C(M,{size:"small",onClick:zt(pe=>i(b).splice(it,1),["stop"]),title:"删除记录"},{icon:w(()=>[C(A,{name:"delete"})]),_:2},1032,["onClick"])]),_:2},1024)]),default:w(()=>[C(be,{xScrollable:"",style:{"max-height":"400px"}},{default:w(()=>[I("div",Xl,[!q.gkd||q.selector.connectKeys.length===0?(z(!0),te(Re,{key:0},Be(q.nodes,pe=>(z(),ae(M,{key:pe.id,onClick:E=>i(r)(pe),size:"small",style:Te(i(ht)(pe,i(v)))},{default:w(()=>[ee(V(i(ot)(pe)),1)]),_:2},1032,["onClick","style"]))),128)):(z(!0),te(Re,{key:1},Be(q.nodes,(pe,E)=>(z(),ae(j,{key:E},{default:w(()=>[C(M,{size:"small",onClick:W=>i(l).showTrack(q.selector,q.results[E])},{default:w(()=>[C(he,null,{default:w(()=>[C(A,{name:"path"})]),_:1})]),_:2},1032,["onClick"]),C(M,{onClick:W=>i(r)(pe),size:"small",style:Te(i(ht)(pe,i(v)))},{default:w(()=>[ee(V(i(ot)(pe)),1)]),_:2},1032,["onClick","style"])]),_:2},1024))),128))]),x[7]||(x[7]=I("div",{un:"h-10px"},null,-1))]),_:2},1024)]),_:2},1032,["name"]))),128))]),_:1},8,["expandedNames"])])]),_:1},8,["initialValue","show"])}}}),_n=[],Zl=Y((e,t)=>{const a=F(()=>e.tag||"div");return()=>{var r,h,d,f;const n=(((h=(r=t.slots).default)==null?void 0:h.call(r))||_n).filter(v=>typeof v.type!="symbol"),l=[];if(n.length>0&&l.push(n[0]),n.length>1)for(let v=1;v<n.length;v++){const c=((f=(d=t.slots).gap)==null?void 0:f.call(d,{index:v-1}))||_n;l.push(...c),l.push(n[v])}return e.virtual?l:T(a.value,e,l)}},{props:["tag","virtual"]}),ei={flex:"","flex-col":"","overflow-hidden":""},ti={flex:"","items-center":"","px-8px":""},ni={flex:"","items-center":"","gap-2px":"","max-w-120px":""},oi=Y({__name:"WindowCard",setup(e){const t=En(),a=je(),{updateFocusNode:n}=a,l=He(a),r=l.snapshot,h=l.rootNode,{focusNode:d,focusTime:f}=l;let v=Number.NaN;const c=J([]),b=J([]);Ae([()=>d.value,()=>f.value],async()=>{if(!d.value)return;const p=d.value.id;et().then(async()=>{var R;if(await un(300),p===((R=d.value)==null?void 0:R.id)){if(v===p){v=Number.NaN;return}const g=document.querySelector(`[data-node-id="${p}"]`);if(!g)return;b.value=[p],g.scrollIntoView({behavior:"smooth",block:"center"})}});let u=d.value.parent;if(!u)return;const x=new Set(c.value);for(;u;)x.add(u.id),u=u.parent;x.size==c.value.length&&c.value.every(R=>x.has(R))||(c.value=[...x])});const $=J(),P=(p,u)=>{var x;return u.id===((x=d.value)==null?void 0:x.id)},s=p=>{const u=ht(p.option,d.value);return{onClick:()=>{v=p.option.id,n(p.option)},style:{"--n-node-text-color":u.color,...u},class:"whitespace-nowrap","data-node-id":String(p.option.id)}},m=p=>ot(p.option),y=F(()=>`${vn(r.value).manufacturer} Android ${vn(r.value).release||""}`),S=F(()=>Pe(r.value).isSystem),N=F(()=>{const p=r.value.activityId,u=r.value.appId;return!p||!u?"":p.startsWith(u)&&p[u.length]==="."?p.substring(u.length):p}),_=async()=>{Fe.success("删除成功,即将回到首页"),await un(2e3),t.replace({path:"/"})};return(p,u)=>{const x=Yt,R=Oe("SvgIcon"),g=al,B=Xt;return z(),te("div",ei,[I("div",ti,[C(i(Zl),{flex:"","flex-wrap":"","items-center":"","gap-8px":"",gkd_code:""},{gap:w(()=>u[8]||(u[8]=[I("div",{"w-1px":"","bg-gray":"","h-12px":""},null,-1)])),default:w(()=>[C(x,null,{trigger:w(()=>[I("div",{onClick:u[0]||(u[0]=A=>i(Ie)(i(y)))},V(i(y)),1)]),default:w(()=>[u[9]||(u[9]=ee(" 设备名称 "))]),_:1}),C(x,null,{trigger:w(()=>[I("div",{class:ft({"opacity-50":!i(gn)(i(r)).versionName})},V(i(gn)(i(r)).versionName||"null"),3)]),default:w(()=>[u[10]||(u[10]=ee(" GKD 版本 "))]),_:1}),I("div",ni,[i(S)?(z(),ae(x,{key:0},{trigger:w(()=>[C(R,{name:"system"})]),default:w(()=>[ee(" "+V(`${i(Pe)(i(r)).name} 是一个系统应用`),1)]),_:1})):de("",!0),C(x,null,{trigger:w(()=>[I("div",{onClick:u[1]||(u[1]=A=>i(Ie)(i(Pe)(i(r)).name))},V(i(Pe)(i(r)).name),1)]),default:w(()=>[u[11]||(u[11]=ee(" 应用名称 "))]),_:1})]),C(x,null,{trigger:w(()=>[I("div",{onClick:u[2]||(u[2]=A=>i(Ie)(i(Pe)(i(r)).versionName))},V(i(Pe)(i(r)).versionName),1)]),default:w(()=>[u[12]||(u[12]=ee(" 版本名称 "))]),_:1}),C(x,null,{trigger:w(()=>[I("div",{onClick:u[3]||(u[3]=A=>i(Ie)(i(Pe)(i(r)).versionCode.toString()))},V(i(Pe)(i(r)).versionCode),1)]),default:w(()=>[u[13]||(u[13]=ee(" 版本代码 "))]),_:1}),C(x,null,{trigger:w(()=>[I("div",{onClick:u[4]||(u[4]=A=>i(Ie)(i(r).appId))},V(i(r).appId),1)]),default:w(()=>[u[14]||(u[14]=ee(" 应用ID "))]),_:1}),C(x,null,{trigger:w(()=>[I("div",{onClick:u[5]||(u[5]=A=>i(Ie)(i(N))),class:ft({"opacity-50":!i(N)})},V(i(N)||"null"),3)]),default:w(()=>[u[15]||(u[15]=ee(" 界面ID "))]),_:1})]),_:1}),u[16]||(u[16]=I("div",{"flex-1":""},null,-1)),C(dr,{class:"ml-8px",snapshot:i(r),onDelete:_,showPreview:!1},null,8,["snapshot"])]),u[17]||(u[17]=I("div",{"h-1px":"","mt-4px":"",bg:"#efeff5"},null,-1)),C(B,{xScrollable:"",class:"flex-1"},{default:w(()=>[C(g,{class:"mb-24px mr-24px",ref_key:"treeRef",ref:$,virtualScroll:"",showLine:"",blockLine:"",keyField:"id",expandedKeys:i(c),"onUpdate:expandedKeys":u[6]||(u[6]=A=>nt(c)?c.value=A:null),selectedKeys:i(b),"onUpdate:selectedKeys":u[7]||(u[7]=A=>nt(b)?b.value=A:null),data:[i(h)],filter:P,nodeProps:s,renderLabel:m},null,8,["expandedKeys","selectedKeys","data","filter","nodeProps","renderLabel"])]),_:1})])}}}),ri={"h-full":"",flex:"","gap-5px":""},li={"w-28px":"","py-8px":"",flex:"","flex-col":"","gap-16px":""},ii={flex:"","justify-center":"",href:"https://gkd.li/guide/snapshot#share-note",target:"_blank",rel:"noopener noreferrer"},ai={key:1,flex:"","justify-center":"","pt-80px":""},bi=Y({__name:"SnapshotPage",setup(e){const t=je(),a=He(t),{snapshot:n,rootNode:l,loading:r,redirected:h,trackData:d,trackShow:f}=a;Ne(()=>{r.value?fn.start():fn.finish()});const v=Bt("searchShow",!0,sessionStorage),c=Bt("ruleShow",!1,sessionStorage),b=Bt("attrShow",!0,sessionStorage),$=()=>{Fe.info("暂未实现")};return(P,s)=>{const m=Oe("SvgIcon"),y=Qt,S=Oe("RouterLink"),N=lt,_=Yt;return i(n)&&i(l)?(z(),te(Re,{key:0},[I("div",ri,[I("div",li,[C(_,{placement:"right"},{trigger:w(()=>[C(N,{text:""},{icon:w(()=>[C(S,{to:"/",title:"",color:"inherit"},{default:w(()=>[C(y,{size:"24"},{default:w(()=>[C(m,{name:"home"})]),_:1})]),_:1})]),_:1})]),default:w(()=>[s[8]||(s[8]=ee(" 回到首页 "))]),_:1}),C(_,{placement:"right"},{trigger:w(()=>[C(N,{onClick:$,text:""},{icon:w(()=>[C(y,{size:"24"},{default:w(()=>[C(m,{name:"settings"})]),_:1})]),_:1})]),default:w(()=>[s[9]||(s[9]=ee(" 设置 "))]),_:1}),s[14]||(s[14]=I("div",null,null,-1)),C(_,{placement:"right"},{trigger:w(()=>[C(N,{text:"",onClick:s[0]||(s[0]=p=>v.value=!i(v))},{icon:w(()=>[C(y,{size:"24"},{default:w(()=>[C(m,{name:"search-list"})]),_:1})]),_:1})]),default:w(()=>[s[10]||(s[10]=ee(" 搜索面板 "))]),_:1}),C(_,{placement:"right"},{trigger:w(()=>[C(N,{onClick:s[1]||(s[1]=p=>b.value=!i(b)),text:""},{icon:w(()=>[C(y,{size:"24"},{default:w(()=>[C(m,{name:"prop"})]),_:1})]),_:1})]),default:w(()=>[s[11]||(s[11]=ee(" 属性面板 "))]),_:1}),C(_,{placement:"right"},{trigger:w(()=>[C(N,{onClick:s[2]||(s[2]=p=>c.value=!i(c)),text:""},{icon:w(()=>[C(y,{size:"24"},{default:w(()=>[C(m,{name:"test"})]),_:1})]),_:1})]),default:w(()=>[s[12]||(s[12]=ee(" 测试规则 "))]),_:1}),s[15]||(s[15]=I("div",null,null,-1)),C(_,{placement:"right"},{trigger:w(()=>[I("a",ii,[C(N,{text:""},{icon:w(()=>[C(y,{size:"24"},{default:w(()=>[C(m,{name:"warn"})]),_:1})]),_:1})])]),default:w(()=>[s[13]||(s[13]=ee(" 分享须知 "))]),_:1})]),C(Wl),C(oi,{class:"flex-1"})]),C(Jl,{show:i(v),onUpdateShow:s[3]||(s[3]=p=>v.value=p)},null,8,["show"]),C(Ll,{show:i(c),onUpdateShow:s[4]||(s[4]=p=>c.value=p)},null,8,["show"]),C(Rl,{show:i(b),onUpdateShow:s[5]||(s[5]=p=>b.value=p)},null,8,["show"]),C(Pl),C(xl,{show:i(f),onUpdateShow:s[6]||(s[6]=p=>f.value=p),data:i(d),onUpdateData:s[7]||(s[7]=p=>d.value=p)},null,8,["show","data"])],64)):!i(r)&&!i(h)?(z(),te("div",ai,s[16]||(s[16]=[I("div",null,"快照数据缺失",-1)]))):de("",!0)}}});export{bi as default};
273
- //# sourceMappingURL=SnapshotPage-FGNM-Bya.js.map
272
+ )`,"background-position-y":"1.5px"}},null,-1))],4),[[$n,n.imgHover]])]))}}),Ol={key:0,flex:"","flex-col":"",relative:"","h-full":"","p-2px":"","box-border":"","overflow-hidden":""},Ml=["src"],Ul={"pointer-events-none":"",absolute:"","left-2px":"","top-2px":"",size:"[calc(100%-4px)]"},Hl={absolute:"","z-4":"","pointer-events-none":"","left-4px":"","top-4px":"","text-12px":"",leading:"100%",flex:"","gap-4px":""},jl={"py-1px":"","px-2px":"",bg:"#ffffff90",title:"尺寸"},ql={"py-1px":"","px-2px":"",bg:"#ffffff90",title:"创建时间"},Wl=Y({__name:"ScreenshotCard",setup(e){const t=je(),{updatePosition:a}=t,n=He(t),{focusNode:l,screenshotUrl:r}=n,h=F(()=>t.snapshot),d=J(),f=J(!1),v=_=>{const p=d.value;if(!p)return;const u=p.getBoundingClientRect(),x=u.width/p.naturalWidth*p.naturalHeight,R=(u.height-x)/2,g=(_.clientX-u.left)/u.width*p.naturalWidth,B=(_.clientY-u.top-R)/x*p.naturalHeight;a({x:g,y:B})},c=_=>`${_*100}%`,b=Xo(d),$=F(()=>{var g;const _=d.value,p=(g=l.value)==null?void 0:g.attr;if(!l.value||!_||!p||!f.value)return"";const u=b.width.value,x=b.height.value,R=u/_.naturalWidth*_.naturalHeight;return{left:`calc(${c(p.left/_.naturalWidth)} - 2px)`,width:`calc(${c((p.right-p.left)/_.naturalWidth)} + 2px)`,top:`calc(${c((p.top/_.naturalHeight*R+(x-R)/2)/x)} - 2px)`,height:`calc(${c((p.bottom-p.top)/_.naturalHeight*R/x)} + 2px)`}}),P=J(!1),s=J({ox:0,oy:0}),m=F(()=>{var x;const _=(x=l.value)==null?void 0:x.attr;if(!_)return;const{ox:p,oy:u}=s.value;return{left:p-_.left,right:_.right-p,top:u-_.top,bottom:_.bottom-u}}),y=F(()=>{var g;if(!((g=l.value)==null?void 0:g.attr)||!m.value)return;const{bottom:p,left:u,right:x,top:R}=m.value;return{left:(u/(x+u)).toFixed(3),right:(x/(x+u)).toFixed(3),top:(R/(R+p)).toFixed(3),bottom:(p/(R+p)).toFixed(3)}}),S=J({left:"0",top:"0"}),N=_=>{const p=d.value;if(!p)return;const u=p.getBoundingClientRect(),x=u.width/p.naturalWidth*p.naturalHeight,R=(u.height-x)/2,g=(_.clientX-u.left)/u.width*p.naturalWidth,B=(_.clientY-u.top-R)/x*p.naturalHeight;s.value={ox:g,oy:B},S.value={left:-(g-.1*p.naturalWidth)/p.naturalWidth*1e3+"px",top:-(B-.1*p.naturalWidth)/p.naturalWidth*1e3+"px"}};return(_,p)=>i(r)?(z(),te("div",Ol,[I("img",{ref_key:"imgRef",ref:d,src:i(r),onClick:v,"cursor-crosshair":"","object-contain":"","h-full":"",class:"max-w-[calc(var(--gkd-w)*0.35)]",onMouseover:p[0]||(p[0]=u=>P.value=!0),onMouseleave:p[1]||(p[1]=u=>P.value=!1),onMousemove:N,onLoad:p[2]||(p[2]=u=>f.value=!0)},null,40,Ml),I("div",Ul,[I("div",{style:Te(i($)),absolute:"","transition-all-300":"","b-1px":"","b-blue":"","b-solid":""},p[3]||(p[3]=[I("div",{absolute:"","left-0":"","top-0":"","bottom-0":"","right-0":"","b-solid":"","b-1px":"","b-red":""},null,-1)]),4)]),I("div",Hl,[I("div",jl,V(`${i(h).screenWidth}x${i(h).screenHeight}`),1),I("div",ql,V(i(Fn)(i(h).id).format("YYYY-MM-DD HH:mm:ss")),1)]),i(d)?(z(),ae(Bl,{key:0,imgHover:i(P),imgRef:i(d),boxHoverPerPosition:i(y),boxHoverPosition:i(m),hoverPositionStyle:i(S),hoverPosition:i(s),screenshotUrl:i(r)},null,8,["imgHover","imgRef","boxHoverPerPosition","boxHoverPosition","hoverPositionStyle","hoverPosition","screenshotUrl"])):de("",!0)])):de("",!0)}}),Vl={"bg-white":"","b-1px":"","b-solid":"","b-gray-200":"","rounded-4px":"","p-8px":""},Gl={flex:"","m-b-4px":"","pr-4px":""},Yl={key:0,underline:"","leading-20px":"","decoration-1":"","m-r-4px":"",gkd_code:"",title:"查询数量"},Ql=["title"],Xl={flex:"","gap-8px":"","flex-wrap":""},Jl=Y({__name:"SearchCard",props:{show:{type:Boolean},onUpdateShow:{type:Function,default:rt}},setup(e){const t=Tn(),{snapshotImportId:a,snapshotImageId:n}=Ln(),l=je(),{updateFocusNode:r}=l,h=He(l),d=h.snapshot,f=h.rootNode,{focusNode:v}=h,c=J(""),b=Gt([]),$=J([]),P=u=>{const x=wr(()=>St(u),g=>typeof g=="string"?g:g instanceof tr?"非法选择器:"+g.outMessage:"非法选择器:"+(g instanceof Error?g.message:g));if(b.find(g=>typeof g.selector=="object"&&g.selector.toString()==x.toString())){Fe.warning("不可重复选择");return}const R=x.querySelectorAllContext(f.value);if(R.length==0){Fe.success("没有选择到节点");return}return Fe.success(`选择到 ${R.length} 个节点`),b.unshift({selector:x,nodes:R.map(g=>g.target),results:R,key:Date.now(),gkd:!0}),R.length},s=u=>{if(b.find(g=>typeof g.selector=="string"&&g.selector.toString()==u)){Fe.warning("不可重复搜索");return}const x=[],R=[f.value];for(;R.length>0;){const g=R.pop();ot(g).includes(u)&&x.push(g),R.push(...[...g.children].reverse())}if(x.length==0){Fe.success("没有搜索到节点");return}return Fe.success(`搜索到 ${x.length} 个节点`),b.unshift({gkd:!1,selector:u,nodes:x,key:Date.now()}),x.length},m=()=>{const u=b[0],x=u.nodes[0];Array.isArray(x)?typeof u.selector=="object"&&r(x):r(x);const R=new Set(b.map(B=>B.key)),g=$.value.filter(B=>R.has(B));g.push(u.key),$.value=g},y=xn(()=>{const u=c.value.trim();if(u){if(N.value){if(!P(u))return}else if(!s(u))return;m()}});Nt(async()=>{await er;let u=0;t.query.gkd&&(u+=P(pn.decode(t.query.gkd))||0),t.query.str&&(u+=s(t.query.str)||0),u>0&&m()});const S=xn(async u=>{var j,he,be;const x=n[d.value.id],R=a[d.value.id],g=R?cn(R):void 0,B=x?Zo(x):void 0,A=u.selector,M=u.nodes[0],we=[((j=M.quickFind)!=null?j:M.idQf)&&M.attr.id&&A.fastQueryList.some(ge=>ge instanceof Ot.Id&&ge.value===M.attr.id),((he=M.quickFind)!=null?he:M.idQf)&&M.attr.vid&&A.fastQueryList.some(ge=>ge instanceof Ot.Vid&&ge.value===M.attr.vid),((be=M.quickFind)!=null?be:M.textQf)&&M.attr.text&&A.fastQueryList.some(ge=>ge instanceof Ot.Text&&ge.value===M.attr.text)].some(Boolean),ne={id:d.value.appId,name:Pe(d.value).name,groups:[{key:1,name:`[ChangeMe]规则名称-${Fn().format("YYYY-MM-DD HH:mm:ss")}`,desc:"[ChangeMe]本规则由GKD网页端审查工具生成",rules:[{fastQuery:we||void 0,activityIds:d.value.activityId,matches:A.toString(),exampleUrls:B,snapshotUrls:g}]}]};Ie(An.stringify(ne,void 0,2))}),N=J(!0),_=F(()=>a[d.value.id]),p=u=>{if(!_.value)return;const x=new URL(cn(a[d.value.id]));typeof u.selector=="object"?x.searchParams.set("gkd",pn.encode(u.selector.toString())):x.searchParams.set("str",u.selector.toString()),Ie(x.toString())};return(u,x)=>{const R=xr,g=Kn,B=yr,A=Oe("SvgIcon"),M=lt,we=zn,ne=kr,j=Rr,he=Qt,be=Xt,ge=Kr,ye=Tr;return z(),ae(Rt,{initialValue:{top:40,right:Math.max(315,12*i(Wn)+135),width:Math.max(480,i(Vn)*.3)},minWidth:300,sizeDraggable:"",class:"box-shadow-dim",show:u.show},{default:w(({onRef:$e})=>[I("div",Vl,[I("div",Gl,[C(B,{value:i(N),"onUpdate:value":x[0]||(x[0]=q=>nt(N)?N.value=q:null)},{default:w(()=>[C(g,null,{default:w(()=>[C(R,{value:!1},{default:w(()=>x[4]||(x[4]=[ee(" 字符搜索 ")])),_:1}),C(R,{value:!0},{default:w(()=>x[5]||(x[5]=[ee(" 选择器查询 ")])),_:1})]),_:1})]),_:1},8,["value"]),I("div",{"flex-1":"","cursor-move":"",ref:$e},null,512),C(M,{onClick:x[1]||(x[1]=q=>u.onUpdateShow(!u.show)),text:"",title:"最小化"},{icon:w(()=>[C(A,{name:"minus"})]),_:1})]),C(ne,null,{default:w(()=>[C(we,{value:i(c),"onUpdate:value":x[2]||(x[2]=q=>nt(c)?c.value=q:null),placeholder:i(N)?"请输入选择器":"请输入字符",onKeyup:Jo(i(y),["enter"]),inputProps:{class:"gkd_code"}},null,8,["value","placeholder","onKeyup"]),C(M,{onClick:i(y)},{icon:w(()=>[C(A,{name:"search"})]),_:1},8,["onClick"])]),_:1}),x[8]||(x[8]=I("div",{"p-5px":""},null,-1)),C(ye,{expandedNames:i($),"onUpdate:expandedNames":x[3]||(x[3]=q=>nt($)?$.value=q:null)},{default:w(()=>[(z(!0),te(Re,null,Be(i(b),(q,it)=>(z(),ae(ge,{key:q.key,name:q.key},{header:w(()=>[q.nodes.length>1?(z(),te("span",Yl,V(q.nodes.length),1)):de("",!0),I("span",{"break-all":"","px-4px":"","leading-20px":"",bg:"#eee",gkd_code:"",title:q.gkd?"选择器":"搜索字符"},[q.gkd?(z(),ae(Ct,{key:0,node:q.selector.ast,source:q.selector.source},null,8,["node","source"])):(z(),te(Re,{key:1},[ee(V(q.selector),1)],64))],8,Ql),x[6]||(x[6]=I("span",{"pl-4px":""},null,-1))]),"header-extra":w(()=>[C(j,null,{default:w(()=>[q.gkd&&q.selector.canCopy?(z(),ae(M,{key:0,size:"small",onClick:zt(pe=>i(S)(q),["stop"]),title:"复制规则"},{icon:w(()=>[C(A,{name:"copy"})]),_:2},1032,["onClick"])):de("",!0),i(_)?(z(),ae(M,{key:1,size:"small",title:q.gkd?"复制查询链接":"复制搜索链接",onClick:zt(pe=>p(q),["stop"])},{icon:w(()=>[C(A,{name:"share"})]),_:2},1032,["title","onClick"])):de("",!0),C(M,{size:"small",onClick:zt(pe=>i(b).splice(it,1),["stop"]),title:"删除记录"},{icon:w(()=>[C(A,{name:"delete"})]),_:2},1032,["onClick"])]),_:2},1024)]),default:w(()=>[C(be,{xScrollable:"",style:{"max-height":"400px"}},{default:w(()=>[I("div",Xl,[!q.gkd||q.selector.connectKeys.length===0?(z(!0),te(Re,{key:0},Be(q.nodes,pe=>(z(),ae(M,{key:pe.id,onClick:E=>i(r)(pe),size:"small",style:Te(i(ht)(pe,i(v)))},{default:w(()=>[ee(V(i(ot)(pe)),1)]),_:2},1032,["onClick","style"]))),128)):(z(!0),te(Re,{key:1},Be(q.nodes,(pe,E)=>(z(),ae(j,{key:E},{default:w(()=>[C(M,{size:"small",onClick:W=>i(l).showTrack(q.selector,q.results[E])},{default:w(()=>[C(he,null,{default:w(()=>[C(A,{name:"path"})]),_:1})]),_:2},1032,["onClick"]),C(M,{onClick:W=>i(r)(pe),size:"small",style:Te(i(ht)(pe,i(v)))},{default:w(()=>[ee(V(i(ot)(pe)),1)]),_:2},1032,["onClick","style"])]),_:2},1024))),128))]),x[7]||(x[7]=I("div",{un:"h-10px"},null,-1))]),_:2},1024)]),_:2},1032,["name"]))),128))]),_:1},8,["expandedNames"])])]),_:1},8,["initialValue","show"])}}}),_n=[],Zl=Y((e,t)=>{const a=F(()=>e.tag||"div");return()=>{var r,h,d,f;const n=(((h=(r=t.slots).default)==null?void 0:h.call(r))||_n).filter(v=>typeof v.type!="symbol"),l=[];if(n.length>0&&l.push(n[0]),n.length>1)for(let v=1;v<n.length;v++){const c=((f=(d=t.slots).gap)==null?void 0:f.call(d,{index:v-1}))||_n;l.push(...c),l.push(n[v])}return e.virtual?l:T(a.value,e,l)}},{props:["tag","virtual"]}),ei={flex:"","flex-col":"","overflow-hidden":""},ti={flex:"","items-center":"","px-8px":""},ni={flex:"","items-center":"","gap-2px":"","max-w-120px":""},oi=Y({__name:"WindowCard",setup(e){const t=En(),a=je(),{updateFocusNode:n}=a,l=He(a),r=l.snapshot,h=l.rootNode,{focusNode:d,focusTime:f}=l;let v=Number.NaN;const c=J([]),b=J([]);Ae([()=>d.value,()=>f.value],async()=>{if(!d.value)return;const p=d.value.id;et().then(async()=>{var R;if(await un(300),p===((R=d.value)==null?void 0:R.id)){if(v===p){v=Number.NaN;return}const g=document.querySelector(`[data-node-id="${p}"]`);if(!g)return;b.value=[p],g.scrollIntoView({behavior:"smooth",block:"center"})}});let u=d.value.parent;if(!u)return;const x=new Set(c.value);for(;u;)x.add(u.id),u=u.parent;x.size==c.value.length&&c.value.every(R=>x.has(R))||(c.value=[...x])});const $=J(),P=(p,u)=>{var x;return u.id===((x=d.value)==null?void 0:x.id)},s=p=>{const u=ht(p.option,d.value);return{onClick:()=>{v=p.option.id,n(p.option)},style:{"--n-node-text-color":u.color,...u},class:"whitespace-nowrap","data-node-id":String(p.option.id)}},m=p=>ot(p.option),y=F(()=>`${vn(r.value).manufacturer} Android ${vn(r.value).release||""}`),S=F(()=>Pe(r.value).isSystem),N=F(()=>{const p=r.value.activityId,u=r.value.appId;return!p||!u?"":p.startsWith(u)&&p[u.length]==="."?p.substring(u.length):p}),_=async()=>{Fe.success("删除成功,即将回到首页"),await un(2e3),t.replace({path:"/"})};return(p,u)=>{const x=Yt,R=Oe("SvgIcon"),g=al,B=Xt;return z(),te("div",ei,[I("div",ti,[C(i(Zl),{flex:"","flex-wrap":"","items-center":"","gap-8px":"",gkd_code:""},{gap:w(()=>u[8]||(u[8]=[I("div",{"w-1px":"","bg-gray":"","h-12px":""},null,-1)])),default:w(()=>[C(x,null,{trigger:w(()=>[I("div",{onClick:u[0]||(u[0]=A=>i(Ie)(i(y)))},V(i(y)),1)]),default:w(()=>[u[9]||(u[9]=ee(" 设备名称 "))]),_:1}),C(x,null,{trigger:w(()=>[I("div",{class:ft({"opacity-50":!i(gn)(i(r)).versionName})},V(i(gn)(i(r)).versionName||"null"),3)]),default:w(()=>[u[10]||(u[10]=ee(" GKD 版本 "))]),_:1}),I("div",ni,[i(S)?(z(),ae(x,{key:0},{trigger:w(()=>[C(R,{name:"system"})]),default:w(()=>[ee(" "+V(`${i(Pe)(i(r)).name} 是一个系统应用`),1)]),_:1})):de("",!0),C(x,null,{trigger:w(()=>[I("div",{onClick:u[1]||(u[1]=A=>i(Ie)(i(Pe)(i(r)).name))},V(i(Pe)(i(r)).name),1)]),default:w(()=>[u[11]||(u[11]=ee(" 应用名称 "))]),_:1})]),C(x,null,{trigger:w(()=>[I("div",{onClick:u[2]||(u[2]=A=>i(Ie)(i(Pe)(i(r)).versionName))},V(i(Pe)(i(r)).versionName),1)]),default:w(()=>[u[12]||(u[12]=ee(" 版本名称 "))]),_:1}),C(x,null,{trigger:w(()=>[I("div",{onClick:u[3]||(u[3]=A=>i(Ie)(i(Pe)(i(r)).versionCode.toString()))},V(i(Pe)(i(r)).versionCode),1)]),default:w(()=>[u[13]||(u[13]=ee(" 版本代码 "))]),_:1}),C(x,null,{trigger:w(()=>[I("div",{onClick:u[4]||(u[4]=A=>i(Ie)(i(r).appId))},V(i(r).appId),1)]),default:w(()=>[u[14]||(u[14]=ee(" 应用ID "))]),_:1}),C(x,null,{trigger:w(()=>[I("div",{onClick:u[5]||(u[5]=A=>i(Ie)(i(N))),class:ft({"opacity-50":!i(N)})},V(i(N)||"null"),3)]),default:w(()=>[u[15]||(u[15]=ee(" 界面ID "))]),_:1})]),_:1}),u[16]||(u[16]=I("div",{"flex-1":""},null,-1)),C(dr,{class:"ml-8px",snapshot:i(r),onDelete:_,showPreview:!1},null,8,["snapshot"])]),u[17]||(u[17]=I("div",{"h-1px":"","mt-4px":"",bg:"#efeff5"},null,-1)),C(B,{xScrollable:"",class:"flex-1"},{default:w(()=>[C(g,{class:"mb-24px mr-24px",ref_key:"treeRef",ref:$,virtualScroll:"",showLine:"",blockLine:"",keyField:"id",expandedKeys:i(c),"onUpdate:expandedKeys":u[6]||(u[6]=A=>nt(c)?c.value=A:null),selectedKeys:i(b),"onUpdate:selectedKeys":u[7]||(u[7]=A=>nt(b)?b.value=A:null),data:[i(h)],filter:P,nodeProps:s,renderLabel:m},null,8,["expandedKeys","selectedKeys","data","filter","nodeProps","renderLabel"])]),_:1})])}}}),ri={"h-full":"",flex:"","gap-5px":""},li={"w-28px":"","py-8px":"",flex:"","flex-col":"","gap-16px":""},ii={flex:"","justify-center":"",href:"https://gkd.li/guide/snapshot#share-note",target:"_blank",rel:"noopener noreferrer"},ai={key:1,flex:"","justify-center":"","pt-80px":""},bi=Y({__name:"SnapshotPage",setup(e){const t=je(),a=He(t),{snapshot:n,rootNode:l,loading:r,redirected:h,trackData:d,trackShow:f}=a;Ne(()=>{r.value?fn.start():fn.finish()});const v=Bt("searchShow",!0,sessionStorage),c=Bt("ruleShow",!1,sessionStorage),b=Bt("attrShow",!0,sessionStorage),$=()=>{Fe.info("暂未实现")};return(P,s)=>{const m=Oe("SvgIcon"),y=Qt,S=Oe("RouterLink"),N=lt,_=Yt;return i(n)&&i(l)?(z(),te(Re,{key:0},[I("div",ri,[I("div",li,[C(_,{placement:"right"},{trigger:w(()=>[C(N,{text:""},{icon:w(()=>[C(S,{to:"/",title:"",color:"inherit"},{default:w(()=>[C(y,{size:"24"},{default:w(()=>[C(m,{name:"home"})]),_:1})]),_:1})]),_:1})]),default:w(()=>[s[8]||(s[8]=ee(" 回到首页 "))]),_:1}),C(_,{placement:"right"},{trigger:w(()=>[C(N,{onClick:$,text:""},{icon:w(()=>[C(y,{size:"24"},{default:w(()=>[C(m,{name:"settings"})]),_:1})]),_:1})]),default:w(()=>[s[9]||(s[9]=ee(" 设置 "))]),_:1}),s[14]||(s[14]=I("div",null,null,-1)),C(_,{placement:"right"},{trigger:w(()=>[C(N,{text:"",onClick:s[0]||(s[0]=p=>v.value=!i(v))},{icon:w(()=>[C(y,{size:"24"},{default:w(()=>[C(m,{name:"search-list"})]),_:1})]),_:1})]),default:w(()=>[s[10]||(s[10]=ee(" 搜索面板 "))]),_:1}),C(_,{placement:"right"},{trigger:w(()=>[C(N,{onClick:s[1]||(s[1]=p=>b.value=!i(b)),text:""},{icon:w(()=>[C(y,{size:"24"},{default:w(()=>[C(m,{name:"prop"})]),_:1})]),_:1})]),default:w(()=>[s[11]||(s[11]=ee(" 属性面板 "))]),_:1}),C(_,{placement:"right"},{trigger:w(()=>[C(N,{onClick:s[2]||(s[2]=p=>c.value=!i(c)),text:""},{icon:w(()=>[C(y,{size:"24"},{default:w(()=>[C(m,{name:"test"})]),_:1})]),_:1})]),default:w(()=>[s[12]||(s[12]=ee(" 测试规则 "))]),_:1}),s[15]||(s[15]=I("div",null,null,-1)),C(_,{placement:"right"},{trigger:w(()=>[I("a",ii,[C(N,{text:""},{icon:w(()=>[C(y,{size:"24"},{default:w(()=>[C(m,{name:"warn"})]),_:1})]),_:1})])]),default:w(()=>[s[13]||(s[13]=ee(" 分享须知 "))]),_:1})]),C(Wl),C(oi,{class:"flex-1"})]),C(Jl,{show:i(v),onUpdateShow:s[3]||(s[3]=p=>v.value=p)},null,8,["show"]),C(Ll,{show:i(c),onUpdateShow:s[4]||(s[4]=p=>c.value=p)},null,8,["show"]),C(Rl,{show:i(b),onUpdateShow:s[5]||(s[5]=p=>b.value=p)},null,8,["show"]),C(Pl),C(xl,{show:i(f),onUpdateShow:s[6]||(s[6]=p=>f.value=p),data:i(d),onUpdateData:s[7]||(s[7]=p=>d.value=p)},null,8,["show","data"])],64)):!i(r)&&!i(h)?(z(),te("div",ai,s[16]||(s[16]=[I("div",null,"快照数据缺失",-1)]))):de("",!0)}}});export{bi as default};
273
+ //# sourceMappingURL=SnapshotPage-iPtU2buw.js.map