@zhangqingcq/vgce 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +35 -20
- package/dist/style.css +1 -1
- package/dist/vgce.js +147 -51
- package/dist/vgce.umd.cjs +2 -2
- package/package.json +1 -1
- package/src/assets/svgs/text-box.svg +1 -0
- package/src/config/files/text-box.vue +72 -0
- package/src/config/index.ts +5 -3
- package/src/config/svg/animation/index.ts +3 -2
- package/src/config/svg/animation/thermometer.ts +2 -1
- package/src/config/svg/custom/clock-a.ts +2 -1
- package/src/config/svg/custom/index.ts +6 -5
- package/src/config/svg/custom/light.ts +2 -1
- package/src/config/svg/custom/svg-text.ts +2 -1
- package/src/config/svg/custom/switch-r.ts +2 -1
- package/src/config/svg/index.ts +6 -10
- package/src/config/svg/stateful/alert-light.ts +2 -1
- package/src/config/svg/stateful/index.ts +3 -2
- package/src/config/svg/stateless/bot-2.ts +2 -1
- package/src/config/svg/stateless/bot-9.ts +2 -1
- package/src/config/svg/stateless/hamburger.ts +2 -1
- package/src/config/svg/stateless/hotpot.ts +2 -1
- package/src/config/svg/stateless/index.ts +6 -5
- package/src/config/vue/component/button.ts +2 -1
- package/src/config/vue/component/common-table.ts +2 -1
- package/src/config/vue/component/index.ts +9 -7
- package/src/config/vue/component/now-time.ts +2 -1
- package/src/config/vue/component/progress.ts +2 -1
- package/src/config/vue/component/tag.ts +2 -1
- package/src/config/vue/component/text-box.ts +66 -0
- package/src/config/vue/echarts/index.ts +3 -2
- package/src/config/vue/echarts/pie-charts.ts +2 -1
- package/src/config/vue/index.ts +4 -3
package/dist/vgce.umd.cjs
CHANGED
@@ -195,7 +195,7 @@
|
|
195
195
|
<rect x="7" y="22.0476" width="34" height="22" rx="2" stroke="currentColor" stroke-width="4" stroke-linejoin="round" />\r
|
196
196
|
<path d="M14 22V14.0047C13.9948 8.87022 17.9227 4.56718 23.0859 4.05117C28.249 3.53516 32.9673 6.97408 34 12.0059" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" />\r
|
197
197
|
<path d="M24 30V36" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" />\r
|
198
|
-
</symbol>`,n.insertBefore(i,n.lastChild)};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",r):r()}const main="",index$2="";var ELineBindAnchors=(r=>(r.TopCenter="TopCenter",r.Left="Left",r.Right="Right",r.BottomCenter="BottomCenter",r))(ELineBindAnchors||{}),EConfigAnimationsType=(r=>(r.None="None",r.Electricity="Electricity",r.WaterDrop="WaterDrop",r.Track="Track",r))(EConfigAnimationsType||{}),EConfigItemPropsType=(r=>(r.Input="Input",r.Textarea="Textarea",r.Color="Color",r.InputNumber="InputNumber",r.Switch="Switch",r.JsonEdit="JsonEdit",r.Select="Select",r))(EConfigItemPropsType||{}),EDoneJsonType=(r=>(r.File="File",r.StraightLine="StraightLine",r.ConnectionLine="ConnectionLine",r.CustomSvg="CustomSvg",r.Vue="Vue",r))(EDoneJsonType||{}),EEventType=(r=>(r.Click="Click",r.Change="Change",r.Null="",r))(EEventType||{}),EEventAction=(r=>(r.ChangeAttr="ChangeAttr",r.JavaScript="JavaScript",r.Null="",r))(EEventAction||{}),EConditionType=(r=>(r.None="None",r.Relation="Relation",r))(EConditionType||{}),EGlobalStoreIntention=(r=>(r.None="None",r.Create="Create",r.Move="Move",r.GroupMove="GroupMove",r.MoveCanvas="MoveCanvas",r.Select="Select",r.Zoom="Zoom",r.Rotate="Rotate",r.Connection="Connection",r.SetConnectionLineNode="SetConnectionLineNode",r.ContextMenu="ContextMenu",r.SelectArea="SelectArea",r))(EGlobalStoreIntention||{}),EMouseInfoState=(r=>(r.Down="Down",r.Up="Up",r))(EMouseInfoState||{}),EScaleInfoType=(r=>(r.None="",r.TopLeft="TopLeft",r.TopCenter="TopCenter",r.TopRight="TopRight",r.Left="Left",r.Right="Right",r.BottomLeft="BottomLeft",r.BottomCenter="BottomCenter",r.BottomRight="BottomRight",r))(EScaleInfoType||{});const svg_alert_light={name:"alert-light",title:"警示灯",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{},defaultState:"white",state:{green:{label:"正常",fill:"#00ff00",fillOpacity:"1"},yellow:{label:"请注意",fill:"#ffff00",fillOpacity:"1"},red:{label:"报警",fill:"#ff0000",fillOpacity:"1"},white:{label:"关闭",fill:"#ffffff",fillOpacity:"0"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},stateful_group={groupType:"stateful",title:"状态SVG",list:[svg_alert_light]},svg_bot_2={name:"bot-2",title:"2号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{height:{title:"高度",type:EConfigItemPropsType.InputNumber,val:150},width:{title:"宽度",type:EConfigItemPropsType.InputNumber,val:120}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_bot_9={name:"bot-9",title:"9号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_hotpot={name:"hotpot",title:"火锅",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_hamburger={name:"hamburger",title:"汉堡",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},stateless_group={groupType:"stateless",title:"静态SVG",list:[svg_hamburger,svg_hotpot,svg_bot_2,svg_bot_9]},thermometer={name:"thermometer",title:"温度计",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},animation_group={groupType:"have_animation",title:"动画SVG",list:[thermometer]},svg_text={name:"svg-text",title:"文字",tag:"svg-text",type:EDoneJsonType.CustomSvg,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{text:{title:"文字内容",type:EConfigItemPropsType.Textarea,val:"文字内容"},fontFamily:{title:"字体",type:EConfigItemPropsType.Select,val:"Microsoft YaHei",options:[{value:"Microsoft YaHei",label:"微软雅黑"},{value:"NSimSun",label:"新宋体"},{value:"KaiTi",label:"楷体"}]},fontSize:{title:"文字大小",type:EConfigItemPropsType.InputNumber,val:18},fill:{title:"文字颜色",type:EConfigItemPropsType.Color,val:"#000"},bold:{title:"文字加粗",type:EConfigItemPropsType.Switch,val:!1},writingMode:{title:"文字朝向",type:EConfigItemPropsType.Select,val:"horizontal-tb",options:[{value:"horizontal-tb",label:"水平"},{value:"vertical-rl",label:"垂直"}]}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},switch_r={name:"switch-r",title:"开关",tag:"switch-r",type:EDoneJsonType.CustomSvg,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{isOpen:{title:"开关",type:EConfigItemPropsType.Switch,val:!1}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},light_a={name:"light",tag:"light-a",title:"灯",type:EDoneJsonType.CustomSvg,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{height:{title:"高度",type:EConfigItemPropsType.InputNumber,val:60},width:{title:"宽度",type:EConfigItemPropsType.InputNumber,val:50},isOpen:{title:"开关",type:EConfigItemPropsType.Switch,val:!1}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},clock_a={name:"clock-a",title:"时钟",tag:"clock-a",type:EDoneJsonType.CustomSvg,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{centerColor:{title:"针顶颜色",type:EConfigItemPropsType.Color,val:"#EBF257"},secondsColor:{title:"秒针颜色",type:EConfigItemPropsType.Color,val:"#E83E24"},circleColor:{title:"针圈颜色",type:EConfigItemPropsType.Color,val:"#F45AFC"},minutesColor:{title:"分针颜色",type:EConfigItemPropsType.Color,val:"#50E68E"},hoursColor:{title:"时针颜色",type:EConfigItemPropsType.Color,val:"#9A36E7"},scaleColor:{title:"刻度颜色",type:EConfigItemPropsType.Color,val:"#4942CF"},backgroundColor:{title:"表盘颜色",type:EConfigItemPropsType.Color,val:"#ffffff"},borderColor:{title:"表框颜色",type:EConfigItemPropsType.Color,val:"#B3A7FF"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},custom_svg_group={groupType:"custom_svg_group",title:"SVG组件",list:[svg_text,switch_r,light_a,clock_a]},svg_config=Object.seal([stateless_group,stateful_group,animation_group,custom_svg_group]),el_button={name:"el-button",tag:"el-button",title:"按钮",type:EDoneJsonType.Vue,config:{can_zoom:!1,have_anchor:!0,actual_rect:!0},display:!0,props:{size:{title:"尺寸",type:EConfigItemPropsType.Select,val:"default",options:[{label:"大",value:"large"},{label:"默认",value:"default"},{label:"小",value:"small"}]},type:{title:"类型",type:EConfigItemPropsType.Select,val:"primary",options:[{label:"主要按钮",value:"primary"},{label:"成功按钮",value:"success"},{label:"警告按钮",value:"warning"},{label:"危险按钮",value:"danger"},{label:"信息按钮",value:"info"}]},plain:{title:"朴素按钮",type:EConfigItemPropsType.Switch,val:!1},text:{title:"文字按钮",type:EConfigItemPropsType.Switch,val:!1}},tag_slot:"按钮",common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},common_table={name:"common-table",title:"通用表格",tag:"common-table",type:EDoneJsonType.Vue,config:{can_zoom:!1,have_anchor:!0,actual_rect:!0},display:!0,props:{"col-config":{title:"列配置",type:EConfigItemPropsType.JsonEdit,val:[{prop:"date",label:"第一列",width:"120px",fixed:!1,sortable:!1,"show-overflow-tooltip":!1},{prop:"name",label:"第二列",width:"120px",fixed:!1,sortable:!1,"show-overflow-tooltip":!1},{prop:"address",label:"第三列测试",width:"280px",fixed:!1,sortable:!1,"show-overflow-tooltip":!1}]},data:{title:"表格数据",type:EConfigItemPropsType.JsonEdit,val:[{date:"2016-05-03",name:"Tom",address:"No. 189, Grove St, Los Angeles"},{date:"2016-05-02",name:"Tom",address:"No. 189, Grove St, Los Angeles"},{date:"2016-05-04",name:"Tom",address:"No. 189, Grove St, Los Angeles"},{date:"2016-05-01",name:"Tom",address:"No. 189, Grove St, Los Angeles"}]},width:{title:"宽度",type:EConfigItemPropsType.InputNumber,val:500},height:{title:"高度",type:EConfigItemPropsType.InputNumber,val:200},maxHeight:{title:"最大高度",type:EConfigItemPropsType.InputNumber,val:200},stripe:{title:"斑马纹",type:EConfigItemPropsType.Switch,val:!1},border:{title:"纵向边框",type:EConfigItemPropsType.Switch,val:!1},size:{title:"尺寸",type:EConfigItemPropsType.Select,val:"default",options:[{label:"大",value:"large"},{label:"默认",value:"default"},{label:"小",value:"small"}]},fit:{title:"列宽自撑开",type:EConfigItemPropsType.Switch,val:!1}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},now_time={name:"now-time",title:"当前时间",tag:"now-time",type:EDoneJsonType.Vue,config:{can_zoom:!1,have_anchor:!1,actual_rect:!0},display:!0,props:{width:{title:"宽度",type:EConfigItemPropsType.InputNumber,val:150},fontFamily:{title:"字体",type:EConfigItemPropsType.Select,val:"Microsoft YaHei",options:[{value:"Microsoft YaHei",label:"微软雅黑"},{value:"NSimSun",label:"新宋体"},{value:"KaiTi",label:"楷体"}]},fontSize:{title:"文字大小",type:EConfigItemPropsType.InputNumber,val:18},color:{title:"文字颜色",type:EConfigItemPropsType.Color,val:"#000000"},bold:{title:"文字加粗",type:EConfigItemPropsType.Switch,val:!1}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},el_tag={name:"el-tag",tag:"el-tag",title:"标签",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{type:{title:"类型",type:EConfigItemPropsType.Select,val:"success",options:[{label:"成功",value:"success"},{label:"警告",value:"warning"},{label:"危险",value:"danger"},{label:"信息",value:"info"}]},closable:{title:"可关闭",type:EConfigItemPropsType.Switch,val:!0},"disable-transitions":{title:"渐变",type:EConfigItemPropsType.Switch,val:!1}},tag_slot:"标签",common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},progress_a={name:"progress-a",tag:"progress-a",title:"进度条",type:EDoneJsonType.Vue,config:{can_zoom:!1,have_anchor:!0,actual_rect:!0},display:!0,props:{percentage:{title:"进度",type:EConfigItemPropsType.InputNumber,val:50}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},components={groupType:"custom-vue",title:"VUE组件",list:[el_button,progress_a,common_table,now_time,el_tag]},pie_charts={name:"pie-charts",tag:"pie-charts",title:"饼图",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{title:{title:"标题",type:EConfigItemPropsType.Input,val:"默认标题"},seriesName:{title:"详情",type:EConfigItemPropsType.Input,val:"详情标题"},seriesData:{title:"legendData",type:EConfigItemPropsType.JsonEdit,val:[{value:1048,name:"办公楼A"},{value:735,name:"办公楼B"},{value:580,name:"保安室"},{value:484,name:"地下车库"},{value:300,name:"食堂"}]}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},echarts_group={groupType:"echarts",title:"图表",list:[pie_charts]},vue_config=Object.seal([components,echarts_group]),_sfc_main$L=vue.defineComponent({__name:"progress",props:{percentage:{default:10}},emits:["onChange"],setup(r,{emit:n}){const i=r,o=[{color:"#f56c6c",percentage:20},{color:"#e6a23c",percentage:40},{color:"#5cb87a",percentage:60},{color:"#1989fa",percentage:80},{color:"#6f7ad3",percentage:100}];return vue.watch(()=>i.percentage,()=>{n("onChange")}),(a,u)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElProgress),{type:"dashboard",percentage:Number(i.percentage),color:o},null,8,["percentage"]))}}),_hoisted_1$m=["id"],_hoisted_2$i=["id"],_hoisted_3$f=vue.createElementVNode("path",{d:"M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z",fill:"white","fill-opacity":".01","p-id":"1537","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"},null,-1),_hoisted_4$b=vue.createElementVNode("path",{d:"M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z m0 512 H276.48 C143.36 750.933333 34.133333 645.12 34.133333 512s109.226667-238.933333 242.346667-238.933333 H750.933333c133.12 0 242.346667 105.813333 242.346667 238.933333s-112.64 238.933333-245.76 238.933333z",fill:"#2c2c2c","p-id":"1531","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"},null,-1),_hoisted_5$9=vue.createElementVNode("path",{d:"M238.933333 409.6c-37.546667 0-68.266667 27.306667-68.266666 61.44v85.333333c0 34.133333 30.72 61.44 68.266666 61.44s68.266667-27.306667 68.266667-61.44v-85.333333c0-34.133333-30.72-61.44-68.266667-61.44z m34.133334 146.773333c0 13.653333-17.066667 23.893333-34.133334 23.893334s-34.133333-10.24-34.133333-27.306667v-85.333333c0-13.653333 17.066667-23.893333 34.133333-23.893334s34.133333 10.24 34.133334 27.306667v85.333333zM460.8 409.6c-10.24 0-17.066667 6.826667-17.066667 17.066667v109.226666l-71.68-119.466666c-3.413333-6.826667-10.24-10.24-20.48-6.826667-6.826667 3.413333-13.653333 10.24-13.653333 17.066667v170.666666c0 10.24 6.826667 17.066667 17.066667 17.066667s17.066667-6.826667 17.066666-17.066667v-109.226666l71.68 119.466666c3.413333 6.826667 10.24 6.826667 13.653334 6.826667h3.413333c6.826667-3.413333 13.653333-10.24 13.653333-17.066667v-170.666666c3.413333-10.24-3.413333-17.066667-13.653333-17.066667zM750.933333 341.333333c-95.573333 0-170.666667 75.093333-170.666666 170.666667s75.093333 170.666667 170.666666 170.666667 170.666667-75.093333 170.666667-170.666667-75.093333-170.666667-170.666667-170.666667z",fill:"#5ad562","p-id":"1530","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i1.1adc3a81uCnBP5"},null,-1),_hoisted_6$7=[_hoisted_3$f,_hoisted_4$b,_hoisted_5$9],_hoisted_7$7=["id"],_hoisted_8$7=vue.createElementVNode("path",{d:"M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z",fill:"white","fill-opacity":".01","p-id":"1536","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"},null,-1),_hoisted_9$7=vue.createElementVNode("path",{d:"M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z m0 512 H276.48 C143.36 750.933333 34.133333 645.12 34.133333 512s109.226667-238.933333 242.346667-238.933333 H750.933333c133.12 0 242.346667 105.813333 242.346667 238.933333s-112.64 238.933333-245.76 238.933333z",fill:"#2c2c2c","p-id":"1535","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"},null,-1),_hoisted_10$6=vue.createElementVNode("path",{d:"M273.066667 341.333333c-95.573333 0-170.666667 75.093333-170.666667 170.666667s75.093333 170.666667 170.666667 170.666667 170.666667-75.093333 170.666666-170.666667-75.093333-170.666667-170.666666-170.666667z",fill:"#bfbfbf","p-id":"1534","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81KYNNkt"},null,-1),_hoisted_11$5=vue.createElementVNode("path",{d:"M580.266667 409.6c-37.546667 0-68.266667 27.306667-68.266667 61.44v85.333333c0 34.133333 30.72 61.44 68.266667 61.44s68.266667-27.306667 68.266666-61.44v-85.333333c0-34.133333-30.72-61.44-68.266666-61.44z m34.133333 146.773333c0 13.653333-17.066667 27.306667-34.133333 27.306667s-34.133333-10.24-34.133334-27.306667v-85.333333c0-13.653333 17.066667-27.306667 34.133334-27.306667s34.133333 10.24 34.133333 27.306667v85.333333zM904.533333 409.6h-68.266666c-10.24 0-17.066667 6.826667-17.066667 17.066667v170.666666c0 10.24 6.826667 17.066667 17.066667 17.066667s17.066667-6.826667 17.066666-17.066667V512h17.066667c10.24 0 17.066667-6.826667 17.066667-17.066667s-6.826667-17.066667-17.066667-17.066666H853.333333v-34.133334h51.2c10.24 0 17.066667-6.826667 17.066667-17.066666s-6.826667-17.066667-17.066667-17.066667zM768 409.6h-68.266667c-10.24 0-17.066667 6.826667-17.066666 17.066667v170.666666c0 10.24 6.826667 17.066667 17.066666 17.066667s17.066667-6.826667 17.066667-17.066667V512h17.066667c10.24 0 17.066667-6.826667 17.066666-17.066667s-6.826667-17.066667-17.066666-17.066666H716.8v-34.133334h51.2c10.24 0 17.066667-6.826667 17.066667-17.066666s-6.826667-17.066667-17.066667-17.066667z",fill:"#707070","p-id":"1533","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i2.1adc3a81KYNNkt"},null,-1),_hoisted_12$5=[_hoisted_8$7,_hoisted_9$7,_hoisted_10$6,_hoisted_11$5],_hoisted_13$4=["xlink:href"],_sfc_main$K=vue.defineComponent({__name:"switch-r",props:{id:{type:String,default:""},isOpen:{type:Boolean,default:!0}},emits:["onChange"],setup(r,{emit:n}){const i=r;return vue.watch(()=>i.isOpen,()=>{n("onChange")}),(o,a)=>(vue.openBlock(),vue.createElementBlock("g",{id:i.id},[vue.createElementVNode("symbol",{viewBox:"0 0 1027 1024",id:`${i.id}switch-demo-open`},_hoisted_6$7,8,_hoisted_2$i),vue.createElementVNode("symbol",{viewBox:"0 0 1027 1024",id:`${i.id}switch-demo-close`},_hoisted_12$5,8,_hoisted_7$7),vue.createElementVNode("use",{"xlink:href":`#${i.id}switch-demo-${i.isOpen?"open":"close"}`,width:"100",height:"100"},null,8,_hoisted_13$4)],8,_hoisted_1$m))}}),_sfc_main$J=vue.defineComponent({__name:"svg-text",props:{text:{},bold:{type:Boolean}},emits:["resize"],setup(r,{emit:n}){const i=r;return vue.watch(()=>i.text,()=>{vue.nextTick(function(){n("resize")})}),(o,a)=>(vue.openBlock(),vue.createElementBlock("text",{x:"50",y:"55",style:vue.normalizeStyle({"font-weight":i.bold?"bold":"normal"})},vue.toDisplayString(i.text),5))}}),_sfc_main$I=vue.defineComponent({__name:"common-table",props:{colConfig:{default:()=>[]},data:{default:()=>[]},height:{default:200},maxHeight:{},stripe:{type:Boolean,default:!1},border:{type:Boolean,default:!1},size:{},fit:{type:Boolean,default:!1},operateDisplay:{type:Boolean,default:!1},selectionData:{default:()=>[]}},setup(r){const n=r,i=vue.ref({});return vue.watchEffect(()=>{const{colConfig:o,...a}=n;i.value=a}),(o,a)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTable),vue.normalizeProps(vue.guardReactiveProps(vue.unref(i))),{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.colConfig,u=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTableColumn),vue.mergeProps({key:u.prop},u),null,16))),128))]),_:1},16))}}),_hoisted_1$l={class:"flex mt-5px"},_sfc_main$H=vue.defineComponent({__name:"now-time",props:{width:{},fontFamily:{},color:{},fontSize:{},bold:{type:Boolean}},setup(r){const n=r,i=vue.computed(()=>({fontFamily:n.fontFamily,color:n.color,fontSize:n.fontSize+"px",fontWeight:n.bold?"bold":"normal"})),o=vue.ref(new Date),a=vue.ref(),u=vue.computed(()=>{const d=o.value.getFullYear(),h=o.value.getMonth()+1,v=o.value.getDate();return d.toString()+"年"+h.toString()+"月"+v.toString()+"日"}),c=vue.computed(()=>{const d=o.value.getDay();return["星期日","星期一","星期二","星期三","星期四","星期五","星期六"][d]}),f=vue.computed(()=>{const d=o.value.getHours(),h=o.value.getMinutes(),v=o.value.getSeconds();return(d<10?"0"+d.toString():d.toString())+":"+(h<10?"0"+h.toString():h.toString())+":"+(v<10?"0"+v.toString():v.toString())});return vue.onMounted(()=>{a.value=setInterval(()=>{o.value=new Date},500)}),vue.onUnmounted(()=>{clearInterval(a.value)}),(d,h)=>(vue.openBlock(),vue.createElementBlock("div",{class:"now-time",style:vue.normalizeStyle({width:n.width+"px"})},[vue.createElementVNode("div",{style:vue.normalizeStyle(vue.unref(i))},vue.toDisplayString(vue.unref(u)),5),vue.createElementVNode("div",_hoisted_1$l,[vue.createElementVNode("div",{style:vue.normalizeStyle(vue.unref(i))},vue.toDisplayString(vue.unref(c)),5),vue.createElementVNode("div",{style:vue.normalizeStyle(vue.unref(i))},vue.toDisplayString(vue.unref(f)),5)])],4))}}),nowTime_vue_vue_type_style_index_0_scoped_82ca3b84_lang="",_export_sfc$1=(r,n)=>{const i=r.__vccOpts||r;for(const[o,a]of n)i[o]=a;return i},NowTime=_export_sfc$1(_sfc_main$H,[["__scopeId","data-v-82ca3b84"]]);/*! *****************************************************************************
|
198
|
+
</symbol>`,n.insertBefore(i,n.lastChild)};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",r):r()}const main="",index$2="";var ELineBindAnchors=(r=>(r.TopCenter="TopCenter",r.Left="Left",r.Right="Right",r.BottomCenter="BottomCenter",r))(ELineBindAnchors||{}),EConfigAnimationsType=(r=>(r.None="None",r.Electricity="Electricity",r.WaterDrop="WaterDrop",r.Track="Track",r))(EConfigAnimationsType||{}),EConfigItemPropsType=(r=>(r.Input="Input",r.Textarea="Textarea",r.Color="Color",r.InputNumber="InputNumber",r.Switch="Switch",r.JsonEdit="JsonEdit",r.Select="Select",r))(EConfigItemPropsType||{}),EDoneJsonType=(r=>(r.File="File",r.StraightLine="StraightLine",r.ConnectionLine="ConnectionLine",r.CustomSvg="CustomSvg",r.Vue="Vue",r))(EDoneJsonType||{}),EEventType=(r=>(r.Click="Click",r.Change="Change",r.Null="",r))(EEventType||{}),EEventAction=(r=>(r.ChangeAttr="ChangeAttr",r.JavaScript="JavaScript",r.Null="",r))(EEventAction||{}),EConditionType=(r=>(r.None="None",r.Relation="Relation",r))(EConditionType||{}),EGlobalStoreIntention=(r=>(r.None="None",r.Create="Create",r.Move="Move",r.GroupMove="GroupMove",r.MoveCanvas="MoveCanvas",r.Select="Select",r.Zoom="Zoom",r.Rotate="Rotate",r.Connection="Connection",r.SetConnectionLineNode="SetConnectionLineNode",r.ContextMenu="ContextMenu",r.SelectArea="SelectArea",r))(EGlobalStoreIntention||{}),EMouseInfoState=(r=>(r.Down="Down",r.Up="Up",r))(EMouseInfoState||{}),EScaleInfoType=(r=>(r.None="",r.TopLeft="TopLeft",r.TopCenter="TopCenter",r.TopRight="TopRight",r.Left="Left",r.Right="Right",r.BottomLeft="BottomLeft",r.BottomCenter="BottomCenter",r.BottomRight="BottomRight",r))(EScaleInfoType||{});const t$p={name:"alert-light",title:"警示灯",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{},defaultState:"white",state:{green:{label:"正常",fill:"#00ff00",fillOpacity:"1"},yellow:{label:"请注意",fill:"#ffff00",fillOpacity:"1"},red:{label:"报警",fill:"#ff0000",fillOpacity:"1"},white:{label:"关闭",fill:"#ffffff",fillOpacity:"0"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$o={groupType:"stateful",title:"状态SVG",list:[t$p]},t$n={name:"bot-2",title:"2号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{height:{title:"高度",type:EConfigItemPropsType.InputNumber,val:150},width:{title:"宽度",type:EConfigItemPropsType.InputNumber,val:120}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$m={name:"bot-9",title:"9号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$l={name:"hotpot",title:"火锅",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$k={name:"hamburger",title:"汉堡",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$j={groupType:"stateless",title:"静态SVG",list:[t$k,t$l,t$n,t$m]},t$i={name:"thermometer",title:"温度计",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$h={groupType:"have_animation",title:"动画SVG",list:[t$i]},t$g={name:"svg-text",title:"文字",tag:"svg-text",type:EDoneJsonType.CustomSvg,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{text:{title:"文字内容",type:EConfigItemPropsType.Textarea,val:"文字内容"},fontFamily:{title:"字体",type:EConfigItemPropsType.Select,val:"Microsoft YaHei",options:[{value:"Microsoft YaHei",label:"微软雅黑"},{value:"NSimSun",label:"新宋体"},{value:"KaiTi",label:"楷体"}]},fontSize:{title:"文字大小",type:EConfigItemPropsType.InputNumber,val:18},fill:{title:"文字颜色",type:EConfigItemPropsType.Color,val:"#000"},bold:{title:"文字加粗",type:EConfigItemPropsType.Switch,val:!1},writingMode:{title:"文字朝向",type:EConfigItemPropsType.Select,val:"horizontal-tb",options:[{value:"horizontal-tb",label:"水平"},{value:"vertical-rl",label:"垂直"}]}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$f={name:"switch-r",title:"开关",tag:"switch-r",type:EDoneJsonType.CustomSvg,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{isOpen:{title:"开关",type:EConfigItemPropsType.Switch,val:!1}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$e={name:"light",tag:"light-a",title:"灯",type:EDoneJsonType.CustomSvg,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{height:{title:"高度",type:EConfigItemPropsType.InputNumber,val:60},width:{title:"宽度",type:EConfigItemPropsType.InputNumber,val:50},isOpen:{title:"开关",type:EConfigItemPropsType.Switch,val:!1}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$d={name:"clock-a",title:"时钟",tag:"clock-a",type:EDoneJsonType.CustomSvg,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{centerColor:{title:"针顶颜色",type:EConfigItemPropsType.Color,val:"#EBF257"},secondsColor:{title:"秒针颜色",type:EConfigItemPropsType.Color,val:"#E83E24"},circleColor:{title:"针圈颜色",type:EConfigItemPropsType.Color,val:"#F45AFC"},minutesColor:{title:"分针颜色",type:EConfigItemPropsType.Color,val:"#50E68E"},hoursColor:{title:"时针颜色",type:EConfigItemPropsType.Color,val:"#9A36E7"},scaleColor:{title:"刻度颜色",type:EConfigItemPropsType.Color,val:"#4942CF"},backgroundColor:{title:"表盘颜色",type:EConfigItemPropsType.Color,val:"#ffffff"},borderColor:{title:"表框颜色",type:EConfigItemPropsType.Color,val:"#B3A7FF"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$c={groupType:"custom_svg_group",title:"SVG组件",list:[t$g,t$f,t$e,t$d]},t$b=Object.seal([t$j,t$o,t$h,t$c]),t$a={name:"el-button",tag:"el-button",title:"按钮",type:EDoneJsonType.Vue,config:{can_zoom:!1,have_anchor:!0,actual_rect:!0},display:!0,props:{size:{title:"尺寸",type:EConfigItemPropsType.Select,val:"default",options:[{label:"大",value:"large"},{label:"默认",value:"default"},{label:"小",value:"small"}]},type:{title:"类型",type:EConfigItemPropsType.Select,val:"primary",options:[{label:"主要按钮",value:"primary"},{label:"成功按钮",value:"success"},{label:"警告按钮",value:"warning"},{label:"危险按钮",value:"danger"},{label:"信息按钮",value:"info"}]},plain:{title:"朴素按钮",type:EConfigItemPropsType.Switch,val:!1},text:{title:"文字按钮",type:EConfigItemPropsType.Switch,val:!1}},tag_slot:"按钮",common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$9={name:"common-table",title:"通用表格",tag:"common-table",type:EDoneJsonType.Vue,config:{can_zoom:!1,have_anchor:!0,actual_rect:!0},display:!0,props:{"col-config":{title:"列配置",type:EConfigItemPropsType.JsonEdit,val:[{prop:"date",label:"第一列",width:"120px",fixed:!1,sortable:!1,"show-overflow-tooltip":!1},{prop:"name",label:"第二列",width:"120px",fixed:!1,sortable:!1,"show-overflow-tooltip":!1},{prop:"address",label:"第三列测试",width:"280px",fixed:!1,sortable:!1,"show-overflow-tooltip":!1}]},data:{title:"表格数据",type:EConfigItemPropsType.JsonEdit,val:[{date:"2016-05-03",name:"Tom",address:"No. 189, Grove St, Los Angeles"},{date:"2016-05-02",name:"Tom",address:"No. 189, Grove St, Los Angeles"},{date:"2016-05-04",name:"Tom",address:"No. 189, Grove St, Los Angeles"},{date:"2016-05-01",name:"Tom",address:"No. 189, Grove St, Los Angeles"}]},width:{title:"宽度",type:EConfigItemPropsType.InputNumber,val:500},height:{title:"高度",type:EConfigItemPropsType.InputNumber,val:200},maxHeight:{title:"最大高度",type:EConfigItemPropsType.InputNumber,val:200},stripe:{title:"斑马纹",type:EConfigItemPropsType.Switch,val:!1},border:{title:"纵向边框",type:EConfigItemPropsType.Switch,val:!1},size:{title:"尺寸",type:EConfigItemPropsType.Select,val:"default",options:[{label:"大",value:"large"},{label:"默认",value:"default"},{label:"小",value:"small"}]},fit:{title:"列宽自撑开",type:EConfigItemPropsType.Switch,val:!1}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$8={name:"now-time",title:"当前时间",tag:"now-time",type:EDoneJsonType.Vue,config:{can_zoom:!1,have_anchor:!1,actual_rect:!0},display:!0,props:{width:{title:"宽度",type:EConfigItemPropsType.InputNumber,val:150},fontFamily:{title:"字体",type:EConfigItemPropsType.Select,val:"Microsoft YaHei",options:[{value:"Microsoft YaHei",label:"微软雅黑"},{value:"NSimSun",label:"新宋体"},{value:"KaiTi",label:"楷体"}]},fontSize:{title:"文字大小",type:EConfigItemPropsType.InputNumber,val:18},color:{title:"文字颜色",type:EConfigItemPropsType.Color,val:"#000000"},bold:{title:"文字加粗",type:EConfigItemPropsType.Switch,val:!1}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$7={name:"el-tag",tag:"el-tag",title:"标签",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{type:{title:"类型",type:EConfigItemPropsType.Select,val:"success",options:[{label:"成功",value:"success"},{label:"警告",value:"warning"},{label:"危险",value:"danger"},{label:"信息",value:"info"}]},closable:{title:"可关闭",type:EConfigItemPropsType.Switch,val:!0},"disable-transitions":{title:"渐变",type:EConfigItemPropsType.Switch,val:!1}},tag_slot:"标签",common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$6={name:"progress-a",tag:"progress-a",title:"进度条",type:EDoneJsonType.Vue,config:{can_zoom:!1,have_anchor:!0,actual_rect:!0},display:!0,props:{percentage:{title:"进度",type:EConfigItemPropsType.InputNumber,val:50}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$5={name:"text-box",title:"文字背景框",tag:"text-box",type:EDoneJsonType.Vue,config:{can_zoom:!1,have_anchor:!1,actual_rect:!0},display:!0,props:{width:{title:"宽度",type:EConfigItemPropsType.InputNumber,val:250},height:{title:"高度",type:EConfigItemPropsType.InputNumber,val:150},bgColor:{title:"背景颜色",type:EConfigItemPropsType.Color,val:"#000000"},bgOpacity:{title:"背景透明度(%)",type:EConfigItemPropsType.InputNumber,val:1},borderColor:{title:"边框颜色",type:EConfigItemPropsType.Color,val:"#cccccc"},borderWidth:{title:"边框宽度",type:EConfigItemPropsType.InputNumber,val:1},borderRadius:{title:"边框圆角",type:EConfigItemPropsType.InputNumber,val:5},borderOpacity:{title:"边框透明度(%)",type:EConfigItemPropsType.InputNumber,val:100}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$4={groupType:"custom-vue",title:"VUE组件",list:[t$a,t$6,t$9,t$8,t$7,t$5]},t$3={name:"pie-charts",tag:"pie-charts",title:"饼图",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{title:{title:"标题",type:EConfigItemPropsType.Input,val:"默认标题"},seriesName:{title:"详情",type:EConfigItemPropsType.Input,val:"详情标题"},seriesData:{title:"legendData",type:EConfigItemPropsType.JsonEdit,val:[{value:1048,name:"办公楼A"},{value:735,name:"办公楼B"},{value:580,name:"保安室"},{value:484,name:"地下车库"},{value:300,name:"食堂"}]}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$2={groupType:"echarts",title:"图表",list:[t$3]},t$1=Object.seal([t$4,t$2]),_sfc_main$M=vue.defineComponent({__name:"progress",props:{percentage:{default:10}},emits:["onChange"],setup(r,{emit:n}){const i=r,o=[{color:"#f56c6c",percentage:20},{color:"#e6a23c",percentage:40},{color:"#5cb87a",percentage:60},{color:"#1989fa",percentage:80},{color:"#6f7ad3",percentage:100}];return vue.watch(()=>i.percentage,()=>{n("onChange")}),(a,u)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElProgress),{type:"dashboard",percentage:Number(i.percentage),color:o},null,8,["percentage"]))}}),_hoisted_1$m=["id"],_hoisted_2$i=["id"],_hoisted_3$f=vue.createElementVNode("path",{d:"M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z",fill:"white","fill-opacity":".01","p-id":"1537","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"},null,-1),_hoisted_4$b=vue.createElementVNode("path",{d:"M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z m0 512 H276.48 C143.36 750.933333 34.133333 645.12 34.133333 512s109.226667-238.933333 242.346667-238.933333 H750.933333c133.12 0 242.346667 105.813333 242.346667 238.933333s-112.64 238.933333-245.76 238.933333z",fill:"#2c2c2c","p-id":"1531","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"},null,-1),_hoisted_5$9=vue.createElementVNode("path",{d:"M238.933333 409.6c-37.546667 0-68.266667 27.306667-68.266666 61.44v85.333333c0 34.133333 30.72 61.44 68.266666 61.44s68.266667-27.306667 68.266667-61.44v-85.333333c0-34.133333-30.72-61.44-68.266667-61.44z m34.133334 146.773333c0 13.653333-17.066667 23.893333-34.133334 23.893334s-34.133333-10.24-34.133333-27.306667v-85.333333c0-13.653333 17.066667-23.893333 34.133333-23.893334s34.133333 10.24 34.133334 27.306667v85.333333zM460.8 409.6c-10.24 0-17.066667 6.826667-17.066667 17.066667v109.226666l-71.68-119.466666c-3.413333-6.826667-10.24-10.24-20.48-6.826667-6.826667 3.413333-13.653333 10.24-13.653333 17.066667v170.666666c0 10.24 6.826667 17.066667 17.066667 17.066667s17.066667-6.826667 17.066666-17.066667v-109.226666l71.68 119.466666c3.413333 6.826667 10.24 6.826667 13.653334 6.826667h3.413333c6.826667-3.413333 13.653333-10.24 13.653333-17.066667v-170.666666c3.413333-10.24-3.413333-17.066667-13.653333-17.066667zM750.933333 341.333333c-95.573333 0-170.666667 75.093333-170.666666 170.666667s75.093333 170.666667 170.666666 170.666667 170.666667-75.093333 170.666667-170.666667-75.093333-170.666667-170.666667-170.666667z",fill:"#5ad562","p-id":"1530","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i1.1adc3a81uCnBP5"},null,-1),_hoisted_6$7=[_hoisted_3$f,_hoisted_4$b,_hoisted_5$9],_hoisted_7$7=["id"],_hoisted_8$7=vue.createElementVNode("path",{d:"M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z",fill:"white","fill-opacity":".01","p-id":"1536","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"},null,-1),_hoisted_9$7=vue.createElementVNode("path",{d:"M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z m0 512 H276.48 C143.36 750.933333 34.133333 645.12 34.133333 512s109.226667-238.933333 242.346667-238.933333 H750.933333c133.12 0 242.346667 105.813333 242.346667 238.933333s-112.64 238.933333-245.76 238.933333z",fill:"#2c2c2c","p-id":"1535","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"},null,-1),_hoisted_10$6=vue.createElementVNode("path",{d:"M273.066667 341.333333c-95.573333 0-170.666667 75.093333-170.666667 170.666667s75.093333 170.666667 170.666667 170.666667 170.666667-75.093333 170.666666-170.666667-75.093333-170.666667-170.666666-170.666667z",fill:"#bfbfbf","p-id":"1534","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81KYNNkt"},null,-1),_hoisted_11$5=vue.createElementVNode("path",{d:"M580.266667 409.6c-37.546667 0-68.266667 27.306667-68.266667 61.44v85.333333c0 34.133333 30.72 61.44 68.266667 61.44s68.266667-27.306667 68.266666-61.44v-85.333333c0-34.133333-30.72-61.44-68.266666-61.44z m34.133333 146.773333c0 13.653333-17.066667 27.306667-34.133333 27.306667s-34.133333-10.24-34.133334-27.306667v-85.333333c0-13.653333 17.066667-27.306667 34.133334-27.306667s34.133333 10.24 34.133333 27.306667v85.333333zM904.533333 409.6h-68.266666c-10.24 0-17.066667 6.826667-17.066667 17.066667v170.666666c0 10.24 6.826667 17.066667 17.066667 17.066667s17.066667-6.826667 17.066666-17.066667V512h17.066667c10.24 0 17.066667-6.826667 17.066667-17.066667s-6.826667-17.066667-17.066667-17.066666H853.333333v-34.133334h51.2c10.24 0 17.066667-6.826667 17.066667-17.066666s-6.826667-17.066667-17.066667-17.066667zM768 409.6h-68.266667c-10.24 0-17.066667 6.826667-17.066666 17.066667v170.666666c0 10.24 6.826667 17.066667 17.066666 17.066667s17.066667-6.826667 17.066667-17.066667V512h17.066667c10.24 0 17.066667-6.826667 17.066666-17.066667s-6.826667-17.066667-17.066666-17.066666H716.8v-34.133334h51.2c10.24 0 17.066667-6.826667 17.066667-17.066666s-6.826667-17.066667-17.066667-17.066667z",fill:"#707070","p-id":"1533","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i2.1adc3a81KYNNkt"},null,-1),_hoisted_12$5=[_hoisted_8$7,_hoisted_9$7,_hoisted_10$6,_hoisted_11$5],_hoisted_13$4=["xlink:href"],_sfc_main$L=vue.defineComponent({__name:"switch-r",props:{id:{type:String,default:""},isOpen:{type:Boolean,default:!0}},emits:["onChange"],setup(r,{emit:n}){const i=r;return vue.watch(()=>i.isOpen,()=>{n("onChange")}),(o,a)=>(vue.openBlock(),vue.createElementBlock("g",{id:i.id},[vue.createElementVNode("symbol",{viewBox:"0 0 1027 1024",id:`${i.id}switch-demo-open`},_hoisted_6$7,8,_hoisted_2$i),vue.createElementVNode("symbol",{viewBox:"0 0 1027 1024",id:`${i.id}switch-demo-close`},_hoisted_12$5,8,_hoisted_7$7),vue.createElementVNode("use",{"xlink:href":`#${i.id}switch-demo-${i.isOpen?"open":"close"}`,width:"100",height:"100"},null,8,_hoisted_13$4)],8,_hoisted_1$m))}}),_sfc_main$K=vue.defineComponent({__name:"svg-text",props:{text:{},bold:{type:Boolean}},emits:["resize"],setup(r,{emit:n}){const i=r;return vue.watch(()=>i.text,()=>{vue.nextTick(function(){n("resize")})}),(o,a)=>(vue.openBlock(),vue.createElementBlock("text",{x:"50",y:"55",style:vue.normalizeStyle({"font-weight":i.bold?"bold":"normal"})},vue.toDisplayString(i.text),5))}}),_sfc_main$J=vue.defineComponent({__name:"common-table",props:{colConfig:{default:()=>[]},data:{default:()=>[]},height:{default:200},maxHeight:{},stripe:{type:Boolean,default:!1},border:{type:Boolean,default:!1},size:{},fit:{type:Boolean,default:!1},operateDisplay:{type:Boolean,default:!1},selectionData:{default:()=>[]}},setup(r){const n=r,i=vue.ref({});return vue.watchEffect(()=>{const{colConfig:o,...a}=n;i.value=a}),(o,a)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTable),vue.normalizeProps(vue.guardReactiveProps(vue.unref(i))),{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.colConfig,u=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTableColumn),vue.mergeProps({key:u.prop},u),null,16))),128))]),_:1},16))}}),_hoisted_1$l={class:"flex mt-5px"},_sfc_main$I=vue.defineComponent({__name:"now-time",props:{width:{},fontFamily:{},color:{},fontSize:{},bold:{type:Boolean}},setup(r){const n=r,i=vue.computed(()=>({fontFamily:n.fontFamily,color:n.color,fontSize:n.fontSize+"px",fontWeight:n.bold?"bold":"normal"})),o=vue.ref(new Date),a=vue.ref(),u=vue.computed(()=>{const d=o.value.getFullYear(),h=o.value.getMonth()+1,v=o.value.getDate();return d.toString()+"年"+h.toString()+"月"+v.toString()+"日"}),c=vue.computed(()=>{const d=o.value.getDay();return["星期日","星期一","星期二","星期三","星期四","星期五","星期六"][d]}),f=vue.computed(()=>{const d=o.value.getHours(),h=o.value.getMinutes(),v=o.value.getSeconds();return(d<10?"0"+d.toString():d.toString())+":"+(h<10?"0"+h.toString():h.toString())+":"+(v<10?"0"+v.toString():v.toString())});return vue.onMounted(()=>{a.value=setInterval(()=>{o.value=new Date},500)}),vue.onUnmounted(()=>{clearInterval(a.value)}),(d,h)=>(vue.openBlock(),vue.createElementBlock("div",{class:"now-time",style:vue.normalizeStyle({width:n.width+"px"})},[vue.createElementVNode("div",{style:vue.normalizeStyle(vue.unref(i))},vue.toDisplayString(vue.unref(u)),5),vue.createElementVNode("div",_hoisted_1$l,[vue.createElementVNode("div",{style:vue.normalizeStyle(vue.unref(i))},vue.toDisplayString(vue.unref(c)),5),vue.createElementVNode("div",{style:vue.normalizeStyle(vue.unref(i))},vue.toDisplayString(vue.unref(f)),5)])],4))}}),nowTime_vue_vue_type_style_index_0_scoped_82ca3b84_lang="",_export_sfc$1=(r,n)=>{const i=r.__vccOpts||r;for(const[o,a]of n)i[o]=a;return i},NowTime=_export_sfc$1(_sfc_main$I,[["__scopeId","data-v-82ca3b84"]]);/*! *****************************************************************************
|
199
199
|
Copyright (c) Microsoft Corporation.
|
200
200
|
|
201
201
|
Permission to use, copy, modify, and/or distribute this software for any
|
@@ -241,7 +241,7 @@ echarts.use([`+z+"]);":"Unknown series "+V))}return}if(g==="tooltip"){if(S){proc
|
|
241
241
|
|
242
242
|
`:"<br/>",w=g.join(A);this._showOrMove(f,function(){this._updateContentNotChangedOnAxis(i,h)?this._updatePosition(f,y,c[0],c[1],this._tooltipContent,h):this._showTooltipContent(f,w,h,Math.random()+"",c[0],c[1],y,null,p)})},n.prototype._showSeriesItemTooltip=function(i,o,a){var u=this._ecModel,c=getECData(o),f=c.seriesIndex,d=u.getSeriesByIndex(f),h=c.dataModel||d,v=c.dataIndex,g=c.dataType,p=h.getData(g),y=this._renderMode,_=i.positionDefault,b=buildTooltipModel([p.getItemModel(v),h,d&&(d.coordinateSystem||{}).model],this._tooltipModel,_?{position:_}:null),A=b.get("trigger");if(!(A!=null&&A!=="item")){var w=h.getDataParams(v,g),T=new TooltipMarkupStyleCreator;w.marker=T.makeTooltipMarker("item",convertToColorString(w.color),y);var S=normalizeTooltipFormatResult(h.formatTooltip(v,!1,g)),x=b.get("order"),O=b.get("valueFormatter"),L=S.frag,M=L?buildTooltipMarkup(O?extend({valueFormatter:O},L):L,T,y,x,u.get("useUTC"),b.get("textStyle")):S.text,re="item_"+h.name+"_"+v;this._showOrMove(b,function(){this._showTooltipContent(b,M,w,re,i.offsetX,i.offsetY,i.position,i.target,T)}),a({type:"showTip",dataIndexInside:v,dataIndex:p.getRawIndex(v),seriesIndex:f,from:this.uid})}},n.prototype._showComponentItemTooltip=function(i,o,a){var u=getECData(o),c=u.tooltipConfig,f=c.option||{};if(isString$2(f)){var d=f;f={content:d,formatter:d}}var h=[f],v=this._ecModel.getComponent(u.componentMainType,u.componentIndex);v&&h.push(v),h.push({formatter:f.content});var g=i.positionDefault,p=buildTooltipModel(h,this._tooltipModel,g?{position:g}:null),y=p.get("content"),_=Math.random()+"",b=new TooltipMarkupStyleCreator;this._showOrMove(p,function(){var A=clone$2(p.get("formatterParams")||{});this._showTooltipContent(p,y,A,_,i.offsetX,i.offsetY,i.position,o,b)}),a({type:"showTip",from:this.uid})},n.prototype._showTooltipContent=function(i,o,a,u,c,f,d,h,v){if(this._ticket="",!(!i.get("showContent")||!i.get("show"))){var g=this._tooltipContent;g.setEnterable(i.get("enterable"));var p=i.get("formatter");d=d||i.get("position");var y=o,_=this._getNearestPoint([c,f],a,i.get("trigger"),i.get("borderColor")),b=_.color;if(p)if(isString$2(p)){var A=i.ecModel.get("useUTC"),w=isArray$1(a)?a[0]:a,T=w&&w.axisType&&w.axisType.indexOf("time")>=0;y=p,T&&(y=format$1(w.axisValue,y,A)),y=formatTpl(y,a,!0)}else if(isFunction$1(p)){var S=bind$1(function(x,O){x===this._ticket&&(g.setContent(O,v,i,b,d),this._updatePosition(i,d,c,f,g,a,h))},this);this._ticket=u,y=p(a,u,S)}else y=p;g.setContent(y,v,i,b,d),g.show(i,b),this._updatePosition(i,d,c,f,g,a,h)}},n.prototype._getNearestPoint=function(i,o,a,u){if(a==="axis"||isArray$1(o))return{color:u||(this._renderMode==="html"?"#fff":"none")};if(!isArray$1(o))return{color:u||o.color||o.borderColor}},n.prototype._updatePosition=function(i,o,a,u,c,f,d){var h=this._api.getWidth(),v=this._api.getHeight();o=o||i.get("position");var g=c.getSize(),p=i.get("align"),y=i.get("verticalAlign"),_=d&&d.getBoundingRect().clone();if(d&&_.applyTransform(d.transform),isFunction$1(o)&&(o=o([a,u],f,c.el,_,{viewSize:[h,v],contentSize:g.slice()})),isArray$1(o))a=parsePercent(o[0],h),u=parsePercent(o[1],v);else if(isObject$3(o)){var b=o;b.width=g[0],b.height=g[1];var A=getLayoutRect(b,{width:h,height:v});a=A.x,u=A.y,p=null,y=null}else if(isString$2(o)&&d){var w=calcTooltipPosition(o,_,g,i.get("borderWidth"));a=w[0],u=w[1]}else{var w=refixTooltipPosition(a,u,c,h,v,p?null:20,y?null:20);a=w[0],u=w[1]}if(p&&(a-=isCenterAlign(p)?g[0]/2:p==="right"?g[0]:0),y&&(u-=isCenterAlign(y)?g[1]/2:y==="bottom"?g[1]:0),shouldTooltipConfine(i)){var w=confineTooltipPosition(a,u,c,h,v);a=w[0],u=w[1]}c.moveTo(a,u)},n.prototype._updateContentNotChangedOnAxis=function(i,o){var a=this._lastDataByCoordSys,u=this._cbParamsList,c=!!a&&a.length===i.length;return c&&each$4(a,function(f,d){var h=f.dataByAxis||[],v=i[d]||{},g=v.dataByAxis||[];c=c&&h.length===g.length,c&&each$4(h,function(p,y){var _=g[y]||{},b=p.seriesDataIndices||[],A=_.seriesDataIndices||[];c=c&&p.value===_.value&&p.axisType===_.axisType&&p.axisId===_.axisId&&b.length===A.length,c&&each$4(b,function(w,T){var S=A[T];c=c&&w.seriesIndex===S.seriesIndex&&w.dataIndex===S.dataIndex}),u&&each$4(p.seriesDataIndices,function(w){var T=w.seriesIndex,S=o[T],x=u[T];S&&x&&x.data!==S.data&&(c=!1)})})}),this._lastDataByCoordSys=i,this._cbParamsList=o,!!c},n.prototype._hide=function(i){this._lastDataByCoordSys=null,i({type:"hideTip",from:this.uid})},n.prototype.dispose=function(i,o){env$1.node||!o.getDom()||(clear(this,"_updatePosition"),this._tooltipContent.dispose(),unregister("itemTooltip",o))},n.type="tooltip",n}(ComponentView$1);function buildTooltipModel(r,n,i){var o=n.ecModel,a;i?(a=new Model$1(i,o,o),a=new Model$1(n.option,a,o)):a=n;for(var u=r.length-1;u>=0;u--){var c=r[u];c&&(c instanceof Model$1&&(c=c.get("tooltip",!0)),isString$2(c)&&(c={formatter:c}),c&&(a=new Model$1(c,a,o)))}return a}function makeDispatchAction(r,n){return r.dispatchAction||bind$1(n.dispatchAction,n)}function refixTooltipPosition(r,n,i,o,a,u,c){var f=i.getSize(),d=f[0],h=f[1];return u!=null&&(r+d+u+2>o?r-=d+u:r+=u),c!=null&&(n+h+c>a?n-=h+c:n+=c),[r,n]}function confineTooltipPosition(r,n,i,o,a){var u=i.getSize(),c=u[0],f=u[1];return r=Math.min(r+c,o)-c,n=Math.min(n+f,a)-f,r=Math.max(r,0),n=Math.max(n,0),[r,n]}function calcTooltipPosition(r,n,i,o){var a=i[0],u=i[1],c=Math.ceil(Math.SQRT2*o)+8,f=0,d=0,h=n.width,v=n.height;switch(r){case"inside":f=n.x+h/2-a/2,d=n.y+v/2-u/2;break;case"top":f=n.x+h/2-a/2,d=n.y-u-c;break;case"bottom":f=n.x+h/2-a/2,d=n.y+v+c;break;case"left":f=n.x-a-c,d=n.y+v/2-u/2;break;case"right":f=n.x+h+c,d=n.y+v/2-u/2}return[f,d]}function isCenterAlign(r){return r==="center"||r==="middle"}function findComponentReference(r,n,i){var o=preParseFinder(r).queryOptionMap,a=o.keys()[0];if(!(!a||a==="series")){var u=queryReferringComponents(n,a,o.get(a),{useDefault:!1,enableAll:!1,enableNone:!1}),c=u.models[0];if(c){var f=i.getViewOfComponentModel(c),d;if(f.group.traverse(function(h){var v=getECData(h).tooltipConfig;if(v&&v.name===r.name)return d=h,!0}),d)return{componentMainType:a,componentIndex:c.componentIndex,el:d}}}}const TooltipView$1=TooltipView;function install$4(r){use(install$5),r.registerComponentModel(TooltipModel$1),r.registerComponentView(TooltipView$1),r.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},noop$1),r.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},noop$1)}var TitleModel=function(r){__extends(n,r);function n(){var i=r!==null&&r.apply(this,arguments)||this;return i.type=n.type,i.layoutMode={type:"box",ignoreSize:!0},i}return n.type="title",n.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},n}(ComponentModel$1),TitleView=function(r){__extends(n,r);function n(){var i=r!==null&&r.apply(this,arguments)||this;return i.type=n.type,i}return n.prototype.render=function(i,o,a){if(this.group.removeAll(),!!i.get("show")){var u=this.group,c=i.getModel("textStyle"),f=i.getModel("subtextStyle"),d=i.get("textAlign"),h=retrieve2(i.get("textBaseline"),i.get("textVerticalAlign")),v=new ZRText$1({style:createTextStyle(c,{text:i.get("text"),fill:c.getTextColor()},{disableBox:!0}),z2:10}),g=v.getBoundingRect(),p=i.get("subtext"),y=new ZRText$1({style:createTextStyle(f,{text:p,fill:f.getTextColor(),y:g.height+i.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),_=i.get("link"),b=i.get("sublink"),A=i.get("triggerEvent",!0);v.silent=!_&&!A,y.silent=!b&&!A,_&&v.on("click",function(){windowOpen(_,"_"+i.get("target"))}),b&&y.on("click",function(){windowOpen(b,"_"+i.get("subtarget"))}),getECData(v).eventData=getECData(y).eventData=A?{componentType:"title",componentIndex:i.componentIndex}:null,u.add(v),p&&u.add(y);var w=u.getBoundingRect(),T=i.getBoxLayoutParams();T.width=w.width,T.height=w.height;var S=getLayoutRect(T,{width:a.getWidth(),height:a.getHeight()},i.get("padding"));d||(d=i.get("left")||i.get("right"),d==="middle"&&(d="center"),d==="right"?S.x+=S.width:d==="center"&&(S.x+=S.width/2)),h||(h=i.get("top")||i.get("bottom"),h==="center"&&(h="middle"),h==="bottom"?S.y+=S.height:h==="middle"&&(S.y+=S.height/2),h=h||"top"),u.x=S.x,u.y=S.y,u.markRedraw();var x={align:d,verticalAlign:h};v.setStyle(x),y.setStyle(x),w=u.getBoundingRect();var O=S.margin,L=i.getItemStyle(["color","opacity"]);L.fill=i.get("backgroundColor");var M=new Rect$1({shape:{x:w.x-O[3],y:w.y-O[0],width:w.width+O[1]+O[3],height:w.height+O[0]+O[2],r:i.get("borderRadius")},style:L,subPixelOptimize:!0,silent:!0});u.add(M)}},n.type="title",n}(ComponentView$1);function install$3(r){r.registerComponentModel(TitleModel),r.registerComponentView(TitleView)}var getDefaultSelectorOptions=function(r,n){if(n==="all")return{type:"all",title:r.getLocaleModel().get(["legend","selector","all"])};if(n==="inverse")return{type:"inverse",title:r.getLocaleModel().get(["legend","selector","inverse"])}},LegendModel=function(r){__extends(n,r);function n(){var i=r!==null&&r.apply(this,arguments)||this;return i.type=n.type,i.layoutMode={type:"box",ignoreSize:!0},i}return n.prototype.init=function(i,o,a){this.mergeDefaultAndTheme(i,a),i.selected=i.selected||{},this._updateSelector(i)},n.prototype.mergeOption=function(i,o){r.prototype.mergeOption.call(this,i,o),this._updateSelector(i)},n.prototype._updateSelector=function(i){var o=i.selector,a=this.ecModel;o===!0&&(o=i.selector=["all","inverse"]),isArray$1(o)&&each$4(o,function(u,c){isString$2(u)&&(u={type:u}),o[c]=merge(u,getDefaultSelectorOptions(a,u.type))})},n.prototype.optionUpdated=function(){this._updateData(this.ecModel);var i=this._data;if(i[0]&&this.get("selectedMode")==="single"){for(var o=!1,a=0;a<i.length;a++){var u=i[a].get("name");if(this.isSelected(u)){this.select(u),o=!0;break}}!o&&this.select(i[0].get("name"))}},n.prototype._updateData=function(i){var o=[],a=[];i.eachRawSeries(function(d){var h=d.name;a.push(h);var v;if(d.legendVisualProvider){var g=d.legendVisualProvider,p=g.getAllNames();i.isSeriesFiltered(d)||(a=a.concat(p)),p.length?o=o.concat(p):v=!0}else v=!0;v&&isNameSpecified(d)&&o.push(d.name)}),this._availableNames=a;var u=this.get("data")||o,c=createHashMap(),f=map$1(u,function(d){return(isString$2(d)||isNumber$1(d))&&(d={name:d}),c.get(d.name)?null:(c.set(d.name,!0),new Model$1(d,this,this.ecModel))},this);this._data=filter(f,function(d){return!!d})},n.prototype.getData=function(){return this._data},n.prototype.select=function(i){var o=this.option.selected,a=this.get("selectedMode");if(a==="single"){var u=this._data;each$4(u,function(c){o[c.get("name")]=!1})}o[i]=!0},n.prototype.unSelect=function(i){this.get("selectedMode")!=="single"&&(this.option.selected[i]=!1)},n.prototype.toggleSelected=function(i){var o=this.option.selected;o.hasOwnProperty(i)||(o[i]=!0),this[o[i]?"unSelect":"select"](i)},n.prototype.allSelect=function(){var i=this._data,o=this.option.selected;each$4(i,function(a){o[a.get("name",!0)]=!0})},n.prototype.inverseSelect=function(){var i=this._data,o=this.option.selected;each$4(i,function(a){var u=a.get("name",!0);o.hasOwnProperty(u)||(o[u]=!0),o[u]=!o[u]})},n.prototype.isSelected=function(i){var o=this.option.selected;return!(o.hasOwnProperty(i)&&!o[i])&&indexOf(this._availableNames,i)>=0},n.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},n.type="legend.plain",n.dependencies=["series"],n.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},n}(ComponentModel$1);const LegendModel$1=LegendModel;var curry=curry$1,each=each$4,Group$1=Group$3,LegendView=function(r){__extends(n,r);function n(){var i=r!==null&&r.apply(this,arguments)||this;return i.type=n.type,i.newlineDisabled=!1,i}return n.prototype.init=function(){this.group.add(this._contentGroup=new Group$1),this.group.add(this._selectorGroup=new Group$1),this._isFirstRender=!0},n.prototype.getContentGroup=function(){return this._contentGroup},n.prototype.getSelectorGroup=function(){return this._selectorGroup},n.prototype.render=function(i,o,a){var u=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!i.get("show",!0)){var c=i.get("align"),f=i.get("orient");(!c||c==="auto")&&(c=i.get("left")==="right"&&f==="vertical"?"right":"left");var d=i.get("selector",!0),h=i.get("selectorPosition",!0);d&&(!h||h==="auto")&&(h=f==="horizontal"?"end":"start"),this.renderInner(c,i,o,a,d,f,h);var v=i.getBoxLayoutParams(),g={width:a.getWidth(),height:a.getHeight()},p=i.get("padding"),y=getLayoutRect(v,g,p),_=this.layoutInner(i,c,y,u,d,h),b=getLayoutRect(defaults({width:_.width,height:_.height},v),g,p);this.group.x=b.x-_.x,this.group.y=b.y-_.y,this.group.markRedraw(),this.group.add(this._backgroundEl=makeBackground(_,i))}},n.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},n.prototype.renderInner=function(i,o,a,u,c,f,d){var h=this.getContentGroup(),v=createHashMap(),g=o.get("selectedMode"),p=[];a.eachRawSeries(function(y){!y.get("legendHoverLink")&&p.push(y.id)}),each(o.getData(),function(y,_){var b=y.get("name");if(!this.newlineDisabled&&(b===""||b===`
|
243
243
|
`)){var A=new Group$1;A.newline=!0,h.add(A);return}var w=a.getSeriesByName(b)[0];if(!v.get(b)){if(w){var T=w.getData(),S=T.getVisual("legendLineStyle")||{},x=T.getVisual("legendIcon"),O=T.getVisual("style"),L=this._createItem(w,b,_,y,o,i,S,O,x,g,u);L.on("click",curry(dispatchSelectAction,b,null,u,p)).on("mouseover",curry(dispatchHighlightAction,w.name,null,u,p)).on("mouseout",curry(dispatchDownplayAction,w.name,null,u,p)),v.set(b,!0)}else a.eachRawSeries(function(M){if(!v.get(b)&&M.legendVisualProvider){var re=M.legendVisualProvider;if(!re.containName(b))return;var F=re.indexOfName(b),j=re.getItemVisual(F,"style"),V=re.getItemVisual(F,"legendIcon"),z=parse(j.fill);z&&z[3]===0&&(z[3]=.2,j=extend(extend({},j),{fill:stringify(z,"rgba")}));var $=this._createItem(M,b,_,y,o,i,{},j,V,g,u);$.on("click",curry(dispatchSelectAction,null,b,u,p)).on("mouseover",curry(dispatchHighlightAction,null,b,u,p)).on("mouseout",curry(dispatchDownplayAction,null,b,u,p)),v.set(b,!0)}},this);process.env.NODE_ENV!=="production"&&(v.get(b)||console.warn(b+" series not exists. Legend data should be same with series name or data name."))}},this),c&&this._createSelector(c,o,u,f,d)},n.prototype._createSelector=function(i,o,a,u,c){var f=this.getSelectorGroup();each(i,function(h){var v=h.type,g=new ZRText$1({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){a.dispatchAction({type:v==="all"?"legendAllSelect":"legendInverseSelect"})}});f.add(g);var p=o.getModel("selectorLabel"),y=o.getModel(["emphasis","selectorLabel"]);setLabelStyle(g,{normal:p,emphasis:y},{defaultText:h.title}),enableHoverEmphasis(g)})},n.prototype._createItem=function(i,o,a,u,c,f,d,h,v,g,p){var y=i.visualDrawType,_=c.get("itemWidth"),b=c.get("itemHeight"),A=c.isSelected(o),w=u.get("symbolRotate"),T=u.get("symbolKeepAspect"),S=u.get("icon");v=S||v||"roundRect";var x=getLegendStyle(v,u,d,h,y,A,p),O=new Group$1,L=u.getModel("textStyle");if(isFunction$1(i.getLegendIcon)&&(!S||S==="inherit"))O.add(i.getLegendIcon({itemWidth:_,itemHeight:b,icon:v,iconRotate:w,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:T}));else{var M=S==="inherit"&&i.getData().getVisual("symbol")?w==="inherit"?i.getData().getVisual("symbolRotate"):w:0;O.add(getDefaultLegendIcon({itemWidth:_,itemHeight:b,icon:v,iconRotate:M,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:T}))}var re=f==="left"?_+5:-5,F=f,j=c.get("formatter"),V=o;isString$2(j)&&j?V=j.replace("{name}",o??""):isFunction$1(j)&&(V=j(o));var z=u.get("inactiveColor");O.add(new ZRText$1({style:createTextStyle(L,{text:V,x:re,y:b/2,fill:A?L.getTextColor():z,align:F,verticalAlign:"middle"})}));var $=new Rect$1({shape:O.getBoundingRect(),invisible:!0}),he=u.getModel("tooltip");return he.get("show")&&setTooltipConfig({el:$,componentModel:c,itemName:o,itemTooltipOption:he.option}),O.add($),O.eachChild(function(le){le.silent=!0}),$.silent=!g,this.getContentGroup().add(O),enableHoverEmphasis(O),O.__legendDataIndex=a,O},n.prototype.layoutInner=function(i,o,a,u,c,f){var d=this.getContentGroup(),h=this.getSelectorGroup();box(i.get("orient"),d,i.get("itemGap"),a.width,a.height);var v=d.getBoundingRect(),g=[-v.x,-v.y];if(h.markRedraw(),d.markRedraw(),c){box("horizontal",h,i.get("selectorItemGap",!0));var p=h.getBoundingRect(),y=[-p.x,-p.y],_=i.get("selectorButtonGap",!0),b=i.getOrient().index,A=b===0?"width":"height",w=b===0?"height":"width",T=b===0?"y":"x";f==="end"?y[b]+=v[A]+_:g[b]+=p[A]+_,y[1-b]+=v[w]/2-p[w]/2,h.x=y[0],h.y=y[1],d.x=g[0],d.y=g[1];var S={x:0,y:0};return S[A]=v[A]+_+p[A],S[w]=Math.max(v[w],p[w]),S[T]=Math.min(0,p[T]+y[1-b]),S}else return d.x=g[0],d.y=g[1],this.group.getBoundingRect()},n.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},n.type="legend.plain",n}(ComponentView$1);function getLegendStyle(r,n,i,o,a,u,c){function f(A,w){A.lineWidth==="auto"&&(A.lineWidth=w.lineWidth>0?2:0),each(A,function(T,S){A[S]==="inherit"&&(A[S]=w[S])})}var d=n.getModel("itemStyle"),h=d.getItemStyle(),v=r.lastIndexOf("empty",0)===0?"fill":"stroke",g=d.getShallow("decal");h.decal=!g||g==="inherit"?o.decal:createOrUpdatePatternFromDecal(g,c),h.fill==="inherit"&&(h.fill=o[a]),h.stroke==="inherit"&&(h.stroke=o[v]),h.opacity==="inherit"&&(h.opacity=(a==="fill"?o:i).opacity),f(h,o);var p=n.getModel("lineStyle"),y=p.getLineStyle();if(f(y,i),h.fill==="auto"&&(h.fill=o.fill),h.stroke==="auto"&&(h.stroke=o.fill),y.stroke==="auto"&&(y.stroke=o.fill),!u){var _=n.get("inactiveBorderWidth"),b=h[v];h.lineWidth=_==="auto"?o.lineWidth>0&&b?2:0:h.lineWidth,h.fill=n.get("inactiveColor"),h.stroke=n.get("inactiveBorderColor"),y.stroke=p.get("inactiveColor"),y.lineWidth=p.get("inactiveWidth")}return{itemStyle:h,lineStyle:y}}function getDefaultLegendIcon(r){var n=r.icon||"roundRect",i=createSymbol(n,0,0,r.itemWidth,r.itemHeight,r.itemStyle.fill,r.symbolKeepAspect);return i.setStyle(r.itemStyle),i.rotation=(r.iconRotate||0)*Math.PI/180,i.setOrigin([r.itemWidth/2,r.itemHeight/2]),n.indexOf("empty")>-1&&(i.style.stroke=i.style.fill,i.style.fill="#fff",i.style.lineWidth=2),i}function dispatchSelectAction(r,n,i,o){dispatchDownplayAction(r,n,i,o),i.dispatchAction({type:"legendToggleSelect",name:r??n}),dispatchHighlightAction(r,n,i,o)}function isUseHoverLayer(r){for(var n=r.getZr().storage.getDisplayList(),i,o=0,a=n.length;o<a&&!(i=n[o].states.emphasis);)o++;return i&&i.hoverLayer}function dispatchHighlightAction(r,n,i,o){isUseHoverLayer(i)||i.dispatchAction({type:"highlight",seriesName:r,name:n,excludeSeriesId:o})}function dispatchDownplayAction(r,n,i,o){isUseHoverLayer(i)||i.dispatchAction({type:"downplay",seriesName:r,name:n,excludeSeriesId:o})}const LegendView$1=LegendView;function legendFilter(r){var n=r.findComponents({mainType:"legend"});n&&n.length&&r.filterSeries(function(i){for(var o=0;o<n.length;o++)if(!n[o].isSelected(i.name))return!1;return!0})}function legendSelectActionHandler(r,n,i){var o={},a=r==="toggleSelected",u;return i.eachComponent("legend",function(c){a&&u!=null?c[u?"select":"unSelect"](n.name):r==="allSelect"||r==="inverseSelect"?c[r]():(c[r](n.name),u=c.isSelected(n.name));var f=c.getData();each$4(f,function(d){var h=d.get("name");if(!(h===`
|
244
|
-
`||h==="")){var v=c.isSelected(h);o.hasOwnProperty(h)?o[h]=o[h]&&v:o[h]=v}})}),r==="allSelect"||r==="inverseSelect"?{selected:o}:{name:n.name,selected:o}}function installLegendAction(r){r.registerAction("legendToggleSelect","legendselectchanged",curry$1(legendSelectActionHandler,"toggleSelected")),r.registerAction("legendAllSelect","legendselectall",curry$1(legendSelectActionHandler,"allSelect")),r.registerAction("legendInverseSelect","legendinverseselect",curry$1(legendSelectActionHandler,"inverseSelect")),r.registerAction("legendSelect","legendselected",curry$1(legendSelectActionHandler,"select")),r.registerAction("legendUnSelect","legendunselected",curry$1(legendSelectActionHandler,"unSelect"))}function install$2(r){r.registerComponentModel(LegendModel$1),r.registerComponentView(LegendView$1),r.registerProcessor(r.PRIORITY.PROCESSOR.SERIES_FILTER,legendFilter),r.registerSubTypeDefaulter("legend",function(){return"plain"}),installLegendAction(r)}var ScrollableLegendModel=function(r){__extends(n,r);function n(){var i=r!==null&&r.apply(this,arguments)||this;return i.type=n.type,i}return n.prototype.setScrollDataIndex=function(i){this.option.scrollDataIndex=i},n.prototype.init=function(i,o,a){var u=getLayoutParams(i);r.prototype.init.call(this,i,o,a),mergeAndNormalizeLayoutParams(this,i,u)},n.prototype.mergeOption=function(i,o){r.prototype.mergeOption.call(this,i,o),mergeAndNormalizeLayoutParams(this,this.option,i)},n.type="legend.scroll",n.defaultOption=inheritDefaultOption(LegendModel$1.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),n}(LegendModel$1);function mergeAndNormalizeLayoutParams(r,n,i){var o=r.getOrient(),a=[1,1];a[o.index]=0,mergeLayoutParam(n,i,{type:"box",ignoreSize:!!a})}const ScrollableLegendModel$1=ScrollableLegendModel;var Group=Group$3,WH=["width","height"],XY=["x","y"],ScrollableLegendView=function(r){__extends(n,r);function n(){var i=r!==null&&r.apply(this,arguments)||this;return i.type=n.type,i.newlineDisabled=!0,i._currentIndex=0,i}return n.prototype.init=function(){r.prototype.init.call(this),this.group.add(this._containerGroup=new Group),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new Group)},n.prototype.resetInner=function(){r.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},n.prototype.renderInner=function(i,o,a,u,c,f,d){var h=this;r.prototype.renderInner.call(this,i,o,a,u,c,f,d);var v=this._controllerGroup,g=o.get("pageIconSize",!0),p=isArray$1(g)?g:[g,g];_("pagePrev",0);var y=o.getModel("pageTextStyle");v.add(new ZRText$1({name:"pageText",style:{text:"xx/xx",fill:y.getTextColor(),font:y.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),_("pageNext",1);function _(b,A){var w=b+"DataIndex",T=createIcon(o.get("pageIcons",!0)[o.getOrient().name][A],{onclick:bind$1(h._pageGo,h,w,o,u)},{x:-p[0]/2,y:-p[1]/2,width:p[0],height:p[1]});T.name=b,v.add(T)}},n.prototype.layoutInner=function(i,o,a,u,c,f){var d=this.getSelectorGroup(),h=i.getOrient().index,v=WH[h],g=XY[h],p=WH[1-h],y=XY[1-h];c&&box("horizontal",d,i.get("selectorItemGap",!0));var _=i.get("selectorButtonGap",!0),b=d.getBoundingRect(),A=[-b.x,-b.y],w=clone$2(a);c&&(w[v]=a[v]-b[v]-_);var T=this._layoutContentAndController(i,u,w,h,v,p,y,g);if(c){if(f==="end")A[h]+=T[v]+_;else{var S=b[v]+_;A[h]-=S,T[g]-=S}T[v]+=b[v]+_,A[1-h]+=T[y]+T[p]/2-b[p]/2,T[p]=Math.max(T[p],b[p]),T[y]=Math.min(T[y],b[y]+A[1-h]),d.x=A[0],d.y=A[1],d.markRedraw()}return T},n.prototype._layoutContentAndController=function(i,o,a,u,c,f,d,h){var v=this.getContentGroup(),g=this._containerGroup,p=this._controllerGroup;box(i.get("orient"),v,i.get("itemGap"),u?a.width:null,u?null:a.height),box("horizontal",p,i.get("pageButtonItemGap",!0));var y=v.getBoundingRect(),_=p.getBoundingRect(),b=this._showController=y[c]>a[c],A=[-y.x,-y.y];o||(A[u]=v[h]);var w=[0,0],T=[-_.x,-_.y],S=retrieve2(i.get("pageButtonGap",!0),i.get("itemGap",!0));if(b){var x=i.get("pageButtonPosition",!0);x==="end"?T[u]+=a[c]-_[c]:w[u]+=_[c]+S}T[1-u]+=y[f]/2-_[f]/2,v.setPosition(A),g.setPosition(w),p.setPosition(T);var O={x:0,y:0};if(O[c]=b?a[c]:y[c],O[f]=Math.max(y[f],_[f]),O[d]=Math.min(0,_[d]+T[1-u]),g.__rectSize=a[c],b){var L={x:0,y:0};L[c]=Math.max(a[c]-_[c]-S,0),L[f]=O[f],g.setClipPath(new Rect$1({shape:L})),g.__rectSize=L[c]}else p.eachChild(function(re){re.attr({invisible:!0,silent:!0})});var M=this._getPageInfo(i);return M.pageIndex!=null&&updateProps$1(v,{x:M.contentPosition[0],y:M.contentPosition[1]},b?i:null),this._updatePageInfoView(i,M),O},n.prototype._pageGo=function(i,o,a){var u=this._getPageInfo(o)[i];u!=null&&a.dispatchAction({type:"legendScroll",scrollDataIndex:u,legendId:o.id})},n.prototype._updatePageInfoView=function(i,o){var a=this._controllerGroup;each$4(["pagePrev","pageNext"],function(v){var g=v+"DataIndex",p=o[g]!=null,y=a.childOfName(v);y&&(y.setStyle("fill",p?i.get("pageIconColor",!0):i.get("pageIconInactiveColor",!0)),y.cursor=p?"pointer":"default")});var u=a.childOfName("pageText"),c=i.get("pageFormatter"),f=o.pageIndex,d=f!=null?f+1:0,h=o.pageCount;u&&c&&u.setStyle("text",isString$2(c)?c.replace("{current}",d==null?"":d+"").replace("{total}",h==null?"":h+""):c({current:d,total:h}))},n.prototype._getPageInfo=function(i){var o=i.get("scrollDataIndex",!0),a=this.getContentGroup(),u=this._containerGroup.__rectSize,c=i.getOrient().index,f=WH[c],d=XY[c],h=this._findTargetItemIndex(o),v=a.children(),g=v[h],p=v.length,y=p?1:0,_={contentPosition:[a.x,a.y],pageCount:y,pageIndex:y-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!g)return _;var b=x(g);_.contentPosition[c]=-b.s;for(var A=h+1,w=b,T=b,S=null;A<=p;++A)S=x(v[A]),(!S&&T.e>w.s+u||S&&!O(S,w.s))&&(T.i>w.i?w=T:w=S,w&&(_.pageNextDataIndex==null&&(_.pageNextDataIndex=w.i),++_.pageCount)),T=S;for(var A=h-1,w=b,T=b,S=null;A>=-1;--A)S=x(v[A]),(!S||!O(T,S.s))&&w.i<T.i&&(T=w,_.pagePrevDataIndex==null&&(_.pagePrevDataIndex=w.i),++_.pageCount,++_.pageIndex),w=S;return _;function x(L){if(L){var M=L.getBoundingRect(),re=M[d]+L[d];return{s:re,e:re+M[f],i:L.__legendDataIndex}}}function O(L,M){return L.e>=M&&L.s<=M+u}},n.prototype._findTargetItemIndex=function(i){if(!this._showController)return 0;var o,a=this.getContentGroup(),u;return a.eachChild(function(c,f){var d=c.__legendDataIndex;u==null&&d!=null&&(u=f),d===i&&(o=f)}),o??u},n.type="legend.scroll",n}(LegendView$1);const ScrollableLegendView$1=ScrollableLegendView;function installScrollableLegendAction(r){r.registerAction("legendScroll","legendscroll",function(n,i){var o=n.scrollDataIndex;o!=null&&i.eachComponent({mainType:"legend",subType:"scroll",query:n},function(a){a.setScrollDataIndex(o)})})}function install$1(r){use(install$2),r.registerComponentModel(ScrollableLegendModel$1),r.registerComponentView(ScrollableLegendView$1),installScrollableLegendAction(r)}function install(r){use(install$2),use(install$1)}const _sfc_main$G=vue.defineComponent({__name:"pie-charts",props:{title:{type:String,default:"标题"},seriesName:{type:String,default:"详情"},seriesData:{type:Array,default:()=>[]}},setup(r){const n=r;use([install$7,install$6,install$3,install$4,install]),vue.provide(VChart.THEME_KEY,"dark");const i=vue.reactive({title:{text:n.title,left:"center"},tooltip:{trigger:"item",formatter:"{a} <br/>{b} : {c} ({d}%)"},legend:{orient:"vertical",left:"left"},series:[{name:n.seriesName,type:"pie",radius:"55%",center:["50%","60%"],data:n.seriesData,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]});return vue.watch(n,o=>{i.title.text=o.title,i.series[0].name=o.seriesName,i.series[0].data=o.seriesData}),(o,a)=>(vue.openBlock(),vue.createBlock(vue.unref(VChart),{class:"chart",option:vue.unref(i),autoresize:""},null,8,["option"]))}}),pieCharts_vue_vue_type_style_index_0_scoped_fec2cbf2_lang="",PieCharts=_export_sfc$1(_sfc_main$G,[["__scopeId","data-v-fec2cbf2"]]),_hoisted_1$k=["id"],_hoisted_2$h=["id"],_hoisted_3$e=["fill"],_hoisted_4$a=["fill"],_hoisted_5$8=["fill"],_hoisted_6$6=vue.createElementVNode("path",{d:"M375.466667 709.214815l-25.6 137.481481c0 2.844444 1.896296 5.688889 7.585185 10.42963l65.422222 54.992593c5.688889 4.740741 15.17037 8.533333 23.703704 10.429629l36.029629-193.422222-107.14074-19.911111z",fill:"#2D4375"},null,-1),_hoisted_7$6=vue.createElementVNode("path",{d:"M482.607407 729.125926l-36.029629 193.422222c9.481481 1.896296 18.014815 1.896296 25.6-0.948148l80.592592-27.496296c6.637037-1.896296 10.42963-4.740741 11.377778-6.637037L589.748148 749.037037l-107.140741-19.911111z",fill:"#1E2D4F"},null,-1),_hoisted_8$6=["fill-opacity"],_hoisted_9$6=["fill-opacity"],_hoisted_10$5=["fill-opacity"],_hoisted_11$4=vue.createElementVNode("path",{d:"M593.540741 807.822222c1.896296-7.585185-3.792593-15.17037-11.377778-16.118518l-107.140741-19.911111-4.740741 27.496296 107.140741 19.911111c6.637037 0.948148 14.222222-3.792593 16.118519-11.377778z",fill:"#CEEFF6"},null,-1),_hoisted_12$4=vue.createElementVNode("path",{d:"M366.933333 750.933333c-7.585185-1.896296-15.17037 3.792593-16.118518 11.377778-1.896296 7.585185 3.792593 15.17037 11.377778 16.118519l107.14074 19.911111 4.740741-27.496297-107.140741-19.911111zM356.503704 808.77037c-7.585185-1.896296-15.17037 3.792593-16.118519 11.377778-1.896296 7.585185 3.792593 15.17037 11.377778 16.118519l107.140741 19.911111 4.74074-27.496297-107.14074-19.911111z",fill:"#FFFFFF"},null,-1),_hoisted_13$3=vue.createElementVNode("path",{d:"M570.785185 848.592593l-107.140741-19.911112-4.74074 27.496297 107.14074 19.911111c7.585185 1.896296 15.17037-3.792593 16.118519-11.377778 1.896296-7.585185-2.844444-15.17037-11.377778-16.118518z",fill:"#CEEFF6"},null,-1),_hoisted_14$3=["xlink:href","width","height"],_sfc_main$F=vue.defineComponent({__name:"light-a",props:{id:{default:""},isOpen:{type:Boolean,default:!1},height:{default:100},width:{default:100}},emits:["onChange"],setup(r,{emit:n}){const i=r;return vue.watch(()=>i.isOpen,()=>{n("onChange")}),(o,a)=>(vue.openBlock(),vue.createElementBlock("g",{id:i.id,style:{cursor:"pointer"}},[vue.createElementVNode("symbol",{id:`${i.id}light-121`,viewBox:"0 0 1024 1024"},[vue.createElementVNode("path",{d:"M565.096296 289.185185s-0.948148 0 0 0c-110.933333-20.859259-208.592593 40.77037-237.985185 148.859259-14.222222 53.096296-24.651852 101.451852 44.562963 221.866667 14.222222 25.6 11.377778 70.162963 8.533333 95.762963-1.896296 14.222222 64.474074 36.02963 89.125926 42.666667l95.762963-509.155556z",fill:i.isOpen?"#FDB813":"#cccccc"},null,8,_hoisted_3$e),vue.createElementVNode("path",{d:"M732.918519 513.896296c11.377778-111.881481-56.888889-203.851852-166.874075-224.711111h-0.948148L469.333333 798.340741c25.6 2.844444 94.814815 6.637037 98.607408-7.585185 6.637037-25.6 20.859259-67.318519 42.666666-86.281482C719.644444 618.192593 727.22963 568.888889 732.918519 513.896296z",fill:i.isOpen?"#FD9B13":"#bbbbbb"},null,8,_hoisted_4$a),vue.createElementVNode("path",{d:"M467.437037 806.874074c-7.585185-0.948148-12.325926-7.585185-14.222222-14.222222l-38.874074-256c-0.948148-5.688889 0.948148-11.377778 4.74074-15.170371 3.792593-3.792593 9.481481-5.688889 15.170371-4.74074l167.822222 31.288889c5.688889 0.948148 10.42963 4.740741 12.325926 9.481481 1.896296 4.740741 1.896296 11.377778-0.948148 16.118519L486.4 798.340741c-3.792593 6.637037-11.377778 10.42963-18.962963 8.533333z m-14.222222-251.259259l27.496296 182.992592L572.681481 578.37037l-119.466666-22.755555z",fill:i.isOpen?"#F12A3F":"#666666"},null,8,_hoisted_5$8),_hoisted_6$6,_hoisted_7$6,vue.createElementVNode("path",{d:"M612.503704 217.125926c-3.792593 18.014815-20.859259 29.392593-38.874074 26.548148-18.014815-3.792593-30.340741-20.859259-26.548149-38.874074l18.962963-100.503704c3.792593-18.014815 20.859259-29.392593 38.874075-26.548148 18.014815 3.792593 30.340741 20.859259 26.548148 38.874074l-18.962963 100.503704z",fill:"#FDB813","fill-opacity":i.isOpen?1:0},null,8,_hoisted_8$6),vue.createElementVNode("path",{d:"M382.103704 228.503704c10.42963 15.17037 6.637037 36.02963-8.533334 46.459259-15.17037 10.42963-36.02963 6.637037-46.459259-8.533333l-57.837037-84.385186c-10.42963-15.17037-6.637037-36.02963 8.533333-46.459259 15.17037-10.42963 36.02963-6.637037 46.45926 8.533334l57.837037 84.385185zM757.57037 298.666667c-15.17037 10.42963-18.962963 31.288889-8.533333 46.459259 10.42963 15.17037 31.288889 18.962963 46.459259 8.533333l84.385185-57.837037c15.17037-10.42963 18.962963-31.288889 8.533334-46.459259-10.42963-15.17037-31.288889-18.962963-46.459259-8.533333l-84.385186 57.837037z",fill:"#FDB813","fill-opacity":i.isOpen?1:0},null,8,_hoisted_9$6),vue.createElementVNode("path",{d:"M252.207407 361.244444c18.014815 3.792593 30.340741 20.859259 26.548149 38.874075-3.792593 18.014815-20.859259 29.392593-38.874075 26.548148l-100.503703-18.962963c-18.014815-3.792593-30.340741-20.859259-26.548148-38.874074 3.792593-18.014815 20.859259-29.392593 38.874074-26.548149l100.503703 18.962963zM931.081481 488.296296c18.014815 3.792593 30.340741 20.859259 26.548149 38.874074-3.792593 18.014815-20.859259 29.392593-38.874074 26.548149l-100.503704-18.962963c-18.014815-3.792593-30.340741-20.859259-26.548148-38.874075 3.792593-18.014815 20.859259-29.392593 38.874074-26.548148l100.503703 18.962963z",fill:"#FDB813","fill-opacity":i.isOpen?1:0},null,8,_hoisted_10$5),_hoisted_11$4,_hoisted_12$4,_hoisted_13$3],8,_hoisted_2$h),vue.createElementVNode("use",{"xlink:href":`#${i.id}light-121`,width:o.width,height:o.height},null,8,_hoisted_14$3)],8,_hoisted_1$k))}}),_hoisted_1$j=["id"],_hoisted_2$g=["id"],_hoisted_3$d=["fill"],_hoisted_4$9=["fill"],_hoisted_5$7=["fill"],_hoisted_6$5=["from","to"],_hoisted_7$5=["fill"],_hoisted_8$5=["from","to"],_hoisted_9$5=["fill"],_hoisted_10$4=["fill"],_hoisted_11$3=["fill"],_hoisted_12$3=["from","to"],_hoisted_13$2=["fill"],_hoisted_14$2=["xlink:href"],_sfc_main$E=vue.defineComponent({__name:"clock-a",props:{id:{default:""},centerColor:{default:"#EBF257"},secondsColor:{default:"#E83E24"},circleColor:{default:"#F45AFC"},minutesColor:{default:"#50E68E"},hoursColor:{default:"#9A36E7"},scaleColor:{default:"#4942CF"},backgroundColor:{default:"#ffffff"},borderColor:{default:"#B3A7FF"}},setup(r){const n=r,i=new Date(Number(window.sessionStorage.getItem("editorLoadTime")||"0")),o=i.getSeconds()+1,a=i.getMinutes(),u=Math.floor((i.getHours()+(a+o/60)/60)*30);return(c,f)=>(vue.openBlock(),vue.createElementBlock("g",{id:n.id},[vue.createElementVNode("symbol",{id:`${n.id}clock-a-n`,viewBox:"0 0 1024 1024"},[vue.createElementVNode("path",{d:"M512.3 518.9m-469.2 0a469.2 469.2 0 1 0 938.4 0 469.2 469.2 0 1 0-938.4 0Z",fill:n.borderColor},null,8,_hoisted_3$d),vue.createElementVNode("path",{d:"M512.3 518.9m-392.5 0a392.5 392.5 0 1 0 785 0 392.5 392.5 0 1 0-785 0Z",fill:n.backgroundColor},null,8,_hoisted_4$9),vue.createElementVNode("path",{d:"M512.3 523.8c-4.5 0-9-1.7-12.4-5.1L318.3 337.1c-6.8-6.8-6.8-17.9 0-24.8 6.8-6.8 17.9-6.8 24.8 0L524.7 494c6.8 6.8 6.8 17.9 0 24.8-3.5 3.3-7.9 5-12.4 5z",fill:n.minutesColor},[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${45+vue.unref(a)*6} 512.3 506.3`,to:`${405+vue.unref(a)*6} 512.3 506.3`,dur:"3600s",repeatCount:"indefinite"},null,8,_hoisted_6$5)],8,_hoisted_5$7),vue.createElementVNode("path",{d:"M512.3 523.8c-4.5 0-9-1.7-12.4-5.1-6.8-6.8-6.8-17.9 0-24.8l130.8-130.8c6.8-6.8 17.9-6.8 24.8 0 6.8 6.8 6.8 17.9 0 24.8L524.7 518.7c-3.5 3.4-7.9 5.1-12.4 5.1z",fill:n.hoursColor},[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${-45+vue.unref(u)} 512.3 506.3`,to:`${315+vue.unref(u)} 512.3 506.3`,dur:"43200s",repeatCount:"indefinite"},null,8,_hoisted_8$5)],8,_hoisted_7$5),vue.createElementVNode("path",{d:"M512.3 506.3m-47.5 0a47.5 47.5 0 1 0 95 0 47.5 47.5 0 1 0-95 0Z",fill:n.circleColor},null,8,_hoisted_9$5),vue.createElementVNode("path",{d:"M512.3 218.8c-9 0-16.3-7.3-16.3-16.3v-29.1c0-9 7.3-16.3 16.3-16.3s16.3 7.3 16.3 16.3v29.1c0 9-7.4 16.3-16.3 16.3zM512.3 880.8c-9 0-16.3-7.3-16.3-16.3v-29.1c0-9 7.3-16.3 16.3-16.3s16.3 7.3 16.3 16.3v29.1c0 9-7.4 16.3-16.3 16.3zM812.4 518.9c0-9 7.3-16.3 16.3-16.3h29.1c9 0 16.3 7.3 16.3 16.3s-7.3 16.3-16.3 16.3h-29.1c-8.9 0-16.3-7.3-16.3-16.3zM150.4 518.9c0-9 7.3-16.3 16.3-16.3h29.1c9 0 16.3 7.3 16.3 16.3s-7.3 16.3-16.3 16.3h-29.1c-8.9 0-16.3-7.3-16.3-16.3z",fill:n.scaleColor},null,8,_hoisted_10$4),vue.createElementVNode("path",{d:"M296.9 733.5c-2.2 0-4.5-0.9-6.2-2.6-3.4-3.4-3.4-9 0-12.4L540 469.2c3.4-3.4 9-3.4 12.4 0 3.4 3.4 3.4 9 0 12.4L303.1 731c-1.7 1.7-4 2.5-6.2 2.5z",fill:n.secondsColor},[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${135.5+o*6} 512.3 506.3`,to:`${495.5+o*6} 512.3 506.3`,dur:"60s",repeatCount:"indefinite"},null,8,_hoisted_12$3)],8,_hoisted_11$3),vue.createElementVNode("path",{d:"M512.3 506.3m-22.8 0a22.8 22.8 0 1 0 45.6 0 22.8 22.8 0 1 0-45.6 0Z",fill:n.centerColor},null,8,_hoisted_13$2)],8,_hoisted_2$g),vue.createElementVNode("use",{"xlink:href":`#${n.id}clock-a-n`,width:"100",height:"100"},null,8,_hoisted_14$2)],8,_hoisted_1$j))}}),vueComp={"svg-text":_sfc_main$J,"el-button":elementPlus.ElButton,"progress-a":_sfc_main$L,"el-tag":elementPlus.ElTag,"common-table":_sfc_main$I,"pie-charts":PieCharts,"switch-r":_sfc_main$K,"now-time":NowTime,"light-a":_sfc_main$F,"clock-a":_sfc_main$E},config=[...svg_config,...vue_config],useGlobalStore=pinia$1.defineStore("global-store",{state:()=>({config_center:config,intention:EGlobalStoreIntention.None,create_svg_info:null,done_json:[],mouse_info:{state:EMouseInfoState.Up,position_x:0,position_y:0,now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0},handle_svg_info:null,scale_info:{type:EScaleInfoType.None,scale_times:{x:1,y:1},scale_item_info:{x:0,y:0},symmetric_point:{x:0,y:0}},rotate_info:{angle:0},connection_line_node_info:{init_pos:{x:0,y:0},point_index:0}}),actions:{setCreateInfo(r){this.intention=EGlobalStoreIntention.Create,this.create_svg_info=r},setDoneJson(r){isOfType(r,"id")?(this.done_json.push(r),vue.nextTick(()=>{setSvgActualInfo(r)})):this.done_json=objectDeepClone(r),vue.nextTick(()=>{useHistoryRecord(objectDeepClone(this.done_json))})},setHandleSvgInfo(r,n){let i=n;r?(!i&&i!=0&&(i=this.done_json.findIndex(o=>o.id===r.id)??-1),this.handle_svg_info={info:r,index:i}):this.handle_svg_info=r},spliceDoneJson(r){const n=useGlobalStore(),o=n.done_json.splice(r,1)[0];unbindAnchors(o.id),useHistoryRecord(n.done_json)}}}),useSvgEditLayoutStore=pinia$1.defineStore("svg-edit-layout-store",{state:()=>({left_nav:!0,right_nav:!0,center_offset:{x:0,y:0},canvasInfo:{with:0,height:0,top:0,left:0}})}),stopEvent=r=>{r.stopPropagation()},preventDefault=r=>{r.preventDefault()};function componentsRegister(r){var o,a;const n=vue.getCurrentInstance(),i=r?Object.assign(vueComp,r):vueComp;for(let u in i)!((o=n==null?void 0:n.appContext)!=null&&o.components.hasOwnProperty(u))&&vueComp.hasOwnProperty(u)&&((a=n==null?void 0:n.appContext)==null||a.app.component(u,vueComp[u]))}function setEditorLoadTime(){window.sessionStorage.setItem("editorLoadTime",new Date().getTime().toString())}const randomString=r=>{r=r||10;const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=n.length;let o="";for(let a=0;a<r;a++){let u=i;a===0&&(u=i-10),o+=n.charAt(Math.floor(Math.random()*u))}return o},isOfType=(r,n)=>r[n]!==void 0,getCoordinateOffset=(r,n)=>r/2*(n-1),angleToRadian=r=>r*Math.PI/180,calculateRotatedPointCoordinate=(r,n,i)=>({x:parseFloat(((r.x-n.x)*Math.cos(angleToRadian(i))-(r.y-n.y)*Math.sin(angleToRadian(i))+n.x).toFixed(1)),y:parseFloat(((r.x-n.x)*Math.sin(angleToRadian(i))+(r.y-n.y)*Math.cos(angleToRadian(i))+n.y).toFixed(1))}),getCenterPoint=(r,n)=>({x:r.x+(n.x-r.x)/2,y:r.y+(n.y-r.y)/2}),positionArrToPath=r=>{let n="";for(let i=0;i<r.length;i++)i===0?n+=`M ${r[i].x} ${r[i].y}`:n+=` L ${r[i].x} ${r[i].y}`;return n},getSvgNowPosition=(r,n,i)=>i+(n-r),objectDeepClone=(r,n={})=>r?JSON.parse(JSON.stringify(r)):n,setSvgActualInfo=(r,n)=>{var a,u;const i=document.querySelector(`#${r.id}`),o=document.querySelector(`#rect${r.id}`);if(i){let c=0,f=0,d=0,h=0;if(r.type===EDoneJsonType.Vue){d=((a=r.props.width)==null?void 0:a.val)||i.offsetWidth||100,h=((u=r.props.height)==null?void 0:u.val)||i.offsetHeight||100,c=50-d/2,f=50-h/2;const v=document.querySelector(`#foreign-object${r.id}`);v&&(v.getAttribute("x")==="0"&&v.getAttribute("y")==="0"&&v.getAttribute("width")==="0"&&v.getAttribute("height")==="0"||n)&&(v.setAttribute("x",c.toString()),v.setAttribute("y",f.toString()),v.setAttribute("width",d.toString()),v.setAttribute("height",h.toString()))}else{const v=i.getBBox();c=parseFloat(v.x.toFixed(0)),f=parseFloat(v.y.toFixed(0)),d=parseFloat(v.width.toFixed(0)),h=parseFloat(v.height.toFixed(0))}o&&(o.getAttribute("x")==="0"&&o.getAttribute("y")==="0"&&o.getAttribute("width")==="0"&&o.getAttribute("height")==="0"||n)&&(o.setAttribute("x",c.toString()),o.setAttribute("y",f.toString()),o.setAttribute("width",d.toString()),o.setAttribute("height",h.toString())),(r.actual_bound.x===0&&r.actual_bound.y===0&&r.actual_bound.width===0&&r.actual_bound.height===0||n)&&(r.actual_bound={x:c,y:f,width:d,height:h}),r.center_position={x:r.x+r.actual_bound.x+d/2,y:r.y+r.actual_bound.y+h/2},r.point_coordinate.tl={x:r.center_position.x-d*r.scale_x/2,y:r.center_position.y-h*r.scale_y/2},r.point_coordinate.tc={x:r.center_position.x,y:r.center_position.y-h*r.scale_y/2},r.point_coordinate.tr={x:r.center_position.x+d*r.scale_x/2,y:r.center_position.y-h*r.scale_y/2},r.point_coordinate.l={x:r.center_position.x-d*r.scale_x/2,y:r.center_position.y},r.point_coordinate.r={x:r.center_position.x+d*r.scale_x/2,y:r.center_position.y},r.point_coordinate.bl={x:r.center_position.x-d*r.scale_x/2,y:r.center_position.y+h*r.scale_y/2},r.point_coordinate.bc={x:r.center_position.x,y:r.center_position.y+h*r.scale_y/2},r.point_coordinate.br={x:r.center_position.x+d*r.scale_x/2,y:r.center_position.y+h*r.scale_y/2},r.rotate!==0&&setAfterRotationPointCoordinate(r),moveAnchors(r)}},resetHandlePointOld=r=>{for(const n of Object.keys(r.point_coordinate))r.point_coordinate_old&&(r.point_coordinate_old[n].x=0,r.point_coordinate_old[n].y=0)},moveHandlePoint=(r,n,i)=>{const o=useGlobalStore(pinia),a=n??o.mouse_info.new_position_x-o.mouse_info.position_x,u=i??o.mouse_info.new_position_y-o.mouse_info.position_y;for(const c of Object.keys(r.point_coordinate))n!==void 0&&i!==void 0?(r.point_coordinate[c].x+=a,r.point_coordinate[c].y+=u):r.point_coordinate_old&&(r.point_coordinate[c].x=r.point_coordinate_old[c].x+a,r.point_coordinate[c].y=r.point_coordinate_old[c].y+u)},moveAnchors=r=>{var i,o,a,u;const n=useGlobalStore(pinia);for(let c of n.done_json)if(c.type===EDoneJsonType.ConnectionLine){if(((o=(i=c.bind_anchors)==null?void 0:i.start)==null?void 0:o.target_id)===r.id){const f=getAnchorPosByAnchorType(c.bind_anchors.start.type,r);c.props.point_position.val[0]={x:f.x-c.x,y:f.y-c.y}}if(((u=(a=c.bind_anchors)==null?void 0:a.end)==null?void 0:u.target_id)===r.id){const f=getAnchorPosByAnchorType(c.bind_anchors.end.type,r);c.props.point_position.val[c.props.point_position.val.length-1]={x:f.x-c.x,y:f.y-c.y}}}},unbindAnchors=r=>{var i,o,a,u;const n=useGlobalStore(pinia);for(let c of n.done_json)c.type===EDoneJsonType.ConnectionLine&&(((o=(i=c.bind_anchors)==null?void 0:i.start)==null?void 0:o.target_id)===r&&(c.bind_anchors.start=null),((u=(a=c.bind_anchors)==null?void 0:a.end)==null?void 0:u.target_id)===r&&(c.bind_anchors.end=null))},getAnchorPosByAnchorType=(r,n)=>r===ELineBindAnchors.BottomCenter?n.point_coordinate.bc:r===ELineBindAnchors.Left?n.point_coordinate.l:r===ELineBindAnchors.Right?n.point_coordinate.r:n.point_coordinate.tc,setAfterRotationPointCoordinate=r=>{r.point_coordinate={tl:calculateRotatedPointCoordinate(r.point_coordinate.tl,r.center_position,r.rotate),tc:calculateRotatedPointCoordinate(r.point_coordinate.tc,r.center_position,r.rotate),tr:calculateRotatedPointCoordinate(r.point_coordinate.tr,r.center_position,r.rotate),l:calculateRotatedPointCoordinate(r.point_coordinate.l,r.center_position,r.rotate),r:calculateRotatedPointCoordinate(r.point_coordinate.r,r.center_position,r.rotate),bl:calculateRotatedPointCoordinate(r.point_coordinate.bl,r.center_position,r.rotate),bc:calculateRotatedPointCoordinate(r.point_coordinate.bc,r.center_position,r.rotate),br:calculateRotatedPointCoordinate(r.point_coordinate.br,r.center_position,r.rotate)}},prosToVBind=(r,n=[])=>{let i={};if(r.state){for(const o in r.state)if(r.state.hasOwnProperty(o)&&o===r.defaultState){for(let a in r.state[o])a!=="label"&&(i[lodashEs.kebabCase(a)]=r.state[o][a]);break}}for(const o in r.props)n.indexOf(o)<0&&(i[lodashEs.kebabCase(o)]=r.props[o].val);return i},setArrItemByID=(id,key,val,json_arr)=>new Promise(res=>{const find_item=json_arr.find(r=>r.id===id);find_item||res({status:!1,msg:"要设置的id不存在"}),eval(`find_item.${key} = val;`),res({status:!0,msg:"操作成功"})}),getCommonClass=r=>!r.common_animations||!r.common_animations.val?"":`common-ani animate__animated animate__${r.common_animations.val} animate__${r.common_animations.speed} animate__${r.common_animations.repeat} animate__${r.common_animations.delay}`,numberArray=r=>{let n=[];for(let i=0;i<r;i++)n.push(i);return n},getStringWidth=(r,n=12)=>{if(r.length>0){let i=document.createElement("span");i.style.fontSize=n+"px",i.style.fontFamily="inherit",i.innerHTML=r,i.style.opacity="0",i.style.position="fixed",i.style.top="3000px",document.body.append(i);const o=i.clientWidth;return document.body.removeChild(i),o}return 0},valFormat=r=>/false|true/.test(r)?r!=="false":/^\d+(\.\d+)?$/.test(r)?Number(r):r,createLine=(r,n,i)=>{r.preventDefault();const o=useGlobalStore(pinia),a=useConfigStore(pinia),u=useSvgEditLayoutStore(pinia),{clientX:c,clientY:f}=r;let d=objectDeepClone(a.connection_line),h=0,v=0;if(n&&i){d.bind_anchors.start={type:n,target_id:i.id};let p=getAnchorPosByAnchorType(n,i);h=p.x,v=p.y}else h=Math.round((c-u.canvasInfo.left)/a.svg.scale-u.center_offset.x),v=Math.round((f-u.canvasInfo.top)/a.svg.scale-u.center_offset.y);const g={id:randomString(),x:h,y:v,client:{x:h,y:v},scale_x:1,scale_y:1,rotate:0,actual_bound:{x:0,y:0,width:0,height:0},center_position:{x:0,y:0},point_coordinate:{tl:{x:0,y:0},tc:{x:0,y:0},tr:{x:0,y:0},l:{x:0,y:0},r:{x:0,y:0},bl:{x:0,y:0},bc:{x:0,y:0},br:{x:0,y:0}},...d};g.props.point_position.val.push({x:0,y:0}),o.setDoneJson(g),o.setHandleSvgInfo(g,o.done_json.length-1),o.intention=EGlobalStoreIntention.Connection,o.mouse_info={state:EMouseInfoState.Down,position_x:h,position_y:v,now_position_x:h,now_position_y:v,new_position_x:0,new_position_y:0}};Object.seal({name:"straight-line",title:"直线",type:EDoneJsonType.StraightLine,config:{can_zoom:!1,have_anchor:!1,actual_rect:!1},display:!0,props:{fill:{title:"填充色",type:EConfigItemPropsType.Color,val:"#ff0000"},start_x:{title:"起点x坐标",type:EConfigItemPropsType.InputNumber,val:0},start_y:{title:"起点y坐标",type:EConfigItemPropsType.InputNumber,val:0},end_x:{title:"终点x坐标",type:EConfigItemPropsType.InputNumber,val:0},end_y:{title:"终点y坐标",type:EConfigItemPropsType.InputNumber,val:0}},bind_anchors:{start:null,end:null},events:[]});const connection_line_system={name:"connection_line",title:"连接线",type:EDoneJsonType.ConnectionLine,config:{can_zoom:!1,have_anchor:!1,actual_rect:!1},display:!0,props:{stroke:{title:"线条颜色",type:EConfigItemPropsType.Color,val:"#ff0000"},"stroke-width":{title:"线条宽度",type:EConfigItemPropsType.InputNumber,val:2},point_r:{title:"节点半径",type:EConfigItemPropsType.InputNumber,val:4},point_position:{title:"点坐标",type:EConfigItemPropsType.JsonEdit,val:[]}},animations:{type:{title:"动画类型",type:EConfigItemPropsType.Select,val:EConfigAnimationsType.None,options:[{label:"无",value:EConfigAnimationsType.None},{label:"电流",value:EConfigAnimationsType.Electricity},{label:"轨迹",value:EConfigAnimationsType.Track},{label:"水珠",value:EConfigAnimationsType.WaterDrop}]},dur:{title:"持续时间",type:EConfigItemPropsType.InputNumber,val:20},repeatCount:{title:"循环次数",type:EConfigItemPropsType.Input,val:"indefinite",disabled:!0},color:{title:"颜色",type:EConfigItemPropsType.Color,val:"#602a00"},reverse:{title:"反转动画",type:EConfigItemPropsType.Switch,val:!1}},bind_anchors:{start:null,end:null},events:[]},common_animate_list=[{label:"进入",children:[{label:"渐显",value:"fadeIn"},{label:"向右进入",value:"fadeInLeft"},{label:"向左进入",value:"fadeInRight"},{label:"向上进入",value:"fadeInUp"},{label:"向下进入",value:"fadeInDown"},{label:"向右长距进入",value:"fadeInLeftBig"},{label:"向左长距进入",value:"fadeInRightBig"},{label:"向上长距进入",value:"fadeInUpBig"},{label:"向下长距进入",value:"fadeInDownBig"},{label:"旋转进入",value:"rotateIn"},{label:"左顺时针旋转",value:"rotateInDownLeft"},{label:"右逆时针旋转",value:"rotateInDownRight"},{label:"左逆时针旋转",value:"rotateInUpLeft"},{label:"右逆时针旋转",value:"rotateInUpRight"},{label:"弹入",value:"bounceIn"},{label:"向右弹入",value:"bounceInLeft"},{label:"向左弹入",value:"bounceInRight"},{label:"向上弹入",value:"bounceInUp"},{label:"向下弹入",value:"bounceInDown"},{label:"光速从右进入",value:"lightSpeedInRight"},{label:"光速从左进入",value:"lightSpeedInLeft"},{label:"光速从右退出",value:"lightSpeedOutRight"},{label:"光速从左退出",value:"lightSpeedOutLeft"},{label:"Y轴旋转",value:"flip"},{label:"中心X轴旋转",value:"flipInX"},{label:"中心Y轴旋转",value:"flipInY"},{label:"左长半径旋转",value:"rollIn"},{label:"由小变大进入",value:"zoomIn"},{label:"左变大进入",value:"zoomInLeft"},{label:"右变大进入",value:"zoomInRight"},{label:"向上变大进入",value:"zoomInUp"},{label:"向下变大进入",value:"zoomInDown"},{label:"向右滑动展开",value:"slideInLeft"},{label:"向左滑动展开",value:"slideInRight"},{label:"向上滑动展开",value:"slideInUp"},{label:"向下滑动展开",value:"slideInDown"}]},{label:"强调",children:[{label:"弹跳",value:"bounce"},{label:"闪烁",value:"flash"},{label:"放大缩小",value:"pulse"},{label:"放大缩小弹簧",value:"rubberBand"},{label:"左右晃动",value:"headShake"},{label:"左右扇形摇摆",value:"swing"},{label:"放大晃动缩小",value:"tada"},{label:"扇形摇摆",value:"wobble"},{label:"左右上下晃动",value:"jello"},{label:"Y轴旋转",value:"flip"}]},{label:"退出",children:[{label:"渐隐",value:"fadeOut"},{label:"向左退出",value:"fadeOutLeft"},{label:"向右退出",value:"fadeOutRight"},{label:"向上退出",value:"fadeOutUp"},{label:"向下退出",value:"fadeOutDown"},{label:"向左长距退出",value:"fadeOutLeftBig"},{label:"向右长距退出",value:"fadeOutRightBig"},{label:"向上长距退出",value:"fadeOutUpBig"},{label:"向下长距退出",value:"fadeOutDownBig"},{label:"旋转退出",value:"rotateOut"},{label:"左顺时针旋转",value:"rotateOutDownLeft"},{label:"右逆时针旋转",value:"rotateOutDownRight"},{label:"左逆时针旋转",value:"rotateOutUpLeft"},{label:"右逆时针旋转",value:"rotateOutUpRight"},{label:"弹出",value:"bounceOut"},{label:"向左弹出",value:"bounceOutLeft"},{label:"向右弹出",value:"bounceOutRight"},{label:"向上弹出",value:"bounceOutUp"},{label:"向下弹出",value:"bounceOutDown"},{label:"中心X轴旋转",value:"flipOutX"},{label:"中心Y轴旋转",value:"flipOutY"},{label:"左长半径旋转",value:"rollOut"},{label:"由小变大退出",value:"zoomOut"},{label:"左变大退出",value:"zoomOutLeft"},{label:"右变大退出",value:"zoomOutRight"},{label:"向上变大退出",value:"zoomOutUp"},{label:"向下变大退出",value:"zoomOutDown"},{label:"向左滑动收起",value:"slideOutLeft"},{label:"向右滑动收起",value:"slideOutRight"},{label:"向上滑动收起",value:"slideOutUp"},{label:"向下滑动收起",value:"slideOutDown"}]}];let l=localStorage.getItem("svg-editor-config"),s,t;if(l){let r=JSON.parse(l);t=r.connection_line,s=r.svg}else t=objectDeepClone(connection_line_system),s={background_color:"#fff",scale:1,grid:!0,grid_color:"#ebebeb",ruler:!0};const useConfigStore=pinia$1.defineStore("config-store",{state:()=>({svg:s,connection_line:t,net:{mqtt:{url:"",user:"",pwd:"",topics:""}}}),getters:{},actions:{}});var EContextMenuInfoType=(r=>(r.Copy="Copy",r.Delete="Delete",r.MoveUpOneLevel="MoveUpOneLevel",r.MoveDownOneLevel="MoveDownOneLevel",r.MoveUpTopLevel="MoveUpTopLevel",r.MoveDownTopLevel="MoveDownTopLevel",r))(EContextMenuInfoType||{});const useEditPrivateStore=pinia$1.defineStore("edit-private-store",{state:()=>({old_done_components:[],history_doneComponent:[],history_now_index:0,is_record_history:!0,max_record_times:10}),getters:{getTopBtnUndoStatus(r){return r.history_now_index>=1},getTopBtnRedoStatus(r){return r.history_now_index+1!=r.history_doneComponent.length}},actions:{topUndoBtnClick(){if(console.log("撤销"),this.history_now_index<1)return;const r=useGlobalStore();this.is_record_history=!1,this.history_now_index-=1,r.setDoneJson(this.history_doneComponent[this.history_now_index])},topRedoBtnClick(){if(console.log("重做"),this.history_now_index+1==this.history_doneComponent.length)return;const r=useGlobalStore();this.is_record_history=!1,this.history_now_index+=1,r.setDoneJson(this.history_doneComponent[this.history_now_index])}}}),useContextMenuStore=pinia$1.defineStore("context-menu-store",{state:()=>({display:!1,info:{[EContextMenuInfoType.Copy]:{title:"复制",hot_key:"Ctrl + c",enable:!0},[EContextMenuInfoType.Delete]:{title:"删除",hot_key:"Delete",enable:!0},[EContextMenuInfoType.MoveUpTopLevel]:{title:"置于顶层",hot_key:"Ctrl + →",enable:!0},[EContextMenuInfoType.MoveDownTopLevel]:{title:"置于底层",hot_key:"Ctrl + ←",enable:!0},[EContextMenuInfoType.MoveUpOneLevel]:{title:"置于上一层",hot_key:"Ctrl + ↑",enable:!0},[EContextMenuInfoType.MoveDownOneLevel]:{title:"置于下一层",hot_key:"Ctrl + ↓",enable:!0}}}),actions:{onContextMenuClick(r){const n=useGlobalStore();if(n.handle_svg_info)switch(n.intention=EGlobalStoreIntention.Select,r){case EContextMenuInfoType.Copy:const i=objectDeepClone(n.handle_svg_info.info);i.id=randomString(),i.title+="-copy",i.x+=10,i.y+=10,n.setDoneJson(i),this.display=!1,n.setHandleSvgInfo(i,n.done_json.length);break;case EContextMenuInfoType.Delete:n.spliceDoneJson(n.handle_svg_info.index),this.display=!1,n.setHandleSvgInfo(null),n.intention=EGlobalStoreIntention.None;break;case EContextMenuInfoType.MoveUpOneLevel:if(n.done_json.length===1||n.handle_svg_info.index===n.done_json.length-1)return;const o=n.handle_svg_info.info;n.done_json[n.handle_svg_info.index]=n.done_json[n.handle_svg_info.index+1],n.done_json[n.handle_svg_info.index+1]=o,useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(o,n.handle_svg_info.index+1);break;case EContextMenuInfoType.MoveDownOneLevel:if(n.done_json.length===1||n.handle_svg_info.index===0)return;const a=n.handle_svg_info.info;n.done_json[n.handle_svg_info.index]=n.done_json[n.handle_svg_info.index-1],n.done_json[n.handle_svg_info.index-1]=a,useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(a,n.handle_svg_info.index-1);break;case EContextMenuInfoType.MoveDownTopLevel:if(n.done_json.length===1||n.handle_svg_info.index===0)return;const u=n.handle_svg_info.info;n.done_json.splice(n.handle_svg_info.index,1),n.done_json.unshift(u),useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(u,0);break;case EContextMenuInfoType.MoveUpTopLevel:if(n.done_json.length===1||n.handle_svg_info.index===n.done_json.length)return;const c=n.handle_svg_info.info;n.done_json.splice(n.handle_svg_info.index,1),n.done_json.push(c),useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(c,n.done_json.length-1);break}}}}),pinia=pinia$1.createPinia(),useHistoryRecord=r=>{const n=useEditPrivateStore();n.is_record_history&&(n.history_now_index+1<n.history_doneComponent.length&&n.history_doneComponent.splice(n.history_now_index+1),n.history_doneComponent.push(r),n.history_now_index=n.history_doneComponent.length-1,n.history_doneComponent.length>n.max_record_times&&(n.history_doneComponent.shift(),n.history_now_index=n.history_doneComponent.length-1)),n.is_record_history=!0},useImportDataModel=r=>{try{const n=JSON.parse(r);if(!n.config||!n.layout_center||!n.done_json)return elementPlus.ElMessage.error("请导入正确的数据模型!"),!1;const i=useGlobalStore(pinia),o=useSvgEditLayoutStore(pinia),a=useConfigStore(pinia);return a.$state=n.config,o.center_offset=n.layout_center,i.setDoneJson(n.done_json),!0}catch(n){return elementPlus.ElMessage.error("请导入正确的数据模型!"),console.error(n),!1}},_hoisted_1$i={"aria-hidden":"true"},_hoisted_2$f=["xlink:href"],_sfc_main$D=vue.defineComponent({__name:"svg-analysis",props:{name:{},props:{default:()=>({})}},setup(r){const n=r,i=vue.computed(()=>`#svg-${n.name}`);return(o,a)=>(vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$i,[vue.createElementVNode("use",vue.mergeProps({"xlink:href":vue.unref(i)},n.props),null,16,_hoisted_2$f)]))}});var EVisibleConfKey=(r=>(r.ImportJson="ImportJson",r.ExportJson="ExportJson",r.ImportFile="ImportFile",r))(EVisibleConfKey||{});const _withScopeId$2=r=>(vue.pushScopeId("data-v-62907637"),r=r(),vue.popScopeId(),r),_hoisted_1$h={class:"flex justify-between",style:{width:"100%"}},_hoisted_2$e={class:"flex items-center justify-between",style:{width:"250px"}},_hoisted_3$c=_withScopeId$2(()=>vue.createElementVNode("div",{class:"flex items-center"},[vue.createElementVNode("span",{class:"logo-title"},"Svg Editor")],-1)),_hoisted_4$8={class:"flex justify-between",style:{width:"calc(100% - 440px)"}},_hoisted_5$6={class:"flex items-center"},_hoisted_6$4={class:"flex items-center mr-20px"},_hoisted_7$4={class:"flex items-center",style:{width:"250px"}},_hoisted_8$4=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title",style:{"padding-top":"16px"}},"多选",-1)),_hoisted_9$4=_withScopeId$2(()=>vue.createElementVNode("div",null,"在画布空白区域按住鼠标左键可以框选(图形坐标在框选区域即判定被选中),也可以按住ctrl+鼠标左键点图形进行多选",-1)),_hoisted_10$3=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_11$2=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"拖动画布",-1)),_hoisted_12$2=_withScopeId$2(()=>vue.createElementVNode("div",null,"在画布空白区域按住右键可拖动画布,右侧面板‘图纸’栏可微调或重置位置",-1)),_hoisted_13$1=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_14$1=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"画布缩放",-1)),_hoisted_15$1=_withScopeId$2(()=>vue.createElementVNode("div",null,"在画布空白区使用鼠标滚轮或者右侧面板‘图纸’栏可控制画布缩放",-1)),_hoisted_16$2=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_17=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"标尺辅助线",-1)),_hoisted_18=_withScopeId$2(()=>vue.createElementVNode("div",null,"在标尺区域按住鼠标左键并拖动即可创建标尺辅助线,将标尺辅助线拖动到标尺区域即可删除标尺辅助线",-1)),_hoisted_19=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_20=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"组件尺寸",-1)),_hoisted_21=_withScopeId$2(()=>vue.createElementVNode("div",null,[vue.createElementVNode("p",null," 大多数组件可以通过选中组件然后拖动交互点或在右侧‘外观’栏改变外形尺寸,或通过右侧‘数据’栏直接或间接改变外形尺寸;"),vue.createElementVNode("p",null,"少数特殊组件仅可通过右侧'数据'栏直接或间接改变外形尺寸")],-1)),_hoisted_22$1=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_23=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"连线样式",-1)),_hoisted_24=_withScopeId$2(()=>vue.createElementVNode("div",null,"在右侧‘连线’栏可以统一配置连线样式,配置后先增加的线会应用新样式,之前的线样式不变,如需改变,可选中线手动更改或删除重画 ",-1)),_hoisted_25=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_26$1=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"横线和竖线",-1)),_hoisted_27=_withScopeId$2(()=>vue.createElementVNode("div",{class:"guide-text"},[vue.createElementVNode("p",null," 点击编辑器顶部连线按钮会进入连线状态,该状态下在画板点击鼠标左键即可开始画线,移动并再次点击左键创建新的节点,右键结束画线并退出连线状态;"),vue.createElementVNode("p",null,"画线的时候按住ctrl即可画竖线,按住shift即可画横线")],-1)),_hoisted_28=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_29=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"绑定锚点",-1)),_hoisted_30=_withScopeId$2(()=>vue.createElementVNode("div",{class:"guide-text"},[vue.createElementVNode("p",null,"组件在未选中时,鼠标经过组件时会出现锚点,鼠标悬浮在锚点上时,会有交互样式,点击左键即可以锚点为起点创建连线;"),vue.createElementVNode("p",null,"同样,在连线时鼠标经过锚点时,会出现锚点交互样式,点击左键即可以锚点为连线终点结束连线;"),vue.createElementVNode("p",null,"这两种情况下的连线会绑定组件上的锚点,如需解绑,参考下面的‘锚点解绑’;"),vue.createElementVNode("p",null,"同样,也可先画线,再选中连线绑定想要绑定的组件锚点(连线只有首尾节点可以绑定锚点)")],-1)),_hoisted_31=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_32$1=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"线段选中",-1)),_hoisted_33=_withScopeId$2(()=>vue.createElementVNode("div",null," 若线段绑定了锚点,移动线段,绑定的锚点不会移动。若是想将线段整体移动,需要先解绑,参考下面的‘锚点解绑’ ",-1)),_hoisted_34=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_35=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"锚点解绑",-1)),_hoisted_36$1=_withScopeId$2(()=>vue.createElementVNode("div",{style:{"padding-bottom":"14px"}}," 选中线段,在右侧‘数据’栏里解除绑定;或者鼠标左键拖拽连线上需要解绑的节点",-1)),_sfc_main$C=vue.defineComponent({__name:"top-panel",emits:["changeVisible","onReturn","onPreview","onSave"],setup(r,{emit:n}){const i=useSvgEditLayoutStore(pinia),o=useGlobalStore(pinia),a=useEditPrivateStore(pinia),u=useConfigStore(pinia),c=()=>{o.done_json.length<=0||o.setDoneJson([]),o.intention=EGlobalStoreIntention.None},f=v=>{const g={layout_center:i.center_offset,config:u.$state,done_json:o.done_json};n(v,g)},d=vue.ref(!1),h=vue.computed({get:()=>o.intention===EGlobalStoreIntention.Connection,set(v){o.intention=v?EGlobalStoreIntention.Connection:EGlobalStoreIntention.None,v&&o.setHandleSvgInfo(null)}});return(v,g)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",_hoisted_1$h,[vue.createElementVNode("div",_hoisted_2$e,[_hoisted_3$c,vue.createVNode(vue.unref(elementPlus.ElIcon),{size:24,class:"bt-Icon",onClick:g[0]||(g[0]=p=>vue.unref(i).left_nav=!vue.unref(i).left_nav),title:vue.unref(i).left_nav?"隐藏左侧菜单":"显示左侧菜单"},{default:vue.withCtx(()=>[vue.unref(i).left_nav?(vue.openBlock(),vue.createBlock(_sfc_main$D,{key:0,name:"menu-unfold"})):(vue.openBlock(),vue.createBlock(_sfc_main$D,{key:1,name:"menu-fold"}))]),_:1},8,["title"])]),vue.createElementVNode("div",_hoisted_4$8,[vue.createElementVNode("div",_hoisted_5$6,[vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"撤销 ctrl+z",size:24,class:vue.normalizeClass(`${vue.unref(a).getTopBtnUndoStatus?"bt-Icon":"icon-disable"} ml-20px`),onClick:g[1]||(g[1]=()=>vue.unref(a).topUndoBtnClick())},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:vue.unref(a).getTopBtnUndoStatus?"undo":"undo-gray"},null,8,["name"])]),_:1},8,["class"]),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"重做 ctrl+shift+z",class:vue.normalizeClass(`${vue.unref(a).getTopBtnRedoStatus?"bt-Icon":"icon-disable"} ml-5px`),size:24,onClick:g[2]||(g[2]=()=>vue.unref(a).topRedoBtnClick())},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:vue.unref(a).getTopBtnRedoStatus?"redo":"redo-gray"},null,8,["name"])]),_:1},8,["class"]),vue.createVNode(vue.unref(elementPlus.ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"清空 ctrl+delete",class:vue.normalizeClass(vue.unref(o).done_json.length>0?"bt-Icon":"icon-disable"),size:24,onClick:c},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:vue.unref(o).done_json.length>0?"delete":"delete-gray"},null,8,["name"])]),_:1},8,["class"]),vue.createVNode(vue.unref(elementPlus.ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"导入数据模型",class:"bt-Icon",size:24,onClick:g[3]||(g[3]=p=>n("changeVisible",vue.unref(EVisibleConfKey).ImportJson,!0))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"import"})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"导出数据模型",size:24,class:"bt-Icon ml-5px",onClick:g[4]||(g[4]=p=>n("changeVisible",vue.unref(EVisibleConfKey).ExportJson,!0))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"export"})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"创建连线",class:vue.normalizeClass(["bt-Icon",{active:vue.unref(h)}]),size:24,onClick:g[5]||(g[5]=p=>h.value=!vue.unref(h))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:vue.unref(h)?"line-active":"line"},null,8,["name"])]),_:1},8,["class"]),vue.createVNode(vue.unref(elementPlus.ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"说明",class:"bt-Icon",size:24,onClick:g[6]||(g[6]=p=>d.value=!vue.unref(d))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"question"})]),_:1})]),vue.createElementVNode("div",_hoisted_6$4,[vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"返回",class:"bt-Icon",size:24,onClick:g[7]||(g[7]=p=>f("onReturn"))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"return"})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"保存",class:"bt-Icon",size:24,onClick:g[8]||(g[8]=p=>f("onSave"))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"save"})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"预览",class:"bt-Icon",size:22,onClick:g[9]||(g[9]=p=>f("onPreview"))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"preview"})]),_:1})])]),vue.createElementVNode("div",_hoisted_7$4,[vue.createVNode(vue.unref(elementPlus.ElIcon),{size:24,class:"bt-Icon",onClick:g[10]||(g[10]=p=>vue.unref(i).right_nav=!vue.unref(i).right_nav),title:vue.unref(i).right_nav?"隐藏右侧菜单":"显示右侧菜单"},{default:vue.withCtx(()=>[vue.unref(i).right_nav?(vue.openBlock(),vue.createBlock(_sfc_main$D,{key:0,name:"menu-fold"})):(vue.openBlock(),vue.createBlock(_sfc_main$D,{key:1,name:"menu-unfold"}))]),_:1},8,["title"])])]),vue.createVNode(vue.unref(elementPlus.ElDialog),{modelValue:vue.unref(d),"onUpdate:modelValue":g[11]||(g[11]=p=>vue.isRef(d)?d.value=p:null),title:"使用说明",width:"60%",class:"guide-dialog"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElScrollbar),{"max-height":"60vh"},{default:vue.withCtx(()=>[_hoisted_8$4,_hoisted_9$4,_hoisted_10$3,_hoisted_11$2,_hoisted_12$2,_hoisted_13$1,_hoisted_14$1,_hoisted_15$1,_hoisted_16$2,_hoisted_17,_hoisted_18,_hoisted_19,_hoisted_20,_hoisted_21,_hoisted_22$1,_hoisted_23,_hoisted_24,_hoisted_25,_hoisted_26$1,_hoisted_27,_hoisted_28,_hoisted_29,_hoisted_30,_hoisted_31,_hoisted_32$1,_hoisted_33,_hoisted_34,_hoisted_35,_hoisted_36$1]),_:1})]),_:1},8,["modelValue"])],64))}}),topPanel_vue_vue_type_style_index_0_scoped_62907637_lang="",topPanel_vue_vue_type_style_index_1_lang="",TopPanel=_export_sfc$1(_sfc_main$C,[["__scopeId","data-v-62907637"]]),_hoisted_1$g={class:"component-group flex flex-wrap"},_hoisted_2$d=["onDragstart","title"],_sfc_main$B=vue.defineComponent({__name:"left-panel",props:{customToolbar:{}},setup(r){const n=r,i=useGlobalStore(pinia),o=vue.ref(n.customToolbar&&Object.keys(n.customToolbar).length>0?n.customToolbar:i.config_center),a=vue.ref(["stateful","stateless","have_animation","custom_svg_group","element-ui","custom-vue","echarts"]),u=d=>{i.setCreateInfo(c(d))},c=d=>(d!=null&&d.props&&!lodashEs.isEmpty(d.props)&&Object.keys(d.props).forEach((h,v)=>{d.props[h].sort=String(v)}),d),f=d=>{var h;if(((h=d.dataTransfer)==null?void 0:h.dropEffect)!=="copy"){elementPlus.ElMessage.warning("请将组件拖到画布中!"),i.intention=EGlobalStoreIntention.None;return}};return(d,h)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(elementPlus.ElCollapse),{modelValue:vue.unref(a),"onUpdate:modelValue":h[0]||(h[0]=v=>vue.isRef(a)?a.value=v:null),style:{"border-top":"none"}},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(o),v=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElCollapseItem),{name:v.groupType,key:v.title},{title:vue.withCtx(()=>[vue.createElementVNode("div",null,vue.toDisplayString(v.title),1)]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$g,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(v.list,g=>(vue.openBlock(),vue.createElementBlock("div",{class:"ideal",key:g.name,draggable:"true",onDragstart:p=>u(g),onDragend:f,title:g.title},[vue.createVNode(vue.unref(elementPlus.ElIcon),{size:35,class:"flex items-center"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:g.name,props:vue.unref(prosToVBind)(g,["width","height","maxHeight"])},null,8,["name","props"])]),_:2},1024)],40,_hoisted_2$d))),128))])]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"])]))}}),leftPanel_vue_vue_type_style_index_0_scoped_8aba8565_lang="",LeftPanel=_export_sfc$1(_sfc_main$B,[["__scopeId","data-v-8aba8565"]]),calculateLeftTop=(r,n,i)=>{const o=getCenterPoint(r,n),a=calculateRotatedPointCoordinate(r,o,-i),u=calculateRotatedPointCoordinate(n,o,-i);return{width:u.x-a.x,height:u.y-a.y,is_old_width:!1,is_old_height:!1}},calculateRightTop=(r,n,i)=>{const o=getCenterPoint(r,n),a=calculateRotatedPointCoordinate(r,o,-i),u=calculateRotatedPointCoordinate(n,o,-i);return{width:a.x-u.x,height:u.y-a.y,is_old_width:!1,is_old_height:!1}},calculateRightBottom=(r,n,i)=>{const o=getCenterPoint(r,n),a=calculateRotatedPointCoordinate(n,o,-i),u=calculateRotatedPointCoordinate(r,o,-i);return{width:u.x-a.x,height:u.y-a.y,is_old_width:!1,is_old_height:!1}},calculateLeftBottom=(r,n,i)=>{const o=getCenterPoint(r,n),a=calculateRotatedPointCoordinate(n,o,-i),u=calculateRotatedPointCoordinate(r,o,-i);return{width:a.x-u.x,height:u.y-a.y,is_old_width:!1,is_old_height:!1}},calculateTop=(r,n,i,o)=>{const a=calculateRotatedPointCoordinate(r,o,-i),u=calculateRotatedPointCoordinate({x:o.x,y:a.y},o,i),c=Math.sqrt((u.x-n.x)**2+(u.y-n.y)**2);return{width:1,height:Math.round(c),is_old_width:!0,is_old_height:!1}},calculateRight=(r,n,i,o)=>{const a=calculateRotatedPointCoordinate(r,o,-i),u=calculateRotatedPointCoordinate({x:a.x,y:o.y},o,i),c=Math.sqrt((u.x-n.x)**2+(u.y-n.y)**2);return{width:Math.round(c),height:1,is_old_width:!1,is_old_height:!0}},calculateBottom=(r,n,i,o)=>{const a=calculateRotatedPointCoordinate(r,o,-i),u=calculateRotatedPointCoordinate({x:o.x,y:a.y},o,i),c=Math.sqrt((u.x-n.x)**2+(u.y-n.y)**2);return{width:1,height:Math.round(c),is_old_width:!0,is_old_height:!1}},calculateLeft=(r,n,i,o)=>{const a=calculateRotatedPointCoordinate(r,o,-i),u=calculateRotatedPointCoordinate({x:a.x,y:o.y},o,i),c=Math.sqrt((u.x-n.x)**2+(u.y-n.y)**2);return{width:Math.round(c),height:1,is_old_width:!1,is_old_height:!0}},_hoisted_1$f={style:{"vector-effect":"non-scaling-stroke"}},_hoisted_2$c=["fill","x","y"],_hoisted_3$b=["cx","cy"],_hoisted_4$7=["x1","y1","x2","y2"],_hoisted_5$5=["fill","x","y"],_hoisted_6$3=["fill","x","y"],_hoisted_7$3=["fill","x","y"],_hoisted_8$3=["fill","x","y"],_hoisted_9$3=["fill","x","y"],_hoisted_10$2=["fill","x","y"],_hoisted_11$1=["fill","x","y"],_sfc_main$A=vue.defineComponent({__name:"handle-panel",props:{itemInfo:{}},setup(r){const n=r;vue.useCssVars(p=>({"5c831aea":vue.unref(c)}));const i=useGlobalStore(pinia),o=useConfigStore(pinia),a=useSvgEditLayoutStore(pinia),u=vue.ref(4),c=vue.ref("#ab712e"),f=[{start:338,end:23,cursor:"nw",type:EScaleInfoType.TopLeft},{start:23,end:68,cursor:"n",type:EScaleInfoType.TopCenter},{start:68,end:113,cursor:"ne",type:EScaleInfoType.TopRight},{start:293,end:338,cursor:"w",type:EScaleInfoType.Left},{start:113,end:158,cursor:"e",type:EScaleInfoType.Right},{start:248,end:293,cursor:"sw",type:EScaleInfoType.BottomLeft},{start:203,end:248,cursor:"s",type:EScaleInfoType.BottomCenter},{start:158,end:203,cursor:"se",type:EScaleInfoType.BottomRight}],d=vue.computed(()=>n.itemInfo.config.can_zoom),h=(p,y)=>{console.log("handMousedown",y);const{clientX:_,clientY:b}=y;y.stopPropagation(),i.intention=EGlobalStoreIntention.Zoom;const A=Math.round((_-a.canvasInfo.left)/o.svg.scale-a.center_offset.x),w=Math.round((b-a.canvasInfo.top)/o.svg.scale-a.center_offset.y);i.mouse_info={state:EMouseInfoState.Down,position_x:A,position_y:w,now_position_x:A,now_position_y:w,new_position_x:0,new_position_y:0},i.scale_info={type:p,scale_times:{x:n.itemInfo.scale_x,y:n.itemInfo.scale_y},scale_item_info:{x:n.itemInfo.x,y:n.itemInfo.y},symmetric_point:{x:A+Math.abs(A-n.itemInfo.center_position.x)*2*(A>n.itemInfo.center_position.x?-1:1),y:w+Math.abs(w-n.itemInfo.center_position.y)*2*(w>n.itemInfo.center_position.y?-1:1)}}},v=p=>{const{clientX:y,clientY:_}=p,b=Math.round((y-a.canvasInfo.left)/o.svg.scale-a.center_offset.x),A=Math.round((_-a.canvasInfo.top)/o.svg.scale-a.center_offset.y);p.stopPropagation(),i.intention=EGlobalStoreIntention.Rotate,i.rotate_info={angle:n.itemInfo.rotate},i.mouse_info={state:EMouseInfoState.Down,position_x:b,position_y:A,now_position_x:b,now_position_y:A,new_position_x:0,new_position_y:0}},g=p=>{const y=(p+n.itemInfo.rotate)%360,_=f.find(b=>b.start<=y&&b.end>y);return _?{cursor:_.cursor+"-resize",type:_.type}:{cursor:"nw-resize",type:EScaleInfoType.TopLeft}};return(p,y)=>(vue.openBlock(),vue.createElementBlock("g",_hoisted_1$f,[vue.withDirectives(vue.createElementVNode("rect",{id:"resize_tl",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(0).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[0]||(y[0]=_=>h(vue.unref(EScaleInfoType).TopLeft,_))},null,44,_hoisted_2$c),[[vue.vShow,vue.unref(d)]]),vue.createElementVNode("circle",{cx:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,cy:n.itemInfo.actual_bound.y-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)-24,r:4,class:"rotate-circle",onMousedown:v},null,40,_hoisted_3$b),vue.createElementVNode("line",{x1:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,y1:n.itemInfo.actual_bound.y-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),x2:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,y2:n.itemInfo.actual_bound.y-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)-20,style:vue.normalizeStyle({stroke:vue.unref(c),"stroke-width":2})},null,12,_hoisted_4$7),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_tc",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(45).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2-vue.unref(u),y:n.itemInfo.actual_bound.y-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[1]||(y[1]=_=>h(vue.unref(EScaleInfoType).TopCenter,_))},null,44,_hoisted_5$5),[[vue.vShow,vue.unref(d)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_tr",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(90).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width-vue.unref(u)+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[2]||(y[2]=_=>h(vue.unref(EScaleInfoType).TopRight,_))},null,44,_hoisted_6$3),[[vue.vShow,vue.unref(d)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_l",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(315).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(u)+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[3]||(y[3]=_=>h(vue.unref(EScaleInfoType).Left,_))},null,44,_hoisted_7$3),[[vue.vShow,vue.unref(d)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_r",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(135).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(u)+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(u)+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[4]||(y[4]=_=>h(vue.unref(EScaleInfoType).Right,_))},null,44,_hoisted_8$3),[[vue.vShow,vue.unref(d)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_bl",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(270).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(u)+n.itemInfo.actual_bound.height*n.itemInfo.scale_y-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[5]||(y[5]=_=>h(vue.unref(EScaleInfoType).BottomLeft,_))},null,44,_hoisted_9$3),[[vue.vShow,vue.unref(d)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_bc",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(225).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(u)+n.itemInfo.actual_bound.width/2,y:n.itemInfo.actual_bound.y-vue.unref(u)+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[6]||(y[6]=_=>h(vue.unref(EScaleInfoType).BottomCenter,_))},null,44,_hoisted_10$2),[[vue.vShow,vue.unref(d)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_br",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(180).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(u)+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(u)+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[7]||(y[7]=_=>h(vue.unref(EScaleInfoType).BottomRight,_))},null,44,_hoisted_11$1),[[vue.vShow,vue.unref(d)]])]))}}),handlePanel_vue_vue_type_style_index_0_scoped_e6622df8_lang="",HandlePanel=_export_sfc$1(_sfc_main$A,[["__scopeId","data-v-e6622df8"]]),_hoisted_1$e=["fill"],_hoisted_2$b=["cx","cy","r"],_hoisted_3$a=["cx","cy","r"],_hoisted_4$6=["cx","cy","r"],_hoisted_5$4=["cx","cy","r"],_hoisted_6$2=["cx","cy","r"],_hoisted_7$2=["cx","cy","r"],_hoisted_8$2=["cx","cy","r"],_hoisted_9$2=["cx","cy","r"],_sfc_main$z=vue.defineComponent({__name:"connection-panel",props:{itemInfo:{}},setup(r){const n=r,i=vue.ref(4),o=vue.ref("#ab712e"),a=vue.ref(4),u=vue.ref(12),c=useGlobalStore(pinia),f=useSvgEditLayoutStore(pinia),d=vue.computed(()=>n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2-i.value+a.value),h=vue.computed(()=>n.itemInfo.actual_bound.y-i.value-getCoordinateOffset(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+a.value),v=vue.computed(()=>n.itemInfo.actual_bound.x-i.value+n.itemInfo.actual_bound.width+getCoordinateOffset(n.itemInfo.actual_bound.width,n.itemInfo.scale_x)+a.value),g=vue.computed(()=>n.itemInfo.actual_bound.y-i.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-getCoordinateOffset(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+a.value),p=vue.computed(()=>n.itemInfo.actual_bound.x-i.value+n.itemInfo.actual_bound.width/2+a.value),y=vue.computed(()=>n.itemInfo.actual_bound.y-i.value+n.itemInfo.actual_bound.height+getCoordinateOffset(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+a.value),_=vue.computed(()=>n.itemInfo.actual_bound.x-i.value-getCoordinateOffset(n.itemInfo.actual_bound.width,n.itemInfo.scale_x)+a.value),b=vue.computed(()=>n.itemInfo.actual_bound.y-i.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-getCoordinateOffset(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+a.value),A=(T,S)=>{var x;c.intention===EGlobalStoreIntention.SetConnectionLineNode&&(T.stopPropagation(),(x=c.handle_svg_info)!=null&&x.info.bind_anchors&&c.connection_line_node_info&&(c.connection_line_node_info.point_index===0?c.handle_svg_info.info.bind_anchors.start={type:S,target_id:n.itemInfo.id}:c.connection_line_node_info.point_index===c.handle_svg_info.info.props.point_position.val.length-1&&(c.handle_svg_info.info.bind_anchors.end={type:S,target_id:n.itemInfo.id}),c.intention=EGlobalStoreIntention.None,c.setHandleSvgInfo(null),vue.nextTick(function(){moveAnchors(n.itemInfo)})))},w=(T,S)=>{var x;c.intention===EGlobalStoreIntention.None?(createLine(T,S,n.itemInfo),c.handle_svg_info&&(c.handle_svg_info.info.props.point_position.val.length!==1?c.handle_svg_info.info.props.point_position.val.push({x:c.mouse_info.new_position_x-c.mouse_info.position_x-f.center_offset.x,y:c.mouse_info.new_position_y-c.mouse_info.position_y-f.center_offset.y}):c.handle_svg_info.info.props.point_position.val.push({x:0,y:0}))):c.intention===EGlobalStoreIntention.Connection&&(T.stopPropagation(),(x=c.handle_svg_info)!=null&&x.info.bind_anchors&&(c.handle_svg_info.info.bind_anchors.end={type:S,target_id:n.itemInfo.id},c.intention=EGlobalStoreIntention.None,c.setHandleSvgInfo(null),vue.nextTick(function(){moveAnchors(n.itemInfo)})))};return(T,S)=>(vue.openBlock(),vue.createElementBlock("g",{style:{"vector-effect":"non-scaling-stroke"},class:"connect-points",fill:vue.unref(o),"stroke-width":"2",stroke:"rgba(0,0,0,0)"},[vue.createElementVNode("g",{onMousedown:S[0]||(S[0]=x=>w(x,vue.unref(ELineBindAnchors).TopCenter)),onMouseup:S[1]||(S[1]=x=>A(x,vue.unref(ELineBindAnchors).TopCenter))},[vue.createElementVNode("circle",{class:"out-circle",cx:vue.unref(d),cy:vue.unref(h),r:vue.unref(u),"fill-opacity":".3"},null,8,_hoisted_2$b),vue.createElementVNode("circle",{id:"connection_tc",cx:vue.unref(d),cy:vue.unref(h),r:vue.unref(a),"pointer-events":"all"},null,8,_hoisted_3$a)],32),vue.createElementVNode("g",{onMousedown:S[2]||(S[2]=x=>w(x,vue.unref(ELineBindAnchors).Right)),onMouseup:S[3]||(S[3]=x=>A(x,vue.unref(ELineBindAnchors).Right))},[vue.createElementVNode("circle",{class:"out-circle",cx:vue.unref(v),cy:vue.unref(g),r:vue.unref(u),"fill-opacity":".3"},null,8,_hoisted_4$6),vue.createElementVNode("circle",{id:"connection_r",cx:vue.unref(v),cy:vue.unref(g),r:vue.unref(a),"pointer-events":"all"},null,8,_hoisted_5$4)],32),vue.createElementVNode("g",{onMousedown:S[4]||(S[4]=x=>w(x,vue.unref(ELineBindAnchors).BottomCenter)),onMouseup:S[5]||(S[5]=x=>A(x,vue.unref(ELineBindAnchors).BottomCenter))},[vue.createElementVNode("circle",{class:"out-circle",cx:vue.unref(p),cy:vue.unref(y),r:vue.unref(u),"fill-opacity":".3"},null,8,_hoisted_6$2),vue.createElementVNode("circle",{id:"connection_bc",cx:vue.unref(p),cy:vue.unref(y),r:vue.unref(a),"pointer-events":"all"},null,8,_hoisted_7$2)],32),vue.createElementVNode("g",{onMousedown:S[6]||(S[6]=x=>w(x,vue.unref(ELineBindAnchors).Left)),onMouseup:S[7]||(S[7]=x=>A(x,vue.unref(ELineBindAnchors).Left))},[vue.createElementVNode("circle",{class:"out-circle",cx:vue.unref(_),cy:vue.unref(b),r:vue.unref(u),"fill-opacity":".3"},null,8,_hoisted_8$2),vue.createElementVNode("circle",{id:"connection_l",cx:vue.unref(_),cy:vue.unref(b),r:vue.unref(a),style:{cursor:"crosshair"},"pointer-events":"all"},null,8,_hoisted_9$2)],32)],8,_hoisted_1$e))}}),connectionPanel_vue_vue_type_style_index_0_scoped_fb729c7a_lang="",ConnectionPanel=_export_sfc$1(_sfc_main$z,[["__scopeId","data-v-fb729c7a"]]),_hoisted_1$d=["d","stroke-width"],_hoisted_2$a=["d","stroke-width"],_hoisted_3$9=["id","d","stroke","stroke-width","stroke-dasharray"],_hoisted_4$5=["from","to","dur","repeatCount"],_hoisted_5$3=["d","stroke","stroke-width","stroke-dasharray"],_hoisted_6$1=["from","to","dur","repeatCount"],_hoisted_7$1=["r","fill"],_hoisted_8$1=["path","dur","repeatCount"],_hoisted_9$1=["cx","cy","r","stroke-width"],_hoisted_10$1=["cx","cy","r","stroke","onMousedown"],_sfc_main$y=vue.defineComponent({__name:"connection-line",props:{itemInfo:{},pointVisible:{type:Boolean,default:!1}},setup(r){const n=r,i=useGlobalStore(pinia),o=useConfigStore(pinia),a=useSvgEditLayoutStore(pinia),u=(c,f,d,h)=>{if(i.intention===EGlobalStoreIntention.Connection)return;i.setHandleSvgInfo(n.itemInfo);const{clientX:v,clientY:g}=f;f.stopPropagation(),i.connection_line_node_info={init_pos:{x:d,y:h},point_index:c},i.intention=EGlobalStoreIntention.SetConnectionLineNode,i.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((v-a.canvasInfo.left)/o.svg.scale),position_y:Math.round((g-a.canvasInfo.top)/o.svg.scale),now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0}};return(c,f)=>{var d,h,v,g,p,y;return vue.openBlock(),vue.createElementBlock("g",{style:vue.normalizeStyle({cursor:vue.unref(i).intention===vue.unref(EGlobalStoreIntention).Connection?"crosshair":"move"})},[vue.withDirectives(vue.createElementVNode("path",{d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none","fill-opacity":"0",stroke:"#DE4517","stroke-width":Math.ceil(n.itemInfo.props["stroke-width"].val*1.2)+1,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,_hoisted_1$d),[[vue.vShow,n.itemInfo.selected||n.itemInfo.id===((d=vue.unref(i).handle_svg_info)==null?void 0:d.info.id)]]),vue.createElementVNode("path",{d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none","fill-opacity":"0",stroke:"#fff","stroke-opacity":".01","stroke-width":n.itemInfo.props["stroke-width"].val,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,_hoisted_2$a),vue.createElementVNode("path",{id:n.itemInfo.id,d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none",stroke:((h=n.itemInfo.animations)==null?void 0:h.type.val)===vue.unref(EConfigAnimationsType).Electricity?n.itemInfo.animations.color.val:n.itemInfo.props.stroke.val,"stroke-width":n.itemInfo.props["stroke-width"].val,"stroke-dashoffset":"0","stroke-dasharray":((v=n.itemInfo.animations)==null?void 0:v.type.val)===vue.unref(EConfigAnimationsType).Electricity?n.itemInfo.props["stroke-width"].val*3:0,"stroke-linejoin":"round"},[((g=n.itemInfo.animations)==null?void 0:g.type.val)===vue.unref(EConfigAnimationsType).Electricity?(vue.openBlock(),vue.createElementBlock("animate",{key:0,attributeName:"stroke-dashoffset",from:n.itemInfo.animations.reverse.val?0:1e3,to:n.itemInfo.animations.reverse.val?1e3:0,dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val},null,8,_hoisted_4$5)):vue.createCommentVNode("",!0)],8,_hoisted_3$9),((p=n.itemInfo.animations)==null?void 0:p.type.val)===vue.unref(EConfigAnimationsType).WaterDrop?(vue.openBlock(),vue.createElementBlock("path",{key:0,d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none","fill-opacity":"0",stroke:n.itemInfo.animations.color.val,"stroke-width":n.itemInfo.props["stroke-width"].val,"stroke-dasharray":n.itemInfo.props["stroke-width"].val*3,"stroke-dashoffset":"0","stroke-linecap":"round","stroke-linejoin":"round"},[vue.createElementVNode("animate",{attributeName:"stroke-dashoffset",from:n.itemInfo.animations.reverse.val?0:1e3,to:n.itemInfo.animations.reverse.val?1e3:0,dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val,fill:"freeze"},null,8,_hoisted_6$1)],8,_hoisted_5$3)):((y=n.itemInfo.animations)==null?void 0:y.type.val)===vue.unref(EConfigAnimationsType).Track?(vue.openBlock(),vue.createElementBlock("circle",{key:1,cx:"0",cy:"0",r:Math.ceil(n.itemInfo.props["stroke-width"].val*.6)+2,fill:n.itemInfo.animations.color.val},[vue.createElementVNode("animateMotion",{path:vue.unref(positionArrToPath)(n.itemInfo.animations.reverse.val?[...n.itemInfo.props.point_position.val].reverse():n.itemInfo.props.point_position.val),dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val},null,8,_hoisted_8$1)],8,_hoisted_7$1)):vue.createCommentVNode("",!0),vue.createElementVNode("g",null,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.itemInfo.props.point_position.val,(_,b)=>{var A;return vue.withDirectives((vue.openBlock(),vue.createElementBlock("circle",{key:b,cx:_.x,cy:_.y,r:n.itemInfo.props.point_r.val+1,fill:"none","fill-opacity":"0","stroke-width":Math.ceil(n.itemInfo.props.point_r.val*.2)+1,stroke:"#DE4517"},null,8,_hoisted_9$1)),[[vue.vShow,n.itemInfo.selected||n.itemInfo.id===((A=vue.unref(i).handle_svg_info)==null?void 0:A.info.id)]])}),128)),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.itemInfo.props.point_position.val,(_,b)=>(vue.openBlock(),vue.createElementBlock("circle",{key:b,cx:_.x,cy:_.y,r:n.itemInfo.props.point_r.val,"stroke-width":"1",stroke:n.itemInfo.props.stroke.val,fill:"#fff",style:{cursor:"pointer"},onMousedown:A=>u(b,A,_.x,_.y)},null,40,_hoisted_10$1))),128))])],4)}}}),_hoisted_1$c={id:"pattern_grid",patternUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20"},_hoisted_2$9=["stroke"],_hoisted_3$8=["stroke"],_hoisted_4$4=["stroke"],_hoisted_5$2=["stroke"],_hoisted_6={key:0,width:"100%",height:"100%",fill:"url(#pattern_grid)"},_hoisted_7=["transform"],_hoisted_8=["transform"],_hoisted_9=["transform","onMousedown","onMouseup","onMouseenter","onMouseleave","onContextmenu"],_hoisted_10=["xlink:href","width","height","id","transform"],_hoisted_11=["id"],_hoisted_12$1=["id","x1","y1","x2","y2"],_hoisted_13=["id"],_hoisted_14=["x","y","height","width"],_hoisted_15=["onClick"],_hoisted_16$1={class:"shortcut"},_sfc_main$x=vue.defineComponent({__name:"center-panel",props:{vueComp:{}},setup(r,{expose:n}){const i=r;vue.useCssVars(pe=>({"6831c8e2":vue.unref(g)}));const o=useGlobalStore(pinia),a=useConfigStore(pinia),u=useSvgEditLayoutStore(pinia),c=useEditPrivateStore(pinia),f=useContextMenuStore(pinia);componentsRegister(i.vueComp);const d=vue.ref(),h=vue.ref(),v={MoveCanvas:"grab",Rotate:"url('/src/assets/icons/rotate.svg'), auto",Connection:"crosshair",SetConnectionLineNode:"crosshair"},g=vue.computed(()=>Object.keys(v).indexOf(o.intention)>-1?v[o.intention]:"default"),p=vue.reactive({handle_panel:vue.computed(()=>o.intention===EGlobalStoreIntention.Select||o.intention===EGlobalStoreIntention.Zoom||o.intention===EGlobalStoreIntention.Rotate),connection_panel:!1,connection_line:!1,select_item:{info:null,index:-1}}),y=vue.ref({a:{x:0,y:0},b:{x:0,y:0}}),_=vue.computed(()=>o.intention===EGlobalStoreIntention.SelectArea&&y.value.b.x&&y.value.b.y?{with:Math.abs(y.value.b.x-y.value.a.x),height:Math.abs(y.value.b.y-y.value.a.y),x:y.value.a.x<y.value.b.x?y.value.a.x:y.value.b.x,y:y.value.a.y<y.value.b.y?y.value.a.y:y.value.b.y}:{with:0,height:0,x:0,y:0}),b=vue.computed(()=>{let pe=0;for(let Lt of o.done_json)Lt.selected&&pe++;return pe>0});let A=!1,w=!1;const T=pe=>{var Lt;if(o.intention!=EGlobalStoreIntention.None){if(o.intention==EGlobalStoreIntention.Create){if(!o.create_svg_info){console.error("要创建的数据获取失败");return}const _e=Math.floor(pe.offsetX/a.svg.scale-u.center_offset.x),Et=Math.floor(pe.offsetY/a.svg.scale-u.center_offset.y),Cn={id:randomString(),x:_e,y:Et,client:{x:_e,y:Et},scale_x:1,scale_y:1,rotate:0,actual_bound:{x:0,y:0,width:0,height:0},center_position:{x:0,y:0},point_coordinate:{tl:{x:0,y:0},tc:{x:0,y:0},tr:{x:0,y:0},l:{x:0,y:0},r:{x:0,y:0},bl:{x:0,y:0},bc:{x:0,y:0},br:{x:0,y:0}},selected:!1,...objectDeepClone(o.create_svg_info)};o.setDoneJson(Cn),o.setHandleSvgInfo(Cn,o.done_json.length),o.intention=EGlobalStoreIntention.None}(Lt=h.value)==null||Lt.focus()}},S=pe=>{pe.preventDefault()},x=pe=>{pe.preventDefault()},O=(pe,Lt,_e)=>{var Et,Cn,vn;if((Et=h.value)==null||Et.focus(),o.intention===EGlobalStoreIntention.Connection){_e.stopPropagation();return}if(_e.preventDefault(),_e.stopPropagation(),_e.ctrlKey&&_e.button===0)((Cn=o.handle_svg_info)!=null&&Cn.index||((vn=o.handle_svg_info)==null?void 0:vn.index)===0)&&(o.done_json[o.handle_svg_info.index].selected=!0,o.setHandleSvgInfo(null),o.intention=EGlobalStoreIntention.None),pe.selected=!pe.selected;else if(b.value){o.intention=EGlobalStoreIntention.GroupMove,o.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((_e.clientX-u.canvasInfo.left)/a.svg.scale),position_y:Math.round((_e.clientY-u.canvasInfo.top)/a.svg.scale),now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0};for(let Dt of o.done_json)Dt.selected&&(Dt.old_position={x:Dt.x,y:Dt.y},Dt.point_coordinate_old=objectDeepClone(Dt.point_coordinate))}else o.intention=EGlobalStoreIntention.Select,o.setHandleSvgInfo(pe,Lt),o.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((_e.clientX-u.canvasInfo.left)/a.svg.scale),position_y:Math.round((_e.clientY-u.canvasInfo.top)/a.svg.scale),now_position_x:pe.x,now_position_y:pe.y,new_position_x:0,new_position_y:0},pe.point_coordinate_old=objectDeepClone(pe.point_coordinate)},L=(pe,Lt,_e)=>{if(!(o.intention===EGlobalStoreIntention.Connection||o.mouse_info.state!=EMouseInfoState.Down)&&b.value&&!A&&["SelectArea","Move","Select"].indexOf(o.intention)<0){for(let Et of o.done_json)Et.selected=!1,Et.old_position={x:0,y:0},resetHandlePointOld(Et);o.intention=EGlobalStoreIntention.Select,o.setHandleSvgInfo(pe,Lt),o.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((_e.clientX-u.canvasInfo.left)/a.svg.scale),position_y:Math.round((_e.clientY-u.canvasInfo.top)/a.svg.scale),now_position_x:pe.x,now_position_y:pe.y,new_position_x:0,new_position_y:0}}},M=(pe,Lt,_e)=>{_e.preventDefault(),_e.stopPropagation(),p.connection_panel=!0,p.connection_line=!0,!((o.intention===EGlobalStoreIntention.Connection||o.intention===EGlobalStoreIntention.SetConnectionLineNode)&&pe.type===EDoneJsonType.ConnectionLine)&&(p.select_item.info=pe,p.select_item.index=Lt)},re=(pe,Lt,_e)=>{_e.preventDefault(),_e.stopPropagation(),!((o.intention===EGlobalStoreIntention.Connection||o.intention===EGlobalStoreIntention.SetConnectionLineNode)&&pe.type===EDoneJsonType.ConnectionLine)&&(p.connection_panel=!1,p.connection_line=!1,p.select_item.info=null,p.select_item.index=-1)},F=pe=>{var vn,Dt,de,qe,Pt,In,$e,Ce,ue,At,Ne,Oe,kt,jt,_n,ie;if(o.mouse_info.state!=EMouseInfoState.Down&&o.intention!==EGlobalStoreIntention.Connection)return;const{clientX:Lt,clientY:_e}=pe;o.mouse_info.new_position_x=Math.round((Lt-u.canvasInfo.left)/a.svg.scale),o.mouse_info.new_position_y=Math.round((_e-u.canvasInfo.top)/a.svg.scale);const Et=Math.round(o.mouse_info.new_position_x-o.mouse_info.position_x+o.mouse_info.now_position_x),Cn=Math.round(o.mouse_info.new_position_y-o.mouse_info.position_y+o.mouse_info.now_position_y);if((vn=o.handle_svg_info)!=null&&vn.info&&(o.intention===EGlobalStoreIntention.Select||o.intention===EGlobalStoreIntention.Move)){if(o.handle_svg_info.info.x=Et,o.handle_svg_info.info.y=Cn,o.handle_svg_info.info.client={x:Et,y:Cn},o.intention=EGlobalStoreIntention.Move,moveHandlePoint(o.handle_svg_info.info),moveAnchors(o.handle_svg_info.info),o.handle_svg_info.info.type===EDoneJsonType.ConnectionLine){if((Dt=o.handle_svg_info.info.bind_anchors)!=null&&Dt.start){let ae=null;for(let Y of o.done_json)Y.id===((qe=(de=o.handle_svg_info.info.bind_anchors)==null?void 0:de.start)==null?void 0:qe.target_id)&&(ae=Y);ae&&moveAnchors(ae)}if((Pt=o.handle_svg_info.info.bind_anchors)!=null&&Pt.end){let ae=null;for(let Y of o.done_json)Y.id===(($e=(In=o.handle_svg_info.info.bind_anchors)==null?void 0:In.end)==null?void 0:$e.target_id)&&(ae=Y);ae&&moveAnchors(ae)}}}else if(o.intention===EGlobalStoreIntention.MoveCanvas)u.center_offset.x=Et,u.center_offset.y=Cn;else if(o.intention===EGlobalStoreIntention.SelectArea)y.value.b.x=o.mouse_info.new_position_x-u.center_offset.x,y.value.b.y=o.mouse_info.new_position_y-u.center_offset.y;else if(o.intention===EGlobalStoreIntention.GroupMove){A=!0;for(let ae of o.done_json)if(ae.selected&&ae.old_position){const Y=Math.round(o.mouse_info.new_position_x-o.mouse_info.position_x+ae.old_position.x),k=Math.round(o.mouse_info.new_position_y-o.mouse_info.position_y+ae.old_position.y);if(ae.x=Y,ae.y=k,ae.client={x:Y,y:k},moveHandlePoint(ae),moveAnchors(ae),ae.type===EDoneJsonType.ConnectionLine&&((Ce=ae.bind_anchors)!=null&&Ce.end)){let D=null;for(let oe of o.done_json)oe.id===((At=(ue=ae.bind_anchors)==null?void 0:ue.end)==null?void 0:At.target_id)&&(D=oe);D&&moveAnchors(D)}}}else if(o.intention===EGlobalStoreIntention.Zoom){if(!o.handle_svg_info)return;const ae={x:o.mouse_info.new_position_x-u.center_offset.x,y:o.mouse_info.new_position_y-u.center_offset.y};let Y={width:0,height:0,is_old_width:!1,is_old_height:!1};if(o.scale_info.type===EScaleInfoType.TopLeft?Y=calculateLeftTop(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate):o.scale_info.type===EScaleInfoType.TopRight?Y=calculateRightTop(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate):o.scale_info.type===EScaleInfoType.BottomRight?Y=calculateRightBottom(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate):o.scale_info.type===EScaleInfoType.BottomLeft?Y=calculateLeftBottom(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate):o.scale_info.type===EScaleInfoType.TopCenter?Y=calculateTop(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate,o.handle_svg_info.info.client):o.scale_info.type===EScaleInfoType.Right?Y=calculateRight(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate,o.handle_svg_info.info.client):o.scale_info.type===EScaleInfoType.BottomCenter?Y=calculateBottom(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate,o.handle_svg_info.info.client):o.scale_info.type===EScaleInfoType.Left&&(Y=calculateLeft(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate,o.handle_svg_info.info.client)),o.handle_svg_info&&Y.width>0&&Y.height>0){const k=Y.is_old_width?1:parseFloat((Y.width/o.handle_svg_info.info.actual_bound.width).toFixed(3)),D=Y.is_old_height?1:parseFloat((Y.height/o.handle_svg_info.info.actual_bound.height).toFixed(3)),oe=getCenterPoint(ae,o.scale_info.symmetric_point);k>0&&o.scale_info.type!==EScaleInfoType.TopCenter&&o.scale_info.type!==EScaleInfoType.BottomCenter&&(o.handle_svg_info.info.scale_x=k,o.handle_svg_info.info.x=Math.round(getSvgNowPosition(o.handle_svg_info.info.center_position.x,oe.x,o.handle_svg_info.info.client.x))),D>0&&o.scale_info.type!==EScaleInfoType.Left&&o.scale_info.type!==EScaleInfoType.Right&&(o.handle_svg_info.info.scale_y=D,o.handle_svg_info.info.y=Math.round(getSvgNowPosition(o.handle_svg_info.info.center_position.y,oe.y,o.handle_svg_info.info.client.y)))}}else if(o.intention===EGlobalStoreIntention.Rotate){if(!o.handle_svg_info)return;const ae=Math.atan2(o.mouse_info.position_y-o.handle_svg_info.info.y,o.mouse_info.position_x-o.handle_svg_info.info.x)/(Math.PI/180),Y=Math.atan2(o.mouse_info.new_position_y-u.center_offset.y-o.handle_svg_info.info.y,o.mouse_info.new_position_x-u.center_offset.x-o.handle_svg_info.info.x)/(Math.PI/180);o.handle_svg_info.info.rotate=parseFloat((o.rotate_info.angle+Y-ae).toFixed(2))}else if(o.intention===EGlobalStoreIntention.Connection&&o.handle_svg_info){const ae=(Ne=o.handle_svg_info)==null?void 0:Ne.info.props.point_position.val.length,Y=o.mouse_info.new_position_x-o.mouse_info.position_x-u.center_offset.x,k=o.mouse_info.new_position_y-o.mouse_info.position_y-u.center_offset.y,D=o.handle_svg_info.info.props.point_position.val[ae-2],oe=((kt=(Oe=o.handle_svg_info)==null?void 0:Oe.info.props.point_r)==null?void 0:kt.val)+2||4;let xe=D.x<Y?-oe:D.x>Y?oe:0,ze=D.y<k?-oe:D.y>k?oe:0;pe.ctrlKey?o.handle_svg_info.info.props.point_position.val[ae-1]={x:D.x,y:k+ze}:pe.shiftKey?o.handle_svg_info.info.props.point_position.val[ae-1]={x:Y+xe,y:D.y}:o.handle_svg_info.info.props.point_position.val[ae-1]={x:Y+xe,y:k+ze}}else if(o.intention===EGlobalStoreIntention.SetConnectionLineNode&&o.handle_svg_info){!w&&(o.connection_line_node_info.point_index===o.handle_svg_info.info.props.point_position.val.length-1||o.connection_line_node_info.point_index===0)&&(w=!0);const ae=(jt=o.handle_svg_info)==null?void 0:jt.info.props.point_position.val.length,Y=getSvgNowPosition(o.mouse_info.position_x,o.mouse_info.new_position_x,o.connection_line_node_info.init_pos.x),k=getSvgNowPosition(o.mouse_info.position_y,o.mouse_info.new_position_y,o.connection_line_node_info.init_pos.y),D=o.handle_svg_info.info.props.point_position.val[ae-2],oe=((ie=(_n=o.handle_svg_info)==null?void 0:_n.info.props.point_r)==null?void 0:ie.val)+2||4;let xe=D.x<Y?-oe:D.x>Y?oe:0,ze=D.y<k?-oe:D.y>k?oe:0;o.handle_svg_info.info.props.point_position.val[o.connection_line_node_info.point_index]={x:Y+xe,y:k+ze}}},j=()=>{var pe,Lt,_e,Et;if(o.mouse_info.state==EMouseInfoState.Down){if((pe=o.handle_svg_info)!=null&&pe.info&&o.intention==EGlobalStoreIntention.Move)setSvgActualInfo(o.done_json[o.handle_svg_info.index]),o.intention=EGlobalStoreIntention.None,o.setDoneJson(o.done_json);else if(o.intention==EGlobalStoreIntention.GroupMove)A&&(A=!1,o.intention=EGlobalStoreIntention.None);else if((Lt=o.handle_svg_info)!=null&&Lt.info&&o.intention==EGlobalStoreIntention.Zoom)o.handle_svg_info.info.client={x:o.handle_svg_info.info.x,y:o.handle_svg_info.info.y},o.intention=EGlobalStoreIntention.None,setSvgActualInfo(o.done_json[o.handle_svg_info.index]),o.setDoneJson(o.done_json);else if(o.intention===EGlobalStoreIntention.Rotate&&((_e=o.handle_svg_info)!=null&&_e.info))setSvgActualInfo(o.done_json[o.handle_svg_info.index]),o.setDoneJson(o.done_json),o.intention=EGlobalStoreIntention.None;else{if(o.intention===EGlobalStoreIntention.Connection)return;if(o.intention===EGlobalStoreIntention.SetConnectionLineNode)w&&((Et=o.handle_svg_info)!=null&&Et.info.bind_anchors)&&(o.connection_line_node_info.point_index===0?o.handle_svg_info.info.bind_anchors.start=null:o.handle_svg_info.info.bind_anchors.end=null),o.intention=EGlobalStoreIntention.None,w=!1;else if(o.intention===EGlobalStoreIntention.SelectArea){o.setHandleSvgInfo(null);for(let Cn of o.done_json){const vn=_.value;Cn.selected=Cn.x>vn.x&&Cn.x<vn.x+vn.with&&Cn.y>vn.y&&Cn.y<vn.y+vn.height}o.intention=EGlobalStoreIntention.None}else o.intention!=EGlobalStoreIntention.Select&&(o.intention=EGlobalStoreIntention.None)}o.mouse_info={state:EMouseInfoState.Up,position_x:0,position_y:0,now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0},f.display=!1}},V=pe=>{const{clientX:Lt,clientY:_e}=pe;if(o.intention===EGlobalStoreIntention.Connection){o.handle_svg_info||createLine(pe),o.handle_svg_info&&(pe.button===0?o.handle_svg_info.info.props.point_position.val.length!==1?o.handle_svg_info.info.props.point_position.val.push({x:o.mouse_info.new_position_x-o.mouse_info.position_x-u.center_offset.x,y:o.mouse_info.new_position_y-o.mouse_info.position_y-u.center_offset.y}):o.handle_svg_info.info.props.point_position.val.push({x:0,y:0}):pe.button===2&&(o.intention=EGlobalStoreIntention.None,setSvgActualInfo(o.done_json[o.handle_svg_info.index]),o.setHandleSvgInfo(null)));return}pe.button===0?(o.intention=EGlobalStoreIntention.SelectArea,o.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((Lt-u.canvasInfo.left)/a.svg.scale-u.center_offset.x),position_y:Math.round((_e-u.canvasInfo.top)/a.svg.scale-u.center_offset.y),now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0},y.value={a:{x:o.mouse_info.position_x,y:o.mouse_info.position_y},b:{x:0,y:0}}):pe.button===2&&(o.intention=EGlobalStoreIntention.MoveCanvas,o.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((Lt-u.canvasInfo.left)/a.svg.scale),position_y:Math.round((_e-u.canvasInfo.top)/a.svg.scale),now_position_x:u.center_offset.x,now_position_y:u.center_offset.y,new_position_x:0,new_position_y:0})};function z(pe){pe!=null&&pe.wheelDelta&&(pe.wheelDelta>0?a.svg.scale=parseFloat((a.svg.scale+.1).toFixed(1)):a.svg.scale=parseFloat((a.svg.scale-.1).toFixed(1)))}const $=pe=>{pe.stopPropagation(),pe.preventDefault()},he=(pe,Lt,_e)=>{o.intention!==EGlobalStoreIntention.Connection&&d.value&&(o.intention=EGlobalStoreIntention.ContextMenu,o.setHandleSvgInfo(pe,Lt),d.value.style.left=_e.pageX+"px",d.value.style.top=_e.pageY+"px",f.info.MoveUpOneLevel.enable=f.info.MoveUpTopLevel.enable=f.info.MoveDownOneLevel.enable=f.info.MoveDownTopLevel.enable=!0,Lt===o.done_json.length-1&&(f.info.MoveUpOneLevel.enable=f.info.MoveUpTopLevel.enable=!1),Lt===0&&(f.info.MoveDownOneLevel.enable=f.info.MoveDownTopLevel.enable=!1),f.display=!0)},le=(pe,Lt,_e)=>({x:parseFloat((pe.x-pe.width/2*Lt+pe.width/2).toFixed(1)),y:parseFloat((pe.y-pe.height/2*_e+pe.height/2).toFixed(1)),width:parseFloat((pe.width*Lt).toFixed(1)),height:parseFloat((pe.height*_e).toFixed(1))}),Ie=pe=>{pe.preventDefault();let Lt=[];if(!pe.ctrlKey&&["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].indexOf(pe.key)>-1&&(b.value?Lt=o.done_json.map((_e,Et)=>({selected:_e.selected,i:Et})).filter(_e=>_e.selected).map(_e=>_e.i):o.handle_svg_info&&Lt.push(o.handle_svg_info.index)),!pe.ctrlKey&&pe.key=="ArrowUp"){for(let _e of Lt)o.done_json[_e].y-=1,o.done_json[_e].client.y-=1,moveHandlePoint(o.done_json[_e],0,-1),moveAnchors(o.done_json[_e]);useHistoryRecord(o.done_json)}else if(!pe.ctrlKey&&pe.key=="ArrowDown"){for(let _e of Lt)o.done_json[_e].y+=1,o.done_json[_e].client.y+=1,moveHandlePoint(o.done_json[_e],0,1),moveAnchors(o.done_json[_e]);useHistoryRecord(o.done_json)}else if(!pe.ctrlKey&&pe.key=="ArrowLeft"){for(let _e of Lt)o.done_json[_e].x-=1,o.done_json[_e].client.x-=1,moveHandlePoint(o.done_json[_e],-1,0),moveAnchors(o.done_json[_e]);useHistoryRecord(o.done_json)}else if(!pe.ctrlKey&&pe.key=="ArrowRight"){for(let _e of Lt)o.done_json[_e].x+=1,o.done_json[_e].client.x+=1,moveHandlePoint(o.done_json[_e],1,0),moveAnchors(o.done_json[_e]);useHistoryRecord(o.done_json)}else pe.ctrlKey&&pe.key.toLowerCase()=="c"?f.onContextMenuClick(EContextMenuInfoType.Copy):!pe.ctrlKey&&pe.key=="Delete"?b.value?(o.setDoneJson(o.done_json.filter(_e=>!_e.selected)),o.setHandleSvgInfo(o.done_json[o.done_json.length-1],o.done_json.length-1)):f.onContextMenuClick(EContextMenuInfoType.Delete):pe.ctrlKey&&pe.key=="ArrowUp"?f.onContextMenuClick(EContextMenuInfoType.MoveUpOneLevel):pe.ctrlKey&&pe.key=="ArrowDown"?f.onContextMenuClick(EContextMenuInfoType.MoveDownOneLevel):pe.ctrlKey&&pe.key=="ArrowLeft"?f.onContextMenuClick(EContextMenuInfoType.MoveDownTopLevel):pe.ctrlKey&&pe.key=="ArrowRight"?f.onContextMenuClick(EContextMenuInfoType.MoveUpTopLevel):pe.ctrlKey&&pe.shiftKey&&pe.key.toLowerCase()=="z"?c.topRedoBtnClick():pe.ctrlKey&&pe.key.toLowerCase()=="z"?c.topUndoBtnClick():pe.ctrlKey&&pe.key.toLowerCase()=="delete"&&(o.done_json.length<=0||o.setDoneJson([]))},Fe=()=>{setSvgActualInfo(o.done_json[o.handle_svg_info.index],!0)};return vue.onMounted(()=>{var pe;(pe=h.value)==null||pe.focus(),vue.nextTick(function(){var _e;const Lt=(_e=h.value)==null?void 0:_e.getBoundingClientRect();u.canvasInfo={height:(Lt==null?void 0:Lt.height)||0,with:(Lt==null?void 0:Lt.width)||0,top:(Lt==null?void 0:Lt.top)||0,left:(Lt==null?void 0:Lt.left)||0}})}),n({onCanvasMouseUp:j}),(pe,Lt)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",{class:"canvas",tabindex:"0",ref_key:"canvasRef",ref:h,onDrop:T,onDragenter:S,onDragover:x,onMousedown:V,onMousemove:F,onMouseup:j,onContextmenu:$,onKeydown:Ie,onMousewheel:z},[(vue.openBlock(),vue.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",style:vue.normalizeStyle({backgroundColor:vue.unref(a).svg.background_color}),width:"100%",height:"100%"},[vue.createElementVNode("defs",null,[vue.createElementVNode("pattern",_hoisted_1$c,[vue.createElementVNode("line",{x1:"0",y1:"0",x2:"0",y2:"20",stroke:vue.unref(a).svg.grid_color},null,8,_hoisted_2$9),vue.createElementVNode("line",{x1:"10",y1:"0",x2:"10",y2:"20",stroke:vue.unref(a).svg.grid_color},null,8,_hoisted_3$8),vue.createElementVNode("line",{x1:"0",y1:"0",x2:"20",y2:"0",stroke:vue.unref(a).svg.grid_color},null,8,_hoisted_4$4),vue.createElementVNode("line",{x1:"0",y1:"10",x2:"20",y2:"10",stroke:vue.unref(a).svg.grid_color},null,8,_hoisted_5$2)])]),vue.unref(a).svg.grid?(vue.openBlock(),vue.createElementBlock("rect",_hoisted_6)):vue.createCommentVNode("",!0),vue.createElementVNode("g",{transform:`translate(${vue.unref(u).center_offset.x*vue.unref(a).svg.scale},${vue.unref(u).center_offset.y*vue.unref(a).svg.scale})rotate(0)scale(${vue.unref(a).svg.scale})`},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(o).done_json,(_e,Et)=>{var Cn,vn,Dt,de,qe,Pt,In,$e,Ce,ue,At,Ne,Oe,kt;return vue.withDirectives((vue.openBlock(),vue.createElementBlock("g",{key:_e.id,transform:`translate(${_e.x},${_e.y})rotate(0)scale(1)`,onMousewheel:Lt[0]||(Lt[0]=(...jt)=>vue.unref(stopEvent)&&vue.unref(stopEvent)(...jt))},[vue.createElementVNode("g",{class:vue.normalizeClass(`${vue.unref(getCommonClass)(_e)}`)},[vue.createElementVNode("g",{transform:`translate(${_e.actual_bound.x+_e.actual_bound.width/2},${_e.actual_bound.y+_e.actual_bound.height/2})rotate(${_e.rotate}) scale(1) translate(${-(_e.actual_bound.x+_e.actual_bound.width/2)},${-(_e.actual_bound.y+_e.actual_bound.height/2)})`,onMousedown:jt=>O(_e,Et,jt),onMouseup:jt=>L(_e,Et,jt),onMouseenter:jt=>M(_e,Et,jt),onMouseleave:jt=>re(_e,Et,jt),onContextmenu:jt=>he(_e,Et,jt)},[_e.type===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$y,{key:0,"item-info":_e,"point-visible":vue.unref(p).connection_line&&((Cn=vue.unref(p).select_item.info)==null?void 0:Cn.id)==_e.id},null,8,["item-info","point-visible"])):_e.type===vue.unref(EDoneJsonType).File?(vue.openBlock(),vue.createElementBlock("use",vue.mergeProps({key:1,"xlink:href":`#svg-${_e.name}`},vue.unref(prosToVBind)(_e,["height","width"]),{width:((Dt=(vn=_e.props)==null?void 0:vn.width)==null?void 0:Dt.val)??100,height:((qe=(de=_e.props)==null?void 0:de.height)==null?void 0:qe.val)??100,id:_e.id,transform:`translate(${_e.actual_bound.x+_e.actual_bound.width/2},${_e.actual_bound.y+_e.actual_bound.height/2}) scale(${_e.scale_x},${_e.scale_y}) translate(${-(_e.actual_bound.x+_e.actual_bound.width/2)},${-(_e.actual_bound.y+_e.actual_bound.height/2)})`}),null,16,_hoisted_10)):_e.type===vue.unref(EDoneJsonType).CustomSvg?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_e.tag),vue.mergeProps({key:2},vue.unref(prosToVBind)(_e,["height","width"]),{width:((In=(Pt=_e.props)==null?void 0:Pt.width)==null?void 0:In.val)??100,height:((Ce=($e=_e.props)==null?void 0:$e.height)==null?void 0:Ce.val)??100,id:_e.id,onResize:Fe,transform:`translate(${_e.actual_bound.x+_e.actual_bound.width/2},${_e.actual_bound.y+_e.actual_bound.height/2}) scale(${_e.scale_x},${_e.scale_y}) translate(${-(_e.actual_bound.x+_e.actual_bound.width/2)},${-(_e.actual_bound.y+_e.actual_bound.height/2)})`}),null,16,["width","height","id","transform"])):_e.type===vue.unref(EDoneJsonType).Vue?(vue.openBlock(),vue.createElementBlock("foreignObject",vue.mergeProps({key:3},le(_e.actual_bound,_e.scale_x,_e.scale_y),{id:`foreign-object${_e.id}`,class:"foreignObject"}),[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_e.tag),vue.mergeProps(vue.unref(prosToVBind)(_e),{id:_e.id,transform:`translate(${_e.actual_bound.x+_e.actual_bound.width/2},${_e.actual_bound.y+_e.actual_bound.height/2}) scale(${_e.scale_x},${_e.scale_y}) translate(${-(_e.actual_bound.x+_e.actual_bound.width/2)},${-(_e.actual_bound.y+_e.actual_bound.height/2)})`}),{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(_e.tag_slot),1)]),_:2},1040,["id","transform"]))],16,_hoisted_11)):_e.type===vue.unref(EDoneJsonType).StraightLine?(vue.openBlock(),vue.createElementBlock("line",{key:4,id:_e.id,x1:_e.props.start_x.val,y1:_e.props.start_y.val,x2:_e.props.end_x.val,y2:_e.props.end_y.val,fill:"#FF0000",stroke:"#FF0000","stroke-width":"2"},null,8,_hoisted_12$1)):vue.createCommentVNode("",!0),_e.config.actual_rect?(vue.openBlock(),vue.createElementBlock("rect",vue.mergeProps({key:5,id:`rect${_e.id}`,fill:"black","fill-opacity":"0"},le(_e.actual_bound,_e.scale_x,_e.scale_y),{style:{stroke:"none","stroke-width":"2","stroke-miterlimit":"10"},class:{"svg-item-none":!_e.selected&&(vue.unref(o).intention==vue.unref(EGlobalStoreIntention).None||vue.unref(o).intention==vue.unref(EGlobalStoreIntention).Select),"svg-item-move":vue.unref(o).intention==vue.unref(EGlobalStoreIntention).Move&&((ue=vue.unref(o).handle_svg_info)==null?void 0:ue.info.id)==_e.id,"svg-item-select":vue.unref(o).intention==vue.unref(EGlobalStoreIntention).Select&&((At=vue.unref(o).handle_svg_info)==null?void 0:At.info.id)==_e.id,"svg-item-in-group":_e.selected}}),null,16,_hoisted_13)):vue.createCommentVNode("",!0),((Ne=vue.unref(o).handle_svg_info)==null?void 0:Ne.info.id)===_e.id&&vue.unref(p).handle_panel&&_e.type!==vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(HandlePanel,{key:6,"item-info":_e},null,8,["item-info"])):vue.createCommentVNode("",!0),!_e.selected&&((Oe=vue.unref(p).select_item.info)==null?void 0:Oe.id)==_e.id&&vue.unref(p).connection_panel&&_e.config.have_anchor&&vue.unref(o).intention!==vue.unref(EGlobalStoreIntention).SelectArea&&(vue.unref(o).intention!==vue.unref(EGlobalStoreIntention).Select||_e.id!==((kt=vue.unref(o).handle_svg_info)==null?void 0:kt.info.id))?(vue.openBlock(),vue.createBlock(ConnectionPanel,{key:7,onContextmenu:$,"item-info":_e},null,8,["item-info"])):vue.createCommentVNode("",!0)],40,_hoisted_9)],2)],40,_hoisted_8)),[[vue.vShow,_e.display]])}),128)),vue.createElementVNode("rect",{x:vue.unref(_).x,y:vue.unref(_).y,height:vue.unref(_).height,width:vue.unref(_).with,stroke:"#107cec",fill:"#107cec","fill-opacity":".2"},null,8,_hoisted_14)],8,_hoisted_7)],4))],544),vue.withDirectives(vue.createElementVNode("ul",{ref_key:"contextMenuRef",ref:d,class:"contextMenu"},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(f).info,(_e,Et)=>(vue.openBlock(),vue.createElementBlock("li",{key:_e.title,onClick:Cn=>vue.unref(f).onContextMenuClick(Et)},[vue.createElementVNode("p",{class:vue.normalizeClass(_e.enable?"":"disabled")},[vue.createTextVNode(vue.toDisplayString(_e.title)+" ",1),vue.createElementVNode("span",_hoisted_16$1,vue.toDisplayString(_e.hot_key),1)],2)],8,_hoisted_15))),128))],512),[[vue.vShow,vue.unref(f).display]])],64))}}),centerPanel_vue_vue_type_style_index_0_scoped_45eb2bb8_lang="",CenterPanel=_export_sfc$1(_sfc_main$x,[["__scopeId","data-v-45eb2bb8"]]);/*! Element Plus Icons Vue v2.1.0 */var export_helper_default=(r,n)=>{let i=r.__vccOpts||r;for(let[o,a]of n)i[o]=a;return i},aim_vue_vue_type_script_lang_default={name:"Aim"},_hoisted_12={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_22=vue.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"},null,-1),_hoisted_32=vue.createElementVNode("path",{fill:"currentColor",d:"M512 96a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V128a32 32 0 0 1 32-32zm0 576a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V704a32 32 0 0 1 32-32zM96 512a32 32 0 0 1 32-32h192a32 32 0 0 1 0 64H128a32 32 0 0 1-32-32zm576 0a32 32 0 0 1 32-32h192a32 32 0 1 1 0 64H704a32 32 0 0 1-32-32z"},null,-1),_hoisted_42=[_hoisted_22,_hoisted_32];function _sfc_render2(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_12,_hoisted_42)}var aim_default=export_helper_default(aim_vue_vue_type_script_lang_default,[["render",_sfc_render2],["__file","aim.vue"]]),arrow_down_vue_vue_type_script_lang_default={name:"ArrowDown"},_hoisted_16={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_26=vue.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"},null,-1),_hoisted_36=[_hoisted_26];function _sfc_render6(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_16,_hoisted_36)}var arrow_down_default=export_helper_default(arrow_down_vue_vue_type_script_lang_default,[["render",_sfc_render6],["__file","arrow-down.vue"]]),circle_check_vue_vue_type_script_lang_default={name:"CircleCheck"},_hoisted_149={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_249=vue.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"},null,-1),_hoisted_348=vue.createElementVNode("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"},null,-1),_hoisted_415=[_hoisted_249,_hoisted_348];function _sfc_render49(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_149,_hoisted_415)}var circle_check_default=export_helper_default(circle_check_vue_vue_type_script_lang_default,[["render",_sfc_render49],["__file","circle-check.vue"]]),circle_close_vue_vue_type_script_lang_default={name:"CircleClose"},_hoisted_151={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_251=vue.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248L466.752 512z"},null,-1),_hoisted_350=vue.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"},null,-1),_hoisted_416=[_hoisted_251,_hoisted_350];function _sfc_render51(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_151,_hoisted_416)}var circle_close_default=export_helper_default(circle_close_vue_vue_type_script_lang_default,[["render",_sfc_render51],["__file","circle-close.vue"]]),close_vue_vue_type_script_lang_default={name:"Close"},_hoisted_156={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_256=vue.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"},null,-1),_hoisted_355=[_hoisted_256];function _sfc_render56(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_156,_hoisted_355)}var close_default=export_helper_default(close_vue_vue_type_script_lang_default,[["render",_sfc_render56],["__file","close.vue"]]),hide_vue_vue_type_script_lang_default={name:"Hide"},_hoisted_1133={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_2133=vue.createElementVNode("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2L371.2 588.8ZM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"},null,-1),_hoisted_3132=vue.createElementVNode("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"},null,-1),_hoisted_438=[_hoisted_2133,_hoisted_3132];function _sfc_render133(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1133,_hoisted_438)}var hide_default=export_helper_default(hide_vue_vue_type_script_lang_default,[["render",_sfc_render133],["__file","hide.vue"]]),loading_vue_vue_type_script_lang_default={name:"Loading"},_hoisted_1150={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_2150=vue.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"},null,-1),_hoisted_3149=[_hoisted_2150];function _sfc_render150(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1150,_hoisted_3149)}var loading_default=export_helper_default(loading_vue_vue_type_script_lang_default,[["render",_sfc_render150],["__file","loading.vue"]]),view_vue_vue_type_script_lang_default={name:"View"},_hoisted_1283={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_2283=vue.createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352zm0 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-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448zm0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160z"},null,-1),_hoisted_3282=[_hoisted_2283];function _sfc_render283(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1283,_hoisted_3282)}var view_default=export_helper_default(view_vue_vue_type_script_lang_default,[["render",_sfc_render283],["__file","view.vue"]]),MapShim=function(){if(typeof Map<"u")return Map;function r(n,i){var o=-1;return n.some(function(a,u){return a[0]===i?(o=u,!0):!1}),o}return function(){function n(){this.__entries__=[]}return Object.defineProperty(n.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),n.prototype.get=function(i){var o=r(this.__entries__,i),a=this.__entries__[o];return a&&a[1]},n.prototype.set=function(i,o){var a=r(this.__entries__,i);~a?this.__entries__[a][1]=o:this.__entries__.push([i,o])},n.prototype.delete=function(i){var o=this.__entries__,a=r(o,i);~a&&o.splice(a,1)},n.prototype.has=function(i){return!!~r(this.__entries__,i)},n.prototype.clear=function(){this.__entries__.splice(0)},n.prototype.forEach=function(i,o){o===void 0&&(o=null);for(var a=0,u=this.__entries__;a<u.length;a++){var c=u[a];i.call(o,c[1],c[0])}},n}()}(),isBrowser=typeof window<"u"&&typeof document<"u"&&window.document===document,global$1=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),requestAnimationFrame$1=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(global$1):function(r){return setTimeout(function(){return r(Date.now())},1e3/60)}}(),trailingTimeout=2;function throttle(r,n){var i=!1,o=!1,a=0;function u(){i&&(i=!1,r()),o&&f()}function c(){requestAnimationFrame$1(u)}function f(){var d=Date.now();if(i){if(d-a<trailingTimeout)return;o=!0}else i=!0,o=!1,setTimeout(c,n);a=d}return f}var REFRESH_DELAY=20,transitionKeys=["top","right","bottom","left","width","height","size","weight"],mutationObserverSupported=typeof MutationObserver<"u",ResizeObserverController=function(){function r(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=throttle(this.refresh.bind(this),REFRESH_DELAY)}return r.prototype.addObserver=function(n){~this.observers_.indexOf(n)||this.observers_.push(n),this.connected_||this.connect_()},r.prototype.removeObserver=function(n){var i=this.observers_,o=i.indexOf(n);~o&&i.splice(o,1),!i.length&&this.connected_&&this.disconnect_()},r.prototype.refresh=function(){var n=this.updateObservers_();n&&this.refresh()},r.prototype.updateObservers_=function(){var n=this.observers_.filter(function(i){return i.gatherActive(),i.hasActive()});return n.forEach(function(i){return i.broadcastActive()}),n.length>0},r.prototype.connect_=function(){!isBrowser||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),mutationObserverSupported?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},r.prototype.disconnect_=function(){!isBrowser||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},r.prototype.onTransitionEnd_=function(n){var i=n.propertyName,o=i===void 0?"":i,a=transitionKeys.some(function(u){return!!~o.indexOf(u)});a&&this.refresh()},r.getInstance=function(){return this.instance_||(this.instance_=new r),this.instance_},r.instance_=null,r}(),defineConfigurable=function(r,n){for(var i=0,o=Object.keys(n);i<o.length;i++){var a=o[i];Object.defineProperty(r,a,{value:n[a],enumerable:!1,writable:!1,configurable:!0})}return r},getWindowOf=function(r){var n=r&&r.ownerDocument&&r.ownerDocument.defaultView;return n||global$1},emptyRect=createRectInit(0,0,0,0);function toFloat(r){return parseFloat(r)||0}function getBordersSize(r){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];return n.reduce(function(o,a){var u=r["border-"+a+"-width"];return o+toFloat(u)},0)}function getPaddings(r){for(var n=["top","right","bottom","left"],i={},o=0,a=n;o<a.length;o++){var u=a[o],c=r["padding-"+u];i[u]=toFloat(c)}return i}function getSVGContentRect(r){var n=r.getBBox();return createRectInit(0,0,n.width,n.height)}function getHTMLElementContentRect(r){var n=r.clientWidth,i=r.clientHeight;if(!n&&!i)return emptyRect;var o=getWindowOf(r).getComputedStyle(r),a=getPaddings(o),u=a.left+a.right,c=a.top+a.bottom,f=toFloat(o.width),d=toFloat(o.height);if(o.boxSizing==="border-box"&&(Math.round(f+u)!==n&&(f-=getBordersSize(o,"left","right")+u),Math.round(d+c)!==i&&(d-=getBordersSize(o,"top","bottom")+c)),!isDocumentElement(r)){var h=Math.round(f+u)-n,v=Math.round(d+c)-i;Math.abs(h)!==1&&(f-=h),Math.abs(v)!==1&&(d-=v)}return createRectInit(a.left,a.top,f,d)}var isSVGGraphicsElement=function(){return typeof SVGGraphicsElement<"u"?function(r){return r instanceof getWindowOf(r).SVGGraphicsElement}:function(r){return r instanceof getWindowOf(r).SVGElement&&typeof r.getBBox=="function"}}();function isDocumentElement(r){return r===getWindowOf(r).document.documentElement}function getContentRect(r){return isBrowser?isSVGGraphicsElement(r)?getSVGContentRect(r):getHTMLElementContentRect(r):emptyRect}function createReadOnlyRect(r){var n=r.x,i=r.y,o=r.width,a=r.height,u=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,c=Object.create(u.prototype);return defineConfigurable(c,{x:n,y:i,width:o,height:a,top:i,right:n+o,bottom:a+i,left:n}),c}function createRectInit(r,n,i,o){return{x:r,y:n,width:i,height:o}}var ResizeObservation=function(){function r(n){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=createRectInit(0,0,0,0),this.target=n}return r.prototype.isActive=function(){var n=getContentRect(this.target);return this.contentRect_=n,n.width!==this.broadcastWidth||n.height!==this.broadcastHeight},r.prototype.broadcastRect=function(){var n=this.contentRect_;return this.broadcastWidth=n.width,this.broadcastHeight=n.height,n},r}(),ResizeObserverEntry=function(){function r(n,i){var o=createReadOnlyRect(i);defineConfigurable(this,{target:n,contentRect:o})}return r}(),ResizeObserverSPI=function(){function r(n,i,o){if(this.activeObservations_=[],this.observations_=new MapShim,typeof n!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=n,this.controller_=i,this.callbackCtx_=o}return r.prototype.observe=function(n){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(n instanceof getWindowOf(n).Element))throw new TypeError('parameter 1 is not of type "Element".');var i=this.observations_;i.has(n)||(i.set(n,new ResizeObservation(n)),this.controller_.addObserver(this),this.controller_.refresh())}},r.prototype.unobserve=function(n){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(n instanceof getWindowOf(n).Element))throw new TypeError('parameter 1 is not of type "Element".');var i=this.observations_;i.has(n)&&(i.delete(n),i.size||this.controller_.removeObserver(this))}},r.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},r.prototype.gatherActive=function(){var n=this;this.clearActive(),this.observations_.forEach(function(i){i.isActive()&&n.activeObservations_.push(i)})},r.prototype.broadcastActive=function(){if(this.hasActive()){var n=this.callbackCtx_,i=this.activeObservations_.map(function(o){return new ResizeObserverEntry(o.target,o.broadcastRect())});this.callback_.call(n,i,n),this.clearActive()}},r.prototype.clearActive=function(){this.activeObservations_.splice(0)},r.prototype.hasActive=function(){return this.activeObservations_.length>0},r}(),observers=typeof WeakMap<"u"?new WeakMap:new MapShim,ResizeObserver$1=function(){function r(n){if(!(this instanceof r))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var i=ResizeObserverController.getInstance(),o=new ResizeObserverSPI(n,i,this);observers.set(this,o)}return r}();["observe","unobserve","disconnect"].forEach(function(r){ResizeObserver$1.prototype[r]=function(){var n;return(n=observers.get(this))[r].apply(n,arguments)}});var index$1=function(){return typeof global$1.ResizeObserver<"u"?global$1.ResizeObserver:ResizeObserver$1}();const Events=["blur","input","change","changeSelectionStyle","changeSession","copy","focus","paste"],VAceEditor=vue.defineComponent({props:{value:{type:String,required:!0},lang:{type:String,default:"text"},theme:{type:String,default:"chrome"},options:Object,placeholder:String,readonly:Boolean,wrap:Boolean,printMargin:{type:[Boolean,Number],default:!0},minLines:Number,maxLines:Number},emits:["update:value","init",...Events],render(){return vue.h("div")},mounted(){const r=this._editor=vue.markRaw(ace.edit(this.$el,{placeholder:this.placeholder,readOnly:this.readonly,value:this.value,mode:"ace/mode/"+this.lang,theme:"ace/theme/"+this.theme,wrap:this.wrap,printMargin:this.printMargin,useWorker:!1,minLines:this.minLines,maxLines:this.maxLines,...this.options}));this._contentBackup=this.value,this._isSettingContent=!1,r.on("change",()=>{if(this._isSettingContent)return;const n=r.getValue();this._contentBackup=n,this.$emit("update:value",n)}),Events.forEach(n=>{const i="on"+vue.capitalize(n);typeof this.$.vnode.props[i]=="function"&&r.on(n,this.$emit.bind(this,n))}),this._ro=new index$1(()=>r.resize()),this._ro.observe(this.$el),this.$emit("init",r)},beforeUnmount(){var r,n;(r=this._ro)===null||r===void 0||r.disconnect(),(n=this._editor)===null||n===void 0||n.destroy()},methods:{focus(){this._editor.focus()},blur(){this._editor.blur()},selectAll(){this._editor.selectAll()}},watch:{value(r){if(this._contentBackup!==r){try{this._isSettingContent=!0,this._editor.setValue(r,1)}finally{this._isSettingContent=!1}this._contentBackup=r}},theme(r){this._editor.setTheme("ace/theme/"+r)},options(r){this._editor.setOptions(r)},readonly(r){this._editor.setReadOnly(r)},placeholder(r){this._editor.setOption("placeholder",r)},wrap(r){this._editor.setWrapBehavioursEnabled(r)},printMargin(r){this._editor.setOption("printMargin",r)},lang(r){this._editor.setOption("mode","ace/mode/"+r)},minLines(r){this._editor.setOption("minLines",r)},maxLines(r){this._editor.setOption("maxLines",r)}}}),themeUrl2="data:application/javascript;base64,YWNlLmRlZmluZSgiYWNlL3RoZW1lL2tyX3RoZW1lLmNzcyIsWyJyZXF1aXJlIiwiZXhwb3J0cyIsIm1vZHVsZSJdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpe21vZHVsZS5leHBvcnRzID0gIi5hY2Uta3ItdGhlbWUgLmFjZV9ndXR0ZXIge1xuICBiYWNrZ3JvdW5kOiAjMWMxOTE3O1xuICBjb2xvcjogI0ZDRkZFMFxufVxuXG4uYWNlLWtyLXRoZW1lIC5hY2VfcHJpbnQtbWFyZ2luIHtcbiAgd2lkdGg6IDFweDtcbiAgYmFja2dyb3VuZDogIzFjMTkxN1xufVxuXG4uYWNlLWtyLXRoZW1lIHtcbiAgYmFja2dyb3VuZC1jb2xvcjogIzBCMEEwOTtcbiAgY29sb3I6ICNGQ0ZGRTBcbn1cblxuLmFjZS1rci10aGVtZSAuYWNlX2N1cnNvciB7XG4gIGNvbG9yOiAjRkY5OTAwXG59XG5cbi5hY2Uta3ItdGhlbWUgLmFjZV9tYXJrZXItbGF5ZXIgLmFjZV9zZWxlY3Rpb24ge1xuICBiYWNrZ3JvdW5kOiByZ2JhKDE3MCwgMCwgMjU1LCAwLjQ1KVxufVxuXG4uYWNlLWtyLXRoZW1lLmFjZV9tdWx0aXNlbGVjdCAuYWNlX3NlbGVjdGlvbi5hY2Vfc3RhcnQge1xuICBib3gtc2hhZG93OiAwIDAgM3B4IDBweCAjMEIwQTA5O1xufVxuXG4uYWNlLWtyLXRoZW1lIC5hY2VfbWFya2VyLWxheWVyIC5hY2Vfc3RlcCB7XG4gIGJhY2tncm91bmQ6IHJnYigxMDIsIDgyLCAwKVxufVxuXG4uYWNlLWtyLX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Y3NzIik7CnZhciBkb20gPSByZXF1aXJlKCIuLi9saWIvZG9tIik7CmRvbS5pbXBvcnRDc3NTdHJpbmcoZXhwb3J0cy5jc3NUZXh0LCBleHBvcnRzLmNzc0NsYXNzLCBmYWxzZSk7Cgp9KTsgICAgICAgICAgICAgICAgKGZ1bmN0aW9uKCkgewogICAgICAgICAgICAgICAgICAgIGFjZS5yZXF1aXJlKFsiYWNlL3RoZW1lL2tyX3RoZW1lIl0sIGZ1bmN0aW9uKG0pIHsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBtb2R1bGUgPT0gIm9iamVjdCIgJiYgdHlwZW9mIGV4cG9ydHMgPT0gIm9iamVjdCIgJiYgbW9kdWxlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2R1bGUuZXhwb3J0cyA9IG07CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgIH0pKCk7CiAgICAgICAgICAgIA==",modeJsonUrl="data:application/javascript;base64,YWNlLmRlZmluZSgiYWNlL21vZGUvanNvbl9oaWdobGlnaHRfcnVsZXMiLFsicmVxdWlyZSIsImV4cG9ydHMiLCJtb2R1bGUiLCJhY2UvbGliL29vcCIsImFjZS9tb2RlL3RleHRfaGlnaGxpZ2h0X3J1bGVzIl0sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7InVzZSBzdHJpY3QiOwp2YXIgb29wID0gcmVxdWlyZSgiLi4vbGliL29vcCIpOwp2YXIgVGV4dEhpZ2hsaWdodFJ1bGVzID0gcmVxdWlyZSgiLi90ZXh0X2hpZ2hsaWdodF9ydWxlcyIpLlRleHRIaWdobGlnaHRSdWxlczsKdmFyIEpzb25IaWdobGlnaHRSdWxlcyA9IGZ1bmN0aW9uICgpIHsKICAgIHRoaXMuJHJ1bGVzID0gewogICAgICAgICJzdGFydCI6IFsKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgdG9rZW46ICJ2YXJpYWJsZSIsCiAgICAgICAgICAgICAgICByZWdleDogJ1siXSg/Oig/OlxcXFwuKXwoPzpbXiJcXFxcXSkpKj9bIl1cXHMqKD89OiknCiAgICAgICAgICAgIH0sIHsKICAgICAgICAgICAgICAgIHRva2VuOiAic3RyaW5nIiwKICAgICAgICAgICAgICAgIHJlZ2V4OiAnIicsCiAgICAgICAgICAgICAgICBuZXh0OiAic3RyaW5nIgogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICB0b2tlbjogImNvbnN0YW50Lm51bWVyaWMiLAogICAgICAgICAgICAgICAgcmVnZXg6ICIwW3hYXVswLTlhLWZBLUZdK1xcYiIKICAgICAgICAgICAgfSwgewogICAgICAgICAgICAgICAgdG9rZW46ICJjb25zdGFudC5udW1lcmljIiwKICAgICAgICAgICAgICAgIHJlZ2V4OiAiWystXT9cXGQrKD86KD86XFwuXFxkKik/KD86W2VFXVsrLV0/XFxkKyk/KT9cXGIiCiAgICAgICAgICAgIH0sIHsKICAgICAgICAgICAgICAgIHRva2VuOiAiY29uc3RhbnQubGFuZ3VhZ2UuYm9vbGVhbiIsCiAgICAgICAgICAgICAgICByZWdleDogIig/OnRydWV8ZmFsc2UpXFxiIgogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICB0b2tlbjogInRleHQiLAogICAgICAgICAgICAgICAgcmVnZXg6ICJbJ10oPzooPzpcXFxcLil8KD86W14nXFxcXF0pKSo/WyddIgogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICB0b2tlbjogImNvbW1lbnQiLAogICAgICAgICAgICAgICAgcmVnZXg6ICJcXC9cXC8uKiQiCiAgICAgICAgICAgIH0sIHsKICAgICAgICAgICAgICAgIHRva2VuOiAiY29tbWVudC5zdGFydCIsCiAgICAgICAgICAgICAgICByZWdleDogIlxcL1xcKiIsCiAgICAgICAgICAgICAgICBuZXh0OiAiY29tbWVudCIKICAgICAgICAgICAgfSwgewogICAgICAgICAgICAgICAgdG9rZW46ICJwYXJlbi5scGFyZW4iLAogICAgICAgICAgICAgICAgcmVnZXg6ICJbWyh7XSIKICAgICAgICAgICAgfSwgewogICAgICAgICAgICAgICAgdG9rZW46ICJwYXJlbi5ycGFyZW4iLAogICAgICAgICAgICAgICAgcmVnZXg6ICJbXFxdKX1dIgogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICB0b2tlbjogInB1bmN0dWF0aW9uLm9wZXJhdG9yIiwKICAgICAgICAgICAgICAgIHJlZ2V4OiAvWyxdLwogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICB0b2tlbjogInRleHQiLAogICAgICAgICAgICAgICAgcmVnZXg6ICJcXHMrIgogICAgICAgICAgICB9CiAgICAgICAgXSwKICAgICAgICAic3RyaW5nIjogWwogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICB0b2tlbjogImNvbnN0YW50Lmxhbmd1YWdlLmVzY2FwZSIsCiAgICAgICAgICAgICAgICByZWdleDogL1xcKD86eFswLTlhLWZBLUZdezJ9fHVbMC05YS1mQS1GXXs0fXxbIlxcXC9iZm5ydF0pLwogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICB0b2tlbjogInN0cmluZyIsCiAgICAgICAgICAgICAgICByZWdleDogJyJ8JCcsCiAgICAgICAgICAgICAgICBuZXh0OiAic3RhcnQiCiAgICAgICAgICAgIH0sIHsKICAgICAgICAgICAgICAgIGRlZmF1bHRUb2tlbjogInN0cmluZyIKICAgICAgICAgICAgfQogICAgICAgIF0sCiAgICAgICAgImNvbW1lbnQiOiBbCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIHRva2VuOiAiY29tbWVudC5lbmQiLAogICAgICAgICAgICAgICAgcmVnZXg6ICJcXCpcXC8iLAogICAgICAgICAgICAgICAgbmV4dDogInN0YXJ0IgogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICBkZWZhdWx0VG9rZW46ICJjb21tZW50IgogICAgICAgICAgICB9CiAgICAgICAgX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IXJhbmdlLmlzTXVsdGlMaW5lKCkpIHsKICAgICAgICAgICAgICAgIGlmIChmb3JjZU11bHRpbGluZSkgewogICAgICAgICAgICAgICAgICAgIHJhbmdlID0gdGhpcy5nZXRTZWN0aW9uUmFuZ2Uoc2Vzc2lvbiwgcm93KTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGVsc2UgaWYgKGZvbGRTdHlsZSAhPSAiYWxsIikKICAgICAgICAgICAgICAgICAgICByYW5nZSA9IG51bGw7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHJhbmdlOwogICAgICAgIH0KICAgICAgICBpZiAoZm9sZFN0eWxlID09PSAibWFya2JlZ2luIikKICAgICAgICAgICAgcmV0dXJuOwogICAgICAgIHZhciBtYXRjaCA9IGxpbmUubWF0Y2godGhpcy5mb2xkaW5nU3RvcE1hcmtlcik7CiAgICAgICAgaWYgKG1hdGNoKSB7CiAgICAgICAgICAgIHZhciBpID0gbWF0Y2guaW5kZXggKyBtYXRjaFswXS5sZW5ndGg7CiAgICAgICAgICAgIGlmIChtYXRjaFsxXSkKICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmNsb3NpbmdCcmFja2V0QmxvY2soc2Vzc2lvbiwgbWF0Y2hbMV0sIHJvdywgaSk7CiAgICAgICAgICAgIHJldHVybiBzZXNzaW9uLmdldENvbW1lbnRGb2xkUmFuZ2Uocm93LCBpLCAtMSk7CiAgICAgICAgfQogICAgfTsKICAgIHRoaXMuZ2V0U2VjdGlvblJhbmdlID0gZnVuY3Rpb24gKHNlc3Npb24sIHJvdykgewogICAgICAgIHZhciBsaW5lID0gc2Vzc2lvbi5nZXRMaW5lKHJvdyk7CiAgICAgICAgdmFyIHN0YXJ0SW5kZW50ID0gbGluZS5zZWFyY2goL1xTLyk7CiAgICAgICAgdmFyIHN0YXJ0Um93ID0gcm93OwogICAgICAgIHZhciBzdGFydENvbHVtbiA9IGxpbmUubGVuZ3RoOwogICAgICAgIHJvdyA9IHJvdyArIDE7CiAgICAgICAgdmFyIGVuZFJvdyA9IHJvdzsKICAgICAgICB2YXIgbWF4Um93ID0gc2Vzc2lvbi5nZXRMZW5ndGgoKTsKICAgICAgICB3aGlsZSAoKytyb3cgPCBtYXhSb3cpIHsKICAgICAgICAgICAgbGluZSA9IHNlc3Npb24uZ2V0TGluZShyb3cpOwogICAgICAgICAgICB2YXIgaW5kZW50ID0gbGluZS5zZWFyY2goL1xTLyk7CiAgICAgICAgICAgIGlmIChpbmRlbnQgPT09IC0xKQogICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgIGlmIChzdGFydEluZGVudCA+IGluZGVudCkKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICB2YXIgc3ViUmFuZ2UgPSB0aGlzLmdldEZvbGRXaWRnZXRSYW5nZShzZXNzaW9uLCAiYWxsIiwgcm93KTsKICAgICAgICAgICAgaWYgKHN1YlJhbmdlKSB7CiAgICAgICAgICAgICAgICBpZiAoc3ViUmFuZ2Uuc3RhcnQucm93IDw9IHN0YXJ0Um93KSB7CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBlbHNlIGlmIChzdWJSYW5nZS5pc011bHRpTGluZSgpKSB7CiAgICAgICAgICAgICAgICAgICAgcm93ID0gc3ViUmFuZ2UuZW5kLnJvdzsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGVsc2UgaWYgKHN0YXJ0SW5kZW50ID09IGluZGVudCkgewogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIGVuZFJvdyA9IHJvdzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIG5ldyBSYW5nZShzdGFydFJvdywgc3RhcnRDb2x1bW4sIGVuZFJvdywgc2Vzc2lvbi5nZXRMaW5lKGVuZFJvdykubGVuZ3RoKTsKICAgIH07CiAgICB0aGlzLmdldENvbW1lbnRSZWdpb25CbG9jayA9IGZ1bmN0aW9uIChzZXNzaW9uLCBsaW5lLCByb3cpIHsKICAgICAgICB2YXIgc3RhcnRDb2x1bW4gPSBsaW5lLnNlYXJjaCgvXHMqJC8pOwogICAgICAgIHZhciBtYXhSb3cgPSBzZXNzaW9uLmdldExlbmd0aCgpOwogICAgICAgIHZhciBzdGFydFJvdyA9IHJvdzsKICAgICAgICB2YXIgcmUgPSAvXlxzKig/OlwvXCp8XC9cL3wtLSkjPyhlbmQpP3JlZ2lvblxiLzsKICAgICAgICB2YXIgZGVwdGggPSAxOwogICAgICAgIHdoaWxlICgrK3JvdyA8IG1heFJvdykgewogICAgICAgICAgICBsaW5lID0gc2Vzc2lvbi5nZXRMaW5lKHJvdyk7CiAgICAgICAgICAgIHZhciBtID0gcmUuZXhlYyhsaW5lKTsKICAgICAgICAgICAgaWYgKCFtKQogICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgIGlmIChtWzFdKQogICAgICAgICAgICAgICAgZGVwdGgtLTsKICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgZGVwdGgrKzsKICAgICAgICAgICAgaWYgKCFkZXB0aCkKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgICAgICB2YXIgZW5kUm93ID0gcm93OwogICAgICAgIGlmIChlbmRSb3cgPiBzdGFydFJvdykgewogICAgICAgICAgICByZXR1cm4gbmV3IFJhbmdlKHN0YXJ0Um93LCBzdGFydENvbHVtbiwgZW5kUm93LCBsaW5lLmxlbmd0aCk7CiAgICAgICAgfQogICAgfTsKfSkuY2FsbChGb2xkTW9kZS5wcm90b3R5cGUpOwoKfSk7CgphY2UuZGVmaW5lKCJhY2UvbW9kZS9qc29uIixbInJlcXVpcmUiLCJleHBvcnRzIiwibW9kdWxlIiwiYWNlL2xpYi9vb3AiLCJhY2UvbW9kZS90ZXh0IiwiYWNlL21vZGUvanNvbl9oaWdobGlnaHRfcnVsZXMiLCJhY2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fTsKb29wLmluaGVyaXRzKE1vZGUsIFRleHRNb2RlKTsKKGZ1bmN0aW9uICgpIHsKICAgIHRoaXMubGluZUNvbW1lbnRTdGFydCA9ICIvLyI7CiAgICB0aGlzLmJsb2NrQ29tbWVudCA9IHsgc3RhcnQ6ICIvKiIsIGVuZDogIiovIiB9OwogICAgdGhpcy5nZXROZXh0TGluZUluZGVudCA9IGZ1bmN0aW9uIChzdGF0ZSwgbGluZSwgdGFiKSB7CiAgICAgICAgdmFyIGluZGVudCA9IHRoaXMuJGdldEluZGVudChsaW5lKTsKICAgICAgICBpZiAoc3RhdGUgPT0gInN0YXJ0IikgewogICAgICAgICAgICB2YXIgbWF0Y2ggPSBsaW5lLm1hdGNoKC9eLipbXHtcKFxbXVxzKiQvKTsKICAgICAgICAgICAgaWYgKG1hdGNoKSB7CiAgICAgICAgICAgICAgICBpbmRlbnQgKz0gdGFiOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIHJldHVybiBpbmRlbnQ7CiAgICB9OwogICAgdGhpcy5jaGVja091dGRlbnQgPSBmdW5jdGlvbiAoc3RhdGUsIGxpbmUsIGlucHV0KSB7CiAgICAgICAgcmV0dXJuIHRoaXMuJG91dGRlbnQuY2hlY2tPdXRkZW50KGxpbmUsIGlucHV0KTsKICAgIH07CiAgICB0aGlzLmF1dG9PdXRkZW50ID0gZnVuY3Rpb24gKHN0YXRlLCBkb2MsIHJvdykgewogICAgICAgIHRoaXMuJG91dGRlbnQuYXV0b091dGRlbnQoZG9jLCByb3cpOwogICAgfTsKICAgIHRoaXMuY3JlYXRlV29ya2VyID0gZnVuY3Rpb24gKHNlc3Npb24pIHsKICAgICAgICB2YXIgd29ya2VyID0gbmV3IFdvcmtlckNsaWVudChbImFjZSJdLCAiYWNlL21vZGUvanNvbl93b3JrZXIiLCAiSnNvbldvcmtlciIpOwogICAgICAgIHdvcmtlci5hdHRhY2hUb0RvY3VtZW50KHNlc3Npb24uZ2V0RG9jdW1lbnQoKSk7CiAgICAgICAgd29ya2VyLm9uKCJhbm5vdGF0ZSIsIGZ1bmN0aW9uIChlKSB7CiAgICAgICAgICAgIHNlc3Npb24uc2V0QW5ub3RhdGlvbnMoZS5kYXRhKTsKICAgICAgICB9KTsKICAgICAgICB3b3JrZXIub24oInRlcm1pbmF0ZSIsIGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgc2Vzc2lvbi5jbGVhckFubm90YXRpb25zKCk7CiAgICAgICAgfSk7CiAgICAgICAgcmV0dXJuIHdvcmtlcjsKICAgIH07CiAgICB0aGlzLiRpZCA9ICJhY2UvbW9kZS9qc29uIjsKfSkuY2FsbChNb2RlLnByb3RvdHlwZSk7CmV4cG9ydHMuTW9kZSA9IE1vZGU7Cgp9KTsgICAgICAgICAgICAgICAgKGZ1bmN0aW9uKCkgewogICAgICAgICAgICAgICAgICAgIGFjZS5yZXF1aXJlKFsiYWNlL21vZGUvanNvbiJdLCBmdW5jdGlvbihtKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgbW9kdWxlID09ICJvYmplY3QiICYmIHR5cGVvZiBleHBvcnRzID09ICJvYmplY3QiICYmIG1vZHVsZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kdWxlLmV4cG9ydHMgPSBtOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICB9KSgpOwogICAgICAgICAgICA=",workerJsonUrl="data:application/javascript;base64,Im5vIHVzZSBzdHJpY3QiOwohKGZ1bmN0aW9uKHdpbmRvdykgewppZiAodHlwZW9mIHdpbmRvdy53aW5kb3cgIT0gInVuZGVmaW5lZCIgJiYgd2luZG93LmRvY3VtZW50KQogICAgcmV0dXJuOwppZiAod2luZG93LnJlcXVpcmUgJiYgd2luZG93LmRlZmluZSkKICAgIHJldHVybjsKCmlmICghd2luZG93LmNvbnNvbGUpIHsKICAgIHdpbmRvdy5jb25zb2xlID0gZnVuY3Rpb24oK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saWFzLm1haW4gfHwgYWxpYXMubmFtZSk7CiAgICAgICAgfSBlbHNlIGlmIChhbGlhcyA9PT0gZmFsc2UpIHsKICAgICAgICAgICAgcmV0dXJuICIiOwogICAgICAgIH0KICAgICAgICB2YXIgaSA9IHRlc3RQYXRoLmxhc3RJbmRleE9mKCIvIik7CiAgICAgICAgaWYgKGkgPT09IC0xKSBicmVhazsKICAgICAgICB0YWlsID0gdGVzdFBhdGguc3Vic3RyKGkpICsgdGFpbDsKICAgICAgICB0ZXN0UGF0aCA9IHRlc3RQYXRoLnNsaWNlKDAsIGkpOwogICAgfQogICAgcmV0dXJuIGlkOwp9CndpbmRvdy5yZXF1aXJlLm1vZHVsZXMgPSB7fTsKd2luZG93LnJlcXVpcmUudGxucyA9IHt9OwoKd2luZG93LmRlZmluZSA9IGZ1bmN0aW9uKGlkLCBkZXBzLCBmYWN0b3J5KSB7CiAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCA9PSAyKSB7CiAgICAgICAgZmFjdG9yeSA9IGRlcHM7CiAgICAgICAgaWYgKHR5cGVvZiBpZCAhPSAic3RyaW5nIikgewogICAgICAgICAgICBkZXBzID0gaWQ7CiAgICAgICAgICAgIGlkID0gd2luZG93LnJlcXVpcmUuaWQ7CiAgICAgICAgfQogICAgfSBlbHNlIGlmIChhcmd1bWVudHMubGVuZ3RoID09IDEpIHsKICAgICAgICBmYWN0b3J5ID0gaWQ7CiAgICAgICAgZGVwcyA9IFtdOwogICAgICAgIGlkID0gd2luZG93LnJlcXVpcmUuaWQ7CiAgICB9CiAgICAKICAgIGlmICh0eXBlb2YgZmFjdG9yeSAhPSAiZnVuY3Rpb24iKSB7CiAgICAgICAgd2luZG93LnJlcXVpcmUubW9kdWxlc1tpZF0gPSB7CiAgICAgICAgICAgIGV4cG9ydHM6IGZhY3RvcnksCiAgICAgICAgICAgIGluaXRpYWxpemVkOiB0cnVlCiAgICAgICAgfTsKICAgICAgICByZXR1cm47CiAgICB9CgogICAgaWYgKCFkZ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kdWxlOwogICAgICAgICAgICAgICAgICAgIC8vIEJ1dCBmb3IgYWxsIG90aGVyIGRlcGVuZGVuY2llcywgd2UgY2FuIGp1c3QgZ28gYWhlYWQgYW5kCiAgICAgICAgICAgICAgICAgICAgLy8gcmVxdWlyZSB0aGVtLgogICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6ICAgICAgICByZXR1cm4gcmVxKGRlcCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pKTsKICAgICAgICAgICAgaWYgKHJldHVybkV4cG9ydHMpCiAgICAgICAgICAgICAgICBtb2R1bGUuZXhwb3J0cyA9IHJldHVybkV4cG9ydHM7CiAgICAgICAgICAgIHJldHVybiBtb2R1bGU7CiAgICAgICAgfQogICAgfTsKfTsKd2luZG93LmRlZmluZS5hbWQgPSB7fTsKd2luZG93LnJlcXVpcmUudGxucyA9IHt9Owp3aW5kb3cuaW5pdEJhc2VVcmxzICA9IGZ1bmN0aW9uIGluaXRCYXNlVXJscyh0b3BMZXZlbE5hbWVzcGFjZXMpIHsKICAgIGZvciAodmFyIGkgaW4gdG9wTGV2ZWxOYW1lc3BhY2VzKQogICAgICAgIHRoaXMucmVxdWlyZS50bG5zW2ldID0gdG9wTGV2ZWxOYW1lc3BhY2VzW2ldOwp9OwoKd2luZG93LmluaXRTZW5kZXIgPSBmdW5jdGlvbiBpbml0U2VuZGVyKCkgewoKICAgIHZhciBFdmVudEVtaXR0ZXIgPSB3aW5kb3cucmVxdWlyZSgiYWNlL2xpYi9ldmVudF9lbWl0dGVyIikuRXZlbnRFbWl0dGVyOwogICAgdmFyIG9vcCA9IHdpbmRvdy5yZXF1aXJlKCJhY2UvbGliL29vcCIpOwogICAgCiAgICB2YXIgU2VuZGVyID0gZnVuY3Rpb24oKSB7fTsKICAgIAogICAgKGZ1bmN0aW9uKCkgewogICAgICAgIAogICAgICAgIG9vcC5pbXBsZW1lbnQodGhpcywgRXZlbnRFbWl0dGVyKTsKICAgICAgICAgICAgICAgIAogICAgICAgIHRoaXMuY2FsbGJhY2sgPSBmdW5jdGlvbihkYXRhLCBjYWxsYmFja0lkKSB7CiAgICAgICAgICAgIHBvc3RNZXNzYWdlKHsKICAgICAgICAgICAgICAgIHR5cGU6ICJjYWxsIiwKICAgICAgICAgICAgICAgIGlkOiBjYWxsYmFja0lkLAogICAgICAgICAgICAgICAgZGF0YTogZGF0YQogICAgICAgICAgICB9KTsKICAgICAgICB9OwogICAgCiAgICAgICAgdGhpcy5lbWl0ID0gZnVuY3Rpb24obmFtZSwgZGF0YSkgewogICAgICAgICAgICBwb3N0TWVzc2FnZSh7CiAgICAgICAgICAgICAgICB0eXBlOiAiZXZlbnQiLAogICAgICAgICAgICAgICAgbmFtZTogbmFtZSwKICAgICAgICAgICAgICAgIGRhdGE6IGRhdGEKICAgICAgICAgICAgfSk7CiAgICAgICAgfTsKICAgICAgICAKICAgIH0pLmNhbGwoU2VuZGVyLnByb3RvdHlwZSk7CiAgICAKICAgIHJldHVybiBuZXcgU2VuZGVyKCk7Cn07Cgp2YXIgbWFpbiA9IHdpbmRvdy5tYWluID0gbnVsbDsKdmFyIHNlbmRlciA9IHdpbmRvdy5zZW5kZXIgPSBudWxsOwoKd2luZG93Lm9ubWVzc2FnZSA9IGZ1bmN0aW9uKGUpIHsKICAgIHZhciBtc2cgPSBlLmRhdGE7CiAgICBpZiAobXNnLmV2ZW50ICYmIHNlbmRlcikgewogICAgICAgIHNlbmRlci5fc2lnbmFsKG1zZy5ldmVudCwgbXNnLmRhdGEpOwogICAgfQogICAgZWxzZSBpZiAobXNnLmNvbW1hbmQpIHsKICAgICAgICBpZiAobWFpblttc2cuY29tbWFuZF0pCiAgICAgICAgICAgIG1haW5bbXNnLmNvbW1hbmRdLmFwcGx5KG1haW4sIG1zZy5hcmdzKTsKICAgICAgICBlbHNlIGlmICh3aW5kb3dbbXNnLmNvbW1hbmRdKQogICAgICAgICAgICB3aW5kb3dbbXNnLmNvbW1hbmRdLmFwcGx5KHdpbmRvdywgbXNnLmFyZ3MpOwogICAgICAgIGVsc2UKICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCJVbmtub3duIGNvbW1hbmQ6IiArIG1zZy5jb21tYW5kKTsKICAgIH0KICAgIGVsc2UgaWYgKG1zZy5pbml0KSB7CiAgICAgICAgd2luZG93LmluaXRCYXNlVXJscyhtc2cudGxucyk7CiAgICAgICAgc2VuZGVyID0gd2luZG93LnNlbmRlciA9IHdpbmRvdy5pbml0U2VuZGVyKCk7CiAgICAgICAgdmFyIGNsYXp6ID0gdGhpcy5yZXF1aXJlKG1zZy5tb2R1bGUpW21zZy5jbGFzc25hbWVdOwogICAgICAgIG1haW4gPSB3aW5kb3cubWFpbiA9IG5ldyBjbGF6eihzZW5kZXIpOwogICAgfQp9Owp9KSh0aGlzKTsKCmFjZS5kZWZpbmUoImFjZS9saWIvb29wIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXsidXNlIHN0cmljdCI7CmV4cG9ydHMuaW5oZXJpdHMgPSBmdW5jdGlvbiAoY3Rvciwgc3VwZXJDdG9yKSB7CiAgICBjdG9yLnN1cGVyXyA9IHN1cGVyQ3RvcjsKICAgIGN0b3IucHJvdG90eXBlID0gT2JqZWN0LmNyZWF0ZShzdXBlckN0b3IucHJvdG90eXBlLCB7CiAgICAgICAgY29uc3RydWN0b3I6IHsKICAgICAgICAgICAgdmFsdWU6IGN0b3IsCiAgICAgICAgICAgIGVudW1lcmFibGU6IGZhbHNlLAogICAgICAgICAgICB3cml0YWJsZTogdHJ1ZSwKICAgICAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlCiAgICAgICAgfQogICAgfSk7Cn07CmV4cG9ydHMubWl4aW4gPSBmdW5jdGlvbiAob2JqLCBtaXhpbikgewogICAgZm9yICh2YXIga2V5IGluIG1peGluKSB7CiAgICAgICAgb2JqW2tleV0gPSBtaXhpbltrZXldOwogICAgfQogICAgcmV0dXJuIG9iajsKfTsKZXhwb3J0cy5p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ZWx0YS5zdGFydC5yb3c7CiAgICB2YXIgc3RhcnRDb2x1bW4gPSBkZWx0YS5zdGFydC5jb2x1bW47CiAgICB2YXIgbGluZSA9IGRvY0xpbmVzW3Jvd10gfHwgIiI7CiAgICBzd2l0Y2ggKGRlbHRhLmFjdGlvbikgewogICAgICAgIGNhc2UgImluc2VydCI6CiAgICAgICAgICAgIHZhciBsaW5lcyA9IGRlbHRhLmxpbmVzOwogICAgICAgICAgICBpZiAobGluZXMubGVuZ3RoID09PSAxKSB7CiAgICAgICAgICAgICAgICBkb2NMaW5lc1tyb3ddID0gbGluZS5zdWJzdHJpbmcoMCwgc3RhcnRDb2x1bW4pICsgZGVsdGEubGluZXNbMF0gKyBsaW5lLnN1YnN0cmluZyhzdGFydENvbHVtbik7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICB2YXIgYXJncyA9IFtyb3csIDFdLmNvbmNhdChkZWx0YS5saW5lcyk7CiAgICAgICAgICAgICAgICBkb2NMaW5lcy5zcGxpY2UuYXBwbHkoZG9jTGluZXMsIGFyZ3MpOwogICAgICAgICAgICAgICAgZG9jTGluZXNbcm93XSA9IGxpbmUuc3Vic3RyaW5nKDAsIHN0YXJ0Q29sdW1uKSArIGRvY0xpbmVzW3Jvd107CiAgICAgICAgICAgICAgICBkb2NMaW5lc1tyb3cgKyBkZWx0YS5saW5lcy5sZW5ndGggLSAxXSArPSBsaW5lLnN1YnN0cmluZyhzdGFydENvbHVtbik7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgY2FzZSAicmVtb3ZlIjoKICAgICAgICAgICAgdmFyIGVuZENvbHVtbiA9IGRlbHRhLmVuZC5jb2x1bW47CiAgICAgICAgICAgIHZhciBlbmRSb3cgPSBkZWx0YS5lbmQucm93OwogICAgICAgICAgICBpZiAocm93ID09PSBlbmRSb3cpIHsKICAgICAgICAgICAgICAgIGRvY0xpbmVzW3Jvd10gPSBsaW5lL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ROYW1lXTsKICAgICAgICBpZiAoIWxpc3RlbmVycykKICAgICAgICAgICAgbGlzdGVuZXJzID0gdGhpcy5fZXZlbnRSZWdpc3RyeVtldmVudE5hbWVdID0gW107CiAgICAgICAgaWYgKGxpc3RlbmVycy5pbmRleE9mKGNhbGxiYWNrKSA9PSAtMSkKICAgICAgICAgICAgbGlzdGVuZXJzW2NhcHR1cmluZyA/ICJ1bnNoaWZ0IiA6ICJwdXNoIl0oY2FsbGJhY2spOwogICAgICAgIHJldHVybiBjYWxsYmFjazsKICAgIH07CkV2ZW50RW1pdHRlci5vZmYgPQogICAgRXZlbnRFbWl0dGVyLnJlbW92ZUxpc3RlbmVyID0KICAgICAgICBFdmVudEVtaXR0ZXIucmVtb3ZlRXZlbnRMaXN0ZW5lciA9IGZ1bmN0aW9uIChldmVudE5hbWUsIGNhbGxiYWNrKSB7CiAgICAgICAgICAgIHRoaXMuX2V2ZW50UmVnaXN0cnkgPSB0aGlzLl9ldmVudFJlZ2lzdHJ5IHx8IHt9OwogICAgICAgICAgICB2YXIgbGlzdGVuZXJzID0gdGhpcy5fZXZlbnRSZWdpc3RyeVtldmVudE5hbWVdOwogICAgICAgICAgICBpZiAoIWxpc3RlbmVycykKICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgdmFyIGluZGV4ID0gbGlzdGVuZXJzLmluZGV4T2YoY2FsbGJhY2spOwogICAgICAgICAgICBpZiAoaW5kZXggIT09IC0xKQogICAgICAgICAgICAgICAgbGlzdGVuZXJzLnNwbGljZShpbmRleCwgMSk7CiAgICAgICAgfTsKRXZlbnRFbWl0dGVyLnJlbW92ZUFsbExpc3RlbmVycyA9IGZ1bmN0aW9uIChldmVudE5hbWUpIHsKICAgIGlmICghZXZlbnROYW1lKQogICAgICAgIHRoaXMuX2V2ZW50UmVnaXN0cnkgPSB0aGlzLl9kZWZhdWx0SGFuZGxlcnMgPSB1bmRlZmluZWQ7CiAgICBpZiAodGhpcy5fZXZlbnRSZWdpc3Rye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AgIHRoaXMudG9TdHJpbmcgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgcmV0dXJuICgiUmFuZ2U6IFsiICsgdGhpcy5zdGFydC5yb3cgKyAiLyIgKyB0aGlzLnN0YXJ0LmNvbHVtbiArCiAgICAgICAgICAgICJdIC0+IFsiICsgdGhpcy5lbmQucm93ICsgIi8iICsgdGhpcy5lbmQuY29sdW1uICsgIl0iKTsKICAgIH07CiAgICB0aGlzLmNvbnRhaW5zID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZShyb3csIGNvbHVtbikgPT0gMDsKICAgIH07CiAgICB0aGlzLmNvbXBhcmVSYW5nZSA9IGZ1bmN0aW9uIChyYW5nZSkgewogICAgICAgIHZhciBjbXAsIGVuZCA9IHJhbmdlLmVuZCwgc3RhcnQgPSByYW5nZS5zdGFydDsKICAgICAgICBjbXAgPSB0aGlzLmNvbXBhcmUoZW5kLnJvdywgZW5kLmNvbHVtbik7CiAgICAgICAgaWYgKGNtcCA9PSAxKSB7CiAgICAgICAgICAgIGNtcCA9IHRoaXMuY29tcGFyZShzdGFydC5yb3csIHN0YXJ0LmNvbHVtbik7CiAgICAgICAgICAgIGlmIChjbXAgPT0gMSkgewogICAgICAgICAgICAgICAgcmV0dXJuIDI7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSBpZiAoY21wID09IDApIHsKICAgICAgICAgICAgICAgIHJldHVybiAxOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAoY21wID09IC0xKSB7CiAgICAgICAgICAgIHJldHVybiAtMjsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGNtcCA9IHRoaXMuY29tcGFyZShzdGFydC5yb3csIHN0YXJ0LmNvbHVtbik7CiAgICAgICAgICAgIGlmIChjbXAgPT0gLTEpIHsKICAgICAgICAgICAgICAgIHJldHVybiAtMTsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIGlmIChjbXAgPT0gMSkgewogICAgICAgICAgICAgICAgcmV0dXJuIDQyOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9OwogICAgdGhpcy5jb21wYXJlUG9pbnQgPSBmdW5jdGlvbiAocCkgewogICAgICAgIHJldHVybiB0aGlzLmNvbXBhcmUocC5yb3csIHAuY29sdW1uKTsKICAgIH07CiAgICB0aGlzLmNvbnRhaW5zUmFuZ2UgPSBmdW5jdGlvbiAocmFuZ2UpIHsKICAgICAgICByZXR1cm4gdGhpcy5jb21wYXJlUG9pbnQocmFuZ2Uuc3RhcnQpID09IDAgJiYgdGhpcy5jb21wYXJlUG9pbnQocmFuZ2UuZW5kKSA9PSAwOwogICAgfTsKICAgIHRoaXMuaW50ZXJzZWN0cyA9IGZ1bmN0aW9uIChyYW5nZSkgewogICAgICAgIHZhciBjbXAgPSB0aGlzLmNvbXBhcmVSYW5nZShyYW5nZSk7CiAgICAgICAgcmV0dXJuIChjbXAgPT0gLTEgfHwgY21wID09IDAgfHwgY21wID09IDEpOwogICAgfTsKICAgIHRoaXMuaXNFbmQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICByZXR1cm4gdGhpcy5lbmQucm93ID09IHJvdyAmJiB0aGlzLmVuZC5jb2x1bW4gPT0gY29sdW1uOwogICAgfTsKICAgIHRoaXMuaXNTdGFydCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHJldHVybiB0aGlzLnN0YXJ0LnJvdyA9PSByb3cgJiYgdGhpcy5zdGFydC5jb2x1bW4gPT0gY29sdW1uOwogICAgfTsKICAgIHRoaXMuc2V0U3RhcnQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAodHlwZW9mIHJvdyA9PSAib2JqZWN0IikgewogICAgICAgICAgICB0aGlzLnN0YXJ0LmNvbHVtbiA9IHJvdy5jb2x1bW47CiAgICAgICAgICAgIHRoaXMuc3RhcnQucm93ID0gcm93LnJvdzsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIHRoaXMuc3RhcnQucm93ID0gcm93OwogICAgICAgICAgICB0aGlzLnN0YXJ0LmNvbHVtbiA9IGNvbHVtbjsKICAgICAgICB9CiAgICB9OwogICAgdGhpcy5zZXRFbmQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAodHlwZW9mIHJvdyA9PSAib2JqZWN0IikgewogICAgICAgICAgICB0aGlzLmVuZC5jb2x1bW4gPSByb3cuY29sdW1uOwogICAgICAgICAgICB0aGlzLmVuZC5yb3cgPSByb3cucm93OwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgdGhpcy5lbmQucm93ID0gcm93OwogICAgICAgICAgICB0aGlzLmVuZC5jb2x1bW4gPSBjb2x1bW47CiAgICAgICAgfQogICAgfTsKICAgIHRoaXMuaW5zaWRlID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgaWYgKHRoaXMuY29tcGFyZShyb3csIGNvbHVtbikgPT0gMCkgewogICAgICAgICAgICBpZiAodGhpcy5pc0VuZChyb3csIGNvbHVtbikgfHwgdGhpcy5pc1N0YXJ0KHJvdywgY29sdW1uKSkgewogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgfTsKICAgIHRoaXMuaW5zaWRlU3RhcnQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAodGhpcy5jb21wYXJlKHJvdywgY29sdW1uKSA9PSAwKSB7CiAgICAgICAgICAgIGlmICh0aGlzLmlzRW5kKHJvdywgY29sdW1uKSkgewogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgfTsKICAgIHRoaXMuaW5zaWRlRW5kID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgaWYgKHRoaXMuY29tcGFyZShyb3csIGNvbHVtbikgPT0gMCkgewogICAgICAgICAgICBpZiAodGhpcy5pc1N0YXJ0KHJvdywgY29sdW1uKSkgewogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgfTsKICAgIHRoaXMuY29tcGFyZSA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIGlmICghdGhpcy5pc011bHRpTGluZSgpKSB7CiAgICAgICAgICAgIGlmIChyb3cgPT09IHRoaXMuc3RhcnQucm93KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gY29sdW1uIDwgdGhpcy5zdGFydC5jb2x1bW4gPyAtMSA6IChjb2x1bW4gPiB0aGlzLmVuZC5jb2x1bW4gPyAxIDogMCk7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgaWYgKHJvdyA8IHRoaXMuc3RhcnQucm93KQogICAgICAgICAgICByZXR1cm4gLTE7CiAgICAgICAgaWYgKHJvdyA+IHRoaXMuZW5kLnJvdykKICAgICAgICAgICAgcmV0dXJuIDE7CiAgICAgICAgaWYgKHRoaXMuc3RhcnQucm93ID09PSByb3cpCiAgICAgICAgICAgIHJldHVybiBjb2x1bW4gPj0gdGhpcy5zdGFydC5jb2x1bW4gPyAwIDogLTE7CiAgICAgICAgaWYgKHRoaXMuZW5kLnJvdyA9PT0gcm93KQogICAgICAgICAgICByZXR1cm4gY29sdW1uIDw9IHRoaXMuZW5kLmNvbHVtbiA/IDAgOiAxOwogICAgICAgIHJldHVybiAwOwogICAgfTsKICAgIHRoaXMuY29tcGFyZVN0YXJ0ID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgaWYgKHRoaXMuc3RhcnQucm93ID09IHJvdyAmJiB0aGlzLnN0YXJ0LmNvbHVtbiA9PSBjb2x1bW4pIHsKICAgICAgICAgICAgcmV0dXJuIC0xOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZShyb3csIGNvbHVtbik7CiAgICAgICAgfQogICAgfTsKICAgIHRoaXMuY29tcGFyZUVuZCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIGlmICh0aGlzLmVuZC5yb3cgPT0gcm93ICYmIHRoaXMuZW5kLmNvbHVtbiA9PSBjb2x1bW4pIHsKICAgICAgICAgICAgcmV0dXJuIDE7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICByZXR1cm4gdGhpcy5jb21wYXJlKHJvdywgY29sdW1uKTsKICAgICAgICB9CiAgICB9OwogICAgdGhpcy5jb21wYXJlSW5zaWRlID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgaWYgKHRoaXMuZW5kLnJvdyA9PSByb3cgJiYgdGhpcy5lbmQuY29sdW1uID09IGNvbHVtbikgewogICAgICAgICAgICByZXR1cm4gMTsKICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAodGhpcy5zdGFydC5yb3cgPT0gcm93ICYmIHRoaXMuc3RhcnQuY29sdW1uID09IGNvbHVtbikgewogICAgICAgICAgICByZXR1cm4gLTE7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICByZXR1cm4gdGhpcy5jb21wYXJlKHJvdywgY29sdW1uKTsKICAgICAgICB9CiAgICB9OwogICAgdGhpcy5jbGlwUm93cyA9IGZ1bmN0aW9uIChmaXJzdFJvdywgbGFzdFJvdykgewogICAgICAgIGlmICh0aGlzLmVuZC5yb3cgPiBsYXN0Um93KQogICAgICAgICAgICB2YXIgZW5kID0geyByb3c6IGxhc3RSb3cgKyAxLCBjb2x1bW46IDAgfTsKICAgICAgICBlbHNlIGlmICh0aGlzLmVuZC5yb3cgPCBmaXJzdFJvdykKICAgICAgICAgICAgdmFyIGVuZCA9IHsgcm93OiBmaXJzdFJvdywgY29sdW1uOiAwIH07CiAgICAgICAgaWYgKHRoaXMuc3RhcnQucm93ID4gbGFzdFJvdykKICAgICAgICAgICAgdmFyIHN0YXJ0ID0geyByb3c6IGxhc3RSb3cgKyAxLCBjb2x1bW46IDAgfTsKICAgICAgICBlbHNlIGlmICh0aGlzLnN0YXJ0LnJvdyA8IGZpcnN0Um93KQogICAgICAgICAgICB2YXIgc3RhcnQgPSB7IHJvdzogZmlyc3RSb3csIGNvbHVtbjogMCB9OwogICAgICAgIHJldHVybiBSYW5nZS5mcm9tUG9pbnRzKHN0YXJ0IHx8IHRoaXMuc3RhcnQsIGVuZCB8fCB0aGlzLmVuZCk7CiAgICB9OwogICAgdGhpcy5leHRlbmQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICB2YXIgY21wID0gdGhpcy5jb21wYXJlKHJvdywgY29sdW1uKTsKICAgICAgICBpZiAoY21wID09IDApCiAgICAgICAgICAgIHJldHVybiB0aGlzOwogICAgICAgIGVsc2UgaWYgKGNtcCA9PSAtMSkKICAgICAgICAgICAgdmFyIHN0YXJ0ID0geyByb3c6IHJvdywgY29sdW1uOiBjb2x1bW4gfTsKICAgICAgICBlbHNlCiAgICAgICAgICAgIHZhciBlbmQgPSB7IHJvd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nQsIG1vdmVJZkVxdWFsKSkgewogICAgICAgICAgICByZXR1cm4gewogICAgICAgICAgICAgICAgcm93OiBwb2ludC5yb3csCiAgICAgICAgICAgICAgICBjb2x1bW46IHBvaW50LmNvbHVtbgogICAgICAgICAgICB9OwogICAgICAgIH0KICAgICAgICBpZiAoJHBvaW50c0luT3JkZXIoZGVsdGFFbmQsIHBvaW50LCAhbW92ZUlmRXF1YWwpKSB7CiAgICAgICAgICAgIHJldHVybiB7CiAgICAgICAgICAgICAgICByb3c6IHBvaW50LnJvdyArIGRlbHRhUm93U2hpZnQsCiAgICAgICAgICAgICAgICBjb2x1bW46IHBvaW50LmNvbHVtbiArIChwb2ludC5yb3cgPT0gZGVsdGFFbmQucm93ID8gZGVsdGFDb2xTaGlmdCA6IDApCiAgICAgICAgICAgIH07CiAgICAgICAgfQogICAgICAgIHJldHVybiB7CiAgICAgICAgICAgIHJvdzogZGVsdGFTdGFydC5yb3csCiAgICAgICAgICAgIGNvbHVtbjogZGVsdGFTdGFydC5jb2x1bW4KICAgICAgICB9OwogICAgfQogICAgdGhpcy5zZXRQb3NpdGlvbiA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbiwgbm9DbGlwKSB7CiAgICAgICAgdmFyIHBvczsKICAgICAgICBpZiAobm9DbGlwKSB7CiAgICAgICAgICAgIHBvcyA9IHsKICAgICAgICAgICAgICAgIHJvdzogcm93LAogICAgICAgICAgICAgICAgY29sdW1uOiBjb2x1bW4KICAgICAgICAgICAgfTsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIHBvcyA9IHRoaXMuJGNsaXBQb3NpdGlvblRvRG9jdW1lbnQocm93LCBjb2x1bW4pOwogICAgICAgIH0KICAgICAgICBpZiAodGhpcy5yb3cgPT0gcG9zLnJvdyAmJiB0aGlzLmNvbHVtbiA9PSBwb3MuY29sdW1uKQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgdmFyIG9sZCA9IHsKICAgICAgICAgICAgcm93OiB0a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9IHRleHQubWF0Y2goL14uKj8oXHJcbnxccnxcbikvbSk7CiAgICAgICAgdGhpcy4kYXV0b05ld0xpbmUgPSBtYXRjaCA/IG1hdGNoWzFdIDogIlxuIjsKICAgICAgICB0aGlzLl9zaWduYWwoImNoYW5nZU5ld0xpbmVNb2RlIik7CiAgICB9OwogICAgdGhpcy5nZXROZXdMaW5lQ2hhcmFjdGVyID0gZnVuY3Rpb24gKCkgewogICAgICAgIHN3aXRjaCAodGhpcy4kbmV3TGluZU1vZGUpIHsKICAgICAgICAgICAgY2FzZSAid2luZG93cyI6CiAgICAgICAgICAgICAgICByZXR1cm4gIlxyXG4iOwogICAgICAgICAgICBjYXNlICJ1bml4IjoKICAgICAgICAgICAgICAgIHJldHVybiAiXG4iOwogICAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuJGF1dG9OZXdMaW5lIHx8ICJcbiI7CiAgICAgICAgfQogICAgfTsKICAgIHRoaXMuJGF1dG9OZXdMaW5lID0gIiI7CiAgICB0aGlzLiRuZXdMaW5lTW9kZSA9ICJhdXRvIjsKICAgIHRoaXMuc2V0TmV3TGluZU1vZGUgPSBmdW5jdGlvbiAobmV3TGluZU1vZGUpIHsKICAgICAgICBpZiAodGhpcy4kbmV3TGluZU1vZGUgPT09IG5ld0xpbmVNb2RlKQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgdGhpcy4kbmV3TGluZU1vZGUgPSBuZXdMaW5lTW9kZTsKICAgICAgICB0aGlzLl9zaWduYWwoImNoYW5nZU5ld0xpbmVNb2RlIik7CiAgICB9OwogICAgdGhpcy5nZXROZXdMaW5lTW9kZSA9IGZ1bmN0aW9uICgpIHsKICAgICAgICByZXR1cm4gdGhpcy4kbmV3TGluZU1vZGU7CiAgICB9OwogICAgdGhpcy5pc05ld0xpbmUgPSBmdW5jdGlvbiAodGV4dCkgewogICAgICAgIHJldHVybiAodGV4dCA9PSAiXHJcbiIgfHwgdGV4dCA9PSAiXHI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MaW5lcyhwb3NpdGlvbiwgWycnLCAnJ10pIGluc3RlYWQuIik7CiAgICAgICAgcmV0dXJuIHRoaXMuaW5zZXJ0TWVyZ2VkTGluZXMocG9zaXRpb24sIFsiIiwgIiJdKTsKICAgIH07CiAgICB0aGlzLmluc2VydCA9IGZ1bmN0aW9uIChwb3NpdGlvbiwgdGV4dCkgewogICAgICAgIGlmICh0aGlzLmdldExlbmd0aCgpIDw9IDEpCiAgICAgICAgICAgIHRoaXMuJGRldGVjdE5ld0xpbmUodGV4dCk7CiAgICAgICAgcmV0dXJuIHRoaXMuaW5zZXJ0TWVyZ2VkTGluZXMocG9zaXRpb24sIHRoaXMuJHNwbGl0KHRleHQpKTsKICAgIH07CiAgICB0aGlzLmluc2VydEluTGluZSA9IGZ1bmN0aW9uIChwb3NpdGlvbiwgdGV4dCkgewogICAgICAgIHZhciBzdGFydCA9IHRoaXMuY2xpcHBlZFBvcyhwb3NpdGlvbi5yb3csIHBvc2l0aW9uLmNvbHVtbik7CiAgICAgICAgdmFyIGVuZCA9IHRoaXMucG9zKHBvc2l0aW9uLnJvdywgcG9zaXRpb24uY29sdW1uICsgdGV4dC5sZW5ndGgpOwogICAgICAgIHRoaXMuYXBwbHlEZWx0YSh7CiAgICAgICAgICAgIHN0YXJ0OiBzdGFydCwKICAgICAgICAgICAgZW5kOiBlbmQsCiAgICAgICAgICAgIGFjdGlvbjogImluc2VydCIsCiAgICAgICAgICAgIGxpbmVzOiBbdGV4dF0KICAgICAgICB9LCB0cnVlKTsKICAgICAgICByZXR1cm4gdGhpcy5jbG9uZVBvcyhlbmQpOwogICAgfTsKICAgIHRoaXMuY2xpcHBlZFBvcyA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHZhciBsZW5ndGggPSB0aGlzLmdldExlbmd0aCgpOwogICAgICAgIGlmIChyb3cgPT09IHVuZGVmaW5lZCkgewogICAgICAgICAgICByb3cgPSBsZW5ndGg7CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKHJvdyA8IDApIHsKICAgICAgICAgICAgcm93ID0gMDsKICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAocm93ID49IGxlbmd0aCkgewogICAgICAgICAgICByb3cgPSBsZW5ndGggLSAxOwogICAgICAgICAgICBjb2x1bW4gPSB1bmRlZmluZWQ7CiAgICAgICAgfQogICAgICAgIHZhciBsaW5lID0gdGhpcy5nZXRMaW5lKHJvdyk7CiAgICAgICAgaWYgKGNvbHVtbiA9PSB1bmRlZmluZWQpCiAgICAgICAgICAgIGNvbHVtbiA9IGxpbmUubGVuZ3RoOwogICAgICAgIGNvbHVtbiA9IE1hdGgubWluKE1hdGgubWF4KGNvbHVtbiwgMCksIGxpbmUubGVuZ3RoKTsKICAgICAgICByZXR1cm4geyByb3c6IHJvdywgY29sdW1uOiBjb2x1bW4gfTsKICAgIH07CiAgICB0aGlzLmNsb25lUG9zID0gZnVuY3Rpb24gKHBvcykgewogICAgICAgIHJldHVybiB7IHJvdzogcG9zLnJvdywgY29sdW1uOiBwb3MuY29sdW1uIH07CiAgICB9OwogICAgdGhpcy5wb3MgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICByZXR1cm4geyByb3c6IHJvdywgY29sdW1uOiBjb2x1bW4gfTsKICAgIH07CiAgICB0aGlzLiRjbGlwUG9zaXRpb24gPSBmdW5jdGlvbiAocG9zaXRpb24pIHsKICAgICAgICB2YXIgbGVuZ3RoID0gdGhpcy5nZXRMZW5ndGgoKTsKICAgICAgICBpZiAocG9zaXRpb24ucm93ID49IGxlbmd0aCkgewogICAgICAgICAgICBwb3NpdGlvbi5yb3cgPSBNYXRoLm1heCgwLCBsZW5ndGggLSAxKTsKICAgICAgICAgICAgcG9zaXRpb24uY29sdW1uID0gdGhpcy5nZXRMaW5lKGxlbmd0aCAtIDEpLmxlbmd0aDsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIHBvc2l0aW9uLnJvdyA9IE1hdGgubWF4KDAsIHBvc2l0aW9uLnJvdyk7CiAgICAgICAgICAgIHBvc2l0aW9uLmNvbHVtbiA9IE1hdGgubWluKE1hdGgubWF4KHBvc2l0aW9uLmNvbHVtbiwgMCksIHRoaXMuZ2V0TGluZShwb3NpdGlvbi5yb3cpLmxlbmd0aCk7CiAgICAgICAgfQogICAgICAgIHJldHVybiBwb3NpdGlvbjsKICAgIH07CiAgICB0aGlzLmluc2VydEZ1bGxMaW5lcyA9IGZ1bmN0aW9uIChyb3csIGxpbmVzKSB7CiAgICAgICAgcm93ID0gTWF0aC5taW4oTWF0aC5tYXgocm93LCAwKSwgdGhpcy5nZXRMZW5ndGgoKSk7CiAgICAgICAgdmFyIGNvbHVtbiA9IDA7CiAgICAgICAgaWYgKHJvdyA8IHRoaXMuZ2V0TGVuZ3RoKCkpIHsKICAgICAgICAgICAgbGluZXMgPSBsaW5lcy5jb25jYXQoWyIiXSk7CiAgICAgICAgICAgIGNvbHVtbiA9IDA7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICBsaW5lcyA9IFsiIl0uY29uY2F0KGxpbmVzKTsKICAgICAgICAgICAgcm93LS07CiAgICAgICAgICAgIGNvbHVtbiA9IHRoaXMuJGxpbmVzW3Jvd10ubGVuZ3RoOwogICAgICAgIH0KICAgICAgICB0aGlzLmluc2VydE1lcmdlZExpbmVzKHsgcm93OiByb3csIGNvbHVtbjogY29sdW1uIH0sIGxpbmVzKTsKICAgIH07CiAgICB0aGlzLmluc2VydE1lcmdlZExpbmVzID0gZnVuY3Rpb24gKHBvc2l0aW9uLCBsaW5lcykgewogICAgICAgIHZhciBzdGFydCA9IHRoaXMuY2xpcHBlZFBvcyhwb3NpdGlvbi5yb3csIHBvc2l0aW9uLmNvbHVtbik7CiAgICAgICAgdmFyIGVuZCA9IHsKICAgICAgICAgICAgcm93OiBzdGFydC5yb3cgKyBsaW5lcy5sZW5ndGggLSAxLAogICAgICAgICAgICBjb2x1bW46IChsaW5lcy5sZW5ndGggPT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DE7CiAgICAgICAgdmFyIHJvdyA9IGRlbHRhLnN0YXJ0LnJvdzsKICAgICAgICB2YXIgY29sdW1uID0gZGVsdGEuc3RhcnQuY29sdW1uOwogICAgICAgIGZvciAodmFyIGZyb20gPSAwLCB0byA9IDA7IGZyb20gPCBsOyBmcm9tID0gdG8pIHsKICAgICAgICAgICAgdG8gKz0gTUFYIC0gMTsKICAgICAgICAgICAgdmFyIGNodW5rID0gbGluZXMuc2xpY2UoZnJvbSwgdG8pOwogICAgICAgICAgICBjaHVuay5wdXNoKCIiKTsKICAgICAgICAgICAgdGhpcy5hcHBseURlbHRhKHsKICAgICAgICAgICAgICAgIHN0YXJ0OiB0aGlzLnBvcyhyb3cgKyBmcm9tLCBjb2x1bW4pLAogICAgICAgICAgICAgICAgZW5kOiB0aGlzLnBvcyhyb3cgKyB0bywgY29sdW1uID0gMCksCiAgICAgICAgICAgICAgICBhY3Rpb246IGRlbHRhLmFjdGlvbiwKICAgICAgICAgICAgICAgIGxpbmVzOiBjaHVuawogICAgICAgICAgICB9LCB0cnVlKTsKICAgICAgICB9CiAgICAgICAgZGVsdGEubGluZXMgPSBsaW5lcy5zbGljZShmcm9tKTsKICAgICAgICBkZWx0YS5zdGFydC5yb3cgPSByb3cgKyBmcm9tOwogICAgICAgIGRlbHRhLnN0YXJ0LmNvbHVtbiA9IGNvbHVtbjsKICAgICAgICB0aGlzLmFwcGx5RGVsdGEoZGVsdGEsIHRydWUpOwogICAgfTsKICAgIHRoaXMucmV2ZXJ0RGVsdGEgPSBmdW5jdGlvbiAoZGVsdGEpIHsKICAgICAgICB0aGlzLiRzYWZlQXBwbHlEZWx0YSh7CiAgICAgICAgICAgIHN0YXJ0OiB0aGlzLmNsb25lUG9zKGRlbHRhLnN0YXJ0KSwKICAgICAgICAgICAgZW5kOiB0aGlzLmNsb25lUG9zKGRlbHRhLmVuZCksCiAgICAgICAgICAgIGFjdGlvbjogKGRlbHRhLmFjdGlvbiA9PSAiaW5zZXJ0IiA/ICJ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4cG9ydHMuc3RyaW5nVHJpbVJpZ2h0ID0gZnVuY3Rpb24gKHN0cmluZykgewogICAgcmV0dXJuIHN0cmluZy5yZXBsYWNlKHRyaW1FbmRSZWdleHAsICcnKTsKfTsKZXhwb3J0cy5jb3B5T2JqZWN0ID0gZnVuY3Rpb24gKG9iaikgewogICAgdmFyIGNvcHkgPSB7fTsKICAgIGZvciAodmFyIGtleSBpbiBvYmopIHsKICAgICAgICBjb3B5W2tleV0gPSBvYmpba2V5XTsKICAgIH0KICAgIHJldHVybiBjb3B5Owp9OwpleHBvcnRzLmNvcHlBcnJheSA9IGZ1bmN0aW9uIChhcnJheSkgewogICAgdmFyIGNvcHkgPSBbXTsKICAgIGZvciAodmFyIGkgPSAwLCBsID0gYXJyYXkubGVuZ3RoOyBpIDwgbDsgaSsrKSB7CiAgICAgICAgaWYgKGFycmF5W2ldICYmIHR5cGVvZiBhcnJheVtpXSA9PSAib2JqZWN0IikKICAgICAgICAgICAgY29weVtpXSA9IHRoaXMuY29weU9iamVjdChhcnJheVtpXSk7CiAgICAgICAgZWxzZQogICAgICAgICAgICBjb3B5W2ldID0gYXJyYXlbaV07CiAgICB9CiAgICByZXR1cm4gY29weTsKfTsKZXhwb3J0cy5kZWVwQ29weSA9IGZ1bmN0aW9uIGRlZXBDb3B5KG9iaikgewogICAgaWYgKHR5cGVvZiBvYmogIT09ICJvYmplY3QiIHx8ICFvYmopCiAgICAgICAgcmV0dXJuIG9iajsKICAgIHZhciBjb3B5OwogICAgaWYgKEFycmF5LmlzQXJyYXkob2JqKSkgewogICAgICAgIGNvcHkgPSBbXTsKICAgICAgICBmb3IgKHZhciBrZXkgPSAwOyBrZXkgPCBvYmoubGVuZ3RoOyBrZXkrKykgewogICAgICAgICAgICBjb3B5W2tleV0gPSBkZWVwQ29weShvYmpba2V5XSk7CiAgICAgICAgfQogICAgICAgIHJldHVybiBjb3B5OwogICAgfQogICAgaWYgKE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2Fs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ZCA9IHthY3Rpb246ICJyZW1vdmUiLCBzdGFydDogZGF0YVtpXSwgZW5kOiBkYXRhW2krMV19OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICBpZiAoKGQuYWN0aW9uID09ICJpbnNlcnQiID8gZC5zdGFydCA6IGQuZW5kKS5yb3cgPj0gZG9jLiRsaW5lcy5sZW5ndGgpIHsKICAgICAgICAgICAgICAgICAgICBlcnIgPSBuZXcgRXJyb3IoIkludmFsaWQgZGVsdGEiKTsKICAgICAgICAgICAgICAgICAgICBlcnIuZGF0YSA9IHsKICAgICAgICAgICAgICAgICAgICAgICAgcGF0aDogX3NlbGYuJHBhdGgsCiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVzTGVuZ3RoOiBkb2MuJGxpbmVzLmxlbmd0aCwKICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQ6IGQuc3RhcnQsCiAgICAgICAgICAgICAgICAgICAgICAgIGVuZDogZC5lbmQKICAgICAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICAgICAgICAgIHRocm93IGVycjsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICBkb2MuYXBwbHlEZWx0YShkLCB0cnVlKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBpZiAoX3NlbGYuJHRpbWVvdXQpCiAgICAgICAgICAgIHJldHVybiBkZWZlcnJlZFVwZGF0ZS5zY2hlZHVsZShfc2VsZi4kdGltZW91dCk7CiAgICAgICAgX3NlbGYub25VcGRhdGUoKTsKICAgIH0pOwp9OwoKKGZ1bmN0aW9uKCkgewogICAgCiAgICB0aGlzLiR0aW1lb3V0ID0gNTAwOwogICAgCiAgICB0aGlzLnNldFRpbWVvdXQgPSBmdW5jdGlvbih0aW1lb3V0KSB7CiAgICAgICAgdGhpcy4kdGltZW91dCA9IHRpbWVvdXQ7CiAgICB9OwogICAgCiAgICB0aGlzLnNldFZhbHVlID0gZnVuY3Rpb24odmFsdWUpIHsKICAgICAgICB0aGlzLmRvYy5zZXRWYWx1ZSh2YWx1ZSk7CiAgICAgICAgdGhpcy5kZWZlcnJlZFVwZGF0ZS5zY2hlZHVsZSh0aGlzLiR0aW1lb3V0KTsKICAgIH07CiAgICAKICAgIHRoaXMuZ2V0VmFsdWUgPSBmdW5jdGlvbihjYWxsYmFja0lkKSB7CiAgICAgICAgdGhpcy5zZW5kZXIuY2FsbGJhY2sodGhpcy5kb2MuZ2V0VmFsdWUoKSwgY2FsbGJhY2tJZCk7CiAgICB9OwogICAgCiAgICB0aGlzLm9uVXBkYXRlID0gZnVuY3Rpb24oKSB7CiAgICB9OwogICAgCiAgICB0aGlzLmlzUGVuZGluZyA9IGZ1bmN0aW9uKCkgewogICAgICAgIHJldHVybiB0aGlzLmRlZmVycmVkVXBkYXRlLmlzUGVuZGluZygpOwogICAgfTsKICAgIAp9KS5jYWxsKE1pcnJvci5wcm90b3R5cGUpOwoKfSk7CgphY2UuZGVmaW5lKCJhY2UvbW9kZS9qc29uL2pzb25fcGFyc2UiLFtdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpIHsKInVzZSBzdHJpY3QiOwoKICAgIHZhciBhdCwgICAgIC8vIFRoZSBpbmRleCBvZiB0aGUgY3VycmVudCBjaGFyYWN0ZXIKICAgICAgICBjaCwgICAgIC8vIFRoZSBjdXJyZW50IGNoYXJhY3RlcgogICAgICAgIGVzY2FwZWUgPSB7CiAgICAgICAgICAgICciJzogICciJywKICAgICAgICAgICAgJ1xcJzogJ1xcJywKICAgICAgICAgICAgJy8nOiAgJy8nLAogICAgICAgICAgICBiOiAgICAnXGInLAogICAgICAgICAgICBmOiAgICAnXGYnLAogICAgICAgICAgICBuOiAgICAnXG4nLAogICAgICAgICAgICByOiAgICAnXHInLAogICAgICAgICAgICB0OiAgICAnXHQnCiAgICAgICAgfSwKICAgICAgICB0ZXh0LAoKICAgICAgICBlcnJvciA9IGZ1bmN0aW9uIChtKSB7CgogICAgICAgICAgICB0aHJvdyB7CiAgICAgICAgICAgICAgICBuYW1lOiAgICAnU3ludGF4RXJyb3InLAogICAgICAgICAgICAgICAgbWVzc2FnZTogbSwKICAgICAgICAgICAgICAgIGF0OiAgICAgIGF0LAogICAgICAgICAgICAgICAgdGV4dDogICAgdGV4dAogICAgICAgICAgICB9OwogICAgICAgIH0sCgogICAgICAgIG5leHQgPSBmdW5jdGlvbiAoYykgewoKICAgICAgICAgICAgaWYgKGMgJiYgYyAhPT0gY2gpIHsKICAgICAgICAgICAgICAgIGVycm9yKCJFeHBlY3RlZCAnIiArIGMgKyAiJyBpbnN0ZWFkIG9mICciICsgY2ggKyAiJyIpOwogICAgICAgICAgICB9CgogICAgICAgICAgICBjaCA9IHRleHQuY2hhckF0KGF0KTsKICAgICAgICAgICAgYXQgKz0gMTsKICAgICAgICAgICAgcmV0dXJuIGNoOwogICAgICAgIH0sCgogICAgICAgIG51bWJlciA9IGZ1bmN0aW9uICgpIHsKCiAgICAgICAgICAgIHZhciBudW1iZXIsCiAgICAgICAgICAgICAgICBzdHJpbmcgPSAnJzsKCiAgICAgICAgICAgIGlmIChjaCA9PT0gJy0nKSB7CiAgICAgICAgICAgICAgICBzdHJpbmcgPSAnLSc7CiAgICAgICAgICAgICAgICBuZXh0KCctJyk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgd2hpbGUgKGNoID49ICcwJyAmJiBjaCA8PSAnOScpIHsKICAgICAgICAgICAgICAgIHN0cmluZyArPSBjaDsKICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoY2ggPT09ICcuJykgewogICAgICAgICAgICAgICAgc3RyaW5nICs9ICcuJzsKICAgICAgICAgICAgICAgIHdoaWxlIChuZXh0KCkgJiYgY2ggPj0gJzAnICYmIGNoIDw9ICc5JykgewogICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBjaDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoY2ggPT09ICdlJyB8fCBjaCA9PT0gJ0UnKSB7CiAgICAgICAgICAgICAgICBzdHJpbmcgKz0gY2g7CiAgICAgICAgICAgICAgICBuZXh0KCk7CiAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICctJyB8fCBjaCA9PT0gJysnKSB7CiAgICAgICAgICAgICAgICAgICAgc3RyaW5nICs9IGNoOwogICAgICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHdoaWxlIChjaCA+PSAnMCcgJiYgY2ggPD0gJzknKSB7CiAgICAgICAgICAgICAgICAgICAgc3RyaW5nICs9IGNoOwogICAgICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBudW1iZXIgPSArc3RyaW5nOwogICAgICAgICAgICBpZiAoaXNOYU4obnVtYmVyKSkgewogICAgICAgICAgICAgICAgZXJyb3IoIkJhZCBudW1iZXIiKTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXI7CiAgICAgICAgICAgIH0KICAgICAgICB9LAoKICAgICAgICBzdHJpbmcgPSBmdW5jdGlvbiAoKSB7CgogICAgICAgICAgICB2YXIgaGV4LAogICAgICAgICAgICAgICAgaSwKICAgICAgICAgICAgICAgIHN0cmluZyA9ICcnLAogICAgICAgICAgICAgICAgdWZmZmY7CgogICAgICAgICAgICBpZiAoY2ggPT09ICciJykgewogICAgICAgICAgICAgICAgd2hpbGUgKG5leHQoKSkgewogICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJyInKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN0cmluZzsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNoID09PSAnXFwnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNoID09PSAndScpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVmZmZmID0gMDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCA0OyBpICs9IDEpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZXggPSBwYXJzZUludChuZXh0KCksIDE2KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWlzRmluaXRlKGhleCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVmZmZmID0gdWZmZmYgKiAxNiArIGhleDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBTdHJpbmcuZnJvbUNoYXJDb2RlKHVmZmZmKTsKICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgZXNjYXBlZVtjaF0gPT09ICdzdHJpbmcnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJpbmcgKz0gZXNjYXBlZVtjaF07CiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2ggPT0gIlxuIiB8fCBjaCA9PSAiXHIiKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBjaDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZXJyb3IoIkJhZCBzdHJpbmciKTsKICAgICAgICB9LAoKICAgICAgICB3aGl0ZSA9IGZ1bmN0aW9uICgpIHsKCiAgICAgICAgICAgIHdoaWxlIChjaCAmJiBjaCA8PSAnICcpIHsKICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgfQogICAgICAgIH0sCgogICAgICAgIHdvcmQgPSBmdW5jdGlvbiAoKSB7CgogICAgICAgICAgICBzd2l0Y2ggKGNoKSB7CiAgICAgICAgICAgIGNhc2UgJ3QnOgogICAgICAgICAgICAgICAgbmV4dCgndCcpOwogICAgICAgICAgICAgICAgbmV4dCgncicpOwogICAgICAgICAgICAgICAgbmV4dCgndScpOwogICAgICAgICAgICAgICAgbmV4dCgnZScpOwogICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgIGNhc2UgJ2YnOgogICAgICAgICAgICAgICAgbmV4dCgnZicpOwogICAgICAgICAgICAgICAgbmV4dCgnYScpOwogICAgICAgICAgICAgICAgbmV4dCgnbCcpOwogICAgICAgICAgICAgICAgbmV4dCgncycpOwogICAgICAgICAgICAgICAgbmV4dCgnZScpOwogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICBjYXNlICduJzoKICAgICAgICAgICAgICAgIG5leHQoJ24nKTsKICAgICAgICAgICAgICAgIG5leHQoJ3UnKTsKICAgICAgICAgICAgICAgIG5leHQoJ2wnKTsKICAgICAgICAgICAgICAgIG5leHQoJ2wnKTsKICAgICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVycm9yKCJVbmV4cGVjdGVkICciICsgY2ggKyAiJyIpOwogICAgICAgIH0sCgogICAgICAgIHZhbHVlLCAgLy8gUGxhY2UgaG9sZGVyIGZvciB0aGUgdmFsdWUgZnVuY3Rpb24uCgogICAgICAgIGFycmF5ID0gZnVuY3Rpb24gKCkgewoKICAgICAgICAgICAgdmFyIGFycmF5ID0gW107CgogICAgICAgICAgICBpZiAoY2ggPT09ICdbJykgewogICAgICAgICAgICAgICAgbmV4dCgnWycpOwogICAgICAgICAgICAgICAgd2hpdGUoKTsKICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ10nKSB7CiAgICAgICAgICAgICAgICAgICAgbmV4dCgnXScpOwogICAgICAgICAgICAgICAgICAgIHJldHVybiBhcnJheTsgICAvLyBlbXB0eSBhcnJheQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgd2hpbGUgKGNoKSB7CiAgICAgICAgICAgICAgICAgICAgYXJyYXkucHVzaCh2YWx1ZSgpKTsKICAgICAgICAgICAgICAgICAgICB3aGl0ZSgpOwogICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ10nKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQoJ10nKTsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFycmF5OwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBuZXh0KCcsJyk7CiAgICAgICAgICAgICAgICAgICAgd2hpdGUoKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBlcnJvcigiQmFkIGFycmF5Iik7CiAgICAgICAgfSwKCiAgICAgICAgb2JqZWN0ID0gZnVuY3Rpb24gKCkgewoKICAgICAgICAgICAgdmFyIGtleSwKICAgICAgICAgICAgICAgIG9iamVjdCA9IHt9OwoKICAgICAgICAgICAgaWYgKGNoID09PSAneycpIHsKICAgICAgICAgICAgICAgIG5leHQoJ3snKTsKICAgICAgICAgICAgICAgIHdoaXRlKCk7CiAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICd9JykgewogICAgICAgICAgICAgICAgICAgIG5leHQoJ30nKTsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gb2JqZWN0OyAgIC8vIGVtcHR5IG9iamVjdAogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgd2hpbGUgKGNoKSB7CiAgICAgICAgICAgICAgICAgICAga2V5ID0gc3RyaW5nKCk7CiAgICAgICAgICAgICAgICAgICAgd2hpdGUoKTsKICAgICAgICAgICAgICAgICAgICBuZXh0KCc6Jyk7CiAgICAgICAgICAgICAgICAgICAgaWYgKE9iamVjdC5oYXNPd25Qcm9wZXJ0eS5jYWxsKG9iamVjdCwga2V5KSkgewogICAgICAgICAgICAgICAgICAgICAgICBlcnJvcignRHVwbGljYXRlIGtleSAiJyArIGtleSArICciJyk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIG9iamVjdFtrZXldID0gdmFsdWUoKTsKICAgICAgICAgICAgICAgICAgICB3aGl0ZSgpOwogICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ30nKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQoJ30nKTsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9iamVjdDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgbmV4dCgnLCcpOwogICAgICAgICAgICAgICAgICAgIHdoaXRlKCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZXJyb3IoIkJhZCBvYmplY3QiKTsKICAgICAgICB9OwoKICAgIHZhbHVlID0gZnVuY3Rpb24gKCkgewoKICAgICAgICB3aGl0ZSgpOwogICAgICAgIHN3aXRjaCAoY2gpIHsKICAgICAgICBjYXNlICd7JzoKICAgICAgICAgICAgcmV0dXJuIG9iamVjdCgpOwogICAgICAgIGNhc2UgJ1snOgogICAgICAgICAgICByZXR1cm4gYXJyYXkoKTsKICAgICAgICBjYXNlICciJzoKICAgICAgICAgICAgcmV0dXJuIHN0cmluZygpOwogICAgICAgIGNhc2UgJy0nOgogICAgICAgICAgICByZXR1cm4gbnVtYmVyKCk7CiAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgcmV0dXJuIGNoID49ICcwJyAmJiBjaCA8PSAnOScgPyBudW1iZXIoKSA6IHdvcmQoKTsKICAgICAgICB9CiAgICB9OwoKICAgIHJldHVybiBmdW5jdGlvbiAoc291cmNlLCByZXZpdmVyKSB7CiAgICAgICAgdmFyIHJlc3VsdDsKCiAgICAgICAgdGV4dCA9IHNvdXJjZTsKICAgICAgICBhdCA9IDA7CiAgICAgICAgY2ggPSAnICc7CiAgICAgICAgcmVzdWx0ID0gdmFsdWUoKTsKICAgICAgICB3aGl0ZSgpOwogICAgICAgIGlmIChjaCkgewogICAgICAgICAgICBlcnJvcigiU3ludGF4IGVycm9yIik7CiAgICAgICAgfQoKICAgICAgICByZXR1cm4gdHlwZW9mIHJldml2ZXIgPT09ICdmdW5jdGlvbicgPyBmdW5jdGlvbiB3YWxrKGhvbGRlciwga2V5KSB7CiAgICAgICAgICAgIHZhciBrLCB2LCB2YWx1ZSA9IGhvbGRlcltrZXldOwogICAgICAgICAgICBpZiAodmFsdWUgJiYgdHlwZW9mIHZhbHVlID09PSAnb2JqZWN0JykgewogICAgICAgICAgICAgICAgZm9yIChrIGluIHZhbHVlKSB7CiAgICAgICAgICAgICAgICAgICAgaWYgKE9iamVjdC5oYXNPd25Qcm9wZXJ0eS5jYWxsKHZhbHVlLCBrKSkgewogICAgICAgICAgICAgICAgICAgICAgICB2ID0gd2Fsayh2YWx1ZSwgayk7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2ICE9PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlW2tdID0gdjsKICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSB2YWx1ZVtrXTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gcmV2aXZlci5jYWxsKGhvbGRlciwga2V5LCB2YWx1ZSk7CiAgICAgICAgfSh7Jyc6IHJlc3VsdH0sICcnKSA6IHJlc3VsdDsKICAgIH07Cn0pOwoKYWNlLmRlZmluZSgiYWNlL21vZGUvanNvbl93b3JrZXIiLFtdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpIHsKInVzZSBzdHJpY3QiOwoKdmFyIG9vcCA9IHJlcXVpcmUoIi4uL2xpYi9vb3AiKTsKdmFyIE1pcnJvciA9IHJlcXVpcmUoIi4uL3dvcmtlci9taXJyb3IiKS5NaXJyb3I7CnZhciBwYXJzZSA9IHJlcXVpcmUoIi4vanNvbi9qc29uX3BhcnNlIik7Cgp2YXIgSnNvbldvcmtlciA9IGV4cG9ydHMuSnNvbldvcmtlciA9IGZ1bmN0aW9uKHNlbmRlcikgewogICAgTWlycm9yLmNhbGwodGhpcywgc2VuZGVyKTsKICAgIHRoaXMuc2V0VGltZW91dCgyMDApOwp9OwoKb29wLmluaGVyaXRzKEpzb25Xb3JrZXIsIE1pcnJvcik7CgooZnVuY3Rpb24oKSB7CgogICAgdGhpcy5vblVwZGF0ZSA9IGZ1bmN0aW9uKCkgewogICAgICAgIHZhciB2YWx1ZSA9IHRoaXMuZG9jLmdldFZhbHVlKCk7CiAgICAgICAgdmFyIGVycm9ycyA9IFtdOwogICAgICAgIHRyeSB7CiAgICAgICAgICAgIGlmICh2YWx1ZSkKICAgICAgICAgICAgICAgIHBhcnNlKHZhbHVlKTsKICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgIHZhciBwb3MgPSB0aGlzLmRvYy5pbmRleFRvUG9zaXRpb24oZS5hdC0xKTsKICAgICAgICAgICAgZXJyb3JzLnB1c2goewogICAgICAgICAgICAgICAgcm93OiBwb3Mucm93LAogICAgICAgICAgICAgICAgY29sdW1uOiBwb3MuY29sdW1uLAogICAgICAgICAgICAgICAgdGV4dDogZS5tZXNzYWdlLAogICAgICAgICAgICAgICAgdHlwZTogImVycm9yIgogICAgICAgICAgICB9KTsKICAgICAgICB9CiAgICAgICAgdGhpcy5zZW5kZXIuZW1pdCgiYW5ub3RhdGUiLCBlcnJvcnMpOwogICAgfTsKCn0pLmNhbGwoSnNvbldvcmtlci5wcm90b3R5cGUpOwoKfSk7Cg==";ace.config.setModuleUrl("ace/theme/kr_theme",themeUrl2),ace.config.setModuleUrl("ace/mode/json",modeJsonUrl),ace.config.setModuleUrl("ace/mode/json_worker",workerJsonUrl);const _sfc_main$w=vue.defineComponent({__name:"code-edit-modal",props:{modelValue:{default:()=>({})},lang:{default:"json"},title:{default:"编辑"}},emits:["update:modelValue","close"],setup(r,{emit:n}){const i=r,o=vue.ref(!1),a=vue.computed({get(){return i.lang==="json"?JSON.stringify(i.modelValue,null,2):i.modelValue},set(u){i.lang==="json"?n("update:modelValue",JSON.parse(u)):n("update:modelValue",u)}});return(u,c)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(elementPlus.ElButton),{onClick:c[0]||(c[0]=f=>o.value=!0)},{default:vue.withCtx(()=>[vue.createTextVNode("···")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElDialog),{class:"modal-full",modelValue:vue.unref(o),"onUpdate:modelValue":c[2]||(c[2]=f=>vue.isRef(o)?o.value=f:null),title:i.title,width:"60%",onClose:c[3]||(c[3]=f=>n("close"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(VAceEditor),{value:vue.unref(a),"onUpdate:value":c[1]||(c[1]=f=>vue.isRef(a)?a.value=f:null),lang:i.lang,theme:"kr_theme",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value","lang"])]),_:1},8,["modelValue","title"])]))}}),_hoisted_1$b={class:"one-row-txt",style:{width:"78px"}},_hoisted_2$8={key:1},_hoisted_3$7={class:"one-row-txt",style:{width:"145px"}},_hoisted_4$3={key:1},_sfc_main$v=vue.defineComponent({__name:"dynamic-el-form-item",props:{objInfo:{default:()=>({})},hide:{default:()=>[]},code:{type:Boolean,default:!1}},emits:["change"],setup(r,{emit:n}){const i=r,o=vue.computed(()=>{var d;const u={};let c=0,f=[];for(let h of Object.keys(i.objInfo)){const v=(d=i.objInfo[h])==null?void 0:d.sort;if(v){const g=Number(v);g>c&&(c=g)}if(v)u[v]=h;else return Object.keys(i.objInfo).map(g=>({...i.objInfo[g],_key:g}))}for(let h=0;h<c+1;h++){const v=String(h);f.push({...i.objInfo[u[v]],_key:u[v]})}return f});function a(u){let c=window.setTimeout(function(){n("change",u),clearTimeout(c),c=null},200)}return(u,c)=>(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(o),f=>(vue.openBlock(),vue.createElementBlock("div",{key:f._key},[i.code?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:0,class:"props-row",size:"small"},{label:vue.withCtx(()=>[vue.unref(getStringWidth)(String(f._key))>78?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTooltip),{key:0,content:String(f._key),placement:"left","popper-class":"props-popper"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$b,vue.toDisplayString(f._key),1)]),_:2},1032,["content"])):(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$8,vue.toDisplayString(f._key),1))]),default:vue.withCtx(()=>[vue.unref(getStringWidth)(String(f.val))>145?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTooltip),{key:0,content:JSON.stringify(f.val),placement:"left","popper-class":"props-popper"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_3$7,vue.toDisplayString(f.val),1)]),_:2},1032,["content"])):(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$3,vue.toDisplayString(f.val),1))]),_:2},1024)):vue.createCommentVNode("",!0),i.hide.indexOf(String(f._key))<0?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:1,label:f.title,size:"small"},{default:vue.withCtx(()=>[f.type===vue.unref(EConfigItemPropsType).Select?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElSelect),{key:0,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,placeholder:"Select",size:"small",disabled:!!(f!=null&&f.disabled),onChange:a},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(f.options,d=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","disabled"])):f.type===vue.unref(EConfigItemPropsType).InputNumber?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElInputNumber),{key:1,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,disabled:!!(f!=null&&f.disabled),onChange:a},null,8,["modelValue","onUpdate:modelValue","disabled"])):f.type===vue.unref(EConfigItemPropsType).Input?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElInput),{key:2,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,disabled:!!(f!=null&&f.disabled),onChange:a},null,8,["modelValue","onUpdate:modelValue","disabled"])):f.type===vue.unref(EConfigItemPropsType).Textarea?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElInput),{key:3,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,autosize:"",type:"textarea",disabled:!!(f!=null&&f.disabled),onChange:a},null,8,["modelValue","onUpdate:modelValue","disabled"])):f.type===vue.unref(EConfigItemPropsType).Color?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElColorPicker),{key:4,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,disabled:!!(f!=null&&f.disabled),onChange:a},null,8,["modelValue","onUpdate:modelValue","disabled"])):f.type===vue.unref(EConfigItemPropsType).Switch?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElSwitch),{key:5,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,disabled:!!(f!=null&&f.disabled),onChange:a},null,8,["modelValue","onUpdate:modelValue","disabled"])):f.type===vue.unref(EConfigItemPropsType).JsonEdit?(vue.openBlock(),vue.createBlock(_sfc_main$w,{key:6,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,disabled:!!(f!=null&&f.disabled),onClose:a},null,8,["modelValue","onUpdate:modelValue","disabled"])):vue.createCommentVNode("",!0)]),_:2},1032,["label"])):vue.createCommentVNode("",!0)]))),128))}}),dynamicElFormItem_vue_vue_type_style_index_0_scoped_b2819020_lang="",dynamicElFormItem_vue_vue_type_style_index_1_lang="",DynamicElFormItem=_export_sfc$1(_sfc_main$v,[["__scopeId","data-v-b2819020"]]),_hoisted_1$a={style:{height:"100%"}},_hoisted_2$7={class:"flex flex-wrap"},_hoisted_3$6=["onMouseenter","onClick"],_sfc_main$u=vue.defineComponent({__name:"common-animate",props:{val:{}},emits:["updateCommonAniVal"],setup(r,{emit:n}){const i=r,o=vue.ref(i.val),a=vue.ref(!1),u=vue.ref("进入"),c=vue.ref(null),f=d=>{n("updateCommonAniVal",d),a.value=!1};return vue.watch(()=>i.val,d=>{o.value=d}),(d,h)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$a,[vue.unref(o)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTag),{key:0,closable:"",onClose:h[0]||(h[0]=v=>f("")),onClick:h[1]||(h[1]=v=>a.value=!0),style:{cursor:"pointer"}},{default:vue.withCtx(()=>{var v;return[vue.createTextVNode(vue.toDisplayString((v=vue.unref(common_animate_list).map(g=>g.children).reduce((g,p)=>g.concat(p)).find(g=>g.value==vue.unref(o)))==null?void 0:v.label)+" ",1),vue.createVNode(vue.unref(elementPlus.ElIcon),{size:10},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"setting"})]),_:1})]}),_:1})):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTag),{key:1,type:"success",style:{cursor:"pointer"},onClick:h[2]||(h[2]=v=>a.value=!0)},{default:vue.withCtx(()=>[vue.createTextVNode("新增")]),_:1})),vue.createVNode(vue.unref(elementPlus.ElDrawer),{modelValue:vue.unref(a),"onUpdate:modelValue":h[5]||(h[5]=v=>vue.isRef(a)?a.value=v:null),title:"选择动画",direction:"ltr"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElTabs),{modelValue:vue.unref(u),"onUpdate:modelValue":h[4]||(h[4]=v=>vue.isRef(u)?u.value=v:null)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(common_animate_list),v=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTabPane),{label:v.label,name:v.label,key:v.label},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElScrollbar),{height:"500px"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$7,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(v.children,(g,p)=>(vue.openBlock(),vue.createElementBlock("div",{class:"animate",key:p,onMouseenter:y=>c.value=p,onMouseleave:h[3]||(h[3]=y=>c.value=null),onClick:y=>f(g.value)},[vue.createElementVNode("div",{class:vue.normalizeClass(`${vue.unref(c)==p?`animate__animated animate__${g.value} animate__slow animate__infinite`:""}`)},vue.toDisplayString(g.label),3)],40,_hoisted_3$6))),128))])]),_:2},1024)]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])]))}}),commonAnimate_vue_vue_type_style_index_0_scoped_2668f60c_lang="",CommonAnimate=_export_sfc$1(_sfc_main$u,[["__scopeId","data-v-2668f60c"]]),_sfc_main$t=vue.defineComponent({__name:"component-tree",setup(r){const n=useGlobalStore(pinia),i=vue.computed(()=>{var u;return((u=n.handle_svg_info)==null?void 0:u.info.id)??""}),o=u=>{for(let c of n.done_json)c.selected=!1,c.old_position={x:0,y:0};n.intention=EGlobalStoreIntention.Select,n.setHandleSvgInfo(u)},a={children:"children",label:"title"};return(u,c)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTree),{class:"tree-v",data:vue.unref(n).done_json,props:a,onNodeClick:o,"default-expand-all":!0,"expand-on-click-node":!1,"highlight-current":!!vue.unref(i),"node-key":"id","current-node-key":vue.unref(i)},null,8,["data","highlight-current","current-node-key"]))}}),_withScopeId$1=r=>(vue.pushScopeId("data-v-98320511"),r=r(),vue.popScopeId(),r),_hoisted_1$9={class:"wall-l"},_hoisted_2$6={class:"head-l"},_hoisted_3$5=_withScopeId$1(()=>vue.createElementVNode("span",null,"key",-1)),_hoisted_4$2=_withScopeId$1(()=>vue.createElementVNode("span",null,"value",-1)),_hoisted_5$1={class:"row-l"},_sfc_main$s=vue.defineComponent({__name:"list",props:{modelValue:{default:()=>[{key:"",val:""}]}},emits:["update:modelValue"],setup(r,{emit:n}){const i=r,o=vue.computed({get(){return i.modelValue},set(c){n("update:modelValue",c)}}),a=()=>{o.value.push({key:"",val:""})},u=c=>{o.value.splice(c,1)};return(c,f)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$9,[vue.createElementVNode("div",_hoisted_2$6,[_hoisted_3$5,_hoisted_4$2,vue.createVNode(vue.unref(elementPlus.ElIcon),{size:16,class:"bt-Icon",onClick:a},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"add"})]),_:1})]),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(o),(d,h)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_5$1,[vue.createVNode(vue.unref(elementPlus.ElInput),{class:"content-l",modelValue:d.key,"onUpdate:modelValue":v=>d.key=v,size:"small",placeholder:"key"},null,8,["modelValue","onUpdate:modelValue"]),vue.createVNode(vue.unref(elementPlus.ElInput),{class:"content-l",modelValue:d.val,"onUpdate:modelValue":v=>d.val=v,size:"small",placeholder:"value"},null,8,["modelValue","onUpdate:modelValue"]),vue.createVNode(vue.unref(elementPlus.ElIcon),{size:16,class:"bt-Icon",onClick:v=>u(h)},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"delete"})]),_:2},1032,["onClick"])]))),256))]))}}),list_vue_vue_type_style_index_0_scoped_98320511_lang="",List=_export_sfc$1(_sfc_main$s,[["__scopeId","data-v-98320511"]]),composeEventHandlers=(r,n,{checkForDefaultPrevented:i=!0}={})=>a=>{const u=r==null?void 0:r(a);if(i===!1||!u)return n==null?void 0:n(a)};var _a;const isClient=typeof window<"u",isString$1=r=>typeof r=="string",noop=()=>{},isIOS=isClient&&((_a=window==null?void 0:window.navigator)==null?void 0:_a.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function resolveUnref(r){return typeof r=="function"?r():vue.unref(r)}function createFilterWrapper(r,n){function i(...o){return new Promise((a,u)=>{Promise.resolve(r(()=>n.apply(this,o),{fn:n,thisArg:this,args:o})).then(a).catch(u)})}return i}function debounceFilter(r,n={}){let i,o,a=noop;const u=f=>{clearTimeout(f),a(),a=noop};return f=>{const d=resolveUnref(r),h=resolveUnref(n.maxWait);return i&&u(i),d<=0||h!==void 0&&h<=0?(o&&(u(o),o=null),Promise.resolve(f())):new Promise((v,g)=>{a=n.rejectOnCancel?g:v,h&&!o&&(o=setTimeout(()=>{i&&u(i),o=null,v(f())},h)),i=setTimeout(()=>{o&&u(o),o=null,v(f())},d)})}}function identity(r){return r}function tryOnScopeDispose(r){return vue.getCurrentScope()?(vue.onScopeDispose(r),!0):!1}function useDebounceFn(r,n=200,i={}){return createFilterWrapper(debounceFilter(n,i),r)}function refDebounced(r,n=200,i={}){const o=vue.ref(r.value),a=useDebounceFn(()=>{o.value=r.value},n,i);return vue.watch(r,()=>a()),o}function tryOnMounted(r,n=!0){vue.getCurrentInstance()?vue.onMounted(r):n?r():vue.nextTick(r)}function unrefElement(r){var n;const i=resolveUnref(r);return(n=i==null?void 0:i.$el)!=null?n:i}const defaultWindow=isClient?window:void 0;function useEventListener(...r){let n,i,o,a;if(isString$1(r[0])||Array.isArray(r[0])?([i,o,a]=r,n=defaultWindow):[n,i,o,a]=r,!n)return noop;Array.isArray(i)||(i=[i]),Array.isArray(o)||(o=[o]);const u=[],c=()=>{u.forEach(v=>v()),u.length=0},f=(v,g,p,y)=>(v.addEventListener(g,p,y),()=>v.removeEventListener(g,p,y)),d=vue.watch(()=>[unrefElement(n),resolveUnref(a)],([v,g])=>{c(),v&&u.push(...i.flatMap(p=>o.map(y=>f(v,p,y,g))))},{immediate:!0,flush:"post"}),h=()=>{d(),c()};return tryOnScopeDispose(h),h}let _iOSWorkaround=!1;function onClickOutside(r,n,i={}){const{window:o=defaultWindow,ignore:a=[],capture:u=!0,detectIframe:c=!1}=i;if(!o)return;isIOS&&!_iOSWorkaround&&(_iOSWorkaround=!0,Array.from(o.document.body.children).forEach(p=>p.addEventListener("click",noop)));let f=!0;const d=p=>a.some(y=>{if(typeof y=="string")return Array.from(o.document.querySelectorAll(y)).some(_=>_===p.target||p.composedPath().includes(_));{const _=unrefElement(y);return _&&(p.target===_||p.composedPath().includes(_))}}),v=[useEventListener(o,"click",p=>{const y=unrefElement(r);if(!(!y||y===p.target||p.composedPath().includes(y))){if(p.detail===0&&(f=!d(p)),!f){f=!0;return}n(p)}},{passive:!0,capture:u}),useEventListener(o,"pointerdown",p=>{const y=unrefElement(r);y&&(f=!p.composedPath().includes(y)&&!d(p))},{passive:!0}),c&&useEventListener(o,"blur",p=>{var y;const _=unrefElement(r);((y=o.document.activeElement)==null?void 0:y.tagName)==="IFRAME"&&!(_!=null&&_.contains(o.document.activeElement))&&n(p)})].filter(Boolean);return()=>v.forEach(p=>p())}function useSupported(r,n=!1){const i=vue.ref(),o=()=>i.value=!!r();return o(),tryOnMounted(o,n),i}const _global=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},globalKey="__vueuse_ssr_handlers__";_global[globalKey]=_global[globalKey]||{};var __getOwnPropSymbols$g=Object.getOwnPropertySymbols,__hasOwnProp$g=Object.prototype.hasOwnProperty,__propIsEnum$g=Object.prototype.propertyIsEnumerable,__objRest$2=(r,n)=>{var i={};for(var o in r)__hasOwnProp$g.call(r,o)&&n.indexOf(o)<0&&(i[o]=r[o]);if(r!=null&&__getOwnPropSymbols$g)for(var o of __getOwnPropSymbols$g(r))n.indexOf(o)<0&&__propIsEnum$g.call(r,o)&&(i[o]=r[o]);return i};function useResizeObserver(r,n,i={}){const o=i,{window:a=defaultWindow}=o,u=__objRest$2(o,["window"]);let c;const f=useSupported(()=>a&&"ResizeObserver"in a),d=()=>{c&&(c.disconnect(),c=void 0)},h=vue.watch(()=>unrefElement(r),g=>{d(),f.value&&a&&g&&(c=new ResizeObserver(n),c.observe(g,u))},{immediate:!0,flush:"post"}),v=()=>{d(),h()};return tryOnScopeDispose(v),{isSupported:f,stop:v}}var SwipeDirection;(function(r){r.UP="UP",r.RIGHT="RIGHT",r.DOWN="DOWN",r.LEFT="LEFT",r.NONE="NONE"})(SwipeDirection||(SwipeDirection={}));var __defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(r,n,i)=>n in r?__defProp(r,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[n]=i,__spreadValues=(r,n)=>{for(var i in n||(n={}))__hasOwnProp.call(n,i)&&__defNormalProp(r,i,n[i]);if(__getOwnPropSymbols)for(var i of __getOwnPropSymbols(n))__propIsEnum.call(n,i)&&__defNormalProp(r,i,n[i]);return r};const _TransitionPresets={easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]};__spreadValues({linear:identity},_TransitionPresets);const isFirefox=()=>isClient&&/firefox/i.test(window.navigator.userAgent);process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const NOOP=()=>{},hasOwnProperty=Object.prototype.hasOwnProperty,hasOwn=(r,n)=>hasOwnProperty.call(r,n),isArray=Array.isArray,isFunction=r=>typeof r=="function",isString=r=>typeof r=="string",isObject=r=>r!==null&&typeof r=="object",objectToString=Object.prototype.toString,toTypeString=r=>objectToString.call(r),toRawType=r=>toTypeString(r).slice(8,-1),isUndefined=r=>r===void 0,isBoolean=r=>typeof r=="boolean",isNumber=r=>typeof r=="number",isElement=r=>typeof Element>"u"?!1:r instanceof Element,isStringNumber=r=>isString(r)?!Number.isNaN(Number(r)):!1,escapeStringRegexp=(r="")=>r.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),getProp=(r,n,i)=>({get value(){return lodashEs.get(r,n,i)},set value(o){lodashEs.set(r,n,o)}});class ElementPlusError extends Error{constructor(n){super(n),this.name="ElementPlusError"}}function throwError(r,n){throw new ElementPlusError(`[${r}] ${n}`)}function debugWarn(r,n){if(process.env.NODE_ENV!=="production"){const i=isString(r)?new ElementPlusError(`[${r}] ${n}`):r;console.warn(i)}}const SCOPE$1="utils/dom/style";function addUnit(r,n="px"){if(!r)return"";if(isNumber(r)||isStringNumber(r))return`${r}${n}`;if(isString(r))return r;debugWarn(SCOPE$1,"binding value must be a string or number")}function scrollIntoView(r,n){if(!isClient)return;if(!n){r.scrollTop=0;return}const i=[];let o=n.offsetParent;for(;o!==null&&r!==o&&r.contains(o);)i.push(o),o=o.offsetParent;const a=n.offsetTop+i.reduce((d,h)=>d+h.offsetTop,0),u=a+n.offsetHeight,c=r.scrollTop,f=c+r.clientHeight;a<c?r.scrollTop=a:u>f&&(r.scrollTop=u-r.clientHeight)}const epPropKey="__epPropKey",definePropType=r=>r,isEpProp=r=>isObject(r)&&!!r[epPropKey],buildProp=(r,n)=>{if(!isObject(r)||isEpProp(r))return r;const{values:i,required:o,default:a,type:u,validator:c}=r,d={type:u,required:!!o,validator:i||c?h=>{let v=!1,g=[];if(i&&(g=Array.from(i),hasOwn(r,"default")&&g.push(a),v||(v=g.includes(h))),c&&(v||(v=c(h))),!v&&g.length>0){const p=[...new Set(g)].map(y=>JSON.stringify(y)).join(", ");vue.warn(`Invalid prop: validation failed${n?` for prop "${n}"`:""}. Expected one of [${p}], got value ${JSON.stringify(h)}.`)}return v}:void 0,[epPropKey]:!0};return hasOwn(r,"default")&&(d.default=a),d},buildProps=r=>lodashEs.fromPairs(Object.entries(r).map(([n,i])=>[n,buildProp(i,n)])),iconPropType=definePropType([String,Object,Function]),ValidateComponentsMap={validating:loading_default,success:circle_check_default,error:circle_close_default},withInstall=(r,n)=>{if(r.install=i=>{for(const o of[r,...Object.values(n??{})])i.component(o.name,o)},n)for(const[i,o]of Object.entries(n))r[i]=o;return r},withNoopInstall=r=>(r.install=NOOP,r),EVENT_CODE={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},UPDATE_MODEL_EVENT="update:modelValue",CHANGE_EVENT="change",componentSizes=["","default","small","large"],componentSizeMap={large:40,default:32,small:24},getComponentSize=r=>componentSizeMap[r||"default"],isValidComponentSize=r=>["",...componentSizes].includes(r),isKorean=r=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(r),mutable=r=>r,DEFAULT_EXCLUDE_KEYS=["class","style"],LISTENER_PREFIX=/^on[A-Z]/,useAttrs=(r={})=>{const{excludeListeners:n=!1,excludeKeys:i}=r,o=vue.computed(()=>((i==null?void 0:i.value)||[]).concat(DEFAULT_EXCLUDE_KEYS)),a=vue.getCurrentInstance();return a?vue.computed(()=>{var u;return lodashEs.fromPairs(Object.entries((u=a.proxy)==null?void 0:u.$attrs).filter(([c])=>!o.value.includes(c)&&!(n&&LISTENER_PREFIX.test(c))))}):(debugWarn("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),vue.computed(()=>({})))},useDeprecated=({from:r,replacement:n,scope:i,version:o,ref:a,type:u="API"},c)=>{vue.watch(()=>vue.unref(c),f=>{f&&debugWarn(i,`[${u}] ${r} is about to be deprecated in version ${o}, please use ${n} instead.
|
244
|
+
`||h==="")){var v=c.isSelected(h);o.hasOwnProperty(h)?o[h]=o[h]&&v:o[h]=v}})}),r==="allSelect"||r==="inverseSelect"?{selected:o}:{name:n.name,selected:o}}function installLegendAction(r){r.registerAction("legendToggleSelect","legendselectchanged",curry$1(legendSelectActionHandler,"toggleSelected")),r.registerAction("legendAllSelect","legendselectall",curry$1(legendSelectActionHandler,"allSelect")),r.registerAction("legendInverseSelect","legendinverseselect",curry$1(legendSelectActionHandler,"inverseSelect")),r.registerAction("legendSelect","legendselected",curry$1(legendSelectActionHandler,"select")),r.registerAction("legendUnSelect","legendunselected",curry$1(legendSelectActionHandler,"unSelect"))}function install$2(r){r.registerComponentModel(LegendModel$1),r.registerComponentView(LegendView$1),r.registerProcessor(r.PRIORITY.PROCESSOR.SERIES_FILTER,legendFilter),r.registerSubTypeDefaulter("legend",function(){return"plain"}),installLegendAction(r)}var ScrollableLegendModel=function(r){__extends(n,r);function n(){var i=r!==null&&r.apply(this,arguments)||this;return i.type=n.type,i}return n.prototype.setScrollDataIndex=function(i){this.option.scrollDataIndex=i},n.prototype.init=function(i,o,a){var u=getLayoutParams(i);r.prototype.init.call(this,i,o,a),mergeAndNormalizeLayoutParams(this,i,u)},n.prototype.mergeOption=function(i,o){r.prototype.mergeOption.call(this,i,o),mergeAndNormalizeLayoutParams(this,this.option,i)},n.type="legend.scroll",n.defaultOption=inheritDefaultOption(LegendModel$1.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),n}(LegendModel$1);function mergeAndNormalizeLayoutParams(r,n,i){var o=r.getOrient(),a=[1,1];a[o.index]=0,mergeLayoutParam(n,i,{type:"box",ignoreSize:!!a})}const ScrollableLegendModel$1=ScrollableLegendModel;var Group=Group$3,WH=["width","height"],XY=["x","y"],ScrollableLegendView=function(r){__extends(n,r);function n(){var i=r!==null&&r.apply(this,arguments)||this;return i.type=n.type,i.newlineDisabled=!0,i._currentIndex=0,i}return n.prototype.init=function(){r.prototype.init.call(this),this.group.add(this._containerGroup=new Group),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new Group)},n.prototype.resetInner=function(){r.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},n.prototype.renderInner=function(i,o,a,u,c,f,d){var h=this;r.prototype.renderInner.call(this,i,o,a,u,c,f,d);var v=this._controllerGroup,g=o.get("pageIconSize",!0),p=isArray$1(g)?g:[g,g];_("pagePrev",0);var y=o.getModel("pageTextStyle");v.add(new ZRText$1({name:"pageText",style:{text:"xx/xx",fill:y.getTextColor(),font:y.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),_("pageNext",1);function _(b,A){var w=b+"DataIndex",T=createIcon(o.get("pageIcons",!0)[o.getOrient().name][A],{onclick:bind$1(h._pageGo,h,w,o,u)},{x:-p[0]/2,y:-p[1]/2,width:p[0],height:p[1]});T.name=b,v.add(T)}},n.prototype.layoutInner=function(i,o,a,u,c,f){var d=this.getSelectorGroup(),h=i.getOrient().index,v=WH[h],g=XY[h],p=WH[1-h],y=XY[1-h];c&&box("horizontal",d,i.get("selectorItemGap",!0));var _=i.get("selectorButtonGap",!0),b=d.getBoundingRect(),A=[-b.x,-b.y],w=clone$2(a);c&&(w[v]=a[v]-b[v]-_);var T=this._layoutContentAndController(i,u,w,h,v,p,y,g);if(c){if(f==="end")A[h]+=T[v]+_;else{var S=b[v]+_;A[h]-=S,T[g]-=S}T[v]+=b[v]+_,A[1-h]+=T[y]+T[p]/2-b[p]/2,T[p]=Math.max(T[p],b[p]),T[y]=Math.min(T[y],b[y]+A[1-h]),d.x=A[0],d.y=A[1],d.markRedraw()}return T},n.prototype._layoutContentAndController=function(i,o,a,u,c,f,d,h){var v=this.getContentGroup(),g=this._containerGroup,p=this._controllerGroup;box(i.get("orient"),v,i.get("itemGap"),u?a.width:null,u?null:a.height),box("horizontal",p,i.get("pageButtonItemGap",!0));var y=v.getBoundingRect(),_=p.getBoundingRect(),b=this._showController=y[c]>a[c],A=[-y.x,-y.y];o||(A[u]=v[h]);var w=[0,0],T=[-_.x,-_.y],S=retrieve2(i.get("pageButtonGap",!0),i.get("itemGap",!0));if(b){var x=i.get("pageButtonPosition",!0);x==="end"?T[u]+=a[c]-_[c]:w[u]+=_[c]+S}T[1-u]+=y[f]/2-_[f]/2,v.setPosition(A),g.setPosition(w),p.setPosition(T);var O={x:0,y:0};if(O[c]=b?a[c]:y[c],O[f]=Math.max(y[f],_[f]),O[d]=Math.min(0,_[d]+T[1-u]),g.__rectSize=a[c],b){var L={x:0,y:0};L[c]=Math.max(a[c]-_[c]-S,0),L[f]=O[f],g.setClipPath(new Rect$1({shape:L})),g.__rectSize=L[c]}else p.eachChild(function(re){re.attr({invisible:!0,silent:!0})});var M=this._getPageInfo(i);return M.pageIndex!=null&&updateProps$1(v,{x:M.contentPosition[0],y:M.contentPosition[1]},b?i:null),this._updatePageInfoView(i,M),O},n.prototype._pageGo=function(i,o,a){var u=this._getPageInfo(o)[i];u!=null&&a.dispatchAction({type:"legendScroll",scrollDataIndex:u,legendId:o.id})},n.prototype._updatePageInfoView=function(i,o){var a=this._controllerGroup;each$4(["pagePrev","pageNext"],function(v){var g=v+"DataIndex",p=o[g]!=null,y=a.childOfName(v);y&&(y.setStyle("fill",p?i.get("pageIconColor",!0):i.get("pageIconInactiveColor",!0)),y.cursor=p?"pointer":"default")});var u=a.childOfName("pageText"),c=i.get("pageFormatter"),f=o.pageIndex,d=f!=null?f+1:0,h=o.pageCount;u&&c&&u.setStyle("text",isString$2(c)?c.replace("{current}",d==null?"":d+"").replace("{total}",h==null?"":h+""):c({current:d,total:h}))},n.prototype._getPageInfo=function(i){var o=i.get("scrollDataIndex",!0),a=this.getContentGroup(),u=this._containerGroup.__rectSize,c=i.getOrient().index,f=WH[c],d=XY[c],h=this._findTargetItemIndex(o),v=a.children(),g=v[h],p=v.length,y=p?1:0,_={contentPosition:[a.x,a.y],pageCount:y,pageIndex:y-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!g)return _;var b=x(g);_.contentPosition[c]=-b.s;for(var A=h+1,w=b,T=b,S=null;A<=p;++A)S=x(v[A]),(!S&&T.e>w.s+u||S&&!O(S,w.s))&&(T.i>w.i?w=T:w=S,w&&(_.pageNextDataIndex==null&&(_.pageNextDataIndex=w.i),++_.pageCount)),T=S;for(var A=h-1,w=b,T=b,S=null;A>=-1;--A)S=x(v[A]),(!S||!O(T,S.s))&&w.i<T.i&&(T=w,_.pagePrevDataIndex==null&&(_.pagePrevDataIndex=w.i),++_.pageCount,++_.pageIndex),w=S;return _;function x(L){if(L){var M=L.getBoundingRect(),re=M[d]+L[d];return{s:re,e:re+M[f],i:L.__legendDataIndex}}}function O(L,M){return L.e>=M&&L.s<=M+u}},n.prototype._findTargetItemIndex=function(i){if(!this._showController)return 0;var o,a=this.getContentGroup(),u;return a.eachChild(function(c,f){var d=c.__legendDataIndex;u==null&&d!=null&&(u=f),d===i&&(o=f)}),o??u},n.type="legend.scroll",n}(LegendView$1);const ScrollableLegendView$1=ScrollableLegendView;function installScrollableLegendAction(r){r.registerAction("legendScroll","legendscroll",function(n,i){var o=n.scrollDataIndex;o!=null&&i.eachComponent({mainType:"legend",subType:"scroll",query:n},function(a){a.setScrollDataIndex(o)})})}function install$1(r){use(install$2),r.registerComponentModel(ScrollableLegendModel$1),r.registerComponentView(ScrollableLegendView$1),installScrollableLegendAction(r)}function install(r){use(install$2),use(install$1)}const _sfc_main$H=vue.defineComponent({__name:"pie-charts",props:{title:{type:String,default:"标题"},seriesName:{type:String,default:"详情"},seriesData:{type:Array,default:()=>[]}},setup(r){const n=r;use([install$7,install$6,install$3,install$4,install]),vue.provide(VChart.THEME_KEY,"dark");const i=vue.reactive({title:{text:n.title,left:"center"},tooltip:{trigger:"item",formatter:"{a} <br/>{b} : {c} ({d}%)"},legend:{orient:"vertical",left:"left"},series:[{name:n.seriesName,type:"pie",radius:"55%",center:["50%","60%"],data:n.seriesData,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]});return vue.watch(n,o=>{i.title.text=o.title,i.series[0].name=o.seriesName,i.series[0].data=o.seriesData}),(o,a)=>(vue.openBlock(),vue.createBlock(vue.unref(VChart),{class:"chart",option:vue.unref(i),autoresize:""},null,8,["option"]))}}),pieCharts_vue_vue_type_style_index_0_scoped_fec2cbf2_lang="",PieCharts=_export_sfc$1(_sfc_main$H,[["__scopeId","data-v-fec2cbf2"]]),_hoisted_1$k=["id"],_hoisted_2$h=["id"],_hoisted_3$e=["fill"],_hoisted_4$a=["fill"],_hoisted_5$8=["fill"],_hoisted_6$6=vue.createElementVNode("path",{d:"M375.466667 709.214815l-25.6 137.481481c0 2.844444 1.896296 5.688889 7.585185 10.42963l65.422222 54.992593c5.688889 4.740741 15.17037 8.533333 23.703704 10.429629l36.029629-193.422222-107.14074-19.911111z",fill:"#2D4375"},null,-1),_hoisted_7$6=vue.createElementVNode("path",{d:"M482.607407 729.125926l-36.029629 193.422222c9.481481 1.896296 18.014815 1.896296 25.6-0.948148l80.592592-27.496296c6.637037-1.896296 10.42963-4.740741 11.377778-6.637037L589.748148 749.037037l-107.140741-19.911111z",fill:"#1E2D4F"},null,-1),_hoisted_8$6=["fill-opacity"],_hoisted_9$6=["fill-opacity"],_hoisted_10$5=["fill-opacity"],_hoisted_11$4=vue.createElementVNode("path",{d:"M593.540741 807.822222c1.896296-7.585185-3.792593-15.17037-11.377778-16.118518l-107.140741-19.911111-4.740741 27.496296 107.140741 19.911111c6.637037 0.948148 14.222222-3.792593 16.118519-11.377778z",fill:"#CEEFF6"},null,-1),_hoisted_12$4=vue.createElementVNode("path",{d:"M366.933333 750.933333c-7.585185-1.896296-15.17037 3.792593-16.118518 11.377778-1.896296 7.585185 3.792593 15.17037 11.377778 16.118519l107.14074 19.911111 4.740741-27.496297-107.140741-19.911111zM356.503704 808.77037c-7.585185-1.896296-15.17037 3.792593-16.118519 11.377778-1.896296 7.585185 3.792593 15.17037 11.377778 16.118519l107.140741 19.911111 4.74074-27.496297-107.14074-19.911111z",fill:"#FFFFFF"},null,-1),_hoisted_13$3=vue.createElementVNode("path",{d:"M570.785185 848.592593l-107.140741-19.911112-4.74074 27.496297 107.14074 19.911111c7.585185 1.896296 15.17037-3.792593 16.118519-11.377778 1.896296-7.585185-2.844444-15.17037-11.377778-16.118518z",fill:"#CEEFF6"},null,-1),_hoisted_14$3=["xlink:href","width","height"],_sfc_main$G=vue.defineComponent({__name:"light-a",props:{id:{default:""},isOpen:{type:Boolean,default:!1},height:{default:100},width:{default:100}},emits:["onChange"],setup(r,{emit:n}){const i=r;return vue.watch(()=>i.isOpen,()=>{n("onChange")}),(o,a)=>(vue.openBlock(),vue.createElementBlock("g",{id:i.id,style:{cursor:"pointer"}},[vue.createElementVNode("symbol",{id:`${i.id}light-121`,viewBox:"0 0 1024 1024"},[vue.createElementVNode("path",{d:"M565.096296 289.185185s-0.948148 0 0 0c-110.933333-20.859259-208.592593 40.77037-237.985185 148.859259-14.222222 53.096296-24.651852 101.451852 44.562963 221.866667 14.222222 25.6 11.377778 70.162963 8.533333 95.762963-1.896296 14.222222 64.474074 36.02963 89.125926 42.666667l95.762963-509.155556z",fill:i.isOpen?"#FDB813":"#cccccc"},null,8,_hoisted_3$e),vue.createElementVNode("path",{d:"M732.918519 513.896296c11.377778-111.881481-56.888889-203.851852-166.874075-224.711111h-0.948148L469.333333 798.340741c25.6 2.844444 94.814815 6.637037 98.607408-7.585185 6.637037-25.6 20.859259-67.318519 42.666666-86.281482C719.644444 618.192593 727.22963 568.888889 732.918519 513.896296z",fill:i.isOpen?"#FD9B13":"#bbbbbb"},null,8,_hoisted_4$a),vue.createElementVNode("path",{d:"M467.437037 806.874074c-7.585185-0.948148-12.325926-7.585185-14.222222-14.222222l-38.874074-256c-0.948148-5.688889 0.948148-11.377778 4.74074-15.170371 3.792593-3.792593 9.481481-5.688889 15.170371-4.74074l167.822222 31.288889c5.688889 0.948148 10.42963 4.740741 12.325926 9.481481 1.896296 4.740741 1.896296 11.377778-0.948148 16.118519L486.4 798.340741c-3.792593 6.637037-11.377778 10.42963-18.962963 8.533333z m-14.222222-251.259259l27.496296 182.992592L572.681481 578.37037l-119.466666-22.755555z",fill:i.isOpen?"#F12A3F":"#666666"},null,8,_hoisted_5$8),_hoisted_6$6,_hoisted_7$6,vue.createElementVNode("path",{d:"M612.503704 217.125926c-3.792593 18.014815-20.859259 29.392593-38.874074 26.548148-18.014815-3.792593-30.340741-20.859259-26.548149-38.874074l18.962963-100.503704c3.792593-18.014815 20.859259-29.392593 38.874075-26.548148 18.014815 3.792593 30.340741 20.859259 26.548148 38.874074l-18.962963 100.503704z",fill:"#FDB813","fill-opacity":i.isOpen?1:0},null,8,_hoisted_8$6),vue.createElementVNode("path",{d:"M382.103704 228.503704c10.42963 15.17037 6.637037 36.02963-8.533334 46.459259-15.17037 10.42963-36.02963 6.637037-46.459259-8.533333l-57.837037-84.385186c-10.42963-15.17037-6.637037-36.02963 8.533333-46.459259 15.17037-10.42963 36.02963-6.637037 46.45926 8.533334l57.837037 84.385185zM757.57037 298.666667c-15.17037 10.42963-18.962963 31.288889-8.533333 46.459259 10.42963 15.17037 31.288889 18.962963 46.459259 8.533333l84.385185-57.837037c15.17037-10.42963 18.962963-31.288889 8.533334-46.459259-10.42963-15.17037-31.288889-18.962963-46.459259-8.533333l-84.385186 57.837037z",fill:"#FDB813","fill-opacity":i.isOpen?1:0},null,8,_hoisted_9$6),vue.createElementVNode("path",{d:"M252.207407 361.244444c18.014815 3.792593 30.340741 20.859259 26.548149 38.874075-3.792593 18.014815-20.859259 29.392593-38.874075 26.548148l-100.503703-18.962963c-18.014815-3.792593-30.340741-20.859259-26.548148-38.874074 3.792593-18.014815 20.859259-29.392593 38.874074-26.548149l100.503703 18.962963zM931.081481 488.296296c18.014815 3.792593 30.340741 20.859259 26.548149 38.874074-3.792593 18.014815-20.859259 29.392593-38.874074 26.548149l-100.503704-18.962963c-18.014815-3.792593-30.340741-20.859259-26.548148-38.874075 3.792593-18.014815 20.859259-29.392593 38.874074-26.548148l100.503703 18.962963z",fill:"#FDB813","fill-opacity":i.isOpen?1:0},null,8,_hoisted_10$5),_hoisted_11$4,_hoisted_12$4,_hoisted_13$3],8,_hoisted_2$h),vue.createElementVNode("use",{"xlink:href":`#${i.id}light-121`,width:o.width,height:o.height},null,8,_hoisted_14$3)],8,_hoisted_1$k))}}),_hoisted_1$j=["id"],_hoisted_2$g=["id"],_hoisted_3$d=["fill"],_hoisted_4$9=["fill"],_hoisted_5$7=["fill"],_hoisted_6$5=["from","to"],_hoisted_7$5=["fill"],_hoisted_8$5=["from","to"],_hoisted_9$5=["fill"],_hoisted_10$4=["fill"],_hoisted_11$3=["fill"],_hoisted_12$3=["from","to"],_hoisted_13$2=["fill"],_hoisted_14$2=["xlink:href"],_sfc_main$F=vue.defineComponent({__name:"clock-a",props:{id:{default:""},centerColor:{default:"#EBF257"},secondsColor:{default:"#E83E24"},circleColor:{default:"#F45AFC"},minutesColor:{default:"#50E68E"},hoursColor:{default:"#9A36E7"},scaleColor:{default:"#4942CF"},backgroundColor:{default:"#ffffff"},borderColor:{default:"#B3A7FF"}},setup(r){const n=r,i=new Date(Number(window.sessionStorage.getItem("editorLoadTime")||"0")),o=i.getSeconds()+1,a=i.getMinutes(),u=Math.floor((i.getHours()+(a+o/60)/60)*30);return(c,f)=>(vue.openBlock(),vue.createElementBlock("g",{id:n.id},[vue.createElementVNode("symbol",{id:`${n.id}clock-a-n`,viewBox:"0 0 1024 1024"},[vue.createElementVNode("path",{d:"M512.3 518.9m-469.2 0a469.2 469.2 0 1 0 938.4 0 469.2 469.2 0 1 0-938.4 0Z",fill:n.borderColor},null,8,_hoisted_3$d),vue.createElementVNode("path",{d:"M512.3 518.9m-392.5 0a392.5 392.5 0 1 0 785 0 392.5 392.5 0 1 0-785 0Z",fill:n.backgroundColor},null,8,_hoisted_4$9),vue.createElementVNode("path",{d:"M512.3 523.8c-4.5 0-9-1.7-12.4-5.1L318.3 337.1c-6.8-6.8-6.8-17.9 0-24.8 6.8-6.8 17.9-6.8 24.8 0L524.7 494c6.8 6.8 6.8 17.9 0 24.8-3.5 3.3-7.9 5-12.4 5z",fill:n.minutesColor},[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${45+vue.unref(a)*6} 512.3 506.3`,to:`${405+vue.unref(a)*6} 512.3 506.3`,dur:"3600s",repeatCount:"indefinite"},null,8,_hoisted_6$5)],8,_hoisted_5$7),vue.createElementVNode("path",{d:"M512.3 523.8c-4.5 0-9-1.7-12.4-5.1-6.8-6.8-6.8-17.9 0-24.8l130.8-130.8c6.8-6.8 17.9-6.8 24.8 0 6.8 6.8 6.8 17.9 0 24.8L524.7 518.7c-3.5 3.4-7.9 5.1-12.4 5.1z",fill:n.hoursColor},[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${-45+vue.unref(u)} 512.3 506.3`,to:`${315+vue.unref(u)} 512.3 506.3`,dur:"43200s",repeatCount:"indefinite"},null,8,_hoisted_8$5)],8,_hoisted_7$5),vue.createElementVNode("path",{d:"M512.3 506.3m-47.5 0a47.5 47.5 0 1 0 95 0 47.5 47.5 0 1 0-95 0Z",fill:n.circleColor},null,8,_hoisted_9$5),vue.createElementVNode("path",{d:"M512.3 218.8c-9 0-16.3-7.3-16.3-16.3v-29.1c0-9 7.3-16.3 16.3-16.3s16.3 7.3 16.3 16.3v29.1c0 9-7.4 16.3-16.3 16.3zM512.3 880.8c-9 0-16.3-7.3-16.3-16.3v-29.1c0-9 7.3-16.3 16.3-16.3s16.3 7.3 16.3 16.3v29.1c0 9-7.4 16.3-16.3 16.3zM812.4 518.9c0-9 7.3-16.3 16.3-16.3h29.1c9 0 16.3 7.3 16.3 16.3s-7.3 16.3-16.3 16.3h-29.1c-8.9 0-16.3-7.3-16.3-16.3zM150.4 518.9c0-9 7.3-16.3 16.3-16.3h29.1c9 0 16.3 7.3 16.3 16.3s-7.3 16.3-16.3 16.3h-29.1c-8.9 0-16.3-7.3-16.3-16.3z",fill:n.scaleColor},null,8,_hoisted_10$4),vue.createElementVNode("path",{d:"M296.9 733.5c-2.2 0-4.5-0.9-6.2-2.6-3.4-3.4-3.4-9 0-12.4L540 469.2c3.4-3.4 9-3.4 12.4 0 3.4 3.4 3.4 9 0 12.4L303.1 731c-1.7 1.7-4 2.5-6.2 2.5z",fill:n.secondsColor},[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${135.5+o*6} 512.3 506.3`,to:`${495.5+o*6} 512.3 506.3`,dur:"60s",repeatCount:"indefinite"},null,8,_hoisted_12$3)],8,_hoisted_11$3),vue.createElementVNode("path",{d:"M512.3 506.3m-22.8 0a22.8 22.8 0 1 0 45.6 0 22.8 22.8 0 1 0-45.6 0Z",fill:n.centerColor},null,8,_hoisted_13$2)],8,_hoisted_2$g),vue.createElementVNode("use",{"xlink:href":`#${n.id}clock-a-n`,width:"100",height:"100"},null,8,_hoisted_14$2)],8,_hoisted_1$j))}}),_sfc_main$E=vue.defineComponent({__name:"text-box",props:{width:{default:250},height:{default:150},bgColor:{default:"#ffffff"},bgOpacity:{default:50},borderColor:{default:"#000000"},borderWidth:{default:1},borderRadius:{default:5},borderOpacity:{default:100}},setup(r){const n=r,i=vue.computed(()=>({width:(n.width>0?n.width:0)+"px",height:(n.height>0?n.height:0)+"px",borderRadius:(n.borderRadius>0?n.borderRadius:0)+"px"})),o=vue.computed(()=>({border:`${n.borderWidth>0?n.borderWidth:0}px solid ${n.borderColor}`,borderRadius:(n.borderRadius>0?n.borderRadius:0)+"px",opacity:(n.borderOpacity>0?n.borderOpacity<100?n.borderOpacity:100:0)/100})),a=vue.computed(()=>({backgroundColor:n.bgColor,opacity:(n.bgOpacity>0?n.bgOpacity<100?n.bgOpacity:100:0)/100,borderRadius:n.borderRadius+"px"}));return(u,c)=>(vue.openBlock(),vue.createElementBlock("div",{class:"outM",style:vue.normalizeStyle(i.value)},[vue.createElementVNode("div",{class:"wallI",style:vue.normalizeStyle(a.value)},null,4),vue.createElementVNode("div",{class:"borderB",style:vue.normalizeStyle(o.value)},null,4)],4))}}),textBox_vue_vue_type_style_index_0_scoped_4ab181ea_lang="",TextBox=_export_sfc$1(_sfc_main$E,[["__scopeId","data-v-4ab181ea"]]),vueComp={"svg-text":_sfc_main$K,"el-button":elementPlus.ElButton,"progress-a":_sfc_main$M,"el-tag":elementPlus.ElTag,"common-table":_sfc_main$J,"pie-charts":PieCharts,"switch-r":_sfc_main$L,"now-time":NowTime,"light-a":_sfc_main$G,"clock-a":_sfc_main$F,"text-box":TextBox},config=[...t$b,...t$1],useGlobalStore=pinia$1.defineStore("global-store",{state:()=>({config_center:config,intention:EGlobalStoreIntention.None,create_svg_info:null,done_json:[],mouse_info:{state:EMouseInfoState.Up,position_x:0,position_y:0,now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0},handle_svg_info:null,scale_info:{type:EScaleInfoType.None,scale_times:{x:1,y:1},scale_item_info:{x:0,y:0},symmetric_point:{x:0,y:0}},rotate_info:{angle:0},connection_line_node_info:{init_pos:{x:0,y:0},point_index:0}}),actions:{setCreateInfo(r){this.intention=EGlobalStoreIntention.Create,this.create_svg_info=r},setDoneJson(r){isOfType(r,"id")?(this.done_json.push(r),vue.nextTick(()=>{setSvgActualInfo(r)})):this.done_json=objectDeepClone(r),vue.nextTick(()=>{useHistoryRecord(objectDeepClone(this.done_json))})},setHandleSvgInfo(r,n){let i=n;r?(!i&&i!=0&&(i=this.done_json.findIndex(o=>o.id===r.id)??-1),this.handle_svg_info={info:r,index:i}):this.handle_svg_info=r},spliceDoneJson(r){const n=useGlobalStore(),o=n.done_json.splice(r,1)[0];unbindAnchors(o.id),useHistoryRecord(n.done_json)}}}),useSvgEditLayoutStore=pinia$1.defineStore("svg-edit-layout-store",{state:()=>({left_nav:!0,right_nav:!0,center_offset:{x:0,y:0},canvasInfo:{with:0,height:0,top:0,left:0}})}),stopEvent=r=>{r.stopPropagation()},preventDefault=r=>{r.preventDefault()};function componentsRegister(r){var o,a;const n=vue.getCurrentInstance(),i=r?Object.assign(vueComp,r):vueComp;for(let u in i)!((o=n==null?void 0:n.appContext)!=null&&o.components.hasOwnProperty(u))&&vueComp.hasOwnProperty(u)&&((a=n==null?void 0:n.appContext)==null||a.app.component(u,vueComp[u]))}function setEditorLoadTime(){window.sessionStorage.setItem("editorLoadTime",new Date().getTime().toString())}const randomString=r=>{r=r||10;const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=n.length;let o="";for(let a=0;a<r;a++){let u=i;a===0&&(u=i-10),o+=n.charAt(Math.floor(Math.random()*u))}return o},isOfType=(r,n)=>r[n]!==void 0,getCoordinateOffset=(r,n)=>r/2*(n-1),angleToRadian=r=>r*Math.PI/180,calculateRotatedPointCoordinate=(r,n,i)=>({x:parseFloat(((r.x-n.x)*Math.cos(angleToRadian(i))-(r.y-n.y)*Math.sin(angleToRadian(i))+n.x).toFixed(1)),y:parseFloat(((r.x-n.x)*Math.sin(angleToRadian(i))+(r.y-n.y)*Math.cos(angleToRadian(i))+n.y).toFixed(1))}),getCenterPoint=(r,n)=>({x:r.x+(n.x-r.x)/2,y:r.y+(n.y-r.y)/2}),positionArrToPath=r=>{let n="";for(let i=0;i<r.length;i++)i===0?n+=`M ${r[i].x} ${r[i].y}`:n+=` L ${r[i].x} ${r[i].y}`;return n},getSvgNowPosition=(r,n,i)=>i+(n-r),objectDeepClone=(r,n={})=>r?JSON.parse(JSON.stringify(r)):n,setSvgActualInfo=(r,n)=>{var a,u;const i=document.querySelector(`#${r.id}`),o=document.querySelector(`#rect${r.id}`);if(i){let c=0,f=0,d=0,h=0;if(r.type===EDoneJsonType.Vue){d=((a=r.props.width)==null?void 0:a.val)||i.offsetWidth||100,h=((u=r.props.height)==null?void 0:u.val)||i.offsetHeight||100,c=50-d/2,f=50-h/2;const v=document.querySelector(`#foreign-object${r.id}`);v&&(v.getAttribute("x")==="0"&&v.getAttribute("y")==="0"&&v.getAttribute("width")==="0"&&v.getAttribute("height")==="0"||n)&&(v.setAttribute("x",c.toString()),v.setAttribute("y",f.toString()),v.setAttribute("width",d.toString()),v.setAttribute("height",h.toString()))}else{const v=i.getBBox();c=parseFloat(v.x.toFixed(0)),f=parseFloat(v.y.toFixed(0)),d=parseFloat(v.width.toFixed(0)),h=parseFloat(v.height.toFixed(0))}o&&(o.getAttribute("x")==="0"&&o.getAttribute("y")==="0"&&o.getAttribute("width")==="0"&&o.getAttribute("height")==="0"||n)&&(o.setAttribute("x",c.toString()),o.setAttribute("y",f.toString()),o.setAttribute("width",d.toString()),o.setAttribute("height",h.toString())),(r.actual_bound.x===0&&r.actual_bound.y===0&&r.actual_bound.width===0&&r.actual_bound.height===0||n)&&(r.actual_bound={x:c,y:f,width:d,height:h}),r.center_position={x:r.x+r.actual_bound.x+d/2,y:r.y+r.actual_bound.y+h/2},r.point_coordinate.tl={x:r.center_position.x-d*r.scale_x/2,y:r.center_position.y-h*r.scale_y/2},r.point_coordinate.tc={x:r.center_position.x,y:r.center_position.y-h*r.scale_y/2},r.point_coordinate.tr={x:r.center_position.x+d*r.scale_x/2,y:r.center_position.y-h*r.scale_y/2},r.point_coordinate.l={x:r.center_position.x-d*r.scale_x/2,y:r.center_position.y},r.point_coordinate.r={x:r.center_position.x+d*r.scale_x/2,y:r.center_position.y},r.point_coordinate.bl={x:r.center_position.x-d*r.scale_x/2,y:r.center_position.y+h*r.scale_y/2},r.point_coordinate.bc={x:r.center_position.x,y:r.center_position.y+h*r.scale_y/2},r.point_coordinate.br={x:r.center_position.x+d*r.scale_x/2,y:r.center_position.y+h*r.scale_y/2},r.rotate!==0&&setAfterRotationPointCoordinate(r),moveAnchors(r)}},resetHandlePointOld=r=>{for(const n of Object.keys(r.point_coordinate))r.point_coordinate_old&&(r.point_coordinate_old[n].x=0,r.point_coordinate_old[n].y=0)},moveHandlePoint=(r,n,i)=>{const o=useGlobalStore(pinia),a=n??o.mouse_info.new_position_x-o.mouse_info.position_x,u=i??o.mouse_info.new_position_y-o.mouse_info.position_y;for(const c of Object.keys(r.point_coordinate))n!==void 0&&i!==void 0?(r.point_coordinate[c].x+=a,r.point_coordinate[c].y+=u):r.point_coordinate_old&&(r.point_coordinate[c].x=r.point_coordinate_old[c].x+a,r.point_coordinate[c].y=r.point_coordinate_old[c].y+u)},moveAnchors=r=>{var i,o,a,u;const n=useGlobalStore(pinia);for(let c of n.done_json)if(c.type===EDoneJsonType.ConnectionLine){if(((o=(i=c.bind_anchors)==null?void 0:i.start)==null?void 0:o.target_id)===r.id){const f=getAnchorPosByAnchorType(c.bind_anchors.start.type,r);c.props.point_position.val[0]={x:f.x-c.x,y:f.y-c.y}}if(((u=(a=c.bind_anchors)==null?void 0:a.end)==null?void 0:u.target_id)===r.id){const f=getAnchorPosByAnchorType(c.bind_anchors.end.type,r);c.props.point_position.val[c.props.point_position.val.length-1]={x:f.x-c.x,y:f.y-c.y}}}},unbindAnchors=r=>{var i,o,a,u;const n=useGlobalStore(pinia);for(let c of n.done_json)c.type===EDoneJsonType.ConnectionLine&&(((o=(i=c.bind_anchors)==null?void 0:i.start)==null?void 0:o.target_id)===r&&(c.bind_anchors.start=null),((u=(a=c.bind_anchors)==null?void 0:a.end)==null?void 0:u.target_id)===r&&(c.bind_anchors.end=null))},getAnchorPosByAnchorType=(r,n)=>r===ELineBindAnchors.BottomCenter?n.point_coordinate.bc:r===ELineBindAnchors.Left?n.point_coordinate.l:r===ELineBindAnchors.Right?n.point_coordinate.r:n.point_coordinate.tc,setAfterRotationPointCoordinate=r=>{r.point_coordinate={tl:calculateRotatedPointCoordinate(r.point_coordinate.tl,r.center_position,r.rotate),tc:calculateRotatedPointCoordinate(r.point_coordinate.tc,r.center_position,r.rotate),tr:calculateRotatedPointCoordinate(r.point_coordinate.tr,r.center_position,r.rotate),l:calculateRotatedPointCoordinate(r.point_coordinate.l,r.center_position,r.rotate),r:calculateRotatedPointCoordinate(r.point_coordinate.r,r.center_position,r.rotate),bl:calculateRotatedPointCoordinate(r.point_coordinate.bl,r.center_position,r.rotate),bc:calculateRotatedPointCoordinate(r.point_coordinate.bc,r.center_position,r.rotate),br:calculateRotatedPointCoordinate(r.point_coordinate.br,r.center_position,r.rotate)}},prosToVBind=(r,n=[])=>{let i={};if(r.state){for(const o in r.state)if(r.state.hasOwnProperty(o)&&o===r.defaultState){for(let a in r.state[o])a!=="label"&&(i[lodashEs.kebabCase(a)]=r.state[o][a]);break}}for(const o in r.props)n.indexOf(o)<0&&(i[lodashEs.kebabCase(o)]=r.props[o].val);return i},setArrItemByID=(id,key,val,json_arr)=>new Promise(res=>{const find_item=json_arr.find(r=>r.id===id);find_item||res({status:!1,msg:"要设置的id不存在"}),eval(`find_item.${key} = val;`),res({status:!0,msg:"操作成功"})}),getCommonClass=r=>!r.common_animations||!r.common_animations.val?"":`common-ani animate__animated animate__${r.common_animations.val} animate__${r.common_animations.speed} animate__${r.common_animations.repeat} animate__${r.common_animations.delay}`,numberArray=r=>{let n=[];for(let i=0;i<r;i++)n.push(i);return n},getStringWidth=(r,n=12)=>{if(r.length>0){let i=document.createElement("span");i.style.fontSize=n+"px",i.style.fontFamily="inherit",i.innerHTML=r,i.style.opacity="0",i.style.position="fixed",i.style.top="3000px",document.body.append(i);const o=i.clientWidth;return document.body.removeChild(i),o}return 0},valFormat=r=>/false|true/.test(r)?r!=="false":/^\d+(\.\d+)?$/.test(r)?Number(r):r,createLine=(r,n,i)=>{r.preventDefault();const o=useGlobalStore(pinia),a=useConfigStore(pinia),u=useSvgEditLayoutStore(pinia),{clientX:c,clientY:f}=r;let d=objectDeepClone(a.connection_line),h=0,v=0;if(n&&i){d.bind_anchors.start={type:n,target_id:i.id};let p=getAnchorPosByAnchorType(n,i);h=p.x,v=p.y}else h=Math.round((c-u.canvasInfo.left)/a.svg.scale-u.center_offset.x),v=Math.round((f-u.canvasInfo.top)/a.svg.scale-u.center_offset.y);const g={id:randomString(),x:h,y:v,client:{x:h,y:v},scale_x:1,scale_y:1,rotate:0,actual_bound:{x:0,y:0,width:0,height:0},center_position:{x:0,y:0},point_coordinate:{tl:{x:0,y:0},tc:{x:0,y:0},tr:{x:0,y:0},l:{x:0,y:0},r:{x:0,y:0},bl:{x:0,y:0},bc:{x:0,y:0},br:{x:0,y:0}},...d};g.props.point_position.val.push({x:0,y:0}),o.setDoneJson(g),o.setHandleSvgInfo(g,o.done_json.length-1),o.intention=EGlobalStoreIntention.Connection,o.mouse_info={state:EMouseInfoState.Down,position_x:h,position_y:v,now_position_x:h,now_position_y:v,new_position_x:0,new_position_y:0}};Object.seal({name:"straight-line",title:"直线",type:EDoneJsonType.StraightLine,config:{can_zoom:!1,have_anchor:!1,actual_rect:!1},display:!0,props:{fill:{title:"填充色",type:EConfigItemPropsType.Color,val:"#ff0000"},start_x:{title:"起点x坐标",type:EConfigItemPropsType.InputNumber,val:0},start_y:{title:"起点y坐标",type:EConfigItemPropsType.InputNumber,val:0},end_x:{title:"终点x坐标",type:EConfigItemPropsType.InputNumber,val:0},end_y:{title:"终点y坐标",type:EConfigItemPropsType.InputNumber,val:0}},bind_anchors:{start:null,end:null},events:[]});const connection_line_system={name:"connection_line",title:"连接线",type:EDoneJsonType.ConnectionLine,config:{can_zoom:!1,have_anchor:!1,actual_rect:!1},display:!0,props:{stroke:{title:"线条颜色",type:EConfigItemPropsType.Color,val:"#ff0000"},"stroke-width":{title:"线条宽度",type:EConfigItemPropsType.InputNumber,val:2},point_r:{title:"节点半径",type:EConfigItemPropsType.InputNumber,val:4},point_position:{title:"点坐标",type:EConfigItemPropsType.JsonEdit,val:[]}},animations:{type:{title:"动画类型",type:EConfigItemPropsType.Select,val:EConfigAnimationsType.None,options:[{label:"无",value:EConfigAnimationsType.None},{label:"电流",value:EConfigAnimationsType.Electricity},{label:"轨迹",value:EConfigAnimationsType.Track},{label:"水珠",value:EConfigAnimationsType.WaterDrop}]},dur:{title:"持续时间",type:EConfigItemPropsType.InputNumber,val:20},repeatCount:{title:"循环次数",type:EConfigItemPropsType.Input,val:"indefinite",disabled:!0},color:{title:"颜色",type:EConfigItemPropsType.Color,val:"#602a00"},reverse:{title:"反转动画",type:EConfigItemPropsType.Switch,val:!1}},bind_anchors:{start:null,end:null},events:[]},common_animate_list=[{label:"进入",children:[{label:"渐显",value:"fadeIn"},{label:"向右进入",value:"fadeInLeft"},{label:"向左进入",value:"fadeInRight"},{label:"向上进入",value:"fadeInUp"},{label:"向下进入",value:"fadeInDown"},{label:"向右长距进入",value:"fadeInLeftBig"},{label:"向左长距进入",value:"fadeInRightBig"},{label:"向上长距进入",value:"fadeInUpBig"},{label:"向下长距进入",value:"fadeInDownBig"},{label:"旋转进入",value:"rotateIn"},{label:"左顺时针旋转",value:"rotateInDownLeft"},{label:"右逆时针旋转",value:"rotateInDownRight"},{label:"左逆时针旋转",value:"rotateInUpLeft"},{label:"右逆时针旋转",value:"rotateInUpRight"},{label:"弹入",value:"bounceIn"},{label:"向右弹入",value:"bounceInLeft"},{label:"向左弹入",value:"bounceInRight"},{label:"向上弹入",value:"bounceInUp"},{label:"向下弹入",value:"bounceInDown"},{label:"光速从右进入",value:"lightSpeedInRight"},{label:"光速从左进入",value:"lightSpeedInLeft"},{label:"光速从右退出",value:"lightSpeedOutRight"},{label:"光速从左退出",value:"lightSpeedOutLeft"},{label:"Y轴旋转",value:"flip"},{label:"中心X轴旋转",value:"flipInX"},{label:"中心Y轴旋转",value:"flipInY"},{label:"左长半径旋转",value:"rollIn"},{label:"由小变大进入",value:"zoomIn"},{label:"左变大进入",value:"zoomInLeft"},{label:"右变大进入",value:"zoomInRight"},{label:"向上变大进入",value:"zoomInUp"},{label:"向下变大进入",value:"zoomInDown"},{label:"向右滑动展开",value:"slideInLeft"},{label:"向左滑动展开",value:"slideInRight"},{label:"向上滑动展开",value:"slideInUp"},{label:"向下滑动展开",value:"slideInDown"}]},{label:"强调",children:[{label:"弹跳",value:"bounce"},{label:"闪烁",value:"flash"},{label:"放大缩小",value:"pulse"},{label:"放大缩小弹簧",value:"rubberBand"},{label:"左右晃动",value:"headShake"},{label:"左右扇形摇摆",value:"swing"},{label:"放大晃动缩小",value:"tada"},{label:"扇形摇摆",value:"wobble"},{label:"左右上下晃动",value:"jello"},{label:"Y轴旋转",value:"flip"}]},{label:"退出",children:[{label:"渐隐",value:"fadeOut"},{label:"向左退出",value:"fadeOutLeft"},{label:"向右退出",value:"fadeOutRight"},{label:"向上退出",value:"fadeOutUp"},{label:"向下退出",value:"fadeOutDown"},{label:"向左长距退出",value:"fadeOutLeftBig"},{label:"向右长距退出",value:"fadeOutRightBig"},{label:"向上长距退出",value:"fadeOutUpBig"},{label:"向下长距退出",value:"fadeOutDownBig"},{label:"旋转退出",value:"rotateOut"},{label:"左顺时针旋转",value:"rotateOutDownLeft"},{label:"右逆时针旋转",value:"rotateOutDownRight"},{label:"左逆时针旋转",value:"rotateOutUpLeft"},{label:"右逆时针旋转",value:"rotateOutUpRight"},{label:"弹出",value:"bounceOut"},{label:"向左弹出",value:"bounceOutLeft"},{label:"向右弹出",value:"bounceOutRight"},{label:"向上弹出",value:"bounceOutUp"},{label:"向下弹出",value:"bounceOutDown"},{label:"中心X轴旋转",value:"flipOutX"},{label:"中心Y轴旋转",value:"flipOutY"},{label:"左长半径旋转",value:"rollOut"},{label:"由小变大退出",value:"zoomOut"},{label:"左变大退出",value:"zoomOutLeft"},{label:"右变大退出",value:"zoomOutRight"},{label:"向上变大退出",value:"zoomOutUp"},{label:"向下变大退出",value:"zoomOutDown"},{label:"向左滑动收起",value:"slideOutLeft"},{label:"向右滑动收起",value:"slideOutRight"},{label:"向上滑动收起",value:"slideOutUp"},{label:"向下滑动收起",value:"slideOutDown"}]}];let l=localStorage.getItem("svg-editor-config"),s,t;if(l){let r=JSON.parse(l);t=r.connection_line,s=r.svg}else t=objectDeepClone(connection_line_system),s={background_color:"#fff",scale:1,grid:!0,grid_color:"#ebebeb",ruler:!0};const useConfigStore=pinia$1.defineStore("config-store",{state:()=>({svg:s,connection_line:t,net:{mqtt:{url:"",user:"",pwd:"",topics:""}}}),getters:{},actions:{}});var EContextMenuInfoType=(r=>(r.Copy="Copy",r.Delete="Delete",r.MoveUpOneLevel="MoveUpOneLevel",r.MoveDownOneLevel="MoveDownOneLevel",r.MoveUpTopLevel="MoveUpTopLevel",r.MoveDownTopLevel="MoveDownTopLevel",r))(EContextMenuInfoType||{});const useEditPrivateStore=pinia$1.defineStore("edit-private-store",{state:()=>({old_done_components:[],history_doneComponent:[],history_now_index:0,is_record_history:!0,max_record_times:10}),getters:{getTopBtnUndoStatus(r){return r.history_now_index>=1},getTopBtnRedoStatus(r){return r.history_now_index+1!=r.history_doneComponent.length}},actions:{topUndoBtnClick(){if(console.log("撤销"),this.history_now_index<1)return;const r=useGlobalStore();this.is_record_history=!1,this.history_now_index-=1,r.setDoneJson(this.history_doneComponent[this.history_now_index])},topRedoBtnClick(){if(console.log("重做"),this.history_now_index+1==this.history_doneComponent.length)return;const r=useGlobalStore();this.is_record_history=!1,this.history_now_index+=1,r.setDoneJson(this.history_doneComponent[this.history_now_index])}}}),useContextMenuStore=pinia$1.defineStore("context-menu-store",{state:()=>({display:!1,info:{[EContextMenuInfoType.Copy]:{title:"复制",hot_key:"Ctrl + c",enable:!0},[EContextMenuInfoType.Delete]:{title:"删除",hot_key:"Delete",enable:!0},[EContextMenuInfoType.MoveUpTopLevel]:{title:"置于顶层",hot_key:"Ctrl + →",enable:!0},[EContextMenuInfoType.MoveDownTopLevel]:{title:"置于底层",hot_key:"Ctrl + ←",enable:!0},[EContextMenuInfoType.MoveUpOneLevel]:{title:"置于上一层",hot_key:"Ctrl + ↑",enable:!0},[EContextMenuInfoType.MoveDownOneLevel]:{title:"置于下一层",hot_key:"Ctrl + ↓",enable:!0}}}),actions:{onContextMenuClick(r){const n=useGlobalStore();if(n.handle_svg_info)switch(n.intention=EGlobalStoreIntention.Select,r){case EContextMenuInfoType.Copy:const i=objectDeepClone(n.handle_svg_info.info);i.id=randomString(),i.title+="-copy",i.x+=10,i.y+=10,n.setDoneJson(i),this.display=!1,n.setHandleSvgInfo(i,n.done_json.length);break;case EContextMenuInfoType.Delete:n.spliceDoneJson(n.handle_svg_info.index),this.display=!1,n.setHandleSvgInfo(null),n.intention=EGlobalStoreIntention.None;break;case EContextMenuInfoType.MoveUpOneLevel:if(n.done_json.length===1||n.handle_svg_info.index===n.done_json.length-1)return;const o=n.handle_svg_info.info;n.done_json[n.handle_svg_info.index]=n.done_json[n.handle_svg_info.index+1],n.done_json[n.handle_svg_info.index+1]=o,useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(o,n.handle_svg_info.index+1);break;case EContextMenuInfoType.MoveDownOneLevel:if(n.done_json.length===1||n.handle_svg_info.index===0)return;const a=n.handle_svg_info.info;n.done_json[n.handle_svg_info.index]=n.done_json[n.handle_svg_info.index-1],n.done_json[n.handle_svg_info.index-1]=a,useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(a,n.handle_svg_info.index-1);break;case EContextMenuInfoType.MoveDownTopLevel:if(n.done_json.length===1||n.handle_svg_info.index===0)return;const u=n.handle_svg_info.info;n.done_json.splice(n.handle_svg_info.index,1),n.done_json.unshift(u),useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(u,0);break;case EContextMenuInfoType.MoveUpTopLevel:if(n.done_json.length===1||n.handle_svg_info.index===n.done_json.length)return;const c=n.handle_svg_info.info;n.done_json.splice(n.handle_svg_info.index,1),n.done_json.push(c),useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(c,n.done_json.length-1);break}}}}),pinia=pinia$1.createPinia(),useHistoryRecord=r=>{const n=useEditPrivateStore();n.is_record_history&&(n.history_now_index+1<n.history_doneComponent.length&&n.history_doneComponent.splice(n.history_now_index+1),n.history_doneComponent.push(r),n.history_now_index=n.history_doneComponent.length-1,n.history_doneComponent.length>n.max_record_times&&(n.history_doneComponent.shift(),n.history_now_index=n.history_doneComponent.length-1)),n.is_record_history=!0},useImportDataModel=r=>{try{const n=JSON.parse(r);if(!n.config||!n.layout_center||!n.done_json)return elementPlus.ElMessage.error("请导入正确的数据模型!"),!1;const i=useGlobalStore(pinia),o=useSvgEditLayoutStore(pinia),a=useConfigStore(pinia);return a.$state=n.config,o.center_offset=n.layout_center,i.setDoneJson(n.done_json),!0}catch(n){return elementPlus.ElMessage.error("请导入正确的数据模型!"),console.error(n),!1}},_hoisted_1$i={"aria-hidden":"true"},_hoisted_2$f=["xlink:href"],_sfc_main$D=vue.defineComponent({__name:"svg-analysis",props:{name:{},props:{default:()=>({})}},setup(r){const n=r,i=vue.computed(()=>`#svg-${n.name}`);return(o,a)=>(vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$i,[vue.createElementVNode("use",vue.mergeProps({"xlink:href":vue.unref(i)},n.props),null,16,_hoisted_2$f)]))}});var EVisibleConfKey=(r=>(r.ImportJson="ImportJson",r.ExportJson="ExportJson",r.ImportFile="ImportFile",r))(EVisibleConfKey||{});const _withScopeId$2=r=>(vue.pushScopeId("data-v-62907637"),r=r(),vue.popScopeId(),r),_hoisted_1$h={class:"flex justify-between",style:{width:"100%"}},_hoisted_2$e={class:"flex items-center justify-between",style:{width:"250px"}},_hoisted_3$c=_withScopeId$2(()=>vue.createElementVNode("div",{class:"flex items-center"},[vue.createElementVNode("span",{class:"logo-title"},"Svg Editor")],-1)),_hoisted_4$8={class:"flex justify-between",style:{width:"calc(100% - 440px)"}},_hoisted_5$6={class:"flex items-center"},_hoisted_6$4={class:"flex items-center mr-20px"},_hoisted_7$4={class:"flex items-center",style:{width:"250px"}},_hoisted_8$4=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title",style:{"padding-top":"16px"}},"多选",-1)),_hoisted_9$4=_withScopeId$2(()=>vue.createElementVNode("div",null,"在画布空白区域按住鼠标左键可以框选(图形坐标在框选区域即判定被选中),也可以按住ctrl+鼠标左键点图形进行多选",-1)),_hoisted_10$3=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_11$2=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"拖动画布",-1)),_hoisted_12$2=_withScopeId$2(()=>vue.createElementVNode("div",null,"在画布空白区域按住右键可拖动画布,右侧面板‘图纸’栏可微调或重置位置",-1)),_hoisted_13$1=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_14$1=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"画布缩放",-1)),_hoisted_15$1=_withScopeId$2(()=>vue.createElementVNode("div",null,"在画布空白区使用鼠标滚轮或者右侧面板‘图纸’栏可控制画布缩放",-1)),_hoisted_16$2=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_17=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"标尺辅助线",-1)),_hoisted_18=_withScopeId$2(()=>vue.createElementVNode("div",null,"在标尺区域按住鼠标左键并拖动即可创建标尺辅助线,将标尺辅助线拖动到标尺区域即可删除标尺辅助线",-1)),_hoisted_19=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_20=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"组件尺寸",-1)),_hoisted_21=_withScopeId$2(()=>vue.createElementVNode("div",null,[vue.createElementVNode("p",null," 大多数组件可以通过选中组件然后拖动交互点或在右侧‘外观’栏改变外形尺寸,或通过右侧‘数据’栏直接或间接改变外形尺寸;"),vue.createElementVNode("p",null,"少数特殊组件仅可通过右侧'数据'栏直接或间接改变外形尺寸")],-1)),_hoisted_22$1=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_23=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"连线样式",-1)),_hoisted_24=_withScopeId$2(()=>vue.createElementVNode("div",null,"在右侧‘连线’栏可以统一配置连线样式,配置后先增加的线会应用新样式,之前的线样式不变,如需改变,可选中线手动更改或删除重画 ",-1)),_hoisted_25=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_26$1=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"横线和竖线",-1)),_hoisted_27=_withScopeId$2(()=>vue.createElementVNode("div",{class:"guide-text"},[vue.createElementVNode("p",null," 点击编辑器顶部连线按钮会进入连线状态,该状态下在画板点击鼠标左键即可开始画线,移动并再次点击左键创建新的节点,右键结束画线并退出连线状态;"),vue.createElementVNode("p",null,"画线的时候按住ctrl即可画竖线,按住shift即可画横线")],-1)),_hoisted_28=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_29=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"绑定锚点",-1)),_hoisted_30=_withScopeId$2(()=>vue.createElementVNode("div",{class:"guide-text"},[vue.createElementVNode("p",null,"组件在未选中时,鼠标经过组件时会出现锚点,鼠标悬浮在锚点上时,会有交互样式,点击左键即可以锚点为起点创建连线;"),vue.createElementVNode("p",null,"同样,在连线时鼠标经过锚点时,会出现锚点交互样式,点击左键即可以锚点为连线终点结束连线;"),vue.createElementVNode("p",null,"这两种情况下的连线会绑定组件上的锚点,如需解绑,参考下面的‘锚点解绑’;"),vue.createElementVNode("p",null,"同样,也可先画线,再选中连线绑定想要绑定的组件锚点(连线只有首尾节点可以绑定锚点)")],-1)),_hoisted_31=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_32$1=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"线段选中",-1)),_hoisted_33=_withScopeId$2(()=>vue.createElementVNode("div",null," 若线段绑定了锚点,移动线段,绑定的锚点不会移动。若是想将线段整体移动,需要先解绑,参考下面的‘锚点解绑’ ",-1)),_hoisted_34=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_35=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"锚点解绑",-1)),_hoisted_36$1=_withScopeId$2(()=>vue.createElementVNode("div",{style:{"padding-bottom":"14px"}}," 选中线段,在右侧‘数据’栏里解除绑定;或者鼠标左键拖拽连线上需要解绑的节点",-1)),_sfc_main$C=vue.defineComponent({__name:"top-panel",emits:["changeVisible","onReturn","onPreview","onSave"],setup(r,{emit:n}){const i=useSvgEditLayoutStore(pinia),o=useGlobalStore(pinia),a=useEditPrivateStore(pinia),u=useConfigStore(pinia),c=()=>{o.done_json.length<=0||o.setDoneJson([]),o.intention=EGlobalStoreIntention.None},f=v=>{const g={layout_center:i.center_offset,config:u.$state,done_json:o.done_json};n(v,g)},d=vue.ref(!1),h=vue.computed({get:()=>o.intention===EGlobalStoreIntention.Connection,set(v){o.intention=v?EGlobalStoreIntention.Connection:EGlobalStoreIntention.None,v&&o.setHandleSvgInfo(null)}});return(v,g)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",_hoisted_1$h,[vue.createElementVNode("div",_hoisted_2$e,[_hoisted_3$c,vue.createVNode(vue.unref(elementPlus.ElIcon),{size:24,class:"bt-Icon",onClick:g[0]||(g[0]=p=>vue.unref(i).left_nav=!vue.unref(i).left_nav),title:vue.unref(i).left_nav?"隐藏左侧菜单":"显示左侧菜单"},{default:vue.withCtx(()=>[vue.unref(i).left_nav?(vue.openBlock(),vue.createBlock(_sfc_main$D,{key:0,name:"menu-unfold"})):(vue.openBlock(),vue.createBlock(_sfc_main$D,{key:1,name:"menu-fold"}))]),_:1},8,["title"])]),vue.createElementVNode("div",_hoisted_4$8,[vue.createElementVNode("div",_hoisted_5$6,[vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"撤销 ctrl+z",size:24,class:vue.normalizeClass(`${vue.unref(a).getTopBtnUndoStatus?"bt-Icon":"icon-disable"} ml-20px`),onClick:g[1]||(g[1]=()=>vue.unref(a).topUndoBtnClick())},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:vue.unref(a).getTopBtnUndoStatus?"undo":"undo-gray"},null,8,["name"])]),_:1},8,["class"]),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"重做 ctrl+shift+z",class:vue.normalizeClass(`${vue.unref(a).getTopBtnRedoStatus?"bt-Icon":"icon-disable"} ml-5px`),size:24,onClick:g[2]||(g[2]=()=>vue.unref(a).topRedoBtnClick())},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:vue.unref(a).getTopBtnRedoStatus?"redo":"redo-gray"},null,8,["name"])]),_:1},8,["class"]),vue.createVNode(vue.unref(elementPlus.ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"清空 ctrl+delete",class:vue.normalizeClass(vue.unref(o).done_json.length>0?"bt-Icon":"icon-disable"),size:24,onClick:c},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:vue.unref(o).done_json.length>0?"delete":"delete-gray"},null,8,["name"])]),_:1},8,["class"]),vue.createVNode(vue.unref(elementPlus.ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"导入数据模型",class:"bt-Icon",size:24,onClick:g[3]||(g[3]=p=>n("changeVisible",vue.unref(EVisibleConfKey).ImportJson,!0))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"import"})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"导出数据模型",size:24,class:"bt-Icon ml-5px",onClick:g[4]||(g[4]=p=>n("changeVisible",vue.unref(EVisibleConfKey).ExportJson,!0))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"export"})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"创建连线",class:vue.normalizeClass(["bt-Icon",{active:vue.unref(h)}]),size:24,onClick:g[5]||(g[5]=p=>h.value=!vue.unref(h))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:vue.unref(h)?"line-active":"line"},null,8,["name"])]),_:1},8,["class"]),vue.createVNode(vue.unref(elementPlus.ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"说明",class:"bt-Icon",size:24,onClick:g[6]||(g[6]=p=>d.value=!vue.unref(d))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"question"})]),_:1})]),vue.createElementVNode("div",_hoisted_6$4,[vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"返回",class:"bt-Icon",size:24,onClick:g[7]||(g[7]=p=>f("onReturn"))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"return"})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"保存",class:"bt-Icon",size:24,onClick:g[8]||(g[8]=p=>f("onSave"))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"save"})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"预览",class:"bt-Icon",size:22,onClick:g[9]||(g[9]=p=>f("onPreview"))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"preview"})]),_:1})])]),vue.createElementVNode("div",_hoisted_7$4,[vue.createVNode(vue.unref(elementPlus.ElIcon),{size:24,class:"bt-Icon",onClick:g[10]||(g[10]=p=>vue.unref(i).right_nav=!vue.unref(i).right_nav),title:vue.unref(i).right_nav?"隐藏右侧菜单":"显示右侧菜单"},{default:vue.withCtx(()=>[vue.unref(i).right_nav?(vue.openBlock(),vue.createBlock(_sfc_main$D,{key:0,name:"menu-fold"})):(vue.openBlock(),vue.createBlock(_sfc_main$D,{key:1,name:"menu-unfold"}))]),_:1},8,["title"])])]),vue.createVNode(vue.unref(elementPlus.ElDialog),{modelValue:vue.unref(d),"onUpdate:modelValue":g[11]||(g[11]=p=>vue.isRef(d)?d.value=p:null),title:"使用说明",width:"60%",class:"guide-dialog"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElScrollbar),{"max-height":"60vh"},{default:vue.withCtx(()=>[_hoisted_8$4,_hoisted_9$4,_hoisted_10$3,_hoisted_11$2,_hoisted_12$2,_hoisted_13$1,_hoisted_14$1,_hoisted_15$1,_hoisted_16$2,_hoisted_17,_hoisted_18,_hoisted_19,_hoisted_20,_hoisted_21,_hoisted_22$1,_hoisted_23,_hoisted_24,_hoisted_25,_hoisted_26$1,_hoisted_27,_hoisted_28,_hoisted_29,_hoisted_30,_hoisted_31,_hoisted_32$1,_hoisted_33,_hoisted_34,_hoisted_35,_hoisted_36$1]),_:1})]),_:1},8,["modelValue"])],64))}}),topPanel_vue_vue_type_style_index_0_scoped_62907637_lang="",topPanel_vue_vue_type_style_index_1_lang="",TopPanel=_export_sfc$1(_sfc_main$C,[["__scopeId","data-v-62907637"]]),_hoisted_1$g={class:"component-group flex flex-wrap"},_hoisted_2$d=["onDragstart","title"],_sfc_main$B=vue.defineComponent({__name:"left-panel",props:{customToolbar:{}},setup(r){const n=r,i=useGlobalStore(pinia),o=vue.ref(n.customToolbar&&Object.keys(n.customToolbar).length>0?n.customToolbar:i.config_center),a=vue.ref(["stateful","stateless","have_animation","custom_svg_group","element-ui","custom-vue","echarts"]),u=d=>{i.setCreateInfo(c(d))},c=d=>(d!=null&&d.props&&!lodashEs.isEmpty(d.props)&&Object.keys(d.props).forEach((h,v)=>{d.props[h].sort=String(v)}),d),f=d=>{var h;if(((h=d.dataTransfer)==null?void 0:h.dropEffect)!=="copy"){elementPlus.ElMessage.warning("请将组件拖到画布中!"),i.intention=EGlobalStoreIntention.None;return}};return(d,h)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(elementPlus.ElCollapse),{modelValue:vue.unref(a),"onUpdate:modelValue":h[0]||(h[0]=v=>vue.isRef(a)?a.value=v:null),style:{"border-top":"none"}},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(o),v=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElCollapseItem),{name:v.groupType,key:v.title},{title:vue.withCtx(()=>[vue.createElementVNode("div",null,vue.toDisplayString(v.title),1)]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$g,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(v.list,g=>(vue.openBlock(),vue.createElementBlock("div",{class:"ideal",key:g.name,draggable:"true",onDragstart:p=>u(g),onDragend:f,title:g.title},[vue.createVNode(vue.unref(elementPlus.ElIcon),{size:35,class:"flex items-center"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:g.name,props:vue.unref(prosToVBind)(g,["width","height","maxHeight"])},null,8,["name","props"])]),_:2},1024)],40,_hoisted_2$d))),128))])]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"])]))}}),leftPanel_vue_vue_type_style_index_0_scoped_8aba8565_lang="",LeftPanel=_export_sfc$1(_sfc_main$B,[["__scopeId","data-v-8aba8565"]]),calculateLeftTop=(r,n,i)=>{const o=getCenterPoint(r,n),a=calculateRotatedPointCoordinate(r,o,-i),u=calculateRotatedPointCoordinate(n,o,-i);return{width:u.x-a.x,height:u.y-a.y,is_old_width:!1,is_old_height:!1}},calculateRightTop=(r,n,i)=>{const o=getCenterPoint(r,n),a=calculateRotatedPointCoordinate(r,o,-i),u=calculateRotatedPointCoordinate(n,o,-i);return{width:a.x-u.x,height:u.y-a.y,is_old_width:!1,is_old_height:!1}},calculateRightBottom=(r,n,i)=>{const o=getCenterPoint(r,n),a=calculateRotatedPointCoordinate(n,o,-i),u=calculateRotatedPointCoordinate(r,o,-i);return{width:u.x-a.x,height:u.y-a.y,is_old_width:!1,is_old_height:!1}},calculateLeftBottom=(r,n,i)=>{const o=getCenterPoint(r,n),a=calculateRotatedPointCoordinate(n,o,-i),u=calculateRotatedPointCoordinate(r,o,-i);return{width:a.x-u.x,height:u.y-a.y,is_old_width:!1,is_old_height:!1}},calculateTop=(r,n,i,o)=>{const a=calculateRotatedPointCoordinate(r,o,-i),u=calculateRotatedPointCoordinate({x:o.x,y:a.y},o,i),c=Math.sqrt((u.x-n.x)**2+(u.y-n.y)**2);return{width:1,height:Math.round(c),is_old_width:!0,is_old_height:!1}},calculateRight=(r,n,i,o)=>{const a=calculateRotatedPointCoordinate(r,o,-i),u=calculateRotatedPointCoordinate({x:a.x,y:o.y},o,i),c=Math.sqrt((u.x-n.x)**2+(u.y-n.y)**2);return{width:Math.round(c),height:1,is_old_width:!1,is_old_height:!0}},calculateBottom=(r,n,i,o)=>{const a=calculateRotatedPointCoordinate(r,o,-i),u=calculateRotatedPointCoordinate({x:o.x,y:a.y},o,i),c=Math.sqrt((u.x-n.x)**2+(u.y-n.y)**2);return{width:1,height:Math.round(c),is_old_width:!0,is_old_height:!1}},calculateLeft=(r,n,i,o)=>{const a=calculateRotatedPointCoordinate(r,o,-i),u=calculateRotatedPointCoordinate({x:a.x,y:o.y},o,i),c=Math.sqrt((u.x-n.x)**2+(u.y-n.y)**2);return{width:Math.round(c),height:1,is_old_width:!1,is_old_height:!0}},_hoisted_1$f={style:{"vector-effect":"non-scaling-stroke"}},_hoisted_2$c=["fill","x","y"],_hoisted_3$b=["cx","cy"],_hoisted_4$7=["x1","y1","x2","y2"],_hoisted_5$5=["fill","x","y"],_hoisted_6$3=["fill","x","y"],_hoisted_7$3=["fill","x","y"],_hoisted_8$3=["fill","x","y"],_hoisted_9$3=["fill","x","y"],_hoisted_10$2=["fill","x","y"],_hoisted_11$1=["fill","x","y"],_sfc_main$A=vue.defineComponent({__name:"handle-panel",props:{itemInfo:{}},setup(r){const n=r;vue.useCssVars(p=>({"5c831aea":vue.unref(c)}));const i=useGlobalStore(pinia),o=useConfigStore(pinia),a=useSvgEditLayoutStore(pinia),u=vue.ref(4),c=vue.ref("#ab712e"),f=[{start:338,end:23,cursor:"nw",type:EScaleInfoType.TopLeft},{start:23,end:68,cursor:"n",type:EScaleInfoType.TopCenter},{start:68,end:113,cursor:"ne",type:EScaleInfoType.TopRight},{start:293,end:338,cursor:"w",type:EScaleInfoType.Left},{start:113,end:158,cursor:"e",type:EScaleInfoType.Right},{start:248,end:293,cursor:"sw",type:EScaleInfoType.BottomLeft},{start:203,end:248,cursor:"s",type:EScaleInfoType.BottomCenter},{start:158,end:203,cursor:"se",type:EScaleInfoType.BottomRight}],d=vue.computed(()=>n.itemInfo.config.can_zoom),h=(p,y)=>{console.log("handMousedown",y);const{clientX:_,clientY:b}=y;y.stopPropagation(),i.intention=EGlobalStoreIntention.Zoom;const A=Math.round((_-a.canvasInfo.left)/o.svg.scale-a.center_offset.x),w=Math.round((b-a.canvasInfo.top)/o.svg.scale-a.center_offset.y);i.mouse_info={state:EMouseInfoState.Down,position_x:A,position_y:w,now_position_x:A,now_position_y:w,new_position_x:0,new_position_y:0},i.scale_info={type:p,scale_times:{x:n.itemInfo.scale_x,y:n.itemInfo.scale_y},scale_item_info:{x:n.itemInfo.x,y:n.itemInfo.y},symmetric_point:{x:A+Math.abs(A-n.itemInfo.center_position.x)*2*(A>n.itemInfo.center_position.x?-1:1),y:w+Math.abs(w-n.itemInfo.center_position.y)*2*(w>n.itemInfo.center_position.y?-1:1)}}},v=p=>{const{clientX:y,clientY:_}=p,b=Math.round((y-a.canvasInfo.left)/o.svg.scale-a.center_offset.x),A=Math.round((_-a.canvasInfo.top)/o.svg.scale-a.center_offset.y);p.stopPropagation(),i.intention=EGlobalStoreIntention.Rotate,i.rotate_info={angle:n.itemInfo.rotate},i.mouse_info={state:EMouseInfoState.Down,position_x:b,position_y:A,now_position_x:b,now_position_y:A,new_position_x:0,new_position_y:0}},g=p=>{const y=(p+n.itemInfo.rotate)%360,_=f.find(b=>b.start<=y&&b.end>y);return _?{cursor:_.cursor+"-resize",type:_.type}:{cursor:"nw-resize",type:EScaleInfoType.TopLeft}};return(p,y)=>(vue.openBlock(),vue.createElementBlock("g",_hoisted_1$f,[vue.withDirectives(vue.createElementVNode("rect",{id:"resize_tl",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(0).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[0]||(y[0]=_=>h(vue.unref(EScaleInfoType).TopLeft,_))},null,44,_hoisted_2$c),[[vue.vShow,vue.unref(d)]]),vue.createElementVNode("circle",{cx:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,cy:n.itemInfo.actual_bound.y-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)-24,r:4,class:"rotate-circle",onMousedown:v},null,40,_hoisted_3$b),vue.createElementVNode("line",{x1:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,y1:n.itemInfo.actual_bound.y-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),x2:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,y2:n.itemInfo.actual_bound.y-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)-20,style:vue.normalizeStyle({stroke:vue.unref(c),"stroke-width":2})},null,12,_hoisted_4$7),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_tc",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(45).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2-vue.unref(u),y:n.itemInfo.actual_bound.y-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[1]||(y[1]=_=>h(vue.unref(EScaleInfoType).TopCenter,_))},null,44,_hoisted_5$5),[[vue.vShow,vue.unref(d)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_tr",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(90).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width-vue.unref(u)+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[2]||(y[2]=_=>h(vue.unref(EScaleInfoType).TopRight,_))},null,44,_hoisted_6$3),[[vue.vShow,vue.unref(d)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_l",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(315).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(u)+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[3]||(y[3]=_=>h(vue.unref(EScaleInfoType).Left,_))},null,44,_hoisted_7$3),[[vue.vShow,vue.unref(d)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_r",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(135).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(u)+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(u)+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[4]||(y[4]=_=>h(vue.unref(EScaleInfoType).Right,_))},null,44,_hoisted_8$3),[[vue.vShow,vue.unref(d)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_bl",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(270).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(u)+n.itemInfo.actual_bound.height*n.itemInfo.scale_y-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[5]||(y[5]=_=>h(vue.unref(EScaleInfoType).BottomLeft,_))},null,44,_hoisted_9$3),[[vue.vShow,vue.unref(d)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_bc",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(225).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(u)+n.itemInfo.actual_bound.width/2,y:n.itemInfo.actual_bound.y-vue.unref(u)+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[6]||(y[6]=_=>h(vue.unref(EScaleInfoType).BottomCenter,_))},null,44,_hoisted_10$2),[[vue.vShow,vue.unref(d)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_br",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(180).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(u)+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(u)+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[7]||(y[7]=_=>h(vue.unref(EScaleInfoType).BottomRight,_))},null,44,_hoisted_11$1),[[vue.vShow,vue.unref(d)]])]))}}),handlePanel_vue_vue_type_style_index_0_scoped_e6622df8_lang="",HandlePanel=_export_sfc$1(_sfc_main$A,[["__scopeId","data-v-e6622df8"]]),_hoisted_1$e=["fill"],_hoisted_2$b=["cx","cy","r"],_hoisted_3$a=["cx","cy","r"],_hoisted_4$6=["cx","cy","r"],_hoisted_5$4=["cx","cy","r"],_hoisted_6$2=["cx","cy","r"],_hoisted_7$2=["cx","cy","r"],_hoisted_8$2=["cx","cy","r"],_hoisted_9$2=["cx","cy","r"],_sfc_main$z=vue.defineComponent({__name:"connection-panel",props:{itemInfo:{}},setup(r){const n=r,i=vue.ref(4),o=vue.ref("#ab712e"),a=vue.ref(4),u=vue.ref(12),c=useGlobalStore(pinia),f=useSvgEditLayoutStore(pinia),d=vue.computed(()=>n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2-i.value+a.value),h=vue.computed(()=>n.itemInfo.actual_bound.y-i.value-getCoordinateOffset(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+a.value),v=vue.computed(()=>n.itemInfo.actual_bound.x-i.value+n.itemInfo.actual_bound.width+getCoordinateOffset(n.itemInfo.actual_bound.width,n.itemInfo.scale_x)+a.value),g=vue.computed(()=>n.itemInfo.actual_bound.y-i.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-getCoordinateOffset(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+a.value),p=vue.computed(()=>n.itemInfo.actual_bound.x-i.value+n.itemInfo.actual_bound.width/2+a.value),y=vue.computed(()=>n.itemInfo.actual_bound.y-i.value+n.itemInfo.actual_bound.height+getCoordinateOffset(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+a.value),_=vue.computed(()=>n.itemInfo.actual_bound.x-i.value-getCoordinateOffset(n.itemInfo.actual_bound.width,n.itemInfo.scale_x)+a.value),b=vue.computed(()=>n.itemInfo.actual_bound.y-i.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-getCoordinateOffset(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+a.value),A=(T,S)=>{var x;c.intention===EGlobalStoreIntention.SetConnectionLineNode&&(T.stopPropagation(),(x=c.handle_svg_info)!=null&&x.info.bind_anchors&&c.connection_line_node_info&&(c.connection_line_node_info.point_index===0?c.handle_svg_info.info.bind_anchors.start={type:S,target_id:n.itemInfo.id}:c.connection_line_node_info.point_index===c.handle_svg_info.info.props.point_position.val.length-1&&(c.handle_svg_info.info.bind_anchors.end={type:S,target_id:n.itemInfo.id}),c.intention=EGlobalStoreIntention.None,c.setHandleSvgInfo(null),vue.nextTick(function(){moveAnchors(n.itemInfo)})))},w=(T,S)=>{var x;c.intention===EGlobalStoreIntention.None?(createLine(T,S,n.itemInfo),c.handle_svg_info&&(c.handle_svg_info.info.props.point_position.val.length!==1?c.handle_svg_info.info.props.point_position.val.push({x:c.mouse_info.new_position_x-c.mouse_info.position_x-f.center_offset.x,y:c.mouse_info.new_position_y-c.mouse_info.position_y-f.center_offset.y}):c.handle_svg_info.info.props.point_position.val.push({x:0,y:0}))):c.intention===EGlobalStoreIntention.Connection&&(T.stopPropagation(),(x=c.handle_svg_info)!=null&&x.info.bind_anchors&&(c.handle_svg_info.info.bind_anchors.end={type:S,target_id:n.itemInfo.id},c.intention=EGlobalStoreIntention.None,c.setHandleSvgInfo(null),vue.nextTick(function(){moveAnchors(n.itemInfo)})))};return(T,S)=>(vue.openBlock(),vue.createElementBlock("g",{style:{"vector-effect":"non-scaling-stroke"},class:"connect-points",fill:vue.unref(o),"stroke-width":"2",stroke:"rgba(0,0,0,0)"},[vue.createElementVNode("g",{onMousedown:S[0]||(S[0]=x=>w(x,vue.unref(ELineBindAnchors).TopCenter)),onMouseup:S[1]||(S[1]=x=>A(x,vue.unref(ELineBindAnchors).TopCenter))},[vue.createElementVNode("circle",{class:"out-circle",cx:vue.unref(d),cy:vue.unref(h),r:vue.unref(u),"fill-opacity":".3"},null,8,_hoisted_2$b),vue.createElementVNode("circle",{id:"connection_tc",cx:vue.unref(d),cy:vue.unref(h),r:vue.unref(a),"pointer-events":"all"},null,8,_hoisted_3$a)],32),vue.createElementVNode("g",{onMousedown:S[2]||(S[2]=x=>w(x,vue.unref(ELineBindAnchors).Right)),onMouseup:S[3]||(S[3]=x=>A(x,vue.unref(ELineBindAnchors).Right))},[vue.createElementVNode("circle",{class:"out-circle",cx:vue.unref(v),cy:vue.unref(g),r:vue.unref(u),"fill-opacity":".3"},null,8,_hoisted_4$6),vue.createElementVNode("circle",{id:"connection_r",cx:vue.unref(v),cy:vue.unref(g),r:vue.unref(a),"pointer-events":"all"},null,8,_hoisted_5$4)],32),vue.createElementVNode("g",{onMousedown:S[4]||(S[4]=x=>w(x,vue.unref(ELineBindAnchors).BottomCenter)),onMouseup:S[5]||(S[5]=x=>A(x,vue.unref(ELineBindAnchors).BottomCenter))},[vue.createElementVNode("circle",{class:"out-circle",cx:vue.unref(p),cy:vue.unref(y),r:vue.unref(u),"fill-opacity":".3"},null,8,_hoisted_6$2),vue.createElementVNode("circle",{id:"connection_bc",cx:vue.unref(p),cy:vue.unref(y),r:vue.unref(a),"pointer-events":"all"},null,8,_hoisted_7$2)],32),vue.createElementVNode("g",{onMousedown:S[6]||(S[6]=x=>w(x,vue.unref(ELineBindAnchors).Left)),onMouseup:S[7]||(S[7]=x=>A(x,vue.unref(ELineBindAnchors).Left))},[vue.createElementVNode("circle",{class:"out-circle",cx:vue.unref(_),cy:vue.unref(b),r:vue.unref(u),"fill-opacity":".3"},null,8,_hoisted_8$2),vue.createElementVNode("circle",{id:"connection_l",cx:vue.unref(_),cy:vue.unref(b),r:vue.unref(a),style:{cursor:"crosshair"},"pointer-events":"all"},null,8,_hoisted_9$2)],32)],8,_hoisted_1$e))}}),connectionPanel_vue_vue_type_style_index_0_scoped_fb729c7a_lang="",ConnectionPanel=_export_sfc$1(_sfc_main$z,[["__scopeId","data-v-fb729c7a"]]),_hoisted_1$d=["d","stroke-width"],_hoisted_2$a=["d","stroke-width"],_hoisted_3$9=["id","d","stroke","stroke-width","stroke-dasharray"],_hoisted_4$5=["from","to","dur","repeatCount"],_hoisted_5$3=["d","stroke","stroke-width","stroke-dasharray"],_hoisted_6$1=["from","to","dur","repeatCount"],_hoisted_7$1=["r","fill"],_hoisted_8$1=["path","dur","repeatCount"],_hoisted_9$1=["cx","cy","r","stroke-width"],_hoisted_10$1=["cx","cy","r","stroke","onMousedown"],_sfc_main$y=vue.defineComponent({__name:"connection-line",props:{itemInfo:{},pointVisible:{type:Boolean,default:!1}},setup(r){const n=r,i=useGlobalStore(pinia),o=useConfigStore(pinia),a=useSvgEditLayoutStore(pinia),u=(c,f,d,h)=>{if(i.intention===EGlobalStoreIntention.Connection)return;i.setHandleSvgInfo(n.itemInfo);const{clientX:v,clientY:g}=f;f.stopPropagation(),i.connection_line_node_info={init_pos:{x:d,y:h},point_index:c},i.intention=EGlobalStoreIntention.SetConnectionLineNode,i.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((v-a.canvasInfo.left)/o.svg.scale),position_y:Math.round((g-a.canvasInfo.top)/o.svg.scale),now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0}};return(c,f)=>{var d,h,v,g,p,y;return vue.openBlock(),vue.createElementBlock("g",{style:vue.normalizeStyle({cursor:vue.unref(i).intention===vue.unref(EGlobalStoreIntention).Connection?"crosshair":"move"})},[vue.withDirectives(vue.createElementVNode("path",{d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none","fill-opacity":"0",stroke:"#DE4517","stroke-width":Math.ceil(n.itemInfo.props["stroke-width"].val*1.2)+1,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,_hoisted_1$d),[[vue.vShow,n.itemInfo.selected||n.itemInfo.id===((d=vue.unref(i).handle_svg_info)==null?void 0:d.info.id)]]),vue.createElementVNode("path",{d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none","fill-opacity":"0",stroke:"#fff","stroke-opacity":".01","stroke-width":n.itemInfo.props["stroke-width"].val,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,_hoisted_2$a),vue.createElementVNode("path",{id:n.itemInfo.id,d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none",stroke:((h=n.itemInfo.animations)==null?void 0:h.type.val)===vue.unref(EConfigAnimationsType).Electricity?n.itemInfo.animations.color.val:n.itemInfo.props.stroke.val,"stroke-width":n.itemInfo.props["stroke-width"].val,"stroke-dashoffset":"0","stroke-dasharray":((v=n.itemInfo.animations)==null?void 0:v.type.val)===vue.unref(EConfigAnimationsType).Electricity?n.itemInfo.props["stroke-width"].val*3:0,"stroke-linejoin":"round"},[((g=n.itemInfo.animations)==null?void 0:g.type.val)===vue.unref(EConfigAnimationsType).Electricity?(vue.openBlock(),vue.createElementBlock("animate",{key:0,attributeName:"stroke-dashoffset",from:n.itemInfo.animations.reverse.val?0:1e3,to:n.itemInfo.animations.reverse.val?1e3:0,dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val},null,8,_hoisted_4$5)):vue.createCommentVNode("",!0)],8,_hoisted_3$9),((p=n.itemInfo.animations)==null?void 0:p.type.val)===vue.unref(EConfigAnimationsType).WaterDrop?(vue.openBlock(),vue.createElementBlock("path",{key:0,d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none","fill-opacity":"0",stroke:n.itemInfo.animations.color.val,"stroke-width":n.itemInfo.props["stroke-width"].val,"stroke-dasharray":n.itemInfo.props["stroke-width"].val*3,"stroke-dashoffset":"0","stroke-linecap":"round","stroke-linejoin":"round"},[vue.createElementVNode("animate",{attributeName:"stroke-dashoffset",from:n.itemInfo.animations.reverse.val?0:1e3,to:n.itemInfo.animations.reverse.val?1e3:0,dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val,fill:"freeze"},null,8,_hoisted_6$1)],8,_hoisted_5$3)):((y=n.itemInfo.animations)==null?void 0:y.type.val)===vue.unref(EConfigAnimationsType).Track?(vue.openBlock(),vue.createElementBlock("circle",{key:1,cx:"0",cy:"0",r:Math.ceil(n.itemInfo.props["stroke-width"].val*.6)+2,fill:n.itemInfo.animations.color.val},[vue.createElementVNode("animateMotion",{path:vue.unref(positionArrToPath)(n.itemInfo.animations.reverse.val?[...n.itemInfo.props.point_position.val].reverse():n.itemInfo.props.point_position.val),dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val},null,8,_hoisted_8$1)],8,_hoisted_7$1)):vue.createCommentVNode("",!0),vue.createElementVNode("g",null,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.itemInfo.props.point_position.val,(_,b)=>{var A;return vue.withDirectives((vue.openBlock(),vue.createElementBlock("circle",{key:b,cx:_.x,cy:_.y,r:n.itemInfo.props.point_r.val+1,fill:"none","fill-opacity":"0","stroke-width":Math.ceil(n.itemInfo.props.point_r.val*.2)+1,stroke:"#DE4517"},null,8,_hoisted_9$1)),[[vue.vShow,n.itemInfo.selected||n.itemInfo.id===((A=vue.unref(i).handle_svg_info)==null?void 0:A.info.id)]])}),128)),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.itemInfo.props.point_position.val,(_,b)=>(vue.openBlock(),vue.createElementBlock("circle",{key:b,cx:_.x,cy:_.y,r:n.itemInfo.props.point_r.val,"stroke-width":"1",stroke:n.itemInfo.props.stroke.val,fill:"#fff",style:{cursor:"pointer"},onMousedown:A=>u(b,A,_.x,_.y)},null,40,_hoisted_10$1))),128))])],4)}}}),_hoisted_1$c={id:"pattern_grid",patternUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20"},_hoisted_2$9=["stroke"],_hoisted_3$8=["stroke"],_hoisted_4$4=["stroke"],_hoisted_5$2=["stroke"],_hoisted_6={key:0,width:"100%",height:"100%",fill:"url(#pattern_grid)"},_hoisted_7=["transform"],_hoisted_8=["transform"],_hoisted_9=["transform","onMousedown","onMouseup","onMouseenter","onMouseleave","onContextmenu"],_hoisted_10=["xlink:href","width","height","id","transform"],_hoisted_11=["id"],_hoisted_12$1=["id","x1","y1","x2","y2"],_hoisted_13=["id"],_hoisted_14=["x","y","height","width"],_hoisted_15=["onClick"],_hoisted_16$1={class:"shortcut"},_sfc_main$x=vue.defineComponent({__name:"center-panel",props:{vueComp:{}},setup(r,{expose:n}){const i=r;vue.useCssVars(pe=>({"6831c8e2":vue.unref(g)}));const o=useGlobalStore(pinia),a=useConfigStore(pinia),u=useSvgEditLayoutStore(pinia),c=useEditPrivateStore(pinia),f=useContextMenuStore(pinia);componentsRegister(i.vueComp);const d=vue.ref(),h=vue.ref(),v={MoveCanvas:"grab",Rotate:"url('/src/assets/icons/rotate.svg'), auto",Connection:"crosshair",SetConnectionLineNode:"crosshair"},g=vue.computed(()=>Object.keys(v).indexOf(o.intention)>-1?v[o.intention]:"default"),p=vue.reactive({handle_panel:vue.computed(()=>o.intention===EGlobalStoreIntention.Select||o.intention===EGlobalStoreIntention.Zoom||o.intention===EGlobalStoreIntention.Rotate),connection_panel:!1,connection_line:!1,select_item:{info:null,index:-1}}),y=vue.ref({a:{x:0,y:0},b:{x:0,y:0}}),_=vue.computed(()=>o.intention===EGlobalStoreIntention.SelectArea&&y.value.b.x&&y.value.b.y?{with:Math.abs(y.value.b.x-y.value.a.x),height:Math.abs(y.value.b.y-y.value.a.y),x:y.value.a.x<y.value.b.x?y.value.a.x:y.value.b.x,y:y.value.a.y<y.value.b.y?y.value.a.y:y.value.b.y}:{with:0,height:0,x:0,y:0}),b=vue.computed(()=>{let pe=0;for(let Lt of o.done_json)Lt.selected&&pe++;return pe>0});let A=!1,w=!1;const T=pe=>{var Lt;if(o.intention!=EGlobalStoreIntention.None){if(o.intention==EGlobalStoreIntention.Create){if(!o.create_svg_info){console.error("要创建的数据获取失败");return}const _e=Math.floor(pe.offsetX/a.svg.scale-u.center_offset.x),Et=Math.floor(pe.offsetY/a.svg.scale-u.center_offset.y),Cn={id:randomString(),x:_e,y:Et,client:{x:_e,y:Et},scale_x:1,scale_y:1,rotate:0,actual_bound:{x:0,y:0,width:0,height:0},center_position:{x:0,y:0},point_coordinate:{tl:{x:0,y:0},tc:{x:0,y:0},tr:{x:0,y:0},l:{x:0,y:0},r:{x:0,y:0},bl:{x:0,y:0},bc:{x:0,y:0},br:{x:0,y:0}},selected:!1,...objectDeepClone(o.create_svg_info)};o.setDoneJson(Cn),o.setHandleSvgInfo(Cn,o.done_json.length),o.intention=EGlobalStoreIntention.None}(Lt=h.value)==null||Lt.focus()}},S=pe=>{pe.preventDefault()},x=pe=>{pe.preventDefault()},O=(pe,Lt,_e)=>{var Et,Cn,vn;if((Et=h.value)==null||Et.focus(),o.intention===EGlobalStoreIntention.Connection){_e.stopPropagation();return}if(_e.preventDefault(),_e.stopPropagation(),_e.ctrlKey&&_e.button===0)((Cn=o.handle_svg_info)!=null&&Cn.index||((vn=o.handle_svg_info)==null?void 0:vn.index)===0)&&(o.done_json[o.handle_svg_info.index].selected=!0,o.setHandleSvgInfo(null),o.intention=EGlobalStoreIntention.None),pe.selected=!pe.selected;else if(b.value){o.intention=EGlobalStoreIntention.GroupMove,o.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((_e.clientX-u.canvasInfo.left)/a.svg.scale),position_y:Math.round((_e.clientY-u.canvasInfo.top)/a.svg.scale),now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0};for(let Dt of o.done_json)Dt.selected&&(Dt.old_position={x:Dt.x,y:Dt.y},Dt.point_coordinate_old=objectDeepClone(Dt.point_coordinate))}else o.intention=EGlobalStoreIntention.Select,o.setHandleSvgInfo(pe,Lt),o.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((_e.clientX-u.canvasInfo.left)/a.svg.scale),position_y:Math.round((_e.clientY-u.canvasInfo.top)/a.svg.scale),now_position_x:pe.x,now_position_y:pe.y,new_position_x:0,new_position_y:0},pe.point_coordinate_old=objectDeepClone(pe.point_coordinate)},L=(pe,Lt,_e)=>{if(!(o.intention===EGlobalStoreIntention.Connection||o.mouse_info.state!=EMouseInfoState.Down)&&b.value&&!A&&["SelectArea","Move","Select"].indexOf(o.intention)<0){for(let Et of o.done_json)Et.selected=!1,Et.old_position={x:0,y:0},resetHandlePointOld(Et);o.intention=EGlobalStoreIntention.Select,o.setHandleSvgInfo(pe,Lt),o.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((_e.clientX-u.canvasInfo.left)/a.svg.scale),position_y:Math.round((_e.clientY-u.canvasInfo.top)/a.svg.scale),now_position_x:pe.x,now_position_y:pe.y,new_position_x:0,new_position_y:0}}},M=(pe,Lt,_e)=>{_e.preventDefault(),_e.stopPropagation(),p.connection_panel=!0,p.connection_line=!0,!((o.intention===EGlobalStoreIntention.Connection||o.intention===EGlobalStoreIntention.SetConnectionLineNode)&&pe.type===EDoneJsonType.ConnectionLine)&&(p.select_item.info=pe,p.select_item.index=Lt)},re=(pe,Lt,_e)=>{_e.preventDefault(),_e.stopPropagation(),!((o.intention===EGlobalStoreIntention.Connection||o.intention===EGlobalStoreIntention.SetConnectionLineNode)&&pe.type===EDoneJsonType.ConnectionLine)&&(p.connection_panel=!1,p.connection_line=!1,p.select_item.info=null,p.select_item.index=-1)},F=pe=>{var vn,Dt,de,qe,Pt,In,$e,Ce,ue,At,Ne,Oe,kt,jt,_n,ie;if(o.mouse_info.state!=EMouseInfoState.Down&&o.intention!==EGlobalStoreIntention.Connection)return;const{clientX:Lt,clientY:_e}=pe;o.mouse_info.new_position_x=Math.round((Lt-u.canvasInfo.left)/a.svg.scale),o.mouse_info.new_position_y=Math.round((_e-u.canvasInfo.top)/a.svg.scale);const Et=Math.round(o.mouse_info.new_position_x-o.mouse_info.position_x+o.mouse_info.now_position_x),Cn=Math.round(o.mouse_info.new_position_y-o.mouse_info.position_y+o.mouse_info.now_position_y);if((vn=o.handle_svg_info)!=null&&vn.info&&(o.intention===EGlobalStoreIntention.Select||o.intention===EGlobalStoreIntention.Move)){if(o.handle_svg_info.info.x=Et,o.handle_svg_info.info.y=Cn,o.handle_svg_info.info.client={x:Et,y:Cn},o.intention=EGlobalStoreIntention.Move,moveHandlePoint(o.handle_svg_info.info),moveAnchors(o.handle_svg_info.info),o.handle_svg_info.info.type===EDoneJsonType.ConnectionLine){if((Dt=o.handle_svg_info.info.bind_anchors)!=null&&Dt.start){let ae=null;for(let Y of o.done_json)Y.id===((qe=(de=o.handle_svg_info.info.bind_anchors)==null?void 0:de.start)==null?void 0:qe.target_id)&&(ae=Y);ae&&moveAnchors(ae)}if((Pt=o.handle_svg_info.info.bind_anchors)!=null&&Pt.end){let ae=null;for(let Y of o.done_json)Y.id===(($e=(In=o.handle_svg_info.info.bind_anchors)==null?void 0:In.end)==null?void 0:$e.target_id)&&(ae=Y);ae&&moveAnchors(ae)}}}else if(o.intention===EGlobalStoreIntention.MoveCanvas)u.center_offset.x=Et,u.center_offset.y=Cn;else if(o.intention===EGlobalStoreIntention.SelectArea)y.value.b.x=o.mouse_info.new_position_x-u.center_offset.x,y.value.b.y=o.mouse_info.new_position_y-u.center_offset.y;else if(o.intention===EGlobalStoreIntention.GroupMove){A=!0;for(let ae of o.done_json)if(ae.selected&&ae.old_position){const Y=Math.round(o.mouse_info.new_position_x-o.mouse_info.position_x+ae.old_position.x),k=Math.round(o.mouse_info.new_position_y-o.mouse_info.position_y+ae.old_position.y);if(ae.x=Y,ae.y=k,ae.client={x:Y,y:k},moveHandlePoint(ae),moveAnchors(ae),ae.type===EDoneJsonType.ConnectionLine&&((Ce=ae.bind_anchors)!=null&&Ce.end)){let D=null;for(let oe of o.done_json)oe.id===((At=(ue=ae.bind_anchors)==null?void 0:ue.end)==null?void 0:At.target_id)&&(D=oe);D&&moveAnchors(D)}}}else if(o.intention===EGlobalStoreIntention.Zoom){if(!o.handle_svg_info)return;const ae={x:o.mouse_info.new_position_x-u.center_offset.x,y:o.mouse_info.new_position_y-u.center_offset.y};let Y={width:0,height:0,is_old_width:!1,is_old_height:!1};if(o.scale_info.type===EScaleInfoType.TopLeft?Y=calculateLeftTop(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate):o.scale_info.type===EScaleInfoType.TopRight?Y=calculateRightTop(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate):o.scale_info.type===EScaleInfoType.BottomRight?Y=calculateRightBottom(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate):o.scale_info.type===EScaleInfoType.BottomLeft?Y=calculateLeftBottom(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate):o.scale_info.type===EScaleInfoType.TopCenter?Y=calculateTop(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate,o.handle_svg_info.info.client):o.scale_info.type===EScaleInfoType.Right?Y=calculateRight(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate,o.handle_svg_info.info.client):o.scale_info.type===EScaleInfoType.BottomCenter?Y=calculateBottom(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate,o.handle_svg_info.info.client):o.scale_info.type===EScaleInfoType.Left&&(Y=calculateLeft(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate,o.handle_svg_info.info.client)),o.handle_svg_info&&Y.width>0&&Y.height>0){const k=Y.is_old_width?1:parseFloat((Y.width/o.handle_svg_info.info.actual_bound.width).toFixed(3)),D=Y.is_old_height?1:parseFloat((Y.height/o.handle_svg_info.info.actual_bound.height).toFixed(3)),oe=getCenterPoint(ae,o.scale_info.symmetric_point);k>0&&o.scale_info.type!==EScaleInfoType.TopCenter&&o.scale_info.type!==EScaleInfoType.BottomCenter&&(o.handle_svg_info.info.scale_x=k,o.handle_svg_info.info.x=Math.round(getSvgNowPosition(o.handle_svg_info.info.center_position.x,oe.x,o.handle_svg_info.info.client.x))),D>0&&o.scale_info.type!==EScaleInfoType.Left&&o.scale_info.type!==EScaleInfoType.Right&&(o.handle_svg_info.info.scale_y=D,o.handle_svg_info.info.y=Math.round(getSvgNowPosition(o.handle_svg_info.info.center_position.y,oe.y,o.handle_svg_info.info.client.y)))}}else if(o.intention===EGlobalStoreIntention.Rotate){if(!o.handle_svg_info)return;const ae=Math.atan2(o.mouse_info.position_y-o.handle_svg_info.info.y,o.mouse_info.position_x-o.handle_svg_info.info.x)/(Math.PI/180),Y=Math.atan2(o.mouse_info.new_position_y-u.center_offset.y-o.handle_svg_info.info.y,o.mouse_info.new_position_x-u.center_offset.x-o.handle_svg_info.info.x)/(Math.PI/180);o.handle_svg_info.info.rotate=parseFloat((o.rotate_info.angle+Y-ae).toFixed(2))}else if(o.intention===EGlobalStoreIntention.Connection&&o.handle_svg_info){const ae=(Ne=o.handle_svg_info)==null?void 0:Ne.info.props.point_position.val.length,Y=o.mouse_info.new_position_x-o.mouse_info.position_x-u.center_offset.x,k=o.mouse_info.new_position_y-o.mouse_info.position_y-u.center_offset.y,D=o.handle_svg_info.info.props.point_position.val[ae-2],oe=((kt=(Oe=o.handle_svg_info)==null?void 0:Oe.info.props.point_r)==null?void 0:kt.val)+2||4;let xe=D.x<Y?-oe:D.x>Y?oe:0,ze=D.y<k?-oe:D.y>k?oe:0;pe.ctrlKey?o.handle_svg_info.info.props.point_position.val[ae-1]={x:D.x,y:k+ze}:pe.shiftKey?o.handle_svg_info.info.props.point_position.val[ae-1]={x:Y+xe,y:D.y}:o.handle_svg_info.info.props.point_position.val[ae-1]={x:Y+xe,y:k+ze}}else if(o.intention===EGlobalStoreIntention.SetConnectionLineNode&&o.handle_svg_info){!w&&(o.connection_line_node_info.point_index===o.handle_svg_info.info.props.point_position.val.length-1||o.connection_line_node_info.point_index===0)&&(w=!0);const ae=(jt=o.handle_svg_info)==null?void 0:jt.info.props.point_position.val.length,Y=getSvgNowPosition(o.mouse_info.position_x,o.mouse_info.new_position_x,o.connection_line_node_info.init_pos.x),k=getSvgNowPosition(o.mouse_info.position_y,o.mouse_info.new_position_y,o.connection_line_node_info.init_pos.y),D=o.handle_svg_info.info.props.point_position.val[ae-2],oe=((ie=(_n=o.handle_svg_info)==null?void 0:_n.info.props.point_r)==null?void 0:ie.val)+2||4;let xe=D.x<Y?-oe:D.x>Y?oe:0,ze=D.y<k?-oe:D.y>k?oe:0;o.handle_svg_info.info.props.point_position.val[o.connection_line_node_info.point_index]={x:Y+xe,y:k+ze}}},j=()=>{var pe,Lt,_e,Et;if(o.mouse_info.state==EMouseInfoState.Down){if((pe=o.handle_svg_info)!=null&&pe.info&&o.intention==EGlobalStoreIntention.Move)setSvgActualInfo(o.done_json[o.handle_svg_info.index]),o.intention=EGlobalStoreIntention.None,o.setDoneJson(o.done_json);else if(o.intention==EGlobalStoreIntention.GroupMove)A&&(A=!1,o.intention=EGlobalStoreIntention.None);else if((Lt=o.handle_svg_info)!=null&&Lt.info&&o.intention==EGlobalStoreIntention.Zoom)o.handle_svg_info.info.client={x:o.handle_svg_info.info.x,y:o.handle_svg_info.info.y},o.intention=EGlobalStoreIntention.None,setSvgActualInfo(o.done_json[o.handle_svg_info.index]),o.setDoneJson(o.done_json);else if(o.intention===EGlobalStoreIntention.Rotate&&((_e=o.handle_svg_info)!=null&&_e.info))setSvgActualInfo(o.done_json[o.handle_svg_info.index]),o.setDoneJson(o.done_json),o.intention=EGlobalStoreIntention.None;else{if(o.intention===EGlobalStoreIntention.Connection)return;if(o.intention===EGlobalStoreIntention.SetConnectionLineNode)w&&((Et=o.handle_svg_info)!=null&&Et.info.bind_anchors)&&(o.connection_line_node_info.point_index===0?o.handle_svg_info.info.bind_anchors.start=null:o.handle_svg_info.info.bind_anchors.end=null),o.intention=EGlobalStoreIntention.None,w=!1;else if(o.intention===EGlobalStoreIntention.SelectArea){o.setHandleSvgInfo(null);for(let Cn of o.done_json){const vn=_.value;Cn.selected=Cn.x>vn.x&&Cn.x<vn.x+vn.with&&Cn.y>vn.y&&Cn.y<vn.y+vn.height}o.intention=EGlobalStoreIntention.None}else o.intention!=EGlobalStoreIntention.Select&&(o.intention=EGlobalStoreIntention.None)}o.mouse_info={state:EMouseInfoState.Up,position_x:0,position_y:0,now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0},f.display=!1}},V=pe=>{const{clientX:Lt,clientY:_e}=pe;if(o.intention===EGlobalStoreIntention.Connection){o.handle_svg_info||createLine(pe),o.handle_svg_info&&(pe.button===0?o.handle_svg_info.info.props.point_position.val.length!==1?o.handle_svg_info.info.props.point_position.val.push({x:o.mouse_info.new_position_x-o.mouse_info.position_x-u.center_offset.x,y:o.mouse_info.new_position_y-o.mouse_info.position_y-u.center_offset.y}):o.handle_svg_info.info.props.point_position.val.push({x:0,y:0}):pe.button===2&&(o.intention=EGlobalStoreIntention.None,setSvgActualInfo(o.done_json[o.handle_svg_info.index]),o.setHandleSvgInfo(null)));return}pe.button===0?(o.intention=EGlobalStoreIntention.SelectArea,o.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((Lt-u.canvasInfo.left)/a.svg.scale-u.center_offset.x),position_y:Math.round((_e-u.canvasInfo.top)/a.svg.scale-u.center_offset.y),now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0},y.value={a:{x:o.mouse_info.position_x,y:o.mouse_info.position_y},b:{x:0,y:0}}):pe.button===2&&(o.intention=EGlobalStoreIntention.MoveCanvas,o.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((Lt-u.canvasInfo.left)/a.svg.scale),position_y:Math.round((_e-u.canvasInfo.top)/a.svg.scale),now_position_x:u.center_offset.x,now_position_y:u.center_offset.y,new_position_x:0,new_position_y:0})};function z(pe){pe!=null&&pe.wheelDelta&&(pe.wheelDelta>0?a.svg.scale=parseFloat((a.svg.scale+.1).toFixed(1)):a.svg.scale=parseFloat((a.svg.scale-.1).toFixed(1)))}const $=pe=>{pe.stopPropagation(),pe.preventDefault()},he=(pe,Lt,_e)=>{o.intention!==EGlobalStoreIntention.Connection&&d.value&&(o.intention=EGlobalStoreIntention.ContextMenu,o.setHandleSvgInfo(pe,Lt),d.value.style.left=_e.pageX+"px",d.value.style.top=_e.pageY+"px",f.info.MoveUpOneLevel.enable=f.info.MoveUpTopLevel.enable=f.info.MoveDownOneLevel.enable=f.info.MoveDownTopLevel.enable=!0,Lt===o.done_json.length-1&&(f.info.MoveUpOneLevel.enable=f.info.MoveUpTopLevel.enable=!1),Lt===0&&(f.info.MoveDownOneLevel.enable=f.info.MoveDownTopLevel.enable=!1),f.display=!0)},le=(pe,Lt,_e)=>({x:parseFloat((pe.x-pe.width/2*Lt+pe.width/2).toFixed(1)),y:parseFloat((pe.y-pe.height/2*_e+pe.height/2).toFixed(1)),width:parseFloat((pe.width*Lt).toFixed(1)),height:parseFloat((pe.height*_e).toFixed(1))}),Ie=pe=>{pe.preventDefault();let Lt=[];if(!pe.ctrlKey&&["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].indexOf(pe.key)>-1&&(b.value?Lt=o.done_json.map((_e,Et)=>({selected:_e.selected,i:Et})).filter(_e=>_e.selected).map(_e=>_e.i):o.handle_svg_info&&Lt.push(o.handle_svg_info.index)),!pe.ctrlKey&&pe.key=="ArrowUp"){for(let _e of Lt)o.done_json[_e].y-=1,o.done_json[_e].client.y-=1,moveHandlePoint(o.done_json[_e],0,-1),moveAnchors(o.done_json[_e]);useHistoryRecord(o.done_json)}else if(!pe.ctrlKey&&pe.key=="ArrowDown"){for(let _e of Lt)o.done_json[_e].y+=1,o.done_json[_e].client.y+=1,moveHandlePoint(o.done_json[_e],0,1),moveAnchors(o.done_json[_e]);useHistoryRecord(o.done_json)}else if(!pe.ctrlKey&&pe.key=="ArrowLeft"){for(let _e of Lt)o.done_json[_e].x-=1,o.done_json[_e].client.x-=1,moveHandlePoint(o.done_json[_e],-1,0),moveAnchors(o.done_json[_e]);useHistoryRecord(o.done_json)}else if(!pe.ctrlKey&&pe.key=="ArrowRight"){for(let _e of Lt)o.done_json[_e].x+=1,o.done_json[_e].client.x+=1,moveHandlePoint(o.done_json[_e],1,0),moveAnchors(o.done_json[_e]);useHistoryRecord(o.done_json)}else pe.ctrlKey&&pe.key.toLowerCase()=="c"?f.onContextMenuClick(EContextMenuInfoType.Copy):!pe.ctrlKey&&pe.key=="Delete"?b.value?(o.setDoneJson(o.done_json.filter(_e=>!_e.selected)),o.setHandleSvgInfo(o.done_json[o.done_json.length-1],o.done_json.length-1)):f.onContextMenuClick(EContextMenuInfoType.Delete):pe.ctrlKey&&pe.key=="ArrowUp"?f.onContextMenuClick(EContextMenuInfoType.MoveUpOneLevel):pe.ctrlKey&&pe.key=="ArrowDown"?f.onContextMenuClick(EContextMenuInfoType.MoveDownOneLevel):pe.ctrlKey&&pe.key=="ArrowLeft"?f.onContextMenuClick(EContextMenuInfoType.MoveDownTopLevel):pe.ctrlKey&&pe.key=="ArrowRight"?f.onContextMenuClick(EContextMenuInfoType.MoveUpTopLevel):pe.ctrlKey&&pe.shiftKey&&pe.key.toLowerCase()=="z"?c.topRedoBtnClick():pe.ctrlKey&&pe.key.toLowerCase()=="z"?c.topUndoBtnClick():pe.ctrlKey&&pe.key.toLowerCase()=="delete"&&(o.done_json.length<=0||o.setDoneJson([]))},Fe=()=>{setSvgActualInfo(o.done_json[o.handle_svg_info.index],!0)};return vue.onMounted(()=>{var pe;(pe=h.value)==null||pe.focus(),vue.nextTick(function(){var _e;const Lt=(_e=h.value)==null?void 0:_e.getBoundingClientRect();u.canvasInfo={height:(Lt==null?void 0:Lt.height)||0,with:(Lt==null?void 0:Lt.width)||0,top:(Lt==null?void 0:Lt.top)||0,left:(Lt==null?void 0:Lt.left)||0}})}),n({onCanvasMouseUp:j}),(pe,Lt)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",{class:"canvas",tabindex:"0",ref_key:"canvasRef",ref:h,onDrop:T,onDragenter:S,onDragover:x,onMousedown:V,onMousemove:F,onMouseup:j,onContextmenu:$,onKeydown:Ie,onMousewheel:z},[(vue.openBlock(),vue.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",style:vue.normalizeStyle({backgroundColor:vue.unref(a).svg.background_color}),width:"100%",height:"100%"},[vue.createElementVNode("defs",null,[vue.createElementVNode("pattern",_hoisted_1$c,[vue.createElementVNode("line",{x1:"0",y1:"0",x2:"0",y2:"20",stroke:vue.unref(a).svg.grid_color},null,8,_hoisted_2$9),vue.createElementVNode("line",{x1:"10",y1:"0",x2:"10",y2:"20",stroke:vue.unref(a).svg.grid_color},null,8,_hoisted_3$8),vue.createElementVNode("line",{x1:"0",y1:"0",x2:"20",y2:"0",stroke:vue.unref(a).svg.grid_color},null,8,_hoisted_4$4),vue.createElementVNode("line",{x1:"0",y1:"10",x2:"20",y2:"10",stroke:vue.unref(a).svg.grid_color},null,8,_hoisted_5$2)])]),vue.unref(a).svg.grid?(vue.openBlock(),vue.createElementBlock("rect",_hoisted_6)):vue.createCommentVNode("",!0),vue.createElementVNode("g",{transform:`translate(${vue.unref(u).center_offset.x*vue.unref(a).svg.scale},${vue.unref(u).center_offset.y*vue.unref(a).svg.scale})rotate(0)scale(${vue.unref(a).svg.scale})`},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(o).done_json,(_e,Et)=>{var Cn,vn,Dt,de,qe,Pt,In,$e,Ce,ue,At,Ne,Oe,kt;return vue.withDirectives((vue.openBlock(),vue.createElementBlock("g",{key:_e.id,transform:`translate(${_e.x},${_e.y})rotate(0)scale(1)`,onMousewheel:Lt[0]||(Lt[0]=(...jt)=>vue.unref(stopEvent)&&vue.unref(stopEvent)(...jt))},[vue.createElementVNode("g",{class:vue.normalizeClass(`${vue.unref(getCommonClass)(_e)}`)},[vue.createElementVNode("g",{transform:`translate(${_e.actual_bound.x+_e.actual_bound.width/2},${_e.actual_bound.y+_e.actual_bound.height/2})rotate(${_e.rotate}) scale(1) translate(${-(_e.actual_bound.x+_e.actual_bound.width/2)},${-(_e.actual_bound.y+_e.actual_bound.height/2)})`,onMousedown:jt=>O(_e,Et,jt),onMouseup:jt=>L(_e,Et,jt),onMouseenter:jt=>M(_e,Et,jt),onMouseleave:jt=>re(_e,Et,jt),onContextmenu:jt=>he(_e,Et,jt)},[_e.type===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$y,{key:0,"item-info":_e,"point-visible":vue.unref(p).connection_line&&((Cn=vue.unref(p).select_item.info)==null?void 0:Cn.id)==_e.id},null,8,["item-info","point-visible"])):_e.type===vue.unref(EDoneJsonType).File?(vue.openBlock(),vue.createElementBlock("use",vue.mergeProps({key:1,"xlink:href":`#svg-${_e.name}`},vue.unref(prosToVBind)(_e,["height","width"]),{width:((Dt=(vn=_e.props)==null?void 0:vn.width)==null?void 0:Dt.val)??100,height:((qe=(de=_e.props)==null?void 0:de.height)==null?void 0:qe.val)??100,id:_e.id,transform:`translate(${_e.actual_bound.x+_e.actual_bound.width/2},${_e.actual_bound.y+_e.actual_bound.height/2}) scale(${_e.scale_x},${_e.scale_y}) translate(${-(_e.actual_bound.x+_e.actual_bound.width/2)},${-(_e.actual_bound.y+_e.actual_bound.height/2)})`}),null,16,_hoisted_10)):_e.type===vue.unref(EDoneJsonType).CustomSvg?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_e.tag),vue.mergeProps({key:2},vue.unref(prosToVBind)(_e,["height","width"]),{width:((In=(Pt=_e.props)==null?void 0:Pt.width)==null?void 0:In.val)??100,height:((Ce=($e=_e.props)==null?void 0:$e.height)==null?void 0:Ce.val)??100,id:_e.id,onResize:Fe,transform:`translate(${_e.actual_bound.x+_e.actual_bound.width/2},${_e.actual_bound.y+_e.actual_bound.height/2}) scale(${_e.scale_x},${_e.scale_y}) translate(${-(_e.actual_bound.x+_e.actual_bound.width/2)},${-(_e.actual_bound.y+_e.actual_bound.height/2)})`}),null,16,["width","height","id","transform"])):_e.type===vue.unref(EDoneJsonType).Vue?(vue.openBlock(),vue.createElementBlock("foreignObject",vue.mergeProps({key:3},le(_e.actual_bound,_e.scale_x,_e.scale_y),{id:`foreign-object${_e.id}`,class:"foreignObject"}),[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_e.tag),vue.mergeProps(vue.unref(prosToVBind)(_e),{id:_e.id,transform:`translate(${_e.actual_bound.x+_e.actual_bound.width/2},${_e.actual_bound.y+_e.actual_bound.height/2}) scale(${_e.scale_x},${_e.scale_y}) translate(${-(_e.actual_bound.x+_e.actual_bound.width/2)},${-(_e.actual_bound.y+_e.actual_bound.height/2)})`}),{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(_e.tag_slot),1)]),_:2},1040,["id","transform"]))],16,_hoisted_11)):_e.type===vue.unref(EDoneJsonType).StraightLine?(vue.openBlock(),vue.createElementBlock("line",{key:4,id:_e.id,x1:_e.props.start_x.val,y1:_e.props.start_y.val,x2:_e.props.end_x.val,y2:_e.props.end_y.val,fill:"#FF0000",stroke:"#FF0000","stroke-width":"2"},null,8,_hoisted_12$1)):vue.createCommentVNode("",!0),_e.config.actual_rect?(vue.openBlock(),vue.createElementBlock("rect",vue.mergeProps({key:5,id:`rect${_e.id}`,fill:"black","fill-opacity":"0"},le(_e.actual_bound,_e.scale_x,_e.scale_y),{style:{stroke:"none","stroke-width":"2","stroke-miterlimit":"10"},class:{"svg-item-none":!_e.selected&&(vue.unref(o).intention==vue.unref(EGlobalStoreIntention).None||vue.unref(o).intention==vue.unref(EGlobalStoreIntention).Select),"svg-item-move":vue.unref(o).intention==vue.unref(EGlobalStoreIntention).Move&&((ue=vue.unref(o).handle_svg_info)==null?void 0:ue.info.id)==_e.id,"svg-item-select":vue.unref(o).intention==vue.unref(EGlobalStoreIntention).Select&&((At=vue.unref(o).handle_svg_info)==null?void 0:At.info.id)==_e.id,"svg-item-in-group":_e.selected}}),null,16,_hoisted_13)):vue.createCommentVNode("",!0),((Ne=vue.unref(o).handle_svg_info)==null?void 0:Ne.info.id)===_e.id&&vue.unref(p).handle_panel&&_e.type!==vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(HandlePanel,{key:6,"item-info":_e},null,8,["item-info"])):vue.createCommentVNode("",!0),!_e.selected&&((Oe=vue.unref(p).select_item.info)==null?void 0:Oe.id)==_e.id&&vue.unref(p).connection_panel&&_e.config.have_anchor&&vue.unref(o).intention!==vue.unref(EGlobalStoreIntention).SelectArea&&(vue.unref(o).intention!==vue.unref(EGlobalStoreIntention).Select||_e.id!==((kt=vue.unref(o).handle_svg_info)==null?void 0:kt.info.id))?(vue.openBlock(),vue.createBlock(ConnectionPanel,{key:7,onContextmenu:$,"item-info":_e},null,8,["item-info"])):vue.createCommentVNode("",!0)],40,_hoisted_9)],2)],40,_hoisted_8)),[[vue.vShow,_e.display]])}),128)),vue.createElementVNode("rect",{x:vue.unref(_).x,y:vue.unref(_).y,height:vue.unref(_).height,width:vue.unref(_).with,stroke:"#107cec",fill:"#107cec","fill-opacity":".2"},null,8,_hoisted_14)],8,_hoisted_7)],4))],544),vue.withDirectives(vue.createElementVNode("ul",{ref_key:"contextMenuRef",ref:d,class:"contextMenu"},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(f).info,(_e,Et)=>(vue.openBlock(),vue.createElementBlock("li",{key:_e.title,onClick:Cn=>vue.unref(f).onContextMenuClick(Et)},[vue.createElementVNode("p",{class:vue.normalizeClass(_e.enable?"":"disabled")},[vue.createTextVNode(vue.toDisplayString(_e.title)+" ",1),vue.createElementVNode("span",_hoisted_16$1,vue.toDisplayString(_e.hot_key),1)],2)],8,_hoisted_15))),128))],512),[[vue.vShow,vue.unref(f).display]])],64))}}),centerPanel_vue_vue_type_style_index_0_scoped_45eb2bb8_lang="",CenterPanel=_export_sfc$1(_sfc_main$x,[["__scopeId","data-v-45eb2bb8"]]);/*! Element Plus Icons Vue v2.1.0 */var export_helper_default=(r,n)=>{let i=r.__vccOpts||r;for(let[o,a]of n)i[o]=a;return i},aim_vue_vue_type_script_lang_default={name:"Aim"},_hoisted_12={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_22=vue.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"},null,-1),_hoisted_32=vue.createElementVNode("path",{fill:"currentColor",d:"M512 96a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V128a32 32 0 0 1 32-32zm0 576a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V704a32 32 0 0 1 32-32zM96 512a32 32 0 0 1 32-32h192a32 32 0 0 1 0 64H128a32 32 0 0 1-32-32zm576 0a32 32 0 0 1 32-32h192a32 32 0 1 1 0 64H704a32 32 0 0 1-32-32z"},null,-1),_hoisted_42=[_hoisted_22,_hoisted_32];function _sfc_render2(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_12,_hoisted_42)}var aim_default=export_helper_default(aim_vue_vue_type_script_lang_default,[["render",_sfc_render2],["__file","aim.vue"]]),arrow_down_vue_vue_type_script_lang_default={name:"ArrowDown"},_hoisted_16={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_26=vue.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"},null,-1),_hoisted_36=[_hoisted_26];function _sfc_render6(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_16,_hoisted_36)}var arrow_down_default=export_helper_default(arrow_down_vue_vue_type_script_lang_default,[["render",_sfc_render6],["__file","arrow-down.vue"]]),circle_check_vue_vue_type_script_lang_default={name:"CircleCheck"},_hoisted_149={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_249=vue.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"},null,-1),_hoisted_348=vue.createElementVNode("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"},null,-1),_hoisted_415=[_hoisted_249,_hoisted_348];function _sfc_render49(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_149,_hoisted_415)}var circle_check_default=export_helper_default(circle_check_vue_vue_type_script_lang_default,[["render",_sfc_render49],["__file","circle-check.vue"]]),circle_close_vue_vue_type_script_lang_default={name:"CircleClose"},_hoisted_151={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_251=vue.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248L466.752 512z"},null,-1),_hoisted_350=vue.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"},null,-1),_hoisted_416=[_hoisted_251,_hoisted_350];function _sfc_render51(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_151,_hoisted_416)}var circle_close_default=export_helper_default(circle_close_vue_vue_type_script_lang_default,[["render",_sfc_render51],["__file","circle-close.vue"]]),close_vue_vue_type_script_lang_default={name:"Close"},_hoisted_156={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_256=vue.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"},null,-1),_hoisted_355=[_hoisted_256];function _sfc_render56(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_156,_hoisted_355)}var close_default=export_helper_default(close_vue_vue_type_script_lang_default,[["render",_sfc_render56],["__file","close.vue"]]),hide_vue_vue_type_script_lang_default={name:"Hide"},_hoisted_1133={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_2133=vue.createElementVNode("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2L371.2 588.8ZM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"},null,-1),_hoisted_3132=vue.createElementVNode("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"},null,-1),_hoisted_438=[_hoisted_2133,_hoisted_3132];function _sfc_render133(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1133,_hoisted_438)}var hide_default=export_helper_default(hide_vue_vue_type_script_lang_default,[["render",_sfc_render133],["__file","hide.vue"]]),loading_vue_vue_type_script_lang_default={name:"Loading"},_hoisted_1150={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_2150=vue.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"},null,-1),_hoisted_3149=[_hoisted_2150];function _sfc_render150(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1150,_hoisted_3149)}var loading_default=export_helper_default(loading_vue_vue_type_script_lang_default,[["render",_sfc_render150],["__file","loading.vue"]]),view_vue_vue_type_script_lang_default={name:"View"},_hoisted_1283={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_2283=vue.createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352zm0 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-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448zm0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160z"},null,-1),_hoisted_3282=[_hoisted_2283];function _sfc_render283(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1283,_hoisted_3282)}var view_default=export_helper_default(view_vue_vue_type_script_lang_default,[["render",_sfc_render283],["__file","view.vue"]]),MapShim=function(){if(typeof Map<"u")return Map;function r(n,i){var o=-1;return n.some(function(a,u){return a[0]===i?(o=u,!0):!1}),o}return function(){function n(){this.__entries__=[]}return Object.defineProperty(n.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),n.prototype.get=function(i){var o=r(this.__entries__,i),a=this.__entries__[o];return a&&a[1]},n.prototype.set=function(i,o){var a=r(this.__entries__,i);~a?this.__entries__[a][1]=o:this.__entries__.push([i,o])},n.prototype.delete=function(i){var o=this.__entries__,a=r(o,i);~a&&o.splice(a,1)},n.prototype.has=function(i){return!!~r(this.__entries__,i)},n.prototype.clear=function(){this.__entries__.splice(0)},n.prototype.forEach=function(i,o){o===void 0&&(o=null);for(var a=0,u=this.__entries__;a<u.length;a++){var c=u[a];i.call(o,c[1],c[0])}},n}()}(),isBrowser=typeof window<"u"&&typeof document<"u"&&window.document===document,global$1=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),requestAnimationFrame$1=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(global$1):function(r){return setTimeout(function(){return r(Date.now())},1e3/60)}}(),trailingTimeout=2;function throttle(r,n){var i=!1,o=!1,a=0;function u(){i&&(i=!1,r()),o&&f()}function c(){requestAnimationFrame$1(u)}function f(){var d=Date.now();if(i){if(d-a<trailingTimeout)return;o=!0}else i=!0,o=!1,setTimeout(c,n);a=d}return f}var REFRESH_DELAY=20,transitionKeys=["top","right","bottom","left","width","height","size","weight"],mutationObserverSupported=typeof MutationObserver<"u",ResizeObserverController=function(){function r(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=throttle(this.refresh.bind(this),REFRESH_DELAY)}return r.prototype.addObserver=function(n){~this.observers_.indexOf(n)||this.observers_.push(n),this.connected_||this.connect_()},r.prototype.removeObserver=function(n){var i=this.observers_,o=i.indexOf(n);~o&&i.splice(o,1),!i.length&&this.connected_&&this.disconnect_()},r.prototype.refresh=function(){var n=this.updateObservers_();n&&this.refresh()},r.prototype.updateObservers_=function(){var n=this.observers_.filter(function(i){return i.gatherActive(),i.hasActive()});return n.forEach(function(i){return i.broadcastActive()}),n.length>0},r.prototype.connect_=function(){!isBrowser||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),mutationObserverSupported?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},r.prototype.disconnect_=function(){!isBrowser||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},r.prototype.onTransitionEnd_=function(n){var i=n.propertyName,o=i===void 0?"":i,a=transitionKeys.some(function(u){return!!~o.indexOf(u)});a&&this.refresh()},r.getInstance=function(){return this.instance_||(this.instance_=new r),this.instance_},r.instance_=null,r}(),defineConfigurable=function(r,n){for(var i=0,o=Object.keys(n);i<o.length;i++){var a=o[i];Object.defineProperty(r,a,{value:n[a],enumerable:!1,writable:!1,configurable:!0})}return r},getWindowOf=function(r){var n=r&&r.ownerDocument&&r.ownerDocument.defaultView;return n||global$1},emptyRect=createRectInit(0,0,0,0);function toFloat(r){return parseFloat(r)||0}function getBordersSize(r){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];return n.reduce(function(o,a){var u=r["border-"+a+"-width"];return o+toFloat(u)},0)}function getPaddings(r){for(var n=["top","right","bottom","left"],i={},o=0,a=n;o<a.length;o++){var u=a[o],c=r["padding-"+u];i[u]=toFloat(c)}return i}function getSVGContentRect(r){var n=r.getBBox();return createRectInit(0,0,n.width,n.height)}function getHTMLElementContentRect(r){var n=r.clientWidth,i=r.clientHeight;if(!n&&!i)return emptyRect;var o=getWindowOf(r).getComputedStyle(r),a=getPaddings(o),u=a.left+a.right,c=a.top+a.bottom,f=toFloat(o.width),d=toFloat(o.height);if(o.boxSizing==="border-box"&&(Math.round(f+u)!==n&&(f-=getBordersSize(o,"left","right")+u),Math.round(d+c)!==i&&(d-=getBordersSize(o,"top","bottom")+c)),!isDocumentElement(r)){var h=Math.round(f+u)-n,v=Math.round(d+c)-i;Math.abs(h)!==1&&(f-=h),Math.abs(v)!==1&&(d-=v)}return createRectInit(a.left,a.top,f,d)}var isSVGGraphicsElement=function(){return typeof SVGGraphicsElement<"u"?function(r){return r instanceof getWindowOf(r).SVGGraphicsElement}:function(r){return r instanceof getWindowOf(r).SVGElement&&typeof r.getBBox=="function"}}();function isDocumentElement(r){return r===getWindowOf(r).document.documentElement}function getContentRect(r){return isBrowser?isSVGGraphicsElement(r)?getSVGContentRect(r):getHTMLElementContentRect(r):emptyRect}function createReadOnlyRect(r){var n=r.x,i=r.y,o=r.width,a=r.height,u=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,c=Object.create(u.prototype);return defineConfigurable(c,{x:n,y:i,width:o,height:a,top:i,right:n+o,bottom:a+i,left:n}),c}function createRectInit(r,n,i,o){return{x:r,y:n,width:i,height:o}}var ResizeObservation=function(){function r(n){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=createRectInit(0,0,0,0),this.target=n}return r.prototype.isActive=function(){var n=getContentRect(this.target);return this.contentRect_=n,n.width!==this.broadcastWidth||n.height!==this.broadcastHeight},r.prototype.broadcastRect=function(){var n=this.contentRect_;return this.broadcastWidth=n.width,this.broadcastHeight=n.height,n},r}(),ResizeObserverEntry=function(){function r(n,i){var o=createReadOnlyRect(i);defineConfigurable(this,{target:n,contentRect:o})}return r}(),ResizeObserverSPI=function(){function r(n,i,o){if(this.activeObservations_=[],this.observations_=new MapShim,typeof n!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=n,this.controller_=i,this.callbackCtx_=o}return r.prototype.observe=function(n){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(n instanceof getWindowOf(n).Element))throw new TypeError('parameter 1 is not of type "Element".');var i=this.observations_;i.has(n)||(i.set(n,new ResizeObservation(n)),this.controller_.addObserver(this),this.controller_.refresh())}},r.prototype.unobserve=function(n){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(n instanceof getWindowOf(n).Element))throw new TypeError('parameter 1 is not of type "Element".');var i=this.observations_;i.has(n)&&(i.delete(n),i.size||this.controller_.removeObserver(this))}},r.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},r.prototype.gatherActive=function(){var n=this;this.clearActive(),this.observations_.forEach(function(i){i.isActive()&&n.activeObservations_.push(i)})},r.prototype.broadcastActive=function(){if(this.hasActive()){var n=this.callbackCtx_,i=this.activeObservations_.map(function(o){return new ResizeObserverEntry(o.target,o.broadcastRect())});this.callback_.call(n,i,n),this.clearActive()}},r.prototype.clearActive=function(){this.activeObservations_.splice(0)},r.prototype.hasActive=function(){return this.activeObservations_.length>0},r}(),observers=typeof WeakMap<"u"?new WeakMap:new MapShim,ResizeObserver$1=function(){function r(n){if(!(this instanceof r))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var i=ResizeObserverController.getInstance(),o=new ResizeObserverSPI(n,i,this);observers.set(this,o)}return r}();["observe","unobserve","disconnect"].forEach(function(r){ResizeObserver$1.prototype[r]=function(){var n;return(n=observers.get(this))[r].apply(n,arguments)}});var index$1=function(){return typeof global$1.ResizeObserver<"u"?global$1.ResizeObserver:ResizeObserver$1}();const Events=["blur","input","change","changeSelectionStyle","changeSession","copy","focus","paste"],VAceEditor=vue.defineComponent({props:{value:{type:String,required:!0},lang:{type:String,default:"text"},theme:{type:String,default:"chrome"},options:Object,placeholder:String,readonly:Boolean,wrap:Boolean,printMargin:{type:[Boolean,Number],default:!0},minLines:Number,maxLines:Number},emits:["update:value","init",...Events],render(){return vue.h("div")},mounted(){const r=this._editor=vue.markRaw(ace.edit(this.$el,{placeholder:this.placeholder,readOnly:this.readonly,value:this.value,mode:"ace/mode/"+this.lang,theme:"ace/theme/"+this.theme,wrap:this.wrap,printMargin:this.printMargin,useWorker:!1,minLines:this.minLines,maxLines:this.maxLines,...this.options}));this._contentBackup=this.value,this._isSettingContent=!1,r.on("change",()=>{if(this._isSettingContent)return;const n=r.getValue();this._contentBackup=n,this.$emit("update:value",n)}),Events.forEach(n=>{const i="on"+vue.capitalize(n);typeof this.$.vnode.props[i]=="function"&&r.on(n,this.$emit.bind(this,n))}),this._ro=new index$1(()=>r.resize()),this._ro.observe(this.$el),this.$emit("init",r)},beforeUnmount(){var r,n;(r=this._ro)===null||r===void 0||r.disconnect(),(n=this._editor)===null||n===void 0||n.destroy()},methods:{focus(){this._editor.focus()},blur(){this._editor.blur()},selectAll(){this._editor.selectAll()}},watch:{value(r){if(this._contentBackup!==r){try{this._isSettingContent=!0,this._editor.setValue(r,1)}finally{this._isSettingContent=!1}this._contentBackup=r}},theme(r){this._editor.setTheme("ace/theme/"+r)},options(r){this._editor.setOptions(r)},readonly(r){this._editor.setReadOnly(r)},placeholder(r){this._editor.setOption("placeholder",r)},wrap(r){this._editor.setWrapBehavioursEnabled(r)},printMargin(r){this._editor.setOption("printMargin",r)},lang(r){this._editor.setOption("mode","ace/mode/"+r)},minLines(r){this._editor.setOption("minLines",r)},maxLines(r){this._editor.setOption("maxLines",r)}}}),themeUrl2="data:application/javascript;base64,YWNlLmRlZmluZSgiYWNlL3RoZW1lL2tyX3RoZW1lLmNzcyIsWyJyZXF1aXJlIiwiZXhwb3J0cyIsIm1vZHVsZSJdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpe21vZHVsZS5leHBvcnRzID0gIi5hY2Uta3ItdGhlbWUgLmFjZV9ndXR0ZXIge1xuICBiYWNrZ3JvdW5kOiAjMWMxOTE3O1xuICBjb2xvcjogI0ZDRkZFMFxufVxuXG4uYWNlLWtyLXRoZW1lIC5hY2VfcHJpbnQtbWFyZ2luIHtcbiAgd2lkdGg6IDFweDtcbiAgYmFja2dyb3VuZDogIzFj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AgICAgICAgICAgICAgIH0pKCk7CiAgICAgICAgICAgIA==",modeJsonUrl="data:application/javascript;base64,YWNlLmRlZmluZSgiYWNlL21vZGUvanNvbl9oaWdobGlnaHRfcnVsZXMiLFsicmVxdWlyZSIsImV4cG9ydHMiLCJtb2R1bGUiLCJhY2UvbGliL29vcCIsImFjZS9tb2RlL3RleHRfaGlnaGxpZ2h0X3J1bGVzIl0sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7InVzZSBzdHJpY3QiOwp2YXIgb29wID0gcmVxdWlyZSgiLi4vbGliL29vcCIpOwp2YXIgVGV4dEhpZ2hsaWdodFJ1bGVzID0gcmVxdWlyZSgiLi90ZXh0X2hpZ2hsaWdodF9ydWxlcyIpLlRleHRIaWdobGlnaHRSdWxlczsKdmFyIEpzb25IaWdobGlnaHRSdWxlcyA9IGZ1bmN0aW9uICgpIHsKICAgIHRoaXMuJHJ1bGVzID0gewogICAgICAgICJzdGFydCI6IFsKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgdG9rZW46ICJ2YXJpYWJsZSIsCiAgICAgICAgICAgICAgICByZWdleDogJ1siXSg/Oig/OlxcXFwuKXwoPzpbXiJcXFxcXSkpKj9bIl1cXHMqKD89OiknCiAgICAgICAgICAgIH0sIHsKICAgICAgICAgICAgICAgIHRva2VuOiAic3RyaW5nIiwKICAgICAgICAgICAgICAgIHJlZ2V4OiAnIicsCiAgICAgICAgICAgICAgICBuZXh0OiAic3RyaW5nIgogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICB0b2tlbjogImNvbnN0YW50Lm51bWVyaWMiLAogICAgICAgICAgICAgICAgcmVnZXg6ICIwW3hYXVswLTlhLWZBLUZdK1xcYiIKICAgICAgICAgICAgfSwgewogICAgICAgICAgICAgICAgdG9rZW46ICJjb25zdGFudC5udW1lcmljIiwKICAgICAgICAgICAgICAgIHJlZ2V4OiAiWystXT9cXGQrKD86KD86XFwuXFxkKik/KD86W2VFXVsrLV0/XFxkKyk/KT9cXGIiCiAgICAgICAgICAgIH0sIHsKICAgICAgICAgICAgICAgIHRva2VuOiAiY29uc3RhbnQubGFuZ3VhZ2UuYm9vbGVhbiIsCiAgICAgICAgICAgICAgICByZWdleDogIig/OnRydWV8ZmFsc2UpXFxiIgogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICB0b2tlbjogInRleHQiLAogICAgICAgICAgICAgICAgcmVnZXg6ICJbJ10oPzooPzpcXFxcLil8KD86W14nXFxcXF0pKSo/WyddIgogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICB0b2tlbjogImNvbW1lbnQiLAogICAgICAgICAgICAgICAgcmVnZXg6ICJcXC9cXC8uKiQiCiAgICAgICAgICAgIH0sIHsKICAgICAgICAgICAgICAgIHRva2VuOiAiY29tbWVudC5zdGFydCIsCiAgICAgICAgICAgICAgICByZWdleDogIlxcL1xcKiIsCiAgICAgICAgICAgICAgICBuZXh0OiAiY29tbWVudCIKICAgICAgICAgICAgfSwgewogICAgICAgICAgICAgICAgdG9rZW46ICJwYXJlbi5scGFyZW4iLAogICAgICAgICAgICAgICAgcmVnZXg6ICJbWyh7XSIKICAgICAgICAgICAgfSwgewogICAgICAgICAgICAgICAgdG9rZW46ICJwYXJlbi5ycGFyZW4iLAogICAgICAgICAgICAgICAgcmVnZXg6ICJbXFxdKX1dIgogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICB0b2tlbjogInB1bmN0dWF0aW9uLm9wZXJhdG9yIiwKICAgICAgICAgICAgICAgIHJlZ2V4OiAvWyxdLwogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICB0b2tlbjogInRleHQiLAogICAgICAgICAgICAgICAgcmVnZXg6ICJcXHMrIgogICAgICAgICAgICB9CiAgICAgICAgXSwKICAgICAgICAic3RyaW5nIjogWwogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICB0b2tlbjogImNvbnN0YW50Lmxhbmd1YWdlLmVzY2FwZSIsCiAgICAgICAgICAgICAgICByZWdleDogL1xcKD86eFswLTlhLWZBLUZdezJ9fHVbMC05YS1mQS1GXXs0fXxbIlxcXC9iZm5ydF0pLwogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICB0b2tlbjogInN0cmluZyIsCiAgICAgICAgICAgICAgICByZWdleDogJyJ8JCcsCiAgICAgICAgICAgICAgICBuZXh0OiAic3RhcnQiCiAgICAgICAgICAgIH0sIHsKICAgICAgICAgICAgICAgIGRlZmF1bHRUb2tlbjogInN0cmluZyIKICAgICAgICAgICAgfQogICAgICAgIF0sCiAgICAgICAgImNvbW1lbnQiOiBbCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIHRva2VuOiAiY29tbWVudC5lbmQiLAogICAgICAgICAgICAgICAgcmVnZXg6ICJcXCpcXC8iLAogICAgICAgICAgICAgICAgbmV4dDogInN0YXJ0IgogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICBkZWZhdWx0VG9rZW46ICJjb21tZW50IgogICAgICAgICAgICB9CiAgICAgICAgXQogICAgfTsKfTsKb29wLmluaGVyaXRzKEpzb25IaWdobGlnaHRSdWxlcywgVGV4dEhpZ2hsaWdodFJ1bGVzKTsKZXhwb3J0cy5Kc29uSGlnaGxpZ2h0UnVsZXMgPSBKc29uSGlnaGxpZ2h0UnVsZXM7Cgp9KTsKCmFjZS5kZWZpbmUoImFjZS9tb2RlL21hdGNoaW5nX2JyYWNlX291dGRlbnQiLFsicmVxdWlyZSIsImV4cG9ydHMiLCJtb2R1bGUiLCJhY2UvcmFuZ2UiXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXsidXNlIHN0cmljdCI7CnZhciBSYW5nZSA9IHJlcXVpcmUoIi4uL3JhbmdlIikuUmFuZ2U7CnZhciBNYXRjaGluZ0JyYWNlT3V0ZGVudCA9IGZ1bmN0aW9uICgpIHsgfTsKKGZ1bmN0aW9uICgpIHsKICAgIHRoaXMuY2hlY2tPdXRkZW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TGluZShyb3cpOwogICAgICAgIGlmICh0aGlzLnN0YXJ0UmVnaW9uUmUudGVzdChsaW5lKSkKICAgICAgICAgICAgcmV0dXJuIHRoaXMuZ2V0Q29tbWVudFJlZ2lvbkJsb2NrKHNlc3Npb24sIGxpbmUsIHJvdyk7CiAgICAgICAgdmFyIG1hdGNoID0gbGluZS5tYXRjaCh0aGlzLmZvbGRpbmdTdGFydE1hcmtlcik7CiAgICAgICAgaWYgKG1hdGNoKSB7CiAgICAgICAgICAgIHZhciBpID0gbWF0Y2guaW5kZXg7CiAgICAgICAgICAgIGlmIChtYXRjaFsxXSkKICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLm9wZW5pbmdCcmFja2V0QmxvY2soc2Vzc2lvbiwgbWF0Y2hbMV0sIHJvdywgaSk7CiAgICAgICAgICAgIHZhciByYW5nZSA9IHNlc3Npb24uZ2V0Q29tbWVudEZvbGRSYW5nZShyb3csIGkgKyBtYXRjaFswXS5sZW5ndGgsIDEpOwogICAgICAgICAgICBpZiAocmFuZ2UgJiYgIXJhbmdlLmlzTXVsdGlMaW5lKCkpIHsKICAgICAgICAgICAgICAgIGlmIChmb3JjZU11bHRpbGluZSkgewogICAgICAgICAgICAgICAgICAgIHJhbmdlID0gdGhpcy5nZXRTZWN0aW9uUmFuZ2Uoc2Vzc2lvbiwgcm93KTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGVsc2UgaWYgKGZvbGRTdHlsZSAhPSAiYWxsIikKICAgICAgICAgICAgICAgICAgICByYW5nZSA9IG51bGw7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHJhbmdlOwogICAgICAgIH0KICAgICAgICBpZiAoZm9sZFN0eWxlID09PSAibWFya2JlZ2luIikKICAgICAgICAgICAgcmV0dXJuOwogICAgICAgIHZhciBtYXRjaCA9IGxpbmUubWF0Y2godGhpcy5mb2xkaW5nU3RvcE1hcmtlcik7CiAgICAgICAgaWYgKG1hdGNoKSB7CiAgICAgICAgICAgIHZhciBpID0gbWF0Y2guaW5kZXggKyBtYXRjaFswXS5sZW5ndGg7CiAgICAgICAgICAgIGlmIChtYXRjaFsxXSkKICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmNsb3NpbmdCcmFja2V0QmxvY2soc2Vzc2lvbiwgbWF0Y2hbMV0sIHJvdywgaSk7CiAgICAgICAgICAgIHJldHVybiBzZXNzaW9uLmdldENvbW1lbnRGb2xkUmFuZ2Uocm93LCBpLCAtMSk7CiAgICAgICAgfQogICAgfTsKICAgIHRoaXMuZ2V0U2VjdGlvblJhbmdlID0gZnVuY3Rpb24gKHNlc3Npb24sIHJvdykgewogICAgICAgIHZhciBsaW5lID0gc2Vzc2lvbi5nZXRMaW5lKHJvdyk7CiAgICAgICAgdmFyIHN0YXJ0SW5kZW50ID0gbGluZS5zZWFyY2goL1xTLyk7CiAgICAgICAgdmFyIHN0YXJ0Um93ID0gcm93OwogICAgICAgIHZhciBzdGFydENvbHVtbiA9IGxpbmUubGVuZ3RoOwogICAgICAgIHJvdyA9IHJvdyArIDE7CiAgICAgICAgdmFyIGVuZFJvdyA9IHJvdzsKICAgICAgICB2YXIgbWF4Um93ID0gc2Vzc2lvbi5nZXRMZW5ndGgoKTsKICAgICAgICB3aGlsZSAoKytyb3cgPCBtYXhSb3cpIHsKICAgICAgICAgICAgbGluZSA9IHNlc3Npb24uZ2V0TGluZShyb3cpOwogICAgICAgICAgICB2YXIgaW5kZW50ID0gbGluZS5zZWFyY2goL1xTLyk7CiAgICAgICAgICAgIGlmIChpbmRlbnQgPT09IC0xKQogICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgIGlmIChzdGFydEluZGVudCA+IGluZGVudCkKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICB2YXIgc3ViUmFuZ2UgPSB0aGlzLmdldEZvbGRXaWRnZXRSYW5nZShzZXNzaW9uLCAiYWxsIiwgcm93KTsKICAgICAgICAgICAgaWYgKHN1YlJhbmdlKSB7CiAgICAgICAgICAgICAgICBpZiAoc3ViUmFuZ2Uuc3RhcnQucm93IDw9IHN0YXJ0Um93KSB7CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBlbHNlIGlmIChzdWJSYW5nZS5pc011bHRpTGluZSgpKSB7CiAgICAgICAgICAgICAgICAgICAgcm93ID0gc3ViUmFuZ2UuZW5kLnJvdzsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGVsc2UgaWYgKHN0YXJ0SW5kZW50ID09IGluZGVudCkgewogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIGVuZFJvdyA9IHJvdzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIG5ldyBSYW5nZShzdGFydFJvdywgc3RhcnRDb2x1bW4sIGVuZFJvdywgc2Vzc2lvbi5nZXRMaW5lKGVuZFJvdykubGVuZ3RoKTsKICAgIH07CiAgICB0aGlzLmdldENvbW1lbnRSZWdpb25CbG9jayA9IGZ1bmN0aW9uIChzZXNzaW9uLCBsaW5lLCByb3cpIHsKICAgICAgICB2YXIgc3RhcnRDb2x1bW4gPSBsaW5lLnNlYXJjaCgvXHMqJC8pOwogICAgICAgIHZhciBtYXhSb3cgPSBzZXNzaW9uLmdldExlbmd0aCgpOwogICAgICAgIHZhciBzdGFydFJvdyA9IHJvdzsKICAgICAgICB2YXIgcmUgPSAvXlxzKig/OlwvXCp8XC9cL3wtLSkjPyhlbmQpP3JlZ2lvblxiLzsKICAgICAgICB2YXIgZGVwdGggPSAxOwogICAgICAgIHdoaWxlICgrK3JvdyA8IG1heFJvdykgewogICAgICAgICAgICBsaW5lID0gc2Vzc2lvbi5nZXRMaW5lKHJvdyk7CiAgICAgICAgICAgIHZhciBtID0gcmUuZXhlYyhsaW5lKTsKICAgICAgICAgICAgaWYgKCFtKQogICAgICAgICAgICAgICAgY29udGludWU7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tKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgbW9kdWxlID09ICJvYmplY3QiICYmIHR5cGVvZiBleHBvcnRzID09ICJvYmplY3QiICYmIG1vZHVsZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kdWxlLmV4cG9ydHMgPSBtOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICB9KSgpOwogICAgICAgICAgICA=",workerJsonUrl="data:application/javascript;base64,Im5vIHVzZSBzdHJpY3QiOwohKGZ1bmN0aW9uKHdpbmRvdykgewppZiAodHlwZW9mIHdpbmRvdy53aW5kb3cgIT0gInVuZGVmaW5lZCIgJiYgd2luZG93LmRvY3VtZW50KQogICAgcmV0dXJuOwppZiAod2luZG93LnJlcXVpcmUgJiYgd2luZG93LmRlZmluZSkKICAgIHJldHVybjsKCmlmICghd2luZG93LmNvbnNvbGUpIHsKICAgIHdpbmRvdy5jb25zb2xlID0gZnVuY3Rpb24oKSB7CiAgICAgICAgdmFyIG1zZ3MgPSBBcnJheS5wcm90b3R5cGUuc2xpY2UuY2FsbChhcmd1bWVudHMsIDApOwogICAgICAgIHBvc3RNZXNzYWdlKHt0eXBlOiAibG9nIiwgZGF0YTogbXNnc30pOwogICAgfTsKICAgIHdpbmRvdy5jb25zb2xlLmVycm9yID0KICAgIHdpbmRvdy5jb25zb2xlLndhcm4gPSAKICAgIHdpbmRvdy5jb25zb2xlLmxvZyA9CiAgICB3aW5kb3cuY29uc29sZS50cmFjZSA9IHdpbmRvdy5jb25zb2xlOwp9CndpbmRvdy53aW5kb3cgPSB3aW5kb3c7CndpbmRvdy5hY2UgPSB3aW5kb3c7Cgp3aW5kb3cub25lcnJvciA9IGZ1bmN0aW9uKG1lc3NhZ2UsIGZpbGUsIGxpbmUsIGNvbCwgZXJyKSB7CiAgICBwb3N0TWVzc2FnZSh7dHlwZTogImVycm9yIiwgZGF0YTogewogICAgICA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UoL1wvXC5cLy8sICIvIikucmVwbGFjZSgvW15cL10rXC9cLlwuXC8vLCAiIik7CiAgICAgICAgfQogICAgfQogICAgCiAgICByZXR1cm4gbW9kdWxlTmFtZTsKfTsKCndpbmRvdy5yZXF1aXJlID0gZnVuY3Rpb24gcmVxdWlyZShwYXJlbnRJZCwgaWQpIHsKICAgIGlmICghaWQpIHsKICAgICAgICBpZCA9IHBhcmVudElkOwogICAgICAgIHBhcmVudElkID0gbnVsbDsKICAgIH0KICAgIGlmICghaWQuY2hhckF0KQogICAgICAgIHRocm93IG5ldyBFcnJvcigid29ya2VyLmpzIHJlcXVpcmUoKSBhY2NlcHRzIG9ubHkgKHBhcmVudElkLCBpZCkgYXMgYXJndW1lbnRzIik7CgogICAgaWQgPSB3aW5kb3cubm9ybWFsaXplTW9kdWxlKHBhcmVudElkLCBpZCk7CgogICAgdmFyIG1vZHVsZSA9IHdpbmRvdy5yZXF1aXJlLm1vZHVsZXNbaWRdOwogICAgaWYgKG1vZHVsZSkgewogICAgICAgIGlmICghbW9kdWxlLmluaXRpYWxpemVkKSB7CiAgICAgICAgICAgIG1vZHVsZS5pbml0aWFsaXplZCA9IHRydWU7CiAgICAgICAgICAgIG1vZHVsZS5leHBvcnRzID0gbW9kdWxlLmZhY3RvcnkoKS5leHBvcnRzOwogICAgICAgIH0KICAgICAgICByZXR1cm4gbW9kdWxlLmV4cG9ydHM7CiAgICB9CiAgIAogICAgaWYgKCF3aW5kb3cucmVxdWlyZS50bG5zKQogICAgICAgIHJldHVybiBjb25zb2xlLmxvZygidW5hYmxlIHRvIGxvYWQgIiArIGlkKTsKICAgIAogICAgdmFyIHBhdGggPSByZXNvbHZlTW9kdWxlSWQoaWQsIHdpbmRvdy5yZXF1aXJlLnRsbnMpOwogICAgaWYgKHBhdGguc2xpY2UoLTMpICE9ICIuanMiKSBwYXRoICs9ICIuanMiOwogICAgCiAgICB3aW5kb3cucmVxdWlyZS5pZCA9IGlkOwogICAgd2luZG93LnJlcXVpc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md0aCA9PSAyKSB7CiAgICAgICAgZmFjdG9yeSA9IGRlcHM7CiAgICAgICAgaWYgKHR5cGVvZiBpZCAhPSAic3RyaW5nIikgewogICAgICAgICAgICBkZXBzID0gaWQ7CiAgICAgICAgICAgIGlkID0gd2luZG93LnJlcXVpcmUuaWQ7CiAgICAgICAgfQogICAgfSBlbHNlIGlmIChhcmd1bWVudHMubGVuZ3RoID09IDEpIHsKICAgICAgICBmYWN0b3J5ID0gaWQ7CiAgICAgICAgZGVwcyA9IFtdOwogICAgICAgIGlkID0gd2luZG93LnJlcXVpcmUuaWQ7CiAgICB9CiAgICAKICAgIGlmICh0eXBlb2YgZmFjdG9yeSAhPSAiZnVuY3Rpb24iKSB7CiAgICAgICAgd2luZG93LnJlcXVpcmUubW9kdWxlc1tpZF0gPSB7CiAgICAgICAgICAgIGV4cG9ydHM6IGZhY3RvcnksCiAgICAgICAgICAgIGluaXRpYWxpemVkOiB0cnVlCiAgICAgICAgfTsKICAgICAgICByZXR1cm47CiAgICB9CgogICAgaWYgKCFkZXBzLmxlbmd0aCkKICAgICAgICAvLyBJZiB0aGVyZSBpcyBubyBkZXBlbmRlbmNpZXMsIHdlIGluamVjdCAicmVxdWlyZSIsICJleHBvcnRzIiBhbmQKICAgICAgICAvLyAibW9kdWxlIiBhcyBkZXBlbmRlbmNpZXMsIHRvIHByb3ZpZGUgQ29tbW9uSlMgY29tcGF0aWJpbGl0eS4KICAgICAgICBkZXBzID0gWyJyZXF1aXJlIiwgImV4cG9ydHMiLCAibW9kdWxlIl07CgogICAgdmFyIHJlcSA9IGZ1bmN0aW9uKGNoaWxkSWQpIHsKICAgICAgICByZXR1cm4gd2luZG93LnJlcXVpcmUoaWQsIGNoaWxkSWQpOwogICAgfTsKCiAgICB3aW5kb3cucmVxdWlyZS5tb2R1bGVzW2lkXSA9IHsKICAgICAgICBleHBvcnRzOiB7fSwKICAgICAgICBmYWN0b3J5OiBmdW5jdGlvbigpIHsKICAgICAgICAgICAgdmFyIG1vZHVsZSA9IHRoaXM7CiAgICAgICAgICAgIHZhciByZXR1cm5FeHBvcnRzID0gZmFjdG9yeS5hcHBseSh0aGlzLCBkZXBzLnNsaWNlKDAsIGZhY3RvcnkubGVuZ3RoKS5tYXAoZnVuY3Rpb24oZGVwKSB7CiAgICAgICAgICAgICAgICBzd2l0Y2ggKGRlcCkgewogICAgICAgICAgICAgICAgICAgIC8vIEJlY2F1c2UgInJlcXVpcmUiLCAiZXhwb3J0cyIgYW5kICJtb2R1bGUiIGFyZW4ndCBhY3R1YWwKICAgICAgICAgICAgICAgICAgICAvLyBkZXBlbmRlbmNpZXMsIHdlIG11c3QgaGFuZGxlIHRoZW0gc2VwZXJhdGVseS4KICAgICAgICAgICAgICAgICAgICBjYXNlICJyZXF1aXJlIjogcmV0dXJuIHJlcTsKICAgICAgICAgICAgICAgICAgICBjYXNlICJleHBvcnRzIjogcmV0dXJuIG1vZHVsZS5leHBvcnRzOwogICAgICAgICAgICAgICAgICAgIGNhc2UgIm1vZHVsZSI6ICByZXR1cm4gbW9kdWxlOwogICAgICAgICAgICAgICAgICAgIC8vIEJ1dCBmb3IgYWxsIG90aGVyIGRlcGVuZGVuY2llcywgd2UgY2FuIGp1c3QgZ28gYWhlYWQgYW5kCiAgICAgICAgICAgICAgICAgICAgLy8gcmVxdWlyZSB0aGVtLgogICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6ICAgICAgICByZXR1cm4gcmVxKGRlcCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pKTsKICAgICAgICAgICAgaWYgKHJldHVybkV4cG9ydHMpCiAgICAgICAgICAgICAgICBtb2R1bGUuZXhwb3J0cyA9IHJldHVybkV4cG9ydHM7CiAgICAgICAgICAgIHJldHVybiBtb2R1bGU7CiAgICAgICAgfQogICAgfTsKfTsKd2luZG93LmRlZmluZS5hbWQgPSB7fTsKd2luZG93LnJlcXVpcmUudGxucyA9IHt9Owp3aW5kb3cuaW5pdEJhc2VVcmxzICA9IGZ1bmN0aW9uIGluaXRCYXNlVXJscyh0b3BMZXZlbE5hbWVzcGFjZXMpIHsKICAgIGZvciAodmFyIGkgaW4gdG9wTGV2ZWxOYW1lc3BhY2VzKQogICAgICAgIHRoaXMucmVxdWlyZS50bG5zW2ldID0gdG9wTGV2ZWxOYW1lc3BhY2VzW2ldOwp9OwoKd2luZG93LmluaXRTZW5kZXIgPSBmdW5jdGlvbiBpbml0U2VuZGVyKCkgewoKICAgIHZhciBFdmVudEVtaXR0ZXIgPSB3aW5kb3cucmVxdWlyZSgiYWNlL2xpYi9ldmVudF9lbWl0dGVyIikuRXZlbnRFbWl0dGVyOwogICAgdmFyIG9vcCA9IHdpbmRvdy5yZXF1aXJlKCJhY2UvbGliL29vcCIpOwogICAgCiAgICB2YXIgU2VuZGVyID0gZnVuY3Rpb24oKSB7fTsKICAgIAogICAgKGZ1bmN0aW9uKCkgewogICAgICAgIAogICAgICAgIG9vcC5pbXBsZW1lbnQodGhpcywgRXZlbnRFbWl0dGVyKTsKICAgICAgICAgICAgICAgIAogICAgICAgIHRoaXMuY2FsbGJhY2sgPSBmdW5jdGlvbihkYXRhLCBjYWxsYmFja0lkKSB7CiAgICAgICAgICAgIHBvc3RNZXNzYWdlKHsKICAgICAgICAgICAgICAgIHR5cGU6ICJjYWxsIiwKICAgICAgICAgICAgICAgIGlkOiBjYWxsYmFja0lkLAogICAgICAgICAgICAgICAgZGF0YTogZGF0YQogICAgICAgICAgICB9KTsKICAgICAgICB9OwogICAgCiAgICAgICAgdGhpcy5lbWl0ID0gZnVuY3Rpb24obmFtZSwgZGF0YSkgewogICAgICAgICAgICBwb3N0TWVzc2FnZSh7CiAgICAgICAgICAgICAgICB0eXBlOiAiZXZlbnQiLAogICAgICAgICAgICAgICAgbmFtZTogbmFtZSwKICAgICAgICAgICAgICAgIGRhdGE6IGRhdGEKICAgICAgICAgICAgfSk7CiAgICAgICAgfTsKICAgICAgICAKICAgIH0pLmNhbGwoU2VuZGVyLnByb3RvdHlwZS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ChkZWx0YS5saW5lcyk7CiAgICAgICAgICAgICAgICBkb2NMaW5lcy5zcGxpY2UuYXBwbHkoZG9jTGluZXMsIGFyZ3MpOwogICAgICAgICAgICAgICAgZG9jTGluZXNbcm93XSA9IGxpbmUuc3Vic3RyaW5nKDAsIHN0YXJ0Q29sdW1uKSArIGRvY0xpbmVzW3Jvd107CiAgICAgICAgICAgICAgICBkb2NMaW5lc1tyb3cgKyBkZWx0YS5saW5lcy5sZW5ndGggLSAxXSArPSBsaW5lLnN1YnN0cmluZyhzdGFydENvbHVtbik7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgY2FzZSAicmVtb3ZlIjoKICAgICAgICAgICAgdmFyIGVuZENvbHVtbiA9IGRlbHRhLmVuZC5jb2x1bW47CiAgICAgICAgICAgIHZhciBlbmRSb3cgPSBkZWx0YS5lbmQucm93OwogICAgICAgICAgICBpZiAocm93ID09PSBlbmRSb3cpIHsKICAgICAgICAgICAgICAgIGRvY0xpbmVzW3Jvd10gPSBsaW5lLnN1YnN0cmluZygwLCBzdGFydENvbHVtbikgKyBsaW5lLnN1YnN0cmluZyhlbmRDb2x1bW4pOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgZG9jTGluZXMuc3BsaWNlKHJvdywgZW5kUm93IC0gcm93ICsgMSwgbGluZS5zdWJzdHJpbmcoMCwgc3RhcnRDb2x1bW4pICsgZG9jTGluZXNbZW5kUm93XS5zdWJzdHJpbmcoZW5kQ29sdW1uKSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgYnJlYWs7CiAgICB9Cn07Cgp9KTsKCmFjZS5kZWZpbmUoImFjZS9saWIvZXZlbnRfZW1pdHRlciIsW10sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7InVzZSBzdHJpY3QiOwp2YXIgRXZlbnRFbWl0dGVyID0ge307CnZhciBzdG9wUHJvcGFnYXRpb24gPSBm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Jvdywgc3RhcnRDb2x1bW4sIGVuZFJvdywgZW5kQ29sdW1uKSB7CiAgICB0aGlzLnN0YXJ0ID0gewogICAgICAgIHJvdzogc3RhcnRSb3csCiAgICAgICAgY29sdW1uOiBzdGFydENvbHVtbgogICAgfTsKICAgIHRoaXMuZW5kID0gewogICAgICAgIHJvdzogZW5kUm93LAogICAgICAgIGNvbHVtbjogZW5kQ29sdW1uCiAgICB9Owp9OwooZnVuY3Rpb24gKCkgewogICAgdGhpcy5pc0VxdWFsID0gZnVuY3Rpb24gKHJhbmdlKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuc3RhcnQucm93ID09PSByYW5nZS5zdGFydC5yb3cgJiYKICAgICAgICAgICAgdGhpcy5lbmQucm93ID09PSByYW5nZS5lbmQucm93ICYmCiAgICAgICAgICAgIHRoaXMuc3RhcnQuY29sdW1uID09PSByYW5nZS5zdGFydC5jb2x1bW4gJiYKICAgICAgICAgICAgdGhpcy5lbmQuY29sdW1uID09PSByYW5nZS5lbmQuY29sdW1uOwogICAgfTsKICAgIHRoaXMudG9TdHJpbmcgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgcmV0dXJuICgiUmFuZ2U6IFsiICsgdGhpcy5zdGFydC5yb3cgKyAiLyIgKyB0aGlzLnN0YXJ0LmNvbHVtbiArCiAgICAgICAgICAgICJdIC0+IFsiICsgdGhpcy5lbmQucm93ICsgIi8iICsgdGhpcy5lbmQuY29sdW1uICsgIl0iKTsKICAgIH07CiAgICB0aGlzLmNvbnRhaW5zID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZShyb3csIGNvbHVtbikgPT0gMDsKICAgIH07CiAgICB0aGlzLmNvbXBhcmVSYW5nZSA9IGZ1bmN0aW9uIChyYW5nZSkgewogICAgICAgIHZhciBjbXAsIGVuZCA9IHJhbmdlLmVuZCwgc3RhcnQgPSByYW5nZS5zdGFydDsKICAgICAgICBjbXAgPSB0aGlzLmNvbXBhcmUoZW5kLnJvdywgZW5kLmNvbHVtbik7CiAgICAgICAgaWYgKGNtcCA9PSAxKSB7CiAgICAgICAgICAgIGNtcCA9IHRoaXMuY29tcGFyZShzdGFydC5yb3csIHN0YXJ0LmNvbHVtbik7CiAgICAgICAgICAgIGlmIChjbXAgPT0gMSkgewogICAgICAgICAgICAgICAgcmV0dXJuIDI7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSBpZiAoY21wID09IDApIHsKICAgICAgICAgICAgICAgIHJldHVybiAxOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAoY21wID09IC0xKSB7CiAgICAgICAgICAgIHJldHVybiAtMjsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGNtcCA9IHRoaXMuY29tcGFyZShzdGFydC5yb3csIHN0YXJ0LmNvbHVtbik7CiAgICAgICAgICAgIGlmIChjbXAgPT0gLTEpIHsKICAgICAgICAgICAgICAgIHJldHVybiAtMTsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIGlmIChjbXAgPT0gMSkgewogICAgICAgICAgICAgICAgcmV0dXJuIDQyOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9OwogICAgdGhpcy5jb21wYXJlUG9pbnQgPSBmdW5jdGlvbiAocCkgewogICAgICAgIHJldHVybiB0aGlzLmNvbXBhcmUocC5yb3csIHAuY29sdW1uKTsKICAgIH07CiAgICB0aGlzLmNvbnRhaW5zUmFuZ2UgPSBmdW5jdGlvbiAocmFuZ2UpIHsKICAgICAgICByZXR1cm4gdGhpcy5jb21wYXJlUG9pbnQocmFuZ2Uuc3RhcnQpID09IDAgJiYgdGhpcy5jb21wYXJlUG9pbnQocmFuZ2UuZW5kKSA9PSAwOwogICAgfTsKICAgIHRoaXMuaW50ZXJzZWN0cyA9IGZ1bmN0aW9uIChyYW5nZSkgewogICAgICAgIHZhciBjbXAgPSB0aGlzLmNvbXBhcmVSYW5nZShyYW5nZSk7CiAgICAgICAgcmV0dXJuIChjbXAgPT0gLTEgfHwgY21wID09IDAgfHwgY21wID09IDEpOwogICAgfTsKICAgIHRoaXMuaXNFbmQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICByZXR1cm4gdGhpcy5lbmQucm93ID09IHJvdyAmJiB0aGlzLmVuZC5jb2x1bW4gPT0gY29sdW1uOwogICAgfTsKICAgIHRoaXMuaXNTdGFydCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHJldHVybiB0aGlzLnN0YXJ0LnJvdyA9PSByb3cgJiYgdGhpcy5zdGFydC5jb2x1bW4gPT0gY29sdW1uOwogICAgfTsKICAgIHRoaXMuc2V0U3RhcnQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAodHlwZW9mIHJvdyA9PSAib2JqZWN0IikgewogICAgICAgICAgICB0aGlzLnN0YXJ0LmNvbHVtbiA9IHJvdy5jb2x1bW47CiAgICAgICAgICAgIHRoaXMuc3RhcnQucm93ID0gcm93LnJvdzsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIHRoaXMuc3RhcnQucm93ID0gcm93OwogICAgICAgICAgICB0aGlzLnN0YXJ0LmNvbHVtbiA9IGNvbHVtbjsKICAgICAgICB9CiAgICB9OwogICAgdGhpcy5zZXRFbmQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAodHlwZW9mIHJvdyA9PSAib2JqZWN0IikgewogICAgICAgICAgICB0aGlzLmVuZC5jb2x1bW4gPSByb3cuY29sdW1uOwogICAgICAgICAgICB0aGlzLmVuZC5yb3cgPSByb3cucm93OwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgdGhpcy5lbmQucm93ID0gcm93OwogICAgICAgICAgICB0aGlzLmVuZC5jb2x1bW4gPSBjb2x1bW47CiAgICAgICAgfQogICAgfTsKICAgIHRoaXMuaW5zaWRlID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgaWYgKHRoaXMuY29tcGFyZShyb3csIGNvbHVtbikgPT0gMCkgewogICAgICAgICAgICBpZiAodGhpcy5pc0VuZChyb3csIGNvbHVtbikgfHwgdGhpcy5pc1N0YXJ0KHJvdywgY29sdW1uKSkgewogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgfTsKICAgIHRoaXMuaW5zaWRlU3RhcnQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAodGhpcy5jb21wYXJlKHJvdywgY29sdW1uKSA9PSAwKSB7CiAgICAgICAgICAgIGlmICh0aGlzLmlzRW5kKHJvdywgY29sdW1uKSkgewogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgfTsKICAgIHRoaXMuaW5zaWRlRW5kID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgaWYgKHRoaXMuY29tcGFyZShyb3csIGNvbHVtbikgPT0gMCkgewogICAgICAgICAgICBpZiAodGhpcy5pc1N0YXJ0KHJvdywgY29sdW1uKSkgewogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgfTsKICAgIHRoaXMuY29tcGFyZSA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIGlmICghdGhpcy5pc011bHRpTGluZSgpKSB7CiAgICAgICAgICAgIGlmIChyb3cgPT09IHRoaXMuc3RhcnQucm93KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gY29sdW1uIDwgdGhpcy5zdGFydC5jb2x1bW4gPyAtMSA6IChjb2x1bW4gPiB0aGlzLmVuZC5jb2x1bW4gPyAxIDogMCk7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgaWYgKHJvdyA8IHRoaXMuc3RhcnQucm93KQogICAgICAgICAgICByZXR1cm4gLTE7CiAgICAgICAgaWYgKHJvdyA+IHRoaXMuZW5kLnJvdykKICAgICAgICAgICAgcmV0dXJuIDE7CiAgICAgICAgaWYgKHRoaXMuc3RhcnQucm93ID09PSByb3cpCiAgICAgICAgICAgIHJldHVybiBjb2x1bW4gPj0gdGhpcy5zdGFydC5jb2x1bW4gPyAwIDogLTE7CiAgICAgICAgaWYgKHRoaXMuZW5kLnJvdyA9PT0gcm93KQogICAgICAgICAgICByZXR1cm4gY29sdW1uIDw9IHRoaXMuZW5kLmNvbHVtbiA/IDAgOiAxOwogICAgICAgIHJldHVybiAwOwogICAgfTsKICAgIHRoaXMuY29tcGFyZVN0YXJ0ID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgaWYgKHRoaXMuc3RhcnQucm93ID09IHJvdyAmJiB0aGlzLnN0YXJ0LmNvbHVtbiA9PSBjb2x1bW4pIHsKICAgICAgICAgICAgcmV0dXJuIC0xOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZShyb3csIGNvbHVtbik7CiAgICAgICAgfQogICAgfTsKICAgIHRoaXMuY29tcGFyZUVuZCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIGlmICh0aGlzLmVuZC5yb3cgPT0gcm93ICYmIHRoaXMuZW5kLmNvbHVtbiA9PSBjb2x1bW4pIHsKICAgICAgICAgICAgcmV0dXJuIDE7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICByZXR1cm4gdGhpcy5jb21wYXJlKHJvdywgY29sdW1uKTsKICAgICAgICB9CiAgICB9OwogICAgdGhpcy5jb21wYXJlSW5zaWRlID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgaWYgKHRoaXMuZW5kLnJvdyA9PSByb3cgJiYgdGhpcy5lbmQuY29sdW1uID09IGNvbHVtbikgewogICAgICAgICAgICByZXR1cm4gMTsKICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAodGhpcy5zdGFydC5yb3cgPT0gcm93ICYmIHRoaXMuc3RhcnQuY29sdW1uID09IGNvbHVtbikgewogICAgICAgICAgICByZXR1cm4gLTE7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICByZXR1cm4gdGhpcy5jb21wYXJlKHJvdywgY29sdW1uKTsKICAgICAgICB9CiAgICB9OwogICAgdGhpcy5jbGlwUm93cyA9IGZ1bmN0aW9uIChmaXJzdFJvdywgbGFzdFJvdykgewogICAgICAgIGlmICh0aGlzLmVuZC5yb3cgPiBsYXN0Um93KQogICAgICAgICAgICB2YXIgZW5kID0geyByb3c6IGxhc3RSb3cgKyAxLCBjb2x1bW46IDAgfTsKICAgICAgICBlbHNlIGlmICh0aGlzLmVuZC5yb3cgPCBmaXJzdFJvdykKICAgICAgICAgICAgdmFyIGVuZCA9IHsgcm93OiBmaXJzdFJvdywgY29sdW1uOiAwIH07CiAgICAgICAgaWYgKHRoaXMuc3RhcnQucm93ID4gbGFzdFJvdykKICAgICAgICAgICAgdmFyIHN0YXJ0ID0geyByb3c6IGxhc3RSb3cgKyA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vaW50LCBtb3ZlSWZFcXVhbCkgewogICAgICAgIHZhciBkZWx0YUlzSW5zZXJ0ID0gZGVsdGEuYWN0aW9uID09ICJpbnNlcnQiOwogICAgICAgIHZhciBkZWx0YVJvd1NoaWZ0ID0gKGRlbHRhSXNJbnNlcnQgPyAxIDogLTEpICogKGRlbHRhLmVuZC5yb3cgLSBkZWx0YS5zdGFydC5yb3cpOwogICAgICAgIHZhciBkZWx0YUNvbFNoaWZ0ID0gKGRlbHRhSXNJbnNlcnQgPyAxIDogLTEpICogKGRlbHRhLmVuZC5jb2x1bW4gLSBkZWx0YS5zdGFydC5jb2x1bW4pOwogICAgICAgIHZhciBkZWx0YVN0YXJ0ID0gZGVsdGEuc3RhcnQ7CiAgICAgICAgdmFyIGRlbHRhRW5kID0gZGVsdGFJc0luc2VydCA/IGRlbHRhU3RhcnQgOiBkZWx0YS5lbmQ7IC8vIENvbGxhcHNlIGluc2VydCByYW5nZS4KICAgICAgICBpZiAoJHBvaW50c0luT3JkZXIocG9pbnQsIGRlbHRhU3RhcnQsIG1vdmVJZkVxdWFsKSkgewogICAgICAgICAgICByZXR1cm4gewogICAgICAgICAgICAgICAgcm93OiBwb2ludC5yb3csCiAgICAgICAgICAgICAgICBjb2x1bW46IHBvaW50LmNvbHVtbgogICAgICAgICAgICB9OwogICAgICAgIH0KICAgICAgICBpZiAoJHBvaW50c0luT3JkZXIoZGVsdGFFbmQsIHBvaW50LCAhbW92ZUlmRXF1YWwpKSB7CiAgICAgICAgICAgIHJldHVybiB7CiAgICAgICAgICAgICAgICByb3c6IHBvaW50LnJvdyArIGRlbHRhUm93U2hpZnQsCiAgICAgICAgICAgICAgICBjb2x1bW46IHBvaW50LmNvbHVtbiArIChwb2ludC5yb3cgPT0gZGVsdGFFbmQucm93ID8gZGVsdGFDb2xTaGlmdCA6IDApCiAgICAgICAgICAgIH07CiAgICAgICAgfQogICAgICAgIHJldHVybiB7CiAgICAgICAgICAgIHJvdzogZGVsdGFTdGFydC5yb3csCiAgICAgICAgICAgIGNvbHVtbjogZGVsdGFTdGFydC5jb2x1bW4KICAgICAgICB9OwogICAgfQogICAgdGhpcy5zZXRQb3NpdGlvbiA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbiwgbm9DbGlwKSB7CiAgICAgICAgdmFyIHBvczsKICAgICAgICBpZiAobm9DbGlwKSB7CiAgICAgICAgICAgIHBvcyA9IHsKICAgICAgICAgICAgICAgIHJvdzogcm93LAogICAgICAgICAgICAgICAgY29sdW1uOiBjb2x1bW4KICAgICAgICAgICAgfTsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIHBvcyA9IHRoaXMuJGNsaXBQb3NpdGlvblRvRG9jdW1lbnQocm93LCBjb2x1bW4pOwogICAgICAgIH0KICAgICAgICBpZiAodGhpcy5yb3cgPT0gcG9zLnJvdyAmJiB0aGlzLmNvbHVtbiA9PSBwb3MuY29sdW1uKQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgdmFyIG9sZCA9IHsKICAgICAgICAgICAgcm93OiB0aGlzLnJvdywKICAgICAgICAgICAgY29sdW1uOiB0aGlzLmNvbHVtbgogICAgICAgIH07CiAgICAgICAgdGhpcy5yb3cgPSBwb3Mucm93OwogICAgICAgIHRoaXMuY29sdW1uID0gcG9zLmNvbHVtbjsKICAgICAgICB0aGlzLl9zaWduYWwoImNoYW5nZSIsIHsKICAgICAgICAgICAgb2xkOiBvbGQsCiAgICAgICAgICAgIHZhbHVlOiBwb3MKICAgICAgICB9KTsKICAgIH07CiAgICB0aGlzLmRldGFjaCA9IGZ1bmN0aW9uICgpIHsKICAgICAgICB0aGlzLmRvY3VtZW50Lm9mZigiY2hhbmdlIiwgdGhpcy4kb25DaGFuZ2UpOwogICAgfTsKICAgIHRoaXMuYXR0YWNoID0gZnVuY3Rpb24gKGRvYykgewogICAgICAgIHRoaXMuZG9jdW1lbnQgPSBkb2MgfHwgdGhpcy5kb2N1bWVudDsKICAgICAgICB0aGlzLmRvY3VtZW50L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k7CiAgICB9OwogICAgdGhpcy5jcmVhdGVBbmNob3IgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICByZXR1cm4gbmV3IEFuY2hvcih0aGlzLCByb3csIGNvbHVtbik7CiAgICB9OwogICAgaWYgKCJhYWEiLnNwbGl0KC9hLykubGVuZ3RoID09PSAwKSB7CiAgICAgICAgdGhpcy4kc3BsaXQgPSBmdW5jdGlvbiAodGV4dCkgewogICAgICAgICAgICByZXR1cm4gdGV4dC5yZXBsYWNlKC9cclxufFxyL2csICJcbiIpLnNwbGl0KCJcbiIpOwogICAgICAgIH07CiAgICB9CiAgICBlbHNlIHsKICAgICAgICB0aGlzLiRzcGxpdCA9IGZ1bmN0aW9uICh0ZXh0KSB7CiAgICAgICAgICAgIHJldHVybiB0ZXh0LnNwbGl0KC9cclxufFxyfFxuLyk7CiAgICAgICAgfTsKICAgIH0KICAgIHRoaXMuJGRldGVjdE5ld0xpbmUgPSBmdW5jdGlvbiAodGV4dCkgewogICAgICAgIHZhciBtYXRjaCA9IHRleHQubWF0Y2goL14uKj8oXHJcbnxccnxcbikvbSk7CiAgICAgICAgdGhpcy4kYXV0b05ld0xpbmUgPSBtYXRjaCA/IG1hdGNoWzFdIDogIlxuIjsKICAgICAgICB0aGlzLl9zaWduYWwoImNoYW5nZU5ld0xpbmVNb2RlIik7CiAgICB9OwogICAgdGhpcy5nZXROZXdMaW5lQ2hhcmFjdGVyID0gZnVuY3Rpb24gKCkgewogICAgICAgIHN3aXRjaCAodGhpcy4kbmV3TGluZU1vZGUpIHsKICAgICAgICAgICAgY2FzZSAid2luZG93cyI6CiAgICAgICAgICAgICAgICByZXR1cm4gIlxyXG4iOwogICAgICAgICAgICBjYXNlICJ1bml4IjoKICAgICAgICAgICAgICAgIHJldHVybiAiXG4iOwogICAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuJGF1dG9OZXdMaW5lIHx8ICJcbiI7CiAgICAgICAgf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i5yb3csIHBvc2l0aW9uLmNvbHVtbik7CiAgICAgICAgdmFyIGVuZCA9IHRoaXMucG9zKHBvc2l0aW9uLnJvdywgcG9zaXRpb24uY29sdW1uICsgdGV4dC5sZW5ndGgpOwogICAgICAgIHRoaXMuYXBwbHlEZWx0YSh7CiAgICAgICAgICAgIHN0YXJ0OiBzdGFydCwKICAgICAgICAgICAgZW5kOiBlbmQsCiAgICAgICAgICAgIGFjdGlvbjogImluc2VydCIsCiAgICAgICAgICAgIGxpbmVzOiBbdGV4dF0KICAgICAgICB9LCB0cnVlKTsKICAgICAgICByZXR1cm4gdGhpcy5jbG9uZVBvcyhlbmQpOwogICAgfTsKICAgIHRoaXMuY2xpcHBlZFBvcyA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHZhciBsZW5ndGggPSB0aGlzLmdldExlbmd0aCgpOwogICAgICAgIGlmIChyb3cgPT09IHVuZGVmaW5lZCkgewogICAgICAgICAgICByb3cgPSBsZW5ndGg7CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKHJvdyA8IDApIHsKICAgICAgICAgICAgcm93ID0gMDsKICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAocm93ID49IGxlbmd0aCkgewogICAgICAgICAgICByb3cgPSBsZW5ndGggLSAxOwogICAgICAgICAgICBjb2x1bW4gPSB1bmRlZmluZWQ7CiAgICAgICAgfQogICAgICAgIHZhciBsaW5lID0gdGhpcy5nZXRMaW5lKHJvdyk7CiAgICAgICAgaWYgKGNvbHVtbiA9PSB1bmRlZmluZWQpCiAgICAgICAgICAgIGNvbHVtbiA9IGxpbmUubGVuZ3RoOwogICAgICAgIGNvbHVtbiA9IE1hdGgubWluKE1hdGgubWF4KGNvbHVtbiwgMCksIGxpbmUubGVuZ3RoKTsKICAgICAgICByZXR1cm4geyByb3c6IHJvdywgY29sdW1uOiBjb2x1bW4gfTsKICAgIH07CiAgICB0aGlzLmNsb25lUG9zID0gZnVuY3Rpb24gKHBvcykgewogICA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HVtbiA9IDA7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICBsaW5lcyA9IFsiIl0uY29uY2F0KGxpbmVzKTsKICAgICAgICAgICAgcm93LS07CiAgICAgICAgICAgIGNvbHVtbiA9IHRoaXMuJGxpbmVzW3Jvd10ubGVuZ3RoOwogICAgICAgIH0KICAgICAgICB0aGlzLmluc2VydE1lcmdlZExpbmVzKHsgcm93OiByb3csIGNvbHVtbjogY29sdW1uIH0sIGxpbmVzKTsKICAgIH07CiAgICB0aGlzLmluc2VydE1lcmdlZExpbmVzID0gZnVuY3Rpb24gKHBvc2l0aW9uLCBsaW5lcykgewogICAgICAgIHZhciBzdGFydCA9IHRoaXMuY2xpcHBlZFBvcyhwb3NpdGlvbi5yb3csIHBvc2l0aW9uLmNvbHVtbik7CiAgICAgICAgdmFyIGVuZCA9IHsKICAgICAgICAgICAgcm93OiBzdGFydC5yb3cgKyBsaW5lcy5sZW5ndGggLSAxLAogICAgICAgICAgICBjb2x1bW46IChsaW5lcy5sZW5ndGggPT0gMSA/IHN0YXJ0LmNvbHVtbiA6IDApICsgbGluZXNbbGluZXMubGVuZ3RoIC0gMV0ubGVuZ3RoCiAgICAgICAgfTsKICAgICAgICB0aGlzLmFwcGx5RGVsdGEoewogICAgICAgICAgICBzdGFydDogc3RhcnQsCiAgICAgICAgICAgIGVuZDogZW5kLAogICAgICAgICAgICBhY3Rpb246ICJpbnNlcnQiLAogICAgICAgICAgICBsaW5lczogbGluZXMKICAgICAgICB9KTsKICAgICAgICByZXR1cm4gdGhpcy5jbG9uZVBvcyhlbmQpOwogICAgfTsKICAgIHRoaXMucmVtb3ZlID0gZnVuY3Rpb24gKHJhbmdlKSB7CiAgICAgICAgdmFyIHN0YXJ0ID0gdGhpcy5jbGlwcGVkUG9zKHJhbmdlLnN0YXJ0LnJvdywgcmFuZ2Uuc3RhcnQuY29sdW1uKTsKICAgICAgICB2YXIgZW5kID0gdGhpcy5jbGlwcGVkUG9zKHJhbmdl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KICAgICAgICAgICAgY29weVtpXSA9IHRoaXMuY29weU9iamVjdChhcnJheVtpXSk7CiAgICAgICAgZWxzZQogICAgICAgICAgICBjb3B5W2ldID0gYXJyYXlbaV07CiAgICB9CiAgICByZXR1cm4gY29weTsKfTsKZXhwb3J0cy5kZWVwQ29weSA9IGZ1bmN0aW9uIGRlZXBDb3B5KG9iaikgewogICAgaWYgKHR5cGVvZiBvYmogIT09ICJvYmplY3QiIHx8ICFvYmopCiAgICAgICAgcmV0dXJuIG9iajsKICAgIHZhciBjb3B5OwogICAgaWYgKEFycmF5LmlzQXJyYXkob2JqKSkgewogICAgICAgIGNvcHkgPSBbXTsKICAgICAgICBmb3IgKHZhciBrZXkgPSAwOyBrZXkgPCBvYmoubGVuZ3RoOyBrZXkrKykgewogICAgICAgICAgICBjb3B5W2tleV0gPSBkZWVwQ29weShvYmpba2V5XSk7CiAgICAgICAgfQogICAgICAgIHJldHVybiBjb3B5OwogICAgfQogICAgaWYgKE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbChvYmopICE9PSAiW29iamVjdCBPYmplY3RdIikKICAgICAgICByZXR1cm4gb2JqOwogICAgY29weSA9IHt9OwogICAgZm9yICh2YXIga2V5IGluIG9iaikKICAgICAgICBjb3B5W2tleV0gPSBkZWVwQ29weShvYmpba2V5XSk7CiAgICByZXR1cm4gY29weTsKfTsKZXhwb3J0cy5hcnJheVRvTWFwID0gZnVuY3Rpb24gKGFycikgewogICAgdmFyIG1hcCA9IHt9OwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBhcnIubGVuZ3RoOyBpKyspIHsKICAgICAgICBtYXBbYXJyW2ldXSA9IDE7CiAgICB9CiAgICByZXR1cm4gbWFwOwp9OwpleHBvcnRzLmNyZWF0ZU1hcCA9IGZ1bmN0aW9uIChwcm9wcykgewogICAgdmFyIG1hcCA9IE9iamVjdC5jcmVhdGUobnVsbCk7CiAgICBmb3IgKHZhciBpIGluIHByb3BzKSB7CiAgICAgICAgbWF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RoaXMub25VcGRhdGUuYmluZCh0aGlzKSk7CiAgICAKICAgIHZhciBfc2VsZiA9IHRoaXM7CiAgICBzZW5kZXIub24oImNoYW5nZSIsIGZ1bmN0aW9uKGUpIHsKICAgICAgICB2YXIgZGF0YSA9IGUuZGF0YTsKICAgICAgICBpZiAoZGF0YVswXS5zdGFydCkgewogICAgICAgICAgICBkb2MuYXBwbHlEZWx0YXMoZGF0YSk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBkYXRhLmxlbmd0aDsgaSArPSAyKSB7CiAgICAgICAgICAgICAgICB2YXIgZCwgZXJyOyAKICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KGRhdGFbaSsxXSkpIHsKICAgICAgICAgICAgICAgICAgICBkID0ge2FjdGlvbjogImluc2VydCIsIHN0YXJ0OiBkYXRhW2ldLCBsaW5lczogZGF0YVtpKzFdfTsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgZCA9IHthY3Rpb246ICJyZW1vdmUiLCBzdGFydDogZGF0YVtpXSwgZW5kOiBkYXRhW2krMV19OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICBpZiAoKGQuYWN0aW9uID09ICJpbnNlcnQiID8gZC5zdGFydCA6IGQuZW5kKS5yb3cgPj0gZG9jLiRsaW5lcy5sZW5ndGgpIHsKICAgICAgICAgICAgICAgICAgICBlcnIgPSBuZXcgRXJyb3IoIkludmFsaWQgZGVsdGEiKTsKICAgICAgICAgICAgICAgICAgICBlcnIuZGF0YSA9IHsKICAgICAgICAgICAgICAgICAgICAgICAgcGF0aDogX3NlbGYuJHBhdGgsCiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVzTGVuZ3RoOiBkb2MuJGxpbmVzLmxlbmd0aCwKICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQ6IGQuc3RhcnQsCiAgICAgICAgICAgICAgICAgICAgICAgIGVuZDogZC5lbmQKICAgICAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICAgICAgICAgIHRocm93IGVycjsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICBkb2MuYXBwbHlEZWx0YShkLCB0cnVlKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBpZiAoX3NlbGYuJHRpbWVvdXQpCiAgICAgICAgICAgIHJldHVybiBkZWZlcnJlZFVwZGF0ZS5zY2hlZHVsZShfc2VsZi4kdGltZW91dCk7CiAgICAgICAgX3NlbGYub25VcGRhdGUoKTsKICAgIH0pOwp9OwoKKGZ1bmN0aW9uKCkgewogICAgCiAgICB0aGlzLiR0aW1lb3V0ID0gNTAwOwogICAgCiAgICB0aGlzLnNldFRpbWVvdXQgPSBmdW5jdGlvbih0aW1lb3V0KSB7CiAgICAgICAgdGhpcy4kdGltZW91dCA9IHRpbWVvdXQ7CiAgICB9OwogICAgCiAgICB0aGlzLnNldFZhbHVlID0gZnVuY3Rpb24odmFsdWUpIHsKICAgICAgICB0aGlzLmRvYy5zZXRWYWx1ZSh2YWx1ZSk7CiAgICAgICAgdGhpcy5kZWZlcnJlZFVwZGF0ZS5zY2hlZHVsZSh0aGlzLiR0aW1lb3V0KTsKICAgIH07CiAgICAKICAgIHRoaXMuZ2V0VmFsdWUgPSBmdW5jdGlvbihjYWxsYmFja0lkKSB7CiAgICAgICAgdGhpcy5zZW5kZXIuY2FsbGJhY2sodGhpcy5kb2MuZ2V0VmFsdWUoKSwgY2FsbGJhY2tJZCk7CiAgICB9OwogICAgCiAgICB0aGlzLm9uVXBkYXRlID0gZnVuY3Rpb24oKSB7CiAgICB9OwogICAgCiAgICB0aGlzLmlzUGVuZGluZyA9IGZ1bmN0aW9uKCkgewogICAgICAgIHJldHVybiB0aGlzLmRlZmVycmVkVXBkYXRlLmlzUGVuZGluZygpOwogICAgfTsKICAgIAp9KS5jYWxsKE1pcnJvci5wcm90b3R5cGUpOwoKfSk7CgphY2UuZGVmaW5lKCJhY2UvbW9kZS9qc29uL2pzb25fcGFyc2UiLFtdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpIHsKInVzZSBzdHJpY3QiOwoKICAgIHZhciBhdCwgICAgIC8vIFRoZSBpbmRleCBvZiB0aGUgY3VycmVudCBjaGFyYWN0ZXIKICAgICAgICBjaCwgICAgIC8vIFRoZSBjdXJyZW50IGNoYXJhY3RlcgogICAgICAgIGVzY2FwZWUgPSB7CiAgICAgICAgICAgICciJzogICciJywKICAgICAgICAgICAgJ1xcJzogJ1xcJywKICAgICAgICAgICAgJy8nOiAgJy8nLAogICAgICAgICAgICBiOiAgICAnXGInLAogICAgICAgICAgICBmOiAgICAnXGYnLAogICAgICAgICAgICBuOiAgICAnXG4nLAogICAgICAgICAgICByOiAgICAnXHInLAogICAgICAgICAgICB0OiAgICAnXHQnCiAgICAgICAgfSwKICAgICAgICB0ZXh0LAoKICAgICAgICBlcnJvciA9IGZ1bmN0aW9uIChtKSB7CgogICAgICAgICAgICB0aHJvdyB7CiAgICAgICAgICAgICAgICBuYW1lOiAgICAnU3ludGF4RXJyb3InLAogICAgICAgICAgICAgICAgbWVzc2FnZTogbSwKICAgICAgICAgICAgICAgIGF0OiAgICAgIGF0LAogICAgICAgICAgICAgICAgdGV4dDogICAgdGV4dAogICAgICAgICAgICB9OwogICAgICAgIH0sCgogICAgICAgIG5leHQgPSBmdW5jdGlvbiAoYykgewoKICAgICAgICAgICAgaWYgKGMgJiYgYyAhPT0gY2gpIHsKICAgICAgICAgICAgICAgIGVycm9yKCJFeHBlY3RlZCAnIiArIGMgKyAiJyBpbnN0ZWFkIG9mICciICsgY2ggKyAiJyIpOwogICAgICAgICAgICB9CgogICAgICAgICAgICBjaCA9IHRleHQuY2hhckF0KGF0KTsKICAgICAgICAgICAgYXQgKz0gMTsKICAgICAgICAgICAgcmV0dXJuIGNoOwogICAgICAgIH0sCgogICAgICAgIG51bWJlciA9IGZ1bmN0aW9uICgpIHsKCiAgICAgICAgICAgIHZhciBudW1iZXIsCiAgICAgICAgICAgICAgICBzdHJpbmcgPSAnJzsKCiAgICAgICAgICAgIGlmIChjaCA9PT0gJy0nKSB7CiAgICAgICAgICAgICAgICBzdHJpbmcgPSAnLSc7CiAgICAgICAgICAgICAgICBuZXh0KCctJyk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgd2hpbGUgKGNoID49ICcwJyAmJiBjaCA8PSAnOScpIHsKICAgICAgICAgICAgICAgIHN0cmluZyArPSBjaDsKICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoY2ggPT09ICcuJykgewogICAgICAgICAgICAgICAgc3RyaW5nICs9ICcuJzsKICAgICAgICAgICAgICAgIHdoaWxlIChuZXh0KCkgJiYgY2ggPj0gJzAnICYmIGNoIDw9ICc5JykgewogICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBjaDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoY2ggPT09ICdlJyB8fCBjaCA9PT0gJ0UnKSB7CiAgICAgICAgICAgICAgICBzdHJpbmcgKz0gY2g7CiAgICAgICAgICAgICAgICBuZXh0KCk7CiAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICctJyB8fCBjaCA9PT0gJysnKSB7CiAgICAgICAgICAgICAgICAgICAgc3RyaW5nICs9IGNoOwogICAgICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHdoaWxlIChjaCA+PSAnMCcgJiYgY2ggPD0gJzknKSB7CiAgICAgICAgICAgICAgICAgICAgc3RyaW5nICs9IGNoOwogICAgICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBudW1iZXIgPSArc3RyaW5nOwogICAgICAgICAgICBpZiAoaXNOYU4obnVtYmVyKSkgewogICAgICAgICAgICAgICAgZXJyb3IoIkJhZCBudW1iZXIiKTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXI7CiAgICAgICAgICAgIH0KICAgICAgICB9LAoKICAgICAgICBzdHJpbmcgPSBmdW5jdGlvbiAoKSB7CgogICAgICAgICAgICB2YXIgaGV4LAogICAgICAgICAgICAgICAgaSwKICAgICAgICAgICAgICAgIHN0cmluZyA9ICcnLAogICAgICAgICAgICAgICAgdWZmZmY7CgogICAgICAgICAgICBpZiAoY2ggPT09ICciJykgewogICAgICAgICAgICAgICAgd2hpbGUgKG5leHQoKSkgewogICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJyInKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN0cmluZzsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNoID09PSAnXFwnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNoID09PSAndScpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVmZmZmID0gMDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCA0OyBpICs9IDEpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZXggPSBwYXJzZUludChuZXh0KCksIDE2KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWlzRmluaXRlKGhleCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVmZmZmID0gdWZmZmYgKiAxNiArIGhleDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBTdHJpbmcuZnJvbUNoYXJDb2RlKHVmZmZmKTsKICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgZXNjYXBlZVtjaF0gPT09ICdzdHJpbmcnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJpbmcgKz0gZXNjYXBlZVtjaF07CiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2ggPT0gIlxuIiB8fCBjaCA9PSAiXHIiKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBjaDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZXJyb3IoIkJhZCBzdHJpbmciKTsKICAgICAgICB9LAoKICAgICAgICB3aGl0ZSA9IGZ1bmN0aW9uICgpIHsKCiAgICAgICAgICAgIHdoaWxlIChjaCAmJiBjaCA8PSAnICcpIHsKICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgfQogICAgICAgIH0sCgogICAgICAgIHdvcmQgPSBmdW5jdGlvbiAoKSB7CgogICAgICAgICAgICBzd2l0Y2ggKGNoKSB7CiAgICAgICAgICAgIGNhc2UgJ3QnOgogICAgICAgICAgICAgICAgbmV4dCgndCcpOwogICAgICAgICAgICAgICAgbmV4dCgncicpOwogICAgICAgICAgICAgICAgbmV4dCgndScpOwogICAgICAgICAgICAgICAgbmV4dCgnZScpOwogICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgIGNhc2UgJ2YnOgogICAgICAgICAgICAgICAgbmV4dCgnZicpOwogICAgICAgICAgICAgICAgbmV4dCgnYScpOwogICAgICAgICAgICAgICAgbmV4dCgnbCcpOwogICAgICAgICAgICAgICAgbmV4dCgncycpOwogICAgICAgICAgICAgICAgbmV4dCgnZScpOwogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICBjYXNlICduJzoKICAgICAgICAgICAgICAgIG5leHQoJ24nKTsKICAgICAgICAgICAgICAgIG5leHQoJ3UnKTsKICAgICAgICAgICAgICAgIG5leHQoJ2wnKTsKICAgICAgICAgICAgICAgIG5leHQoJ2wnKTsKICAgICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVycm9yKCJVbmV4cGVjdGVkICciICsgY2ggKyAiJyIpOwogICAgICAgIH0sCgogICAgICAgIHZhbHVlLCAgLy8gUGxhY2UgaG9sZGVyIGZvciB0aGUgdmFsdWUgZnVuY3Rpb24uCgogICAgICAgIGFycmF5ID0gZnVuY3Rpb24gKCkgewoKICAgICAgICAgICAgdmFyIGFycmF5ID0gW107CgogICAgICAgICAgICBpZiAoY2ggPT09ICdbJykgewogICAgICAgICAgICAgICAgbmV4dCgnWycpOwogICAgICAgICAgICAgICAgd2hpdGUoKTsKICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ10nKSB7CiAgICAgICAgICAgICAgICAgICAgbmV4dCgnXScpOwogICAgICAgICAgICAgICAgICAgIHJldHVybiBhcnJheTsgICAvLyBlbXB0eSBhcnJheQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgd2hpbGUgKGNoKSB7CiAgICAgICAgICAgICAgICAgICAgYXJyYXkucHVzaCh2YWx1ZSgpKTsKICAgICAgICAgICAgICAgICAgICB3aGl0ZSgpOwogICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ10nKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQoJ10nKTsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFycmF5OwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBuZXh0KCcsJyk7CiAgICAgICAgICAgICAgICAgICAgd2hpdGUoKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBlcnJvcigiQmFkIGFycmF5Iik7CiAgICAgICAgfSwKCiAgICAgICAgb2JqZWN0ID0gZnVuY3Rpb24gKCkgewoKICAgICAgICAgICAgdmFyIGtleSwKICAgICAgICAgICAgICAgIG9iamVjdCA9IHt9OwoKICAgICAgICAgICAgaWYgKGNoID09PSAneycpIHsKICAgICAgICAgICAgICAgIG5leHQoJ3snKTsKICAgICAgICAgICAgICAgIHdoaXRlKCk7CiAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICd9JykgewogICAgICAgICAgICAgICAgICAgIG5leHQoJ30nKTsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gb2JqZWN0OyAgIC8vIGVtcHR5IG9iamVjdAogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgd2hpbGUgKGNoKSB7CiAgICAgICAgICAgICAgICAgICAga2V5ID0gc3RyaW5nKCk7CiAgICAgICAgICAgICAgICAgICAgd2hpdGUoKTsKICAgICAgICAgICAgICAgICAgICBuZXh0KCc6Jyk7CiAgICAgICAgICAgICAgICAgICAgaWYgKE9iamVjdC5oYXNPd25Qcm9wZXJ0eS5jYWxsKG9iamVjdCwga2V5KSkgewogICAgICAgICAgICAgICAgICAgICAgICBlcnJvcignRHVwbGljYXRlIGtleSAiJyArIGtleSArICciJyk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIG9iamVjdFtrZXldID0gdmFsdWUoKTsKICAgICAgICAgICAgICAgICAgICB3aGl0ZSgpOwogICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ30nKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQoJ30nKTsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9iamVjdDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgbmV4dCgnLCcpOwogICAgICAgICAgICAgICAgICAgIHdoaXRlKCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZXJyb3IoIkJhZCBvYmplY3QiKTsKICAgICAgICB9OwoKICAgIHZhbHVlID0gZnVuY3Rpb24gKCkgewoKICAgICAgICB3aGl0ZSgpOwogICAgICAgIHN3aXRjaCAoY2gpIHsKICAgICAgICBjYXNlICd7JzoKICAgICAgICAgICAgcmV0dXJuIG9iamVjdCgpOwogICAgICAgIGNhc2UgJ1snOgogICAgICAgICAgICByZXR1cm4gYXJyYXkoKTsKICAgICAgICBjYXNlICciJzoKICAgICAgICAgICAgcmV0dXJuIHN0cmluZygpOwogICAgICAgIGNhc2UgJy0nOgogICAgICAgICAgICByZXR1cm4gbnVtYmVyKCk7CiAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgcmV0dXJuIGNoID49ICcwJyAmJiBjaCA8PSAnOScgPyBudW1iZXIoKSA6IHdvcmQoKTsKICAgICAgICB9CiAgICB9OwoKICAgIHJldHVybiBmdW5jdGlvbiAoc291cmNlLCByZXZpdmVyKSB7CiAgICAgICAgdmFyIHJlc3VsdDsKCiAgICAgICAgdGV4dCA9IHNvdXJjZTsKICAgICAgICBhdCA9IDA7CiAgICAgICAgY2ggPSAnICc7CiAgICAgICAgcmVzdWx0ID0gdmFsdWUoKTsKICAgICAgICB3aGl0ZSgpOwogICAgICAgIGlmIChjaCkgewogICAgICAgICAgICBlcnJvcigiU3ludGF4IGVycm9yIik7CiAgICAgICAgfQoKICAgICAgICByZXR1cm4gdHlwZW9mIHJldml2ZXIgPT09ICdmdW5jdGlvbicgPyBmdW5jdGlvbiB3YWxrKGhvbGRlciwga2V5KSB7CiAgICAgICAgICAgIHZhciBrLCB2LCB2YWx1ZSA9IGhvbGRlcltrZXldOwogICAgICAgICAgICBpZiAodmFsdWUgJiYgdHlwZW9mIHZhbHVlID09PSAnb2JqZWN0JykgewogICAgICAgICAgICAgICAgZm9yIChrIGluIHZhbHVlKSB7CiAgICAgICAgICAgICAgICAgICAgaWYgKE9iamVjdC5oYXNPd25Qcm9wZXJ0eS5jYWxsKHZhbHVlLCBrKSkgewogICAgICAgICAgICAgICAgICAgICAgICB2ID0gd2Fsayh2YWx1ZSwgayk7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2ICE9PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlW2tdID0gdjsKICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSB2YWx1ZVtrXTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gcmV2aXZlci5jYWxsKGhvbGRlciwga2V5LCB2YWx1ZSk7CiAgICAgICAgfSh7Jyc6IHJlc3VsdH0sICcnKSA6IHJlc3VsdDsKICAgIH07Cn0pOwoKYWNlLmRlZmluZSgiYWNlL21vZGUvanNvbl93b3JrZXIiLFtdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpIHsKInVzZSBzdHJpY3QiOwoKdmFyIG9vcCA9IHJlcXVpcmUoIi4uL2xpYi9vb3AiKTsKdmFyIE1pcnJvciA9IHJlcXVpcmUoIi4uL3dvcmtlci9taXJyb3IiKS5NaXJyb3I7CnZhciBwYXJzZSA9IHJlcXVpcmUoIi4vanNvbi9qc29uX3BhcnNlIik7Cgp2YXIgSnNvbldvcmtlciA9IGV4cG9ydHMuSnNvbldvcmtlciA9IGZ1bmN0aW9uKHNlbmRlcikgewogICAgTWlycm9yLmNhbGwodGhpcywgc2VuZGVyKTsKICAgIHRoaXMuc2V0VGltZW91dCgyMDApOwp9OwoKb29wLmluaGVyaXRzKEpzb25Xb3JrZXIsIE1pcnJvcik7CgooZnVuY3Rpb24oKSB7CgogICAgdGhpcy5vblVwZGF0ZSA9IGZ1bmN0aW9uKCkgewogICAgICAgIHZhciB2YWx1ZSA9IHRoaXMuZG9jLmdldFZhbHVlKCk7CiAgICAgICAgdmFyIGVycm9ycyA9IFtdOwogICAgICAgIHRyeSB7CiAgICAgICAgICAgIGlmICh2YWx1ZSkKICAgICAgICAgICAgICAgIHBhcnNlKHZhbHVlKTsKICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgIHZhciBwb3MgPSB0aGlzLmRvYy5pbmRleFRvUG9zaXRpb24oZS5hdC0xKTsKICAgICAgICAgICAgZXJyb3JzLnB1c2goewogICAgICAgICAgICAgICAgcm93OiBwb3Mucm93LAogICAgICAgICAgICAgICAgY29sdW1uOiBwb3MuY29sdW1uLAogICAgICAgICAgICAgICAgdGV4dDogZS5tZXNzYWdlLAogICAgICAgICAgICAgICAgdHlwZTogImVycm9yIgogICAgICAgICAgICB9KTsKICAgICAgICB9CiAgICAgICAgdGhpcy5zZW5kZXIuZW1pdCgiYW5ub3RhdGUiLCBlcnJvcnMpOwogICAgfTsKCn0pLmNhbGwoSnNvbldvcmtlci5wcm90b3R5cGUpOwoKfSk7Cg==";ace.config.setModuleUrl("ace/theme/kr_theme",themeUrl2),ace.config.setModuleUrl("ace/mode/json",modeJsonUrl),ace.config.setModuleUrl("ace/mode/json_worker",workerJsonUrl);const _sfc_main$w=vue.defineComponent({__name:"code-edit-modal",props:{modelValue:{default:()=>({})},lang:{default:"json"},title:{default:"编辑"}},emits:["update:modelValue","close"],setup(r,{emit:n}){const i=r,o=vue.ref(!1),a=vue.computed({get(){return i.lang==="json"?JSON.stringify(i.modelValue,null,2):i.modelValue},set(u){i.lang==="json"?n("update:modelValue",JSON.parse(u)):n("update:modelValue",u)}});return(u,c)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(elementPlus.ElButton),{onClick:c[0]||(c[0]=f=>o.value=!0)},{default:vue.withCtx(()=>[vue.createTextVNode("···")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElDialog),{class:"modal-full",modelValue:vue.unref(o),"onUpdate:modelValue":c[2]||(c[2]=f=>vue.isRef(o)?o.value=f:null),title:i.title,width:"60%",onClose:c[3]||(c[3]=f=>n("close"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(VAceEditor),{value:vue.unref(a),"onUpdate:value":c[1]||(c[1]=f=>vue.isRef(a)?a.value=f:null),lang:i.lang,theme:"kr_theme",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value","lang"])]),_:1},8,["modelValue","title"])]))}}),_hoisted_1$b={class:"one-row-txt",style:{width:"78px"}},_hoisted_2$8={key:1},_hoisted_3$7={class:"one-row-txt",style:{width:"145px"}},_hoisted_4$3={key:1},_sfc_main$v=vue.defineComponent({__name:"dynamic-el-form-item",props:{objInfo:{default:()=>({})},hide:{default:()=>[]},code:{type:Boolean,default:!1}},emits:["change"],setup(r,{emit:n}){const i=r,o=vue.computed(()=>{var d;const u={};let c=0,f=[];for(let h of Object.keys(i.objInfo)){const v=(d=i.objInfo[h])==null?void 0:d.sort;if(v){const g=Number(v);g>c&&(c=g)}if(v)u[v]=h;else return Object.keys(i.objInfo).map(g=>({...i.objInfo[g],_key:g}))}for(let h=0;h<c+1;h++){const v=String(h);f.push({...i.objInfo[u[v]],_key:u[v]})}return f});function a(u){let c=window.setTimeout(function(){n("change",u),clearTimeout(c),c=null},200)}return(u,c)=>(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(o),f=>(vue.openBlock(),vue.createElementBlock("div",{key:f._key},[i.code?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:0,class:"props-row",size:"small"},{label:vue.withCtx(()=>[vue.unref(getStringWidth)(String(f._key))>78?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTooltip),{key:0,content:String(f._key),placement:"left","popper-class":"props-popper"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$b,vue.toDisplayString(f._key),1)]),_:2},1032,["content"])):(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$8,vue.toDisplayString(f._key),1))]),default:vue.withCtx(()=>[vue.unref(getStringWidth)(String(f.val))>145?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTooltip),{key:0,content:JSON.stringify(f.val),placement:"left","popper-class":"props-popper"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_3$7,vue.toDisplayString(f.val),1)]),_:2},1032,["content"])):(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$3,vue.toDisplayString(f.val),1))]),_:2},1024)):vue.createCommentVNode("",!0),i.hide.indexOf(String(f._key))<0?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:1,label:f.title,size:"small"},{default:vue.withCtx(()=>[f.type===vue.unref(EConfigItemPropsType).Select?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElSelect),{key:0,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,placeholder:"Select",size:"small",disabled:!!(f!=null&&f.disabled),onChange:a},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(f.options,d=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","disabled"])):f.type===vue.unref(EConfigItemPropsType).InputNumber?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElInputNumber),{key:1,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,disabled:!!(f!=null&&f.disabled),onChange:a},null,8,["modelValue","onUpdate:modelValue","disabled"])):f.type===vue.unref(EConfigItemPropsType).Input?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElInput),{key:2,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,disabled:!!(f!=null&&f.disabled),onChange:a},null,8,["modelValue","onUpdate:modelValue","disabled"])):f.type===vue.unref(EConfigItemPropsType).Textarea?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElInput),{key:3,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,autosize:"",type:"textarea",disabled:!!(f!=null&&f.disabled),onChange:a},null,8,["modelValue","onUpdate:modelValue","disabled"])):f.type===vue.unref(EConfigItemPropsType).Color?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElColorPicker),{key:4,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,disabled:!!(f!=null&&f.disabled),onChange:a},null,8,["modelValue","onUpdate:modelValue","disabled"])):f.type===vue.unref(EConfigItemPropsType).Switch?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElSwitch),{key:5,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,disabled:!!(f!=null&&f.disabled),onChange:a},null,8,["modelValue","onUpdate:modelValue","disabled"])):f.type===vue.unref(EConfigItemPropsType).JsonEdit?(vue.openBlock(),vue.createBlock(_sfc_main$w,{key:6,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,disabled:!!(f!=null&&f.disabled),onClose:a},null,8,["modelValue","onUpdate:modelValue","disabled"])):vue.createCommentVNode("",!0)]),_:2},1032,["label"])):vue.createCommentVNode("",!0)]))),128))}}),dynamicElFormItem_vue_vue_type_style_index_0_scoped_b2819020_lang="",dynamicElFormItem_vue_vue_type_style_index_1_lang="",DynamicElFormItem=_export_sfc$1(_sfc_main$v,[["__scopeId","data-v-b2819020"]]),_hoisted_1$a={style:{height:"100%"}},_hoisted_2$7={class:"flex flex-wrap"},_hoisted_3$6=["onMouseenter","onClick"],_sfc_main$u=vue.defineComponent({__name:"common-animate",props:{val:{}},emits:["updateCommonAniVal"],setup(r,{emit:n}){const i=r,o=vue.ref(i.val),a=vue.ref(!1),u=vue.ref("进入"),c=vue.ref(null),f=d=>{n("updateCommonAniVal",d),a.value=!1};return vue.watch(()=>i.val,d=>{o.value=d}),(d,h)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$a,[vue.unref(o)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTag),{key:0,closable:"",onClose:h[0]||(h[0]=v=>f("")),onClick:h[1]||(h[1]=v=>a.value=!0),style:{cursor:"pointer"}},{default:vue.withCtx(()=>{var v;return[vue.createTextVNode(vue.toDisplayString((v=vue.unref(common_animate_list).map(g=>g.children).reduce((g,p)=>g.concat(p)).find(g=>g.value==vue.unref(o)))==null?void 0:v.label)+" ",1),vue.createVNode(vue.unref(elementPlus.ElIcon),{size:10},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"setting"})]),_:1})]}),_:1})):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTag),{key:1,type:"success",style:{cursor:"pointer"},onClick:h[2]||(h[2]=v=>a.value=!0)},{default:vue.withCtx(()=>[vue.createTextVNode("新增")]),_:1})),vue.createVNode(vue.unref(elementPlus.ElDrawer),{modelValue:vue.unref(a),"onUpdate:modelValue":h[5]||(h[5]=v=>vue.isRef(a)?a.value=v:null),title:"选择动画",direction:"ltr"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElTabs),{modelValue:vue.unref(u),"onUpdate:modelValue":h[4]||(h[4]=v=>vue.isRef(u)?u.value=v:null)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(common_animate_list),v=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTabPane),{label:v.label,name:v.label,key:v.label},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElScrollbar),{height:"500px"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$7,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(v.children,(g,p)=>(vue.openBlock(),vue.createElementBlock("div",{class:"animate",key:p,onMouseenter:y=>c.value=p,onMouseleave:h[3]||(h[3]=y=>c.value=null),onClick:y=>f(g.value)},[vue.createElementVNode("div",{class:vue.normalizeClass(`${vue.unref(c)==p?`animate__animated animate__${g.value} animate__slow animate__infinite`:""}`)},vue.toDisplayString(g.label),3)],40,_hoisted_3$6))),128))])]),_:2},1024)]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])]))}}),commonAnimate_vue_vue_type_style_index_0_scoped_2668f60c_lang="",CommonAnimate=_export_sfc$1(_sfc_main$u,[["__scopeId","data-v-2668f60c"]]),_sfc_main$t=vue.defineComponent({__name:"component-tree",setup(r){const n=useGlobalStore(pinia),i=vue.computed(()=>{var u;return((u=n.handle_svg_info)==null?void 0:u.info.id)??""}),o=u=>{for(let c of n.done_json)c.selected=!1,c.old_position={x:0,y:0};n.intention=EGlobalStoreIntention.Select,n.setHandleSvgInfo(u)},a={children:"children",label:"title"};return(u,c)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTree),{class:"tree-v",data:vue.unref(n).done_json,props:a,onNodeClick:o,"default-expand-all":!0,"expand-on-click-node":!1,"highlight-current":!!vue.unref(i),"node-key":"id","current-node-key":vue.unref(i)},null,8,["data","highlight-current","current-node-key"]))}}),_withScopeId$1=r=>(vue.pushScopeId("data-v-98320511"),r=r(),vue.popScopeId(),r),_hoisted_1$9={class:"wall-l"},_hoisted_2$6={class:"head-l"},_hoisted_3$5=_withScopeId$1(()=>vue.createElementVNode("span",null,"key",-1)),_hoisted_4$2=_withScopeId$1(()=>vue.createElementVNode("span",null,"value",-1)),_hoisted_5$1={class:"row-l"},_sfc_main$s=vue.defineComponent({__name:"list",props:{modelValue:{default:()=>[{key:"",val:""}]}},emits:["update:modelValue"],setup(r,{emit:n}){const i=r,o=vue.computed({get(){return i.modelValue},set(c){n("update:modelValue",c)}}),a=()=>{o.value.push({key:"",val:""})},u=c=>{o.value.splice(c,1)};return(c,f)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$9,[vue.createElementVNode("div",_hoisted_2$6,[_hoisted_3$5,_hoisted_4$2,vue.createVNode(vue.unref(elementPlus.ElIcon),{size:16,class:"bt-Icon",onClick:a},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"add"})]),_:1})]),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(o),(d,h)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_5$1,[vue.createVNode(vue.unref(elementPlus.ElInput),{class:"content-l",modelValue:d.key,"onUpdate:modelValue":v=>d.key=v,size:"small",placeholder:"key"},null,8,["modelValue","onUpdate:modelValue"]),vue.createVNode(vue.unref(elementPlus.ElInput),{class:"content-l",modelValue:d.val,"onUpdate:modelValue":v=>d.val=v,size:"small",placeholder:"value"},null,8,["modelValue","onUpdate:modelValue"]),vue.createVNode(vue.unref(elementPlus.ElIcon),{size:16,class:"bt-Icon",onClick:v=>u(h)},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"delete"})]),_:2},1032,["onClick"])]))),256))]))}}),list_vue_vue_type_style_index_0_scoped_98320511_lang="",List=_export_sfc$1(_sfc_main$s,[["__scopeId","data-v-98320511"]]),composeEventHandlers=(r,n,{checkForDefaultPrevented:i=!0}={})=>a=>{const u=r==null?void 0:r(a);if(i===!1||!u)return n==null?void 0:n(a)};var _a;const isClient=typeof window<"u",isString$1=r=>typeof r=="string",noop=()=>{},isIOS=isClient&&((_a=window==null?void 0:window.navigator)==null?void 0:_a.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function resolveUnref(r){return typeof r=="function"?r():vue.unref(r)}function createFilterWrapper(r,n){function i(...o){return new Promise((a,u)=>{Promise.resolve(r(()=>n.apply(this,o),{fn:n,thisArg:this,args:o})).then(a).catch(u)})}return i}function debounceFilter(r,n={}){let i,o,a=noop;const u=f=>{clearTimeout(f),a(),a=noop};return f=>{const d=resolveUnref(r),h=resolveUnref(n.maxWait);return i&&u(i),d<=0||h!==void 0&&h<=0?(o&&(u(o),o=null),Promise.resolve(f())):new Promise((v,g)=>{a=n.rejectOnCancel?g:v,h&&!o&&(o=setTimeout(()=>{i&&u(i),o=null,v(f())},h)),i=setTimeout(()=>{o&&u(o),o=null,v(f())},d)})}}function identity(r){return r}function tryOnScopeDispose(r){return vue.getCurrentScope()?(vue.onScopeDispose(r),!0):!1}function useDebounceFn(r,n=200,i={}){return createFilterWrapper(debounceFilter(n,i),r)}function refDebounced(r,n=200,i={}){const o=vue.ref(r.value),a=useDebounceFn(()=>{o.value=r.value},n,i);return vue.watch(r,()=>a()),o}function tryOnMounted(r,n=!0){vue.getCurrentInstance()?vue.onMounted(r):n?r():vue.nextTick(r)}function unrefElement(r){var n;const i=resolveUnref(r);return(n=i==null?void 0:i.$el)!=null?n:i}const defaultWindow=isClient?window:void 0;function useEventListener(...r){let n,i,o,a;if(isString$1(r[0])||Array.isArray(r[0])?([i,o,a]=r,n=defaultWindow):[n,i,o,a]=r,!n)return noop;Array.isArray(i)||(i=[i]),Array.isArray(o)||(o=[o]);const u=[],c=()=>{u.forEach(v=>v()),u.length=0},f=(v,g,p,y)=>(v.addEventListener(g,p,y),()=>v.removeEventListener(g,p,y)),d=vue.watch(()=>[unrefElement(n),resolveUnref(a)],([v,g])=>{c(),v&&u.push(...i.flatMap(p=>o.map(y=>f(v,p,y,g))))},{immediate:!0,flush:"post"}),h=()=>{d(),c()};return tryOnScopeDispose(h),h}let _iOSWorkaround=!1;function onClickOutside(r,n,i={}){const{window:o=defaultWindow,ignore:a=[],capture:u=!0,detectIframe:c=!1}=i;if(!o)return;isIOS&&!_iOSWorkaround&&(_iOSWorkaround=!0,Array.from(o.document.body.children).forEach(p=>p.addEventListener("click",noop)));let f=!0;const d=p=>a.some(y=>{if(typeof y=="string")return Array.from(o.document.querySelectorAll(y)).some(_=>_===p.target||p.composedPath().includes(_));{const _=unrefElement(y);return _&&(p.target===_||p.composedPath().includes(_))}}),v=[useEventListener(o,"click",p=>{const y=unrefElement(r);if(!(!y||y===p.target||p.composedPath().includes(y))){if(p.detail===0&&(f=!d(p)),!f){f=!0;return}n(p)}},{passive:!0,capture:u}),useEventListener(o,"pointerdown",p=>{const y=unrefElement(r);y&&(f=!p.composedPath().includes(y)&&!d(p))},{passive:!0}),c&&useEventListener(o,"blur",p=>{var y;const _=unrefElement(r);((y=o.document.activeElement)==null?void 0:y.tagName)==="IFRAME"&&!(_!=null&&_.contains(o.document.activeElement))&&n(p)})].filter(Boolean);return()=>v.forEach(p=>p())}function useSupported(r,n=!1){const i=vue.ref(),o=()=>i.value=!!r();return o(),tryOnMounted(o,n),i}const _global=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},globalKey="__vueuse_ssr_handlers__";_global[globalKey]=_global[globalKey]||{};var __getOwnPropSymbols$g=Object.getOwnPropertySymbols,__hasOwnProp$g=Object.prototype.hasOwnProperty,__propIsEnum$g=Object.prototype.propertyIsEnumerable,__objRest$2=(r,n)=>{var i={};for(var o in r)__hasOwnProp$g.call(r,o)&&n.indexOf(o)<0&&(i[o]=r[o]);if(r!=null&&__getOwnPropSymbols$g)for(var o of __getOwnPropSymbols$g(r))n.indexOf(o)<0&&__propIsEnum$g.call(r,o)&&(i[o]=r[o]);return i};function useResizeObserver(r,n,i={}){const o=i,{window:a=defaultWindow}=o,u=__objRest$2(o,["window"]);let c;const f=useSupported(()=>a&&"ResizeObserver"in a),d=()=>{c&&(c.disconnect(),c=void 0)},h=vue.watch(()=>unrefElement(r),g=>{d(),f.value&&a&&g&&(c=new ResizeObserver(n),c.observe(g,u))},{immediate:!0,flush:"post"}),v=()=>{d(),h()};return tryOnScopeDispose(v),{isSupported:f,stop:v}}var SwipeDirection;(function(r){r.UP="UP",r.RIGHT="RIGHT",r.DOWN="DOWN",r.LEFT="LEFT",r.NONE="NONE"})(SwipeDirection||(SwipeDirection={}));var __defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(r,n,i)=>n in r?__defProp(r,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[n]=i,__spreadValues=(r,n)=>{for(var i in n||(n={}))__hasOwnProp.call(n,i)&&__defNormalProp(r,i,n[i]);if(__getOwnPropSymbols)for(var i of __getOwnPropSymbols(n))__propIsEnum.call(n,i)&&__defNormalProp(r,i,n[i]);return r};const _TransitionPresets={easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]};__spreadValues({linear:identity},_TransitionPresets);const isFirefox=()=>isClient&&/firefox/i.test(window.navigator.userAgent);process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const NOOP=()=>{},hasOwnProperty=Object.prototype.hasOwnProperty,hasOwn=(r,n)=>hasOwnProperty.call(r,n),isArray=Array.isArray,isFunction=r=>typeof r=="function",isString=r=>typeof r=="string",isObject=r=>r!==null&&typeof r=="object",objectToString=Object.prototype.toString,toTypeString=r=>objectToString.call(r),toRawType=r=>toTypeString(r).slice(8,-1),isUndefined=r=>r===void 0,isBoolean=r=>typeof r=="boolean",isNumber=r=>typeof r=="number",isElement=r=>typeof Element>"u"?!1:r instanceof Element,isStringNumber=r=>isString(r)?!Number.isNaN(Number(r)):!1,escapeStringRegexp=(r="")=>r.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),getProp=(r,n,i)=>({get value(){return lodashEs.get(r,n,i)},set value(o){lodashEs.set(r,n,o)}});class ElementPlusError extends Error{constructor(n){super(n),this.name="ElementPlusError"}}function throwError(r,n){throw new ElementPlusError(`[${r}] ${n}`)}function debugWarn(r,n){if(process.env.NODE_ENV!=="production"){const i=isString(r)?new ElementPlusError(`[${r}] ${n}`):r;console.warn(i)}}const SCOPE$1="utils/dom/style";function addUnit(r,n="px"){if(!r)return"";if(isNumber(r)||isStringNumber(r))return`${r}${n}`;if(isString(r))return r;debugWarn(SCOPE$1,"binding value must be a string or number")}function scrollIntoView(r,n){if(!isClient)return;if(!n){r.scrollTop=0;return}const i=[];let o=n.offsetParent;for(;o!==null&&r!==o&&r.contains(o);)i.push(o),o=o.offsetParent;const a=n.offsetTop+i.reduce((d,h)=>d+h.offsetTop,0),u=a+n.offsetHeight,c=r.scrollTop,f=c+r.clientHeight;a<c?r.scrollTop=a:u>f&&(r.scrollTop=u-r.clientHeight)}const epPropKey="__epPropKey",definePropType=r=>r,isEpProp=r=>isObject(r)&&!!r[epPropKey],buildProp=(r,n)=>{if(!isObject(r)||isEpProp(r))return r;const{values:i,required:o,default:a,type:u,validator:c}=r,d={type:u,required:!!o,validator:i||c?h=>{let v=!1,g=[];if(i&&(g=Array.from(i),hasOwn(r,"default")&&g.push(a),v||(v=g.includes(h))),c&&(v||(v=c(h))),!v&&g.length>0){const p=[...new Set(g)].map(y=>JSON.stringify(y)).join(", ");vue.warn(`Invalid prop: validation failed${n?` for prop "${n}"`:""}. Expected one of [${p}], got value ${JSON.stringify(h)}.`)}return v}:void 0,[epPropKey]:!0};return hasOwn(r,"default")&&(d.default=a),d},buildProps=r=>lodashEs.fromPairs(Object.entries(r).map(([n,i])=>[n,buildProp(i,n)])),iconPropType=definePropType([String,Object,Function]),ValidateComponentsMap={validating:loading_default,success:circle_check_default,error:circle_close_default},withInstall=(r,n)=>{if(r.install=i=>{for(const o of[r,...Object.values(n??{})])i.component(o.name,o)},n)for(const[i,o]of Object.entries(n))r[i]=o;return r},withNoopInstall=r=>(r.install=NOOP,r),EVENT_CODE={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},UPDATE_MODEL_EVENT="update:modelValue",CHANGE_EVENT="change",componentSizes=["","default","small","large"],componentSizeMap={large:40,default:32,small:24},getComponentSize=r=>componentSizeMap[r||"default"],isValidComponentSize=r=>["",...componentSizes].includes(r),isKorean=r=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(r),mutable=r=>r,DEFAULT_EXCLUDE_KEYS=["class","style"],LISTENER_PREFIX=/^on[A-Z]/,useAttrs=(r={})=>{const{excludeListeners:n=!1,excludeKeys:i}=r,o=vue.computed(()=>((i==null?void 0:i.value)||[]).concat(DEFAULT_EXCLUDE_KEYS)),a=vue.getCurrentInstance();return a?vue.computed(()=>{var u;return lodashEs.fromPairs(Object.entries((u=a.proxy)==null?void 0:u.$attrs).filter(([c])=>!o.value.includes(c)&&!(n&&LISTENER_PREFIX.test(c))))}):(debugWarn("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),vue.computed(()=>({})))},useDeprecated=({from:r,replacement:n,scope:i,version:o,ref:a,type:u="API"},c)=>{vue.watch(()=>vue.unref(c),f=>{f&&debugWarn(i,`[${u}] ${r} is about to be deprecated in version ${o}, please use ${n} instead.
|
245
245
|
For more detail, please visit: ${a}
|
246
246
|
`)},{immediate:!0})},useFocus=r=>({focus:()=>{var n,i;(i=(n=r.value)==null?void 0:n.focus)==null||i.call(n)}});var English={name:"en",el:{colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color."},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"}}};const buildTranslator=r=>(n,i)=>translate(n,i,vue.unref(r)),translate=(r,n,i)=>lodashEs.get(i,r,r).replace(/\{(\w+)\}/g,(o,a)=>{var u;return`${(u=n==null?void 0:n[a])!=null?u:`{${a}}`}`}),buildLocaleContext=r=>{const n=vue.computed(()=>vue.unref(r).name),i=vue.isRef(r)?r:vue.ref(r);return{lang:n,locale:i,t:buildTranslator(r)}},localeContextKey=Symbol("localeContextKey"),useLocale=r=>{const n=r||vue.inject(localeContextKey,vue.ref());return buildLocaleContext(vue.computed(()=>n.value||English))},defaultNamespace="el",statePrefix="is-",_bem=(r,n,i,o,a)=>{let u=`${r}-${n}`;return i&&(u+=`-${i}`),o&&(u+=`__${o}`),a&&(u+=`--${a}`),u},namespaceContextKey=Symbol("namespaceContextKey"),useGetDerivedNamespace=r=>{const n=r||vue.inject(namespaceContextKey,vue.ref(defaultNamespace));return vue.computed(()=>vue.unref(n)||defaultNamespace)},useNamespace=(r,n)=>{const i=useGetDerivedNamespace(n);return{namespace:i,b:(b="")=>_bem(i.value,r,b,"",""),e:b=>b?_bem(i.value,r,"",b,""):"",m:b=>b?_bem(i.value,r,"","",b):"",be:(b,A)=>b&&A?_bem(i.value,r,b,A,""):"",em:(b,A)=>b&&A?_bem(i.value,r,"",b,A):"",bm:(b,A)=>b&&A?_bem(i.value,r,b,"",A):"",bem:(b,A,w)=>b&&A&&w?_bem(i.value,r,b,A,w):"",is:(b,...A)=>{const w=A.length>=1?A[0]:!0;return b&&w?`${statePrefix}${b}`:""},cssVar:b=>{const A={};for(const w in b)b[w]&&(A[`--${i.value}-${w}`]=b[w]);return A},cssVarName:b=>`--${i.value}-${b}`,cssVarBlock:b=>{const A={};for(const w in b)b[w]&&(A[`--${i.value}-${r}-${w}`]=b[w]);return A},cssVarBlockName:b=>`--${i.value}-${r}-${b}`}},_prop=buildProp({type:definePropType(Boolean),default:null}),_event=buildProp({type:definePropType(Function)}),createModelToggleComposable=r=>{const n=`update:${r}`,i=`onUpdate:${r}`,o=[n],a={[r]:_prop,[i]:_event};return{useModelToggle:({indicator:c,toggleReason:f,shouldHideWhenRouteChanges:d,shouldProceed:h,onShow:v,onHide:g})=>{const p=vue.getCurrentInstance(),{emit:y}=p,_=p.props,b=vue.computed(()=>isFunction(_[i])),A=vue.computed(()=>_[r]===null),w=M=>{c.value!==!0&&(c.value=!0,f&&(f.value=M),isFunction(v)&&v(M))},T=M=>{c.value!==!1&&(c.value=!1,f&&(f.value=M),isFunction(g)&&g(M))},S=M=>{if(_.disabled===!0||isFunction(h)&&!h())return;const re=b.value&&isClient;re&&y(n,!0),(A.value||!re)&&w(M)},x=M=>{if(_.disabled===!0||!isClient)return;const re=b.value&&isClient;re&&y(n,!1),(A.value||!re)&&T(M)},O=M=>{isBoolean(M)&&(_.disabled&&M?b.value&&y(n,!1):c.value!==M&&(M?w():T()))},L=()=>{c.value?x():S()};return vue.watch(()=>_[r],O),d&&p.appContext.config.globalProperties.$route!==void 0&&vue.watch(()=>({...p.proxy.$route}),()=>{d.value&&c.value&&x()}),vue.onMounted(()=>{O(_[r])}),{hide:x,show:S,toggle:L,hasUpdateHandler:b}},useModelToggleProps:a,useModelToggleEmits:o}};createModelToggleComposable("modelValue");const useProp=r=>{const n=vue.getCurrentInstance();return vue.computed(()=>{var i,o;return(o=(i=n==null?void 0:n.proxy)==null?void 0:i.$props)==null?void 0:o[r]})};var E="top",R="bottom",W="right",P="left",me="auto",G=[E,R,W,P],U="start",J="end",Xe="clippingParents",je="viewport",K="popper",Ye="reference",De=G.reduce(function(r,n){return r.concat([n+"-"+U,n+"-"+J])},[]),Ee=[].concat(G,[me]).reduce(function(r,n){return r.concat([n,n+"-"+U,n+"-"+J])},[]),Ge="beforeRead",Je="read",Ke="afterRead",Qe="beforeMain",Ze="main",et="afterMain",tt="beforeWrite",nt="write",rt="afterWrite",ot=[Ge,Je,Ke,Qe,Ze,et,tt,nt,rt];function C(r){return r?(r.nodeName||"").toLowerCase():null}function H(r){if(r==null)return window;if(r.toString()!=="[object Window]"){var n=r.ownerDocument;return n&&n.defaultView||window}return r}function Q(r){var n=H(r).Element;return r instanceof n||r instanceof Element}function B(r){var n=H(r).HTMLElement;return r instanceof n||r instanceof HTMLElement}function Pe(r){if(typeof ShadowRoot>"u")return!1;var n=H(r).ShadowRoot;return r instanceof n||r instanceof ShadowRoot}function Mt(r){var n=r.state;Object.keys(n.elements).forEach(function(i){var o=n.styles[i]||{},a=n.attributes[i]||{},u=n.elements[i];!B(u)||!C(u)||(Object.assign(u.style,o),Object.keys(a).forEach(function(c){var f=a[c];f===!1?u.removeAttribute(c):u.setAttribute(c,f===!0?"":f)}))})}function Rt(r){var n=r.state,i={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,i.popper),n.styles=i,n.elements.arrow&&Object.assign(n.elements.arrow.style,i.arrow),function(){Object.keys(n.elements).forEach(function(o){var a=n.elements[o],u=n.attributes[o]||{},c=Object.keys(n.styles.hasOwnProperty(o)?n.styles[o]:i[o]),f=c.reduce(function(d,h){return d[h]="",d},{});!B(a)||!C(a)||(Object.assign(a.style,f),Object.keys(u).forEach(function(d){a.removeAttribute(d)}))})}}var Ae={name:"applyStyles",enabled:!0,phase:"write",fn:Mt,effect:Rt,requires:["computeStyles"]};function q(r){return r.split("-")[0]}var X=Math.max,ve=Math.min,Z=Math.round;function ee(r,n){n===void 0&&(n=!1);var i=r.getBoundingClientRect(),o=1,a=1;if(B(r)&&n){var u=r.offsetHeight,c=r.offsetWidth;c>0&&(o=Z(i.width)/c||1),u>0&&(a=Z(i.height)/u||1)}return{width:i.width/o,height:i.height/a,top:i.top/a,right:i.right/o,bottom:i.bottom/a,left:i.left/o,x:i.left/o,y:i.top/a}}function ke(r){var n=ee(r),i=r.offsetWidth,o=r.offsetHeight;return Math.abs(n.width-i)<=1&&(i=n.width),Math.abs(n.height-o)<=1&&(o=n.height),{x:r.offsetLeft,y:r.offsetTop,width:i,height:o}}function it(r,n){var i=n.getRootNode&&n.getRootNode();if(r.contains(n))return!0;if(i&&Pe(i)){var o=n;do{if(o&&r.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function N(r){return H(r).getComputedStyle(r)}function Wt(r){return["table","td","th"].indexOf(C(r))>=0}function I(r){return((Q(r)?r.ownerDocument:r.document)||window.document).documentElement}function ge(r){return C(r)==="html"?r:r.assignedSlot||r.parentNode||(Pe(r)?r.host:null)||I(r)}function at(r){return!B(r)||N(r).position==="fixed"?null:r.offsetParent}function Bt(r){var n=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,i=navigator.userAgent.indexOf("Trident")!==-1;if(i&&B(r)){var o=N(r);if(o.position==="fixed")return null}var a=ge(r);for(Pe(a)&&(a=a.host);B(a)&&["html","body"].indexOf(C(a))<0;){var u=N(a);if(u.transform!=="none"||u.perspective!=="none"||u.contain==="paint"||["transform","perspective"].indexOf(u.willChange)!==-1||n&&u.willChange==="filter"||n&&u.filter&&u.filter!=="none")return a;a=a.parentNode}return null}function se(r){for(var n=H(r),i=at(r);i&&Wt(i)&&N(i).position==="static";)i=at(i);return i&&(C(i)==="html"||C(i)==="body"&&N(i).position==="static")?n:i||Bt(r)||n}function Le(r){return["top","bottom"].indexOf(r)>=0?"x":"y"}function fe(r,n,i){return X(r,ve(n,i))}function St(r,n,i){var o=fe(r,n,i);return o>i?i:o}function st(){return{top:0,right:0,bottom:0,left:0}}function ft(r){return Object.assign({},st(),r)}function ct(r,n){return n.reduce(function(i,o){return i[o]=r,i},{})}var Tt=function(r,n){return r=typeof r=="function"?r(Object.assign({},n.rects,{placement:n.placement})):r,ft(typeof r!="number"?r:ct(r,G))};function Ht(r){var n,i=r.state,o=r.name,a=r.options,u=i.elements.arrow,c=i.modifiersData.popperOffsets,f=q(i.placement),d=Le(f),h=[P,W].indexOf(f)>=0,v=h?"height":"width";if(!(!u||!c)){var g=Tt(a.padding,i),p=ke(u),y=d==="y"?E:P,_=d==="y"?R:W,b=i.rects.reference[v]+i.rects.reference[d]-c[d]-i.rects.popper[v],A=c[d]-i.rects.reference[d],w=se(u),T=w?d==="y"?w.clientHeight||0:w.clientWidth||0:0,S=b/2-A/2,x=g[y],O=T-p[v]-g[_],L=T/2-p[v]/2+S,M=fe(x,L,O),re=d;i.modifiersData[o]=(n={},n[re]=M,n.centerOffset=M-L,n)}}function Ct(r){var n=r.state,i=r.options,o=i.element,a=o===void 0?"[data-popper-arrow]":o;a!=null&&(typeof a=="string"&&(a=n.elements.popper.querySelector(a),!a)||!it(n.elements.popper,a)||(n.elements.arrow=a))}var pt={name:"arrow",enabled:!0,phase:"main",fn:Ht,effect:Ct,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function te(r){return r.split("-")[1]}var qt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Vt(r){var n=r.x,i=r.y,o=window,a=o.devicePixelRatio||1;return{x:Z(n*a)/a||0,y:Z(i*a)/a||0}}function ut(r){var n,i=r.popper,o=r.popperRect,a=r.placement,u=r.variation,c=r.offsets,f=r.position,d=r.gpuAcceleration,h=r.adaptive,v=r.roundOffsets,g=r.isFixed,p=c.x,y=p===void 0?0:p,_=c.y,b=_===void 0?0:_,A=typeof v=="function"?v({x:y,y:b}):{x:y,y:b};y=A.x,b=A.y;var w=c.hasOwnProperty("x"),T=c.hasOwnProperty("y"),S=P,x=E,O=window;if(h){var L=se(i),M="clientHeight",re="clientWidth";if(L===H(i)&&(L=I(i),N(L).position!=="static"&&f==="absolute"&&(M="scrollHeight",re="scrollWidth")),L=L,a===E||(a===P||a===W)&&u===J){x=R;var F=g&&L===O&&O.visualViewport?O.visualViewport.height:L[M];b-=F-o.height,b*=d?1:-1}if(a===P||(a===E||a===R)&&u===J){S=W;var j=g&&L===O&&O.visualViewport?O.visualViewport.width:L[re];y-=j-o.width,y*=d?1:-1}}var V=Object.assign({position:f},h&&qt),z=v===!0?Vt({x:y,y:b}):{x:y,y:b};if(y=z.x,b=z.y,d){var $;return Object.assign({},V,($={},$[x]=T?"0":"",$[S]=w?"0":"",$.transform=(O.devicePixelRatio||1)<=1?"translate("+y+"px, "+b+"px)":"translate3d("+y+"px, "+b+"px, 0)",$))}return Object.assign({},V,(n={},n[x]=T?b+"px":"",n[S]=w?y+"px":"",n.transform="",n))}function Nt(r){var n=r.state,i=r.options,o=i.gpuAcceleration,a=o===void 0?!0:o,u=i.adaptive,c=u===void 0?!0:u,f=i.roundOffsets,d=f===void 0?!0:f,h={placement:q(n.placement),variation:te(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:a,isFixed:n.options.strategy==="fixed"};n.modifiersData.popperOffsets!=null&&(n.styles.popper=Object.assign({},n.styles.popper,ut(Object.assign({},h,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:c,roundOffsets:d})))),n.modifiersData.arrow!=null&&(n.styles.arrow=Object.assign({},n.styles.arrow,ut(Object.assign({},h,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:d})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})}var Me={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Nt,data:{}},ye={passive:!0};function It(r){var n=r.state,i=r.instance,o=r.options,a=o.scroll,u=a===void 0?!0:a,c=o.resize,f=c===void 0?!0:c,d=H(n.elements.popper),h=[].concat(n.scrollParents.reference,n.scrollParents.popper);return u&&h.forEach(function(v){v.addEventListener("scroll",i.update,ye)}),f&&d.addEventListener("resize",i.update,ye),function(){u&&h.forEach(function(v){v.removeEventListener("scroll",i.update,ye)}),f&&d.removeEventListener("resize",i.update,ye)}}var Re={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:It,data:{}},_t={left:"right",right:"left",bottom:"top",top:"bottom"};function be(r){return r.replace(/left|right|bottom|top/g,function(n){return _t[n]})}var zt={start:"end",end:"start"};function lt(r){return r.replace(/start|end/g,function(n){return zt[n]})}function We(r){var n=H(r),i=n.pageXOffset,o=n.pageYOffset;return{scrollLeft:i,scrollTop:o}}function Be(r){return ee(I(r)).left+We(r).scrollLeft}function Ft(r){var n=H(r),i=I(r),o=n.visualViewport,a=i.clientWidth,u=i.clientHeight,c=0,f=0;return o&&(a=o.width,u=o.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(c=o.offsetLeft,f=o.offsetTop)),{width:a,height:u,x:c+Be(r),y:f}}function Ut(r){var n,i=I(r),o=We(r),a=(n=r.ownerDocument)==null?void 0:n.body,u=X(i.scrollWidth,i.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),c=X(i.scrollHeight,i.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),f=-o.scrollLeft+Be(r),d=-o.scrollTop;return N(a||i).direction==="rtl"&&(f+=X(i.clientWidth,a?a.clientWidth:0)-u),{width:u,height:c,x:f,y:d}}function Se(r){var n=N(r),i=n.overflow,o=n.overflowX,a=n.overflowY;return/auto|scroll|overlay|hidden/.test(i+a+o)}function dt(r){return["html","body","#document"].indexOf(C(r))>=0?r.ownerDocument.body:B(r)&&Se(r)?r:dt(ge(r))}function ce(r,n){var i;n===void 0&&(n=[]);var o=dt(r),a=o===((i=r.ownerDocument)==null?void 0:i.body),u=H(o),c=a?[u].concat(u.visualViewport||[],Se(o)?o:[]):o,f=n.concat(c);return a?f:f.concat(ce(ge(c)))}function Te(r){return Object.assign({},r,{left:r.x,top:r.y,right:r.x+r.width,bottom:r.y+r.height})}function Xt(r){var n=ee(r);return n.top=n.top+r.clientTop,n.left=n.left+r.clientLeft,n.bottom=n.top+r.clientHeight,n.right=n.left+r.clientWidth,n.width=r.clientWidth,n.height=r.clientHeight,n.x=n.left,n.y=n.top,n}function ht(r,n){return n===je?Te(Ft(r)):Q(n)?Xt(n):Te(Ut(I(r)))}function Yt(r){var n=ce(ge(r)),i=["absolute","fixed"].indexOf(N(r).position)>=0,o=i&&B(r)?se(r):r;return Q(o)?n.filter(function(a){return Q(a)&&it(a,o)&&C(a)!=="body"}):[]}function Gt(r,n,i){var o=n==="clippingParents"?Yt(r):[].concat(n),a=[].concat(o,[i]),u=a[0],c=a.reduce(function(f,d){var h=ht(r,d);return f.top=X(h.top,f.top),f.right=ve(h.right,f.right),f.bottom=ve(h.bottom,f.bottom),f.left=X(h.left,f.left),f},ht(r,u));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}function mt(r){var n=r.reference,i=r.element,o=r.placement,a=o?q(o):null,u=o?te(o):null,c=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2,d;switch(a){case E:d={x:c,y:n.y-i.height};break;case R:d={x:c,y:n.y+n.height};break;case W:d={x:n.x+n.width,y:f};break;case P:d={x:n.x-i.width,y:f};break;default:d={x:n.x,y:n.y}}var h=a?Le(a):null;if(h!=null){var v=h==="y"?"height":"width";switch(u){case U:d[h]=d[h]-(n[v]/2-i[v]/2);break;case J:d[h]=d[h]+(n[v]/2-i[v]/2);break}}return d}function ne(r,n){n===void 0&&(n={});var i=n,o=i.placement,a=o===void 0?r.placement:o,u=i.boundary,c=u===void 0?Xe:u,f=i.rootBoundary,d=f===void 0?je:f,h=i.elementContext,v=h===void 0?K:h,g=i.altBoundary,p=g===void 0?!1:g,y=i.padding,_=y===void 0?0:y,b=ft(typeof _!="number"?_:ct(_,G)),A=v===K?Ye:K,w=r.rects.popper,T=r.elements[p?A:v],S=Gt(Q(T)?T:T.contextElement||I(r.elements.popper),c,d),x=ee(r.elements.reference),O=mt({reference:x,element:w,strategy:"absolute",placement:a}),L=Te(Object.assign({},w,O)),M=v===K?L:x,re={top:S.top-M.top+b.top,bottom:M.bottom-S.bottom+b.bottom,left:S.left-M.left+b.left,right:M.right-S.right+b.right},F=r.modifiersData.offset;if(v===K&&F){var j=F[a];Object.keys(re).forEach(function(V){var z=[W,R].indexOf(V)>=0?1:-1,$=[E,R].indexOf(V)>=0?"y":"x";re[V]+=j[$]*z})}return re}function Jt(r,n){n===void 0&&(n={});var i=n,o=i.placement,a=i.boundary,u=i.rootBoundary,c=i.padding,f=i.flipVariations,d=i.allowedAutoPlacements,h=d===void 0?Ee:d,v=te(o),g=v?f?De:De.filter(function(_){return te(_)===v}):G,p=g.filter(function(_){return h.indexOf(_)>=0});p.length===0&&(p=g);var y=p.reduce(function(_,b){return _[b]=ne(r,{placement:b,boundary:a,rootBoundary:u,padding:c})[q(b)],_},{});return Object.keys(y).sort(function(_,b){return y[_]-y[b]})}function Kt(r){if(q(r)===me)return[];var n=be(r);return[lt(r),n,lt(n)]}function Qt(r){var n=r.state,i=r.options,o=r.name;if(!n.modifiersData[o]._skip){for(var a=i.mainAxis,u=a===void 0?!0:a,c=i.altAxis,f=c===void 0?!0:c,d=i.fallbackPlacements,h=i.padding,v=i.boundary,g=i.rootBoundary,p=i.altBoundary,y=i.flipVariations,_=y===void 0?!0:y,b=i.allowedAutoPlacements,A=n.options.placement,w=q(A),T=w===A,S=d||(T||!_?[be(A)]:Kt(A)),x=[A].concat(S).reduce(function(Dt,de){return Dt.concat(q(de)===me?Jt(n,{placement:de,boundary:v,rootBoundary:g,padding:h,flipVariations:_,allowedAutoPlacements:b}):de)},[]),O=n.rects.reference,L=n.rects.popper,M=new Map,re=!0,F=x[0],j=0;j<x.length;j++){var V=x[j],z=q(V),$=te(V)===U,he=[E,R].indexOf(z)>=0,le=he?"width":"height",Ie=ne(n,{placement:V,boundary:v,rootBoundary:g,altBoundary:p,padding:h}),Fe=he?$?W:P:$?R:E;O[le]>L[le]&&(Fe=be(Fe));var pe=be(Fe),Lt=[];if(u&&Lt.push(Ie[z]<=0),f&&Lt.push(Ie[Fe]<=0,Ie[pe]<=0),Lt.every(function(Dt){return Dt})){F=V,re=!1;break}M.set(V,Lt)}if(re)for(var _e=_?3:1,Et=function(Dt){var de=x.find(function(qe){var Pt=M.get(qe);if(Pt)return Pt.slice(0,Dt).every(function(In){return In})});if(de)return F=de,"break"},Cn=_e;Cn>0;Cn--){var vn=Et(Cn);if(vn==="break")break}n.placement!==F&&(n.modifiersData[o]._skip=!0,n.placement=F,n.reset=!0)}}var vt={name:"flip",enabled:!0,phase:"main",fn:Qt,requiresIfExists:["offset"],data:{_skip:!1}};function gt(r,n,i){return i===void 0&&(i={x:0,y:0}),{top:r.top-n.height-i.y,right:r.right-n.width+i.x,bottom:r.bottom-n.height+i.y,left:r.left-n.width-i.x}}function yt(r){return[E,W,R,P].some(function(n){return r[n]>=0})}function Zt(r){var n=r.state,i=r.name,o=n.rects.reference,a=n.rects.popper,u=n.modifiersData.preventOverflow,c=ne(n,{elementContext:"reference"}),f=ne(n,{altBoundary:!0}),d=gt(c,o),h=gt(f,a,u),v=yt(d),g=yt(h);n.modifiersData[i]={referenceClippingOffsets:d,popperEscapeOffsets:h,isReferenceHidden:v,hasPopperEscaped:g},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":v,"data-popper-escaped":g})}var bt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Zt};function en(r,n,i){var o=q(r),a=[P,E].indexOf(o)>=0?-1:1,u=typeof i=="function"?i(Object.assign({},n,{placement:r})):i,c=u[0],f=u[1];return c=c||0,f=(f||0)*a,[P,W].indexOf(o)>=0?{x:f,y:c}:{x:c,y:f}}function tn(r){var n=r.state,i=r.options,o=r.name,a=i.offset,u=a===void 0?[0,0]:a,c=Ee.reduce(function(v,g){return v[g]=en(g,n.rects,u),v},{}),f=c[n.placement],d=f.x,h=f.y;n.modifiersData.popperOffsets!=null&&(n.modifiersData.popperOffsets.x+=d,n.modifiersData.popperOffsets.y+=h),n.modifiersData[o]=c}var wt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:tn};function nn(r){var n=r.state,i=r.name;n.modifiersData[i]=mt({reference:n.rects.reference,element:n.rects.popper,strategy:"absolute",placement:n.placement})}var He={name:"popperOffsets",enabled:!0,phase:"read",fn:nn,data:{}};function rn(r){return r==="x"?"y":"x"}function on(r){var n=r.state,i=r.options,o=r.name,a=i.mainAxis,u=a===void 0?!0:a,c=i.altAxis,f=c===void 0?!1:c,d=i.boundary,h=i.rootBoundary,v=i.altBoundary,g=i.padding,p=i.tether,y=p===void 0?!0:p,_=i.tetherOffset,b=_===void 0?0:_,A=ne(n,{boundary:d,rootBoundary:h,padding:g,altBoundary:v}),w=q(n.placement),T=te(n.placement),S=!T,x=Le(w),O=rn(x),L=n.modifiersData.popperOffsets,M=n.rects.reference,re=n.rects.popper,F=typeof b=="function"?b(Object.assign({},n.rects,{placement:n.placement})):b,j=typeof F=="number"?{mainAxis:F,altAxis:F}:Object.assign({mainAxis:0,altAxis:0},F),V=n.modifiersData.offset?n.modifiersData.offset[n.placement]:null,z={x:0,y:0};if(L){if(u){var $,he=x==="y"?E:P,le=x==="y"?R:W,Ie=x==="y"?"height":"width",Fe=L[x],pe=Fe+A[he],Lt=Fe-A[le],_e=y?-re[Ie]/2:0,Et=T===U?M[Ie]:re[Ie],Cn=T===U?-re[Ie]:-M[Ie],vn=n.elements.arrow,Dt=y&&vn?ke(vn):{width:0,height:0},de=n.modifiersData["arrow#persistent"]?n.modifiersData["arrow#persistent"].padding:st(),qe=de[he],Pt=de[le],In=fe(0,M[Ie],Dt[Ie]),$e=S?M[Ie]/2-_e-In-qe-j.mainAxis:Et-In-qe-j.mainAxis,Ce=S?-M[Ie]/2+_e+In+Pt+j.mainAxis:Cn+In+Pt+j.mainAxis,ue=n.elements.arrow&&se(n.elements.arrow),At=ue?x==="y"?ue.clientTop||0:ue.clientLeft||0:0,Ne=($=V==null?void 0:V[x])!=null?$:0,Oe=Fe+$e-Ne-At,kt=Fe+Ce-Ne,jt=fe(y?ve(pe,Oe):pe,Fe,y?X(Lt,kt):Lt);L[x]=jt,z[x]=jt-Fe}if(f){var _n,ie=x==="x"?E:P,ae=x==="x"?R:W,Y=L[O],k=O==="y"?"height":"width",D=Y+A[ie],oe=Y-A[ae],xe=[E,P].indexOf(w)!==-1,ze=(_n=V==null?void 0:V[O])!=null?_n:0,hn=xe?D:Y-M[k]-re[k]-ze+j.altAxis,An=xe?Y+M[k]+re[k]-ze-j.altAxis:oe,Tn=y&&xe?St(hn,Y,An):fe(y?hn:D,Y,y?An:oe);L[O]=Tn,z[O]=Tn-Y}n.modifiersData[o]=z}}var xt={name:"preventOverflow",enabled:!0,phase:"main",fn:on,requiresIfExists:["offset"]};function an(r){return{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}}function sn(r){return r===H(r)||!B(r)?We(r):an(r)}function fn(r){var n=r.getBoundingClientRect(),i=Z(n.width)/r.offsetWidth||1,o=Z(n.height)/r.offsetHeight||1;return i!==1||o!==1}function cn(r,n,i){i===void 0&&(i=!1);var o=B(n),a=B(n)&&fn(n),u=I(n),c=ee(r,a),f={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(o||!o&&!i)&&((C(n)!=="body"||Se(u))&&(f=sn(n)),B(n)?(d=ee(n,!0),d.x+=n.clientLeft,d.y+=n.clientTop):u&&(d.x=Be(u))),{x:c.left+f.scrollLeft-d.x,y:c.top+f.scrollTop-d.y,width:c.width,height:c.height}}function pn(r){var n=new Map,i=new Set,o=[];r.forEach(function(u){n.set(u.name,u)});function a(u){i.add(u.name);var c=[].concat(u.requires||[],u.requiresIfExists||[]);c.forEach(function(f){if(!i.has(f)){var d=n.get(f);d&&a(d)}}),o.push(u)}return r.forEach(function(u){i.has(u.name)||a(u)}),o}function un(r){var n=pn(r);return ot.reduce(function(i,o){return i.concat(n.filter(function(a){return a.phase===o}))},[])}function ln(r){var n;return function(){return n||(n=new Promise(function(i){Promise.resolve().then(function(){n=void 0,i(r())})})),n}}function dn(r){var n=r.reduce(function(i,o){var a=i[o.name];return i[o.name]=a?Object.assign({},a,o,{options:Object.assign({},a.options,o.options),data:Object.assign({},a.data,o.data)}):o,i},{});return Object.keys(n).map(function(i){return n[i]})}var Ot={placement:"bottom",modifiers:[],strategy:"absolute"};function $t(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return!n.some(function(o){return!(o&&typeof o.getBoundingClientRect=="function")})}function we(r){r===void 0&&(r={});var n=r,i=n.defaultModifiers,o=i===void 0?[]:i,a=n.defaultOptions,u=a===void 0?Ot:a;return function(c,f,d){d===void 0&&(d=u);var h={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ot,u),modifiersData:{},elements:{reference:c,popper:f},attributes:{},styles:{}},v=[],g=!1,p={state:h,setOptions:function(b){var A=typeof b=="function"?b(h.options):b;_(),h.options=Object.assign({},u,h.options,A),h.scrollParents={reference:Q(c)?ce(c):c.contextElement?ce(c.contextElement):[],popper:ce(f)};var w=un(dn([].concat(o,h.options.modifiers)));return h.orderedModifiers=w.filter(function(T){return T.enabled}),y(),p.update()},forceUpdate:function(){if(!g){var b=h.elements,A=b.reference,w=b.popper;if($t(A,w)){h.rects={reference:cn(A,se(w),h.options.strategy==="fixed"),popper:ke(w)},h.reset=!1,h.placement=h.options.placement,h.orderedModifiers.forEach(function(re){return h.modifiersData[re.name]=Object.assign({},re.data)});for(var T=0;T<h.orderedModifiers.length;T++){if(h.reset===!0){h.reset=!1,T=-1;continue}var S=h.orderedModifiers[T],x=S.fn,O=S.options,L=O===void 0?{}:O,M=S.name;typeof x=="function"&&(h=x({state:h,options:L,name:M,instance:p})||h)}}}},update:ln(function(){return new Promise(function(b){p.forceUpdate(),b(h)})}),destroy:function(){_(),g=!0}};if(!$t(c,f))return p;p.setOptions(d).then(function(b){!g&&d.onFirstUpdate&&d.onFirstUpdate(b)});function y(){h.orderedModifiers.forEach(function(b){var A=b.name,w=b.options,T=w===void 0?{}:w,S=b.effect;if(typeof S=="function"){var x=S({state:h,name:A,instance:p,options:T}),O=function(){};v.push(x||O)}})}function _(){v.forEach(function(b){return b()}),v=[]}return p}}we();var mn=[Re,He,Me,Ae];we({defaultModifiers:mn});var gn=[Re,He,Me,Ae,wt,vt,xt,pt,bt],yn=we({defaultModifiers:gn});const usePopper=(r,n,i={})=>{const o={name:"updateState",enabled:!0,phase:"write",fn:({state:d})=>{const h=deriveState(d);Object.assign(c.value,h)},requires:["computeStyles"]},a=vue.computed(()=>{const{onFirstUpdate:d,placement:h,strategy:v,modifiers:g}=vue.unref(i);return{onFirstUpdate:d,placement:h||"bottom",strategy:v||"absolute",modifiers:[...g||[],o,{name:"applyStyles",enabled:!1}]}}),u=vue.shallowRef(),c=vue.ref({styles:{popper:{position:vue.unref(a).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),f=()=>{u.value&&(u.value.destroy(),u.value=void 0)};return vue.watch(a,d=>{const h=vue.unref(u);h&&h.setOptions(d)},{deep:!0}),vue.watch([r,n],([d,h])=>{f(),!(!d||!h)&&(u.value=yn(d,h,vue.unref(a)))}),vue.onBeforeUnmount(()=>{f()}),{state:vue.computed(()=>{var d;return{...((d=vue.unref(u))==null?void 0:d.state)||{}}}),styles:vue.computed(()=>vue.unref(c).styles),attributes:vue.computed(()=>vue.unref(c).attributes),update:()=>{var d;return(d=vue.unref(u))==null?void 0:d.update()},forceUpdate:()=>{var d;return(d=vue.unref(u))==null?void 0:d.forceUpdate()},instanceRef:vue.computed(()=>vue.unref(u))}};function deriveState(r){const n=Object.keys(r.elements),i=lodashEs.fromPairs(n.map(a=>[a,r.styles[a]||{}])),o=lodashEs.fromPairs(n.map(a=>[a,r.attributes[a]]));return{styles:i,attributes:o}}function useTimeout(){let r;const n=(o,a)=>{i(),r=window.setTimeout(o,a)},i=()=>window.clearTimeout(r);return tryOnScopeDispose(()=>i()),{registerTimeout:n,cancelTimeout:i}}const defaultIdInjection={prefix:Math.floor(Math.random()*1e4),current:0},ID_INJECTION_KEY=Symbol("elIdInjection"),useIdInjection=()=>vue.getCurrentInstance()?vue.inject(ID_INJECTION_KEY,defaultIdInjection):defaultIdInjection,useId=r=>{const n=useIdInjection();!isClient&&n===defaultIdInjection&&debugWarn("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
|
247
247
|
usage: app.provide(ID_INJECTION_KEY, {
|