import{w as A,a as T,E as z}from"./element-plus.9175fe58.js";import{d as L,r as O,b,o as i,M as k,O as s,c as f,W as l,T as P,S as C,a as c,V as W,a7 as j,Q as V,J,R as K,u,_ as B}from"./@vue.c3e77981.js";import{e as Q}from"./index.7385ee23.js";import{v as R,h as U,K as q,L as G}from"./@element-plus.12c58ce2.js";import{d as H}from"./index.669f9987.js";import"./@vueuse.a48d0173.js";import"./lodash-es.2b5acb28.js";import"./dayjs.1f51da93.js";import"./axios.13991fdc.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.b082b0c1.js";import"./@popperjs.36402333.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./attr.e3c62de8.js";import"./index.d5a98515.js";import"./picker.6d73274c.js";import"./index.vue_vue_type_script_setup_true_lang.0fb3ad1e.js";import"./usePaging.d25ebf19.js";import"./article.ebc53ffb.js";import"./index.c7b1c52d.js";import"./picker.0630e4ea.js";import"./index.ad8825bc.js";import"./index.a26fd36c.js";import"./index.vue_vue_type_script_setup_true_lang.5e44b2ed.js";import"./vue3-video-play.4813c60b.js";import"./vuedraggable.39068026.js";import"./vue.ecf7f5ee.js";import"./sortablejs.a3e32c99.js";import"./lodash.6c5d06b3.js";import"./vue-router.43c06794.js";import"./pinia.b5130627.js";import"./css-color-function.23ed6179.js";import"./color.9c368256.js";import"./clone.e9277309.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./ms.564e106c.js";import"./nprogress.212df0f4.js";import"./vue-clipboard3.f310ddad.js";import"./clipboard.141ef824.js";import"./echarts.8535e5a6.js";import"./zrender.3eba8991.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.b8b719e9.js";import"./content.vue_vue_type_script_setup_true_lang.b89a1ffc.js";import"./decoration-img.41f67be7.js";import"./attr.vue_vue_type_script_setup_true_lang.53e33852.js";import"./content.4dbec86a.js";import"./attr.vue_vue_type_script_setup_true_lang.7c8c516c.js";import"./content.vue_vue_type_script_setup_true_lang.8046030c.js";import"./attr.vue_vue_type_script_setup_true_lang.07086116.js";import"./add-nav.vue_vue_type_script_setup_true_lang.7a539962.js";import"./content.6f8c1b45.js";import"./attr.vue_vue_type_script_setup_true_lang.37a6f0a0.js";import"./content.vue_vue_type_script_setup_true_lang.e71a6668.js";import"./attr.vue_vue_type_script_setup_true_lang.4f1b3bc4.js";import"./content.55051f56.js";import"./decoration.1c716c58.js";import"./attr.vue_vue_type_script_setup_true_lang.1bcdc46d.js";import"./index.vue_vue_type_script_setup_true_lang.a4bd6b7c.js";import"./content.516d58ee.js";import"./attr.48a75b52.js";import"./content.vue_vue_type_script_setup_true_lang.5a4edb09.js";import"./attr.vue_vue_type_script_setup_true_lang.c1356dc8.js";import"./content.d129ae7c.js";import"./attr.vue_vue_type_script_setup_true_lang.1b7a422e.js";import"./content.vue_vue_type_script_setup_true_lang.f7142f3c.js";import"./attr.vue_vue_type_script_setup_true_lang.3ed965a5.js";import"./content.2a0ba2b3.js";const X={class:"shadow mx-[30px] pages-preview"},Y=["onClick"],Z={key:0,class:"widget-btns py-[5px]"},g=L({__name:"preview",props:{pageMeta:{type:Object,default:()=>null},pageData:{type:Array,default:()=>[]},modelValue:{type:Number,default:0}},emits:["update:modelValue"],setup(m,{emit:E}){const a=m,d=E,y=O(-1),D=()=>{a.modelValue===-1?d("update:modelValue",y.value):(y.value=a.modelValue,d("update:modelValue",-1))},M=(e,o)=>{e.disabled||d("update:modelValue",o)},F=b(()=>e=>e===0),N=b(()=>e=>{var o;return((o=a.pageData)==null?void 0:o.length)===e+1}),_=b(()=>e=>(e==null?void 0:e.enabled)==0),S=e=>{e.enabled!==void 0&&(e.enabled=e.enabled?0:1)},h=(e,o)=>{if(e<0||e>=a.pageData.length||o<0||o>=a.pageData.length)return;const p=a.pageData.splice(e,1)[0];a.pageData.splice(o,0,p),d("update:modelValue",o)};return(e,o)=>{const p=A,v=T,$=z;return i(),k($,{class:"pages-preview-container"},{default:s(()=>[m.pageMeta!==null?(i(),f("div",{key:0,class:"absolute right-4 top-4",onClick:D},[l(p,null,{default:s(()=>[P("\u9875\u9762\u8BBE\u7F6E")]),_:1})])):C("",!0),c("div",X,[(i(!0),f(W,null,j(m.pageData,(t,r)=>(i(),f("div",{key:t.id,class:V(["relative",{"cursor-pointer":!(t!=null&&t.disabled)}]),onClick:n=>M(t,r)},[c("div",{class:V(["absolute w-full h-full z-[100] border-dashed",{select:r==m.modelValue,hide:_.value(t.content),"border-[#dcdfe6] border-2":!(t!=null&&t.disabled)}])},null,2),J(e.$slots,"default",{},()=>{var n;return[(i(),k(K((n=u(Q)[t==null?void 0:t.name])==null?void 0:n.content),{content:t.content,styles:t.styles,key:t.id},null,8,["content","styles"]))]},!0),r==m.modelValue?(i(),f("div",Z,[c("div",null,[l(v,{effect:"dark",content:_.value(t.content)?"\u663E\u793A":"\u9690\u85CF",placement:"right"},{default:s(()=>[l(p,{class:"py-[5px]",type:"primary",icon:_.value(t.content)?u(R):u(U),onClick:n=>S(t.content)},null,8,["icon","onClick"])]),_:2},1032,["content"])]),c("div",null,[l(v,{effect:"dark",content:"\u4E0A\u79FB",placement:"right"},{default:s(()=>[l(p,{class:"py-[5px]",type:"primary",icon:u(q),disabled:F.value(r),onClick:B(n=>h(r,r-1),["stop"])},null,8,["icon","disabled","onClick"])]),_:2},1024)]),c("div",null,[l(v,{effect:"dark",content:"\u4E0B\u79FB",placement:"right"},{default:s(()=>[l(p,{class:"py-[5px]",type:"primary",icon:u(G),disabled:N.value(r),onClick:B(n=>h(r,r+1),["stop"])},null,8,["icon","disabled","onClick"])]),_:2},1024)])])):C("",!0)],10,Y))),128))])]),_:3})}}});const vt=H(g,[["__scopeId","data-v-6fe9720f"]]);export{vt as default};