hzzt-kfb-slide 1.0.21 → 1.0.22

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 (113) hide show
  1. package/dist/components/{annotateD6iDpO7f.js → annotate-IT4ma9W.js} +1 -1
  2. package/dist/components/{annotateCnpFlB7l.js → annotate0hFGZRyO.js} +1 -1
  3. package/dist/components/{annotateS9m_7F_t.js → annotateC1yTzBhy.js} +1 -1
  4. package/dist/components/{annotateDcVXJrRC.js → annotateDyOQXeyQ.js} +3 -3
  5. package/dist/components/{arrowBLK7t0VD.js → arrowC0rDp8Bn.js} +1 -1
  6. package/dist/components/{arrowCircleCsL3Zm90.js → arrowCircleLErHJnS7.js} +1 -1
  7. package/dist/components/{arrowCircleDZAzyMrh.js → arrowCircleqR7pFNMI.js} +1 -1
  8. package/dist/components/{arrowDIoD5hwi.js → arrowDN6X3CJX.js} +1 -1
  9. package/dist/components/{arrowDownPZKOLUgK.js → arrowDowncuLVZOji.js} +1 -1
  10. package/dist/components/{arrowDownBYGkm1jY.js → arrowDowniSogtTaN.js} +1 -1
  11. package/dist/components/{arrowLeftDrzMmH78.js → arrowLeftBXLiQ8FW.js} +1 -1
  12. package/dist/components/{arrowLeft4tXIB3LW.js → arrowLeftvM5bdaAK.js} +1 -1
  13. package/dist/components/{arrowRightDylomche.js → arrowRightBLFRu3SA.js} +1 -1
  14. package/dist/components/{arrowRightBuyDbO_G.js → arrowRightojbRUNEH.js} +1 -1
  15. package/dist/components/{arrowUpByK5cnFA.js → arrowUpCoMSTGNO.js} +1 -1
  16. package/dist/components/{arrowUpDfS53des.js → arrowUpz1vIVOSV.js} +1 -1
  17. package/dist/components/{bilateralXZdekUUl.js → bilateralCg-gx7jD.js} +1 -1
  18. package/dist/components/{bilateralVwNc0Md7.js → bilateralJ-hw3tXI.js} +1 -1
  19. package/dist/components/{channelEMKDDh6Y.js → channelCm6YJ8fh.js} +1 -1
  20. package/dist/components/{channelCqYZgNjT.js → channelDFlzOldb.js} +1 -1
  21. package/dist/components/{checkB2ka5Rvj.js → check8fd4j5YV.js} +1 -1
  22. package/dist/components/{checkCQyihNov.js → checkiLB_s1QS.js} +1 -1
  23. package/dist/components/{configB3o5JhZB.js → configDwwIRx42.js} +1 -1
  24. package/dist/components/{configBXX7OsBg.js → configmsBpDpDj.js} +1 -1
  25. package/dist/components/{customU1g0C3oa.js → custom455bHAkw.js} +1 -1
  26. package/dist/components/{customiCFpF8Iu.js → customCb9i20VS.js} +1 -1
  27. package/dist/components/{deleteBiWQF7Vc.js → deleteChcerUv3.js} +1 -1
  28. package/dist/components/{deleteBrANmTTw.js → deleteD561Tark.js} +1 -1
  29. package/dist/components/{dotCMMhOOTW.js → dotB8ubA13y.js} +1 -1
  30. package/dist/components/{dotFQ8rH5rz.js → dotBqfaYLre.js} +4 -4
  31. package/dist/components/{dotCjaHTvme.js → dotDJBi2ADD.js} +1 -1
  32. package/dist/components/{dotk8dz87xn.js → dotDzoUAyX9.js} +1 -1
  33. package/dist/components/{dotDRiHDpuw.js → dotE56kIgc8.js} +1 -1
  34. package/dist/components/{dotC9jetQq2.js → dotlk0WPNKU.js} +1 -1
  35. package/dist/components/{downloadB8Niyy0n.js → downloadBLKD66pn.js} +1 -1
  36. package/dist/components/{downloadBr2LFWrC.js → downloadC_Xd3PLe.js} +3 -3
  37. package/dist/components/{downloadDRon7MZm.js → downloadD40shkLT.js} +1 -1
  38. package/dist/components/{downloadB4im9Upm.js → downloadDmGV-MAM.js} +1 -1
  39. package/dist/components/{ellipseDq3cWSCR.js → ellipseBTYmSj5x.js} +1 -1
  40. package/dist/components/{ellipseB44Nxbvs.js → ellipseDVq_hwAq.js} +1 -1
  41. package/dist/components/{expandLeftDYwT6cWU.js → expandLeftCQhxJIQq.js} +1 -1
  42. package/dist/components/{expandLeftHydSM9I8.js → expandLeftCUpxNXf0.js} +1 -1
  43. package/dist/components/{expandRightBkJGFUn8.js → expandRightD8RhZ8Tp.js} +1 -1
  44. package/dist/components/{expandRightB0o_qftH.js → expandRightDLstOwkZ.js} +1 -1
  45. package/dist/components/{flagC2vvXfFF.js → flagBMOuB16r.js} +1 -1
  46. package/dist/components/{flagem1I0mtm.js → flagkUQIenjH.js} +1 -1
  47. package/dist/components/{flipg8wC3G4c.js → flipCRGM9pTK.js} +1 -1
  48. package/dist/components/{flipDhhbDPtH.js → flipIHCjVvHg.js} +1 -1
  49. package/dist/components/{fontBFr03tyR.js → fontC-gK2Yad.js} +1 -1
  50. package/dist/components/{fontBqBTMpbk.js → fontChUgJQO3.js} +1 -1
  51. package/dist/components/{fullscreenDh2GPwvi.js → fullscreenBEU5VXHD.js} +2 -2
  52. package/dist/components/{fullscreenDNjPXieL.js → fullscreenBUkJSH3j.js} +1 -1
  53. package/dist/components/{fullscreenC-D2FWP0.js → fullscreenL2HMOFVZ.js} +1 -1
  54. package/dist/components/{fullscreenZRiW7ADA.js → fullscreenqDTPIYPP.js} +1 -1
  55. package/dist/components/{fulltailorKQAWkx12.js → fulltailorB424scXz.js} +1 -1
  56. package/dist/components/{fulltailorGkgjt3NS.js → fulltailorCbEqI7R8.js} +1 -1
  57. package/dist/components/indexCQHd1FAC.js +4 -0
  58. package/dist/components/{indexBt-hoAPX.js → indexDE_LMsPG.js} +1762 -1735
  59. package/dist/components/{infoCEoYs9tl.js → infoBvPiq61g.js} +1 -1
  60. package/dist/components/{infoC6LJqUo4.js → infoCGmyOcOl.js} +1 -1
  61. package/dist/components/{levelC7dSBXiF.js → levelBUpIUK5R.js} +1 -1
  62. package/dist/components/{levelCpxuxE75.js → levelsPbu_aDy.js} +1 -1
  63. package/dist/components/{lineCLScyilQ.js → lineBb085Wuo.js} +1 -1
  64. package/dist/components/{lineCSiG-rgX.js → lineEiHYr-qs.js} +1 -1
  65. package/dist/components/{measureD5dd2m65.js → measureBsodKaVS.js} +1 -1
  66. package/dist/components/{measureMfshwA5D.js → measureDN1KzIos.js} +1 -1
  67. package/dist/components/{microscopeD6LeGX-I.js → microscopeCs7Ti2pQ.js} +1 -1
  68. package/dist/components/{microscopeKE1n-1VJ.js → microscopeDVmQgR_m.js} +1 -1
  69. package/dist/components/{microscopeDOR4ITmp.js → microscopeD_1Eu8IW.js} +1 -1
  70. package/dist/components/{microscopeBXDxbZQk.js → microscopeenu9uf2l.js} +3 -3
  71. package/dist/components/{moveDMTQN7MR.js → moveBCag_PK0.js} +1 -1
  72. package/dist/components/{moveB_UjIkjG.js → moveD2SnBSbf.js} +1 -1
  73. package/dist/components/{moveD6QC3XSH.js → moveDUJuGQyS.js} +1 -1
  74. package/dist/components/{moveDhB-bvPR.js → moveDUeyGXUi.js} +3 -3
  75. package/dist/components/{next_FHavUbD.js → nextD09Dhqqp.js} +1 -1
  76. package/dist/components/{nextBmwSx2_j.js → nextwXJnhlYU.js} +1 -1
  77. package/dist/components/{polygonD4sIeJsL.js → polygonBdSPdbXb.js} +1 -1
  78. package/dist/components/{polygonCrlqZ6Rg.js → polygongrxC-1FZ.js} +1 -1
  79. package/dist/components/{prevBLPvjPjZ.js → prevCdIvpDBg.js} +1 -1
  80. package/dist/components/{prevBAQ8fAS8.js → prevIhelcF7l.js} +1 -1
  81. package/dist/components/{processBa-REUiu.js → process-WFumM5a.js} +1 -1
  82. package/dist/components/{processCg3zvbbP.js → process7Z-azDGd.js} +3 -3
  83. package/dist/components/{processDkNDXOUw.js → processCWJZF9qk.js} +1 -1
  84. package/dist/components/{processL_p7JcxZ.js → processCxz8q0FG.js} +1 -1
  85. package/dist/components/{rectangle7nBuNG6m.js → rectangleBi7Jw0c-.js} +1 -1
  86. package/dist/components/{rectangleD8kKz7rC.js → rectangleBubwkDxz.js} +1 -1
  87. package/dist/components/{rotateCGfb57rP.js → rotate8AyDunPi.js} +1 -1
  88. package/dist/components/{rotateCHSOw1s1.js → rotateB03-xSK7.js} +1 -1
  89. package/dist/components/{rotateDdVyoRpL.js → rotateCXh_S2fN.js} +4 -4
  90. package/dist/components/{rotateCNC4_D0p.js → rotateUecgXkbX.js} +1 -1
  91. package/dist/components/{settingD8jduAuZ.js → settingBZncuaz7.js} +1 -1
  92. package/dist/components/{settingC6jzPy4x.js → settingBfFMNId3.js} +3 -3
  93. package/dist/components/{setting4mQSpijG.js → settingDiXPm899.js} +1 -1
  94. package/dist/components/{settingBHm__JEG.js → settinghG0VLKui.js} +1 -1
  95. package/dist/components/{starjty5rmfV.js → starCiKaBgEq.js} +1 -1
  96. package/dist/components/{starCevkgLLp.js → starblZzgeFe.js} +1 -1
  97. package/dist/components/{tailorDae0iTNE.js → tailorBGJMFw7P.js} +1 -1
  98. package/dist/components/{tailorDm6UVe3p.js → tailorDQwuVfga.js} +1 -1
  99. package/dist/components/{useCommon1IVEtxgB.js → useCommonCgPqOwwL.js} +1 -1
  100. package/dist/components/{useCommonBJEdoExC.js → useCommonziPgvd93.js} +1 -1
  101. package/dist/components/{voiceDNQTpuEE.js → voiceCSRO3GXx.js} +1 -1
  102. package/dist/components/{voiceUjxBlsqB.js → voiceDEwBTpL5.js} +1 -1
  103. package/dist/components/{zoomCQevD3FV.js → zoomCL5KW6rU.js} +1 -1
  104. package/dist/components/{zoomIn00fV4-DA.js → zoomInCCwpHJeV.js} +1 -1
  105. package/dist/components/{zoomInB43tFyCf.js → zoomInDJRQmjC_.js} +1 -1
  106. package/dist/components/{zoomOutBQ0kfk_c.js → zoomOutDkpcuy7N.js} +1 -1
  107. package/dist/components/{zoomOutD2EOybys.js → zoomOutUktkRJ3h.js} +1 -1
  108. package/dist/components/{zoomBIixAFT8.js → zoomSkaQ-9HR.js} +1 -1
  109. package/dist/index.cjs.js +1 -1
  110. package/dist/index.css +1 -1
  111. package/dist/index.es.js +1 -1
  112. package/package.json +1 -1
  113. package/dist/components/indexCQfbU-rB.js +0 -4
@@ -0,0 +1,4 @@
1
+ "use strict";var bn=Object.defineProperty,En=Object.defineProperties;var xn=Object.getOwnPropertyDescriptors;var Bt=Object.getOwnPropertySymbols;var Nn=Object.prototype.hasOwnProperty,zn=Object.prototype.propertyIsEnumerable;var Be=Math.pow,$t=(n,o,t)=>o in n?bn(n,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[o]=t,J=(n,o)=>{for(var t in o||(o={}))Nn.call(o,t)&&$t(n,t,o[t]);if(Bt)for(var t of Bt(o))zn.call(o,t)&&$t(n,t,o[t]);return n},se=(n,o)=>En(n,xn(o));var ge=(n,o,t)=>new Promise((l,c)=>{var s=_=>{try{p(t.next(_))}catch(m){c(m)}},u=_=>{try{p(t.throw(_))}catch(m){c(m)}},p=_=>_.done?l(_.value):Promise.resolve(_.value).then(s,u);p((t=t.apply(n,o)).next())});const e=require("vue"),b=require("element-plus"),be=require("@vueuse/core"),ne=require("kfb-view"),Dt=require("dayjs"),Sn=require("v-lazy-image"),ut=Symbol("I18N_INJECT_KEY");function me(){const n=e.inject(ut),o=t=>t;return{locale:n==null?void 0:n.locale,t:(n==null?void 0:n.t)||o}}const Tn={install(n,o){n.provide(ut,o==null?void 0:o.global)}},ee=e.ref({annotate:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./annotateC1yTzBhy.js")))),arrowCircle:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./arrowCircleLErHJnS7.js")))),check:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./check8fd4j5YV.js")))),dot:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./dotDzoUAyX9.js")))),flip:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./flipCRGM9pTK.js")))),info:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./infoCGmyOcOl.js")))),microscope:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./microscopeD_1Eu8IW.js")))),move:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./moveDUJuGQyS.js")))),next:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./nextwXJnhlYU.js")))),prev:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./prevCdIvpDBg.js")))),process:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./processCxz8q0FG.js")))),rotate:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./rotateUecgXkbX.js")))),fullscreen:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./fullscreenBUkJSH3j.js")))),setting:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./settingBZncuaz7.js")))),tailor:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./tailorBGJMFw7P.js")))),fulltailor:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./fulltailorCbEqI7R8.js")))),download:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./downloadDmGV-MAM.js")))),config:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./configmsBpDpDj.js")))),arrowDown:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./arrowDowniSogtTaN.js")))),arrowUp:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./arrowUpCoMSTGNO.js")))),arrowLeft:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./arrowLeftvM5bdaAK.js")))),arrowRight:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./arrowRightojbRUNEH.js")))),zoomIn:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./zoomInCCwpHJeV.js")))),zoomOut:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./zoomOutUktkRJ3h.js")))),level:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./levelsPbu_aDy.js")))),channel:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./channelDFlzOldb.js")))),delete:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./deleteD561Tark.js")))),expandLeft:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./expandLeftCQhxJIQq.js")))),expandRight:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./expandRightDLstOwkZ.js")))),markMeasure:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./measureBsodKaVS.js")))),markLine:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./lineBb085Wuo.js")))),markArrow:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./arrowDN6X3CJX.js")))),markBilateral:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./bilateralCg-gx7jD.js")))),markRectangle:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./rectangleBi7Jw0c-.js")))),markEllipse:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./ellipseDVq_hwAq.js")))),markPolygon:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./polygonBdSPdbXb.js")))),markFlag:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./flagBMOuB16r.js")))),markStar:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./starblZzgeFe.js")))),markDot:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./dotB8ubA13y.js")))),markFont:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./fontC-gK2Yad.js")))),markVoice:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./voiceDEwBTpL5.js"))))}),le=e.defineComponent({__name:"KfbIcon",props:{name:{type:[String,Number],required:!0},component:{type:Object,required:!1}},setup(n){return(o,t)=>(e.openBlock(),e.createBlock(e.unref(b.ElIcon),e.normalizeProps(e.guardReactiveProps(o.$attrs)),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.component||e.unref(ee)[n.name])))]),_:1},16))}}),Bn={class:"hzzt-kfb-tool-config"},$n={class:"tabs-item-box"},Dn={class:"hzzt-kfb-tool-config__block flex align-items-center"},Ln={class:"hzzt-kfb-tool-config__icon flex align-items-center justify-content-center"},Mn={class:"margin-l-4 flex-1"},Pn={class:"tabs-item-box",style:{"padding-left":"32px"}},In={class:"flex align-items-center"},Rn={class:"margin-t-2 margin-b-2",style:{width:"150px"}},An={class:"flex align-items-center"},Fn={class:"margin-t-2 margin-b-2",style:{width:"150px"}},Hn={class:"flex align-items-center"},Un={class:"margin-t-2 margin-b-2",style:{width:"150px"}},jn={class:"flex align-items-center"},On={class:"margin-t-2 margin-b-2",style:{width:"150px"}},qn={class:"flex align-items-center"},Kn={class:"margin-t-2 margin-b-2",style:{width:"150px"}},Wn={class:"flex align-items-center"},Gn={class:"margin-t-2 margin-b-2",style:{width:"150px"}},Yn={class:"flex align-items-center"},Zn={class:"margin-t-2 margin-b-2",style:{width:"150px"}},Xn={class:"flex align-items-center"},Jn={class:"margin-t-2 margin-b-2",style:{width:"150px"}},Qn={class:"flex align-items-center"},eo={class:"margin-t-2 margin-b-2",style:{width:"150px"}},to={class:"margin-l-2",style:{"font-size":"12px",color:"var(--el-text-color-secondary)"}},no={class:"flex align-items-center"},oo={class:"margin-t-2 margin-b-2",style:{width:"150px"}},lo=e.defineComponent({name:"KfbToolConfig",__name:"KfbToolConfig",props:{menus:{default:()=>[]},menusModifiers:{}},emits:["update:menus"],setup(n){const o=e.useModel(n,"menus"),{t}=me(),l=e.computed(()=>o.value.filter(v=>v.name!=="line"&&v.name!=="config"&&v.name!=="zoom"&&v.props.name!=="config")),c=e.ref("operate"),s=(v,g)=>{console.log(v,g)},u={fullscreen:t("全屏"),next:t("上一张"),prev:t("上一张"),flip:t("镜像翻转"),setting:t("工具"),rotate:t("旋转"),dot:t("打点"),annotate:t("标注"),tailor:t("区域截图"),fulltailor:t("全屏截图"),process:t("图像处理"),microscope:t("镜下"),move:t("快速移动"),info:t("信息"),download:t("下载")},p=e.inject("show-keyboard",e.ref(!1)),_=e.inject("show-watermark",e.ref(!1)),m=e.inject("show-menu-text",e.ref(!0)),z=be.useStorage("default-open-ai",!1),r=e.inject("menu-config-other-setting",{screenshotLocally:!1,screenshotIncludeAnnotations:!0,screenshotFormat:"image/jpeg",screenshotWatermark:{time:!1,mac:!1,scale:!1,ratio:!1},screenshotSize:{w:200,h:200},labelDisplayDuration:15});function k(v){return v in u}function w(v){var g;return((g=v.props)==null?void 0:g.text)||(k(v.name)?u[v.name]:"")}return(v,g)=>(e.openBlock(),e.createElementBlock("div",Bn,[e.createVNode(e.unref(b.ElTabs),{modelValue:c.value,"onUpdate:modelValue":g[14]||(g[14]=d=>c.value=d),class:"demo-tabs",onTabClick:s},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElTabPane),{label:e.unref(t)("操作设置"),name:"operate"},{default:e.withCtx(()=>[e.createElementVNode("div",$n,[e.createVNode(e.unref(b.ElRow),{gutter:10},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,d=>(e.openBlock(),e.createBlock(e.unref(b.ElCol),{key:d.name,span:8},{default:e.withCtx(()=>{var f,a;return[e.createElementVNode("div",Dn,[e.createElementVNode("div",Ln,[(f=d.props)!=null&&f.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent((a=d.props)==null?void 0:a.component),{key:1,size:24})):(e.openBlock(),e.createBlock(le,{key:0,size:24,name:d.name},null,8,["name"]))]),e.createElementVNode("p",Mn,e.toDisplayString(w(d)),1),e.createVNode(e.unref(b.ElSwitch),{modelValue:d.show,"onUpdate:modelValue":i=>d.show=i,"active-text":"","inactive-text":""},null,8,["modelValue","onUpdate:modelValue"])])]}),_:2},1024))),128))]),_:1})])]),_:1},8,["label"]),e.createVNode(e.unref(b.ElTabPane),{label:e.unref(t)("其他设置"),name:"other"},{default:e.withCtx(()=>[e.createElementVNode("div",Pn,[e.createVNode(e.unref(b.ElRow),{gutter:10},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElCol),{span:11},{default:e.withCtx(()=>[e.createElementVNode("div",In,[e.createElementVNode("p",Rn,e.toDisplayString(e.unref(t)("工具列表显示切换"))+": ",1),e.createVNode(e.unref(b.ElSwitch),{modelValue:e.unref(m),"onUpdate:modelValue":g[0]||(g[0]=d=>e.isRef(m)?m.value=d:null),"inactive-text":e.unref(t)("隐藏"),"active-text":e.unref(t)("显示"),class:"margin-r-2"},null,8,["modelValue","inactive-text","active-text"])])]),_:1}),e.createVNode(e.unref(b.ElCol),{span:11},{default:e.withCtx(()=>[e.createElementVNode("div",An,[e.createElementVNode("p",Fn,e.toDisplayString(e.unref(t)("小键盘显示切换"))+": ",1),e.createVNode(e.unref(b.ElSwitch),{modelValue:e.unref(p),"onUpdate:modelValue":g[1]||(g[1]=d=>e.isRef(p)?p.value=d:null),"inactive-text":e.unref(t)("隐藏"),"active-text":e.unref(t)("显示"),class:"margin-r-2"},null,8,["modelValue","inactive-text","active-text"])])]),_:1})]),_:1}),e.createVNode(e.unref(b.ElRow),{gutter:10},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElCol),{span:11},{default:e.withCtx(()=>[e.createElementVNode("div",Hn,[e.createElementVNode("p",Un,e.toDisplayString(e.unref(t)("默认开启AI分析"))+": ",1),e.createVNode(e.unref(b.ElSwitch),{modelValue:e.unref(z),"onUpdate:modelValue":g[2]||(g[2]=d=>e.isRef(z)?z.value=d:null),"inactive-text":e.unref(t)("禁用"),"active-text":e.unref(t)("启用"),class:"margin-r-2"},null,8,["modelValue","inactive-text","active-text"])])]),_:1}),e.createVNode(e.unref(b.ElCol),{span:11},{default:e.withCtx(()=>[e.createElementVNode("div",jn,[e.createElementVNode("p",On,e.toDisplayString(e.unref(t)("水印文字"))+": ",1),e.createVNode(e.unref(b.ElSwitch),{modelValue:e.unref(_),"onUpdate:modelValue":g[3]||(g[3]=d=>e.isRef(_)?_.value=d:null),"inactive-text":e.unref(t)("禁用"),"active-text":e.unref(t)("启用"),class:"margin-r-2"},null,8,["modelValue","inactive-text","active-text"])])]),_:1})]),_:1}),e.createVNode(e.unref(b.ElRow),{gutter:10},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElCol),{span:11},{default:e.withCtx(()=>[e.createElementVNode("div",qn,[e.createElementVNode("p",Kn,e.toDisplayString(e.unref(t)("截图本地下载"))+": ",1),e.createVNode(e.unref(b.ElSwitch),{modelValue:e.unref(r).screenshotLocally,"onUpdate:modelValue":g[4]||(g[4]=d=>e.unref(r).screenshotLocally=d),"inactive-text":e.unref(t)("禁用"),"active-text":e.unref(t)("启用"),class:"margin-r-2"},null,8,["modelValue","inactive-text","active-text"])])]),_:1}),e.createVNode(e.unref(b.ElCol),{span:11},{default:e.withCtx(()=>[e.createElementVNode("div",Wn,[e.createElementVNode("p",Gn,e.toDisplayString(e.unref(t)("截图包含标注"))+": ",1),e.createVNode(e.unref(b.ElSwitch),{modelValue:e.unref(r).screenshotIncludeAnnotations,"onUpdate:modelValue":g[5]||(g[5]=d=>e.unref(r).screenshotIncludeAnnotations=d),"inactive-text":e.unref(t)("否"),"active-text":e.unref(t)("是"),class:"margin-r-2"},null,8,["modelValue","inactive-text","active-text"])])]),_:1})]),_:1}),e.createVNode(e.unref(b.ElRow),{gutter:10},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElCol),{span:11},{default:e.withCtx(()=>[e.createElementVNode("div",Yn,[e.createElementVNode("p",Zn,e.toDisplayString(e.unref(t)("下载图片格式设置"))+": ",1),e.createVNode(e.unref(b.ElRadioGroup),{modelValue:e.unref(r).screenshotFormat,"onUpdate:modelValue":g[6]||(g[6]=d=>e.unref(r).screenshotFormat=d)},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElRadio),{value:"image/png"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("PNG")),1)]),_:1}),e.createVNode(e.unref(b.ElRadio),{value:"image/jpeg"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("JPG")),1)]),_:1})]),_:1},8,["modelValue"])])]),_:1})]),_:1}),e.createVNode(e.unref(b.ElRow),{gutter:10},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElCol),{span:20},{default:e.withCtx(()=>[e.createElementVNode("div",Xn,[e.createElementVNode("p",Jn,e.toDisplayString(e.unref(t)("截图水印"))+": ",1),e.createVNode(e.unref(b.ElCheckbox),{modelValue:e.unref(r).screenshotWatermark.time,"onUpdate:modelValue":g[7]||(g[7]=d=>e.unref(r).screenshotWatermark.time=d)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("时间")),1)]),_:1},8,["modelValue"]),e.createVNode(e.unref(b.ElCheckbox),{modelValue:e.unref(r).screenshotWatermark.mac,"onUpdate:modelValue":g[8]||(g[8]=d=>e.unref(r).screenshotWatermark.mac=d)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("设备编码")),1)]),_:1},8,["modelValue"]),e.createVNode(e.unref(b.ElCheckbox),{modelValue:e.unref(r).screenshotWatermark.scale,"onUpdate:modelValue":g[9]||(g[9]=d=>e.unref(r).screenshotWatermark.scale=d)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("放大倍数")),1)]),_:1},8,["modelValue"]),e.createVNode(e.unref(b.ElCheckbox),{modelValue:e.unref(r).screenshotWatermark.ratio,"onUpdate:modelValue":g[10]||(g[10]=d=>e.unref(r).screenshotWatermark.ratio=d)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("比例尺")),1)]),_:1},8,["modelValue"])])]),_:1})]),_:1}),e.createVNode(e.unref(b.ElRow),{gutter:10},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElCol),{span:20},{default:e.withCtx(()=>[e.createElementVNode("div",Qn,[e.createElementVNode("p",eo,e.toDisplayString(e.unref(t)("标签显示时间"))+": ",1),e.createVNode(e.unref(b.ElInput),{type:"number",modelValue:e.unref(r).labelDisplayDuration,"onUpdate:modelValue":g[11]||(g[11]=d=>e.unref(r).labelDisplayDuration=d),modelModifiers:{number:!0},min:0,style:{width:"150px"}},{append:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("秒")),1)]),_:1},8,["modelValue"]),e.createElementVNode("span",to,e.toDisplayString(e.unref(t)("0表示不自动关闭")),1)])]),_:1})]),_:1}),e.createVNode(e.unref(b.ElRow),{gutter:10},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElCol),{span:20},{default:e.withCtx(()=>[e.createElementVNode("div",no,[e.createElementVNode("p",oo,e.toDisplayString(e.unref(t)("截图初始化大小"))+": ",1),e.createElementVNode("div",null,[e.createVNode(e.unref(b.ElInput),{type:"number",modelValue:e.unref(r).screenshotSize.w,"onUpdate:modelValue":g[12]||(g[12]=d=>e.unref(r).screenshotSize.w=d),style:{width:"150px"}},{prepend:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("宽")),1)]),_:1},8,["modelValue"]),e.createVNode(e.unref(b.ElInput),{type:"number",modelValue:e.unref(r).screenshotSize.h,"onUpdate:modelValue":g[13]||(g[13]=d=>e.unref(r).screenshotSize.h=d),style:{width:"150px","margin-left":"24px"}},{prepend:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("高")),1)]),_:1},8,["modelValue"])])])]),_:1})]),_:1})])]),_:1},8,["label"])]),_:1},8,["modelValue"])]))}}),ao={class:"hzzt-kfb-toolbox"},ro={class:"hzzt-kfb-toolbox__component"},Le=e.defineComponent({name:"KfbToolbox",__name:"KfbToolbox",props:{menu:{},process:{},microscope:{},divideMode:{type:Boolean}},emits:["tool"],setup(n,{emit:o}){const t=n,l=o,{t:c}=me(),s={prev:c("上一张"),next:c("下一张"),config:c("配置"),info:c("信息"),flip:c("镜像"),tailor:c("区域截图"),fulltailor:c("全屏截图")},u=e.inject("kfbViewRef"),p=e.ref(!1),_=e.ref([]),m={fullscreen:e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./fullscreenqDTPIYPP.js"))),line:e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./linej48TZYKp.js"))),setting:e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./settinghG0VLKui.js"))),rotate:e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./rotateB03-xSK7.js"))),dot:e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./dotlk0WPNKU.js"))),annotate:e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./annotate0hFGZRyO.js"))),process:e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./processCWJZF9qk.js"))),microscope:e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./microscopeDVmQgR_m.js"))),move:e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./moveBCag_PK0.js"))),custom:e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./customCb9i20VS.js"))),zoom:e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./zoomCL5KW6rU.js"))),download:e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./downloadBLKD66pn.js")))},z=e.computed(()=>_.value.filter(w=>w.show!==!1).map(w=>({component:m[w.name],props:w.props,slots:w.slots})));e.watch(()=>[t.menu],([w])=>{_.value=r(w)},{immediate:!0});function r(w){return w.map(v=>{var d,f;const g=typeof v=="string"?v:v.name;return s[g]?{name:"custom",show:typeof v=="string"?!0:v.show!==!1,props:se(J({text:s[g],component:e.h(le,{name:g})},typeof v=="string"?{}:v.props),{name:g})}:g=="custom"&&!s[g]&&typeof v!="string"?{name:"custom",show:typeof v=="string"?!0:v.show!==!1,props:se(J({},typeof v=="string"?{}:v.props),{component:e.h(le,{name:(d=v.props)==null?void 0:d.name,component:(f=v.props)==null?void 0:f.component})}),slots:typeof v=="string"?void 0:v.slots}:g==="process"?{name:g,props:typeof v=="string"?{process:t.process}:J({process:t.process},v.props),slots:typeof v=="string"?void 0:v.slots,show:typeof v=="string"?!0:v.show!==!1}:g==="microscope"?{name:g,props:typeof v=="string"?{process:t.process}:J({microscope:t.microscope},v.props),slots:typeof v=="string"?void 0:v.slots,show:typeof v=="string"?!0:v.show!==!1}:{name:g,props:typeof v=="string"?{}:v.props,slots:typeof v=="string"?void 0:v.slots,show:typeof v=="string"?!0:v.show!==!1}})}function k(w,v){const g={annotate:()=>u.value.startDraw(v),process:()=>u.value.forceRedraw(v),microscope:()=>u.value.scopeChange(v),move:()=>u.value.fastMove(v),endDraw:()=>u.value.endDraw(),info:()=>u.value.info(),zoom:()=>u.value.zoomTo(v),flip:()=>u.value.toggleFlip(v),config:()=>p.value=!0,grid:()=>u.value.updateGrid(v),ruler:()=>u.value.updateGrid(v),graduation:()=>u.value.updateGraduation(v),navigator:()=>u.value.updateNavigator(v),tool:()=>{u.value.updateGrid({show:v}),u.value.updateGraduation({show:v}),u.value.updateGrid({ruler:v}),u.value.updateNavigator(v)}};g[w]?g[w]():l("tool",w,v)}return(w,v)=>(e.openBlock(),e.createElementBlock("div",ao,[e.renderSlot(w.$slots,"left"),e.createElementVNode("div",ro,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.value,(g,d)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g.component),e.mergeProps({ref_for:!0},g.props,{key:d,onTool:k}),{default:e.withCtx(()=>[g.slots?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(g.slots,f=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f)))),256)):e.createCommentVNode("",!0)]),_:2},1040))),128))]),e.renderSlot(w.$slots,"right"),e.createVNode(e.unref(b.ElDialog),{modelValue:p.value,"onUpdate:modelValue":v[1]||(v[1]=g=>p.value=g),top:"5vh",width:"800px",title:e.unref(c)("用户偏好配置")},{default:e.withCtx(()=>[e.createVNode(lo,{menus:_.value,"onUpdate:menus":v[0]||(v[0]=g=>_.value=g)},null,8,["menus"])]),_:1},8,["modelValue","title"])]))}}),Ve="data:image/svg+xml,%3csvg%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%3e%3cpath%20d='M556.45%20126.8H904.7c31.31%200%2056.26%2025.47%2057.3%2056.78v656.85c-0.68%2031.26-26.03%2056.35-57.3%2056.72H617.28l74.32-291.24-77.38-56.14%2032.3-27.32c8.28-6.66%2015.51-11.46%2025.7-11.46%209.96%200.24%2019.33%204.77%2025.7%2012.45h-0.06l198.87%20214.09-0.58-522.46c-0.75-13.7-12.21-24.35-25.93-24.08H542.45l14-64.19z%20m-118.47%200l-14.01%2064.24H152.41c-13.6%200-24.31%209.84-26.22%2023.44v522.63l242.33-292.28-13.08%2060.14%20204.6%20148.46-62.22%20243.77H118.15a56.398%2056.398%200%200%201-39.86-16.73A56.35%2056.35%200%200%201%2062%20840.43V183.57c0-31.25%2024.89-56.72%2056.14-56.72h319.83v-0.05z%20m203.67%20224.68c-0.86-34.98%2017.31-67.68%2047.47-85.42%2030.16-17.74%2067.56-17.74%2097.73%200%2030.16%2017.74%2048.33%2050.44%2047.47%2085.42%200%2053.22-43.15%2096.37-96.37%2096.37-53.22%200-96.37-43.14-96.37-96.37h0.07z%20m0%200'%20fill='%23ffffff'%3e%3c/path%3e%3c/svg%3e",Ue={shape:"50%",width:.3,color:"#FA0404",borderWidth:5},ct={r:0,g:0,b:0,c:0,s:0,l:0,ga:1};function io(n){const o=e.reactive(J(J({},ct),n.process));e.watch(()=>n.process,s=>{c(s)});const t=e.computed(()=>{const s=[1+o.r+o.l+.5*o.c,0,0,0,-.25*o.c],u=[0,1+o.g+o.l+.5*o.c,0,0,-.25*o.c],p=[0,0,1+o.b+o.l+.5*o.c,0,-.25*o.c],_=[0,0,0,1,0];return`${s.join(" ")}
2
+ ${u.join(" ")}
3
+ ${p.join(" ")}
4
+ ${_.join(" ")}`}),l=e.computed(()=>String(1+o.s));function c(s){s&&Object.assign(o,s)}return{imageProcess:o,matrixValues:t,saturateValues:l,forceRedraw:c}}function so(n,o,t,l,c,s){const u=e.inject("menu-config-other-setting",{screenshotLocally:!1,screenshotIncludeAnnotations:!0,screenshotFormat:"image/jpeg",screenshotWatermark:{time:!1,mac:!1,scale:!1,ratio:!1},screenshotSize:{w:200,h:200},labelDisplayDuration:15});function p(){t.value.$on(ne.KfbView.events.EVENT_TAILORING_SCREENSHOT,_)}function _({base64:f}){const a=Dt().format("YYYY_MM_DD_hh_mm_ss"),i=new Image;i.src=f,i.onload=()=>{const E=document.createElement("canvas"),B=E.getContext("2d");E.width=i.width,E.height=i.height,B&&(B.drawImage(i,0,0,i.width,i.height),d(B,E,a));const P=E.toDataURL(u.screenshotFormat);u.screenshotLocally&&v(P,w()),n("tool","screen-shot",{imgUrl:P,timeStr:a,format:u.screenshotFormat})}}function m(f,a){var W,R;const i=window.devicePixelRatio||1,{width:E,height:B}=t.value.$options,P=E>B?(E-B)/2:0,L=E>B?0:(B-E)/2,H=E>B?B:E;if(f==="fulltailor"&&!a.value)t.value.tailoring.init({left:P,top:L,height:H,width:H,now:!0,shape:(W=u.screenshotIncludeAnnotations)!=null?W:!0});else if(f==="fulltailor"&&a.value.length>1){const Y=[];a.value.forEach(y=>{const C=document.createElement("canvas");C.width=H,C.height=H;const D=C.getContext("2d");D&&(D.fillStyle="#FFFFFF",D.fillRect(0,0,C.width,C.height));const V=y.kfbView.viewer.drawer.canvas;D==null||D.drawImage(V,P*i,L*i,H*i,H*i,0,0,H,H);const N=C.toDataURL();C.remove(),Y.push(N)});const j=document.createElement("canvas"),G=[],x=[];for(let y=0;y<Y.length;y++){const C=new Image;G.push(C);const D=new Promise((V,N)=>{C.onload=()=>{V()},C.onerror=N,C.src=Y[y]});x.push(D)}Promise.all(x).then(()=>{const y=G.length>4?3:2,C=z(G,y),D=H*y;j.width=D,j.height=D;const V=j.getContext("2d");V&&(V.fillStyle="#FFFFFF",V.fillRect(0,0,j.width,j.height));const N=G.length===2||G.length>=5&&G.length<=6,$=C.length*H,A=N?(j.height-$)/2:0;C.forEach((M,T)=>{M.forEach((F,O)=>{const ae=O*H,ke=A+T*H;V==null||V.drawImage(F,ae,ke,H,H)})});const U=Dt().format("YYYY_MM_DD_hh_mm_ss");V&&d(V,j,U);const Q=j.toDataURL(u.screenshotFormat);u.screenshotLocally&&v(Q,w()),n("tool","screen-shot",{imgUrl:Q,timeStr:U,format:u.screenshotFormat}),j.remove()})}else{const Y=Number(u.screenshotSize.w)/1,j=Number(u.screenshotSize.h)/1;t.value.tailoring.init({left:E/2-Y/2,top:B/2-j/2,height:j,width:Y,color:"#ff0000",contents:[o("双击区域内表示完成截图"),o("双击区域外或按ESC表示取消截图"),(G,x)=>`${o("区域大小为")}${G}*${x},${o("可拉动缩放")}`],shape:(R=u.screenshotIncludeAnnotations)!=null?R:!0})}}function z(f,a){const i=[];for(let E=0;E<f.length;E+=a)i.push(f.slice(E,E+a));return i}function r(f){const a=(f||"").toLowerCase();return a.includes("png")?"png":a.includes("webp")?"webp":a.includes("bmp")?"bmp":a.includes("gif")?"gif":"jpg"}function k(f){return String(f!=null?f:"").trim().replace(/[\\/:*?"<>|]/g,"_").replace(/\s+/g,"")}function w(){var B,P;const f=k((B=s.value)==null?void 0:B.pathology_number)||o("未知病理号"),a=k((P=s.value)==null?void 0:P.paraffin_block_number)||o("未知蜡块号"),i=`${l.value}x`,E=r(u.screenshotFormat);return`${f}-${a}-${i}.${E}`}function v(f,a){const i=document.createElement("a");i.href=f,i.download=a,i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(i.href)}function g(f){if(t.value.area){const a=t.value.area.imageToViewerElementCoordinates(0,0),i=t.value.area.imageToViewerElementCoordinates(f,0);return Math.abs(i.x-a.x)}return 0}function d(f,a,i){var E,B,P,L,H;if(f.font="16px Arial",f.fillStyle="rgba(0, 0, 0, 0.9)",f.textAlign="left",u.screenshotWatermark.mac){const W=(P=(B=(E=c.value)==null?void 0:E.ext)==null?void 0:B.machineNum)!=null?P:"未知设备号";f.fillText(W,5,15)}if(u.screenshotWatermark.time&&f.fillText(i,a.width-180,15),u.screenshotWatermark.scale&&f.fillText(`${l.value}x`,5,a.height-10),u.screenshotWatermark.ratio){const W=[.1,.4,.6,1,2,4,8,10,20,40,60,100,140,200],R=[5e3,2e3,1250,1e3,500,250,200,100,50,25,20,10,5,2],Y=W.findIndex($=>$>=l.value);let j=8,G="";~Y?(G=R[Y].toString(),j=g(R[Y]/(((H=c.value)==null?void 0:H.scanResolution)||1))):(G=R[R.length-1].toString(),j=g(R[R.length-1]/(((L=c.value)==null?void 0:L.scanResolution)||1))),f.beginPath();const x=a.width,y=a.height,C=x-10-j,D=y-24;f.beginPath(),f.strokeStyle="#000000",f.lineWidth=3,f.moveTo(C,D-8),f.lineTo(C,D),f.lineTo(C+j,D),f.lineTo(C+j,D-8),f.stroke(),f.beginPath(),f.fillStyle="#000000",f.font="bold 12px Arial";const V=parseFloat(G).toFixed(0)+"um",N=f.measureText(V).width;f.fillText(V,C+j/2-N/2,a.height-5)}}return{tailorEvent:p,shotScreen:m}}const uo=["onClick"],co=["src"],fo={key:2,style:{width:"18px"},class:"margin-r-3"},mo={key:1,class:"hzzt-kfb-sub-menu"},vo=["onClick"],po={class:"flex align-items-center"},ho=["src"],go={key:2,style:{width:"18px"},class:"margin-r-2"},wo=e.defineComponent({__name:"KfbMenu",props:{menus:{}},emits:["tool"],setup(n,{emit:o}){const t=e.ref({top:"0",left:"0",display:"none"}),l=e.inject("kfbView",e.ref({})),c=e.inject("currentLabel"),s=n,u=o,p=e.inject("is-count-drawing",void 0),_=e.inject("end-count-draw",void 0),{t:m}=me(),z=[{label:m("测量"),value:"Measure",icon:ee.value.markMeasure},{label:m("直线"),value:"line",icon:ee.value.markLine},{label:m("箭头"),value:"arrow",icon:ee.value.markArrow},{label:m("双箭头"),value:"bilateral",icon:ee.value.markBilateral},{label:m("矩形"),value:"rectangle",icon:ee.value.markRectangle},{label:m("圆形"),value:"ellipse",icon:ee.value.markEllipse},{label:m("曲线"),value:"polygon",icon:ee.value.markPolygon},{label:m("星星"),value:"star",icon:ee.value.markStar},{label:m("旗帜"),value:"flag",icon:ee.value.markFlag},{label:m("点"),value:"dot",icon:ee.value.markDot},{label:m("文字"),value:"font",icon:ee.value.markFont},{label:m("语音"),value:"voice",icon:ee.value.markVoice}],r=e.computed(()=>{var d;return c!=null&&c.value?[{label:m("删除"),value:"delete",icon:ee.value.delete}]:(d=s.menus)!=null&&d.length?s.menus.map(f=>f.value==="annotate"?se(J({},f),{children:z,icon:ee.value.annotate}):se(J({},f),{icon:f.icon||ee.value[f.value]})):[{label:m("上一张"),value:"prev",icon:ee.value.prev},{label:m("下一张"),value:"next",icon:ee.value.next},{label:m("标注"),value:"annotate",icon:ee.value.annotate,children:z},{label:m("区域截图"),value:"tailor",icon:ee.value.tailor},{label:m("全屏截图"),value:"fulltailor",icon:ee.value.fulltailor},{label:m("镜像翻转"),value:"flip",icon:ee.value.flip},{label:m("切片信息"),value:"info",icon:ee.value.info}]});e.watch(()=>l.value,(d,f)=>{f!=null&&f.viewer&&(f.viewer.removeHandler("canvas-contextmenu",k),f.viewer.removeHandler("canvas-click",w)),d!=null&&d.viewer&&(d.viewer.addHandler("canvas-contextmenu",k),d.viewer.addHandler("canvas-click",w))}),e.onMounted(()=>{var d;(d=l.value)!=null&&d.viewer&&(l.value.viewer.addHandler("canvas-contextmenu",k),l.value.viewer.addHandler("canvas-click",w)),document.body.addEventListener("click",w)}),e.onBeforeUnmount(()=>{var d;(d=l.value)!=null&&d.viewer&&(l.value.viewer.removeHandler("canvas-contextmenu",k),l.value.viewer.removeHandler("canvas-click",w)),document.body.removeEventListener("click",w)});function k(d){if(d.preventDefault=!0,p!=null&&p.value){_==null||_(),u("tool","count-draw-end"),w();return}t.value.top=`${d.position.y}px`,t.value.left=`${d.position.x}px`,t.value.display==="block"?t.value.display="none":t.value.display="block"}function w(){t.value.display="none"}function v(d,f){d.children||((f==null?void 0:f.value)==="annotate"?u("tool","annotate",{tool:d.value.substring(0,1).toLocaleUpperCase()+d.value.substring(1),once:!0}):u("tool",d.value),w())}function g(d){return d==null||typeof d!="object"&&typeof d!="function"?!1:typeof d=="function"||"render"in d||"setup"in d}return(d,f)=>(e.openBlock(),e.createElementBlock("div",{class:"hzzt-kfb-menu",style:e.normalizeStyle(t.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(a,i)=>(e.openBlock(),e.createElementBlock("div",{key:i,class:"hzzt-kfb-menu-item"},[e.createElementVNode("div",{class:"flex align-items-center",onClick:E=>v(a)},[g(a.icon)?(e.openBlock(),e.createBlock(e.unref(b.ElIcon),{key:0,class:"margin-r-3",size:18},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.icon)))]),_:2},1024)):a.icon?(e.openBlock(),e.createElementBlock("img",{key:1,style:{width:"18px"},class:"margin-r-2",src:a.icon},null,8,co)):(e.openBlock(),e.createElementBlock("div",fo)),e.createElementVNode("span",null,e.toDisplayString(a.label),1)],8,uo),a.children?(e.openBlock(),e.createBlock(le,{key:0,name:"arrowRight",class:"margin-r-2",size:14})):e.createCommentVNode("",!0),a.children?(e.openBlock(),e.createElementBlock("div",mo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.children,(E,B)=>(e.openBlock(),e.createElementBlock("div",{key:B,class:"hzzt-kfb-menu-item",onClick:P=>v(E,a)},[e.createElementVNode("div",po,[g(E.icon)?(e.openBlock(),e.createBlock(e.unref(b.ElIcon),{key:0,class:"margin-r-2",size:18},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(E.icon)))]),_:2},1024)):E.icon?(e.openBlock(),e.createElementBlock("img",{key:1,style:{width:"18px"},class:"margin-r-2",src:E.icon},null,8,ho)):(e.openBlock(),e.createElementBlock("div",go)),e.createElementVNode("span",null,e.toDisplayString(E.label),1)])],8,vo))),128))])):e.createCommentVNode("",!0)]))),128))],4))}}),ye=(n,o)=>{const t=n.__vccOpts||n;for(const[l,c]of o)t[l]=c;return t},yo=ye(wo,[["__scopeId","data-v-a80d92ce"]]),_o={key:0,class:"hzzt-kfb-microscope"},ko=e.defineComponent({__name:"KfbMicroscope",props:e.mergeDefaults({shape:{},width:{},color:{},borderWidth:{}},J({},Ue)),setup(n,{expose:o}){const t=n,l=e.reactive(J(J({},Ue),t));e.watch(()=>t,r=>{z({name:"change",value:r})});const c=e.ref("200px"),s=e.ref(!1),u=e.computed(()=>({borderRadius:l.shape,borderColor:l.color,borderWidth:l.borderWidth+"px",width:c.value,height:c.value})),p=e.inject("kfbView",e.ref({}));e.watch(()=>p.value,(r,k)=>{k!=null&&k.viewer&&k.viewer.removeHandler("zoom",_),r!=null&&r.viewer&&r.viewer.addHandler("zoom",_)}),e.onMounted(()=>{var r;(r=p.value)!=null&&r.viewer&&p.value.viewer.addHandler("zoom",_)}),e.onBeforeUnmount(()=>{var r;(r=p.value)!=null&&r.viewer&&p.value.viewer.removeHandler("zoom",_)});function _(){setTimeout(()=>{z({name:"change",value:l})},100)}function m(r){let{x:k,y:w}=p.value.viewer.viewport.getCenter(!0);r==="top"?w-=.006:r==="bottom"?w+=.006:r==="left"?k-=.006:r==="right"&&(k+=.006),p.value.area.moveToLabel({x:k,y:w})}function z({name:r,value:k}){var v,g;const w=(g=(v=p.value.$options)==null?void 0:v.pxConversion)==null?void 0:g.imageCapRes;if(r==="visible"){if(s.value=k,k){const d=p.value.area.imageToViewerElementRectangle({x:0,y:0,width:l.width*1e3/w,height:l.width*1e3/w});c.value=d.width+"px"}}else if(r==="change"){Object.assign(l,k);const d=p.value.area.imageToViewerElementRectangle({x:0,y:0,width:l.width*1e3/w,height:l.width*1e3/w});c.value=d.width+"px"}}return o({scopeChange:z}),(r,k)=>s.value?(e.openBlock(),e.createElementBlock("div",_o,[e.createElementVNode("div",{class:"hzzt-kfb-microscope__container",style:e.normalizeStyle(u.value)},null,4),e.createElementVNode("div",{class:"hzzt-kfb-microscope__top",onClick:k[0]||(k[0]=w=>m("top"))},[e.createVNode(le,{size:"24",name:"arrowUp"})]),e.createElementVNode("div",{class:"hzzt-kfb-microscope__bottom",onClick:k[1]||(k[1]=w=>m("bottom"))},[e.createVNode(le,{size:"24",name:"arrowDown"})]),e.createElementVNode("div",{class:"hzzt-kfb-microscope__left",onClick:k[2]||(k[2]=w=>m("left"))},[e.createVNode(le,{size:"24",name:"arrowLeft"})]),e.createElementVNode("div",{class:"hzzt-kfb-microscope__right",onClick:k[3]||(k[3]=w=>m("right"))},[e.createVNode(le,{size:"24",name:"arrowRight"})])])):e.createCommentVNode("",!0)}}),Co=ye(ko,[["__scopeId","data-v-cf5949b8"]]),Vo={class:"hzzt-kfb-label flex column"},bo={class:"hzzt-kfb-label__header"},Eo={class:"hzzt-kfb-label__hint"},xo=["src"],No=["src"],zo={class:"ellipsis flex-1"},So={class:"hzzt-kfb-label__dialog-imgs"},To={class:"hzzt-kfb-label__dialog-cell hzzt-kfb-label__dialog-cell--label"},Bo=["src"],$o={class:"hzzt-kfb-label__dialog-cell hzzt-kfb-label__dialog-cell--preview"},Do=["src"],Lo=e.defineComponent({__name:"KfbLabel",props:{visible:{type:Boolean},info:{},slide:{},pathologyHandle:{type:Function}},emits:["tool"],setup(n,{emit:o}){var f;const{t}=me(),l=n,c=o,s=e.ref((f=l.visible)!=null?f:!0),u=e.ref(!1),p=e.ref(!1);e.watch(()=>l.visible,a=>{a!==void 0&&(s.value=a)});const _=e.inject("menu-config-other-setting",{screenshotLocally:!1,screenshotIncludeAnnotations:!0,screenshotFormat:"image/jpeg",screenshotWatermark:{time:!1,mac:!1,scale:!1,ratio:!1},screenshotSize:{w:200,h:200},labelDisplayDuration:15});let m;function z(){m!==void 0&&(clearTimeout(m),m=void 0)}function r(){var i;z();const a=Number((i=_.labelDisplayDuration)!=null?i:15);!a||a<=0||!s.value||(m=setTimeout(()=>{s.value=!1,m=void 0},a*1e3))}e.watch(s,a=>{a?r():(z(),p.value=!1)},{immediate:!0}),e.watch(()=>_.labelDisplayDuration,()=>{s.value&&r()}),e.watch(()=>{var a;return(a=l.slide)==null?void 0:a.file},()=>{p.value=!1,s.value&&r()}),e.onUnmounted(z);const k=e.computed(()=>l.slide.pathology_id?t("修改病理号"):t("绑定病理号")),w=e.computed(()=>t(`点击标签旋转${l.pathologyHandle?",点击病理号重绑":""}`));function v(){l.slide.angle||(l.slide.angle=0),l.slide.angle+=90,l.slide.angle>360&&(l.slide.angle=l.slide.angle%360),c("tool","rotate",l.slide.angle)}function g(){u.value=!0}function d(){l.pathologyHandle&&l.pathologyHandle(l.slide).then(()=>{u.value=!1})}return(a,i)=>(e.openBlock(),e.createElementBlock("div",Vo,[e.withDirectives(e.createElementVNode("div",bo,[e.createVNode(e.unref(b.ElTooltip),{effect:"dark",placement:"right",content:w.value},{default:e.withCtx(()=>[e.createElementVNode("span",Eo,[e.createVNode(le,{size:"14",name:"info"})])]),_:1},8,["content"])],512),[[e.vShow,s.value]]),e.withDirectives(e.createElementVNode("div",{class:"hzzt-kfb-label__img flex justify-content-center align-items-center",onClick:v,onDblclick:i[0]||(i[0]=e.withModifiers(E=>p.value=!0,["stop"]))},[e.createElementVNode("img",{src:a.info.labelImg,style:e.normalizeStyle({transform:`rotate(${a.slide.angle}deg)`})},null,12,xo)],544),[[e.vShow,s.value]]),p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"hzzt-kfb-label__preview flex justify-content-center align-items-center",onClick:i[1]||(i[1]=e.withModifiers(E=>p.value=!1,["stop"]))},[e.createElementVNode("img",{src:a.info.labelImg,style:e.normalizeStyle({transform:`rotate(${a.slide.angle}deg)`})},null,12,No)])):e.createCommentVNode("",!0),a.pathologyHandle?e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:1,class:"hzzt-kfb-label__pathology flex align-items-center justify-content-between",onClick:g},[e.createElementVNode("span",zo,e.toDisplayString(a.slide.pathology_number),1),e.createVNode(le,{size:"14",name:"annotate"})],512)),[[e.vShow,s.value]]):e.createCommentVNode("",!0),e.createElementVNode("span",{onClick:i[2]||(i[2]=E=>s.value=!s.value),style:e.normalizeStyle({transform:`translateY(${s.value?"-50%":0})`}),class:"hzzt-kfb-label__expend flex align-items-center justify-content-center"},[s.value?(e.openBlock(),e.createBlock(le,{key:0,size:"10",name:"arrowLeft"})):(e.openBlock(),e.createBlock(le,{key:1,size:"10",name:"arrowRight"}))],4),e.createVNode(e.unref(b.ElDialog),{modelValue:u.value,"onUpdate:modelValue":i[7]||(i[7]=E=>u.value=E),"append-to-body":!0,title:k.value,width:"450px",class:"hzzt-kfb-label-dialog"},{footer:e.withCtx(()=>[e.createVNode(e.unref(b.ElButton),{onClick:i[6]||(i[6]=E=>u.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("取消")),1)]),_:1}),e.createVNode(e.unref(b.ElButton),{type:"primary",onClick:d},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("确认")),1)]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",So,[e.createElementVNode("div",To,[e.createElementVNode("img",{src:a.slide.labelImg,style:e.normalizeStyle({transform:`rotate(${a.slide.angle||0}deg)`})},null,12,Bo)]),e.createElementVNode("div",$o,[e.createElementVNode("img",{src:a.slide.previewImg},null,8,Do)])]),e.createVNode(e.unref(b.ElForm),{class:"margin-t-2"},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElFormItem),{label:e.unref(t)("病理号")},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElInput),{modelValue:a.slide.pathology_number,"onUpdate:modelValue":i[3]||(i[3]=E=>a.slide.pathology_number=E),placeholder:e.unref(t)("输入病理号"),clearable:""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),e.createVNode(e.unref(b.ElFormItem),{label:e.unref(t)("蜡块号")},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElInput),{modelValue:a.slide.paraffin_block_number,"onUpdate:modelValue":i[4]||(i[4]=E=>a.slide.paraffin_block_number=E),placeholder:e.unref(t)("输入蜡块号"),clearable:""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),a.slide.slide_id?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(b.ElFormItem),{key:0,label:e.unref(t)("试剂")},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElInput),{modelValue:a.slide.reagent,"onUpdate:modelValue":i[5]||(i[5]=E=>a.slide.reagent=E),placeholder:e.unref(t)("输入试剂"),clearable:""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]))]),_:1})]),_:1},8,["modelValue","title"])]))}}),Mo=ye(Lo,[["__scopeId","data-v-a97863da"]]);function Po(n,o){const t=e.ref(1),l=e.ref(null),c=e.ref(null);function s(){n.value.viewer.addHandler("canvas-drag",p=>{l.value||(l.value=p.position)}),n.value.viewer.addHandler("canvas-drag-end",p=>{if(t.value!==1){c.value=p.position;const _=n.value.viewer.viewport.containerSize.x,m=n.value.viewer.viewport.containerSize.y,z=(c.value.x-l.value.x)/(_*o.value)*(t.value-1),r=(c.value.y-l.value.y)/(m*o.value)*(t.value-1),k=n.value.viewer.viewport.getCenter(),w=new ne.OpenSeadragon.Point(k.x-z,k.y-r);n.value.viewer.viewport.panTo(w),l.value=null}})}function u({name:p,value:_}){p==="ratio"&&(t.value=_/1)}return{moveEvent:s,fastMove:u}}const Io=22,Ne="rgba(0,0,0,0)",Me="countColor",$e="countDotKey",je={measure:!1,lineWidth:1,fillStyle:Ne,strokeStyle:Ne};function Ro(n){return se(J({tool:"Dot",once:!1,clear:!0,custom:!0,subType:"count"},je),{__other__:{[Me]:n},__data__:se(J({},je),{subType:"count",custom:!0,__other__:{[Me]:n}})})}function Ao(n){var o,t;return!!((t=n==null?void 0:n.custom)!=null?t:(o=n==null?void 0:n.__data__)!=null&&o.custom)}function Ft(n){var o,t;return(t=n==null?void 0:n.subType)!=null?t:(o=n==null?void 0:n.__data__)==null?void 0:o.subType}function ze(n){const o=n==null?void 0:n[Me];return typeof o=="string"&&o!==Ne?o:void 0}function Ht(n){var t,l,c;const o=[n==null?void 0:n.strokeStyle,(t=n==null?void 0:n.__data__)==null?void 0:t.strokeStyle,(c=(l=n==null?void 0:n.__data__)==null?void 0:l.__data__)==null?void 0:c.strokeStyle];for(const s of o)if(s&&s!==Ne)return s}function Oe(n){var o,t,l,c,s,u,p;return Ke(n)?(c=(l=(t=ze(n==null?void 0:n.__other__))!=null?t:ze((o=n==null?void 0:n.__data__)==null?void 0:o.__other__))!=null?l:Ht(n))!=null?c:"":(p=(u=n==null?void 0:n.strokeStyle)!=null?u:(s=n==null?void 0:n.__data__)==null?void 0:s.strokeStyle)!=null?p:""}function Fo(n){var o,t,l,c;return(c=(l=(t=ze(n==null?void 0:n.__other__))!=null?t:ze((o=n==null?void 0:n.__data__)==null?void 0:o.__other__))!=null?l:Ht(n))!=null?c:"#004BFF"}function Ke(n){return Ft(n)==="count"}function xe(n){var o;return n?Ke(n)?!0:!!(ze(n.__other__)||ze((o=n.__data__)==null?void 0:o.__other__)):!1}let lt=0;function Ho(){return lt=(lt+1)%1e5,Date.now()*1e5+lt}function Uo(){return`cd-${Date.now()}-${Math.random().toString(36).slice(2,11)}`}function pe(n){var t,l,c,s;if(!n)return;const o=[(t=n.__other__)==null?void 0:t[$e],(c=(l=n.__data__)==null?void 0:l.__other__)==null?void 0:c[$e],(s=n.__data__)==null?void 0:s[$e]];for(const u of o)if(typeof u=="string"&&u)return u}function it(n){var l,c;const o=new Set,t=[];for(const s of n){const u=(c=pe(s))!=null?c:`id:${(l=s.id)!=null?l:""}`;o.has(u)||(o.add(u),t.push(s))}return t}function Ut(n,o){const t=pe(n),l=pe(o);if(t&&l&&t===l||n.id!=null&&o.id!=null&&n.id===o.id)return!0;const c=Pe(n),s=Pe(o);return!c||!s?!1:Math.hypot(c.x-s.x,c.y-s.y)<.5}function Lt(n,o){if(!n.length)return-1;const t=pe(o);if(t){const l=n.findIndex(c=>pe(c)===t);if(l>-1)return l}if(o.id!=null){const l=n.map((c,s)=>({item:c,index:s})).filter(({item:c})=>c.id===o.id).map(({index:c})=>c);if(l.length===1)return l[0];if(l.length>1){const c=Pe(o);if(!c)return l[0];let s=l[0],u=1/0;for(const p of l){const _=Pe(n[p]);if(!_)continue;const m=Math.hypot(_.x-c.x,_.y-c.y);m<u&&(u=m,s=p)}return s}}return n.findIndex(l=>Ut(l,o))}function Mt(n,o){return n?Ke(n)?!0:!!(o&&n.tool==="Dot"):!1}function Pe(n){var o;if((o=n.points)!=null&&o.length){const t=n.points[0];return{x:t.x,y:t.y}}return n.region&&n.region.width!=null&&n.region.height!=null?{x:n.region.x+n.region.width/2,y:n.region.y+n.region.height/2}:null}function Pt(n,o){var l;const t=Pe(o);return!t||!((l=n.area)!=null&&l.imageToViewerElementCoordinates)?null:n.area.imageToViewerElementCoordinates(t.x,t.y)}function It(n,o,t,l=Io){const c=Pt(t,n);if(c)return o.find(s=>{if(n.id!=null&&s.id===n.id)return!1;const u=Pt(t,s);return u?Math.hypot(u.x-c.x,u.y-c.y)<=l:!1})}function Rt(n,o=[]){var s;const t=Fo(n);let l=n.id;(l==null||o.some(u=>u.id===l))&&(l=Ho());let c=pe(n);return(!c||o.some(u=>pe(u)===c))&&(c=Uo()),se(J(J({},n),je),{id:l,tool:"Dot",subType:"count",custom:!0,__other__:se(J({},n.__other__||{}),{[Me]:t,[$e]:c}),__data__:se(J({},n.__data__||{}),{subType:"count",custom:!0,measure:!1,lineWidth:1,fillStyle:Ne,__other__:se(J({},((s=n.__data__)==null?void 0:s.__other__)||{}),{[Me]:t,[$e]:c})})})}function jo(n,o){const t=e.ref([]),l=e.ref(!1);let c=!1,s;e.watch(()=>{var d;return(d=n.slide)==null?void 0:d.file},()=>{t.value=[],l.value=!1,c=!1,s=void 0});function u(){requestAnimationFrame(()=>{const d=o.value.board;d!=null&&d.isInDraw&&d.endDraw&&d.endDraw()})}function p(){l.value=!1,c=!1,s=void 0}function _(){p(),u()}function m(d){l.value=!0,c=!1,s=void 0}function z(d){if(!l.value)return;const f=Rt(d,t.value),a=It(f,t.value,o.value);a&&(c=!0,s=a)}function r(d){if(c&&s){c=!1;const E=s;return s=void 0,p(),u(),{action:"selected",nearby:E}}const f=Rt(d,t.value),a=It(f,t.value,o.value);if(a)return p(),u(),{action:"selected",nearby:a};const i=Lt(t.value,f);return i>-1?{action:"selected",nearby:t.value[i]}:(t.value.push(f),t.value=it(t.value),{action:"added"})}function k(d){const f=Lt(t.value,d);return f>-1?(t.value=t.value.filter((a,i)=>i!==f),!0):!1}function w(d){const f=pe(d),a=o.value.labelList||[],i=new Set(a.filter(xe).map(B=>pe(B)).filter(B=>!!B)),E=new Set(a.map(B=>B.id).filter(B=>B!=null));t.value=t.value.filter(B=>{const P=pe(B);return f&&P===f||d.id!=null&&B.id===d.id?!1:P?i.has(P):B.id!=null?E.has(B.id):!0}),t.value=it(t.value)}function v(d){k(d),w(d)}function g(d){const f=d.id;t.value=t.value.map(a=>a.id!==f?a:se(J({},a),{points:d.points,region:d.region}))}return{countLabelList:t,isCountDrawing:l,beginCountDraw:m,endCountDraw:_,clearCountDrawState:p,scheduleBoardEndDraw:u,onCountDotPress:z,handleCountAdd:r,handleCountDelete:v,handleCountMove:g,removeOneCountDot:k,isSameCountDot:Ut}}function Oo(n,o,t,l,c){const s=e.ref(void 0),u=e.ref([]),p=e.ref([]);function _(x,y){var D,V;s.value&&(s.value.select=!1,s.value=void 0);const C=(t.value.labelList||[]).findIndex(N=>N.id===x.id);if(C>-1){s.value=(D=t.value.labelList)==null?void 0:D[C],s.value.select=!0;const N=t.value.area.getCenterPoint(x.region);t.value.area.moveToLabel(N),(V=t.value.viewer)!=null&&V.canvas&&t.value.viewer.canvas.focus(),G()}y&&c(y)}const{countLabelList:m,isCountDrawing:z,beginCountDraw:r,endCountDraw:k,clearCountDrawState:w,scheduleBoardEndDraw:v,onCountDotPress:g,handleCountAdd:d,handleCountDelete:f,handleCountMove:a}=jo(n,t);e.watch(()=>n.aiLabelList,R);let i=!1;function E(x){const y=pe(x);u.value=u.value.filter(C=>!(y&&pe(C)===y||x.id!=null&&C.id===x.id))}function B(x){f(x),E(x),R(),queueMicrotask(()=>R())}function P(){t.value.$on(ne.KfbView.events.EVENT_INIT_COMPLETE,L("init-complete")),t.value.$on(ne.KfbView.events.EVENT_UPDATE_ZRENDER,L("update-zrender")),t.value.$on(ne.KfbView.events.EVENT_START_PAINTING,x=>{x&&Mt(x,z.value)&&g(x)}),t.value.$on(ne.KfbView.events.EVENT_END_PAINTING,L("add")),t.value.$on(ne.KfbView.events.EVENT_AREA_MOVE_END,L("move")),t.value.$on(ne.KfbView.events.EVENT_ADD_POLYGON_POINT,L("add-point")),t.value.$on(ne.KfbView.events.EVENT_DELETE_POLYGON_POINT,L("delete-point")),t.value.$on(ne.KfbView.events.EVENT_DELETE_LABEL,L("delete")),t.value.$on(ne.KfbView.events.EVENT_STOP_PAINTING,()=>{z.value&&(w(),o("tool","count-draw-end"))}),t.value.$on(ne.KfbView.events.EVENT_SELECT_LABEL,x=>{s.value=x,z.value&&(w(),v(),o("tool","count-draw-end")),G(),o("tool","select-label",s.value)}),t.value.$on(ne.KfbView.events.EVENT_CANCEL_SELECT_LABEL,()=>{s.value=void 0,o("tool","cancel-select-label",s.value)}),L("list")()}function L(x){return y=>H(x,y)}function H(x,y){var C,D,V,N,$,A;if(x==="add"&&y&&Mt(y,z.value)){const U=d(y);R(),U.action==="selected"&&requestAnimationFrame(()=>{_(U.nearby)});return}if(x==="delete"&&y&&xe(y)){if(i)return;i=!0;try{B(y)}finally{i=!1}return}if(x==="delete"&&(y==null?void 0:y.tool)==="Dot"&&((D=y.custom)!=null?D:(C=y==null?void 0:y.__data__)!=null&&C.custom)){if(i)return;i=!0;try{B(y)}finally{i=!1}return}if(x==="move"&&y&&xe(y)){a(y),R();return}if(x==="add"&&y&&((y==null?void 0:y.subType)||((V=y==null?void 0:y.__data__)==null?void 0:V.subType))==="voice")l(y);else if(x==="add"&&y&&((y==null?void 0:y.subType)||((N=y==null?void 0:y.__data__)==null?void 0:N.subType))==="measure")y.id=new Date().getTime(),p.value.push(y),R();else if(x==="move"&&y&&((y==null?void 0:y.subType)||(($=y==null?void 0:y.__data__.__data__)==null?void 0:$.subType))==="measure")p.value.forEach(U=>{U.id===y.id&&(U.points=y.points)}),R();else if(x==="delete"&&y&&((y==null?void 0:y.subType)||((A=y==null?void 0:y.__data__.__data__)==null?void 0:A.subType))==="measure")p.value.forEach((U,Q)=>{U.id===y.id&&p.value.splice(Q,1)}),R();else if(x==="init-complete")n.initHandle&&n.initHandle();else if(x==="update-zrender")n.zrenderUpdateHandle&&n.zrenderUpdateHandle(t);else return n.labelHandle(x,n.slide,y,u.value).then(U=>{u.value=U.filter(Q=>!xe(Q)),R()}).catch(()=>{R()})}function W(){u.value=u.value.filter(x=>!xe(x))}function R(x){var C;x!=null&&x.length&&(u.value=x.filter(D=>!xe(D))),W();const y=it(m.value);if(y.length!==m.value.length&&(m.value=y),(C=t.value)!=null&&C.initLabelList){const D=[...u.value,...p.value,...y,...n.aiLabelList||[]];D.find(({id:V})=>{var N;return V===((N=s.value)==null?void 0:N.id)})||(s.value=void 0),t.value.initLabelList(D)}}function Y(x,y){_(x,y)}function j(x){return n.labelHandle("add",n.slide,x,u.value).then(y=>{u.value=y,R()}).catch(()=>{R()})}function G(){var y,C,D,V;(((y=s.value)==null?void 0:y.subType)||((D=(C=s.value)==null?void 0:C.__data__)==null?void 0:D.subType))==="voice"&&((V=s.value)!=null&&V.src)&&new Audio(s.value.src).play()}return{currentLabel:s,localLabelList:u,countLabelList:m,isCountDrawing:z,beginCountDraw:r,endCountDraw:k,initLabel:P,jumpToLabel:Y,reloadLabelList:R,eventHandel:L,addHandle:j}}function qo(){function n(o,t){o.save(),o.strokeStyle="rgba(0,0,0,0)",o.miterLimit=4,o.font="15px",o.fillStyle=t,o.font="15px",o.scale(.02734375,.02734375),o.save(),o.font="15px",o.beginPath(),o.moveTo(512,427.023),o.moveTo(422,427.023),o.translate(512,427.023),o.rotate(0),o.arc(0,0,90,3.141592653589793,6.283185307179586,!0),o.rotate(0),o.translate(-512,-427.023),o.translate(512,427.023),o.rotate(0),o.arc(0,0,90,0,3.141592653589793,!0),o.rotate(0),o.translate(-512,-427.023),o.fill(),o.stroke(),o.restore(),o.save(),o.font="15px",o.beginPath(),o.moveTo(512,910.402),o.bezierCurveTo(492.86,910.402,474.51800000000003,904.548,458.95799999999997,893.4730000000001),o.bezierCurveTo(444.895,883.4630000000001,434.032,869.8770000000001,427.36899999999997,854.013),o.lineTo(255.043,585.177),o.lineTo(254.889,584.927),o.bezierCurveTo(225.522,537.209,210,482.605,210,427.021),o.bezierCurveTo(210,346.35400000000004,241.414,270.515,298.454,213.47500000000002),o.bezierCurveTo(355.494,156.43500000000006,431.333,125.021,512,125.021),o.bezierCurveTo(592.6669999999999,125.021,668.506,156.435,725.546,213.475),o.bezierCurveTo(782.587,270.515,814,346.354,814,427.021),o.bezierCurveTo(814,482.87,798.345,537.692,768.726,585.56),o.lineTo(768.462,585.9789999999999),o.lineTo(596.381,854.6949999999999),o.bezierCurveTo(589.626,870.4209999999999,578.721,883.871,564.677,893.7499999999999),o.bezierCurveTo(549.192,904.6449999999999,530.977,910.4019999999999,512,910.4019999999999),o.closePath(),o.moveTo(309.246,551.141),o.lineTo(484.74,824.9209999999999),o.lineTo(485.934,828.1179999999999),o.bezierCurveTo(490.083,839.2249999999999,500.31500000000005,846.4019999999999,512,846.4019999999999),o.bezierCurveTo(523.584,846.4019999999999,533.791,839.3309999999999,538.004,828.387),o.lineTo(539.169,825.3589999999999),o.lineTo(714.43,551.678),o.bezierCurveTo(737.701,513.983,750,470.884,750,427.021),o.bezierCurveTo(750,363.449,725.244,303.682,680.2909999999999,258.72900000000004),o.bezierCurveTo(635.3389999999999,213.77800000000005,575.5719999999999,189.02100000000004,511.99999999999994,189.02100000000004),o.bezierCurveTo(448.428,189.02100000000004,388.66099999999994,213.77700000000004,343.70799999999997,258.72900000000004),o.bezierCurveTo(298.755,303.68100000000004,274,363.449,274,427.021),o.bezierCurveTo(274,470.661,286.186,513.573,309.246,551.1410000000001),o.closePath(),o.fill(),o.stroke(),o.restore(),o.restore()}return{drawDot:n}}function Ko(n,o){const{t}=me(),l=e.ref(!1),c=e.ref();let s=null;const u=e.ref(!1),p=e.ref(0);let _=0;const m=e.ref([]),z=e.ref(void 0);let r=!1;e.onBeforeUnmount(()=>{var E;v();const i=(E=z.value)==null?void 0:E.src;i!=null&&i.startsWith("blob:")&&URL.revokeObjectURL(i)});function k(i,E){i.save(),i.strokeStyle="rgba(0,0,0,0)",i.miterLimit=4,i.font="15px ''",i.fillStyle=E,i.font=" 15px ''",i.scale(.03125,.03125),i.save(),i.font=" 15px ''",i.beginPath(),i.moveTo(515.041727,670.617766),i.bezierCurveTo(606.625894,670.617766,681.137374,596.113511,681.137374,504.52212),i.lineTo(681.137374,229.350568),i.bezierCurveTo(681.137374,137.76640100000003,606.625894,63.254920999999996,515.041727,63.254920999999996),i.bezierCurveTo(423.44311000000005,63.254920999999996,348.93885500000005,137.766401,348.93885600000004,229.350568),i.lineTo(348.93885600000004,504.52212),i.bezierCurveTo(348.93885600000004,596.113512,423.44311100000004,670.617767,515.041727,670.617766),i.closePath(),i.fill(),i.stroke(),i.restore(),i.save(),i.font=" 15px ''",i.beginPath(),i.moveTo(801.643237,874.001665),i.lineTo(558.391759,874.001665),i.lineTo(558.391759,828.578057),i.bezierCurveTo(719.899527,807.264291,844.993269,668.7898399999999,844.993269,501.55986699999994),i.translate(801.643237,501.55986699999994),i.rotate(0),i.arc(0,0,43.350032,0,3.141592653589793,!0),i.rotate(0),i.translate(-801.643237,-501.55986699999994),i.bezierCurveTo(758.2932050000001,635.684865,649.166725,744.811345,515.0345020000001,744.811346),i.bezierCurveTo(380.9095040000001,744.811346,271.79024900000013,635.6848659999999,271.79024900000013,501.55986699999994),i.translate(228.44021750000013,501.5664510740879),i.rotate(0),i.arc(0,0,43.350032,-.00015188164315591997,-3.1414407719461273,!0),i.rotate(0),i.translate(-228.44021750000013,-501.5664510740879),i.bezierCurveTo(185.09018600000013,668.7898389999999,310.1911530000001,807.271516,471.69169500000015,828.578057),i.lineTo(471.69169500000015,874.001665),i.lineTo(228.440217,874.001665),i.translate(228.440217,917.3516970000001),i.rotate(0),i.arc(0,0,43.350032,-1.5707963267948966,1.5707963267948966,!0),i.rotate(0),i.translate(-228.440217,-917.3516970000001),i.lineTo(801.643237,960.701729),i.translate(801.643237,917.3516970000001),i.rotate(0),i.arc(0,0,43.350032,1.5707963267948966,4.71238898038469,!0),i.rotate(0),i.translate(-801.643237,-917.3516970000001),i.closePath(),i.fill(),i.stroke(),i.restore(),i.restore()}function w(){return ge(this,null,function*(){try{c.value=yield navigator.mediaDevices.getUserMedia({audio:!0}),s=new MediaRecorder(c.value),m.value=[],s.addEventListener("dataavailable",i=>{m.value.push(i.data)}),s.addEventListener("stop",()=>ge(this,null,function*(){if(z.value){const i=new Blob(m.value,{type:n.audioType||"audio/wav"});z.value.src=URL.createObjectURL(i)}u.value=!1,r&&(yield a())})),s.start(),u.value=!0,_=window.setInterval(()=>{p.value++},1e3)}catch(i){b.ElMessage.error(t("麦克风启用失败,请确认是否开启麦克风权限"))}})}function v(){c.value&&s?(s.stop(),c.value.getTracks().forEach(i=>i.stop()),s=null,c.value=void 0):(s=null,c.value=void 0),u.value=!1,_&&(clearInterval(_),_=0),p.value=0}function g(i){l.value=!0,z.value=i,m.value=[],r=!1}function d(){u.value&&v(),l.value=!1,u.value=!1,r=!1}function f(){return ge(this,null,function*(){if(!u.value&&!m.value.length){b.ElMessage.error(t("请先录音"));return}u.value&&v(),u.value=!1,r=!0,m.value.length&&(yield a()),l.value=!1})}function a(){return ge(this,null,function*(){if(n.uploadHandle&&z.value){const i=b.ElLoading.service({text:t("录音上传中")}),E=new Blob(m.value,{type:n.audioType||"audio/wav"});m.value=[];try{yield n.uploadHandle(n.slide,z.value,E).then(B=>{z.value.src=B}),i.close(),o(z.value)}catch(B){i.close()}}})}return{voiceVisible:l,voiceForm:z,recordTime:p,isRecording:u,drawVoice:k,startRecording:w,stopRecording:v,initVoice:g,cancelRecord:d,confirmRecord:f}}function Wo(n,o,t){const l=e.ref([]),c=e.ref(0),s=e.ref(!1);let u=null;e.watch(()=>{var w;return(w=n.analysis)==null?void 0:w.hotmap_path},w=>{var v,g,d;if((g=(v=o.value)==null?void 0:v.viewer)!=null&&g.world){c.value=0;const f=o.value.viewer.world.getItemAt(0);f&&(f.tilesMatrix={},f.draw())}w&&((d=n.analysis)!=null&&d.zoom_roi)&&t({x:n.analysis.zoom_roi.x,y:n.analysis.zoom_roi.y,width:n.analysis.zoom_roi.w,height:n.analysis.zoom_roi.h},5)}),e.onMounted(()=>{window.addEventListener("mousemove",m),window.addEventListener("mouseup",r)}),e.onBeforeUnmount(()=>{window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",r)});function p(w,v,g){var f,a,i,E;const d=se(J({},v),{file:(f=n.analysis)==null?void 0:f.hotmap_path});if((a=n.analysis)!=null&&a.hotmap_info){if(g[v.x+"_"+v.y+"_"+Number(v.scale)])if(((i=n.analysis)==null?void 0:i.hotmap_type)==="drag")_(w,d);else return n.tileHandle(d,n.slide)}else if(((E=n.analysis)==null?void 0:E.hotmap_type)==="drag")_(w,d);else return n.tileHandle(d,n.slide);return w}function _(w,v){const g=l.value.find(d=>d.url===w)||{url:w,x:v.x,y:v.y,img:void 0,load:""};if(!(g!=null&&g.img)&&(l.value.push(g),g.load!=="success")){const d=new Image;d.src=n.tileHandle(v,n.slide),d.onload=()=>{g.load="success"},g.img=d}}function m(w){s.value&&u&&(c.value+=w.x-u.x,c.value<0?c.value=0:c.value>o.value.$options.width&&(c.value=o.value.$options.width,s.value=!1),o.value.viewer.forceRedraw()),u={x:w.x,y:w.y}}function z(w){const{x:v,y:g}=w;s.value=!0,u={x:v,y:g}}function r(){s.value=!1,u=null}function k(w){const{context:v,sourceWidth:g,sourceHeight:d,position:f,size:a,initRendered:i,tile:E,pixelDensityRatio:B}=w,P=E.getUrl(),L=c.value*B,H=f.original.x;if(H<L&&H+a.x>L){const W=L-H,R=a.x-W,Y=l.value.find(G=>G.url===P),j=(Y==null?void 0:Y.load)==="success"?Y.img:i.canvas;v.drawImage(j,0,0,g*W/a.x,d,f.x,f.y,W,a.y),v.drawImage(i.canvas,g*W/a.x,0,g*R/a.x,d,f.x+W,f.y,R,a.y)}else if(H+a.x<=L){const W=l.value.find(Y=>Y.url===P),R=(W==null?void 0:W.load)==="success"?W.img:i.canvas;v.drawImage(R,0,0,g,d,f.x,f.y,a.x,a.y)}else H>=L&&v.drawImage(i.canvas,0,0,g,d,f.x,f.y,a.x,a.y)}return{getHotmapUrl:p,hotmapImgs:l,handlerImage:k,hotmapLine:c,lineMouseDown:z}}function Go(n,o,t){const l=e.getCurrentInstance(),c=e.ref(!1),s=new BroadcastChannel("sync_kfb_view");s.onmessage=r=>{const k=r.data;m(k)},e.onMounted(()=>{var r,k,w;(r=t.value)==null||r.addEventListener("mouseenter",u),(k=t.value)==null||k.addEventListener("mousemove",u),(w=t.value)==null||w.addEventListener("mouseleave",p)}),e.onBeforeUnmount(()=>{var r,k,w;(r=t.value)==null||r.removeEventListener("mouseenter",u),(k=t.value)==null||k.removeEventListener("mousemove",u),(w=t.value)==null||w.removeEventListener("mouseleave",p),s.close()});function u(){c.value=!0}function p(){c.value=!1}function _(){let r;o.value.viewer.addHandler("pan",k=>{var g,d,f,a;if(!r){r=(d=(g=k.center)==null?void 0:g.clone)==null?void 0:d.call(g);return}const w=k.center,v=(f=w==null?void 0:w.minus)==null?void 0:f.call(w,r);r=(a=w==null?void 0:w.clone)==null?void 0:a.call(w),n.syncPosition&&z({position:v,type:"sync_position"})}),o.value.viewer.addHandler("zoom",k=>{n.syncZoom&&z({zoom:k.zoom,type:"sync_zoom"})}),o.value.viewer.addHandler("animation-finish",()=>{var v;if(n.syncZoom&&z({zoom:o.value.viewer.viewport.getZoom(!0),type:"sync_zoom"}),!r)return;const k=o.value.viewer.viewport.getCenter(!0),w=(v=k==null?void 0:k.minus)==null?void 0:v.call(k,r);r=void 0,n.syncPosition&&z({position:w,type:"sync_position"})})}function m(r){r.uuid&&r.type==="sync_position"&&r.uuid!==(l==null?void 0:l.uid)?o.value&&o.value.viewer.viewport.panBy(r.position,!0):r.uuid&&r.type==="sync_zoom"&&r.uuid!==(l==null?void 0:l.uid)&&o.value&&o.value.viewer.viewport.zoomTo(r.zoom)}function z(r){var k;c.value&&s.postMessage(se(J({},r),{uuid:l==null?void 0:l.uid,fileName:(k=n.slide)==null?void 0:k.file}))}return{initSync:_}}const Yo={class:"hzzt-kfb-keyword flex wrap"},Zo=["onMouseenter"],Xo=e.defineComponent({__name:"KfbKeyword",setup(n){const o=e.ref([{code:"Q",icon:"zoomIn"},{code:"W",icon:"arrowUp"},{code:"E",icon:"zoomOut"},{code:"A",icon:"arrowLeft"},{code:"S",icon:"arrowDown"},{code:"D",icon:"arrowRight"}]),t=e.inject("kfbView",e.ref({}));let l=null;function c(u,p){u.preventDefault(),l&&clearTimeout(l),l=setInterval(()=>{p==="E"&&(t.value.viewer.viewport.zoomBy(1.1),t.value.viewer.viewport.applyConstraints()),p==="Q"&&(t.value.viewer.viewport.zoomBy(.9),t.value.viewer.viewport.applyConstraints()),p==="W"&&(t.value.viewer.viewport.panBy(t.value.viewer.viewport.deltaPointsFromPixels(new ne.OpenSeadragon.Point(0,-40))),t.value.viewer.viewport.applyConstraints()),p==="S"&&(t.value.viewer.viewport.panBy(t.value.viewer.viewport.deltaPointsFromPixels(new ne.OpenSeadragon.Point(0,40))),t.value.viewer.viewport.applyConstraints()),p==="A"&&(t.value.viewer.viewport.panBy(t.value.viewer.viewport.deltaPointsFromPixels(new ne.OpenSeadragon.Point(-40,0))),t.value.viewer.viewport.applyConstraints()),p==="D"&&(t.value.viewer.viewport.panBy(t.value.viewer.viewport.deltaPointsFromPixels(new ne.OpenSeadragon.Point(40,0))),t.value.viewer.viewport.applyConstraints())},120)}function s(){l&&(clearInterval(l),l=null)}return e.onBeforeUnmount(()=>{clearTimeout(l)}),(u,p)=>(e.openBlock(),e.createElementBlock("div",Yo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,_=>(e.openBlock(),e.createElementBlock("div",{key:_.code,class:"hzzt-kfb-keyword__code flex column align-items-center justify-content-center",onMouseenter:m=>c(m,_.code),onMouseleave:s},[e.createElementVNode("p",null,e.toDisplayString(_.code),1),e.createVNode(le,{size:"14",name:_.icon},null,8,["name"])],40,Zo))),128))]))}}),Jo=ye(Xo,[["__scopeId","data-v-7b625d72"]]);function Qo(n,o,t={}){const{panSensitivity:l=.2,zoomSensitivity:c=1.1,damping:s=.6,minThreshold:u=.05}=t;let p=!1,_=null,m=0,z=0,r=!1;const k=()=>{p=document.pointerLockElement===o.value,p||w()},w=()=>{m=0,z=0,_&&(cancelAnimationFrame(_),_=null),r=!1},v=i=>ge(this,null,function*(){try{i.key==="l"&&o.value&&(document.pointerLockElement?(document.exitPointerLock(),console.log("鼠标已解锁!")):(yield o.value.requestPointerLock(),console.log("鼠标已锁定!")))}catch(E){console.error("无法锁定鼠标:",E)}}),g=i=>{if(p){i.preventDefault();const E=Math.pow(c,Math.sign(i.deltaY)*-1);n.value.viewer.viewport.zoomBy(E),n.value.viewer.viewport.applyConstraints()}},d=i=>{p&&(m+=i.movementX*l,z+=i.movementY*l,!r&&(Math.abs(m)>1||Math.abs(z)>1)&&(r=!0,_=requestAnimationFrame(f)))},f=()=>{const i=n.value.viewer.viewport;if(Math.abs(m)>u||Math.abs(z)>u){const E=i.deltaPointsFromPixels(new ne.OpenSeadragon.Point(m,z));i.panBy(E),i.applyConstraints()}m*=s,z*=s,Math.abs(m)>u||Math.abs(z)>u?_=requestAnimationFrame(f):w()},a=()=>{p&&document.exitPointerLock()};return e.onMounted(()=>{var i;(i=o.value)==null||i.addEventListener("keydown",v),document.addEventListener("wheel",g,{passive:!1}),document.addEventListener("click",a),document.addEventListener("mousemove",d),document.addEventListener("pointerlockchange",k)}),e.onBeforeUnmount(()=>{var i;(i=o.value)==null||i.removeEventListener("keydown",v),document.removeEventListener("click",a),document.removeEventListener("wheel",g),document.removeEventListener("mousemove",d),document.removeEventListener("pointerlockchange",k),w()}),{setConfig:i=>{Object.assign(t,i)}}}const el=e.defineComponent({__name:"KfbLevel",props:e.mergeModels({slides:{default:()=>[]}},{"model-value":{default:0},"model-valueModifiers":{}}),emits:["update:model-value"],setup(n){const o=n,t=e.useModel(n,"model-value"),l=e.inject("kfbView",e.ref({})),c=e.computed(()=>Array.from(new Array(o.slides.length+1)).map((u,p)=>p));function s(){const u=l.value.viewer.world.getItemAt(0),p=Object.keys(u.tilesMatrix);p.forEach((_,m)=>{m>p.length-4&&(u.tilesMatrix[_]={})}),u.draw()}return(u,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["hzzt-kfb-level flex column align-items-center",u.slides.length>5?"hzzt-kfb-level--large":""])},[e.createVNode(le,{name:"level",size:"24",class:"margin-b-4 margin-t-2"}),e.createVNode(e.unref(b.ElSlider),{modelValue:t.value,"onUpdate:modelValue":p[0]||(p[0]=_=>t.value=_),vertical:"",min:c.value[0],step:1,max:c.value[c.value.length-1],"show-stops":"","show-tooltip":!0,placement:"left",height:u.slides.length>5?"180px":"130px",onInput:s},null,8,["modelValue","min","max","height"])],2))}}),tl={DAPI:"#4A6CF7",480:"#00BFFF",520:"#32CD32",570:"#FFAA33",620:"#FF6347",670:"#DC143C",780:"#4B0082"};function nl(n){const o=n.r===""||n.r===void 0?NaN:Number(n.r),t=n.g===""||n.g===void 0?NaN:Number(n.g),l=n.b===""||n.b===void 0?NaN:Number(n.b);if(![o,t,l].some(c=>!Number.isFinite(c)))return`rgb(${o}, ${t}, ${l})`}function st(n){return((n==null?void 0:n.channel)||[]).map(t=>{const l=nl(t),c=tl[t.eqt_num];return{label:t.eqt_num,defaultColor:l||c||"#ffffff"}})}function ol(n,o){const t=new Set(o);return((n==null?void 0:n.channel)||[]).map(l=>l.eqt_num).filter(l=>t.has(l))}function ll(n,o){return JSON.stringify(ol(n,o))}const al={key:0,class:"flex hzzt-kfb-channel"},rl=["onClick"],il=e.defineComponent({__name:"KfbChannel",props:e.mergeModels({info:{}},{"model-value":{default:()=>[]},"model-valueModifiers":{}}),emits:e.mergeModels(["load"],["update:model-value"]),setup(n,{emit:o}){const t=n,l=o,c=e.useModel(n,"model-value"),s=e.computed(()=>st(t.info).map(p=>({label:p.label,color:p.defaultColor})));function u(p){const _=st(t.info).map(r=>r.label),m=c.value.includes(p)?c.value.filter(r=>r!==p):[...c.value,p],z=new Set(m);c.value=_.filter(r=>z.has(r)),l("load")}return(p,_)=>s.value.length>0?(e.openBlock(),e.createElementBlock("div",al,[e.createVNode(le,{name:"channel",size:"32"}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,m=>(e.openBlock(),e.createElementBlock("div",{key:m.label,style:e.normalizeStyle({background:m.color}),class:e.normalizeClass(["hzzt-kfb-channel__box",c.value.includes(m.label)?"":"hzzt-kfb-channel__box--unactive"]),onClick:z=>u(m.label)},e.toDisplayString(m.label),15,rl))),128))])):e.createCommentVNode("",!0)}}),sl={class:"flex align-items-center justify-content-between"},ul={class:"hzzt-kfb-title"},cl={class:"hzzt-kfb-annotation__container flex-1"},dl=["onClick"],fl=e.defineComponent({__name:"KfbAnnotation",props:e.mergeModels({annotation:{},annotations:{}},{expand:{type:Boolean},expandModifiers:{}}),emits:e.mergeModels(["select"],["update:expand"]),setup(n,{emit:o}){const t=e.useModel(n,"expand"),l=o,{t:c}=me();function s(p){let _="";return p.subType==="count"?_=p.tool||"":_=p.subType||p.tool||"",`mark${_.substring(0,1).toLocaleUpperCase()}${_.substring(1)}`}function u(p){l("select",p)}return(p,_)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["hzzt-kfb-annotation flex column",t.value?"hzzt-kfb-annotation--expand":""])},[e.createElementVNode("div",sl,[e.withDirectives(e.createElementVNode("div",ul,[e.createElementVNode("span",null,e.toDisplayString(e.unref(c)("标注列表")),1)],512),[[e.vShow,t.value]]),e.createVNode(le,{class:"hzzt-kfb-annotation__icon",name:t.value?"expandLeft":"expandRight",onClick:_[0]||(_[0]=m=>t.value=!t.value)},null,8,["name"])]),e.withDirectives(e.createElementVNode("div",cl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.annotations,(m,z)=>{var r;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["hzzt-kfb-annotation__item",((r=p.annotation)==null?void 0:r.id)===m.id?"hzzt-kfb-annotation__item--active":""]),key:z,onClick:k=>u(m)},[e.createVNode(le,{size:"16",color:m.subType==="count"?e.unref(Oe)(m):void 0,name:s(m)},null,8,["color","name"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(c)("标注"))+e.toDisplayString(z+1),1)],10,dl)}),128))],512),[[e.vShow,t.value]])],2))}}),ml=ye(fl,[["__scopeId","data-v-8560f6f0"]]);function De(n,o,t){return Math.min(t,Math.max(o,n))}function At(n){const o=((n==null?void 0:n.trim())||"").toLowerCase().replace(/\s+/g,""),t=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*[\d.]+)?\s*\)$/i.exec(o);if(t){const u=De(parseInt(t[1],10),0,255),p=De(parseInt(t[2],10),0,255),_=De(parseInt(t[3],10),0,255);return{r:u/255,g:p/255,b:_/255}}let l=o;l.startsWith("#")&&l.length===4&&(l=`#${l[1]}${l[1]}${l[2]}${l[2]}${l[3]}${l[3]}`);const c=/^#([0-9a-f]{6})$/.exec(l);if(!c)return{r:0,g:0,b:0};const s=parseInt(c[1],16);return{r:(s>>16&255)/255,g:(s>>8&255)/255,b:(s&255)/255}}function at(n,o){let t=Math.round(De(n,0,255)),l=Math.round(De(o,0,255));t>l&&([t,l]=[l,t]),l-t<1&&(l=Math.min(255,t+1));const c=[];for(let s=0;s<256;s++)s<=t?c.push(0):s>=l?c.push(1):c.push((s-t)/(l-t));return c.join(" ")}function rt(){return Array.from({length:256},(n,o)=>o/255).join(" ")}const vl="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0";function pl(n){return n.lower!==0||n.upper!==255||Math.abs(n.gamma-1)>.001}function hl(n,o){const t=e.reactive({}),l=e.ref([]);function c(f){return{color:f,lower:0,upper:255,gamma:1}}function s(){l.value=st(n.value);const f=new Set(l.value.map(a=>a.label));Object.keys(t).forEach(a=>{f.has(a)||delete t[a]});for(const a of l.value)t[a.label]||(t[a.label]=c(a.defaultColor))}e.watch(()=>{var f;return(f=n.value)==null?void 0:f.channel},()=>s(),{deep:!0,immediate:!0});const u=e.computed(()=>l.value.map(f=>f.label)),p=e.computed(()=>vl),_=e.computed(()=>l.value.some(f=>{const a=t[f.label];return!!a&&pl(a)}));function m(f){const a=u.value[f];return a&&t[a]||null}const z=e.computed(()=>{const f=m(0);return f?at(f.lower,f.upper):rt()}),r=e.computed(()=>{const f=m(1);return f?at(f.lower,f.upper):rt()}),k=e.computed(()=>{const f=m(2);return f?at(f.lower,f.upper):rt()}),w=e.computed(()=>{var i,E;const f=(E=(i=m(0))==null?void 0:i.gamma)!=null?E:1;return 1/Math.max(.01,f)}),v=e.computed(()=>{var i,E;const f=(E=(i=m(1))==null?void 0:i.gamma)!=null?E:1;return 1/Math.max(.01,f)}),g=e.computed(()=>{var i,E;const f=(E=(i=m(2))==null?void 0:i.gamma)!=null?E:1;return 1/Math.max(.01,f)});function d(){s();for(const f of l.value)t[f.label]=c(f.defaultColor)}return{channelParams:t,orderedLabels:u,filterMatrix:p,filterActive:_,redTransferTable:z,greenTransferTable:r,blueTransferTable:k,gammaExponentR:w,gammaExponentG:v,gammaExponentB:g,syncFromFile:s,resetToDefaults:d,displayRows:e.computed(()=>l.value)}}const gl={class:"fluo-adjust"},wl={class:"fluo-adjust__left"},yl={class:"fluo-adjust__left-inner"},_l=["onClick"],kl={key:0,class:"fluo-adjust__right"},Cl={class:"fluo-adjust__chart-row"},Vl={class:"fluo-adjust__chart-col"},bl={class:"fluo-adjust__section-title"},El={class:"fluo-adjust__gamma-col"},xl={class:"fluo-adjust__gamma-label"},Nl={class:"fluo-adjust__gamma-val"},zl={class:"fluo-adjust__nums"},Sl={class:"fluo-adjust__num-item"},Tl={class:"fluo-adjust__num-lab"},Bl={class:"fluo-adjust__num-item"},$l={class:"fluo-adjust__num-lab"},Dl={class:"fluo-adjust__num-item"},Ll={class:"fluo-adjust__num-lab"},Ml={class:"fluo-adjust__footer"},Pl=e.defineComponent({__name:"KfbFluorescenceChannelAdjust",props:e.mergeModels({displayRows:{},channelParams:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:e.mergeModels(["apply","reset","save"],["update:modelValue"]),setup(n,{emit:o}){const t=n,l=o,c=e.useModel(n,"modelValue"),{t:s}=me(),u=e.ref(null),p=e.ref(null),_=e.computed(()=>t.displayRows.map(V=>{const N=t.channelParams[V.label];return N?{row:V,param:N}:null}).filter(V=>V!==null)),m=e.computed(()=>{var N;const V=u.value;return V&&(N=t.channelParams[V])!=null?N:null}),z=e.computed(()=>{const V=m.value;return V?Math.max(0,Math.min(254,V.upper-16)):254}),r=e.computed(()=>{const V=m.value;return V?Math.min(255,Math.max(1,V.lower+16)):1});let k=null;function w(V){const{r:N,g:$,b:A}=At(V);return .2126*N+.7152*$+.0722*A>.55?"#000":"#fff"}function v(V){u.value=V,e.nextTick(()=>E())}function g(V,N,$,A){if(V<=N)return 0;if(V>=$)return 255;const U=(V-N)/($-N);return 1+Math.pow(U,A)*254}function d(){const V=p.value;if(!V)return null;const N=34,$=10,A=10,U=28,Q=V.clientWidth||268,M=V.clientHeight||208,T=Q-N-$,F=M-A-U;return{canvas:V,padL:N,padR:$,padT:A,padB:U,plotW:T,plotH:F,cw:Q,ch:M}}function f(V,N){return N.padL+V/255*N.plotW}function a(V,N){return N.padT+N.plotH-V/255*N.plotH}function i(V,N){return Math.round(Math.min(255,Math.max(0,(V-N.padL)/N.plotW*255)))}function E(){const V=p.value,N=m.value,$=d();if(!V||!N||!$)return;const A=window.devicePixelRatio||1,U=$.cw,Q=$.ch;V.width=Math.floor(U*A),V.height=Math.floor(Q*A);const M=V.getContext("2d");if(!M)return;M.setTransform(A,0,0,A,0,0),M.fillStyle="#0a0d24",M.fillRect(0,0,U,Q),M.strokeStyle="rgba(255,255,255,0.2)",M.lineWidth=1;const T=[0,51,102,153,204,255];for(const ue of T){const he=f(ue,$);M.beginPath(),M.moveTo(he,$.padT),M.lineTo(he,$.padT+$.plotH),M.stroke();const Ce=a(ue,$);M.beginPath(),M.moveTo($.padL,Ce),M.lineTo($.padL+$.plotW,Ce),M.stroke(),M.fillStyle="rgba(255,255,255,0.45)",M.font="10px sans-serif",M.textAlign="center",M.fillText(String(ue),he,$.padT+$.plotH+14),M.textAlign="right",M.fillText(String(ue),$.padL-4,Ce+3)}const F=g(N.lower,N.lower,N.upper,N.gamma),O=g(N.upper,N.lower,N.upper,N.gamma),ae=f(N.lower,$),ke=a(F,$),We=f(N.upper,$),Ge=a(O,$),Ee=m.value?At(m.value.color):{r:.2,g:1,b:.3};M.strokeStyle=`rgb(${Math.round(Ee.r*255)}, ${Math.round(Ee.g*255)}, ${Math.round(Ee.b*255)})`,M.lineWidth=2,M.beginPath();for(let ue=N.lower;ue<=N.upper;ue++){const he=g(ue,N.lower,N.upper,N.gamma),Ce=f(ue,$),Ie=a(he,$);ue===N.lower?M.moveTo(Ce,Ie):M.lineTo(Ce,Ie)}M.stroke();for(const[ue,he]of[[ae,ke],[We,Ge]])M.fillStyle="#5470c6",M.beginPath(),M.arc(ue,he,6,0,Math.PI*2),M.fill(),M.strokeStyle="#fff",M.lineWidth=2,M.stroke()}function B(V,N){const $=m.value,A=d();if(!$||!A)return null;const U=g($.lower,$.lower,$.upper,$.gamma),Q=g($.upper,$.lower,$.upper,$.gamma),M=f($.lower,A),T=a(U,A),F=f($.upper,A),O=a(Q,A),ae=10;return Be(V-M,2)+Be(N-T,2)<=ae*ae?"lower":Be(V-F,2)+Be(N-O,2)<=ae*ae?"upper":null}function P(V){const N=p.value;if(!N||!m.value)return;const $=N.getBoundingClientRect(),A=V.clientX-$.left,U=V.clientY-$.top;k=B(A,U),k&&(window.addEventListener("mousemove",L),window.addEventListener("mouseup",H,{once:!0}))}function L(V){if(!k||!m.value)return;const N=p.value,$=d();if(!N||!$)return;const A=N.getBoundingClientRect(),U=V.clientX-A.left,Q=i(U,$),M=m.value;k==="lower"?(M.lower=Math.min(Q,M.upper-16),M.lower=Math.max(0,M.lower)):(M.upper=Math.max(Q,M.lower+16),M.upper=Math.min(255,M.upper)),E(),R()}function H(){k=null,window.removeEventListener("mousemove",L)}function W(V){const N=t.channelParams[V];if(!N)return;let $=Math.round(Math.min(255,Math.max(0,N.lower))),A=Math.round(Math.min(255,Math.max(0,N.upper)));A-$<16&&(A=Math.min(255,$+16)),$>A-16&&($=Math.max(0,A-16)),N.lower=$,N.upper=A,N.gamma=Math.min(10,Math.max(.5,N.gamma))}function R(){_.value.forEach(({row:V})=>W(V.label)),l("apply"),e.nextTick(()=>E())}function Y(){R()}function j(){R()}function G(){R()}function x(){var N;const V=(N=_.value[0])==null?void 0:N.row.label;u.value=V!=null?V:null,e.nextTick(()=>E())}function y(){H()}function C(){l("reset"),e.nextTick(()=>R())}function D(){l("save")}return e.watch(()=>[c.value,u.value,t.channelParams],()=>{c.value&&e.nextTick(()=>E())},{deep:!0}),e.watch(()=>m.value?[m.value.lower,m.value.upper,m.value.gamma,m.value.color]:null,()=>{c.value&&e.nextTick(()=>E())},{deep:!0}),e.onBeforeUnmount(()=>{H()}),(V,N)=>(e.openBlock(),e.createBlock(e.unref(b.ElDialog),{modelValue:c.value,"onUpdate:modelValue":N[4]||(N[4]=$=>c.value=$),"append-to-body":!0,title:e.unref(s)("图像处理"),width:"550px",top:"6vh",draggable:"",class:"kfb-fluorescence-adjust-dialog","destroy-on-close":!1,onOpen:x,onClosed:y},{footer:e.withCtx(()=>[e.createElementVNode("div",Ml,[e.createVNode(e.unref(b.ElButton),{type:"info",onClick:C},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("重置")),1)]),_:1}),e.createVNode(e.unref(b.ElButton),{type:"primary",onClick:D},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("保存")),1)]),_:1})])]),default:e.withCtx(()=>[e.createElementVNode("div",gl,[e.createElementVNode("div",wl,[e.createElementVNode("div",yl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,({row:$,param:A})=>(e.openBlock(),e.createElementBlock("div",{key:$.label,class:e.normalizeClass(["fluo-adjust__ch-item",{"fluo-adjust__ch-item--active":$.label===u.value}]),onClick:U=>v($.label)},[e.createElementVNode("span",{class:"fluo-adjust__ch-tag",style:e.normalizeStyle({background:A.color,color:w(A.color)})},e.toDisplayString($.label),5),e.createVNode(e.unref(b.ElColorPicker),{modelValue:A.color,"onUpdate:modelValue":U=>A.color=U,"show-alpha":"",size:"small",onChange:R},null,8,["modelValue","onUpdate:modelValue"])],10,_l))),128))]),e.createElementVNode("button",{type:"button",class:"fluo-adjust__update-btn",onClick:Y},e.toDisplayString(e.unref(s)("更新通道")),1)]),m.value?(e.openBlock(),e.createElementBlock("div",kl,[e.createElementVNode("div",Cl,[e.createElementVNode("div",Vl,[e.createElementVNode("div",bl,e.toDisplayString(e.unref(s)("图像调整")),1),e.createElementVNode("canvas",{ref_key:"curveCanvasRef",ref:p,class:"fluo-adjust__curve-canvas",width:"268",height:"208",onMousedown:e.withModifiers(P,["prevent"])},null,544)]),e.createElementVNode("div",El,[e.createVNode(e.unref(b.ElSlider),{modelValue:m.value.gamma,"onUpdate:modelValue":N[0]||(N[0]=$=>m.value.gamma=$),vertical:"",height:"140px",min:.5,max:3.5,step:.01,onInput:G},null,8,["modelValue"]),e.createElementVNode("span",xl,e.toDisplayString(e.unref(s)("伽马值")),1),e.createElementVNode("span",Nl,e.toDisplayString(m.value.gamma.toFixed(2)),1)])]),e.createElementVNode("div",zl,[e.createElementVNode("div",Sl,[e.createElementVNode("span",Tl,e.toDisplayString(e.unref(s)("下限位")),1),e.createVNode(e.unref(b.ElInputNumber),{modelValue:m.value.lower,"onUpdate:modelValue":N[1]||(N[1]=$=>m.value.lower=$),size:"small",min:0,max:z.value,step:1,"controls-position":"right",onChange:j},null,8,["modelValue","max"])]),e.createElementVNode("div",Bl,[e.createElementVNode("span",$l,e.toDisplayString(e.unref(s)("上限位")),1),e.createVNode(e.unref(b.ElInputNumber),{modelValue:m.value.upper,"onUpdate:modelValue":N[2]||(N[2]=$=>m.value.upper=$),size:"small",min:r.value,max:255,step:1,"controls-position":"right",onChange:j},null,8,["modelValue","min"])]),e.createElementVNode("div",Dl,[e.createElementVNode("span",Ll,e.toDisplayString(e.unref(s)("伽马值")),1),e.createVNode(e.unref(b.ElInputNumber),{modelValue:m.value.gamma,"onUpdate:modelValue":N[3]||(N[3]=$=>m.value.gamma=$),size:"small",min:.5,max:10,step:.1,"controls-position":"right",onChange:G},null,8,["modelValue"])])])])):e.createCommentVNode("",!0)])]),_:1},8,["modelValue","title"]))}}),Il=ye(Pl,[["__scopeId","data-v-0c396ba1"]]);function jt(n){const{t:o}=me();return e.computed(()=>{var c;const l=((c=n==null?void 0:n.analysis)==null?void 0:c.result)||"";return l.indexOf("疑似阳性")>-1?{type:"warning",name:l}:l.indexOf("阳性")>-1?{type:"danger",name:l}:l.indexOf("阴性")>-1?{type:"success",name:l}:l.indexOf("不合格")>-1?{type:"danger",name:l}:l.indexOf("合格")>-1?{type:"success",name:l}:{type:"info",name:l||o("未知")}})}const Rl=["element-loading-text"],Al={key:1,class:"hzzt-kfb-view__main flex align-items-center justify-content-center"},Fl={class:"hzzt-kfb-view__filter",height:"0",width:"0"},Hl={id:"colorMatrixFilter"},Ul=["values"],jl=["values"],Ol=["exponent"],ql=["exponent"],Kl=["exponent"],Wl={key:3,class:"hzzt-kfb-view__filter",height:"0",width:"0"},Gl=["id"],Yl=["values"],Zl=["tableValues"],Xl=["tableValues"],Jl=["tableValues"],Ql=["exponent"],ea=["exponent"],ta=["exponent"],na={class:"flex nowrap justify-content-center overflow-hidden"},oa=["src"],la=["src"],aa={class:"flex-1"},ra={class:"flex-1"},ia={class:"flex-1"},sa={class:"flex-1"},ua={class:"flex-1"},ca={class:"flex-1"},da=["src"],fa={key:2,class:"margin-l-2"},ma={key:10,class:"hzzt-kfb-view__watermark"},Se=e.defineComponent({name:"HzztKfbView",__name:"index",props:{slide:{},fileHandle:{},labelHandle:{},tileHandle:{},initHandle:{},zrenderUpdateHandle:{},navigatorHandle:{},pathologyHandle:{},uploadHandle:{},options:{},labelDrawing:{},process:{default:()=>J({},ct)},microscope:{default:()=>J({},Ue)},menus:{},syncPosition:{type:Boolean},syncZoom:{type:Boolean},audioType:{},watermark:{},analysis:{},aiLabelList:{},showLabel:{type:Boolean},showZrender:{type:Boolean}},emits:["tool"],setup(n,{expose:o,emit:t}){e.useCssVars(h=>({"974774ca":ue.value}));const l=n,c=t,{t:s,locale:u}=me(),p=e.ref(),_=e.ref(),m=e.ref(),z=e.ref(!1),r=e.ref({}),k=e.ref(!1),w=e.ref(0),v=e.ref(0),g=e.ref(0),d=e.ref([]),f=e.ref(!0),a=e.ref({width:0,height:0,fileNum:0,scanScale:1,fileName:"",ratiomap:{}}),i=e.useId().replace(/:/g,"_"),E=e.ref(!1),B=e.computed(()=>{var h;return!!((h=a.value.channel)!=null&&h.length)}),P=e.computed(()=>E.value&&W.value),{channelParams:L,filterMatrix:H,filterActive:W,redTransferTable:R,greenTransferTable:Y,blueTransferTable:j,gammaExponentR:G,gammaExponentG:x,gammaExponentB:y,resetToDefaults:C,displayRows:D}=hl(a),V=e.inject("show-kfb-label",e.ref(!0)),N=e.inject("show-keyboard",e.ref(!1)),$=e.inject("show-watermark",e.ref(!1)),A=e.ref(!1);let U=!1,Q,M,T,F=null;function O(){Q!==void 0&&(clearTimeout(Q),Q=void 0),M!==void 0&&(clearTimeout(M),M=void 0),T!==void 0&&(clearTimeout(T),T=void 0)}function ae(h,S=200){let I;return(...q)=>{I&&clearTimeout(I),I=setTimeout(()=>h(...q),S)}}let ke=!0;const We=ae(h=>{c("tool","rotateChange",h)},200),Ge=b.ElLoading.directive;e.watch(()=>{var h;return(h=l.slide)==null?void 0:h.file},()=>{wt(),Q=setTimeout(()=>{Q=void 0,U||vt()},100)}),e.onMounted(()=>{vt()}),e.onBeforeUnmount(()=>{U=!0,O(),wt()});const Ee=jt(l),ue=e.computed(()=>{var h,S;return`url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='150' height='100'><text x='30' y='80' font-family='Arial' font-size='16' fill='${((h=l.watermark)==null?void 0:h.color)||"rgba(0,0,0,0.2)"}' transform='rotate(-30)' text-anchor='middle'>${((S=l.watermark)==null?void 0:S.text)||"水印文字"}</text></svg>")`}),{imageProcess:he,matrixValues:Ce,saturateValues:Ie,forceRedraw:Ot}=io(l),{tailorEvent:qt,shotScreen:Kt}=so(c,s,r,v,a,e.computed(()=>l.slide)),{moveEvent:Wt,fastMove:Gt}=Po(r,v),{initSync:Yt}=Go(l,r,p);Qo(r,p);const{drawDot:Zt}=qo(),{voiceVisible:Ye,voiceForm:Ze,drawVoice:Xt,recordTime:Jt,isRecording:dt,startRecording:Qt,stopRecording:en,initVoice:tn,cancelRecord:nn,confirmRecord:on}=Ko(l,cn),{currentLabel:Xe,localLabelList:Je,isCountDrawing:Re,beginCountDraw:ln,endCountDraw:Qe,initLabel:an,jumpToLabel:ft,reloadLabelList:rn,eventHandel:sn,addHandle:un}=Oo(l,c,r,tn,et);function cn(h){un(h)}const{getHotmapUrl:dn,handlerImage:fn,hotmapLine:mn,lineMouseDown:mt,hotmapImgs:vn}=Wo(l,r,tt);function vt(){var S,I,q;if(U||!((S=l.slide)!=null&&S.file)||!l.fileHandle||k.value)return;k.value=!0;const h=Number((q=(I=l.slide)==null?void 0:I.rotate)!=null?q:0);w.value=Number.isFinite(h)?h:0,ke=!0,l.fileHandle(l.slide).then(ie=>{var Z,X,ce,_e,oe;U||(a.value=ie,d.value=(((Z=a.value)==null?void 0:Z.channel)||[]).map(te=>te.eqt_num),r.value=new ne.KfbView(se(J({el:_.value,fileName:(X=l.slide)==null?void 0:X.file,showZrender:l.showZrender,scale:a.value.scanScale,lang:(u==null?void 0:u.value)==="en-US"?"en":u==null?void 0:u.value,navigator:{style:"left: 0;bottom: 0",thumbnail:a.value.thumbnailImg,width:200,height:180},grid:{show:!1,ruler:!1,pxConversion:!0},thumb:{bgColor:"rgba(0,0,0,0)"},graduation:{show:!0,right:120,bottom:(_e=(ce=a.value)==null?void 0:ce.channel)!=null&&_e.length?120:30,tick:{number:3,height:8}},pxConversion:{units:["um","mm"],binary:1e3,imageCapRes:a.value.imageCapRes||a.value.scanResolution||1},openSeadragonOptions:{maxZoomLevel:a.value.scanScale*20,pixelsPerArrowPress:200,animationTime:0,tileSources:gt()},tileDrawing:fn,label:{drawing:(te,re,fe)=>{if(Ao(re)){const K=te.getContext("2d");K.save(),K.beginPath();const de=Ft(re),ve=Oe(re);de==="count"?(K.translate(fe.x-14,fe.y-22),Zt(K,ve)):de==="voice"?(K.translate(fe.x-16,fe.y-18),Xt(K,ve)):l.labelDrawing&&l.labelDrawing(K,re),K.restore()}}}},l.options||{}),{measure:J({defaultShow:!0,scale:.1,handler:(te,re)=>re.subType==="measure"?[...te]:[]},((oe=l.options)==null?void 0:oe.measure)||{})})),Ae(),pn(),r.value.viewer.viewport.setRotation(w.value),an(),_n(),Yt(),M=setTimeout(()=>{var te,re;M=void 0,!U&&(te=l.analysis)!=null&&te.hotmap_path&&(re=l.analysis)!=null&&re.zoom_roi&&tt({x:l.analysis.zoom_roi.x,y:l.analysis.zoom_roi.y,width:l.analysis.zoom_roi.w,height:l.analysis.zoom_roi.h},5)},200))}).finally(()=>{U||(k.value=!1,V.value||(Vt({show:!1,ruler:!1}),bt({show:!1}),T=setTimeout(()=>{T=void 0,!U&&Et(!1)},100)))})}function pn(){var S,I;const h=(I=(S=r.value)==null?void 0:S.navigator)==null?void 0:I.element;h&&(h.style.zIndex="5")}function pt(h,S,I){const q=document.createElement("canvas");q.width=h.width,q.height=h.height;const ie=q.getContext("2d");if(ie&&ie.drawImage(h,0,0),getComputedStyle(S).position==="static"&&(S.style.position="relative"),I.fillHost)q.style.cssText=["position:absolute","left:0","top:0","width:100%","height:100%","pointer-events:none",`z-index:${I.zIndex}`].join(";");else{const X=["position:absolute",`left:${I.left}px`,`top:${I.top}px`,`width:${I.width}px`,`height:${I.height}px`,"pointer-events:none",`z-index:${I.zIndex}`];I.clipPath&&X.push(`clip-path:${I.clipPath}`),q.style.cssText=X.join(";")}S.appendChild(q);let Z=!1;return()=>{Z||(Z=!0,q.remove())}}function hn(){var X,ce,_e,oe,te,re,fe;const h=[],S=(_e=(ce=(X=r.value)==null?void 0:X.viewer)==null?void 0:ce.drawer)==null?void 0:_e.canvas,I=_.value;if(S&&I){const K=S.getBoundingClientRect(),de=I.getBoundingClientRect(),ve=(te=(oe=r.value)==null?void 0:oe.navigator)==null?void 0:te.element;let Te;if(ve&&ve.style.display!=="none"){const we=ve.getBoundingClientRect();if(we.width&&we.height){const nt=we.left-K.left,ot=we.top-K.top,xt=nt+we.width,Vn=ot+we.height;if(xt>0&&Vn>0&&nt<K.width&&ot<K.height){const Nt=Math.max(0,nt),zt=Math.max(0,ot),St=Math.min(K.width,xt),Tt=K.width,Fe=K.height;Te=`polygon(0px 0px, ${Tt}px 0px, ${Tt}px ${Fe}px, ${St}px ${Fe}px, ${St}px ${zt}px, ${Nt}px ${zt}px, ${Nt}px ${Fe}px, 0px ${Fe}px)`}}}h.push(pt(S,I,{zIndex:1,left:K.left-de.left,top:K.top-de.top,width:K.width,height:K.height,clipPath:Te}))}const q=(fe=(re=r.value)==null?void 0:re.navigator)==null?void 0:fe.element,ie=q==null?void 0:q.querySelector("canvas");q&&ie&&q.style.display!=="none"&&h.push(pt(ie,q,{zIndex:2,fillHost:!0}));let Z=!1;return()=>{Z||(Z=!0,h.forEach(K=>K()))}}function Ae(){var S,I,q;const h=(q=(I=(S=r.value)==null?void 0:S.viewer)==null?void 0:I.drawer)==null?void 0:q.canvas;if(h){if(B.value){h.style.filter=P.value?`url(#${i})`:"none";return}h.style.filter="url(#colorMatrixFilter)"}}function gn(){var fe;F=null;const h=(fe=r.value)==null?void 0:fe.viewer;if(!(h!=null&&h.world))return;const S=h.world.getItemAt(0);if(!S)return;const I=hn();let q=!1,ie=0;const Z=()=>{var K;q||(q=!0,I(),clearTimeout(_e),h.removeHandler("tile-loaded",X),(K=oe==null?void 0:oe.removeHandler)==null||K.call(oe,"fully-loaded-change",ce))},X=()=>{ie++,ie>=2&&requestAnimationFrame(()=>Z())},ce=K=>{var de;K.fullyLoaded&&((de=h.forceRedraw)==null||de.call(h),requestAnimationFrame(()=>Z()))},_e=setTimeout(Z,8e3);h.addHandler("tile-loaded",X);let oe;const te=h.viewport.getZoom(),re=h.viewport.getCenter();h.world.removeItem(S),h.addTiledImage({tileSource:gt(),success:function(){var K,de,ve;h.viewport.zoomTo(te),h.viewport.panTo(re),Ae(),oe=(K=h.world)==null?void 0:K.getItemAt(0),(de=oe==null?void 0:oe.addHandler)==null||de.call(oe,"fully-loaded-change",ce),(ve=h.forceRedraw)==null||ve.call(h)}})}function ht(){var h,S,I;(I=(S=(h=r.value)==null?void 0:h.viewer)==null?void 0:S.forceRedraw)==null||I.call(S)}function wn(){c("tool","save_fluorescence_channel",JSON.parse(JSON.stringify(L)))}e.watch(B,()=>Ae(),{flush:"post"}),e.watch(P,()=>Ae(),{flush:"post"}),e.watch([H,R,Y,j,G,x,y],()=>{B.value&&P.value&&ht()});function yn(){var ie,Z;const h=a.value.tileWidth||a.value.imageBlockLen||256,S=a.value.tileHeight||a.value.imageBlockLen||256,I={};(ie=l.analysis)!=null&&ie.hotmap_path&&(((Z=l.analysis)==null?void 0:Z.hotmap_info)||[]).forEach(X=>{I[X[0]/h+"_"+X[1]/S+"_"+X[2]]=!0});let q=10;return a.value.ratiomap&&Object.keys(a.value.ratiomap).forEach(X=>{const ce=a.value.fileNum-Math.sqrt(a.value.scanScale/Number(X));ce>0&&(q=q?Math.min(q,ce):ce)}),{height:a.value.height,width:a.value.width,tileWidth:h,tileHeight:S,minLevel:Math.floor(q||8),getTileUrl:(X,ce,_e)=>{var fe,K,de,ve,Te;const oe=X,te={file:((fe=l.slide)==null?void 0:fe.file)||"",x:ce,y:_e,scale:"0",level:X,channel:ll(a.value,d.value)};a.value.fileNum===X?(X=a.value.scanScale,te.scale=X.toFixed(6)):(X=a.value.scanScale/Math.pow(2,a.value.fileNum-X),te.scale=X.toFixed(6)),te.level=oe,te.file=g.value===0?te.file:((de=(K=l.slide)==null?void 0:K.children)==null?void 0:de[g.value-1])||"";const re=l.tileHandle(te,l.slide);return(ve=l.analysis)!=null&&ve.hotmap_path?(I.length||(((Te=l.analysis)==null?void 0:Te.hotmap_info)||[]).forEach(we=>{I[we[0]/h+"_"+we[1]/S+"_"+we[2]]=!0}),dn(re,te,I)):re}}}function gt(){return F||(F=yn()),F}function _n(){r.value.viewer.addHandler("rotate",h=>{w.value=h.degrees||0,!ke&&(console.log("rotateChange",w.value,"isInitRotate",ke),We(w.value))}),r.value.viewer.addHandler("zoom",h=>{const S=r.value.viewer.viewport.viewportToImageZoom(h.zoom||0)*Number(r.value.$options.scale);v.value=Number(S.toFixed(2))}),r.value.$on(ne.KfbView.events.EVENT_NAVIGATOR_VESTIGE,h=>{l.navigatorHandle&&l.navigatorHandle("add",l.slide,h)}),l.navigatorHandle&&l.navigatorHandle("list",l.slide).then(h=>{var S,I;(I=(S=r.value.navigator)==null?void 0:S.drawPointList)==null||I.call(S,h)}),qt(),Wt(),ke=!1}function wt(){var h;if(O(),F=null,E.value=!1,!!((h=r.value)!=null&&h.destroy)){try{r.value.destroy()}catch(S){console.warn("kfbView destroy error:",S)}r.value={},a.value={width:0,height:0,fileNum:0,scanScale:1,fileName:"",ratiomap:{}},vn.value=[],d.value=[],v.value=0,w.value=0,g.value=0}}function yt(h,S){h==="annotate"?_t(S):h==="info"?z.value=!0:h==="flip"?Ct():h==="delete"?sn("delete")(Xe.value):c("tool",h,S)}function _t(h){if(h.tool==="Voice"&&(h.subType="voice",h.tool="Dot",h.custom=!0),h.tool==="Measure"&&(h.subType="measure",h.tool="Line"),(h==null?void 0:h.subType)==="count"){Object.assign(h,J({once:!1,clear:!0,custom:!0},je));const S=Oe(h);S&&S!==Ne&&ln(S)}r.value.board.startDraw(h)}function kt(){if(Re.value){Qe(),c("tool","count-draw-end");return}const h=r.value.board;h!=null&&h.isInDraw&&h.endDraw&&h.endDraw()}function Ct(){r.value.viewer.viewport.toggleFlip()}function kn(h){var S,I;(I=(S=m.value)==null?void 0:S.scopeChange)==null||I.call(S,h)}function Cn(){z.value=!0}function Vt(h){var S;(S=r.value)!=null&&S.grid&&r.value.grid.updated(h)}function bt(h){var S;(S=r.value)!=null&&S.graduation&&r.value.graduation.updated(h)}function Et(h){var S;(S=r.value)!=null&&S.navigator&&(r.value.navigator.element.style.display=h?"flex":"none")}function et(h){const S=r.value.viewer.viewport.imageToViewportZoom(Number(h/r.value.$options.scale));r.value.viewer.viewport.zoomTo(S)}function tt(h,S){r.value.area&&(r.value.area.moveToLabel(r.value.viewer.viewport.imageToViewportCoordinates(h.x+h.width/2,h.y+h.height/2)),et(S))}return e.provide("kfbView",r),e.provide("currentLabel",Xe),e.provide("is-count-drawing",Re),e.provide("end-count-draw",()=>{Re.value?(Qe(),c("tool","count-draw-end")):kt()}),o({kfbView:r,degrees:w,zoom:v,localLabelList:Je,isCountDrawing:Re,forceRedraw:Ot,toggleFlip:Ct,startDraw:_t,endDraw:kt,endCountDraw:Qe,shotScreen:Kt,info:Cn,scopeChange:kn,updateGrid:Vt,updateGraduation:bt,updateNavigator:Et,fastMove:Gt,zoomTo:et,jumpToLabel:ft,jumpToPosition:tt,reloadLabelList:rn,isFluorescenceSlide:()=>{var h,S;return!!((S=(h=a.value)==null?void 0:h.channel)!=null&&S.length)},openFluorescenceChannelAdjust:()=>{var h,S;(S=(h=a.value)==null?void 0:h.channel)!=null&&S.length&&(E.value=!0)}}),(h,S)=>{var I,q,ie;return e.openBlock(),e.createElementBlock("div",{ref_key:"mainKfbViewRef",ref:p,class:"hzzt-kfb-view"},[h.slide.file?e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"kfbViewMainRef",ref:_,class:"hzzt-kfb-view__main","element-loading-text":e.unref(s)("加载中"),"element-loading-background":"rgba(0, 0, 0, 0.8)"},null,8,Rl)),[[e.unref(Ge),k.value]]):(e.openBlock(),e.createElementBlock("div",Al,S[6]||(S[6]=[e.createElementVNode("img",{style:{width:"50%"},src:Ve},null,-1)]))),h.analysis&&h.analysis.result?(e.openBlock(),e.createBlock(e.unref(b.ElTag),{key:2,class:"hzzt-kfb-view__tag",type:e.unref(Ee).type},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(Ee).name),1)]),_:1},8,["type"])):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",Fl,[e.createElementVNode("filter",Hl,[e.createElementVNode("feColorMatrix",{values:e.unref(Ce),type:"matrix"},null,8,Ul),e.createElementVNode("feColorMatrix",{values:e.unref(Ie),type:"saturate"},null,8,jl),e.createElementVNode("feComponentTransfer",null,[e.createElementVNode("feFuncR",{id:"feFuncR",type:"gamma",exponent:e.unref(he).ga,amplitude:"1",offset:"0"},null,8,Ol),e.createElementVNode("feFuncG",{id:"feFuncG",type:"gamma",exponent:e.unref(he).ga,amplitude:"1",offset:"0"},null,8,ql),e.createElementVNode("feFuncB",{id:"feFuncB",type:"gamma",exponent:e.unref(he).ga,amplitude:"1",offset:"0"},null,8,Kl)])])])),B.value?(e.openBlock(),e.createElementBlock("svg",Wl,[e.createElementVNode("filter",{id:e.unref(i),"color-interpolation-filters":"sRGB"},[e.createElementVNode("feColorMatrix",{type:"matrix",values:e.unref(H)},null,8,Yl),e.createElementVNode("feComponentTransfer",null,[e.createElementVNode("feFuncR",{type:"table",tableValues:e.unref(R)},null,8,Zl),e.createElementVNode("feFuncG",{type:"table",tableValues:e.unref(Y)},null,8,Xl),e.createElementVNode("feFuncB",{type:"table",tableValues:e.unref(j)},null,8,Jl)]),e.createElementVNode("feComponentTransfer",null,[e.createElementVNode("feFuncR",{type:"gamma",amplitude:1,exponent:e.unref(G)},null,8,Ql),e.createElementVNode("feFuncG",{type:"gamma",amplitude:1,exponent:e.unref(x)},null,8,ea),e.createElementVNode("feFuncB",{type:"gamma",amplitude:1,exponent:e.unref(y)},null,8,ta)])],8,Gl)])):e.createCommentVNode("",!0),e.createVNode(yo,{menus:h.menus,onTool:yt},null,8,["menus"]),e.createVNode(Co,e.mergeProps(h.microscope,{ref_key:"microscopeRef",ref:m}),null,16),e.unref(V)&&h.slide.file&&a.value.labelImg?(e.openBlock(),e.createBlock(Mo,{key:4,visible:f.value,info:a.value,slide:h.slide,pathologyHandle:h.pathologyHandle,onTool:yt},null,8,["visible","info","slide","pathologyHandle"])):e.createCommentVNode("",!0),e.unref(N)?(e.openBlock(),e.createBlock(Jo,{key:5})):e.createCommentVNode("",!0),(I=h.slide.children)!=null&&I.length?(e.openBlock(),e.createBlock(el,{key:6,modelValue:g.value,"onUpdate:modelValue":S[0]||(S[0]=Z=>g.value=Z),slides:h.slide.children},null,8,["modelValue","slides"])):e.createCommentVNode("",!0),(ie=(q=a.value)==null?void 0:q.channel)!=null&&ie.length?(e.openBlock(),e.createBlock(il,{key:7,modelValue:d.value,"onUpdate:modelValue":S[1]||(S[1]=Z=>d.value=Z),info:a.value,onLoad:gn},null,8,["modelValue","info"])):e.createCommentVNode("",!0),e.unref(Je).length?(e.openBlock(),e.createBlock(ml,{key:8,expand:A.value,"onUpdate:expand":S[2]||(S[2]=Z=>A.value=Z),style:e.normalizeStyle({top:h.analysis&&h.analysis.result?"24px":"4px"}),annotation:e.unref(Xe),annotations:e.unref(Je),onSelect:e.unref(ft)},null,8,["expand","style","annotation","annotations","onSelect"])):e.createCommentVNode("",!0),e.createVNode(e.unref(b.ElDialog),{modelValue:z.value,"onUpdate:modelValue":S[3]||(S[3]=Z=>z.value=Z),"append-to-body":!0,title:e.unref(s)("图像信息"),width:"700px",top:"5vh"},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElForm),{"label-position":"left"},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElFormItem),{class:"flex","label-width":"0px"},{default:e.withCtx(()=>[e.createElementVNode("div",na,[e.createElementVNode("img",{src:a.value.labelImg,style:{height:"180px",width:"auto","object-fit":"contain",background:"#f5f5f5"}},null,8,oa),e.createElementVNode("img",{src:a.value.previewImg,style:{height:"180px","object-fit":"cover"},class:"flex-1"},null,8,la)])]),_:1}),e.createVNode(e.unref(b.ElFormItem),{label:e.unref(s)("文件名")},{default:e.withCtx(()=>[e.createElementVNode("span",aa,e.toDisplayString(a.value.fileName),1)]),_:1},8,["label"]),e.createVNode(e.unref(b.ElFormItem),{label:e.unref(s)("图像像素")},{default:e.withCtx(()=>[e.createElementVNode("span",ra,e.toDisplayString(a.value.width)+"Pixel - "+e.toDisplayString(a.value.height)+"Pixel",1)]),_:1},8,["label"]),e.createVNode(e.unref(b.ElFormItem),{label:e.unref(s)("扫描倍率")},{default:e.withCtx(()=>[e.createElementVNode("span",ia,e.toDisplayString(a.value.scanScale),1)]),_:1},8,["label"]),e.createVNode(e.unref(b.ElFormItem),{label:e.unref(s)("扫描时刻")},{default:e.withCtx(()=>[e.createElementVNode("span",sa,e.toDisplayString(a.value.scanTime),1)]),_:1},8,["label"]),e.createVNode(e.unref(b.ElFormItem),{label:e.unref(s)("扫描时间")},{default:e.withCtx(()=>[e.createElementVNode("span",ua,e.toDisplayString(a.value.scanDuration||0)+"s",1)]),_:1},8,["label"]),a.value.ext?(e.openBlock(),e.createBlock(e.unref(b.ElFormItem),{key:0,label:e.unref(s)("扫描设备")},{default:e.withCtx(()=>[e.createElementVNode("span",ca,e.toDisplayString(a.value.ext.machineNum||""),1)]),_:1},8,["label"])):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["modelValue","title"]),e.createVNode(e.unref(b.ElDialog),{modelValue:e.unref(Ye),"onUpdate:modelValue":S[4]||(S[4]=Z=>e.isRef(Ye)?Ye.value=Z:null),"append-to-body":!0,title:e.unref(s)("语音输入"),width:"500px",top:"5vh"},{footer:e.withCtx(()=>[e.createVNode(e.unref(b.ElButton),{onClick:e.unref(nn)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("取消")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(b.ElButton),{type:"primary",onClick:e.unref(on)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("确定")),1)]),_:1},8,["onClick"])]),default:e.withCtx(()=>[e.createVNode(e.unref(b.ElForm),{"label-position":"left"},{default:e.withCtx(()=>{var Z;return[e.createVNode(e.unref(b.ElFormItem),null,{default:e.withCtx(()=>{var X;return[(X=e.unref(Ze))!=null&&X.src?(e.openBlock(),e.createElementBlock("audio",{key:0,class:"width-100%",src:e.unref(Ze).src,controls:"",preload:"auto"},null,8,da)):e.createCommentVNode("",!0)]}),_:1}),(Z=e.unref(Ze))!=null&&Z.src?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(b.ElFormItem),{key:0},{default:e.withCtx(()=>[e.unref(dt)?(e.openBlock(),e.createBlock(e.unref(b.ElButton),{key:1,type:"danger",onClick:e.unref(en)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("结束录音")),1)]),_:1},8,["onClick"])):(e.openBlock(),e.createBlock(e.unref(b.ElButton),{key:0,type:"primary",onClick:e.unref(Qt)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("开始录音")),1)]),_:1},8,["onClick"])),e.unref(dt)?(e.openBlock(),e.createElementBlock("span",fa,e.toDisplayString(e.unref(s)("录音时长"))+":"+e.toDisplayString(e.unref(Jt))+"s",1)):e.createCommentVNode("",!0)]),_:1}))]}),_:1})]),_:1},8,["modelValue","title"]),h.analysis&&h.analysis.hotmap_path&&h.analysis.hotmap_type!=="switch"?(e.openBlock(),e.createElementBlock("div",{key:9,class:"hzzt-kfb-view__hotmap",style:e.normalizeStyle({left:e.unref(mn)+"px"})},[e.createVNode(e.unref(b.ElIcon),{class:"icon-caret-left",size:"30",onMousedown:e.unref(mt)},{default:e.withCtx(()=>S[7]||(S[7]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M672 192 288 511.936 672 832z"})],-1)])),_:1,__:[7]},8,["onMousedown"]),e.createVNode(e.unref(b.ElIcon),{class:"icon-caret-right",size:"30",onMousedown:e.unref(mt)},{default:e.withCtx(()=>S[8]||(S[8]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M384 192v640l384-320.064z"})],-1)])),_:1,__:[8]},8,["onMousedown"])],4)):e.createCommentVNode("",!0),e.unref($)?(e.openBlock(),e.createElementBlock("div",ma)):e.createCommentVNode("",!0),e.createVNode(Il,{modelValue:E.value,"onUpdate:modelValue":S[5]||(S[5]=Z=>E.value=Z),"display-rows":e.unref(D),"channel-params":e.unref(L),onApply:ht,onReset:e.unref(C),onSave:wn},null,8,["modelValue","display-rows","channel-params","onReset"]),e.renderSlot(h.$slots,"default")],512)}}});function va(n,o){var f;const t=be.useStorage("default-open-ai",!!((f=n.ai)!=null&&f.default)),l=e.ref(t.value),c=e.ref(t.value),s=e.ref([]),u=e.computed(()=>{var a,i,E,B;return(a=o.value)!=null&&a.analysis?Object.prototype.toString.call((i=o.value)==null?void 0:i.analysis)==="[object Array]"?(E=o.value)==null?void 0:E.analysis:[(B=o.value)==null?void 0:B.analysis]:[]}),p=e.computed(()=>u.value.find(a=>(a==null?void 0:a.class)==="IQC")),_=e.computed(()=>!!p.value),m=e.computed(()=>u.value.find(a=>(a==null?void 0:a.class)!=="IQC")),z=e.computed(()=>!!m.value),r=e.computed(()=>l.value?m.value:c.value?p.value:void 0);e.watch(()=>{var a;return(a=o==null?void 0:o.value)==null?void 0:a.id},()=>{k(),w()}),e.onMounted(()=>{k(),w()});function k(){z.value&&l.value&&(c.value=!1),_.value&&c.value&&(l.value=!1)}function w(){var a;(a=o.value)!=null&&a.id&&u.value.length?z.value&&l.value||_.value&&c.value?v():s.value=[]:s.value=[]}function v(){n.ai.handle(o.value,r.value).then(a=>{s.value=a}).catch(()=>{s.value=[]})}function g(){c.value=!1,w()}function d(){l.value=!1,w()}return{hasAi:z,hasIqc:_,currentAnalysis:r,aiLabelList:s,enableAi:l,enableIqc:c,toggleIqc:d,toggleAi:g}}var pa=e.defineComponent({name:"Edit",__name:"edit",setup(n){return(o,t)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"}),e.createElementVNode("path",{fill:"currentColor",d:"m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"})]))}}),ha=pa,ga=e.defineComponent({name:"View",__name:"view",setup(n){return(o,t)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),wa=ga;const ya=["src"],_a=["src"],He=e.defineComponent({name:"KfbImage",__name:"KfbImage",props:{src:{type:String,required:!0,default:""},fit:{type:String,validator:n=>["","contain","cover","fill","none","scale-down"].includes(n),default:""},retryTimes:{type:Number,default:0},load:{type:Function,default:()=>({})},hover:{type:Boolean,default:!1}},setup(n){const o=n;let t=0;const l=e.ref(!1),c=e.reactive({x:0,y:0}),s=e.computed(()=>J({height:"100%",width:"100%",display:"block"},o.fit?{objectFit:o.fit}:{})),u=e.computed(()=>({top:`${c.y+10}px`,left:`${c.x}px`,transform:"translateY(-50%)",width:`${4*300/3}px`,height:"300px",background:"rgba(0,0,0,0.8)",zIndex:"10000"}));function p(r){const k=r.target;t<o.retryTimes?(k.src=o.src,t++):k.src=Ve}function _(r){if(!o.hover)return;if(r.target){const d=r.target,f=d.tagName;let a="";if(d.tagName==="IMG"?a=d.src||"":f==="DIV"&&(a=d.children[0].src||""),a.indexOf(Ve)>-1)return}const{x:k,y:w}=m(r),v=4*300/3,g=300;c.x=Math.min(Math.max(k,v/2),window.innerWidth-v/2),c.y=Math.min(Math.max(w,g/2),window.innerHeight-g/2),l.value=!0}function m(r){const k=r.target,w=r.offsetX,v=r.offsetY,g=k.clientWidth,d=k.clientHeight;return{x:r.clientX+g-w,y:r.clientY-v+d/2}}function z(){l.value=!1}return(r,k)=>(e.openBlock(),e.createElementBlock("div",{class:"relative hzzt-kfb-image-wrap",onMouseenter:_,onMouseleave:z},[e.createElementVNode("img",{src:n.src,onError:p,style:e.normalizeStyle(s.value)},null,44,ya),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed hzzt-kfb-img-triangle-left",style:e.normalizeStyle(u.value)},[e.createElementVNode("img",{src:n.src,style:{objectFit:"contain",height:"100%",width:"100%"},onMouseenter:k[0]||(k[0]=()=>{l.value=!0}),onMouseleave:z},null,40,_a)],4)):e.createCommentVNode("",!0)]))],32))}}),ka={},Ca={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function Va(n,o){return e.openBlock(),e.createElementBlock("svg",Ca,o[0]||(o[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M160 448a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zM160 896a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32z"},null,-1)]))}const ba=ye(ka,[["render",Va]]),Ea={},xa={width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Na(n,o){return e.openBlock(),e.createElementBlock("svg",xa,o[0]||(o[0]=[e.createElementVNode("g",{id:"Frame"},[e.createElementVNode("path",{id:"Vector",d:"M5.33333 2.66659H14V3.99992H5.33333V2.66659ZM2 2.33325H4V4.33325H2V2.33325ZM2 6.99992H4V8.99992H2V6.99992ZM2 11.6666H4V13.6666H2V11.6666ZM5.33333 7.33325H14V8.66659H5.33333V7.33325ZM5.33333 11.9999H14V13.3333H5.33333V11.9999Z",fill:"currentColor","fill-opacity":"0.9"})],-1)]))}const za=ye(Ea,[["render",Na]]);function Sa(n,o){const t=new URL(n);return t.searchParams.set("file_index",String(o)),t.href}function Ta(n){return[...n].sort((o,t)=>o.left-t.left)}function Ba(n){var c,s;if(n.length<2)return null;const o=window.screenX+window.outerWidth/2,t=Ta(n);let l=t.findIndex(u=>o>=u.left&&o<u.left+u.width);return l<0&&(l=t.findIndex(u=>o>=u.left&&o<=u.left+u.width)),l<0&&(l=0),(s=(c=t[l+1])!=null?c:t[l-1])!=null?s:null}function $a(){return ge(this,null,function*(){var _,m;const n=window;if(typeof n.getScreenDetails=="function")try{const z=yield n.getScreenDetails(),r=Ba(z.screens);if(r)return{left:r.availLeft,top:r.availTop,width:Math.max(480,r.availWidth),height:Math.max(360,r.availHeight)}}catch(z){}const o=window.screen,t=(_=o.availLeft)!=null?_:0,l=(m=o.availTop)!=null?m:0,c=t+o.availWidth,s=window.screenX+window.outerWidth;return{left:Math.max(c,s),top:l,width:Math.max(480,Math.min(1600,o.availWidth)),height:Math.max(360,o.availHeight)}})}function Da(){return ge(this,arguments,function*(n={}){var _,m;const o=(_=n.url)!=null?_:window.location.href,t=(m=n.target)!=null?m:"_blank",{left:l,top:c,width:s,height:u}=yield $a(),p=["popup=yes",`left=${Math.round(l)}`,`top=${Math.round(c)}`,`width=${Math.round(s)}`,`height=${Math.round(u)}`,"noopener","noreferrer"].join(",");return window.open(o,t,p)})}const La={class:"hzzt-kfb-slides"},Ma={class:"hzzt-kfb-slides__row"},Pa={class:"hzzt-kfb-slides__top"},Ia={key:0,class:"flex align-items-center"},Ra={class:"text-primary"},Aa={key:1},Fa={class:"text-primary"},Ha={class:"flex align-items-center"},Ua={key:0},ja=["data-index","onClick","onContextmenu"],Oa={key:0},qa={class:"hzzt-kfb-slides__gallery"},Ka=["onClick"],Wa={key:0,class:"hzzt-kfb-slides__read"},Ga=["onClick"],Ya={key:1},Za={class:"hzzt-kfb-slides__unUploaded"},Xa={class:"margin-l-2 ellipsis"},Ja={key:1,class:"flex column hzzt-kfb-slides__list"},Qa={class:"hzzt-kfb-slides__header"},er={class:"w-30%"},tr={class:"w-40%"},nr={class:"w-20%"},or=["data-index","onClick","onContextmenu"],lr={key:0,style:{height:"100%",width:"100%",display:"flex","align-items":"center"}},ar={class:"w-30% flex"},rr={class:"hzzt-kfb-slides__gallery hzzt-kfb-slides__gallery--list"},ir={key:1,class:"hzzt-kfb-slides__read"},sr={class:"w-40% flex"},ur=["onClick"],cr=["onClick"],dr={key:1},fr={class:"hzzt-kfb-slides__unUploaded"},mr={class:"margin-l-2 ellipsis"},vr={class:"flex column py-2"},pr={class:"flex align-items-center justify-content-center"},hr={class:"margin-r-1"},gr={class:"margin-r-1 margin-l-2"},wr=e.defineComponent({__name:"KfbSlideList",props:{slides:{},editPathology:{type:Boolean},pathologyNumber:{}},emits:["select","tool"],setup(n,{expose:o,emit:t}){const l=n,c=t,s=e.inject("file-index",{value:0}),u=e.inject("divide",{value:!1}),p=e.inject("sync",{value:!1}),_=e.ref(!1),m=e.ref(null),z=e.ref(null),r=e.reactive({show:!1,x:0,y:0,slide:null,index:-1});let k=null;const w=e.reactive({});let v=null;const g=e.computed(()=>l.slides.filter(x=>!!x.read)),{t:d}=me();function f(x,y){return`${x}-${y}`}function a(x,y){return!!w[f(x,y)]}function i(){Object.keys(w).forEach(x=>delete w[x])}function E(){return ge(this,null,function*(){m.value&&(v==null||v.disconnect(),v=new IntersectionObserver(x=>{x.forEach(y=>{if(!y.isIntersecting)return;const C=y.target,D=C.dataset.index,V=D?Number(D):NaN;Number.isNaN(V)||(w[f(V,"label")]=!0,w[f(V,"preview")]=!0),v==null||v.unobserve(C)})},{root:m.value,rootMargin:"200px 0px",threshold:.01}),yield e.nextTick(),m.value.querySelectorAll("[data-index]").forEach(x=>v==null?void 0:v.observe(x)))})}function B(x){s.value=x,c("select",x)}function P(x){x.check=!x.check}function L(x){var V;if(!m.value)return;const y=m.value.querySelector(`[data-index="${x}"]`),C=m.value.querySelector('[data-index="0"]');if(!(y!=null&&y.getBoundingClientRect)||!(C!=null&&C.getBoundingClientRect))return;const D=(V=C.getBoundingClientRect().y)!=null?V:0;m.value.scrollTop=y.getBoundingClientRect().y-D}function H(){u.value||(p.value=!1)}function W(){r.show=!1,r.slide=null,r.index=-1,k&&(document.removeEventListener("pointerdown",k,!0),k=null)}function R(){k&&document.removeEventListener("pointerdown",k,!0),k=x=>{const y=z.value;y&&x.target instanceof Node&&y.contains(x.target)||W()},document.addEventListener("pointerdown",k,!0)}function Y(){const x=z.value;if(!x)return;const y=x.getBoundingClientRect(),C=8;let D=r.x,V=r.y;y.right>window.innerWidth-C&&(D=Math.max(C,window.innerWidth-y.width-C)),y.bottom>window.innerHeight-C&&(V=Math.max(C,window.innerHeight-y.height-C)),r.x=D,r.y=V}function j(){return ge(this,null,function*(){const x=r.index>=0?r.index:s.value,y=Sa(window.location.href,x);yield Da({url:y}),W()})}function G(x,y,C){r.x=x.clientX,r.y=x.clientY,r.slide=y,r.index=C,r.show=!0,e.nextTick(()=>{Y(),R()})}return o({jumpToSlide:L}),e.watch(()=>[l.slides.length,_.value],()=>ge(this,null,function*(){i(),yield E()}),{immediate:!0}),e.onMounted(()=>{E()}),e.onBeforeUnmount(()=>{v==null||v.disconnect(),v=null,k&&(document.removeEventListener("pointerdown",k,!0),k=null)}),(x,y)=>(e.openBlock(),e.createElementBlock("div",La,[e.createElementVNode("div",Ma,[e.createElementVNode("div",Pa,[x.editPathology?(e.openBlock(),e.createElementBlock("div",Ia,[e.createVNode(e.unref(b.ElIcon),{class:"margin-r-2 pointer text-primary",size:"16",onClick:y[0]||(y[0]=C=>c("tool","edit-pathology"))},{default:e.withCtx(()=>[e.createVNode(e.unref(ha))]),_:1}),e.createElementVNode("span",Ra,e.toDisplayString(x.pathologyNumber||e.unref(d)("未知"))+"("+e.toDisplayString(g.value.length)+"/"+e.toDisplayString(x.slides.length)+")",1)])):(e.openBlock(),e.createElementBlock("span",Aa,[e.createTextVNode(e.toDisplayString(e.unref(d)("已读"))+":",1),e.createElementVNode("span",Fa,e.toDisplayString(g.value.length),1),e.createTextVNode("/"+e.toDisplayString(x.slides.length),1)])),e.createElementVNode("div",Ha,[x.editPathology?(e.openBlock(),e.createBlock(e.unref(b.ElIcon),{key:0,class:"margin-r-2 pointer",size:"16",onClick:y[1]||(y[1]=C=>c("tool","view-all"))},{default:e.withCtx(()=>[e.createVNode(e.unref(wa))]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(b.ElIcon),{class:"margin-r-2 pointer",size:"16",color:_.value?"#999":"#000",onClick:y[2]||(y[2]=C=>_.value=!_.value)},{default:e.withCtx(()=>[e.createVNode(ba)]),_:1},8,["color"]),e.createVNode(e.unref(b.ElIcon),{class:"pointer",name:"cus-list",size:"16",color:_.value?"#000":"#999",onClick:y[3]||(y[3]=C=>_.value=!_.value)},{default:e.withCtx(()=>[e.createVNode(za)]),_:1},8,["color"])])]),e.createElementVNode("div",{class:"flex-1 overflow-auto",style:{width:"100%",padding:"0 8px"},ref_key:"slidesRef",ref:m},[_.value?(e.openBlock(),e.createElementBlock("ul",Ja,[e.createElementVNode("li",Qa,[y[7]||(y[7]=e.createElementVNode("div",{class:"w-10%"},null,-1)),e.createElementVNode("div",er,e.toDisplayString(e.unref(d)("缩略图")),1),e.createElementVNode("div",tr,e.toDisplayString(e.unref(d)("切片名")),1),e.createElementVNode("div",nr,e.toDisplayString(e.unref(d)("评分")),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.slides,(C,D)=>(e.openBlock(),e.createElementBlock("li",{key:D,"data-index":D,class:"flex align-items-center overflow-hidden hzzt-kfb-slides__row-li",style:e.normalizeStyle({backgroundColor:e.unref(s)===D?"rgba(6, 85, 195, 0.1)":"#fff"}),onClick:V=>C.isNotUpload?()=>{}:B(D),onContextmenu:e.withModifiers(V=>G(V,C,D),["prevent"])},[C.isNotUpload?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",lr,[e.createElementVNode("div",{class:"w-10% text-center",onClick:e.withModifiers(()=>{},["stop"])},[e.createVNode(e.unref(b.ElCheckbox),{modelValue:C.check,"onUpdate:modelValue":V=>C.check=V,style:{width:"14px",height:"16px"}},null,8,["modelValue","onUpdate:modelValue"])]),e.createElementVNode("div",ar,[e.createElementVNode("div",rr,[C.labelImg?(e.openBlock(),e.createBlock(He,{key:0,style:e.normalizeStyle({transform:`rotate(${C.angle}deg)`}),"retry-times":1,src:a(D,"label")?C.labelImg:e.unref(Ve),fit:"contain",class:"hzzt-kfb-slides__list-thumb hzzt-kfb-slides__list-thumb--label"},null,8,["style","src"])):e.createCommentVNode("",!0),e.createVNode(He,{"retry-times":1,fit:"cover",src:a(D,"preview")?C.previewImg:e.unref(Ve),class:"hzzt-kfb-slides__list-thumb"},null,8,["src"]),C.read?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ir,e.toDisplayString(e.unref(d)("未读")),1))])]),e.createElementVNode("div",sr,[e.createVNode(e.unref(b.ElTooltip),{effect:"dark",placement:"bottom",content:`${C.name}`},{default:e.withCtx(()=>[e.createElementVNode("span",{style:{"line-height":"16px"},class:"margin-l-1 ellipsis hzzt-kfb-slides__text",dir:"rtl",onClick:e.withModifiers(V=>P(C),["stop"])},e.toDisplayString(C.name),9,ur)]),_:2},1032,["content"])]),e.createElementVNode("div",{class:"w-20% flex text-center pointer",style:e.normalizeStyle({color:C.gradeColor}),onClick:V=>c("tool","grade",C)},e.toDisplayString(C.grade),13,cr)])),C.isNotUpload?(e.openBlock(),e.createElementBlock("div",dr,[e.createElementVNode("span",fr,e.toDisplayString(e.unref(d)("未扫描")),1),e.createElementVNode("span",mr,e.toDisplayString(C.name),1)])):e.createCommentVNode("",!0)],44,or))),128))])):(e.openBlock(),e.createElementBlock("div",Ua,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.slides,(C,D)=>(e.openBlock(),e.createElementBlock("div",{key:D,class:e.normalizeClass(["hzzt-kfb-slides__box",e.unref(s)===D?"hzzt-kfb-slides__box--active":""]),"data-index":D,onClick:V=>C.isNotUpload?()=>{}:B(D),onContextmenu:e.withModifiers(V=>G(V,C,D),["prevent"])},[C.isNotUpload?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Oa,[e.createElementVNode("div",qa,[C.labelImg?(e.openBlock(),e.createBlock(He,{key:0,style:e.normalizeStyle({transform:`rotate(${C.angle}deg)`}),"retry-times":1,src:a(D,"label")?C.labelImg:e.unref(Ve),class:"hzzt-kfb-slides__img hzzt-kfb-slides__img--label",fit:"contain"},null,8,["style","src"])):e.createCommentVNode("",!0),e.createVNode(He,{"retry-times":1,src:a(D,"preview")?C.previewImg:e.unref(Ve),class:"hzzt-kfb-slides__img1",fit:"cover"},null,8,["src"])]),e.createElementVNode("div",{class:"flex justify-content-between align-items-center",onClick:e.withModifiers(()=>{},["stop"])},[e.createVNode(e.unref(b.ElCheckbox),{modelValue:C.check,"onUpdate:modelValue":V=>C.check=V,style:{width:"14px",height:"16px"}},null,8,["modelValue","onUpdate:modelValue"]),e.createVNode(e.unref(b.ElTooltip),{effect:"dark",placement:"bottom",content:`${C.name}`},{default:e.withCtx(()=>[e.createElementVNode("span",{style:{"line-height":"16px","text-align":"center",width:"calc(100% - 14px)"},class:"margin-l-1 ellipsis",onClick:e.withModifiers(V=>P(C),["stop"])},e.toDisplayString(C.name),9,Ka)]),_:2},1032,["content"])]),C.read?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Wa,e.toDisplayString(e.unref(d)("未读")),1)),e.renderSlot(x.$slots,"slide-extra",{slide:C},void 0,!0),C.grade?(e.openBlock(),e.createElementBlock("div",{key:1,class:"hzzt-kfb-slides__grade",style:e.normalizeStyle({background:C.gradeColor}),onClick:V=>c("tool","grade",C)},e.toDisplayString(C.grade),13,Ga)):e.createCommentVNode("",!0),e.renderSlot(x.$slots,"slide",{slide:C},void 0,!0)])),C.isNotUpload?(e.openBlock(),e.createElementBlock("div",Ya,[e.createElementVNode("span",Za,e.toDisplayString(e.unref(d)("未扫描")),1),e.createElementVNode("span",Xa,e.toDisplayString(C.name),1)])):e.createCommentVNode("",!0)],42,ja))),128))]))],512),e.renderSlot(x.$slots,"footer",{},void 0,!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[r.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"hzzt-kfb-slides__ctx-mask",onClick:W,onContextmenu:e.withModifiers(W,["prevent"])},null,32)):e.createCommentVNode("",!0),r.show?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"contextMenuPanelRef",ref:z,class:"hzzt-kfb-slides__ctx-panel",style:e.normalizeStyle({left:`${r.x}px`,top:`${r.y}px`}),role:"menu",onClick:y[4]||(y[4]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(x.$slots,"slide-contextmenu",{slide:r.slide,index:r.index,close:W,openOnOtherScreen:j},()=>[e.createElementVNode("button",{type:"button",class:"hzzt-kfb-slides__ctx-item",onClick:j},e.toDisplayString(e.unref(d)("在新窗口打开")),1)],!0)],4)):e.createCommentVNode("",!0)])),e.createElementVNode("div",vr,[e.createElementVNode("div",pr,[e.createElementVNode("span",hr,e.toDisplayString(e.unref(d)("分屏")),1),e.createVNode(e.unref(b.ElSwitch),{onChange:H,modelValue:e.unref(u),"onUpdate:modelValue":y[5]||(y[5]=C=>e.isRef(u)?u.value=C:null)},null,8,["modelValue"]),e.createElementVNode("span",gr,e.toDisplayString(e.unref(d)("同步")),1),e.createVNode(e.unref(b.ElSwitch),{disabled:!e.unref(u),modelValue:e.unref(p),"onUpdate:modelValue":y[6]||(y[6]=C=>e.isRef(p)?p.value=C:null)},null,8,["disabled","modelValue"])])])])]))}}),yr=ye(wr,[["__scopeId","data-v-bfe84887"]]),_r={class:"hzzt-kfb-ai overflow-hidden"},kr={class:"flex align-items-center margin-t-1"},Cr=["onClick"],Vr={style:{color:"var(--el-color-success)"}},br={class:"flex-1 flex overflow-auto wrap margin-t-1"},Er=["onClick"],xr={key:0,style:{"margin-left":"2px"}},Nr=e.defineComponent({name:"KfbAiList",__name:"list",props:{data:{default:()=>[]},analysis:{}},setup(n,{expose:o}){const t=n,{t:l}=me(),c=e.inject("kfbViewRef"),s=e.ref(-1),u=e.ref(1),p=e.ref(100),_=e.ref(!0),m=e.ref([]),z=e.computed(()=>t.data.filter(B=>m.value.includes(B.cls||""))),r=e.computed(()=>z.value.slice((u.value-1)*p.value,u.value*p.value)),k=e.computed(()=>{const B=new Set;return t.data.forEach(P=>{const L=P.cls||"";L&&!B.has(L)&&B.add(L)}),Array.from(B)}),w=e.computed(()=>m.value.length!==0&&m.value.length!==k.value.length),v=jt(t);e.watch(()=>k.value,B=>{g(),m.value=[...B]}),e.onMounted(()=>{m.value=[...k.value]});function g(){s.value=-1,u.value=1,p.value=100,_.value=!0}function d(B){const P=z.value.findIndex(L=>L.id===B.id);s.value=P,c.value.jumpToLabel(B,5)}function f(B){const P=t.data.filter(L=>L.cls===B);return P.length?`(${P.length})`:""}function a(){s.value=-1,_.value=m.value.length==k.value.length}function i(B){m.value=B?[...k.value]:[],s.value=-1}function E(B,P){B.stopPropagation(),B.preventDefault(),m.value=[P],a()}return o({labelList:z}),(B,P)=>(e.openBlock(),e.createElementBlock("div",_r,[e.createElementVNode("div",kr,[e.createVNode(e.unref(b.ElPopover),{placement:"bottom",trigger:"click",width:"160"},{reference:e.withCtx(()=>[e.createVNode(e.unref(b.ElButton),{class:"margin-r-1",type:"primary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("分类"))+" ",1),e.createVNode(le,{name:"arrowDown"})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createVNode(e.unref(b.ElCheckbox),{modelValue:_.value,"onUpdate:modelValue":P[0]||(P[0]=L=>_.value=L),indeterminate:w.value,onChange:i},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("全选")),1)]),_:1},8,["modelValue","indeterminate"]),e.createVNode(e.unref(b.ElCheckboxGroup),{modelValue:m.value,"onUpdate:modelValue":P[1]||(P[1]=L=>m.value=L),class:"flex column",onChange:a},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,L=>(e.openBlock(),e.createBlock(e.unref(b.ElCheckbox),{key:L,value:L},{default:e.withCtx(()=>[e.createElementVNode("p",{onClick:H=>E(H,L)},[e.createTextVNode(e.toDisplayString(L),1),e.createElementVNode("span",Vr,e.toDisplayString(f(L)),1)],8,Cr)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])])]),_:1}),e.createVNode(e.unref(b.ElTag),{type:e.unref(v).type,class:"margin-l-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(v).name),1)]),_:1},8,["type"])]),e.renderSlot(B.$slots,"default",{analysis:B.analysis}),e.createElementVNode("div",br,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(L,H)=>(e.openBlock(),e.createElementBlock("div",{key:H+(u.value-1)*p.value,class:e.normalizeClass(`hzzt-kfb-ai__img ${s.value===H+(u.value-1)*p.value?"hzzt-kfb-ai__img--active":""}`),onClick:W=>d(L)},[e.createVNode(e.unref(Sn),{"retry-times":1,src:L.imageUrl,"error-src":e.unref(Ve)},null,8,["src","error-src"]),e.createElementVNode("div",{style:e.normalizeStyle({color:L.strokeStyle}),class:"ellipsis"},[e.createTextVNode(e.toDisplayString(L.cls)+" ",1),L.score?(e.openBlock(),e.createElementBlock("span",xr,e.toDisplayString(L.score),1)):e.createCommentVNode("",!0)],4)],10,Er))),128))]),e.createVNode(e.unref(b.ElPagination),{class:"wrap","current-page":u.value,"onUpdate:currentPage":P[2]||(P[2]=L=>u.value=L),"page-size":p.value,"onUpdate:pageSize":P[3]||(P[3]=L=>p.value=L),"page-sizes":[100,200,300,400],layout:"total, sizes, prev, pager, next",total:z.value.length},null,8,["current-page","page-size","total"])]))}}),zr={class:"hzzt-kfb-slide"},Sr={class:"flex flex-1 overflow-hidden"},Tr={class:"flex flex-1"},Br={key:0,style:{height:"100%",width:"100%"},class:"flex wrap"},$r=["onClick"],qe=e.defineComponent({name:"HzztKfbSlide",__name:"HzztKfbSlide",props:e.mergeModels({menus:{default:()=>[]},kfb:{},slides:{default:()=>[]},ai:{},teleport:{type:Boolean,default:!1},watermark:{},process:{},microscope:{},showList:{type:Boolean,default:!0},showKfbLabel:{type:Boolean,default:!0},showKeyboard:{type:Boolean,default:!1},showMenuText:{type:Boolean,default:!0},showWatermark:{type:Boolean,default:!1},showZrender:{type:Boolean,default:!1},editPathology:{type:Boolean,default:!1},pathologyNumber:{}},{index:{default:0},indexModifiers:{}}),emits:e.mergeModels(["tool"],["update:index"]),setup(n,{expose:o,emit:t}){const l=n,c=t,s=e.useSlots(),u=e.useModel(n,"index"),p=e.computed(()=>l.slides[u.value]),_=e.computed(()=>l.slides.filter(({check:T})=>T)),m=e.ref(),z=e.ref(),r=e.ref(),k=e.ref(),w=be.useStorage("kfb-showKeyboard",l.showKeyboard),v=be.useStorage("kfb-showKfbLabel",l.showKfbLabel),g=be.useStorage("kfb-showWatermark",l.showWatermark),d=be.useStorage("kfb-showMenuText",l.showMenuText),f=be.useStorage("kfb-menuConfigOtherSetting",{screenshotLocally:!1,screenshotIncludeAnnotations:!0,screenshotFormat:"image/jpeg",screenshotWatermark:{time:!1,mac:!1,scale:!1,ratio:!1},screenshotSize:{w:200,h:200},labelDisplayDuration:15}).value;f.screenshotIncludeAnnotations===void 0&&(f.screenshotIncludeAnnotations=!0),f.labelDisplayDuration===void 0&&(f.labelDisplayDuration=15);const a=e.ref(!1),i=e.ref(!1),{t:E}=me(),B=e.computed(()=>{var T;if(a.value){const F=_.value.findIndex(({id:O})=>{var ae;return O===((ae=p.value)==null?void 0:ae.id)});return((T=r.value)==null?void 0:T[F])||z.value}else return z.value}),P=e.computed(()=>_.value.length<=1?{height:"100%",width:"100%"}:_.value.length<=2?{height:"100%",width:"calc((100% - 4px) / 2)"}:_.value.length<=4?{height:"calc((100% - 4px) / 2)",width:"calc((100% - 4px) / 2)"}:_.value.length<=6?{height:"calc((100% - 4px) / 2)",width:"calc((100% - 4px * 2) / 3)"}:_.value.length<=9?{height:"calc((100% - 4px * 2) / 3)",width:"calc((100% - 4px * 2) / 3)"}:{height:"100%",width:"100%"});e.watch(()=>_.value,T=>{a.value&&T.length<=1&&(a.value=!1)}),e.watch(()=>p.value,T=>{if(T){const F=T.read;T.read=!0,c("tool","choose",{slide:T,read:F})}}),Object.entries({keyboard:w,kfbLabel:v,watermark:g,menuText:d}).forEach(([T,F])=>{e.watch(()=>F.value,O=>{c("tool",T,O)})});const{hasAi:H,hasIqc:W,currentAnalysis:R,aiLabelList:Y,enableAi:j,enableIqc:G,toggleIqc:x,toggleAi:y}=va(l,p);function C(T,F){if(T==="next"&&l.slides[u.value+1]&&u.value++,T==="prev"&&l.slides[u.value-1]&&u.value--,(T==="label"||T==="tool")&&(v.value=F),T.includes("tailor")){B.value.shotScreen(T,r);return}c("tool",T,F)}function D(T){var O,ae;const F=se(J({},l.kfb),{showZrender:l.showZrender,watermark:l.watermark,process:l.process,microscope:l.microscope,slide:T,aiLabelList:p.value.id===T.id?((O=k.value)==null?void 0:O.labelList)||[]:[],syncPosition:i.value,syncZoom:i.value,handle:void 0,analysis:p.value.id===T.id?R.value:void 0});return(ae=l.kfb)!=null&&ae.handle?l.kfb.handle(T,F):F}function V(T){u.value=l.slides.findIndex(F=>F.id===T.id)}function N(T){a.value&&(l.slides[T].check=!0)}function $(){var T;(T=a.value?r.value:[z.value])==null||T.forEach(F=>{v.value||(F.updateGrid({show:v.value,ruler:v.value}),w.value=v.value),F.updateGraduation({show:v.value}),F.updateNavigator(v.value)})}function A(T){u.value=T,m.value&&m.value.jumpToSlide(T)}function U(T,F){B.value&&B.value.jumpToLabel(T,F)}function Q(T,F){B.value&&B.value.jumpToPosition(T,F)}function M(T){B.value.shotScreen(T,r)}return e.provide("kfbViewRef",B),e.provide("kfbViewRefs",r),e.provide("show-keyboard",w),e.provide("show-kfb-label",v),e.provide("show-menu-text",d),e.provide("show-watermark",g),e.provide("file-index",u),e.provide("divide",a),e.provide("sync",i),e.provide("menu-config-other-setting",f),o({divide:a,sync:i,slide:p,kfbViewRef:B,kfbViewRefs:r,jumpToSlide:A,jumpToLabel:U,jumpToPosition:Q,shotScreen:M,analysis:R,enableAi:j,enableIqc:G,showAiList:e.computed(()=>{var T;return!!((T=l.ai)!=null&&T.enable)&&Y.value.length})}),(T,F)=>(e.openBlock(),e.createElementBlock("div",zr,[T.menus.length?(e.openBlock(),e.createBlock(Le,{key:0,menu:T.menus,divideMode:a.value,process:T.process,microscope:T.microscope,onTool:C},{left:e.withCtx(()=>[e.renderSlot(T.$slots,"left")]),right:e.withCtx(()=>[e.createVNode(e.unref(b.ElSwitch),{modelValue:e.unref(v),"onUpdate:modelValue":F[0]||(F[0]=O=>e.isRef(v)?v.value=O:null),"active-text":e.unref(E)("隐藏标签"),"active-value":!1,"inactive-value":!0,class:"margin-r-2",onChange:$},null,8,["modelValue","active-text"]),T.ai&&T.ai.enable&&e.unref(W)?(e.openBlock(),e.createBlock(e.unref(b.ElSwitch),{key:0,modelValue:e.unref(G),"onUpdate:modelValue":F[1]||(F[1]=O=>e.isRef(G)?G.value=O:null),"active-text":e.unref(E)("AI质控"),class:"margin-r-2",onChange:e.unref(x)},null,8,["modelValue","active-text","onChange"])):e.createCommentVNode("",!0),T.ai&&T.ai.enable&&e.unref(H)?(e.openBlock(),e.createBlock(e.unref(b.ElSwitch),{key:1,modelValue:e.unref(j),"onUpdate:modelValue":F[2]||(F[2]=O=>e.isRef(j)?j.value=O:null),"active-text":e.unref(E)("AI分析"),class:"margin-r-2",onChange:e.unref(y)},null,8,["modelValue","active-text","onChange"])):e.createCommentVNode("",!0),e.renderSlot(T.$slots,"right")]),_:3},8,["menu","divideMode","process","microscope"])):e.createCommentVNode("",!0),e.createElementVNode("div",Sr,[T.showList?(e.openBlock(),e.createBlock(e.Teleport,{key:0,defer:"",to:"#kfb-slide-list",disabled:!T.teleport},[e.createVNode(yr,{ref_key:"slidesRef",ref:m,style:e.normalizeStyle(T.teleport?"":"width: 250px"),editPathology:T.editPathology,pathologyNumber:T.pathologyNumber,slides:T.slides,onSelect:N,onTool:C},e.createSlots({slide:e.withCtx(({slide:O})=>[e.renderSlot(T.$slots,"list",{slide:O})]),"slide-extra":e.withCtx(({slide:O})=>[e.renderSlot(T.$slots,"slide-extra",{slide:O})]),footer:e.withCtx(()=>[e.renderSlot(T.$slots,"listFooter")]),_:2},[e.unref(s)["slide-contextmenu"]?{name:"slide-contextmenu",fn:e.withCtx(O=>[e.renderSlot(T.$slots,"slide-contextmenu",e.normalizeProps(e.guardReactiveProps(O)))]),key:"0"}:void 0]),1032,["style","editPathology","pathologyNumber","slides"])],8,["disabled"])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{defer:"",to:"#kfb-slide-view",disabled:!T.teleport},[e.createElementVNode("div",Tr,[_.value.length&&a.value?(e.openBlock(),e.createElementBlock("ul",Br,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,O=>(e.openBlock(),e.createElementBlock("li",{key:O.id,style:e.normalizeStyle(P.value),class:e.normalizeClass(p.value.id===O.id?"hzzt-kfb-view-screen-active":""),onClick:ae=>V(O)},[(e.openBlock(),e.createBlock(Se,e.mergeProps({ref_for:!0,ref_key:"kfbViewRefs",ref:r,key:`kfb-${O.id}`},{ref_for:!0},D(O),{onTool:C}),{default:e.withCtx(()=>[e.renderSlot(T.$slots,"kfb",{slide:O})]),_:2},1040))],14,$r))),128))])):p.value?(e.openBlock(),e.createBlock(Se,e.mergeProps({key:1,ref_key:"kfbViewRef",ref:z},D(p.value),{onTool:C}),{default:e.withCtx(()=>[e.renderSlot(T.$slots,"kfb",{slide:p.value})]),_:3},16)):e.createCommentVNode("",!0)])],8,["disabled"])),T.ai&&T.ai.enable&&e.unref(Y).length?(e.openBlock(),e.createBlock(e.Teleport,{key:1,defer:"",to:"#kfb-slide-ai",disabled:!T.teleport},[e.createVNode(Nr,{style:e.normalizeStyle(T.teleport?"":"width: 350px"),ref_key:"kfbAiRef",ref:k,data:e.unref(Y),slide:p.value,analysis:e.unref(R)},{default:e.withCtx(({analysis:O})=>[e.renderSlot(T.$slots,"analysis",{analysis:O})]),_:3},8,["style","data","slide","analysis"])],8,["disabled"])):e.createCommentVNode("",!0),e.renderSlot(T.$slots,"default")])]))}});qe.name="HzztKfbSlide";Se.name="HzztKfbView";Le.name="HzztKfbToolbox";const Dr=(n,o)=>{n.use(Tn,o==null?void 0:o.i18n),n.component(qe.name,qe),n.component(Se.name,Se),n.component(Le.name,Le)},Lr={install:Dr};exports.DEFAULT_MICROSCOPE=Ue;exports.DEFAULT_PROCESS=ct;exports.I18N_INJECT_KEY=ut;exports._export_sfc=ye;exports._sfc_main=le;exports._sfc_main$1=qe;exports._sfc_main$2=Se;exports._sfc_main$3=Le;exports.getCountDrawStartOptions=Ro;exports.getLabelStrokeStyle=Oe;exports.index=Lr;exports.isCountDotLabel=Ke;exports.useLocalI18n=me;