import{A as e,C as t,D as n,E as r,M as i,S as a,St as o,T as ee,X as s,Z as c,bt as l,dt as u,h as d,in as f,kt as p,nn as te,ot as m,t as h,w as g,z as _}from"./_plugin-vue_export-helper-9JxOV_6y.js";import{t as v}from"./dialog-CTuQSeYb.js";import{Bt as y,Gr as b,Qn as x,Ut as S,Vt as C,Zt as w,ar as T,bi as E,yt as D}from"./stores-Dcoqi2M5.js";var ne={key:2,class:`flex flex-col fjs-editor-container fjs-form-container flex-grow`,style:{"min-height":`100px`}},re={class:`flex flex-col fjs-editor-container fjs-form-container flex-grow`,style:{"min-height":`30px`}},ie=`gx-pc-dialog-footer`,O=h(i({__name:`DialogFormPreview`,props:_({itemElement:{},title:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:_([`upload-screenshot-success`],[`update:visible`]),setup(i,{expose:h,emit:_}){let O=D(),k=_;c(b,T);let A=o(!0);c(`isPreviewForm`,A);let j=i,M=a(()=>j.itemElement),N=a(()=>j.itemElement?.type===`gx-pc-dialog`),{getPorpertyValue:P,boolCheck:F}=E(j),I=m(i,`visible`),L=a(()=>P(`title`)||P(`bind-user-intf-name`)||j.title||`标题`),R=a(()=>P(`width`)||`50%`),z=a(()=>P(`height`)||`unset`),B=a(()=>F(`modal`,`true`)),V=a(()=>P(`inner-label-layout`,`左边`)),H=a(()=>P(`inner-label-width`,`100`));a(()=>F(`close-switch`,`true`)),a(()=>F(`confirm-switch`,`true`)),a(()=>F(`append-to-body`,`false`)),a(()=>F(`close-on-press-escape`,`true`));let ae=a(()=>P(`bind-user-intf-id`)),U=a(()=>P(`bind-user-intf-no`)),W=o(),G=a(()=>{let e=W.value;return e&&e.dialogContentRef?.$el||null}),K=a(()=>{let e=P(`prototype-type`);return console.log(`gx-pc-dialog: prototypeType -`,e),e}),q=a(()=>K.value===`URL`),J=a(()=>K.value===`IMG`);a(()=>!q.value&&!J.value);let oe=a(()=>{let e=q.value,t=J.value,n=M.value;if(e||t)return!1;let r=n.rawXmlObj;return r?!Object.keys(r).some(e=>e!==ie&&e.startsWith(`gx-pc-`)):!1}),{formContentType:se,exposeMethoods:Y}=w(P,{props:j}),X=null,ce=e=>{I.value=!0,X=e||null},Z=e=>{if(I.value=!1,e&&X&&X.callerRef){let t=X.callerRef.exposed;t&&typeof t.triggerDialogClosedCallback==`function`&&t.triggerDialogClosedCallback(e)}};h({dialogVisible:I,exposeMethoods:[...Y,{key:`openDialog`,label:`打开弹框`,value:ce},{key:`closeDialog`,label:`关闭弹框`,value:Z}]}),c(`adapFormUuid`,j.itemElement?.id),c(`closeDialog`,Z);let Q=j.itemElement.rawXmlObj?._formUUID;c(`formUuid`,Q);let le=l({width:R.value,height:z.value}),ue=e=>e!==`gx-pc-dialog`&&e!==`gx-pc-dialog-footer`,$=a(()=>{let e=j.itemElement.rawXmlObj||null,t=e&&e[`gx-pc-dialog-footer`]||null;return Array.isArray(t)&&(t=t[0]),t?{id:t&&t._controlUUID||``,index:`0`,type:`gx-pc-dialog-footer`,attributes:void 0,parentId:``,rawXmlObj:t,isRootPanel:!0,localFormUuid:j.itemElement.localFormUuid,rootPanelFormUuid:j.itemElement.rootPanelFormUuid}:null});return(i,a)=>{let o=v;return s(),r(`div`,{onClick:a[2]||=d(()=>{},[`stop`])},[e(o,{ref_key:`dialogRef`,ref:W,class:te([`preview-form-dialog fjs-container`,`gx-pc-dialog`]),"data-uuid":j.itemElement.id,modelValue:I.value,"onUpdate:modelValue":a[1]||=e=>I.value=e,title:L.value,width:R.value,modal:B.value,"append-to-body":!0,"close-on-click-modal":!1,"close-on-press-escape":!0,style:f(le)},n({default:u(()=>[q.value?(s(),g(C,{key:0,class:`!h-60`,itemElement:M.value,updateRootElementFlag:0,onFlushRootXml:e=>null},null,8,[`itemElement`])):J.value?(s(),g(y,{key:1,class:`!h-60`,itemElement:M.value,updateRootElementFlag:0,onFlushRootXml:e=>null},null,8,[`itemElement`])):(s(),r(`div`,ne,[(s(),g(p(x),{"item-element":M.value,"is-root-panel":!0,group:`draggable-group`,innerLabelLayout:V.value,innerLabelWidth:H.value,subItemMatch:ue,childEnvObject:void 0,key:oe.value?`non-child`:`exist-child`},null,8,[`item-element`,`innerLabelLayout`,`innerLabelWidth`]))])),N.value?(s(),g(p(S),{key:3,"review-type":`adap-root-panel`,"form-uuid":p(Q),"bind-user-intf-id":ae.value,"bind-user-intf-no":U.value,layout:`left`,"hidden-business-rule":!1,"zxl-prd-id":p(O).zxlPrdId,isPreviewForm:A.value,formMainEl:G.value,onUploadScreenshotSuccess:a[0]||=e=>k(`upload-screenshot-success`)},null,8,[`form-uuid`,`bind-user-intf-id`,`bind-user-intf-no`,`zxl-prd-id`,`isPreviewForm`,`formMainEl`])):ee(``,!0)]),_:2},[$.value?{name:`footer`,fn:u(()=>[t(`div`,re,[e(p(x),{"item-element":$.value,"is-root-panel":!0,group:`draggable-group`,forceRowAlignCenter:!0,stopRowMove:!0},null,8,[`item-element`])])]),key:`0`}:void 0]),1032,[`data-uuid`,`modelValue`,`title`,`width`,`modal`,`style`])])}}}),[[`__scopeId`,`data-v-bd1df2a3`]]);export{O as t};