cft-builder 0.2.126 → 0.2.127
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cft-builder.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as s, C as o, E as a, F as d, R as i, T as u, A as B, z as l, B as m } from "./main-
|
|
1
|
+
import { D as s, C as o, E as a, F as d, R as i, T as u, A as B, z as l, B as m } from "./main-C9y-C8go.js";
|
|
2
2
|
export {
|
|
3
3
|
s as BuilderItems,
|
|
4
4
|
o as BuilderItemsRender,
|
package/dist/cft-builder.umd.cjs
CHANGED
|
@@ -2378,7 +2378,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2378
2378
|
}
|
|
2379
2379
|
}
|
|
2380
2380
|
`}}),ui=b.forwardRef(function(t,e){var n=$n(),r=b.useContext(rr),i=h4.getProps(t,r),s=b.useState(i.id),a=bO(s,2),l=a[0],c=a[1],u=b.useState(i.collapsed),d=bO(u,2),f=d[0],h=d[1],g=b.useRef(null),m=b.useRef(null),v=i.toggleable?i.onToggle?i.collapsed:f:!1,A=l+"_header",w=l+"_content",E=h4.setMetaData({props:i,state:{id:l,collapsed:v}}),x=E.ptm,C=E.cx,S=E.isUnstyled;ci(h4.css.styles,S,{name:"panel"});var _=function(Q){i.toggleable&&(v?I(Q):k(Q),Q&&(i.onToggle&&i.onToggle({originalEvent:Q,value:!v}),Q.preventDefault()))},I=function(Q){i.onToggle||h(!1),i.onExpand&&Q&&i.onExpand(Q)},k=function(Q){i.onToggle||h(!0),i.onCollapse&&Q&&i.onCollapse(Q)};b.useImperativeHandle(e,function(){return{props:i,toggle:_,expand:I,collapse:k,getElement:function(){return g.current},getContent:function(){return m.current}}}),Pi(function(){l||c(el())});var P=function(){if(i.toggleable){var Q=l+"_label",fe=n({className:C("toggler"),onClick:_,id:Q,"aria-controls":w,"aria-expanded":!v,type:"button",role:"button","aria-label":i.header},x("toggler")),Y=n(x("togglericon")),ce=v?i.expandIcon||b.createElement(y3,Y):i.collapseIcon||b.createElement(G8,Y),te=Qn.getJSXIcon(ce,Y,{props:i,collapsed:v});return b.createElement("button",fe,te,b.createElement(tn,null))}return null},L=function(){var Q=Oe.getJSXElement(i.header,i),fe=Oe.getJSXElement(i.icons,i),Y=P(),ce=n({id:A,className:C("title")},x("title")),te=b.createElement("span",ce,Q),ne=n({className:C("icons")},x("icons")),K=b.createElement("div",ne,fe,Y),W=n({className:C("header")},x("header")),de=b.createElement("div",W,te,K);if(i.headerTemplate){var ve={className:"p-panel-header",titleClassName:"p-panel-title",iconsClassName:"p-panel-icons",togglerClassName:"p-panel-header-icon p-panel-toggler p-link",onTogglerClick:_,titleElement:te,iconsElement:K,togglerElement:Y,element:de,id:l+"_header",props:i,collapsed:v};return Oe.getJSXElement(i.headerTemplate,ve)}else if(i.header||i.toggleable)return de;return null},V=function(){var Q=Oe.getJSXElement(i.footer,i),fe=n({className:C("footer")},x("footer")),Y=b.createElement("div",fe,Q);if(i.footerTemplate){var ce={className:C("footer"),element:Y,props:i};return Oe.getJSXElement(i.footerTemplate,ce)}else if(i.footer)return Y;return null},z=function(){var Q=n({ref:m,className:C("toggleableContent"),"aria-hidden":v,role:"region",id:w,"aria-labelledby":A},x("toggleablecontent")),fe=n({className:C("content")},x("content")),Y=n({classNames:C("transition"),timeout:{enter:1e3,exit:450},in:!v,unmountOnExit:!0,options:i.transitionOptions},x("transition"));return b.createElement(tl,pb({nodeRef:m},Y),b.createElement("div",Q,b.createElement("div",fe,i.children)))},O=n({id:l,ref:g,style:i.style,className:gt(i.className,C("root"))},h4.getOtherProps(i),x("root")),q=L(),re=z(),pe=V();return b.createElement("div",O,q,re,pe)});ui.displayName="Panel";const Roe=t=>{var m;const{fieldState:e,setFieldState:n,pageIndex:r,formBuilderFormLayout:i,pageSettingUpdate:s}=t,a=(v,A)=>{const w=`${v.className} justify-content-start`,E=`${v.titleClassName} pl-1`;return o.jsxs("div",{className:w,children:[o.jsx($t,{text:!0,icon:"pi pi-trash",className:v.togglerClassName,onClick:()=>c(A),"aria-label":"Submit"}),o.jsx("span",{className:E,children:`Rule ${A+1}`})]})},l=(v,A)=>{var E;const w=[...((E=e==null?void 0:e.conditionalTabRules)==null?void 0:E.rules)||[]];w[v].conditions=w[v].conditions.filter((x,C)=>A!==C),n(x=>({...x,conditionalTabRules:{...x.conditionalTabRules,rules:w}}))},c=v=>{var x;const A=[...(e==null?void 0:e.conditionalTabRules.rules)||[]],w=A.filter((C,S)=>v!==S);n(C=>({...C,conditionalTabRules:{...C.conditionalTabRules,rules:w}}));const E=A[v];(x=E==null?void 0:E.conditions)==null||x.map(C=>{const S=i?_t.findIndex(i,I=>{var k;return(I==null?void 0:I.uuid)===((k=C==null?void 0:C.tab)==null?void 0:k.uuid)}):-1,_=i[S];_&&(_.isHidden=!1,s(S,_))})};let u=[...i].filter(function(v,A){return A!==r});u.map(v=>({uuid:v==null?void 0:v.uuid,title:v==null?void 0:v.title}));const d=(v,A,w)=>{const E=[...(e==null?void 0:e.conditionalTabRules.rules)||[]];E[A].conditions[w].option=v==null?void 0:v.value,n(x=>({...x,conditionalTabRules:{...x.conditionalTabRules,rules:E}}))},f=(v,A,w)=>{const E=[...(e==null?void 0:e.conditionalTabRules.rules)||[]];E[A].conditions[w].tab=v==null?void 0:v.value,n(S=>({...S,conditionalTabRules:{...S.conditionalTabRules,rules:E}}));const x=_t.findIndex(i,S=>{var _;return(S==null?void 0:S.uuid)===((_=v==null?void 0:v.value)==null?void 0:_.uuid)}),C=i[x];C&&(C.isHidden=!0,s(x,C))},h=()=>{n(v=>({...v,conditionalTabRules:{...v.conditionalTabRules,rules:[...v.conditionalTabRules.rules,{conditions:[]}]}}))},g=v=>{const A=[...(e==null?void 0:e.conditionalTabRules.rules)||[]];A[v].conditions=[...A[v].conditions,{option:null,tab:null}],n(w=>({...w,conditionalTabRules:{...w.conditionalTabRules,rules:[...A]}}))};return o.jsxs("div",{children:[o.jsx("h4",{children:"Conditional Tabs"}),i&&(i==null?void 0:i.length)>1&&((m=e==null?void 0:e.conditionalTabRules)==null?void 0:m.rules.map((v,A)=>o.jsx(ui,{className:"mb-3",header:`Rule ${A+1}`,headerTemplate:w=>a(w,A),children:o.jsxs("div",{children:[v==null?void 0:v.conditions.map((w,E)=>o.jsx("div",{className:"p-field pb-6",children:o.jsxs("div",{className:"grid",children:[o.jsx("div",{className:"col-2",children:o.jsxs("label",{children:["Show tab",w.value]})}),o.jsx("div",{className:"col-3 p-fluid",children:o.jsx(Os,{value:w.tab,options:u,onChange:x=>f(x,A,E),optionLabel:"title.english",placeholder:"Select option"})}),o.jsx("div",{className:"col-3",children:"when option is selected"}),o.jsx("div",{className:"col-3 p-fluid",children:o.jsx(Os,{value:w==null?void 0:w.option,options:e==null?void 0:e.options,onChange:x=>d(x,A,E),optionLabel:"optionText.english",placeholder:"Select option"})}),o.jsx("div",{className:"col-1",children:o.jsx($t,{text:!0,icon:"pi pi-trash",className:"p-button-danger button-sm",tooltip:"Field Settings",onClick:()=>l(A,E),tooltipOptions:{position:"top"}})})]})},E)),o.jsx($t,{text:!0,size:"small",onClick:()=>g(A),icon:"pi pi-plus",className:"p-mt-4",label:"Add Condition"})]})},"conditional_tab_rule"+A))),i&&(i==null?void 0:i.length)>1&&o.jsx($t,{text:!0,onClick:()=>h(),className:"p-mt-4",icon:"pi pi-plus",label:"Add Rule",size:"small"}),i&&(i==null?void 0:i.length)<2&&o.jsx("p",{className:"error",children:"Please needs to have two or more tabs to enable the conditional tabs"})]})},Goe=t=>{var x;const{fieldState:e,setFieldState:n,section:r,formBuilderFormLayout:i,sectionSettingUpdate:s,page:a}=t,[l]=M.useState([]),{schemaBuilderUpdate:c,formBuilderFormSchema:u}=an(),d=(C,S)=>{const _=`${C.className} justify-content-start`,I=`${C.titleClassName} pl-1`;return o.jsxs("div",{className:_,children:[o.jsx($t,{text:!0,icon:"pi pi-trash",className:C.togglerClassName,onClick:()=>f(S),"aria-label":"Submit"}),o.jsx("span",{className:I,children:`Rule ${S+1}`})]})},f=C=>{var k;const S=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]],_=S[C];(k=_==null?void 0:_.conditions)==null||k.map(P=>{var z;const L=_t.findIndex(i,O=>{var q;return(O==null?void 0:O.uuid)===((q=P==null?void 0:P.tab)==null?void 0:q.uuid)}),V=i?_t.findIndex(i[L].children,O=>{var q;return(O==null?void 0:O.uuid)===((q=P==null?void 0:P.section)==null?void 0:q.uuid)}):-1;if(V>=0){const O=(z=i[L])==null?void 0:z.children[V];O&&(O.isHidden=!1,s(L,V,O))}});const I=S.filter((P,L)=>C!==L);n(P=>({...P,conditionalSectionRules:{...P.conditionalSectionRules,rules:I}}))},h=C=>{var I;let S=!1;const _=i?i.filter(function(k){return(k==null?void 0:k.uuid)===(C==null?void 0:C.uuid)}):[];return(_==null?void 0:_.length)>0&&((I=_[0].children)==null?void 0:I.length)>1&&(S=!0),S},g=(C,S,_)=>{const I=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];I[S].conditions[_].option=C==null?void 0:C.value,n(k=>({...k,conditionalSectionRules:{...k.conditionalSectionRules,rules:I}}))},m=(C,S)=>{var k;const _=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]],I=_[C];(k=I==null?void 0:I.conditions)==null||k.map(P=>{var O;const L=_t.findIndex(i,q=>{var re;return(q==null?void 0:q.uuid)===((re=P==null?void 0:P.tab)==null?void 0:re.uuid)}),V=i?_t.findIndex(i[L].children,q=>{var re;return(q==null?void 0:q.uuid)===((re=P==null?void 0:P.section)==null?void 0:re.uuid)}):-1,z=(O=i[L])==null?void 0:O.children[V];console.log("sectionData",z),z&&(z.isHidden=!1,console.log("sectionData",z),s(L,V,z))}),_[C].conditions=_[C].conditions.filter((P,L)=>S!==L),n(P=>({...P,conditionalSectionRules:{...P.conditionalSectionRules,rules:_}}))},v=(C,S,_)=>{var z,O;const I=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];I[S].conditions[_].section=C==null?void 0:C.value;const k=(O=(z=I[S].conditions[_])==null?void 0:z.tab)==null?void 0:O.uuid,P=_t.findIndex(i,q=>(q==null?void 0:q.uuid)===k);n(q=>({...q,conditionalSectionRules:{...q.conditionalSectionRules,rules:I}}));const L=i?_t.findIndex(i[P].children,q=>{var re;return(q==null?void 0:q.uuid)===((re=C==null?void 0:C.value)==null?void 0:re.uuid)}):-1,V=i[P].children[L];V&&(V.isHidden=!0,s(P,L,V))},A=C=>{const S=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];S[C].conditions=[...S[C].conditions,{option:null,tab:{title:a==null?void 0:a.title,uuid:a==null?void 0:a.uuid},section:null}],n(_=>({..._,conditionalSectionRules:{..._.conditionalSectionRules,rules:S}}))},w=()=>{n(S=>({...S,conditionalSectionRules:{...S.conditionalSectionRules,rules:[...S.conditionalSectionRules.rules,{uuid:tt(),conditions:[]}]}}));const C=[...(u==null?void 0:u.conditionalSectionsRules)||[]];c({conditionalSectionsRules:[...C,{fieldId:e==null?void 0:e.uuid,uuid:tt(),conditions:[]}]})},E=C=>{var _;const S=i==null?void 0:i.filter(function(I){return(I==null?void 0:I.uuid)===(C==null?void 0:C.uuid)});if(S&&(S==null?void 0:S.length)>0){const I=(_=S[0])==null?void 0:_.children.filter(function(k){return(k==null?void 0:k.uuid)!==(r==null?void 0:r.uuid)});if((I==null?void 0:I.length)>0)return I}return l};return o.jsxs("div",{children:[o.jsx("h4",{children:"Conditional Sections"}),(x=e==null?void 0:e.conditionalSectionRules)==null?void 0:x.rules.map((C,S)=>o.jsx(ui,{className:"mb-3",header:`Rule ${S+1}`,headerTemplate:_=>d(_,S),children:o.jsxs("div",{children:[C==null?void 0:C.conditions.map((_,I)=>{var k,P;return o.jsx("div",{className:"p-field pb-2",children:o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:"col-3 p-fluid",children:[o.jsx("label",{children:"In Tab"}),o.jsx("p",{children:(P=(k=_==null?void 0:_.tab)==null?void 0:k.title)==null?void 0:P.english})]}),o.jsxs("div",{className:"col-3 p-fluid",children:[o.jsxs("label",{children:["Select section",_.value]}),o.jsx(Os,{disabled:!h(_==null?void 0:_.tab),value:_.section,options:E(_.tab),onChange:L=>v(L,S,I),optionLabel:"heading.english",placeholder:"Select option"})]}),o.jsxs("div",{className:"col-4 p-fluid",children:["when option is selected",o.jsx(Os,{disabled:!h(_==null?void 0:_.tab),value:_==null?void 0:_.option,options:e==null?void 0:e.options,onChange:L=>g(L,S,I),optionLabel:"optionText.english",placeholder:"Select option"})]}),o.jsxs("div",{className:"col-1",children:[o.jsx("br",{}),o.jsx($t,{text:!0,icon:"pi pi-trash",className:"p-button-danger button-sm",tooltip:"Field Settings",onClick:()=>m(S,I),tooltipOptions:{position:"top"}})]}),!h(_.tab)&&o.jsx("div",{className:"col-12",children:o.jsxs("p",{className:"error",children:[" ","At least two or more sections should exist in a page"]})})]})},I)}),o.jsx("div",{children:o.jsx("div",{className:"flex",children:o.jsx($t,{text:!0,className:"btn-sm mt-3 ",label:"+ Add Condition",onClick:()=>A(S),size:"small"})})})]})},S)),o.jsx($t,{text:!0,icon:"pi pi-plus",onClick:()=>w(),className:"p-mt-4",label:"Add Rule",size:"small"})]})},Woe=t=>{var u;const{fieldState:e,setFieldState:n}=t,r=d=>{var g;const h=[...((g=e==null?void 0:e.inlineConditionalRules)==null?void 0:g.rules)||[]].filter((m,v)=>d!==v);n(m=>({...m,inlineConditionalRules:{...m.inlineConditionalRules,rules:h}}))},i=(d,f)=>{const h=`${d.className} justify-content-start`,g=`${d.titleClassName} pl-1`;return o.jsxs("div",{className:h,children:[o.jsx($t,{text:!0,icon:"pi pi-trash",className:d.togglerClassName,onClick:()=>r(f),"aria-label":"Submit"}),o.jsx("span",{className:g,children:`Rule ${f+1}`})]})},s=(d,f,h)=>{const g=[...(e==null?void 0:e.inlineConditionalRules.rules)||[]];g[f].conditions[h].value=d==null?void 0:d.value,n(m=>({...m,inlineConditionalRules:{...m.inlineConditionalRules,rules:g}}))},a=(d,f)=>{const h=[...(e==null?void 0:e.inlineConditionalRules.rules)||[]];h[d].conditions=h[d].conditions.filter((g,m)=>f!==m),n(g=>({...g,inlineConditionalRules:{...g.inlineConditionalRules,rules:h}}))},l=d=>{const f=[...(e==null?void 0:e.inlineConditionalRules.rules)||[]];f[d].conditions=[...f[d].conditions,{value:"",children:[]}],n(h=>({...h,inlineConditionalRules:{...h.inlineConditionalRules,rules:f}}))},c=()=>{n(d=>({...d,inlineConditionalRules:{...d.inlineConditionalRules,rules:[...d.inlineConditionalRules.rules,{conditions:[]}]}}))};return o.jsxs("div",{children:[o.jsx("h4",{children:"Inline Conditions"}),(u=e==null?void 0:e.inlineConditionalRules)==null?void 0:u.rules.map((d,f)=>o.jsx(ui,{className:"mb-3",header:`Rule ${f+1}`,headerTemplate:h=>i(h,f),children:o.jsxs("div",{children:[d==null?void 0:d.conditions.map((h,g)=>o.jsx("div",{className:"p-field p-pt-2",children:o.jsxs("div",{className:"grid",children:[o.jsx("label",{className:"block",children:"Show when selected option is:"}),o.jsx("div",{className:" p-fluid col-11",children:o.jsx(Os,{value:h.value,options:e==null?void 0:e.options,onChange:m=>s(m,f,g),optionLabel:"optionText.english",placeholder:"Select option"})}),o.jsx("div",{className:"col-1",children:o.jsx($t,{text:!0,icon:"pi pi-trash",className:"p-button-danger button-sm",tooltip:"Field Settings",onClick:()=>a(f,g),tooltipOptions:{position:"top"}})})]})},"inline-rules-"+g)),o.jsx($t,{text:!0,onClick:()=>l(f),className:"p-mt-4",icon:"pi pi-plus",label:"Add Condition",size:"small"})]})},f)),o.jsx($t,{text:!0,onClick:()=>c(),className:"p-mt-4",icon:"pi pi-plus",label:"Add Rule",size:"small"})]})},Qoe=t=>{const{fieldState:e,pageIndex:n,section:r,setFieldState:i,page:s}=t,{pageSettingUpdate:a,formBuilderFormLayout:l,sectionSettingUpdate:c}=an();return o.jsx(o.Fragment,{children:o.jsxs("div",{className:" scroll-height-250",children:[o.jsx(Woe,{fieldState:e,setFieldState:i}),o.jsx("hr",{}),o.jsx(Roe,{fieldState:e,setFieldState:i,pageIndex:n,formBuilderFormLayout:l,pageSettingUpdate:a}),o.jsx("hr",{}),o.jsx(Goe,{fieldState:e,setFieldState:i,section:r,formBuilderFormLayout:l,sectionSettingUpdate:c,page:s}),o.jsx("hr",{})]})})},Joe=t=>{const{fieldState:e,setFieldState:n}=t,[r,i]=M.useState(""),[s,a]=M.useState([""]),[l,c]=M.useState(!1),[u,d]=M.useState(0),[f,h]=M.useState(!1),{updateGlobalToast:g}=Jt(),m=()=>{h(!0)},v=()=>{var q;const z=((q=e==null?void 0:e.reviewerChecklist)==null?void 0:q.length)>=0?[...e.reviewerChecklist]:[];z.push({uuid:tt(),checklist:r,action:s,agree:null,selectAction:[],other:{isOther:!1,description:""},reviewerComments:""});const O={...e,reviewerChecklist:z};n(re=>({...re,...O})),h(!1),i(""),a([""])},A=()=>{h(!1),i(""),a([""])},w=z=>{const O=[...e.reviewerChecklist];O.splice(z,1);const q={...e,reviewerChecklist:O};n(re=>({...re,...q}))},E=(z,O)=>{c(!0);const{checklist:q,action:re}=z;h(!0),d(O),setTimeout(()=>{i(q),a(re)},1e3)},x=(z,O)=>o.jsxs(o.Fragment,{children:[o.jsx($t,{text:!0,type:"button",className:"p-button-info",icon:"pi pi-pencil",onClick:()=>E(z,O==null?void 0:O.rowIndex)}),o.jsx($t,{text:!0,type:"button",className:"p-button-danger",icon:"pi pi-trash",onClick:()=>w(O==null?void 0:O.rowIndex)})]}),C=z=>{var O;return o.jsx(o.Fragment,{children:(O=z==null?void 0:z.action)==null?void 0:O.length})},S=z=>{const O=[...s];O.splice(z,1),a(O)},_=()=>{const z=[...e.reviewerChecklist];z[u]={checklist:r,action:s};const O={...e,reviewerChecklist:z};n(q=>({...q,...O})),h(!1),c(!1)},I=()=>o.jsx("div",{children:l?o.jsx($t,{text:!0,className:"mb-5 p-button-success",label:"Edit Checklist",onClick:()=>{_()}}):o.jsx($t,{text:!0,className:"mb-5 p-button-success",label:"Add Checklist",onClick:()=>{v()}})}),k=z=>{n(O=>({...O,reviewerChecklist:z==null?void 0:z.value}))},P=z=>{navigator.clipboard.writeText(JSON.stringify(z))};function L(z){try{JSON.parse(z)}catch{return!1}return!0}const V=async()=>{var q;const z=await navigator.clipboard.readText();let O="";if(L(z)){const re=JSON.parse(z);if((q=re[0])!=null&&q.checklist){const pe={..._t.cloneDeep(e),reviewerChecklist:re};n(Z=>({...Z,...pe}));return}else O="Empty or Invalid Schema"}else O="Invalid Schema";g({showToast:!0,toastMessage:O,toastDetail:"",toastType:"error"})};return o.jsxs("div",{children:[o.jsx(za,{maximizable:!0,header:"Add Checklist",visible:f,style:{width:"30vw"},onHide:()=>A(),footer:I(),children:o.jsxs("div",{className:"scroll-height-500",children:[o.jsx("h5",{children:"Checklist"}),o.jsx(fo,{rows:2,cols:50,value:r,onChange:z=>{var O;i((O=z==null?void 0:z.target)==null?void 0:O.value)}}),o.jsx("h5",{children:"Actions when user selects No"}),s.map((z,O)=>o.jsxs("div",{children:[O+1,"."," ",o.jsx(fo,{value:z,onChange:q=>{var pe;const re=[...s];re[O]=(pe=q==null?void 0:q.target)==null?void 0:pe.value,a(re)},rows:2,cols:50})," ",o.jsx($t,{text:!0,type:"button",icon:"pi pi-trash",className:"p-button-danger",onClick:()=>S(O)}),o.jsx("br",{}),o.jsx("br",{})]},`actionIndex-${O}`)),o.jsx($t,{text:!0,className:" p-button-info mr-2",onClick:()=>{a([...s,""])},children:"Add Action"})]})})," ",o.jsx("h5",{children:"Reviewer Checklist"}),o.jsx($t,{text:!0,className:"mb-5 mr-2 p-button-success",label:"Add Review Checklist",onClick:()=>{m()}}),o.jsx($t,{text:!0,label:"Copy Schema ",onClick:()=>{P([...(e==null?void 0:e.reviewerChecklist)||[]])},className:"mb-5 mr-2"}),o.jsx($t,{text:!0,label:"Paste Checklist ",onClick:()=>{V()},className:"mb-5 p-button-info"}),o.jsx("div",{className:"card",children:o.jsxs(oo,{value:e==null?void 0:e.reviewerChecklist,reorderableRows:!0,onRowReorder:k,scrollable:!0,children:[o.jsx(Ar,{rowReorder:!0,style:{width:"3em"}}),o.jsx(Ar,{field:"checklist",header:"Checklist"}),o.jsx(Ar,{field:"actions",header:"Actions",body:z=>C(z)}),o.jsx(Ar,{header:"",body:(z,O)=>x(z,O)})]})})]})},Zoe=t=>{const{onHandleChangeLayoutSettings:e,fieldState:n}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field-checkbox",children:[o.jsx(zr,{inputId:"isFieldAnFilterOption",checked:(n==null?void 0:n.isFieldAnFilterOption)||!1,onChange:r=>e("isFieldAnFilterOption",r.checked)}),o.jsx("label",{htmlFor:"isFieldAnFilterOption",children:"Is field an filter option to filter data"})," ",o.jsx(cn,{target:".isFieldAnFilterOption",content:"Make the field a filter for sorting data"}),o.jsx("i",{className:"isFieldAnFilterOption pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(zr,{inputId:"isSortable",checked:(n==null?void 0:n.isSortable)||!1,onChange:r=>e("isSortable",r.checked)}),o.jsx("label",{htmlFor:"isSortable",children:"Enable sortable"})," ",o.jsx(cn,{target:".isSortable",content:"Make the field as column sortable"}),o.jsx("i",{className:"isSortable pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(zr,{inputId:"isFilterable",checked:(n==null?void 0:n.isFilterable)||!1,onChange:r=>e("isFilterable",r.checked)}),o.jsx("label",{htmlFor:"isFilterable",children:"Enable filter"})," ",o.jsx(cn,{target:".isFilterable",content:"Filter the column data"}),o.jsx("i",{className:"isFilterable pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(zr,{inputId:"resizableColumns",checked:n==null?void 0:n.resizableColumns,onChange:r=>e("resizableColumns",r.checked)}),o.jsx("label",{htmlFor:"resizableColumns",children:"Enable resizable columns"})," ",o.jsx(cn,{target:".resizableColumns",content:"Column width can be increase or decreased by dragging"}),o.jsx("i",{className:"resizableColumns pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(zr,{inputId:"reorderableColumns",checked:n==null?void 0:n.reorderableColumns,onChange:r=>e("reorderableColumns",r.checked)}),o.jsx("label",{htmlFor:"reorderableColumns",children:"Enable reorderable columns"})," ",o.jsx(cn,{target:".reorderableColumns",content:"Column can ordered to show as first or last"}),o.jsx("i",{className:"reorderableColumns pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(zr,{inputId:"colToggle",checked:(n==null?void 0:n.colToggle)||!1,onChange:r=>e("colToggle",r.checked)}),o.jsx("label",{htmlFor:"colToggle",children:"Enable column toggle"})," ",o.jsx(cn,{target:".colToggle",content:"Column can be shown and hide by settings by user"}),o.jsx("i",{className:"colToggle pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(zr,{inputId:"freezeColumn",checked:(n==null?void 0:n.freezeColumn)||!1,onChange:r=>e("freezeColumn",r.checked)}),o.jsx("label",{htmlFor:"freezeColumn",children:"Enable freeze columns"})," ",o.jsx(cn,{target:".freezeColumn",content:"Column can sticky so the important can be in view all the time"}),o.jsx("i",{className:"freezeColumn pi pi-question-circle text-secondary overlay-badge",style:{fontSize:"15px",cursor:"pointer",backgroundColor:"#000",color:"#fff",borderRadius:50}})]})]})},ele=t=>{var c,u,d;const{fieldState:e,setFieldState:n}=t,{formBuilderSchemaLanguages:r}=an(),i=()=>{n(f=>Object.assign({},f,{options:[...f.options,{uuid:tt(),optionText:{english:""},value:"",score:0,hyperlinkText:{english:""},abbreviationText:{english:""},custom_values:{}}]}))},s=f=>{n(h=>({...h,fieldType:{...h==null?void 0:h.fieldType,type:f}}))},a=(f,h)=>{n(g=>({...g,[f]:h}))},l=[{label:"Employee",api:"/employees/list",availableId:["user_id","employee_id"],optionValue:"employee_id",optionLabel:"first_name"},{label:"Departments",api:"/department/",availableId:["department_id"],optionValue:"department_id",optionLabel:"department_name"}];return o.jsxs("div",{className:"p-fluid",children:[o.jsx("h4",{children:"Render Type"}),o.jsxs("div",{className:"flex flex-wrap gap-3 my-2",children:[o.jsxs("div",{className:"flex align-items-center",children:[o.jsx(ss,{inputId:"renderType1",name:"renderType",value:"radio",onChange:f=>{s(f==null?void 0:f.value)},checked:((c=e==null?void 0:e.fieldType)==null?void 0:c.type)==="radio"}),o.jsx("label",{htmlFor:"ingredient1",className:"ml-2",children:"Radio"})]}),o.jsxs("div",{className:"flex align-items-center",children:[o.jsx(ss,{inputId:"renderType2",name:"renderType",value:"dropdown",onChange:f=>{s(f==null?void 0:f.value)},checked:((u=e==null?void 0:e.fieldType)==null?void 0:u.type)==="dropdown"}),o.jsx("label",{htmlFor:"ingredient2",className:"ml-2",children:"Dropdown"})]})]}),o.jsx("label",{htmlFor:"",className:"pb-2",children:"Data Source"}),o.jsxs("div",{className:"flex flex-wrap gap-3 mt-2",children:[o.jsxs("div",{className:"flex align-items-center",children:[o.jsx(ss,{inputId:"dataSourceType1",name:"dataSourceType",value:"custom",onChange:f=>{a("dataSourceType",f==null?void 0:f.value)},checked:(e==null?void 0:e.dataSourceType)==="custom"}),o.jsx("label",{htmlFor:"ingredient1",className:"ml-2",children:"Custom"})]}),o.jsxs("div",{className:"flex align-items-center",children:[o.jsx(ss,{inputId:"dataSourceType2",name:"dataSourceType",value:"database",onChange:f=>{a("dataSourceType",f==null?void 0:f.value)},checked:(e==null?void 0:e.dataSourceType)==="database"}),o.jsx("label",{htmlFor:"ingredient2",className:"ml-2",children:"Database"})]})]}),(e==null?void 0:e.dataSourceType)==="database"&&o.jsxs(o.Fragment,{children:[o.jsx("h4",{children:"Select Data Source"}),o.jsx("div",{children:o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:"col-6",children:[o.jsx("div",{className:"py-2",children:o.jsx("label",{children:"Datasources"})}),o.jsx(Os,{value:e==null?void 0:e.dataSource,onChange:f=>{var h;a("optionLabel",(h=f.value)==null?void 0:h.optionLabel),a("dataSource",f.value)},options:l,placeholder:"Select a Data Source",className:"w-full "})]}),o.jsxs("div",{className:"col-6",children:[o.jsx("div",{className:"py-2",children:o.jsx("label",{htmlFor:"",className:"py-2",children:"Select Datasource Id"})}),o.jsx(Os,{value:e==null?void 0:e.optionValue,onChange:f=>a("optionValue",f.value),options:(d=e==null?void 0:e.dataSource)==null?void 0:d.availableId,placeholder:"Source Id",className:"w-full "})]})]})})]}),(e==null?void 0:e.dataSourceType)==="custom"&&o.jsx(o.Fragment,{children:(e==null?void 0:e.options)!==void 0&&e.componentType!=="grid-component"&&e.componentType!=="matrix-dropdown"&&e.componentType!=="table"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"scroll-height-300 pt-5",children:o.jsx(uo,{activeIndex:0,children:r!=null&&r.length?r.map((f,h)=>o.jsx(co,{tabIndex:h,header:f==null?void 0:f.language,children:o.jsx(mO,{enableCopyPaste:!0,isCustomValue:!0,fieldState:e,setFieldState:n,language:f})},h)):""})}),o.jsx($t,{text:!0,className:"mr-3",label:"Add",icon:"pi pi-plus",onClick:()=>i(),"aria-label":"Add"})]})})]})},tle=t=>{var u,d;const{option:e,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:s}=t,{userSelectedLanguage:a}=an(),l=[{type:"radio",label:"Radio"},{type:"text",label:"Input Text"},{type:"text-area",label:"Text Area"},{type:"date",label:"Date Field"}],c=(f,h)=>{var g;return o.jsxs("div",{onClick:f.onClick,className:f.className,children:[o.jsx("span",{children:f.titleElement}),e.children&&((g=e.children)==null?void 0:g.length)>1&&o.jsx($t,{text:!0,icon:"pi pi-trash",size:"small",onClick:()=>{console.log("field",h==null?void 0:h.uuid),s(h==null?void 0:h.uuid)},"aria-label":"Filter"})]})};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"field-checkbox mt-3",children:[o.jsx(zr,{inputId:"showConditionalFields",onChange:f=>{n(e==null?void 0:e.uuid,f.checked,{enableConditionalField:f.checked})},checked:e==null?void 0:e.enableConditionalField}),o.jsx("label",{htmlFor:"showConditionalFields",children:"Enable Conditional Field"})]}),(e==null?void 0:e.enableConditionalField)===!0&&o.jsxs(o.Fragment,{children:[o.jsx($t,{text:!0,label:"Add Field",onClick:()=>{i(e==null?void 0:e.uuid)}}),o.jsx(Js,{children:((u=e.children)==null?void 0:u.length)&&((d=e.children)==null?void 0:d.map((f,h)=>{var g,m;return o.jsx(br,{header:(g=f.label)==null?void 0:g[a==null?void 0:a.type],headerTemplate:v=>c(v,f),children:o.jsxs("div",{className:"card",children:[o.jsx("p",{children:"Choose Field Type"}),o.jsx("div",{className:"flex mb-3",children:(l==null?void 0:l.length)&&(l==null?void 0:l.map(v=>o.jsxs("div",{className:"mr-3",children:[o.jsx(ss,{inputId:"ingredient1",name:"fieldType",value:v==null?void 0:v.type,onChange:()=>r(f==null?void 0:f.uuid,{type:v==null?void 0:v.type}),checked:(f==null?void 0:f.type)===(v==null?void 0:v.type)}),o.jsx("label",{htmlFor:"ingredient1",className:"ml-2",children:v==null?void 0:v.label})]},`field_type_${f==null?void 0:f.uuid}`)))}),o.jsxs("div",{className:"field-checkbox mt-3",children:[o.jsx(zr,{inputId:"isRequired",onChange:v=>{r(f==null?void 0:f.uuid,{attributes:{required:v.checked}})},checked:(m=f==null?void 0:f.attributes)==null?void 0:m.required}),o.jsxs("label",{htmlFor:"showConditionalFields",children:["Is Required"," "]})]}),o.jsxs(Js,{children:[o.jsx(br,{header:"Text",children:o.jsx(ui,{header:"Text Settings",toggleable:!0,collapsed:!0,children:o.jsx("div",{className:"",children:o.jsx(aN,{language:a,fieldState:f,onHandleChange:(v,A,w)=>{r(f==null?void 0:f.uuid,{[v]:{[A==null?void 0:A.type]:w}})}})})})}),(f==null?void 0:f.type)==="radio"&&o.jsx(br,{header:"Radio",children:o.jsx("div",{style:{width:"100%"},children:o.jsx(gb,{option:e,fieldState:f,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:s})})})]})]})},`field-tab-${h}-${f==null?void 0:f.uuid}-${e==null?void 0:e.uuid}`)}))})]})]})},gb=t=>{var a,l;const{fieldState:e,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:s}=t;return o.jsx(o.Fragment,{children:o.jsx(Js,{children:((a=e==null?void 0:e.options)==null?void 0:a.length)&&((l=e==null?void 0:e.options)==null?void 0:l.map((c,u)=>o.jsx(br,{header:`Option - ${c==null?void 0:c.label}`,children:o.jsx(tle,{option:c,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:s})},`hirarchey-option-${u}`)))})})};var yO={},nle=Di&&Di.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),p4=Di&&Di.__assign||function(){return p4=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},p4.apply(this,arguments)},rle=Di&&Di.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),ile=Di&&Di.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),AO=Di&&Di.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&rle(e,t,n);return ile(e,t),e},sle=Di&&Di.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},ale=Di&&Di.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(yO,"__esModule",{value:!0});var mb=AO(M),ole=ale(R_),hd=AO(us);function wO(t){return t&&t.replace(/ |\u202F|\u00A0/g," ").replace(/<br \/>/g,"<br>")}function lle(t){var e=document.createTextNode("");t.appendChild(e);var n=document.activeElement===t;if(e!==null&&e.nodeValue!==null&&n){var r=window.getSelection();if(r!==null){var i=document.createRange();i.setStart(e,e.nodeValue.length),i.collapse(!0),r.removeAllRanges(),r.addRange(i)}t instanceof HTMLElement&&t.focus()}}var cle=function(t){nle(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.lastHtml=n.props.html,n.el=typeof n.props.innerRef=="function"?{current:null}:mb.createRef(),n.getEl=function(){return(n.props.innerRef&&typeof n.props.innerRef!="function"?n.props.innerRef:n.el).current},n.emitChange=function(r){var i=n.getEl();if(i){var s=i.innerHTML;if(n.props.onChange&&s!==n.lastHtml){var a=Object.assign({},r,{target:{value:s}});n.props.onChange(a)}n.lastHtml=s}},n}return e.prototype.render=function(){var n=this,r=this.props,i=r.tagName,s=r.html,a=r.innerRef,l=sle(r,["tagName","html","innerRef"]);return mb.createElement(i||"div",p4(p4({},l),{ref:typeof a=="function"?function(c){a(c),n.el.current=c}:a||this.el,onInput:this.emitChange,onBlur:this.props.onBlur||this.emitChange,onKeyUp:this.props.onKeyUp||this.emitChange,onKeyDown:this.props.onKeyDown||this.emitChange,contentEditable:!this.props.disabled,dangerouslySetInnerHTML:{__html:s}}),this.props.children)},e.prototype.shouldComponentUpdate=function(n){var r=this.props,i=this.getEl();return!i||wO(n.html)!==wO(i.innerHTML)?!0:r.disabled!==n.disabled||r.tagName!==n.tagName||r.className!==n.className||r.innerRef!==n.innerRef||r.placeholder!==n.placeholder||!(0,ole.default)(r.style,n.style)},e.prototype.componentDidUpdate=function(){var n=this.getEl();n&&(this.props.html!==n.innerHTML&&(n.innerHTML=this.props.html),this.lastHtml=this.props.html,lle(n))},e.propTypes={html:hd.string.isRequired,onChange:hd.func,disabled:hd.bool,tagName:hd.string,className:hd.string,style:hd.object,innerRef:hd.oneOfType([hd.object,hd.func])},e}(mb.Component),g4=yO.default=cle;const ule=t=>{var w;const e=M.useRef(null),{field:n,fieldIndex:r,pageIndex:i,sectionIndex:s,rowIndex:a,columnIndex:l,path:c}=t,[u,d]=M.useState(n),{userSelectedLanguage:f,fieldSettingUpdate:h,fieldSettingUpdateInlineConditional:g,gridComponentFieldSettingUpdate:m}=an(),v=(E,x,C)=>{d(S=>({...S,[E]:{...S[E],[x==null?void 0:x.type]:C}}))};M.useEffect(()=>(A(),()=>{}),[u]);const A=()=>{const E=c.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?g(E[ms],E[vs],E[xs],E[Cs],E[Ts],E[Ns],E[Zo],E[Fo],u):(E==null?void 0:E.length)>Ns&&(E==null?void 0:E.length)===tc+1&&(n!=null&&n.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?m(E[ms],E[vs],E[xs],E[Cs],E[Ts],E[5],E[6],E[7],u):h(i,s,a,l,r,{...n,label:u==null?void 0:u.label})};return o.jsx(o.Fragment,{children:o.jsx(g4,{style:{display:"inline-block"},className:"builder-input-label-edit",innerRef:e,html:(w=n==null?void 0:n.label)==null?void 0:w[f==null?void 0:f.type],disabled:!1,onChange:E=>{var x;v("label",f,(x=E==null?void 0:E.target)==null?void 0:x.value)},tagName:"article"})})},ds=t=>{const{sectionIndex:e,fieldIndex:n}=t,{formBuilderFormSchema:r}=an();return(r==null?void 0:r.enableFieldEnumeration)===!0?o.jsx("span",{className:"mr-2",children:o.jsx(D7,{classes:"font-medium p-1 bg-primary",level:"purple",value:`${e+1}.${n+1}`})}):o.jsx(o.Fragment,{})},vb=t=>{var d,f,h,g,m,v,A,w,E,x,C,S,_,I;const{field:e,update:n,value:r,isFirst:i,isDisabled:s}=t,{isPreview:a}=Jt(),{userSelectedLanguage:l}=an(),[c,u]=M.useState(0);return M.useEffect(()=>{const k=Zt.addListener("onSubmitUserForm",()=>{var L;(L=e==null?void 0:e.attributes)!=null&&L.required?r!=null&&r[e.uuid]?e.isValid=1:e.isValid=0:e.isValid=1}),P=Zt.addListener("OnInvalidFieldCatch",L=>{(e==null?void 0:e.uuid)===(L==null?void 0:L.fieldId)?u(1):u(0)});return()=>{k.remove(),P.remove()}}),o.jsxs("div",{className:"ml-3 p-2",children:[(e==null?void 0:e.type)==="radio"&&o.jsxs(o.Fragment,{children:[o.jsxs("h5",{children:[" ",i===!0&&o.jsx(ds,{...t}),((d=e==null?void 0:e.attributes)==null?void 0:d.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",a?o.jsx(o.Fragment,{children:(f=e==null?void 0:e.label)==null?void 0:f[l==null?void 0:l.type]}):o.jsx(ule,{...t})]}),((h=e==null?void 0:e.options)==null?void 0:h.length)&&((g=e==null?void 0:e.options)==null?void 0:g.map(k=>{var P,L;return o.jsxs("div",{children:[o.jsxs("div",{className:"flex align-items-center mb-2",children:[o.jsx(ss,{inputId:k.uuid,name:e==null?void 0:e.uuid,value:k.uuid,onChange:V=>n(e==null?void 0:e.uuid,V==null?void 0:V.value),checked:(r==null?void 0:r[e.uuid])===k.uuid,disabled:s}),o.jsx("label",{htmlFor:k.uuid,className:"ml-2",children:k.label})]}),(k==null?void 0:k.enableConditionalField)===!0&&(r==null?void 0:r[e==null?void 0:e.uuid])===(k==null?void 0:k.uuid)&&(k==null?void 0:k.children)&&((P=k==null?void 0:k.children)==null?void 0:P.length)>0&&((L=k==null?void 0:k.children)==null?void 0:L.map(()=>o.jsx(vb,{...t},`radio_child_${r==null?void 0:r[e==null?void 0:e.uuid]}`)))]},`${k.uuid}-radio-wrapper-${e==null?void 0:e.uuid}`)}))]}),(e==null?void 0:e.type)==="text"&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((m=e==null?void 0:e.attributes)==null?void 0:m.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[l==null?void 0:l.type]]}),o.jsx(Sn,{className:"mt-2",onChange:k=>{var P;return n(e==null?void 0:e.uuid,(P=k==null?void 0:k.target)==null?void 0:P.value)},value:r==null?void 0:r.uuid,placeholder:(v=e==null?void 0:e.placeholder)==null?void 0:v[l==null?void 0:l.type]})]})}),(e==null?void 0:e.type)==="date"&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((A=e==null?void 0:e.attributes)==null?void 0:A.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[l==null?void 0:l.type]]}),o.jsx(Tf,{className:"mt-2",onChange:k=>{var P;return n(e==null?void 0:e.uuid,(P=k==null?void 0:k.target)==null?void 0:P.value)},value:r==null?void 0:r.uuid,placeholder:(w=e==null?void 0:e.placeholder)==null?void 0:w[l==null?void 0:l.type]})]})}),(e==null?void 0:e.type)==="text-area"&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((E=e==null?void 0:e.attributes)==null?void 0:E.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[l==null?void 0:l.type]]}),o.jsx(fo,{className:"mt-2",onChange:k=>{var P;return n(e==null?void 0:e.uuid,(P=k==null?void 0:k.target)==null?void 0:P.value)},value:r==null?void 0:r.uuid,placeholder:(x=e==null?void 0:e.placeholder)==null?void 0:x[l==null?void 0:l.type]})]})}),o.jsx("div",{children:((C=e==null?void 0:e.helperText)==null?void 0:C[l==null?void 0:l.type])!==""&&o.jsx("small",{children:(S=e==null?void 0:e.helperText)==null?void 0:S[l==null?void 0:l.type]})}),o.jsx("div",{children:((_=e==null?void 0:e.attributes)==null?void 0:_.required)&&o.jsx("small",{className:"error",children:c===1&&!(r!=null&&r[e.uuid])?(I=e==null?void 0:e.validationMesssage)==null?void 0:I.language:""})})]},`${e==null?void 0:e.uuid}-radio`)},dle=t=>{const{hirarechicalRadioSchemaState:e}=t,[n,r]=M.useState({});return o.jsx("div",{children:o.jsx(vb,{schema:e,field:e,update:(i,s)=>{const a={...n};a[i]=s,r(a)},value:n,sectionIndex:0,fieldIndex:0,pageIndex:0,rowIndex:0,columnIndex:0,path:""})})},bb={showHeaderText:!1,showHelperText:!1,showToolTip:!1,showLabel:!0,label:{english:"Field label"},abbreviationLabel:{english:""},helperText:{english:"Helper Text"},guidelines:{english:""},headerText:{english:"Header text"},textTable:{english:""},toolTip:{english:""},validationMesssage:{english:"This field is required"},placeholder:{english:""},enableConditionalField:!0},fle={uuid:tt(),...bb,type:"radio",value:null,options:[{uuid:tt(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:tt(),label:"No",value:null,enableConditionalField:!0,children:[]}]};({uuid:tt(),...bb,options:(tt(),{uuid:tt(),...bb,options:(tt(),tt())},tt())});const hle=t=>{const{fieldState:e,setFieldState:n}=t,r=(f,h,g)=>g==null?void 0:g.map(m=>{var v;return m.uuid===f?{...m,...h}:{...m,children:m!=null&&m.children&&((v=m==null?void 0:m.children)==null?void 0:v.length)>0?[...m.children.map(A=>A.type==="radio"?{...A,options:r(f,h,(A==null?void 0:A.options)||[])}:{...A})]:[]}}),i=(f,h,g)=>{const m=r(f,g,e.options);n(v=>({...v,options:m}))},s=(f,h,g)=>g==null?void 0:g.map(m=>{var v;return{...m,children:m!=null&&m.children&&((v=m==null?void 0:m.children)==null?void 0:v.length)>0?[...m.children.map(A=>A.uuid===f?{...A,...h}:{...A,options:s(f,h,A==null?void 0:A.options)})]:[]}}),a=(f,h)=>{const g=s(f,h,e.options);n(m=>({...m,options:g}))},l=(f,h)=>h==null?void 0:h.map(g=>{var m;return{...g,children:g!=null&&g.children&&((m=g==null?void 0:g.children)==null?void 0:m.length)>0?[...g.children.filter(v=>{if(v.uuid!==f)return{...v,options:l(f,v==null?void 0:v.options)}})]:[]}}),c=(f,h,g)=>g==null?void 0:g.map(m=>{var v;return m.children&&m.uuid===f?{...m,children:[...m.children,h]}:{...m,children:m!=null&&m.children&&((v=m==null?void 0:m.children)==null?void 0:v.length)>0?[...m.children.map(A=>({...A,options:c(f,h,A==null?void 0:A.options)}))]:[]}}),u=f=>{const h=c(f,{...fle,isValid:0,uuid:tt(),options:[{uuid:tt(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:tt(),label:"No",value:null,enableConditionalField:!0,children:[]}],isPostField:!1,showAlphabetList:!1,showButtonLayout:!1,answerOptions:[],isExternalSource:!1,underLined:!1,noOfMultpleAnswer:void 0,isAllowMultipleAnswer:!1,isIcon:!1,isTodayBtn:!1,resizableColumns:!1,isFilterable:!1,freezeColumn:!1,colToggle:!1,isFieldAnFilterOption:!1,isSortable:!1,reorderableColumns:!1,timeLimit:0,score:0,subject_id:0,course_category_id:0,TextEditorProps:!1,fieldData:void 0},e.options);n(g=>({...g,options:h}))},d=f=>{const h=l(f,e.options);n(g=>({...g,options:h}))};return o.jsx("div",{children:o.jsx("div",{className:" px-4",children:o.jsxs("div",{className:"grid",children:[o.jsx("div",{className:"col-6 scroll-height-200",children:(e==null?void 0:e.isHierarchalCondionalTabEnabled)===!0&&o.jsx(gb,{fieldState:e,updateCondtionOption:i,updateChildrenField:a,addChildrenField:u,removeChildrenField:d})}),o.jsxs("div",{className:"col-6 p-3 scroll-height-200",children:[o.jsx("h4",{className:"flex justify-content-center align-items-center",children:"Preview"}),o.jsx(dle,{hirarechicalRadioSchemaState:e})]})]})})})},Wi=t=>{var te,ne;const{formBuilderFormSchema:e,fieldSettingUpdate:n,fieldSettingUpdateInlineConditional:r,formBuilderSchemaLanguages:i,pageSettingUpdate:s,formBuilderFormLayout:a,formBuilderPublishedStatus:l,gridComponentFieldSettingUpdate:c}=an(),{renderType:u}=Jt(),{visibilty:d,field:f,closeSettingFieldSidebar:h,pageIndex:g,sectionIndex:m,rowIndex:v,columnIndex:A,fieldIndex:w,path:E,row:x}=t,{updateGlobalToast:C}=Jt(),[S,_]=M.useState(f),I=E.split("-"),k=()=>{const K=E.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?r(K[ms],K[vs],K[xs],K[Cs],K[Ts],K[Ns],K[Zo],K[Fo],S):(K==null?void 0:K.length)>Ns&&(K==null?void 0:K.length)===tc+1&&(S!=null&&S.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?c(K[ms],K[vs],K[xs],K[Cs],K[Ts],K[5],K[6],K[7],S):(n(g,m,v,A,w,S),setTimeout(()=>{Zt.emit("OnSignatureSettingChange",{})},1e3),setTimeout(()=>{Zt.emit("onUpdateField",{})},1e3)),C({showToast:!0,toastMessage:"Updated",toastDetail:"Field updated",toastType:"success"})},P=(K,W,de)=>{_(ve=>({...ve,[K]:{...ve[K],[W==null?void 0:W.type]:de}}))},L=(K,W)=>{_(de=>({...de,attributes:{...de.attributes,[K]:W}}))},V=(K,W)=>{_(de=>({...de,[K]:W}))},z=(K,W)=>{_(de=>({...de,inlineConditional:{...de.inlineConditional,[K]:W}}))},O=()=>{},q=()=>{_(K=>({...K,data:[...K.data,{uuid:tt(),dataKey:"",value:""}]}))},re=()=>{_(K=>Object.assign({},K,{options:[...K.options,{uuid:tt(),optionText:{english:""},value:"",score:0,hyperlinkText:{english:""},abbreviationText:{english:""},custom_values:{}}]}))},pe=()=>{},Z=()=>{},Q=()=>{},fe=()=>{},Y=K=>{var Te;const W=[...(S==null?void 0:S.conditionalTabRules.rules)||[]],de=W.filter((ye,Ae)=>K!==Ae);_(ye=>({...ye,conditionalTabRules:{...ye.conditionalTabRules,rules:de}}));const ve=W[K];(Te=ve==null?void 0:ve.conditions)==null||Te.map(ye=>{const Ae=_t.findIndex(a,U=>{var ae;return(U==null?void 0:U.uuid)===((ae=ye==null?void 0:ye.tab)==null?void 0:ae.uuid)}),J=a[Ae];J&&(J.isHidden=!1,s(Ae,J))})},ce=(K,W)=>{const de=[...(S==null?void 0:S.conditionalTabRules.rules)||[]];de[K].conditions=de[K].conditions.filter((ve,Te)=>W!==Te),_(ve=>({...ve,conditionalTabRules:{...ve.conditionalTabRules,rules:de}}))};return o.jsx(o.Fragment,{children:o.jsxs(Vo,{style:{width:"80vw",zIndex:7e3},visible:d,position:"left",className:"p-sidebar-lg",onHide:()=>h(),children:[o.jsxs("div",{className:"flex justify-content-between flex-wrap card-container ",children:[o.jsxs("div",{className:"flex align-items-center justify-content-center ",children:[" ",o.jsxs("h5",{className:"mb-0",children:[(te=f==null?void 0:f.label)==null?void 0:te.english," "]})]}),!l&&o.jsx("div",{className:"flex align-items-center justify-content-center",children:o.jsx($t,{className:"mt-3",label:"Update",type:"button",onClick:()=>k(),"aria-label":"Update"})})]}),o.jsx("div",{className:" mt-4",children:o.jsxs(Js,{children:[o.jsx(br,{header:"Text",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(uo,{activeIndex:0,children:i!=null&&i.length?i.map((K,W)=>o.jsx(co,{tabIndex:W,header:K==null?void 0:K.language,children:o.jsx(aN,{language:K,fieldState:S,onHandleChange:P,...t})},W)):""})})}),(S==null?void 0:S.isValidationTabEnabled)===!0&&o.jsx(br,{header:"Validation",children:o.jsx(bre,{fieldState:S,onHandleChangeLayoutSettings:V,onHandleChangeAttributesSetttings:L,...t})}),o.jsx(br,{header:"Attributes",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(yre,{fieldState:S,onHandleChangeLayoutSettings:V,onHandleChangeAttributesSetttings:L})})}),(S==null?void 0:S.isLayoutTabEnabled)===!0&&o.jsx(br,{header:"Layout",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(Ore,{fieldState:S,onHandleChangeLayoutSettings:V})})}),(S==null?void 0:S.isDynamicListingTabEnabled)===!0&&o.jsx(br,{header:"Dynamic Options",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(ele,{fieldState:S,setFieldState:_})})}),(S==null?void 0:S.options)!==void 0&&(S==null?void 0:S.data)&&o.jsx(br,{header:"Data",children:o.jsxs("div",{className:"scroll-height-200",children:[o.jsx(Fre,{onHandleChangeLayoutSettings:V,fieldState:S,setFieldState:_}),o.jsx($t,{className:"mr-3",label:"Data Option",icon:"pi pi-plus",onClick:()=>q(),"aria-label":"Add"})]})}),o.jsx(br,{header:"Table view options",children:o.jsx(Zoe,{fieldState:S,onHandleChangeLayoutSettings:V})}),(S==null?void 0:S.componentType)!=="radio-hierarchal"&&(S==null?void 0:S.options)!==void 0&&f.componentType!=="grid-component"&&f.componentType!=="matrix-dropdown"&&f.componentType!=="table"&&o.jsxs(br,{header:"Options",children:[(S==null?void 0:S.componentType)!=="radio-hierarchal"&&o.jsx("div",{className:"flex justify-content-end",children:o.jsx($t,{className:"mr-3 mb-2",label:"Option",icon:"pi pi-plus",onClick:()=>re(),"aria-label":"Option"})}),o.jsxs("div",{className:"scroll-height-200 px-4",children:[o.jsx(uo,{activeIndex:0,children:i!=null&&i.length?i.map((K,W)=>o.jsx(co,{tabIndex:W,header:K==null?void 0:K.language,children:o.jsx(mO,{enableAbbreviationColumn:(S==null?void 0:S.componentType)!=="radio-hierarchal",enableHyperTextColumn:(S==null?void 0:S.componentType)!=="radio-hierarchal",enableAddNewColumn:(S==null?void 0:S.componentType)!=="radio-hierarchal",enableCopyPaste:(S==null?void 0:S.componentType)!=="radio-hierarchal",isCustomValue:!1,fieldState:S,setFieldState:_,language:K})},W)):""}),(S==null?void 0:S.isHierarchalCondionalTabEnabled)===!0&&o.jsx(gb,{fieldState:S,onHandleChangeLayoutSettings:V,removeChildrenField:fe,addChildrenField:Q,updateChildrenField:Z,updateCondtionOption:pe})]})]}),(S==null?void 0:S.componentType)==="radio-hierarchal"&&(S==null?void 0:S.options)!==void 0&&f.componentType!=="grid-component"&&f.componentType!=="matrix-dropdown"&&f.componentType!=="table"&&o.jsx(br,{header:"Hierarchal Options",children:o.jsx(hle,{fieldState:S,setFieldState:_})}),u===$3&&(S==null?void 0:S.inlineConditionalRules)!==void 0&&!(x!=null&&x.rowIsRepeatable)&&(I==null?void 0:I.length)<Fo+1&&o.jsx(br,{header:"Conditional",children:o.jsx(Qoe,{handleRemoveConditionalTabRule:Y,handleRemoveConditionalTabRuleCondition:ce,onHandleSelectInlineConditionalOption:O,onHandleChangeLayoutSettings:V,onHandleChangeInlineConditionaltSetttings:z,fieldState:S,setFieldState:_,pageIndex:g,sectionIndex:m,...t})}),!((ne=t==null?void 0:t.row)!=null&&ne.rowIsRepeatable)&&(e==null?void 0:e.enableReviewTask)===!0&&o.jsx(br,{header:"Admin",children:o.jsx(Joe,{fieldState:S,setFieldState:_})})]})})]})})},Ni=t=>{const[e,n]=M.useState(null),{field:r}=t,{userTaskSubmitFormData:i,updateUserFormDataSubmit:s}=vr();M.useEffect(()=>{var h,g;if(i!==null&&e===null){let m=0;r!=null&&r.rowIsRepeatable?m=i.findIndex(v=>(v==null?void 0:v.rowId)===(r==null?void 0:r.uuid)):m=i.findIndex(v=>(v==null?void 0:v.fieldId)===(r==null?void 0:r.uuid)),n((h=i[m])!=null&&h.reviewerChecklist?(g=i[m])==null?void 0:g.reviewerChecklist:[])}return()=>{}},[r==null?void 0:r.rowIsRepeatable,r==null?void 0:r.uuid,e,i]);const a=h=>{const g=i.findIndex(v=>(v==null?void 0:v.fieldId)===(r==null?void 0:r.uuid)),m=[...i];m[g]={...m[g],reviewerChecklist:h},s(m)},l=(h,g)=>{const m=e;m[g]={...m[g],agree:h==null?void 0:h.value},n([...m]),a(m)},c=(h,g)=>{const m=e;if(g!=null&&g.checked)m[h].selectAction.push(g==null?void 0:g.value);else{const v=m[h].selectAction.findIndex(A=>A===(g==null?void 0:g.value));m[h].selectAction.splice(v,1)}n([...m]),a(m)},u=(h,g)=>{const m=e;h!=null&&h.checked?m[g]={...m[g],other:{...m[g].other,isOther:!0}}:m[g]={...m[g],other:{...m[g].other,isOther:!1}},n([...m]),a(m)},d=(h,g)=>{var v;const m=e;m[g]={...m[g],other:{...m[g].other,description:(v=h==null?void 0:h.target)==null?void 0:v.value}},n([...m]),a(m)},f=(h,g,m)=>{var A;const v=e;v[m]={...v[m],[g]:(A=h==null?void 0:h.target)==null?void 0:A.value},n([...v]),a(v)};return o.jsx(o.Fragment,{children:o.jsx("div",{className:"col-12",children:o.jsx(Js,{children:o.jsx(br,{header:"Admin Review",children:o.jsx("div",{className:"grid",children:e!==null&&(e==null?void 0:e.length)>0&&(e==null?void 0:e.map((h,g)=>{var m,v,A,w,E;return o.jsx("div",{className:"col-4 p-fluid p-3",children:o.jsxs("div",{className:"card",children:[o.jsx("h6",{className:"mb-2",children:h==null?void 0:h.checklist}),o.jsx("br",{}),o.jsxs("div",{className:"field-radiobutton",children:[o.jsx(ss,{inputId:`yes-${g}`,name:"action",value:!0,onChange:x=>{l(x,g)},checked:(h==null?void 0:h.agree)===!0}),o.jsx("label",{htmlFor:`yes-${g}`,children:"Yes"})]}),o.jsxs("div",{className:"field-radiobutton",children:[o.jsx(ss,{inputId:`no-${g}`,name:"action",value:!1,onChange:x=>{l(x,g)},checked:(h==null?void 0:h.agree)===!1}),o.jsx("label",{htmlFor:`no-${g}`,children:"No"})]}),(h==null?void 0:h.agree)===!1&&o.jsxs("div",{className:"px-5 mb-3",children:[(h==null?void 0:h.action)&&Array.isArray(h.action)&&((m=h==null?void 0:h.action)==null?void 0:m.length)>0&&((v=h==null?void 0:h.action)==null?void 0:v.map((x,C)=>{var S;return o.jsxs("div",{children:[o.jsx(zr,{value:x,checked:((S=h==null?void 0:h.selectAction)==null?void 0:S.length)>0?h==null?void 0:h.selectAction.some(_=>_===x):!1,onChange:_=>{c(g,_)}})," ",x," ",o.jsx("br",{}),o.jsx("br",{})]},`action-${g}-${C}`)})),o.jsx(zr,{checked:(A=h==null?void 0:h.other)==null?void 0:A.isOther,onChange:x=>{u(x,g)}})," Other ",o.jsx("br",{}),o.jsx("br",{}),((w=h==null?void 0:h.other)==null?void 0:w.isOther)===!0&&o.jsxs("div",{className:"",children:[o.jsx("label",{children:"If other please specify the action point"}),o.jsx("br",{}),o.jsx(fo,{className:"mt-3",value:(E=h==null?void 0:h.other)==null?void 0:E.description,onChange:x=>d(x,g)})]})]}),(h==null?void 0:h.agree)===!1&&o.jsxs("div",{className:"",children:[o.jsx("label",{children:"Reviewer Feedback "}),o.jsx("br",{}),o.jsx(fo,{className:"mt-3",value:h==null?void 0:h.reviewerFeedback,onChange:x=>f(x,"reviewerFeedback",g)})]}),o.jsxs("div",{className:"",children:[o.jsx("label",{children:"Reviewer Comments / Notes (internal use only)"}),o.jsx("br",{}),o.jsx(fo,{className:"mt-3",value:h==null?void 0:h.reviewerComments,onChange:x=>f(x,"reviewerComments",g)})]})]})},`checklistIndex-${g}`)}))})})})})})},Si=t=>{const{isPreview:e,field:n,isAdmin:r,fieldWrap:i}=t,{userSelectedLanguage:s}=an(),{globalAlignment:a}=Jt(),l=g=>{const m=g.collapsed?"pi pi-chevron-down":"pi pi-chevron-up",v=`${g.className} justify-content-start`,A=`${g.titleClassName} pl-1`;return o.jsxs("div",{className:v,children:[o.jsxs("button",{className:g.togglerClassName,onClick:g.onTogglerClick,children:[o.jsx("span",{className:m}),o.jsx(tn,{})]}),o.jsx("span",{className:A,children:d})]})},{TASK_PUBLISHED:c,task_status:u}=vr(),[d,f]=M.useState("");M.useEffect(()=>{var g;f((g=n==null?void 0:n.label)==null?void 0:g[s==null?void 0:s.type])},[n,s==null?void 0:s.type]);const h=()=>{let g="";return e||(g=g+" field-form-builder"),u===c&&r===!0&&(g=g+" card"),g};return o.jsx(o.Fragment,{children:o.jsx("div",{dir:a,className:h(),children:u===c&&r===!0?o.jsx(ui,{headerTemplate:l,toggleable:!0,children:i}):i})})};/*! @license DOMPurify 3.2.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.3/LICENSE */const{entries:SO,setPrototypeOf:xO,isFrozen:ple,getPrototypeOf:gle,getOwnPropertyDescriptor:mle}=Object;let{freeze:Uo,seal:ac,create:CO}=Object,{apply:yb,construct:Ab}=typeof Reflect<"u"&&Reflect;Uo||(Uo=function(e){return e}),ac||(ac=function(e){return e}),yb||(yb=function(e,n,r){return e.apply(n,r)}),Ab||(Ab=function(e,n){return new e(...n)});const m4=Dl(Array.prototype.forEach),TO=Dl(Array.prototype.pop),O2=Dl(Array.prototype.push),v4=Dl(String.prototype.toLowerCase),wb=Dl(String.prototype.toString),EO=Dl(String.prototype.match),F2=Dl(String.prototype.replace),vle=Dl(String.prototype.indexOf),ble=Dl(String.prototype.trim),Uc=Dl(Object.prototype.hasOwnProperty),qo=Dl(RegExp.prototype.test),k2=yle(TypeError);function Dl(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return yb(t,e,r)}}function yle(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Ab(t,n)}}function pi(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:v4;xO&&xO(t,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const s=n(i);s!==i&&(ple(e)||(e[r]=s),i=s)}t[i]=!0}return t}function Ale(t){for(let e=0;e<t.length;e++)Uc(t,e)||(t[e]=null);return t}function m1(t){const e=CO(null);for(const[n,r]of SO(t))Uc(t,n)&&(Array.isArray(r)?e[n]=Ale(r):r&&typeof r=="object"&&r.constructor===Object?e[n]=m1(r):e[n]=r);return e}function P2(t,e){for(;t!==null;){const r=mle(t,e);if(r){if(r.get)return Dl(r.get);if(typeof r.value=="function")return Dl(r.value)}t=gle(t)}function n(){return null}return n}const IO=Uo(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Sb=Uo(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),xb=Uo(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),wle=Uo(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Cb=Uo(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Sle=Uo(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),_O=Uo(["#text"]),DO=Uo(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Tb=Uo(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),NO=Uo(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),b4=Uo(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),xle=ac(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Cle=ac(/<%[\w\W]*|[\w\W]*%>/gm),Tle=ac(/\$\{[\w\W]*}/gm),Ele=ac(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ile=ac(/^aria-[\-\w]+$/),OO=ac(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),_le=ac(/^(?:\w+script|data):/i),Dle=ac(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),FO=ac(/^html$/i),Nle=ac(/^[a-z][.\w]*(-[.\w]+)+$/i);var kO=Object.freeze({__proto__:null,ARIA_ATTR:Ile,ATTR_WHITESPACE:Dle,CUSTOM_ELEMENT:Nle,DATA_ATTR:Ele,DOCTYPE_NAME:FO,ERB_EXPR:Cle,IS_ALLOWED_URI:OO,IS_SCRIPT_OR_DATA:_le,MUSTACHE_EXPR:xle,TMPLIT_EXPR:Tle});const M2={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ole=function(){return typeof window>"u"?null:window},Fle=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const s="dompurify"+(r?"#"+r:"");try{return e.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},PO=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function MO(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ole();const e=ct=>MO(ct);if(e.version="3.2.3",e.removed=[],!t||!t.document||t.document.nodeType!==M2.document)return e.isSupported=!1,e;let{document:n}=t;const r=n,i=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:l,Element:c,NodeFilter:u,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:f,DOMParser:h,trustedTypes:g}=t,m=c.prototype,v=P2(m,"cloneNode"),A=P2(m,"remove"),w=P2(m,"nextSibling"),E=P2(m,"childNodes"),x=P2(m,"parentNode");if(typeof a=="function"){const ct=n.createElement("template");ct.content&&ct.content.ownerDocument&&(n=ct.content.ownerDocument)}let C,S="";const{implementation:_,createNodeIterator:I,createDocumentFragment:k,getElementsByTagName:P}=n,{importNode:L}=r;let V=PO();e.isSupported=typeof SO=="function"&&typeof x=="function"&&_&&_.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:z,ERB_EXPR:O,TMPLIT_EXPR:q,DATA_ATTR:re,ARIA_ATTR:pe,IS_SCRIPT_OR_DATA:Z,ATTR_WHITESPACE:Q,CUSTOM_ELEMENT:fe}=kO;let{IS_ALLOWED_URI:Y}=kO,ce=null;const te=pi({},[...IO,...Sb,...xb,...Cb,..._O]);let ne=null;const K=pi({},[...DO,...Tb,...NO,...b4]);let W=Object.seal(CO(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),de=null,ve=null,Te=!0,ye=!0,Ae=!1,J=!0,U=!1,ae=!0,G=!1,le=!1,De=!1,_e=!1,be=!1,me=!1,Se=!0,Ie=!1;const $="user-content-";let se=!0,ge=!1,oe={},he=null;const ue=pi({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ve=null;const Ne=pi({},["audio","video","img","source","image","track"]);let Ye=null;const st=pi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ot="http://www.w3.org/1998/Math/MathML",ht="http://www.w3.org/2000/svg",Pt="http://www.w3.org/1999/xhtml";let pn=Pt,kt=!1,wt=null;const qe=pi({},[ot,ht,Pt],wb);let pt=pi({},["mi","mo","mn","ms","mtext"]),qt=pi({},["annotation-xml"]);const fn=pi({},["title","style","font","a","script"]);let mn=null;const En=["application/xhtml+xml","text/html"],Vn="text/html";let _n=null,Wt=null;const Xe=n.createElement("form"),Qe=function(Be){return Be instanceof RegExp||Be instanceof Function},dt=function(){let Be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Wt&&Wt===Be)){if((!Be||typeof Be!="object")&&(Be={}),Be=m1(Be),mn=En.indexOf(Be.PARSER_MEDIA_TYPE)===-1?Vn:Be.PARSER_MEDIA_TYPE,_n=mn==="application/xhtml+xml"?wb:v4,ce=Uc(Be,"ALLOWED_TAGS")?pi({},Be.ALLOWED_TAGS,_n):te,ne=Uc(Be,"ALLOWED_ATTR")?pi({},Be.ALLOWED_ATTR,_n):K,wt=Uc(Be,"ALLOWED_NAMESPACES")?pi({},Be.ALLOWED_NAMESPACES,wb):qe,Ye=Uc(Be,"ADD_URI_SAFE_ATTR")?pi(m1(st),Be.ADD_URI_SAFE_ATTR,_n):st,Ve=Uc(Be,"ADD_DATA_URI_TAGS")?pi(m1(Ne),Be.ADD_DATA_URI_TAGS,_n):Ne,he=Uc(Be,"FORBID_CONTENTS")?pi({},Be.FORBID_CONTENTS,_n):ue,de=Uc(Be,"FORBID_TAGS")?pi({},Be.FORBID_TAGS,_n):{},ve=Uc(Be,"FORBID_ATTR")?pi({},Be.FORBID_ATTR,_n):{},oe=Uc(Be,"USE_PROFILES")?Be.USE_PROFILES:!1,Te=Be.ALLOW_ARIA_ATTR!==!1,ye=Be.ALLOW_DATA_ATTR!==!1,Ae=Be.ALLOW_UNKNOWN_PROTOCOLS||!1,J=Be.ALLOW_SELF_CLOSE_IN_ATTR!==!1,U=Be.SAFE_FOR_TEMPLATES||!1,ae=Be.SAFE_FOR_XML!==!1,G=Be.WHOLE_DOCUMENT||!1,_e=Be.RETURN_DOM||!1,be=Be.RETURN_DOM_FRAGMENT||!1,me=Be.RETURN_TRUSTED_TYPE||!1,De=Be.FORCE_BODY||!1,Se=Be.SANITIZE_DOM!==!1,Ie=Be.SANITIZE_NAMED_PROPS||!1,se=Be.KEEP_CONTENT!==!1,ge=Be.IN_PLACE||!1,Y=Be.ALLOWED_URI_REGEXP||OO,pn=Be.NAMESPACE||Pt,pt=Be.MATHML_TEXT_INTEGRATION_POINTS||pt,qt=Be.HTML_INTEGRATION_POINTS||qt,W=Be.CUSTOM_ELEMENT_HANDLING||{},Be.CUSTOM_ELEMENT_HANDLING&&Qe(Be.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(W.tagNameCheck=Be.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Be.CUSTOM_ELEMENT_HANDLING&&Qe(Be.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(W.attributeNameCheck=Be.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Be.CUSTOM_ELEMENT_HANDLING&&typeof Be.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(W.allowCustomizedBuiltInElements=Be.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),U&&(ye=!1),be&&(_e=!0),oe&&(ce=pi({},_O),ne=[],oe.html===!0&&(pi(ce,IO),pi(ne,DO)),oe.svg===!0&&(pi(ce,Sb),pi(ne,Tb),pi(ne,b4)),oe.svgFilters===!0&&(pi(ce,xb),pi(ne,Tb),pi(ne,b4)),oe.mathMl===!0&&(pi(ce,Cb),pi(ne,NO),pi(ne,b4))),Be.ADD_TAGS&&(ce===te&&(ce=m1(ce)),pi(ce,Be.ADD_TAGS,_n)),Be.ADD_ATTR&&(ne===K&&(ne=m1(ne)),pi(ne,Be.ADD_ATTR,_n)),Be.ADD_URI_SAFE_ATTR&&pi(Ye,Be.ADD_URI_SAFE_ATTR,_n),Be.FORBID_CONTENTS&&(he===ue&&(he=m1(he)),pi(he,Be.FORBID_CONTENTS,_n)),se&&(ce["#text"]=!0),G&&pi(ce,["html","head","body"]),ce.table&&(pi(ce,["tbody"]),delete de.tbody),Be.TRUSTED_TYPES_POLICY){if(typeof Be.TRUSTED_TYPES_POLICY.createHTML!="function")throw k2('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Be.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw k2('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=Be.TRUSTED_TYPES_POLICY,S=C.createHTML("")}else C===void 0&&(C=Fle(g,i)),C!==null&&typeof S=="string"&&(S=C.createHTML(""));Uo&&Uo(Be),Wt=Be}},Ft=pi({},[...Sb,...xb,...wle]),vn=pi({},[...Cb,...Sle]),Pn=function(Be){let rt=x(Be);(!rt||!rt.tagName)&&(rt={namespaceURI:pn,tagName:"template"});const It=v4(Be.tagName),zt=v4(rt.tagName);return wt[Be.namespaceURI]?Be.namespaceURI===ht?rt.namespaceURI===Pt?It==="svg":rt.namespaceURI===ot?It==="svg"&&(zt==="annotation-xml"||pt[zt]):!!Ft[It]:Be.namespaceURI===ot?rt.namespaceURI===Pt?It==="math":rt.namespaceURI===ht?It==="math"&&qt[zt]:!!vn[It]:Be.namespaceURI===Pt?rt.namespaceURI===ht&&!qt[zt]||rt.namespaceURI===ot&&!pt[zt]?!1:!vn[It]&&(fn[It]||!Ft[It]):!!(mn==="application/xhtml+xml"&&wt[Be.namespaceURI]):!1},Mn=function(Be){O2(e.removed,{element:Be});try{x(Be).removeChild(Be)}catch{A(Be)}},Xn=function(Be,rt){try{O2(e.removed,{attribute:rt.getAttributeNode(Be),from:rt})}catch{O2(e.removed,{attribute:null,from:rt})}if(rt.removeAttribute(Be),Be==="is")if(_e||be)try{Mn(rt)}catch{}else try{rt.setAttribute(Be,"")}catch{}},Zn=function(Be){let rt=null,It=null;if(De)Be="<remove></remove>"+Be;else{const Ue=EO(Be,/^[\r\n\t ]+/);It=Ue&&Ue[0]}mn==="application/xhtml+xml"&&pn===Pt&&(Be='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Be+"</body></html>");const zt=C?C.createHTML(Be):Be;if(pn===Pt)try{rt=new h().parseFromString(zt,mn)}catch{}if(!rt||!rt.documentElement){rt=_.createDocument(pn,"template",null);try{rt.documentElement.innerHTML=kt?S:zt}catch{}}const yt=rt.body||rt.documentElement;return Be&&It&&yt.insertBefore(n.createTextNode(It),yt.childNodes[0]||null),pn===Pt?P.call(rt,G?"html":"body")[0]:G?rt.documentElement:yt},pr=function(Be){return I.call(Be.ownerDocument||Be,Be,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},gi=function(Be){return Be instanceof f&&(typeof Be.nodeName!="string"||typeof Be.textContent!="string"||typeof Be.removeChild!="function"||!(Be.attributes instanceof d)||typeof Be.removeAttribute!="function"||typeof Be.setAttribute!="function"||typeof Be.namespaceURI!="string"||typeof Be.insertBefore!="function"||typeof Be.hasChildNodes!="function")},yn=function(Be){return typeof l=="function"&&Be instanceof l};function it(ct,Be,rt){m4(ct,It=>{It.call(e,Be,rt,Wt)})}const ft=function(Be){let rt=null;if(it(V.beforeSanitizeElements,Be,null),gi(Be))return Mn(Be),!0;const It=_n(Be.nodeName);if(it(V.uponSanitizeElement,Be,{tagName:It,allowedTags:ce}),Be.hasChildNodes()&&!yn(Be.firstElementChild)&&qo(/<[/\w]/g,Be.innerHTML)&&qo(/<[/\w]/g,Be.textContent)||Be.nodeType===M2.progressingInstruction||ae&&Be.nodeType===M2.comment&&qo(/<[/\w]/g,Be.data))return Mn(Be),!0;if(!ce[It]||de[It]){if(!de[It]&&Lt(It)&&(W.tagNameCheck instanceof RegExp&&qo(W.tagNameCheck,It)||W.tagNameCheck instanceof Function&&W.tagNameCheck(It)))return!1;if(se&&!he[It]){const zt=x(Be)||Be.parentNode,yt=E(Be)||Be.childNodes;if(yt&&zt){const Ue=yt.length;for(let Je=Ue-1;Je>=0;--Je){const Nt=v(yt[Je],!0);Nt.__removalCount=(Be.__removalCount||0)+1,zt.insertBefore(Nt,w(Be))}}}return Mn(Be),!0}return Be instanceof c&&!Pn(Be)||(It==="noscript"||It==="noembed"||It==="noframes")&&qo(/<\/no(script|embed|frames)/i,Be.innerHTML)?(Mn(Be),!0):(U&&Be.nodeType===M2.text&&(rt=Be.textContent,m4([z,O,q],zt=>{rt=F2(rt,zt," ")}),Be.textContent!==rt&&(O2(e.removed,{element:Be.cloneNode()}),Be.textContent=rt)),it(V.afterSanitizeElements,Be,null),!1)},At=function(Be,rt,It){if(Se&&(rt==="id"||rt==="name")&&(It in n||It in Xe))return!1;if(!(ye&&!ve[rt]&&qo(re,rt))){if(!(Te&&qo(pe,rt))){if(!ne[rt]||ve[rt]){if(!(Lt(Be)&&(W.tagNameCheck instanceof RegExp&&qo(W.tagNameCheck,Be)||W.tagNameCheck instanceof Function&&W.tagNameCheck(Be))&&(W.attributeNameCheck instanceof RegExp&&qo(W.attributeNameCheck,rt)||W.attributeNameCheck instanceof Function&&W.attributeNameCheck(rt))||rt==="is"&&W.allowCustomizedBuiltInElements&&(W.tagNameCheck instanceof RegExp&&qo(W.tagNameCheck,It)||W.tagNameCheck instanceof Function&&W.tagNameCheck(It))))return!1}else if(!Ye[rt]){if(!qo(Y,F2(It,Q,""))){if(!((rt==="src"||rt==="xlink:href"||rt==="href")&&Be!=="script"&&vle(It,"data:")===0&&Ve[Be])){if(!(Ae&&!qo(Z,F2(It,Q,"")))){if(It)return!1}}}}}}return!0},Lt=function(Be){return Be!=="annotation-xml"&&EO(Be,fe)},Ut=function(Be){it(V.beforeSanitizeAttributes,Be,null);const{attributes:rt}=Be;if(!rt||gi(Be))return;const It={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ne,forceKeepAttr:void 0};let zt=rt.length;for(;zt--;){const yt=rt[zt],{name:Ue,namespaceURI:Je,value:Nt}=yt,nn=_n(Ue);let St=Ue==="value"?Nt:ble(Nt);if(It.attrName=nn,It.attrValue=St,It.keepAttr=!0,It.forceKeepAttr=void 0,it(V.uponSanitizeAttribute,Be,It),St=It.attrValue,Ie&&(nn==="id"||nn==="name")&&(Xn(Ue,Be),St=$+St),ae&&qo(/((--!?|])>)|<\/(style|title)/i,St)){Xn(Ue,Be);continue}if(It.forceKeepAttr||(Xn(Ue,Be),!It.keepAttr))continue;if(!J&&qo(/\/>/i,St)){Xn(Ue,Be);continue}U&&m4([z,O,q],et=>{St=F2(St,et," ")});const Pe=_n(Be.nodeName);if(At(Pe,nn,St)){if(C&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Je)switch(g.getAttributeType(Pe,nn)){case"TrustedHTML":{St=C.createHTML(St);break}case"TrustedScriptURL":{St=C.createScriptURL(St);break}}try{Je?Be.setAttributeNS(Je,Ue,St):Be.setAttribute(Ue,St),gi(Be)?Mn(Be):TO(e.removed)}catch{}}}it(V.afterSanitizeAttributes,Be,null)},vt=function ct(Be){let rt=null;const It=pr(Be);for(it(V.beforeSanitizeShadowDOM,Be,null);rt=It.nextNode();)it(V.uponSanitizeShadowNode,rt,null),ft(rt),Ut(rt),rt.content instanceof s&&ct(rt.content);it(V.afterSanitizeShadowDOM,Be,null)};return e.sanitize=function(ct){let Be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},rt=null,It=null,zt=null,yt=null;if(kt=!ct,kt&&(ct="<!-->"),typeof ct!="string"&&!yn(ct))if(typeof ct.toString=="function"){if(ct=ct.toString(),typeof ct!="string")throw k2("dirty is not a string, aborting")}else throw k2("toString is not a function");if(!e.isSupported)return ct;if(le||dt(Be),e.removed=[],typeof ct=="string"&&(ge=!1),ge){if(ct.nodeName){const Nt=_n(ct.nodeName);if(!ce[Nt]||de[Nt])throw k2("root node is forbidden and cannot be sanitized in-place")}}else if(ct instanceof l)rt=Zn("<!---->"),It=rt.ownerDocument.importNode(ct,!0),It.nodeType===M2.element&&It.nodeName==="BODY"||It.nodeName==="HTML"?rt=It:rt.appendChild(It);else{if(!_e&&!U&&!G&&ct.indexOf("<")===-1)return C&&me?C.createHTML(ct):ct;if(rt=Zn(ct),!rt)return _e?null:me?S:""}rt&&De&&Mn(rt.firstChild);const Ue=pr(ge?ct:rt);for(;zt=Ue.nextNode();)ft(zt),Ut(zt),zt.content instanceof s&&vt(zt.content);if(ge)return ct;if(_e){if(be)for(yt=k.call(rt.ownerDocument);rt.firstChild;)yt.appendChild(rt.firstChild);else yt=rt;return(ne.shadowroot||ne.shadowrootmode)&&(yt=L.call(r,yt,!0)),yt}let Je=G?rt.outerHTML:rt.innerHTML;return G&&ce["!doctype"]&&rt.ownerDocument&&rt.ownerDocument.doctype&&rt.ownerDocument.doctype.name&&qo(FO,rt.ownerDocument.doctype.name)&&(Je="<!DOCTYPE "+rt.ownerDocument.doctype.name+`>
|
|
2381
|
-
`+Je),U&&m4([z,O,q],Nt=>{Je=F2(Je,Nt," ")}),C&&me?C.createHTML(Je):Je},e.setConfig=function(){let ct=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dt(ct),le=!0},e.clearConfig=function(){Wt=null,le=!1},e.isValidAttribute=function(ct,Be,rt){Wt||dt({});const It=_n(ct),zt=_n(Be);return At(It,zt,rt)},e.addHook=function(ct,Be){typeof Be=="function"&&O2(V[ct],Be)},e.removeHook=function(ct){return TO(V[ct])},e.removeHooks=function(ct){V[ct]=[]},e.removeAllHooks=function(){V=PO()},e}var y4=MO();const as=t=>{var E;const{field:e,fieldIndex:n,pageIndex:r,sectionIndex:i,rowIndex:s,columnIndex:a,path:l}=t,[c,u]=M.useState(e);M.useEffect(()=>{var x;return A((x=e==null?void 0:e.label)==null?void 0:x[d==null?void 0:d.type]),()=>{}},[e]);const{userSelectedLanguage:d,fieldSettingUpdate:f,fieldSettingUpdateInlineConditional:h,gridComponentFieldSettingUpdate:g}=an(),m=(x,C,S)=>{u(_=>({..._,[x]:{..._[x],[C==null?void 0:C.type]:S}}))},[v,A]=M.useState((E=e==null?void 0:e.label)==null?void 0:E[d==null?void 0:d.type]);M.useEffect(()=>(w(),()=>{}),[c]);const w=()=>{const x=l.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?h(x[ms],x[vs],x[xs],x[Cs],x[Ts],x[Ns],x[Zo],x[Fo],c):(x==null?void 0:x.length)>Ns&&(x==null?void 0:x.length)===tc+1&&(e!=null&&e.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?g(x[ms],x[vs],x[xs],x[Cs],x[Ts],x[5],x[6],x[7],c):f(r,i,s,a,n,{...e,label:c==null?void 0:c.label})};return o.jsx(o.Fragment,{children:o.jsx(g4,{style:{display:"inline-block"},className:"builder-input-label-edit",html:v,disabled:!1,onChange:x=>{var C;A(y4.sanitize((C=x==null?void 0:x.target)==null?void 0:C.value))},onBlur:x=>{var S;const C=y4.sanitize((S=x==null?void 0:x.target)==null?void 0:S.innerText);A(C),m("label",d,C)},tagName:"article"})})},v1=t=>{const{onLabel:e,offLabel:n,onIcon:r,offIcon:i,onHandleChangeSetttings:s,settingsKey:a,settingsKeyValue:l}=t;return o.jsx(o.Fragment,{children:o.jsx(b2,{checked:l,onLabel:e,onChange:c=>{s(a,c.value)},offLabel:n,onIcon:r,offIcon:i,className:"mr-1 px-1",style:{fontSize:"0.8rem"}})})},Xr=t=>{var pe,Z,Q,fe;const{field:e,fieldIndex:n,columnIndex:r,sectionIndex:i,rowIndex:s,pageIndex:a,type:l,path:c,handleFieldSettingsSidebar:u,showFieldIcons:d=!0,showSettingsIcon:f=!0}=t,{emitSocketData:h,renderType:g}=Jt(),m=(Y,ce)=>{V(te=>({...te,[Y]:ce}))},{fieldSettingUpdate:v,fieldSettingUpdateInlineConditional:A,cloneField:w,gridComponentFieldSettingUpdate:E,fieldSettingDeleteInlineConditional:x,gridComponentFieldDelete:C,removeField:S}=an(),{updateGlobalToast:_}=Jt(),I=Y=>{const ce=c.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?A(ce[ms],ce[vs],ce[xs],ce[Cs],ce[Ts],ce[Ns],ce[Zo],ce[Fo],Y):(ce==null?void 0:ce.length)>Ns&&(ce==null?void 0:ce.length)===tc+1&&(Y!=null&&Y.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?E(ce[ms],ce[vs],ce[xs],ce[Cs],ce[Ts],ce[5],ce[6],ce[7],Y):v(a,i,s,r,n,Y),_({showToast:!0,toastMessage:"Updated",toastDetail:"Field updated",toastType:"success"})},[k,P]=M.useState(!1),[L,V]=M.useState({custom_component_title:"",custom_component_description:""}),z=()=>{V(Y=>({...Y,custom_component_schema:e})),P(!0)},O=()=>{const Y=c.split("-").map(Number);l==="inline-conditional"?x(Y[ms],Y[vs],Y[xs],Y[Cs],Y[Ts],Y[Ns],Y[Zo],Y[Fo]):(Y==null?void 0:Y.length)>Ns&&(Y==null?void 0:Y.length)===tc+1&&(e!=null&&e.componentType)&&l==="grid"?C(Y[ms],Y[vs],Y[xs],Y[Cs],Y[Ts],Y[5],Y[6],Y[7]):S(a,i,s,r,n)},q=(Y,ce)=>{const te={...e,attributes:{...e.attributes,[Y]:ce}};I(te)},re=(Y,ce)=>{const te={...e,[Y]:ce};I(te)};return o.jsx(o.Fragment,{children:o.jsxs("div",{className:`${(e==null?void 0:e.componentType)!=="hidden-field"&&(e==null?void 0:e.componentType)!=="image"&&(e==null?void 0:e.componentType)!=="quiz"&&(e==null?void 0:e.componentType)!=="document"&&(e==null?void 0:e.componentType)!=="href"&&(e==null?void 0:e.componentType)!=="paragraph"&&(e==null?void 0:e.componentType)!=="heading"&&(e==null?void 0:e.componentType)!=="list"&&(e==null?void 0:e.componentType)!=="hr"&&(e==null?void 0:e.componentType)!=="image-gallery"&&(e==null?void 0:e.componentType)!=="video"&&(e==null?void 0:e.componentType)!=="question"?"builder-element-quick-options mb-2 w-9 justify-content-end":"builder-element-quick-options mb-2 w-4 justify-content-center"} flex quick-setting`,children:[o.jsx(o.Fragment,{children:(e==null?void 0:e.componentType)!=="hidden-field"&&(e==null?void 0:e.componentType)!=="document"&&(e==null?void 0:e.componentType)!=="quiz"&&(e==null?void 0:e.componentType)!=="image"&&(e==null?void 0:e.componentType)!=="href"&&(e==null?void 0:e.componentType)!=="paragraph"&&(e==null?void 0:e.componentType)!=="heading"&&(e==null?void 0:e.componentType)!=="list"&&(e==null?void 0:e.componentType)!=="hr"&&(e==null?void 0:e.componentType)!=="image-gallery"&&(e==null?void 0:e.componentType)!=="video"&&(e==null?void 0:e.componentType)!=="question"&&d===!1&&o.jsxs("div",{className:" ",children:[o.jsx(v1,{field:e,onHandleChangeSetttings:q,settingsKey:"required",settingsKeyValue:(pe=e==null?void 0:e.attributes)==null?void 0:pe.required,onLabel:"Required",offLabel:"Not Required",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:(Z=e==null?void 0:e.attributes)==null?void 0:Z.required}),o.jsx(v1,{field:e,onHandleChangeSetttings:re,settingsKey:"showToolTip",settingsKeyValue:e==null?void 0:e.showToolTip,onLabel:"Tooltip",offLabel:"Tooltip",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showToolTip}),o.jsx(v1,{field:e,onHandleChangeSetttings:re,settingsKey:"showHelperText",settingsKeyValue:e==null?void 0:e.showHelperText,onLabel:"Helper text",offLabel:"Helper text",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showHelperText}),o.jsx(v1,{field:e,onHandleChangeSetttings:re,settingsKey:"showHeaderText",settingsKeyValue:e==null?void 0:e.showHeaderText,onLabel:"Header text",offLabel:"Header text",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showHeaderText}),o.jsx(v1,{field:e,onHandleChangeSetttings:re,settingsKey:"isFluid",settingsKeyValue:e==null?void 0:e.isFluid,onLabel:"Fluid",offLabel:"Fluid",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.isFluid}),(e==null?void 0:e.componentType)=="radio"&&o.jsxs(o.Fragment,{children:[o.jsx(v1,{field:e,onHandleChangeSetttings:re,settingsKey:"showAlphabetList",settingsKeyValue:e==null?void 0:e.showAlphabetList,onLabel:"Alpha",offLabel:"Alpha",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showAlphabetList}),o.jsx(v1,{field:e,onHandleChangeSetttings:q,settingsKey:"style",settingsKeyValue:(Q=e==null?void 0:e.attributes)==null?void 0:Q.style,onLabel:"Style",offLabel:"Style",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:(fe=e==null?void 0:e.attributes)==null?void 0:fe.style})]})]})}),o.jsxs("div",{className:"quick-setting",children:[f===!0&&o.jsxs("span",{className:"p-buttonset",children:[(e==null?void 0:e.componentType)!=="hr"&&o.jsx($t,{text:!0,size:"small",tooltip:"Advanced settings",icon:"pi pi-cog",onClick:()=>{u(!0)},className:"mr-3"}),o.jsx($t,{size:"small",text:!0,icon:"pi pi-clone",outlined:!0,onClick:()=>{w(e,a,i,s,r,n),h()},tooltip:"Clone"}),o.jsx($t,{text:!0,className:"p-button-danger",size:"small",outlined:!0,icon:"pi pi-trash",onClick:()=>{O()},tooltip:"Delete"}),(g===$3||g===Q0)&&o.jsx($t,{text:!0,size:"small",outlined:!0,icon:"pi pi-file",tooltip:"Save as custom component",onClick:()=>{z()}})]}),o.jsxs(za,{header:"Custom component save",visible:k,style:{width:"20vw"},footer:()=>o.jsx(o.Fragment,{children:o.jsxs("div",{children:[o.jsx($t,{size:"small",text:!0,label:"Close",icon:"pi pi-times",onClick:()=>P(!1),className:"p-button-text"}),(e==null?void 0:e.componentType)!=="hidden-field"&&o.jsx($t,{text:!0,label:"Save",icon:"pi pi-check",onClick:()=>{P(!1)},autoFocus:!0})]})}),onHide:()=>P(!1),children:[o.jsxs("span",{className:"p-float-label",children:[o.jsx(Sn,{id:"custom_component_title",name:"custom_component_title",className:"w-full",value:(L==null?void 0:L.custom_component_title)||"",onChange:Y=>{var ce;return m("custom_component_title",(ce=Y==null?void 0:Y.target)==null?void 0:ce.value)}}),o.jsx("label",{htmlFor:"username",children:"Custom component title"})]}),o.jsxs("span",{className:"p-float-label mt-5",children:[o.jsx(fo,{id:"custom_component_description",name:"custom_component_description",className:"w-full",value:(L==null?void 0:L.custom_component_description)||"",onChange:Y=>{var ce;return m("custom_component_description",(ce=Y==null?void 0:Y.target)==null?void 0:ce.value)}}),o.jsx("label",{htmlFor:"username",children:"Custom component description"})]})]})]})]})})},kle=t=>{var ne,K,W,de,ve,Te,ye,Ae;const{pageIndex:e,sectionIndex:n,field:r,fieldIndex:i,row:s,rowIndex:a,columnIndex:l,isDisabled:c}=t,{isAdmin:u,isRenderView:d,isPreview:f}=Jt(),{userSelectedLanguage:h,fieldSettingUpdate:g}=an(),{taskRegisterData:m,updateTaskRegisterData:v,updateTaskProgressValue:A,updateUserFormDataSubmit:w,userTaskSubmitFormData:E}=vr(),[x,C]=M.useState(!1),[S,_]=M.useState(!1),[I,k]=M.useState(null),[P,L]=M.useState(0),[V,z]=M.useState(!1),O=()=>{z(!0)},q=()=>{z(!1)},re=J=>{C(J)},pe=()=>{C(!1)},Z=()=>{var J,U,ae;if(s!=null&&s.rowIsRepeatable){if(s!=null&&s.repeatableFields){const G=[...s.repeatableFields],le=_t.findIndex(G,function(De){return De.uuid===(r==null?void 0:r.uuid)});le>=0&&G[le].fieldData?k(G[le].fieldData):(r.isValid=0,k(null))}}else{const G=E,le=_t.cloneDeep(m);if(G!=null&&G.length){for(const De of G)if(De.fieldId===t.field.uuid&&((J=De==null?void 0:De.postData)!=null&&J.length)){k((U=De==null?void 0:De.postData[0])==null?void 0:U.postValue),le[r==null?void 0:r.uuid]=(ae=De==null?void 0:De.postData[0])==null?void 0:ae.postValue;const _e=Object.keys(le).length;A(_e);break}}}_(!0)},Q=J=>{var le;k(J.target.value);const U=E,ae=_t.cloneDeep(m);if((le=J==null?void 0:J.target)!=null&&le.value&&(U==null?void 0:U.length)>0)for(const De of U)De.fieldId===t.field.uuid&&(ae[r==null?void 0:r.uuid]=J==null?void 0:J.value,De.postData[0]={postValue:J.value});else delete ae[r==null?void 0:r.uuid];v(ae);const G=Object.keys(ae).length;A(G)};M.useEffect(()=>{S||Z();const J=Zt.addListener("clearRepeatableFields",G=>{G===(s==null?void 0:s.uuid)&&(k(null),L(0),r.isValid=0,g(e,n,a,l,i,r))}),U=Zt.addListener("onSubmitUserForm",()=>{var G;(G=r==null?void 0:r.attributes)!=null&&G.required?I!==null||I!==void 0?r.isValid=1:(console.log("Countr field in valid ",I),r.isValid=0):r.isValid=1}),ae=Zt.addListener("OnInvalidFieldCatch",G=>{console.log("OnInvalidFieldCatch listener"),console.log("field.uuid === value?.fieldId",r.uuid===(G==null?void 0:G.fieldId)),r.uuid===(G==null?void 0:G.fieldId)?L(1):L(0)});return()=>{U.remove(),ae.remove(),J.remove()}});const fe=(J,U)=>{var ae;if(E){const G=[...E],le=_t.findIndex(G,function(_e){return _e.rowId===(s==null?void 0:s.uuid)});let De=(ae=E[le])==null?void 0:ae.repeatableFields;De={...De,[J==null?void 0:J.uuid]:U},G[le]={...G[le],repeatableFields:De},w(G)}k(U),U!==null?J.isValid=1:J.isValid=0},Y=(J,U)=>J?o.jsxs("div",{className:"country-item flex",children:[o.jsx("img",{alt:J.name,src:J==null?void 0:J.image,onError:ae=>ae.target.src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png",style:{width:"20px",marginRight:10}}),o.jsx("div",{children:J.name})]}):o.jsx("span",{children:U.placeholder}),ce=J=>o.jsxs("div",{className:"country-item flex",children:[o.jsx("img",{alt:J.name,src:J==null?void 0:J.image,onError:U=>U.target.src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png",style:{width:"20px",marginRight:10}}),o.jsx("div",{children:J.name})]}),te=o.jsxs("div",{onMouseOver:O,onMouseOut:q,children:[!d&&!f&&V&&o.jsx(Xr,{handleFieldSettingsSidebar:re,...t}),o.jsxs("div",{className:`field ${f?" ":" builder-element-wrapper "}${(r==null?void 0:r.isFluid)===!0?" card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:f?"col-12 ":"field-form-builder col-12 ",children:[(r==null?void 0:r.showHeaderText)&&o.jsx("h6",{children:(ne=r==null?void 0:r.headerText)==null?void 0:ne[h==null?void 0:h.type]}),(r==null?void 0:r.showLabel)&&o.jsxs("label",{htmlFor:i,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(ds,{...t}),((K=r==null?void 0:r.attributes)==null?void 0:K.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",f?o.jsx(o.Fragment,{children:(W=r==null?void 0:r.label)==null?void 0:W[h==null?void 0:h.type]}):o.jsx(as,{...t}),o.jsx("span",{className:"ml-3",children:(r==null?void 0:r.showToolTip)&&o.jsx(Mi,{message:(de=r==null?void 0:r.toolTip)==null?void 0:de[h==null?void 0:h.type],position:"right"})})]}),o.jsx(Os,{className:"country-select-builder-component",onFocus:()=>L(1),onChange:J=>{s!=null&&s.rowIsRepeatable?fe(r,J.target.value):Q(J)},options:r==null?void 0:r.countries,optionLabel:"name",value:I,placeholder:(ve=r==null?void 0:r.placeholder)==null?void 0:ve[h==null?void 0:h.type],disabled:c,valueTemplate:Y,itemTemplate:ce,filter:!0,filterBy:"name",showClear:!0}),((Te=r==null?void 0:r.attributes)==null?void 0:Te.required)&&o.jsx("small",{className:"error",children:P===1&&I===null?((ye=r==null?void 0:r.validationMesssage)==null?void 0:ye[h==null?void 0:h.type])||"field is required":""}),o.jsx("div",{children:(r==null?void 0:r.showHelperText)&&o.jsx("small",{children:(Ae=r==null?void 0:r.helperText)==null?void 0:Ae[h==null?void 0:h.type]})})]})}),u&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[x===!0&&o.jsx(Wi,{visibilty:x,closeSettingFieldSidebar:pe,...t},r==null?void 0:r.uuid),o.jsx(Si,{...t,fieldWrap:te})]})},Ple=t=>{var W,de,ve,Te,ye,Ae,J,U,ae,G,le,De,_e,be,me;const{taskRegisterData:e,updateTaskRegisterData:n,updateTaskProgressValue:r,updateUserFormDataSubmit:i,userTaskSubmitFormData:s,task_status:a,TASK_PUBLISHED:l}=vr(),{userSelectedLanguage:c,fieldSettingUpdate:u}=an(),{field:d,fieldIndex:f,sectionIndex:h,pageIndex:g,row:m,rowIndex:v,columnIndex:A,isDisabled:w}=t,{isAdmin:E,isRenderView:x,isPreview:C}=Jt(),[S,_]=M.useState(!1),[I,k]=M.useState(""),[P,L]=M.useState(null),[V,z]=M.useState(0),[O,q]=M.useState(!1),[re,pe]=M.useState(!1),Z=()=>{pe(!0)},Q=()=>{pe(!1)},fe=()=>{var Se,Ie,$;if(m!=null&&m.rowIsRepeatable){if(m!=null&&m.repeatableFields){const se=[...m.repeatableFields],ge=_t.findIndex(se,function(oe){return oe.uuid===(d==null?void 0:d.uuid)});ge>=0&&se[ge].fieldData?k(se[ge].fieldData):k("")}}else{const se=s;if(se!=null&&se.length){for(const ge of se)if(ge.fieldId===t.field.uuid&&((Se=ge==null?void 0:ge.postData[0])==null?void 0:Se.postValue)!==""&&((Ie=ge==null?void 0:ge.postData[0])!=null&&Ie.postValue)){k(($=ge==null?void 0:ge.postData[0])==null?void 0:$.postValue);break}}}q(!0)};M.useEffect(()=>{O||fe();const Se=Zt.addListener("clearRepeatableFields",oe=>{oe===(m==null?void 0:m.uuid)&&(k(""),z(0),d.isValid=0,u(g,h,v,A,f,d))}),Ie=Zt.addListener("onSubmitUserForm",()=>{var oe,he;(oe=d==null?void 0:d.attributes)!=null&&oe.required?I&&I.length&&(I==null?void 0:I.length)<((he=d==null?void 0:d.attributes)==null?void 0:he.minLength)?d.isValid=1:d.isValid=0:d.isValid=1}),$=Zt.addListener("OnInvalidFieldCatch",oe=>{d.uuid===(oe==null?void 0:oe.fieldId)?z(1):z(0)}),se=Zt.addListener("OnGetFieldValue",oe=>{var ue;const he=(ue=oe==null?void 0:oe.repeatableColumn)==null?void 0:ue.filter(Ve=>(Ve==null?void 0:Ve.fieldUuid)===(d==null?void 0:d.uuid));he!=null&&he.length}),ge=Zt.addListener("formFieldAdded",oe=>{P===null&&L(oe==null?void 0:oe.uuid)});return()=>{Ie.remove(),$.remove(),se.remove(),Se.remove(),ge.remove()}}),M.useEffect(()=>(P!==null&&setTimeout(()=>{L(null)},1e3),()=>{}),[P]);const Y=Se=>{_(Se)},ce=()=>{_(!1)},te=Se=>{var se,ge;k(Se.target.value);const Ie=s,$=_t.cloneDeep(e);if(Ie!==null){if((se=Se==null?void 0:Se.target)!=null&&se.value){if($[d==null?void 0:d.uuid]=(ge=Se==null?void 0:Se.target)==null?void 0:ge.value,(Ie==null?void 0:Ie.length)>0)for(const oe of Ie)oe.fieldId===t.field.uuid&&(oe.postData[0]={postValue:Se.target.value})}else if(delete $[d==null?void 0:d.uuid],(Ie==null?void 0:Ie.length)>0)for(const oe of Ie)oe.fieldId===t.field.uuid&&(oe.postData[0]={postValue:""})}if(console.log("row?.rowIsRepeatable",m==null?void 0:m.rowIsRepeatable),!(m!=null&&m.rowIsRepeatable)){n($);const oe=Object.keys($).length;r(oe)}},ne=(Se,Ie)=>{var $;if(s){const se=[...s],ge=_t.findIndex(se,function(he){return he.rowId===(m==null?void 0:m.uuid)});let oe=($=s[ge])==null?void 0:$.repeatableFields;oe={...oe,[Se==null?void 0:Se.uuid]:Ie},se[ge]={...se[ge],repeatableFields:oe},i(se)}k(Ie),Ie!==""?Se.isValid=1:Se.isValid=0},K=o.jsxs("div",{onMouseOver:Z,onMouseOut:Q,children:[!x&&!C&&re&&o.jsx(Xr,{handleFieldSettingsSidebar:Y,...t}),o.jsxs("div",{className:`field ${C?" ":" builder-element-wrapper "} ${(d==null?void 0:d.isFluid)===!0?" p-fluid ":""} ${x?" ":" py-6 px-4 "} ${P===(d==null?void 0:d.uuid)?" new-field ":" card "} `,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:E?"col-6 ":"col-12 p-fluid",children:[(d==null?void 0:d.showHeaderText)&&o.jsx("h6",{children:(W=d==null?void 0:d.headerText)==null?void 0:W[c==null?void 0:c.type]}),(d==null?void 0:d.showLabel)&&o.jsxs("label",{htmlFor:d==null?void 0:d.uuid,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(ds,{...t}),((de=d==null?void 0:d.attributes)==null?void 0:de.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",C?o.jsx(o.Fragment,{children:(ve=d==null?void 0:d.label)==null?void 0:ve[c==null?void 0:c.type]}):o.jsx(as,{...t}),(d==null?void 0:d.showToolTip)&&o.jsx("span",{className:"ml-3",children:o.jsx(Mi,{message:(Te=d==null?void 0:d.toolTip)==null?void 0:Te[c==null?void 0:c.type],position:"right"})})]}),o.jsxs("div",{className:"mt-3",children:[o.jsxs("span",{className:"p-input-icon-"+(d==null?void 0:d.iconAlignment),children:[(d==null?void 0:d.showIcon)&&o.jsx("i",{className:"pi pi-"+((Ae=(ye=d==null?void 0:d.icon)==null?void 0:ye.properties)==null?void 0:Ae.name)}),o.jsx(Sn,{id:d==null?void 0:d.uuid,placeholder:(J=d==null?void 0:d.placeholder)==null?void 0:J[c==null?void 0:c.type],minLength:(U=d==null?void 0:d.attributes)==null?void 0:U.minLength,maxLength:(ae=d==null?void 0:d.attributes)==null?void 0:ae.maxLength,value:I,onFocus:()=>z(1),onChange:Se=>{m!=null&&m.rowIsRepeatable?ne(d,Se.target.value):te(Se)},className:V===1&&((G=d==null?void 0:d.attributes)!=null&&G.required)?I?"valid":"invalid":"valid'",readOnly:w})]}),o.jsx("div",{children:((le=d==null?void 0:d.attributes)==null?void 0:le.required)&&o.jsxs(o.Fragment,{children:[o.jsx("small",{className:"error",children:V===1&&!I?(De=d==null?void 0:d.validationMesssage)==null?void 0:De.english:""}),o.jsx("small",{className:"error",children:V===1&&I.length&&(I==null?void 0:I.length)<((_e=d==null?void 0:d.attributes)==null?void 0:_e.minLength)?`Mini length ${(be=d==null?void 0:d.attributes)==null?void 0:be.minLength}`:""})]})}),o.jsx("div",{children:(d==null?void 0:d.showHelperText)&&o.jsx("small",{children:(me=d==null?void 0:d.helperText)==null?void 0:me[c==null?void 0:c.type]})})]})]})}),E&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[S===!0&&o.jsx(Wi,{visibilty:S,closeSettingFieldSidebar:ce,...t}),o.jsx(Si,{...t,fieldWrap:K})]})},Mle=t=>{var i,s;const{language:e,onHandleChange:n,fieldState:r}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Hyperlink text"}),o.jsx(Sn,{value:(i=r==null?void 0:r.text)==null?void 0:i[e==null?void 0:e.type],onChange:a=>n("text",e,a.target.value)})]}),o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Hyperlink"}),o.jsx(Sn,{value:(s=r==null?void 0:r.hrefLink)==null?void 0:s[e==null?void 0:e.type],onChange:a=>n("hrefLink",e,a.target.value)})]})]})},Lle=t=>{var r;const{onHandleChangeStyling:e,fieldState:n}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field",children:[o.jsx("label",{className:"mr-2",children:"Hyperlink color"}),o.jsx(n4,{value:n==null?void 0:n.color,onChange:i=>{e("color",i.value)}})]}),o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Font Size"}),o.jsx(Sn,{type:"number",maxLength:2,placeholder:"eg 20px",value:(r=Number(n==null?void 0:n.fontSize))==null?void 0:r.toFixed(0),onChange:i=>{e("fontSize",i.target.value)}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(zr,{checked:n==null?void 0:n.underLined,onChange:i=>{e("underLined",i.checked)}}),o.jsx("label",{children:"Underline link"})]})]})},Ble=t=>{const{visibilty:e,field:n,closeSettingFieldSidebar:r,pageIndex:i,sectionIndex:s,rowIndex:a,columnIndex:l,fieldIndex:c}=t,[u,d]=M.useState(n),{fieldSettingUpdate:f,formBuilderSchemaLanguages:h,formBuilderPublishedStatus:g}=an(),{updateGlobalToast:m}=Jt(),v=(E,x,C)=>{d(S=>({...S,[E]:{...S[E],[x==null?void 0:x.type]:C}}))},A=(E,x)=>{d(C=>({...C,[E]:x}))},w=()=>{f(i,s,a,l,c,u),m({showToast:!0,toastMessage:"Updated",toastDetail:"Html updated",toastType:"success"})};return o.jsx(o.Fragment,{children:o.jsxs(Vo,{visible:e,position:"left",className:"p-sidebar-lg",onHide:()=>r(),children:[o.jsxs("div",{className:"flex justify-content-between flex-wrap card-container ",children:[o.jsxs("div",{className:"flex align-items-center justify-content-center ",children:[" ",o.jsxs("h5",{className:"mb-0",children:[t==null?void 0:t.typeName," settings "]})]}),!g&&o.jsx("div",{className:"flex align-items-center justify-content-center",children:o.jsx($t,{className:"mt-3",label:"Update",type:"button",onClick:()=>w(),"aria-label":"Update"})})]}),o.jsxs(Js,{children:[o.jsx(br,{header:"Text",children:o.jsx(uo,{activeIndex:0,children:h!=null&&h.length?h.map((E,x)=>o.jsx(co,{tabIndex:x,header:E==null?void 0:E.language,children:o.jsx(Mle,{language:E,fieldState:u,onHandleChange:v,...t})},x)):""})}),o.jsx(br,{header:"Styling",children:o.jsx(Lle,{fieldState:u,onHandleChangeStyling:A,...t})})]})]})})},Vle=t=>{var g,m,v,A,w,E,x,C,S;const{field:e}=t,{userSelectedLanguage:n}=an(),{isPreview:r}=Jt(),[i,s]=M.useState(!1),[a,l]=M.useState(!1),c=()=>{l(!0)},u=()=>{l(!1)},d=_=>{s(_)},f=()=>{s(!1)};M.useEffect(()=>{},[e]);const h=o.jsxs("div",{className:r?"":"builder-element-wrapper",onMouseOver:c,onMouseOut:u,children:[!r&&a&&o.jsx(Xr,{handleFieldSettingsSidebar:d,...t}),o.jsxs("div",{className:r?" px-4":"field-form-builder px-4",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(g=e==null?void 0:e.headerText)==null?void 0:g[n==null?void 0:n.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:e.uuid,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[((m=e==null?void 0:e.attributes)==null?void 0:m.required)&&o.jsx("span",{className:"must-required",children:"*"})," ",r?o.jsx(o.Fragment,{children:(v=e==null?void 0:e.label)==null?void 0:v[n==null?void 0:n.type]}):o.jsx(as,{...t}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(Mi,{message:(A=e==null?void 0:e.toolTip)==null?void 0:A[n==null?void 0:n.type],position:"right"})})]}),o.jsx("a",{style:{fontSize:parseInt(e==null?void 0:e.fontSize),color:`#${e==null?void 0:e.color}`,textDecoration:e!=null&&e.underLined?"underline":"none"},className:"atag-style",href:(w=e==null?void 0:e.hrefLink)==null?void 0:w[n==null?void 0:n.type],children:(E=e==null?void 0:e.text)==null?void 0:E[n==null?void 0:n.type]}),((x=e==null?void 0:e.attributes)==null?void 0:x.required)&&o.jsx("small",{className:"error",children:(C=e==null?void 0:e.validationMesssage)==null?void 0:C[n==null?void 0:n.type]}),(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(S=e==null?void 0:e.helperText)==null?void 0:S[n==null?void 0:n.type]})]})]});return o.jsxs(o.Fragment,{children:[o.jsx(Ble,{visibilty:i,closeSettingFieldSidebar:f,...t}),o.jsx(Si,{...t,fieldWrap:h})]})},Ule=t=>{var W,de,ve,Te,ye,Ae,J,U,ae,G,le,De,_e,be,me,Se,Ie,$,se,ge,oe;const{field:e,fieldIndex:n,sectionIndex:r,pageIndex:i,row:s,rowIndex:a,columnIndex:l,isDisabled:c}=t,{isPreview:u,isRenderView:d,isAdmin:f}=Jt(),{taskRegisterData:h,updateTaskRegisterData:g,updateTaskProgressValue:m,updateUserFormDataSubmit:v,userTaskSubmitFormData:A,TASK_PUBLISHED:w,task_status:E}=vr(),{userSelectedLanguage:x,fieldSettingUpdate:C}=an(),[S,_]=M.useState(null),[I,k]=M.useState(!1),[P,L]=M.useState(null),[V,z]=M.useState(0),[O,q]=M.useState(!1),[re,pe]=M.useState(!1),Z=()=>{pe(!0)},Q=()=>{pe(!1)},fe=()=>{var he,ue;if(s!=null&&s.rowIsRepeatable){if(s!=null&&s.repeatableFields){const Ve=[...s.repeatableFields],Ne=_t.findIndex(Ve,function(Ye){return Ye.uuid===(e==null?void 0:e.uuid)});Ne>=0&&Ve[Ne].fieldData?L(Number(Ve[Ne].fieldData)||null):L(null)}}else{const Ve=A;if(Ve!=null&&Ve.length){for(const Ne of Ve)if(Ne.fieldId===t.field.uuid&&((he=Ne==null?void 0:Ne.postData)!=null&&he.length)){L(Number((ue=Ne==null?void 0:Ne.postData[0])==null?void 0:ue.postValue)||null);break}}}q(!0)};M.useEffect(()=>{O||fe();const he=Zt.addListener("clearRepeatableFields",st=>{st===(s==null?void 0:s.uuid)&&(L(null),z(0),e.isValid=0,C(i,r,a,l,n,e))}),ue=Zt.addListener("onSubmitUserForm",()=>{var st;(st=e==null?void 0:e.attributes)!=null&&st.required?P?e.isValid=1:e.isValid=0:e.isValid=1}),Ve=Zt.addListener("OnInvalidFieldCatch",st=>{e.uuid===(st==null?void 0:st.fieldId)?z(1):z(0)}),Ne=Zt.addListener("OnGetFieldValue",st=>{var ht;const ot=(ht=st==null?void 0:st.repeatableColumn)==null?void 0:ht.filter(Pt=>(Pt==null?void 0:Pt.fieldUuid)===(e==null?void 0:e.uuid));ot!=null&&ot.length}),Ye=Zt.addListener("formFieldAdded",st=>{S===null&&_(st.uuid)});return()=>{ue.remove(),Ve.remove(),Ne.remove(),he.remove(),Ye.remove()}}),M.useEffect(()=>(S!==null&&setTimeout(()=>{_(null)},1e3),()=>{}),[S]);const Y=he=>{k(he)},ce=()=>{k(!1)},te=he=>{const ue=A,Ve=_t.cloneDeep(h);if(ue!==null){if(he){if(Ve[e==null?void 0:e.uuid]=he,(ue==null?void 0:ue.length)>0)for(const Ne of ue)Ne.fieldId===t.field.uuid&&(Ne.postData[0]={postValue:he})}else if(delete Ve[e==null?void 0:e.uuid],(ue==null?void 0:ue.length)>0)for(const Ne of ue)Ne.fieldId===t.field.uuid&&(Ne.postData[0]={postValue:""})}if(!(s!=null&&s.rowIsRepeatable)){g(Ve);const Ne=Object.keys(Ve).length;m(Ne)}},ne=(he,ue)=>{var Ve;if(A!=null&&A.length){const Ne=[...A],Ye=_t.findIndex(Ne,function(ot){return ot.rowId===(s==null?void 0:s.uuid)});let st=(Ve=A[Ye])==null?void 0:Ve.repeatableFields;st={...st,[he==null?void 0:he.uuid]:ue},Ne[Ye]={...Ne[Ye],repeatableFields:st},v(Ne)}L(ue),ue!==""?he.isValid=1:he.isValid=0},K=o.jsxs("div",{onMouseOver:Z,onMouseOut:Q,children:[!d&&!u&&re&&o.jsx(Xr,{handleFieldSettingsSidebar:Y,...t}),o.jsxs("div",{className:`field ${u?" ":" builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0?" p-fluid py-6 px-4":" py-6 px-4"} ${S===(e==null?void 0:e.uuid)?" new-field ":" card "}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:f?"col-6 ":"col-12 p-fluid",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(W=e==null?void 0:e.headerText)==null?void 0:W[x==null?void 0:x.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:e.uuid,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(ds,{...t}),((de=e==null?void 0:e.attributes)==null?void 0:de.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",u?o.jsx(o.Fragment,{children:(ve=e==null?void 0:e.label)==null?void 0:ve[x==null?void 0:x.type]}):o.jsx(as,{...t}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(Mi,{message:(Te=e==null?void 0:e.toolTip)==null?void 0:Te[x==null?void 0:x.type],position:"right"})})]}),o.jsxs("div",{className:"mt-3",children:[o.jsxs("span",{className:"p-input-icon-"+(e==null?void 0:e.iconAlignment),children:[(e==null?void 0:e.showIcon)&&o.jsx("i",{className:"pi pi-"+((Ae=(ye=e==null?void 0:e.icon)==null?void 0:ye.properties)==null?void 0:Ae.name)}),o.jsx(ro,{readOnly:c,id:e==null?void 0:e.uuid,placeholder:(J=e==null?void 0:e.placeholder)==null?void 0:J[x==null?void 0:x.type],value:P,min:(U=e==null?void 0:e.attributes)==null?void 0:U.min,max:e==null?void 0:e.attributes.max,suffix:e==null?void 0:e.attributes.suffix,prefix:(ae=e==null?void 0:e.attributes)==null?void 0:ae.prefix,showButtons:(G=e==null?void 0:e.attributes)==null?void 0:G.showButtons,pt:{incrementButton:{className:"bg-teal-500 border-teal-500"},decrementButton:{className:"bg-orange-500 border-orange-500"}},minFractionDigits:(le=e==null?void 0:e.attributes)==null?void 0:le.minFractionDigits,maxFractionDigits:(De=e==null?void 0:e.attributes)==null?void 0:De.maxFractionDigits,locale:(_e=e==null?void 0:e.attributes)==null?void 0:_e.locale,mode:(be=e==null?void 0:e.attributes)==null?void 0:be.mode,currency:(me=e==null?void 0:e.attributes)==null?void 0:me.currency,currencyDisplay:(Se=e==null?void 0:e.attributes)==null?void 0:Se.currencyDisplay,useGrouping:(Ie=e==null?void 0:e.attributes)==null?void 0:Ie.useGrouping,onFocus:()=>z(1),onChange:he=>{s!=null&&s.rowIsRepeatable?ne(e,he.value):te(he.value)},className:V===1&&(($=e==null?void 0:e.attributes)!=null&&$.required)?P?"valid":"invalid":"valid'"})]}),o.jsx("div",{children:((se=e==null?void 0:e.attributes)==null?void 0:se.required)&&o.jsx("small",{className:"error",children:V===1&&!P?(ge=e==null?void 0:e.validationMesssage)==null?void 0:ge.english:""})}),o.jsx("div",{children:(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(oe=e==null?void 0:e.helperText)==null?void 0:oe[x==null?void 0:x.type]})})]})]})}),f&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[I===!0&&o.jsx(Wi,{visibilty:I,closeSettingFieldSidebar:ce,...t}),o.jsx(Si,{...t,fieldWrap:K})]})},Eb=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],A4=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/,xu=/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+\$,\\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=+\$,\\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%\/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)/;function LO(t){try{JSON.parse(t)}catch{return!1}return!0}function BO(t){if(t<26)return Eb[t];{const e=Math.floor(t/26)-1,n=t%26;return Eb[e]+Eb[n]}}const qle=t=>{var te,ne,K,W,de,ve,Te,ye,Ae,J,U;const{field:e,fieldIndex:n,pageIndex:r,sectionIndex:i,row:s,update:a,value:l,isDisabled:c}=t,{isPreview:u,isAdmin:d,isRenderView:f}=Jt(),{task_status:h,taskRegisterData:g,updateTaskRegisterData:m,updateTaskProgressValue:v,updateUserFormDataSubmit:A,userTaskSubmitFormData:w,TASK_PUBLISHED:E}=vr(),{userSelectedLanguage:x}=an(),[C,S]=M.useState(!1),[_,I]=M.useState(""),[k,P]=M.useState(0),[L,V]=M.useState(!1),z=()=>{V(!0)},O=()=>{V(!1)};M.useEffect(()=>{C||Q();const ae=Zt.addListener("clearRepeatableFields",le=>{le===(s==null?void 0:s.uuid)&&(I(""),P(0),e.isValid=0)}),G=Zt.addListener("onSubmitUserForm",()=>{var le;(le=e==null?void 0:e.attributes)!=null&&le.required?_!==""&&A4.test(_)===!0?e.isValid=1:e.isValid=0:e.isValid=1});return()=>{G.remove(),ae.remove()}});const[q,re]=M.useState(!1),pe=ae=>{re(ae)},Z=()=>{re(!1)},Q=()=>{var ae,G,le;if(s!=null&&s.rowIsRepeatable){if(s!=null&&s.repeatableFields){const De=[...s.repeatableFields],_e=_t.findIndex(De,function(be){return be.uuid===(e==null?void 0:e.uuid)});_e>=0&&De[_e].fieldData?I(De[_e].fieldData):I("")}}else{const De=w;if(De!=null&&De.length){for(const _e of De)if(_e.fieldId===t.field.uuid&&((ae=_e==null?void 0:_e.postData[0])==null?void 0:ae.postValue)!==""&&((G=_e==null?void 0:_e.postData[0])!=null&&G.postValue)){I((le=_e==null?void 0:_e.postData[0])==null?void 0:le.postValue),S(!0);break}}}S(!0)},fe=ae=>{I(ae);const G=w,le=_t.cloneDeep(g);if(G!==null){if(ae!==""&&A4.test(ae)===!0){if(le[e==null?void 0:e.uuid]=ae,(G==null?void 0:G.length)>0)for(const De of G)De.fieldId===t.field.uuid&&(De.postData[0]={postValue:ae})}else if(delete le[e==null?void 0:e.uuid],(G==null?void 0:G.length)>0)for(const De of G)De.fieldId===t.field.uuid&&(De.postData[0]={postValue:""})}if(!(s!=null&&s.rowIsRepeatable)){m(le);const De=Object.keys(le).length;v(De)}},Y=(ae,G,le,De)=>{var _e;if(I(De),w!==null){const be=[...w],me=_t.findIndex(be,function(Ie){return Ie.rowId===(s==null?void 0:s.uuid)});let Se=(_e=w[me])==null?void 0:_e.repeatableFields;Se={...Se,[le==null?void 0:le.uuid]:De},be[me]={...be[me],repeatableFields:Se},A(be),De!==""&&A4.test(De)===!0?e.isValid=1:e.isValid=0}},ce=o.jsxs("div",{onMouseOver:z,onMouseOut:O,children:[!f&&!u&&L&&o.jsx(Xr,{handleFieldSettingsSidebar:pe,...t}),o.jsxs("div",{className:`field ${u?" ":" builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0?" card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(te=e==null?void 0:e.headerText)==null?void 0:te[x==null?void 0:x.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:n,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(ds,{...t,update:a,value:l}),((ne=e==null?void 0:e.attributes)==null?void 0:ne.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",u?o.jsx(o.Fragment,{children:(K=e==null?void 0:e.label)==null?void 0:K[x==null?void 0:x.type]}):o.jsx(as,{...t}),o.jsx("span",{className:"ml-2",children:(e==null?void 0:e.showToolTip)&&o.jsx(o.Fragment,{children:o.jsx(Mi,{message:(W=e==null?void 0:e.toolTip)==null?void 0:W[x==null?void 0:x.type],position:"right"})})})]}),o.jsxs("span",{className:"p-input-icon-"+(e==null?void 0:e.iconAlignment),children:[(e==null?void 0:e.showIcon)&&o.jsx("i",{className:"pi pi-"+((ve=(de=e==null?void 0:e.icon)==null?void 0:de.properties)==null?void 0:ve.name)}),o.jsx(Sn,{id:e==null?void 0:e.uuid,placeholder:(Te=e==null?void 0:e.placeholder)==null?void 0:Te[x==null?void 0:x.type],value:_,onFocus:()=>P(1),onChange:ae=>{s!=null&&s.rowIsRepeatable?Y(r,i,{uuid:e.uuid},ae.target.value):fe(ae.target.value)},className:k===1&&((ye=e==null?void 0:e.attributes)!=null&&ye.required)?_?"valid":"invalid":"valid'",readOnly:c})]}),((Ae=e==null?void 0:e.attributes)==null?void 0:Ae.required)&&o.jsx("div",{children:o.jsx("small",{className:"error",children:k===1&&(_===null||_==="")?(J=e==null?void 0:e.validationMesssage)==null?void 0:J[x==null?void 0:x.language]:""})}),_!==""&&k===1&&A4.test(_)===!1&&o.jsx("small",{className:"error",children:"Please enter correct email"}),(e==null?void 0:e.showHelperText)&&o.jsx("div",{children:o.jsx("small",{children:(U=e==null?void 0:e.helperText)==null?void 0:U[x==null?void 0:x.type]})})]}),d&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]});return o.jsxs(o.Fragment,{children:[q===!0&&o.jsx(Wi,{visibilty:q,closeSettingFieldSidebar:Z,...t},e==null?void 0:e.uuid),o.jsx(Si,{...t,fieldWrap:ce})]})},$le=t=>{var W,de,ve,Te,ye,Ae,J,U,ae;const{field:e,fieldIndex:n,pageIndex:r,sectionIndex:i,rowIndex:s,columnIndex:a,row:l,isDisabled:c}=t,{isRenderView:u,isAdmin:d,isPreview:f}=Jt(),{userSelectedLanguage:h,fieldSettingUpdate:g}=an(),{task_status:m,taskRegisterData:v,updateTaskRegisterData:A,updateTaskProgressValue:w,updateUserFormDataSubmit:E,userTaskSubmitFormData:x,TASK_PUBLISHED:C}=vr(),[S,_]=M.useState(!1),[I,k]=M.useState(""),[P,L]=M.useState(0),[V,z]=M.useState(!1),[O,q]=M.useState(!1),[re,pe]=M.useState(!1),Z=()=>{q(!0)},Q=()=>{q(!1)},fe=G=>{_(G)},Y=()=>{_(!1)},ce=()=>{var le,De,_e;const G=x;if(l!=null&&l.rowIsRepeatable){if(l!=null&&l.repeatableFields){const be=[...l.repeatableFields],me=_t.findIndex(be,function(Se){return Se.uuid===(e==null?void 0:e.uuid)});me>=0&&be[me].fieldData?k(be[me].fieldData):(e.isValid=0,k(""))}}else if(G!=null&&G.length){for(const be of G)if(be.fieldId===t.field.uuid&&((le=be==null?void 0:be.postData[0])!=null&&le.postValue)&&((De=be==null?void 0:be.postData[0])==null?void 0:De.postValue)!==""){k((_e=be==null?void 0:be.postData[0])==null?void 0:_e.postValue),z(!0);break}}z(!0)},te=(G,le,De,_e)=>{var be;if(x!=null&&x.length){const me=[...x],Se=_t.findIndex(me,function($){return $.rowId===(l==null?void 0:l.uuid)});let Ie=(be=x[Se])==null?void 0:be.repeatableFields;Ie={...Ie,[De==null?void 0:De.uuid]:_e},me[Se]={...me[Se],repeatableFields:Ie},E(me)}k(_e),_e!==""?e.isValid=1:e.isValid=0,g(G,le,s,a,n,e)};M.useEffect(()=>{V||ce();const G=Zt.addListener("clearRepeatableFields",me=>{me===(l==null?void 0:l.uuid)&&(k(""),L(0),e.isValid=0)}),le=Zt.addListener("onSubmitUserForm",()=>{var me;(me=e==null?void 0:e.attributes)!=null&&me.required?I?e.isValid=1:e.isValid=0:e.isValid=1}),De=Zt.addListener("OnInvalidFieldCatch",me=>{e.uuid===(me==null?void 0:me.fieldId)?L(1):L(0)}),_e=Zt.addListener("OnGetFieldValue",me=>{var Ie;const Se=(Ie=me==null?void 0:me.repeatableColumn)==null?void 0:Ie.filter($=>($==null?void 0:$.fieldUuid)===(e==null?void 0:e.uuid));Se!=null&&Se.length}),be=Zt.addListener("onUpdateField",()=>{pe(!re)});return()=>{be.remove(),le.remove(),De.remove(),_e.remove(),G.remove()}});const ne=G=>{var _e,be;k(G.target.value);const le=x,De=_t.cloneDeep(v);if(le!==null){if((_e=G==null?void 0:G.target)!=null&&_e.value){if(De[e==null?void 0:e.uuid]=(be=G==null?void 0:G.target)==null?void 0:be.value,(le==null?void 0:le.length)>0)for(const me of le)me.fieldId===t.field.uuid&&(me.postData[0]={postValue:G.target.value})}else if(delete De[e==null?void 0:e.uuid],(le==null?void 0:le.length)>0)for(const me of le)me.fieldId===t.field.uuid&&(me.postData[0]={postValue:""})}if(!(l!=null&&l.rowIsRepeatable)){A(De);const me=Object.keys(De).length;w(me)}},K=o.jsxs("div",{onMouseOver:Z,onMouseOut:Q,children:[!u&&!f&&O&&o.jsx(Xr,{handleFieldSettingsSidebar:fe,...t}),o.jsxs("div",{className:`field ${f?" ":" builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0?"card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:f?"col-12 ":"col-12 field-form-builder ",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(W=e==null?void 0:e.headerText)==null?void 0:W[h==null?void 0:h.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:n,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(ds,{...t}),((de=e==null?void 0:e.attributes)==null?void 0:de.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",f?o.jsx(o.Fragment,{children:(ve=e==null?void 0:e.label)==null?void 0:ve[h==null?void 0:h.type]}):o.jsx(as,{...t}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(Mi,{message:(Te=e==null?void 0:e.toolTip)==null?void 0:Te[h==null?void 0:h.type],position:"right"})})]}),o.jsx(fo,{rows:e==null?void 0:e.textareaRows,cols:e==null?void 0:e.textareaCols,autoResize:e==null?void 0:e.resizable,id:e==null?void 0:e.uuid,placeholder:(ye=e==null?void 0:e.placeholder)==null?void 0:ye[h==null?void 0:h.type],value:I,onFocus:()=>L(1),onChange:G=>{l!=null&&l.rowIsRepeatable?te(r,i,e,G.target.value):ne(G)},className:P===1&&((Ae=e==null?void 0:e.attributes)!=null&&Ae.required)?I?"valid":"invalid":"valid",readOnly:c}),o.jsx("div",{children:((J=e==null?void 0:e.attributes)==null?void 0:J.required)&&o.jsx("small",{className:"error",children:P===1&&!I?(U=e==null?void 0:e.validationMesssage)==null?void 0:U[h==null?void 0:h.type]:""})}),o.jsx("div",{children:(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(ae=e==null?void 0:e.helperText)==null?void 0:ae[h==null?void 0:h.type]})})]})}),d&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[S===!0&&o.jsx(Wi,{visibilty:S,closeSettingFieldSidebar:Y,...t},e==null?void 0:e.uuid),o.jsx(Si,{...t,fieldWrap:K})]})},jle={},Ib=t=>{var I,k,P,L;const{isAdmin:e,isAdvanceView:n,isPreview:r}=Jt(),{handleDrop:i}=an(),{data:s,path:a,pageIndex:l,sectionIndex:c,rowIndex:u,columnIndex:d,conditionIndex:f,ruleIndex:h,condition:g,page:m,section:v,row:A,column:w}=t,E=M.useRef(null),[{isDragging:x},C]=is({type:fT,item:{type:fT,uuid:s.uuid,children:s.children,path:a},collect:V=>({isDragging:V.isDragging()})}),S=x?0:1;C(E);const _=(V,z,O,q,re,pe,Z)=>{const Q=t!=null&&t.fieldContainer?t==null?void 0:t.fieldContainer:"inline-condition-container";return o.jsx(eu,{type:"inline-conditional",field:V,data:V,path:z,page:m,section:v,row:A,column:w,pageIndex:O,sectionIndex:q,rowIndex:re,columnIndex:pe,fieldIndex:Z,isAdmin:e,fieldContainer:Q},V.uuid)};return o.jsxs("div",{ref:r===!1?E:null,style:{...jle,opacity:S},className:"draggable column",children:[g&&((I=g.children)==null?void 0:I.length)===0&&o.jsx("p",{className:"text-primary text-center",children:"Drag item here"}),g&&g.children&&((k=g.children)==null?void 0:k.length)>0&&g.children.map((V,z)=>{var O;return o.jsxs(M.Fragment,{children:[r===!1&&o.jsx(Fr,{isAdvanceView:n,data:{path:`${a}-${h}-${f}-${z}`,childrenCount:(O=g==null?void 0:g.children)==null?void 0:O.length,droppedField:g},onDrop:i}),_(V,`${a}-${h}-${f}-${z}`,l,c,u,d,z)]},V.uuid)}),r===!1&&o.jsx(Fr,{isAdvanceView:n,fieldDropArea:!0,data:{path:`${a}-${h}-${f}-${(P=g==null?void 0:g.children)==null?void 0:P.length}`,childrenCount:(L=g==null?void 0:g.children)==null?void 0:L.length,droppedField:g},onDrop:i,isLast:!0})]})},u0=t=>{const{inputValue:e,condition:n,ruleIndex:r,conditionIndex:i,field:s,section:a,page:l,row:c,pageIndex:u,sectionIndex:d,rowIndex:f,columnIndex:h,isConditionTrue:g}=t,{taskRegisterData:m,updateUserFormDataSubmit:v,userTaskSubmitFormData:A,updateProgressDataValuesHook:w}=vr(),E=M.useCallback((x,C,S)=>{var I,k,P;const _=A;if(_!=null&&_.length){const L=m,V=(I=s==null?void 0:s.inlineConditionalRules)==null?void 0:I.rules[C].conditions[S].children;for(const[O,q]of V.entries()){(k=q==null?void 0:q.attributes)!=null&&k.required;const re=_t.findIndex(_,function(pe){return pe.fieldId===q.uuid});x?re===-1&&(_.push({postData:[],tabId:l.uuid,tabIndex:u,...s.inlineConditionalRules?{inlineConditionalRules:s.inlineConditionalRules}:{},...s.conditionalTabRules?{conditionalTabRules:s.conditionalTabRules}:{},...s.conditionalSectionRules?{conditionalSectionRules:s.conditionalSectionRules}:{},sectionId:a.uuid,sectionIndex:d,sectionHeading:a.heading,subHeadingText:a.subHeadingText,reviewerChecklist:s==null?void 0:s.reviewerChecklist,rowId:c.uuid,rowIndex:f,columnId:a.uuid,columnIndex:h,inlineConditionalField:!0,fieldIndex:O,fieldId:q.uuid,fieldInputType:s.componentType,fieldTitle:(P=s.label)==null?void 0:P.english,fieldDescription:s.description||null,fieldHelperText:s.helperText||null,fieldHeaderText:s.headerText||null,fieldFooterText:s.footerText||null,fieldTitleAbb:s.abbreviationLabel||s.label,question_abb_table:s.textForTable||null,language:"english",isHiddenfield:s.isHidden&&s.isHidden===1?1:0,isHiddenSection:a.isHidden&&a.isHidden===1?1:0}),L[q==null?void 0:q.uuid]&&delete L[q==null?void 0:q.uuid]):(L[q==null?void 0:q.uuid]&&delete L[q==null?void 0:q.uuid],re>=0&&_.splice(re,1))}const z=Object.keys(L).length;w({progressMaxValue:_==null?void 0:_.length,progressValue:z}),v(_)}},[h,s.abbreviationLabel,s.componentType,s.conditionalSectionRules,s.conditionalTabRules,s.description,s.footerText,s.headerText,s.helperText,s.inlineConditionalRules,s.isHidden,s.label,s==null?void 0:s.reviewerChecklist,s.textForTable,l.uuid,u,c.uuid,f,a.heading,a.isHidden,a.subHeadingText,a.uuid,d,m,w,v,A]);return M.useEffect(()=>(E(g,r,i),()=>{}),[i,e,g,r,E]),o.jsx("div",{children:g&&o.jsx("div",{className:"p-field p-pt-2",children:o.jsx(o.Fragment,{children:o.jsx(Ib,{...t,ruleIndex:r,conditionIndex:i,condition:n,data:s})})},i)})};function L2(t){"@babel/helpers - typeof";return L2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},L2(t)}function zle(t,e){if(L2(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(L2(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Hle(t){var e=zle(t,"string");return L2(e)=="symbol"?e:e+""}function _b(t,e,n){return(e=Hle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Yle={value:"p-tag-value",icon:"p-tag-icon",root:function(e){var n=e.props;return gt("p-tag p-component",_b(_b({},"p-tag-".concat(n.severity),n.severity!==null),"p-tag-rounded",n.rounded))}},Kle=`
|
|
2381
|
+
`+Je),U&&m4([z,O,q],Nt=>{Je=F2(Je,Nt," ")}),C&&me?C.createHTML(Je):Je},e.setConfig=function(){let ct=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dt(ct),le=!0},e.clearConfig=function(){Wt=null,le=!1},e.isValidAttribute=function(ct,Be,rt){Wt||dt({});const It=_n(ct),zt=_n(Be);return At(It,zt,rt)},e.addHook=function(ct,Be){typeof Be=="function"&&O2(V[ct],Be)},e.removeHook=function(ct){return TO(V[ct])},e.removeHooks=function(ct){V[ct]=[]},e.removeAllHooks=function(){V=PO()},e}var y4=MO();const as=t=>{var E;const{field:e,fieldIndex:n,pageIndex:r,sectionIndex:i,rowIndex:s,columnIndex:a,path:l}=t,[c,u]=M.useState(e);M.useEffect(()=>{var x;return A((x=e==null?void 0:e.label)==null?void 0:x[d==null?void 0:d.type]),()=>{}},[e]);const{userSelectedLanguage:d,fieldSettingUpdate:f,fieldSettingUpdateInlineConditional:h,gridComponentFieldSettingUpdate:g}=an(),m=(x,C,S)=>{u(_=>({..._,[x]:{..._[x],[C==null?void 0:C.type]:S}}))},[v,A]=M.useState((E=e==null?void 0:e.label)==null?void 0:E[d==null?void 0:d.type]);M.useEffect(()=>(w(),()=>{}),[c]);const w=()=>{const x=l.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?h(x[ms],x[vs],x[xs],x[Cs],x[Ts],x[Ns],x[Zo],x[Fo],c):(x==null?void 0:x.length)>Ns&&(x==null?void 0:x.length)===tc+1&&(e!=null&&e.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?g(x[ms],x[vs],x[xs],x[Cs],x[Ts],x[5],x[6],x[7],c):f(r,i,s,a,n,{...e,label:c==null?void 0:c.label})};return o.jsx(o.Fragment,{children:o.jsx(g4,{style:{display:"inline-block"},className:"builder-input-label-edit",html:v,disabled:!1,onChange:x=>{var C;A(y4.sanitize((C=x==null?void 0:x.target)==null?void 0:C.value))},onBlur:x=>{var S;const C=y4.sanitize((S=x==null?void 0:x.target)==null?void 0:S.innerText);A(C),m("label",d,C)},tagName:"article"})})},v1=t=>{const{onLabel:e,offLabel:n,onIcon:r,offIcon:i,onHandleChangeSetttings:s,settingsKey:a,settingsKeyValue:l}=t;return o.jsx(o.Fragment,{children:o.jsx(b2,{checked:l,onLabel:e,onChange:c=>{s(a,c.value)},offLabel:n,onIcon:r,offIcon:i,className:"mr-1 px-1",style:{fontSize:"0.8rem"}})})},Xr=t=>{var pe,Z,Q,fe;const{field:e,fieldIndex:n,columnIndex:r,sectionIndex:i,rowIndex:s,pageIndex:a,type:l,path:c,handleFieldSettingsSidebar:u,showFieldIcons:d=!0,showSettingsIcon:f=!0}=t,{emitSocketData:h,renderType:g}=Jt(),m=(Y,ce)=>{V(te=>({...te,[Y]:ce}))},{fieldSettingUpdate:v,fieldSettingUpdateInlineConditional:A,cloneField:w,gridComponentFieldSettingUpdate:E,fieldSettingDeleteInlineConditional:x,gridComponentFieldDelete:C,removeField:S}=an(),{updateGlobalToast:_}=Jt(),I=Y=>{const ce=c.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?A(ce[ms],ce[vs],ce[xs],ce[Cs],ce[Ts],ce[Ns],ce[Zo],ce[Fo],Y):(ce==null?void 0:ce.length)>Ns&&(ce==null?void 0:ce.length)===tc+1&&(Y!=null&&Y.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?E(ce[ms],ce[vs],ce[xs],ce[Cs],ce[Ts],ce[5],ce[6],ce[7],Y):v(a,i,s,r,n,Y),_({showToast:!0,toastMessage:"Updated",toastDetail:"Field updated",toastType:"success"})},[k,P]=M.useState(!1),[L,V]=M.useState({custom_component_title:"",custom_component_description:""}),z=()=>{V(Y=>({...Y,custom_component_schema:e})),P(!0)},O=()=>{const Y=c.split("-").map(Number);l==="inline-conditional"?x(Y[ms],Y[vs],Y[xs],Y[Cs],Y[Ts],Y[Ns],Y[Zo],Y[Fo]):(Y==null?void 0:Y.length)>Ns&&(Y==null?void 0:Y.length)===tc+1&&(e!=null&&e.componentType)&&l==="grid"?C(Y[ms],Y[vs],Y[xs],Y[Cs],Y[Ts],Y[5],Y[6],Y[7]):S(a,i,s,r,n)},q=(Y,ce)=>{const te={...e,attributes:{...e.attributes,[Y]:ce}};I(te)},re=(Y,ce)=>{const te={...e,[Y]:ce};I(te)};return o.jsx(o.Fragment,{children:o.jsxs("div",{className:`${(e==null?void 0:e.componentType)!=="hidden-field"&&(e==null?void 0:e.componentType)!=="image"&&(e==null?void 0:e.componentType)!=="quiz"&&(e==null?void 0:e.componentType)!=="document"&&(e==null?void 0:e.componentType)!=="href"&&(e==null?void 0:e.componentType)!=="paragraph"&&(e==null?void 0:e.componentType)!=="heading"&&(e==null?void 0:e.componentType)!=="list"&&(e==null?void 0:e.componentType)!=="hr"&&(e==null?void 0:e.componentType)!=="image-gallery"&&(e==null?void 0:e.componentType)!=="video"&&(e==null?void 0:e.componentType)!=="question","builder-element-quick-options mb-2 w-3 justify-content-center"} flex quick-setting`,children:[o.jsx(o.Fragment,{children:(e==null?void 0:e.componentType)!=="hidden-field"&&(e==null?void 0:e.componentType)!=="document"&&(e==null?void 0:e.componentType)!=="quiz"&&(e==null?void 0:e.componentType)!=="image"&&(e==null?void 0:e.componentType)!=="href"&&(e==null?void 0:e.componentType)!=="paragraph"&&(e==null?void 0:e.componentType)!=="heading"&&(e==null?void 0:e.componentType)!=="list"&&(e==null?void 0:e.componentType)!=="hr"&&(e==null?void 0:e.componentType)!=="image-gallery"&&(e==null?void 0:e.componentType)!=="video"&&(e==null?void 0:e.componentType)!=="question"&&d===!1&&o.jsxs("div",{className:" ",children:[o.jsx(v1,{field:e,onHandleChangeSetttings:q,settingsKey:"required",settingsKeyValue:(pe=e==null?void 0:e.attributes)==null?void 0:pe.required,onLabel:"Required",offLabel:"Not Required",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:(Z=e==null?void 0:e.attributes)==null?void 0:Z.required}),o.jsx(v1,{field:e,onHandleChangeSetttings:re,settingsKey:"showToolTip",settingsKeyValue:e==null?void 0:e.showToolTip,onLabel:"Tooltip",offLabel:"Tooltip",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showToolTip}),o.jsx(v1,{field:e,onHandleChangeSetttings:re,settingsKey:"showHelperText",settingsKeyValue:e==null?void 0:e.showHelperText,onLabel:"Helper text",offLabel:"Helper text",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showHelperText}),o.jsx(v1,{field:e,onHandleChangeSetttings:re,settingsKey:"showHeaderText",settingsKeyValue:e==null?void 0:e.showHeaderText,onLabel:"Header text",offLabel:"Header text",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showHeaderText}),o.jsx(v1,{field:e,onHandleChangeSetttings:re,settingsKey:"isFluid",settingsKeyValue:e==null?void 0:e.isFluid,onLabel:"Fluid",offLabel:"Fluid",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.isFluid}),(e==null?void 0:e.componentType)=="radio"&&o.jsxs(o.Fragment,{children:[o.jsx(v1,{field:e,onHandleChangeSetttings:re,settingsKey:"showAlphabetList",settingsKeyValue:e==null?void 0:e.showAlphabetList,onLabel:"Alpha",offLabel:"Alpha",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showAlphabetList}),o.jsx(v1,{field:e,onHandleChangeSetttings:q,settingsKey:"style",settingsKeyValue:(Q=e==null?void 0:e.attributes)==null?void 0:Q.style,onLabel:"Style",offLabel:"Style",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:(fe=e==null?void 0:e.attributes)==null?void 0:fe.style})]})]})}),o.jsxs("div",{className:"quick-setting",children:[f===!0&&o.jsxs("span",{className:"p-buttonset",children:[(e==null?void 0:e.componentType)!=="hr"&&o.jsx($t,{text:!0,size:"small",tooltip:"Advanced settings",icon:"pi pi-cog",onClick:()=>{u(!0)},className:"mr-3"}),o.jsx($t,{size:"small",text:!0,icon:"pi pi-clone",outlined:!0,onClick:()=>{w(e,a,i,s,r,n),h()},tooltip:"Clone"}),o.jsx($t,{text:!0,className:"p-button-danger",size:"small",outlined:!0,icon:"pi pi-trash",onClick:()=>{O()},tooltip:"Delete"}),(g===$3||g===Q0)&&o.jsx($t,{text:!0,size:"small",outlined:!0,icon:"pi pi-file",tooltip:"Save as custom component",onClick:()=>{z()}})]}),o.jsxs(za,{header:"Custom component save",visible:k,style:{width:"20vw"},footer:()=>o.jsx(o.Fragment,{children:o.jsxs("div",{children:[o.jsx($t,{size:"small",text:!0,label:"Close",icon:"pi pi-times",onClick:()=>P(!1),className:"p-button-text"}),(e==null?void 0:e.componentType)!=="hidden-field"&&o.jsx($t,{text:!0,label:"Save",icon:"pi pi-check",onClick:()=>{P(!1)},autoFocus:!0})]})}),onHide:()=>P(!1),children:[o.jsxs("span",{className:"p-float-label",children:[o.jsx(Sn,{id:"custom_component_title",name:"custom_component_title",className:"w-full",value:(L==null?void 0:L.custom_component_title)||"",onChange:Y=>{var ce;return m("custom_component_title",(ce=Y==null?void 0:Y.target)==null?void 0:ce.value)}}),o.jsx("label",{htmlFor:"username",children:"Custom component title"})]}),o.jsxs("span",{className:"p-float-label mt-5",children:[o.jsx(fo,{id:"custom_component_description",name:"custom_component_description",className:"w-full",value:(L==null?void 0:L.custom_component_description)||"",onChange:Y=>{var ce;return m("custom_component_description",(ce=Y==null?void 0:Y.target)==null?void 0:ce.value)}}),o.jsx("label",{htmlFor:"username",children:"Custom component description"})]})]})]})]})})},kle=t=>{var ne,K,W,de,ve,Te,ye,Ae;const{pageIndex:e,sectionIndex:n,field:r,fieldIndex:i,row:s,rowIndex:a,columnIndex:l,isDisabled:c}=t,{isAdmin:u,isRenderView:d,isPreview:f}=Jt(),{userSelectedLanguage:h,fieldSettingUpdate:g}=an(),{taskRegisterData:m,updateTaskRegisterData:v,updateTaskProgressValue:A,updateUserFormDataSubmit:w,userTaskSubmitFormData:E}=vr(),[x,C]=M.useState(!1),[S,_]=M.useState(!1),[I,k]=M.useState(null),[P,L]=M.useState(0),[V,z]=M.useState(!1),O=()=>{z(!0)},q=()=>{z(!1)},re=J=>{C(J)},pe=()=>{C(!1)},Z=()=>{var J,U,ae;if(s!=null&&s.rowIsRepeatable){if(s!=null&&s.repeatableFields){const G=[...s.repeatableFields],le=_t.findIndex(G,function(De){return De.uuid===(r==null?void 0:r.uuid)});le>=0&&G[le].fieldData?k(G[le].fieldData):(r.isValid=0,k(null))}}else{const G=E,le=_t.cloneDeep(m);if(G!=null&&G.length){for(const De of G)if(De.fieldId===t.field.uuid&&((J=De==null?void 0:De.postData)!=null&&J.length)){k((U=De==null?void 0:De.postData[0])==null?void 0:U.postValue),le[r==null?void 0:r.uuid]=(ae=De==null?void 0:De.postData[0])==null?void 0:ae.postValue;const _e=Object.keys(le).length;A(_e);break}}}_(!0)},Q=J=>{var le;k(J.target.value);const U=E,ae=_t.cloneDeep(m);if((le=J==null?void 0:J.target)!=null&&le.value&&(U==null?void 0:U.length)>0)for(const De of U)De.fieldId===t.field.uuid&&(ae[r==null?void 0:r.uuid]=J==null?void 0:J.value,De.postData[0]={postValue:J.value});else delete ae[r==null?void 0:r.uuid];v(ae);const G=Object.keys(ae).length;A(G)};M.useEffect(()=>{S||Z();const J=Zt.addListener("clearRepeatableFields",G=>{G===(s==null?void 0:s.uuid)&&(k(null),L(0),r.isValid=0,g(e,n,a,l,i,r))}),U=Zt.addListener("onSubmitUserForm",()=>{var G;(G=r==null?void 0:r.attributes)!=null&&G.required?I!==null||I!==void 0?r.isValid=1:(console.log("Countr field in valid ",I),r.isValid=0):r.isValid=1}),ae=Zt.addListener("OnInvalidFieldCatch",G=>{console.log("OnInvalidFieldCatch listener"),console.log("field.uuid === value?.fieldId",r.uuid===(G==null?void 0:G.fieldId)),r.uuid===(G==null?void 0:G.fieldId)?L(1):L(0)});return()=>{U.remove(),ae.remove(),J.remove()}});const fe=(J,U)=>{var ae;if(E){const G=[...E],le=_t.findIndex(G,function(_e){return _e.rowId===(s==null?void 0:s.uuid)});let De=(ae=E[le])==null?void 0:ae.repeatableFields;De={...De,[J==null?void 0:J.uuid]:U},G[le]={...G[le],repeatableFields:De},w(G)}k(U),U!==null?J.isValid=1:J.isValid=0},Y=(J,U)=>J?o.jsxs("div",{className:"country-item flex",children:[o.jsx("img",{alt:J.name,src:J==null?void 0:J.image,onError:ae=>ae.target.src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png",style:{width:"20px",marginRight:10}}),o.jsx("div",{children:J.name})]}):o.jsx("span",{children:U.placeholder}),ce=J=>o.jsxs("div",{className:"country-item flex",children:[o.jsx("img",{alt:J.name,src:J==null?void 0:J.image,onError:U=>U.target.src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png",style:{width:"20px",marginRight:10}}),o.jsx("div",{children:J.name})]}),te=o.jsxs("div",{onMouseOver:O,onMouseOut:q,children:[!d&&!f&&V&&o.jsx(Xr,{handleFieldSettingsSidebar:re,...t}),o.jsxs("div",{className:`field ${f?" ":" builder-element-wrapper "}${(r==null?void 0:r.isFluid)===!0?" card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:f?"col-12 ":"field-form-builder col-12 ",children:[(r==null?void 0:r.showHeaderText)&&o.jsx("h6",{children:(ne=r==null?void 0:r.headerText)==null?void 0:ne[h==null?void 0:h.type]}),(r==null?void 0:r.showLabel)&&o.jsxs("label",{htmlFor:i,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(ds,{...t}),((K=r==null?void 0:r.attributes)==null?void 0:K.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",f?o.jsx(o.Fragment,{children:(W=r==null?void 0:r.label)==null?void 0:W[h==null?void 0:h.type]}):o.jsx(as,{...t}),o.jsx("span",{className:"ml-3",children:(r==null?void 0:r.showToolTip)&&o.jsx(Mi,{message:(de=r==null?void 0:r.toolTip)==null?void 0:de[h==null?void 0:h.type],position:"right"})})]}),o.jsx(Os,{className:"country-select-builder-component",onFocus:()=>L(1),onChange:J=>{s!=null&&s.rowIsRepeatable?fe(r,J.target.value):Q(J)},options:r==null?void 0:r.countries,optionLabel:"name",value:I,placeholder:(ve=r==null?void 0:r.placeholder)==null?void 0:ve[h==null?void 0:h.type],disabled:c,valueTemplate:Y,itemTemplate:ce,filter:!0,filterBy:"name",showClear:!0}),((Te=r==null?void 0:r.attributes)==null?void 0:Te.required)&&o.jsx("small",{className:"error",children:P===1&&I===null?((ye=r==null?void 0:r.validationMesssage)==null?void 0:ye[h==null?void 0:h.type])||"field is required":""}),o.jsx("div",{children:(r==null?void 0:r.showHelperText)&&o.jsx("small",{children:(Ae=r==null?void 0:r.helperText)==null?void 0:Ae[h==null?void 0:h.type]})})]})}),u&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[x===!0&&o.jsx(Wi,{visibilty:x,closeSettingFieldSidebar:pe,...t},r==null?void 0:r.uuid),o.jsx(Si,{...t,fieldWrap:te})]})},Ple=t=>{var W,de,ve,Te,ye,Ae,J,U,ae,G,le,De,_e,be,me;const{taskRegisterData:e,updateTaskRegisterData:n,updateTaskProgressValue:r,updateUserFormDataSubmit:i,userTaskSubmitFormData:s,task_status:a,TASK_PUBLISHED:l}=vr(),{userSelectedLanguage:c,fieldSettingUpdate:u}=an(),{field:d,fieldIndex:f,sectionIndex:h,pageIndex:g,row:m,rowIndex:v,columnIndex:A,isDisabled:w}=t,{isAdmin:E,isRenderView:x,isPreview:C}=Jt(),[S,_]=M.useState(!1),[I,k]=M.useState(""),[P,L]=M.useState(null),[V,z]=M.useState(0),[O,q]=M.useState(!1),[re,pe]=M.useState(!1),Z=()=>{pe(!0)},Q=()=>{pe(!1)},fe=()=>{var Se,Ie,$;if(m!=null&&m.rowIsRepeatable){if(m!=null&&m.repeatableFields){const se=[...m.repeatableFields],ge=_t.findIndex(se,function(oe){return oe.uuid===(d==null?void 0:d.uuid)});ge>=0&&se[ge].fieldData?k(se[ge].fieldData):k("")}}else{const se=s;if(se!=null&&se.length){for(const ge of se)if(ge.fieldId===t.field.uuid&&((Se=ge==null?void 0:ge.postData[0])==null?void 0:Se.postValue)!==""&&((Ie=ge==null?void 0:ge.postData[0])!=null&&Ie.postValue)){k(($=ge==null?void 0:ge.postData[0])==null?void 0:$.postValue);break}}}q(!0)};M.useEffect(()=>{O||fe();const Se=Zt.addListener("clearRepeatableFields",oe=>{oe===(m==null?void 0:m.uuid)&&(k(""),z(0),d.isValid=0,u(g,h,v,A,f,d))}),Ie=Zt.addListener("onSubmitUserForm",()=>{var oe,he;(oe=d==null?void 0:d.attributes)!=null&&oe.required?I&&I.length&&(I==null?void 0:I.length)<((he=d==null?void 0:d.attributes)==null?void 0:he.minLength)?d.isValid=1:d.isValid=0:d.isValid=1}),$=Zt.addListener("OnInvalidFieldCatch",oe=>{d.uuid===(oe==null?void 0:oe.fieldId)?z(1):z(0)}),se=Zt.addListener("OnGetFieldValue",oe=>{var ue;const he=(ue=oe==null?void 0:oe.repeatableColumn)==null?void 0:ue.filter(Ve=>(Ve==null?void 0:Ve.fieldUuid)===(d==null?void 0:d.uuid));he!=null&&he.length}),ge=Zt.addListener("formFieldAdded",oe=>{P===null&&L(oe==null?void 0:oe.uuid)});return()=>{Ie.remove(),$.remove(),se.remove(),Se.remove(),ge.remove()}}),M.useEffect(()=>(P!==null&&setTimeout(()=>{L(null)},1e3),()=>{}),[P]);const Y=Se=>{_(Se)},ce=()=>{_(!1)},te=Se=>{var se,ge;k(Se.target.value);const Ie=s,$=_t.cloneDeep(e);if(Ie!==null){if((se=Se==null?void 0:Se.target)!=null&&se.value){if($[d==null?void 0:d.uuid]=(ge=Se==null?void 0:Se.target)==null?void 0:ge.value,(Ie==null?void 0:Ie.length)>0)for(const oe of Ie)oe.fieldId===t.field.uuid&&(oe.postData[0]={postValue:Se.target.value})}else if(delete $[d==null?void 0:d.uuid],(Ie==null?void 0:Ie.length)>0)for(const oe of Ie)oe.fieldId===t.field.uuid&&(oe.postData[0]={postValue:""})}if(console.log("row?.rowIsRepeatable",m==null?void 0:m.rowIsRepeatable),!(m!=null&&m.rowIsRepeatable)){n($);const oe=Object.keys($).length;r(oe)}},ne=(Se,Ie)=>{var $;if(s){const se=[...s],ge=_t.findIndex(se,function(he){return he.rowId===(m==null?void 0:m.uuid)});let oe=($=s[ge])==null?void 0:$.repeatableFields;oe={...oe,[Se==null?void 0:Se.uuid]:Ie},se[ge]={...se[ge],repeatableFields:oe},i(se)}k(Ie),Ie!==""?Se.isValid=1:Se.isValid=0},K=o.jsxs("div",{onMouseOver:Z,onMouseOut:Q,children:[!x&&!C&&re&&o.jsx(Xr,{handleFieldSettingsSidebar:Y,...t}),o.jsxs("div",{className:`field ${C?" ":" builder-element-wrapper "} ${(d==null?void 0:d.isFluid)===!0?" p-fluid ":""} ${x?" ":" py-6 px-4 "} ${P===(d==null?void 0:d.uuid)?" new-field ":" card "} `,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:E?"col-6 ":"col-12 p-fluid",children:[(d==null?void 0:d.showHeaderText)&&o.jsx("h6",{children:(W=d==null?void 0:d.headerText)==null?void 0:W[c==null?void 0:c.type]}),(d==null?void 0:d.showLabel)&&o.jsxs("label",{htmlFor:d==null?void 0:d.uuid,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(ds,{...t}),((de=d==null?void 0:d.attributes)==null?void 0:de.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",C?o.jsx(o.Fragment,{children:(ve=d==null?void 0:d.label)==null?void 0:ve[c==null?void 0:c.type]}):o.jsx(as,{...t}),(d==null?void 0:d.showToolTip)&&o.jsx("span",{className:"ml-3",children:o.jsx(Mi,{message:(Te=d==null?void 0:d.toolTip)==null?void 0:Te[c==null?void 0:c.type],position:"right"})})]}),o.jsxs("div",{className:"mt-3",children:[o.jsxs("span",{className:"p-input-icon-"+(d==null?void 0:d.iconAlignment),children:[(d==null?void 0:d.showIcon)&&o.jsx("i",{className:"pi pi-"+((Ae=(ye=d==null?void 0:d.icon)==null?void 0:ye.properties)==null?void 0:Ae.name)}),o.jsx(Sn,{id:d==null?void 0:d.uuid,placeholder:(J=d==null?void 0:d.placeholder)==null?void 0:J[c==null?void 0:c.type],minLength:(U=d==null?void 0:d.attributes)==null?void 0:U.minLength,maxLength:(ae=d==null?void 0:d.attributes)==null?void 0:ae.maxLength,value:I,onFocus:()=>z(1),onChange:Se=>{m!=null&&m.rowIsRepeatable?ne(d,Se.target.value):te(Se)},className:V===1&&((G=d==null?void 0:d.attributes)!=null&&G.required)?I?"valid":"invalid":"valid'",readOnly:w})]}),o.jsx("div",{children:((le=d==null?void 0:d.attributes)==null?void 0:le.required)&&o.jsxs(o.Fragment,{children:[o.jsx("small",{className:"error",children:V===1&&!I?(De=d==null?void 0:d.validationMesssage)==null?void 0:De.english:""}),o.jsx("small",{className:"error",children:V===1&&I.length&&(I==null?void 0:I.length)<((_e=d==null?void 0:d.attributes)==null?void 0:_e.minLength)?`Mini length ${(be=d==null?void 0:d.attributes)==null?void 0:be.minLength}`:""})]})}),o.jsx("div",{children:(d==null?void 0:d.showHelperText)&&o.jsx("small",{children:(me=d==null?void 0:d.helperText)==null?void 0:me[c==null?void 0:c.type]})})]})]})}),E&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[S===!0&&o.jsx(Wi,{visibilty:S,closeSettingFieldSidebar:ce,...t}),o.jsx(Si,{...t,fieldWrap:K})]})},Mle=t=>{var i,s;const{language:e,onHandleChange:n,fieldState:r}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Hyperlink text"}),o.jsx(Sn,{value:(i=r==null?void 0:r.text)==null?void 0:i[e==null?void 0:e.type],onChange:a=>n("text",e,a.target.value)})]}),o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Hyperlink"}),o.jsx(Sn,{value:(s=r==null?void 0:r.hrefLink)==null?void 0:s[e==null?void 0:e.type],onChange:a=>n("hrefLink",e,a.target.value)})]})]})},Lle=t=>{var r;const{onHandleChangeStyling:e,fieldState:n}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field",children:[o.jsx("label",{className:"mr-2",children:"Hyperlink color"}),o.jsx(n4,{value:n==null?void 0:n.color,onChange:i=>{e("color",i.value)}})]}),o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Font Size"}),o.jsx(Sn,{type:"number",maxLength:2,placeholder:"eg 20px",value:(r=Number(n==null?void 0:n.fontSize))==null?void 0:r.toFixed(0),onChange:i=>{e("fontSize",i.target.value)}})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(zr,{checked:n==null?void 0:n.underLined,onChange:i=>{e("underLined",i.checked)}}),o.jsx("label",{children:"Underline link"})]})]})},Ble=t=>{const{visibilty:e,field:n,closeSettingFieldSidebar:r,pageIndex:i,sectionIndex:s,rowIndex:a,columnIndex:l,fieldIndex:c}=t,[u,d]=M.useState(n),{fieldSettingUpdate:f,formBuilderSchemaLanguages:h,formBuilderPublishedStatus:g}=an(),{updateGlobalToast:m}=Jt(),v=(E,x,C)=>{d(S=>({...S,[E]:{...S[E],[x==null?void 0:x.type]:C}}))},A=(E,x)=>{d(C=>({...C,[E]:x}))},w=()=>{f(i,s,a,l,c,u),m({showToast:!0,toastMessage:"Updated",toastDetail:"Html updated",toastType:"success"})};return o.jsx(o.Fragment,{children:o.jsxs(Vo,{visible:e,position:"left",className:"p-sidebar-lg",onHide:()=>r(),children:[o.jsxs("div",{className:"flex justify-content-between flex-wrap card-container ",children:[o.jsxs("div",{className:"flex align-items-center justify-content-center ",children:[" ",o.jsxs("h5",{className:"mb-0",children:[t==null?void 0:t.typeName," settings "]})]}),!g&&o.jsx("div",{className:"flex align-items-center justify-content-center",children:o.jsx($t,{className:"mt-3",label:"Update",type:"button",onClick:()=>w(),"aria-label":"Update"})})]}),o.jsxs(Js,{children:[o.jsx(br,{header:"Text",children:o.jsx(uo,{activeIndex:0,children:h!=null&&h.length?h.map((E,x)=>o.jsx(co,{tabIndex:x,header:E==null?void 0:E.language,children:o.jsx(Mle,{language:E,fieldState:u,onHandleChange:v,...t})},x)):""})}),o.jsx(br,{header:"Styling",children:o.jsx(Lle,{fieldState:u,onHandleChangeStyling:A,...t})})]})]})})},Vle=t=>{var g,m,v,A,w,E,x,C,S;const{field:e}=t,{userSelectedLanguage:n}=an(),{isPreview:r}=Jt(),[i,s]=M.useState(!1),[a,l]=M.useState(!1),c=()=>{l(!0)},u=()=>{l(!1)},d=_=>{s(_)},f=()=>{s(!1)};M.useEffect(()=>{},[e]);const h=o.jsxs("div",{className:r?"":"builder-element-wrapper",onMouseOver:c,onMouseOut:u,children:[!r&&a&&o.jsx(Xr,{handleFieldSettingsSidebar:d,...t}),o.jsxs("div",{className:r?" px-4":"field-form-builder px-4",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(g=e==null?void 0:e.headerText)==null?void 0:g[n==null?void 0:n.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:e.uuid,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[((m=e==null?void 0:e.attributes)==null?void 0:m.required)&&o.jsx("span",{className:"must-required",children:"*"})," ",r?o.jsx(o.Fragment,{children:(v=e==null?void 0:e.label)==null?void 0:v[n==null?void 0:n.type]}):o.jsx(as,{...t}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(Mi,{message:(A=e==null?void 0:e.toolTip)==null?void 0:A[n==null?void 0:n.type],position:"right"})})]}),o.jsx("a",{style:{fontSize:parseInt(e==null?void 0:e.fontSize),color:`#${e==null?void 0:e.color}`,textDecoration:e!=null&&e.underLined?"underline":"none"},className:"atag-style",href:(w=e==null?void 0:e.hrefLink)==null?void 0:w[n==null?void 0:n.type],children:(E=e==null?void 0:e.text)==null?void 0:E[n==null?void 0:n.type]}),((x=e==null?void 0:e.attributes)==null?void 0:x.required)&&o.jsx("small",{className:"error",children:(C=e==null?void 0:e.validationMesssage)==null?void 0:C[n==null?void 0:n.type]}),(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(S=e==null?void 0:e.helperText)==null?void 0:S[n==null?void 0:n.type]})]})]});return o.jsxs(o.Fragment,{children:[o.jsx(Ble,{visibilty:i,closeSettingFieldSidebar:f,...t}),o.jsx(Si,{...t,fieldWrap:h})]})},Ule=t=>{var W,de,ve,Te,ye,Ae,J,U,ae,G,le,De,_e,be,me,Se,Ie,$,se,ge,oe;const{field:e,fieldIndex:n,sectionIndex:r,pageIndex:i,row:s,rowIndex:a,columnIndex:l,isDisabled:c}=t,{isPreview:u,isRenderView:d,isAdmin:f}=Jt(),{taskRegisterData:h,updateTaskRegisterData:g,updateTaskProgressValue:m,updateUserFormDataSubmit:v,userTaskSubmitFormData:A,TASK_PUBLISHED:w,task_status:E}=vr(),{userSelectedLanguage:x,fieldSettingUpdate:C}=an(),[S,_]=M.useState(null),[I,k]=M.useState(!1),[P,L]=M.useState(null),[V,z]=M.useState(0),[O,q]=M.useState(!1),[re,pe]=M.useState(!1),Z=()=>{pe(!0)},Q=()=>{pe(!1)},fe=()=>{var he,ue;if(s!=null&&s.rowIsRepeatable){if(s!=null&&s.repeatableFields){const Ve=[...s.repeatableFields],Ne=_t.findIndex(Ve,function(Ye){return Ye.uuid===(e==null?void 0:e.uuid)});Ne>=0&&Ve[Ne].fieldData?L(Number(Ve[Ne].fieldData)||null):L(null)}}else{const Ve=A;if(Ve!=null&&Ve.length){for(const Ne of Ve)if(Ne.fieldId===t.field.uuid&&((he=Ne==null?void 0:Ne.postData)!=null&&he.length)){L(Number((ue=Ne==null?void 0:Ne.postData[0])==null?void 0:ue.postValue)||null);break}}}q(!0)};M.useEffect(()=>{O||fe();const he=Zt.addListener("clearRepeatableFields",st=>{st===(s==null?void 0:s.uuid)&&(L(null),z(0),e.isValid=0,C(i,r,a,l,n,e))}),ue=Zt.addListener("onSubmitUserForm",()=>{var st;(st=e==null?void 0:e.attributes)!=null&&st.required?P?e.isValid=1:e.isValid=0:e.isValid=1}),Ve=Zt.addListener("OnInvalidFieldCatch",st=>{e.uuid===(st==null?void 0:st.fieldId)?z(1):z(0)}),Ne=Zt.addListener("OnGetFieldValue",st=>{var ht;const ot=(ht=st==null?void 0:st.repeatableColumn)==null?void 0:ht.filter(Pt=>(Pt==null?void 0:Pt.fieldUuid)===(e==null?void 0:e.uuid));ot!=null&&ot.length}),Ye=Zt.addListener("formFieldAdded",st=>{S===null&&_(st.uuid)});return()=>{ue.remove(),Ve.remove(),Ne.remove(),he.remove(),Ye.remove()}}),M.useEffect(()=>(S!==null&&setTimeout(()=>{_(null)},1e3),()=>{}),[S]);const Y=he=>{k(he)},ce=()=>{k(!1)},te=he=>{const ue=A,Ve=_t.cloneDeep(h);if(ue!==null){if(he){if(Ve[e==null?void 0:e.uuid]=he,(ue==null?void 0:ue.length)>0)for(const Ne of ue)Ne.fieldId===t.field.uuid&&(Ne.postData[0]={postValue:he})}else if(delete Ve[e==null?void 0:e.uuid],(ue==null?void 0:ue.length)>0)for(const Ne of ue)Ne.fieldId===t.field.uuid&&(Ne.postData[0]={postValue:""})}if(!(s!=null&&s.rowIsRepeatable)){g(Ve);const Ne=Object.keys(Ve).length;m(Ne)}},ne=(he,ue)=>{var Ve;if(A!=null&&A.length){const Ne=[...A],Ye=_t.findIndex(Ne,function(ot){return ot.rowId===(s==null?void 0:s.uuid)});let st=(Ve=A[Ye])==null?void 0:Ve.repeatableFields;st={...st,[he==null?void 0:he.uuid]:ue},Ne[Ye]={...Ne[Ye],repeatableFields:st},v(Ne)}L(ue),ue!==""?he.isValid=1:he.isValid=0},K=o.jsxs("div",{onMouseOver:Z,onMouseOut:Q,children:[!d&&!u&&re&&o.jsx(Xr,{handleFieldSettingsSidebar:Y,...t}),o.jsxs("div",{className:`field ${u?" ":" builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0?" p-fluid py-6 px-4":" py-6 px-4"} ${S===(e==null?void 0:e.uuid)?" new-field ":" card "}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:f?"col-6 ":"col-12 p-fluid",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(W=e==null?void 0:e.headerText)==null?void 0:W[x==null?void 0:x.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:e.uuid,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(ds,{...t}),((de=e==null?void 0:e.attributes)==null?void 0:de.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",u?o.jsx(o.Fragment,{children:(ve=e==null?void 0:e.label)==null?void 0:ve[x==null?void 0:x.type]}):o.jsx(as,{...t}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(Mi,{message:(Te=e==null?void 0:e.toolTip)==null?void 0:Te[x==null?void 0:x.type],position:"right"})})]}),o.jsxs("div",{className:"mt-3",children:[o.jsxs("span",{className:"p-input-icon-"+(e==null?void 0:e.iconAlignment),children:[(e==null?void 0:e.showIcon)&&o.jsx("i",{className:"pi pi-"+((Ae=(ye=e==null?void 0:e.icon)==null?void 0:ye.properties)==null?void 0:Ae.name)}),o.jsx(ro,{readOnly:c,id:e==null?void 0:e.uuid,placeholder:(J=e==null?void 0:e.placeholder)==null?void 0:J[x==null?void 0:x.type],value:P,min:(U=e==null?void 0:e.attributes)==null?void 0:U.min,max:e==null?void 0:e.attributes.max,suffix:e==null?void 0:e.attributes.suffix,prefix:(ae=e==null?void 0:e.attributes)==null?void 0:ae.prefix,showButtons:(G=e==null?void 0:e.attributes)==null?void 0:G.showButtons,pt:{incrementButton:{className:"bg-teal-500 border-teal-500"},decrementButton:{className:"bg-orange-500 border-orange-500"}},minFractionDigits:(le=e==null?void 0:e.attributes)==null?void 0:le.minFractionDigits,maxFractionDigits:(De=e==null?void 0:e.attributes)==null?void 0:De.maxFractionDigits,locale:(_e=e==null?void 0:e.attributes)==null?void 0:_e.locale,mode:(be=e==null?void 0:e.attributes)==null?void 0:be.mode,currency:(me=e==null?void 0:e.attributes)==null?void 0:me.currency,currencyDisplay:(Se=e==null?void 0:e.attributes)==null?void 0:Se.currencyDisplay,useGrouping:(Ie=e==null?void 0:e.attributes)==null?void 0:Ie.useGrouping,onFocus:()=>z(1),onChange:he=>{s!=null&&s.rowIsRepeatable?ne(e,he.value):te(he.value)},className:V===1&&(($=e==null?void 0:e.attributes)!=null&&$.required)?P?"valid":"invalid":"valid'"})]}),o.jsx("div",{children:((se=e==null?void 0:e.attributes)==null?void 0:se.required)&&o.jsx("small",{className:"error",children:V===1&&!P?(ge=e==null?void 0:e.validationMesssage)==null?void 0:ge.english:""})}),o.jsx("div",{children:(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(oe=e==null?void 0:e.helperText)==null?void 0:oe[x==null?void 0:x.type]})})]})]})}),f&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[I===!0&&o.jsx(Wi,{visibilty:I,closeSettingFieldSidebar:ce,...t}),o.jsx(Si,{...t,fieldWrap:K})]})},Eb=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],A4=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/,xu=/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+\$,\\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=+\$,\\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%\/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)/;function LO(t){try{JSON.parse(t)}catch{return!1}return!0}function BO(t){if(t<26)return Eb[t];{const e=Math.floor(t/26)-1,n=t%26;return Eb[e]+Eb[n]}}const qle=t=>{var te,ne,K,W,de,ve,Te,ye,Ae,J,U;const{field:e,fieldIndex:n,pageIndex:r,sectionIndex:i,row:s,update:a,value:l,isDisabled:c}=t,{isPreview:u,isAdmin:d,isRenderView:f}=Jt(),{task_status:h,taskRegisterData:g,updateTaskRegisterData:m,updateTaskProgressValue:v,updateUserFormDataSubmit:A,userTaskSubmitFormData:w,TASK_PUBLISHED:E}=vr(),{userSelectedLanguage:x}=an(),[C,S]=M.useState(!1),[_,I]=M.useState(""),[k,P]=M.useState(0),[L,V]=M.useState(!1),z=()=>{V(!0)},O=()=>{V(!1)};M.useEffect(()=>{C||Q();const ae=Zt.addListener("clearRepeatableFields",le=>{le===(s==null?void 0:s.uuid)&&(I(""),P(0),e.isValid=0)}),G=Zt.addListener("onSubmitUserForm",()=>{var le;(le=e==null?void 0:e.attributes)!=null&&le.required?_!==""&&A4.test(_)===!0?e.isValid=1:e.isValid=0:e.isValid=1});return()=>{G.remove(),ae.remove()}});const[q,re]=M.useState(!1),pe=ae=>{re(ae)},Z=()=>{re(!1)},Q=()=>{var ae,G,le;if(s!=null&&s.rowIsRepeatable){if(s!=null&&s.repeatableFields){const De=[...s.repeatableFields],_e=_t.findIndex(De,function(be){return be.uuid===(e==null?void 0:e.uuid)});_e>=0&&De[_e].fieldData?I(De[_e].fieldData):I("")}}else{const De=w;if(De!=null&&De.length){for(const _e of De)if(_e.fieldId===t.field.uuid&&((ae=_e==null?void 0:_e.postData[0])==null?void 0:ae.postValue)!==""&&((G=_e==null?void 0:_e.postData[0])!=null&&G.postValue)){I((le=_e==null?void 0:_e.postData[0])==null?void 0:le.postValue),S(!0);break}}}S(!0)},fe=ae=>{I(ae);const G=w,le=_t.cloneDeep(g);if(G!==null){if(ae!==""&&A4.test(ae)===!0){if(le[e==null?void 0:e.uuid]=ae,(G==null?void 0:G.length)>0)for(const De of G)De.fieldId===t.field.uuid&&(De.postData[0]={postValue:ae})}else if(delete le[e==null?void 0:e.uuid],(G==null?void 0:G.length)>0)for(const De of G)De.fieldId===t.field.uuid&&(De.postData[0]={postValue:""})}if(!(s!=null&&s.rowIsRepeatable)){m(le);const De=Object.keys(le).length;v(De)}},Y=(ae,G,le,De)=>{var _e;if(I(De),w!==null){const be=[...w],me=_t.findIndex(be,function(Ie){return Ie.rowId===(s==null?void 0:s.uuid)});let Se=(_e=w[me])==null?void 0:_e.repeatableFields;Se={...Se,[le==null?void 0:le.uuid]:De},be[me]={...be[me],repeatableFields:Se},A(be),De!==""&&A4.test(De)===!0?e.isValid=1:e.isValid=0}},ce=o.jsxs("div",{onMouseOver:z,onMouseOut:O,children:[!f&&!u&&L&&o.jsx(Xr,{handleFieldSettingsSidebar:pe,...t}),o.jsxs("div",{className:`field ${u?" ":" builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0?" card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(te=e==null?void 0:e.headerText)==null?void 0:te[x==null?void 0:x.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:n,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(ds,{...t,update:a,value:l}),((ne=e==null?void 0:e.attributes)==null?void 0:ne.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",u?o.jsx(o.Fragment,{children:(K=e==null?void 0:e.label)==null?void 0:K[x==null?void 0:x.type]}):o.jsx(as,{...t}),o.jsx("span",{className:"ml-2",children:(e==null?void 0:e.showToolTip)&&o.jsx(o.Fragment,{children:o.jsx(Mi,{message:(W=e==null?void 0:e.toolTip)==null?void 0:W[x==null?void 0:x.type],position:"right"})})})]}),o.jsxs("span",{className:"p-input-icon-"+(e==null?void 0:e.iconAlignment),children:[(e==null?void 0:e.showIcon)&&o.jsx("i",{className:"pi pi-"+((ve=(de=e==null?void 0:e.icon)==null?void 0:de.properties)==null?void 0:ve.name)}),o.jsx(Sn,{id:e==null?void 0:e.uuid,placeholder:(Te=e==null?void 0:e.placeholder)==null?void 0:Te[x==null?void 0:x.type],value:_,onFocus:()=>P(1),onChange:ae=>{s!=null&&s.rowIsRepeatable?Y(r,i,{uuid:e.uuid},ae.target.value):fe(ae.target.value)},className:k===1&&((ye=e==null?void 0:e.attributes)!=null&&ye.required)?_?"valid":"invalid":"valid'",readOnly:c})]}),((Ae=e==null?void 0:e.attributes)==null?void 0:Ae.required)&&o.jsx("div",{children:o.jsx("small",{className:"error",children:k===1&&(_===null||_==="")?(J=e==null?void 0:e.validationMesssage)==null?void 0:J[x==null?void 0:x.language]:""})}),_!==""&&k===1&&A4.test(_)===!1&&o.jsx("small",{className:"error",children:"Please enter correct email"}),(e==null?void 0:e.showHelperText)&&o.jsx("div",{children:o.jsx("small",{children:(U=e==null?void 0:e.helperText)==null?void 0:U[x==null?void 0:x.type]})})]}),d&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]});return o.jsxs(o.Fragment,{children:[q===!0&&o.jsx(Wi,{visibilty:q,closeSettingFieldSidebar:Z,...t},e==null?void 0:e.uuid),o.jsx(Si,{...t,fieldWrap:ce})]})},$le=t=>{var W,de,ve,Te,ye,Ae,J,U,ae;const{field:e,fieldIndex:n,pageIndex:r,sectionIndex:i,rowIndex:s,columnIndex:a,row:l,isDisabled:c}=t,{isRenderView:u,isAdmin:d,isPreview:f}=Jt(),{userSelectedLanguage:h,fieldSettingUpdate:g}=an(),{task_status:m,taskRegisterData:v,updateTaskRegisterData:A,updateTaskProgressValue:w,updateUserFormDataSubmit:E,userTaskSubmitFormData:x,TASK_PUBLISHED:C}=vr(),[S,_]=M.useState(!1),[I,k]=M.useState(""),[P,L]=M.useState(0),[V,z]=M.useState(!1),[O,q]=M.useState(!1),[re,pe]=M.useState(!1),Z=()=>{q(!0)},Q=()=>{q(!1)},fe=G=>{_(G)},Y=()=>{_(!1)},ce=()=>{var le,De,_e;const G=x;if(l!=null&&l.rowIsRepeatable){if(l!=null&&l.repeatableFields){const be=[...l.repeatableFields],me=_t.findIndex(be,function(Se){return Se.uuid===(e==null?void 0:e.uuid)});me>=0&&be[me].fieldData?k(be[me].fieldData):(e.isValid=0,k(""))}}else if(G!=null&&G.length){for(const be of G)if(be.fieldId===t.field.uuid&&((le=be==null?void 0:be.postData[0])!=null&&le.postValue)&&((De=be==null?void 0:be.postData[0])==null?void 0:De.postValue)!==""){k((_e=be==null?void 0:be.postData[0])==null?void 0:_e.postValue),z(!0);break}}z(!0)},te=(G,le,De,_e)=>{var be;if(x!=null&&x.length){const me=[...x],Se=_t.findIndex(me,function($){return $.rowId===(l==null?void 0:l.uuid)});let Ie=(be=x[Se])==null?void 0:be.repeatableFields;Ie={...Ie,[De==null?void 0:De.uuid]:_e},me[Se]={...me[Se],repeatableFields:Ie},E(me)}k(_e),_e!==""?e.isValid=1:e.isValid=0,g(G,le,s,a,n,e)};M.useEffect(()=>{V||ce();const G=Zt.addListener("clearRepeatableFields",me=>{me===(l==null?void 0:l.uuid)&&(k(""),L(0),e.isValid=0)}),le=Zt.addListener("onSubmitUserForm",()=>{var me;(me=e==null?void 0:e.attributes)!=null&&me.required?I?e.isValid=1:e.isValid=0:e.isValid=1}),De=Zt.addListener("OnInvalidFieldCatch",me=>{e.uuid===(me==null?void 0:me.fieldId)?L(1):L(0)}),_e=Zt.addListener("OnGetFieldValue",me=>{var Ie;const Se=(Ie=me==null?void 0:me.repeatableColumn)==null?void 0:Ie.filter($=>($==null?void 0:$.fieldUuid)===(e==null?void 0:e.uuid));Se!=null&&Se.length}),be=Zt.addListener("onUpdateField",()=>{pe(!re)});return()=>{be.remove(),le.remove(),De.remove(),_e.remove(),G.remove()}});const ne=G=>{var _e,be;k(G.target.value);const le=x,De=_t.cloneDeep(v);if(le!==null){if((_e=G==null?void 0:G.target)!=null&&_e.value){if(De[e==null?void 0:e.uuid]=(be=G==null?void 0:G.target)==null?void 0:be.value,(le==null?void 0:le.length)>0)for(const me of le)me.fieldId===t.field.uuid&&(me.postData[0]={postValue:G.target.value})}else if(delete De[e==null?void 0:e.uuid],(le==null?void 0:le.length)>0)for(const me of le)me.fieldId===t.field.uuid&&(me.postData[0]={postValue:""})}if(!(l!=null&&l.rowIsRepeatable)){A(De);const me=Object.keys(De).length;w(me)}},K=o.jsxs("div",{onMouseOver:Z,onMouseOut:Q,children:[!u&&!f&&O&&o.jsx(Xr,{handleFieldSettingsSidebar:fe,...t}),o.jsxs("div",{className:`field ${f?" ":" builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0?"card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:f?"col-12 ":"col-12 field-form-builder ",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(W=e==null?void 0:e.headerText)==null?void 0:W[h==null?void 0:h.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:n,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(ds,{...t}),((de=e==null?void 0:e.attributes)==null?void 0:de.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",f?o.jsx(o.Fragment,{children:(ve=e==null?void 0:e.label)==null?void 0:ve[h==null?void 0:h.type]}):o.jsx(as,{...t}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(Mi,{message:(Te=e==null?void 0:e.toolTip)==null?void 0:Te[h==null?void 0:h.type],position:"right"})})]}),o.jsx(fo,{rows:e==null?void 0:e.textareaRows,cols:e==null?void 0:e.textareaCols,autoResize:e==null?void 0:e.resizable,id:e==null?void 0:e.uuid,placeholder:(ye=e==null?void 0:e.placeholder)==null?void 0:ye[h==null?void 0:h.type],value:I,onFocus:()=>L(1),onChange:G=>{l!=null&&l.rowIsRepeatable?te(r,i,e,G.target.value):ne(G)},className:P===1&&((Ae=e==null?void 0:e.attributes)!=null&&Ae.required)?I?"valid":"invalid":"valid",readOnly:c}),o.jsx("div",{children:((J=e==null?void 0:e.attributes)==null?void 0:J.required)&&o.jsx("small",{className:"error",children:P===1&&!I?(U=e==null?void 0:e.validationMesssage)==null?void 0:U[h==null?void 0:h.type]:""})}),o.jsx("div",{children:(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(ae=e==null?void 0:e.helperText)==null?void 0:ae[h==null?void 0:h.type]})})]})}),d&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[S===!0&&o.jsx(Wi,{visibilty:S,closeSettingFieldSidebar:Y,...t},e==null?void 0:e.uuid),o.jsx(Si,{...t,fieldWrap:K})]})},jle={},Ib=t=>{var I,k,P,L;const{isAdmin:e,isAdvanceView:n,isPreview:r}=Jt(),{handleDrop:i}=an(),{data:s,path:a,pageIndex:l,sectionIndex:c,rowIndex:u,columnIndex:d,conditionIndex:f,ruleIndex:h,condition:g,page:m,section:v,row:A,column:w}=t,E=M.useRef(null),[{isDragging:x},C]=is({type:fT,item:{type:fT,uuid:s.uuid,children:s.children,path:a},collect:V=>({isDragging:V.isDragging()})}),S=x?0:1;C(E);const _=(V,z,O,q,re,pe,Z)=>{const Q=t!=null&&t.fieldContainer?t==null?void 0:t.fieldContainer:"inline-condition-container";return o.jsx(eu,{type:"inline-conditional",field:V,data:V,path:z,page:m,section:v,row:A,column:w,pageIndex:O,sectionIndex:q,rowIndex:re,columnIndex:pe,fieldIndex:Z,isAdmin:e,fieldContainer:Q},V.uuid)};return o.jsxs("div",{ref:r===!1?E:null,style:{...jle,opacity:S},className:"draggable column",children:[g&&((I=g.children)==null?void 0:I.length)===0&&o.jsx("p",{className:"text-primary text-center",children:"Drag item here"}),g&&g.children&&((k=g.children)==null?void 0:k.length)>0&&g.children.map((V,z)=>{var O;return o.jsxs(M.Fragment,{children:[r===!1&&o.jsx(Fr,{isAdvanceView:n,data:{path:`${a}-${h}-${f}-${z}`,childrenCount:(O=g==null?void 0:g.children)==null?void 0:O.length,droppedField:g},onDrop:i}),_(V,`${a}-${h}-${f}-${z}`,l,c,u,d,z)]},V.uuid)}),r===!1&&o.jsx(Fr,{isAdvanceView:n,fieldDropArea:!0,data:{path:`${a}-${h}-${f}-${(P=g==null?void 0:g.children)==null?void 0:P.length}`,childrenCount:(L=g==null?void 0:g.children)==null?void 0:L.length,droppedField:g},onDrop:i,isLast:!0})]})},u0=t=>{const{inputValue:e,condition:n,ruleIndex:r,conditionIndex:i,field:s,section:a,page:l,row:c,pageIndex:u,sectionIndex:d,rowIndex:f,columnIndex:h,isConditionTrue:g}=t,{taskRegisterData:m,updateUserFormDataSubmit:v,userTaskSubmitFormData:A,updateProgressDataValuesHook:w}=vr(),E=M.useCallback((x,C,S)=>{var I,k,P;const _=A;if(_!=null&&_.length){const L=m,V=(I=s==null?void 0:s.inlineConditionalRules)==null?void 0:I.rules[C].conditions[S].children;for(const[O,q]of V.entries()){(k=q==null?void 0:q.attributes)!=null&&k.required;const re=_t.findIndex(_,function(pe){return pe.fieldId===q.uuid});x?re===-1&&(_.push({postData:[],tabId:l.uuid,tabIndex:u,...s.inlineConditionalRules?{inlineConditionalRules:s.inlineConditionalRules}:{},...s.conditionalTabRules?{conditionalTabRules:s.conditionalTabRules}:{},...s.conditionalSectionRules?{conditionalSectionRules:s.conditionalSectionRules}:{},sectionId:a.uuid,sectionIndex:d,sectionHeading:a.heading,subHeadingText:a.subHeadingText,reviewerChecklist:s==null?void 0:s.reviewerChecklist,rowId:c.uuid,rowIndex:f,columnId:a.uuid,columnIndex:h,inlineConditionalField:!0,fieldIndex:O,fieldId:q.uuid,fieldInputType:s.componentType,fieldTitle:(P=s.label)==null?void 0:P.english,fieldDescription:s.description||null,fieldHelperText:s.helperText||null,fieldHeaderText:s.headerText||null,fieldFooterText:s.footerText||null,fieldTitleAbb:s.abbreviationLabel||s.label,question_abb_table:s.textForTable||null,language:"english",isHiddenfield:s.isHidden&&s.isHidden===1?1:0,isHiddenSection:a.isHidden&&a.isHidden===1?1:0}),L[q==null?void 0:q.uuid]&&delete L[q==null?void 0:q.uuid]):(L[q==null?void 0:q.uuid]&&delete L[q==null?void 0:q.uuid],re>=0&&_.splice(re,1))}const z=Object.keys(L).length;w({progressMaxValue:_==null?void 0:_.length,progressValue:z}),v(_)}},[h,s.abbreviationLabel,s.componentType,s.conditionalSectionRules,s.conditionalTabRules,s.description,s.footerText,s.headerText,s.helperText,s.inlineConditionalRules,s.isHidden,s.label,s==null?void 0:s.reviewerChecklist,s.textForTable,l.uuid,u,c.uuid,f,a.heading,a.isHidden,a.subHeadingText,a.uuid,d,m,w,v,A]);return M.useEffect(()=>(E(g,r,i),()=>{}),[i,e,g,r,E]),o.jsx("div",{children:g&&o.jsx("div",{className:"p-field p-pt-2",children:o.jsx(o.Fragment,{children:o.jsx(Ib,{...t,ruleIndex:r,conditionIndex:i,condition:n,data:s})})},i)})};function L2(t){"@babel/helpers - typeof";return L2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},L2(t)}function zle(t,e){if(L2(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(L2(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Hle(t){var e=zle(t,"string");return L2(e)=="symbol"?e:e+""}function _b(t,e,n){return(e=Hle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Yle={value:"p-tag-value",icon:"p-tag-icon",root:function(e){var n=e.props;return gt("p-tag p-component",_b(_b({},"p-tag-".concat(n.severity),n.severity!==null),"p-tag-rounded",n.rounded))}},Kle=`
|
|
2382
2382
|
@layer primereact {
|
|
2383
2383
|
.p-tag {
|
|
2384
2384
|
display: inline-flex;
|
|
@@ -54486,7 +54486,7 @@ const $i = (t) => {
|
|
|
54486
54486
|
return /* @__PURE__ */ c(we, { children: /* @__PURE__ */ I(
|
|
54487
54487
|
"div",
|
|
54488
54488
|
{
|
|
54489
|
-
className: `${(e == null ? void 0 : e.componentType) !== "hidden-field" && (e == null ? void 0 : e.componentType) !== "image" && (e == null ? void 0 : e.componentType) !== "quiz" && (e == null ? void 0 : e.componentType) !== "document" && (e == null ? void 0 : e.componentType) !== "href" && (e == null ? void 0 : e.componentType) !== "paragraph" && (e == null ? void 0 : e.componentType) !== "heading" && (e == null ? void 0 : e.componentType) !== "list" && (e == null ? void 0 : e.componentType) !== "hr" && (e == null ? void 0 : e.componentType) !== "image-gallery" && (e == null ? void 0 : e.componentType) !== "video" && (e == null ? void 0 : e.componentType) !== "question"
|
|
54489
|
+
className: `${(e == null ? void 0 : e.componentType) !== "hidden-field" && (e == null ? void 0 : e.componentType) !== "image" && (e == null ? void 0 : e.componentType) !== "quiz" && (e == null ? void 0 : e.componentType) !== "document" && (e == null ? void 0 : e.componentType) !== "href" && (e == null ? void 0 : e.componentType) !== "paragraph" && (e == null ? void 0 : e.componentType) !== "heading" && (e == null ? void 0 : e.componentType) !== "list" && (e == null ? void 0 : e.componentType) !== "hr" && (e == null ? void 0 : e.componentType) !== "image-gallery" && (e == null ? void 0 : e.componentType) !== "video" && (e == null ? void 0 : e.componentType) !== "question", "builder-element-quick-options mb-2 w-3 justify-content-center"} flex quick-setting`,
|
|
54490
54490
|
children: [
|
|
54491
54491
|
/* @__PURE__ */ c(we, { children: (e == null ? void 0 : e.componentType) !== "hidden-field" && (e == null ? void 0 : e.componentType) !== "document" && (e == null ? void 0 : e.componentType) !== "quiz" && (e == null ? void 0 : e.componentType) !== "image" && (e == null ? void 0 : e.componentType) !== "href" && (e == null ? void 0 : e.componentType) !== "paragraph" && (e == null ? void 0 : e.componentType) !== "heading" && (e == null ? void 0 : e.componentType) !== "list" && (e == null ? void 0 : e.componentType) !== "hr" && (e == null ? void 0 : e.componentType) !== "image-gallery" && (e == null ? void 0 : e.componentType) !== "video" && (e == null ? void 0 : e.componentType) !== "question" && d === !1 && /* @__PURE__ */ I("div", { className: " ", children: [
|
|
54492
54492
|
/* @__PURE__ */ c(
|
|
@@ -57905,7 +57905,7 @@ var jue = function() {
|
|
|
57905
57905
|
theme: i.theme,
|
|
57906
57906
|
formats: i.formats
|
|
57907
57907
|
};
|
|
57908
|
-
jue ? w(new Quill(d.current, V)) : import("./quill-
|
|
57908
|
+
jue ? w(new Quill(d.current, V)) : import("./quill-DOES3GuC.js").then(function(z) {
|
|
57909
57909
|
if (z && Se.isExist(d.current)) {
|
|
57910
57910
|
var N;
|
|
57911
57911
|
z.default ? N = new z.default(d.current, V) : N = new z(d.current, V), w(N);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Bl = Object.defineProperty;
|
|
2
2
|
var Ml = (n, t, e) => t in n ? Bl(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
3
|
var T = (n, t, e) => Ml(n, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
-
import { d as ti, i as Rr, a as Hi, b as Dl, e as Br, M as Ul, S as ei, U as si, g as ni, c as ri, f as fr, h as zs, j as $i, k as Vs, l as dr, m as Pl, n as jl, o as Fi, p as Hl, q as $l, r as Fl, s as zl, t as ii, u as Kl, v as Gl, w as Ft, x as zi, y as xe } from "./main-
|
|
4
|
+
import { d as ti, i as Rr, a as Hi, b as Dl, e as Br, M as Ul, S as ei, U as si, g as ni, c as ri, f as fr, h as zs, j as $i, k as Vs, l as dr, m as Pl, n as jl, o as Fi, p as Hl, q as $l, r as Fl, s as zl, t as ii, u as Kl, v as Gl, w as Ft, x as zi, y as xe } from "./main-C9y-C8go.js";
|
|
5
5
|
function Ki(n) {
|
|
6
6
|
return n;
|
|
7
7
|
}
|