cft-builder 0.2.336 → 0.2.337

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.
@@ -1,4 +1,4 @@
1
- import { E as s, D as o, F as a, G as d, R as i, T as u, C as m, A as B, z as k, B as l } from "./main-CDahdulO.js";
1
+ import { E as s, D as o, F as a, G as d, R as i, T as u, C as m, A as B, z as k, B as l } from "./main-Ddyqppzv.js";
2
2
  export {
3
3
  s as BuilderItems,
4
4
  o as BuilderItemsRender,
@@ -2286,7 +2286,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2286
2286
  position: relative;
2287
2287
  }
2288
2288
  }
2289
- `}}),ii=b.forwardRef(function(t,e){var n=Kn(),r=b.useContext(ar),i=_3.getProps(t,r),a=b.useState(i.id),s=pN(a,2),l=s[0],c=s[1],u=b.useState(i.collapsed),d=pN(u,2),f=d[0],h=d[1],g=b.useRef(null),v=b.useRef(null),m=i.toggleable?i.onToggle?i.collapsed:f:!1,A=l+"_header",w=l+"_content",C=_3.setMetaData({props:i,state:{id:l,collapsed:m}}),x=C.ptm,T=C.cx,S=C.isUnstyled;ci(_3.css.styles,S,{name:"panel"});var E=function(X){i.toggleable&&(m?_(X):M(X),X&&(i.onToggle&&i.onToggle({originalEvent:X,value:!m}),X.preventDefault()))},_=function(X){i.onToggle||h(!1),i.onExpand&&X&&i.onExpand(X)},M=function(X){i.onToggle||h(!0),i.onCollapse&&X&&i.onCollapse(X)};b.useImperativeHandle(e,function(){return{props:i,toggle:E,expand:_,collapse:M,getElement:function(){return g.current},getContent:function(){return v.current}}}),Li(function(){l||c(So())});var N=function(){if(i.toggleable){var X=l+"_label",ce=n({className:T("toggler"),onClick:E,id:X,"aria-controls":w,"aria-expanded":!m,type:"button",role:"button","aria-label":i.header},x("toggler")),Y=n(x("togglericon")),ae=m?i.expandIcon||b.createElement(Mm,Y):i.collapseIcon||b.createElement(n8,Y),re=nr.getJSXIcon(ae,Y,{props:i,collapsed:m});return b.createElement("button",ce,re,b.createElement(Qt,null))}return null},F=function(){var X=ke.getJSXElement(i.header,i),ce=ke.getJSXElement(i.icons,i),Y=N(),ae=n({id:A,className:T("title")},x("title")),re=b.createElement("span",ae,X),Z=n({className:T("icons")},x("icons")),K=b.createElement("div",Z,ce,Y),W=n({className:T("header")},x("header")),ge=b.createElement("div",W,re,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:E,titleElement:re,iconsElement:K,togglerElement:Y,element:ge,id:l+"_header",props:i,collapsed:m};return ke.getJSXElement(i.headerTemplate,ve)}else if(i.header||i.toggleable)return ge;return null},P=function(){var X=ke.getJSXElement(i.footer,i),ce=n({className:T("footer")},x("footer")),Y=b.createElement("div",ce,X);if(i.footerTemplate){var ae={className:T("footer"),element:Y,props:i};return ke.getJSXElement(i.footerTemplate,ae)}else if(i.footer)return Y;return null},H=function(){var X=n({ref:v,className:T("toggleableContent"),"aria-hidden":m,role:"region",id:w,"aria-labelledby":A},x("toggleablecontent")),ce=n({className:T("content")},x("content")),Y=n({classNames:T("transition"),timeout:{enter:1e3,exit:450},in:!m,unmountOnExit:!0,options:i.transitionOptions},x("transition"));return b.createElement(Ro,v7({nodeRef:v},Y),b.createElement("div",X,b.createElement("div",ce,i.children)))},O=n({id:l,ref:g,style:i.style,className:ft(i.className,T("root"))},_3.getOtherProps(i),x("root")),j=F(),U=H(),le=P();return b.createElement("div",O,j,U,le)});ii.displayName="Panel";const ese=t=>{var v;const{fieldState:e,setFieldState:n,pageIndex:r,formBuilderFormLayout:i,pageSettingUpdate:a}=t,s=(m,A)=>{const w=`${m.className} justify-content-start`,C=`${m.titleClassName} pl-1`;return o.jsxs("div",{className:w,children:[o.jsx(Ot,{text:!0,icon:"pi pi-trash",className:m.togglerClassName,onClick:()=>c(A),"aria-label":"Submit"}),o.jsx("span",{className:C,children:`Rule ${A+1}`})]})},l=(m,A)=>{var C;const w=[...((C=e==null?void 0:e.conditionalTabRules)==null?void 0:C.rules)||[]];w[m].conditions=w[m].conditions.filter((x,T)=>A!==T),n(x=>({...x,conditionalTabRules:{...x.conditionalTabRules,rules:w}}))},c=m=>{var x;const A=[...(e==null?void 0:e.conditionalTabRules.rules)||[]],w=A.filter((T,S)=>m!==S);n(T=>({...T,conditionalTabRules:{...T.conditionalTabRules,rules:w}}));const C=A[m];(x=C==null?void 0:C.conditions)==null||x.map(T=>{const S=i?_t.findIndex(i,_=>{var M;return(_==null?void 0:_.uuid)===((M=T==null?void 0:T.tab)==null?void 0:M.uuid)}):-1,E=i[S];E&&(E.isHidden=!1,a(S,E))})};let u=[...i].filter(function(m,A){return A!==r});u.map(m=>({uuid:m==null?void 0:m.uuid,title:m==null?void 0:m.title}));const d=(m,A,w)=>{const C=[...(e==null?void 0:e.conditionalTabRules.rules)||[]];C[A].conditions[w].option=m==null?void 0:m.value,n(x=>({...x,conditionalTabRules:{...x.conditionalTabRules,rules:C}}))},f=(m,A,w)=>{const C=[...(e==null?void 0:e.conditionalTabRules.rules)||[]];C[A].conditions[w].tab=m==null?void 0:m.value,n(S=>({...S,conditionalTabRules:{...S.conditionalTabRules,rules:C}}));const x=_t.findIndex(i,S=>{var E;return(S==null?void 0:S.uuid)===((E=m==null?void 0:m.value)==null?void 0:E.uuid)}),T=i[x];T&&(T.isHidden=!0,a(x,T))},h=()=>{n(m=>({...m,conditionalTabRules:{...m.conditionalTabRules,rules:[...m.conditionalTabRules.rules,{conditions:[]}]}}))},g=m=>{const A=[...(e==null?void 0:e.conditionalTabRules.rules)||[]];A[m].conditions=[...A[m].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&&((v=e==null?void 0:e.conditionalTabRules)==null?void 0:v.rules.map((m,A)=>o.jsx(ii,{className:"mb-3",header:`Rule ${A+1}`,headerTemplate:w=>s(w,A),children:o.jsxs("div",{children:[m==null?void 0:m.conditions.map((w,C)=>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(Pa,{value:w.tab,options:u,onChange:x=>f(x,A,C),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(Pa,{value:w==null?void 0:w.option,options:e==null?void 0:e.options,onChange:x=>d(x,A,C),optionLabel:"optionText.english",placeholder:"Select option"})}),o.jsx("div",{className:"col-1",children:o.jsx(Ot,{text:!0,icon:"pi pi-trash",className:"p-button-danger button-sm",tooltip:"Field Settings",onClick:()=>l(A,C),tooltipOptions:{position:"top"}})})]})},C)),o.jsx(Ot,{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(Ot,{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"})]})},tse=t=>{var x;const{fieldState:e,setFieldState:n,section:r,formBuilderFormLayout:i,sectionSettingUpdate:a,page:s}=t,[l]=k.useState([]),{schemaBuilderUpdate:c,formBuilderFormSchema:u}=sn(),d=(T,S)=>{const E=`${T.className} justify-content-start`,_=`${T.titleClassName} pl-1`;return o.jsxs("div",{className:E,children:[o.jsx(Ot,{text:!0,icon:"pi pi-trash",className:T.togglerClassName,onClick:()=>f(S),"aria-label":"Submit"}),o.jsx("span",{className:_,children:`Rule ${S+1}`})]})},f=T=>{var M;const S=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]],E=S[T];(M=E==null?void 0:E.conditions)==null||M.map(N=>{var H;const F=_t.findIndex(i,O=>{var j;return(O==null?void 0:O.uuid)===((j=N==null?void 0:N.tab)==null?void 0:j.uuid)}),P=i?_t.findIndex(i[F].children,O=>{var j;return(O==null?void 0:O.uuid)===((j=N==null?void 0:N.section)==null?void 0:j.uuid)}):-1;if(P>=0){const O=(H=i[F])==null?void 0:H.children[P];O&&(O.isHidden=!1,a(F,P,O))}});const _=S.filter((N,F)=>T!==F);n(N=>({...N,conditionalSectionRules:{...N.conditionalSectionRules,rules:_}}))},h=T=>{var _;let S=!1;const E=i?i.filter(function(M){return(M==null?void 0:M.uuid)===(T==null?void 0:T.uuid)}):[];return(E==null?void 0:E.length)>0&&((_=E[0].children)==null?void 0:_.length)>1&&(S=!0),S},g=(T,S,E)=>{const _=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];_[S].conditions[E].option=T==null?void 0:T.value,n(M=>({...M,conditionalSectionRules:{...M.conditionalSectionRules,rules:_}}))},v=(T,S)=>{var M;const E=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]],_=E[T];(M=_==null?void 0:_.conditions)==null||M.map(N=>{var O;const F=_t.findIndex(i,j=>{var U;return(j==null?void 0:j.uuid)===((U=N==null?void 0:N.tab)==null?void 0:U.uuid)}),P=i?_t.findIndex(i[F].children,j=>{var U;return(j==null?void 0:j.uuid)===((U=N==null?void 0:N.section)==null?void 0:U.uuid)}):-1,H=(O=i[F])==null?void 0:O.children[P];console.log("sectionData",H),H&&(H.isHidden=!1,console.log("sectionData",H),a(F,P,H))}),E[T].conditions=E[T].conditions.filter((N,F)=>S!==F),n(N=>({...N,conditionalSectionRules:{...N.conditionalSectionRules,rules:E}}))},m=(T,S,E)=>{var H,O;const _=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];_[S].conditions[E].section=T==null?void 0:T.value;const M=(O=(H=_[S].conditions[E])==null?void 0:H.tab)==null?void 0:O.uuid,N=_t.findIndex(i,j=>(j==null?void 0:j.uuid)===M);n(j=>({...j,conditionalSectionRules:{...j.conditionalSectionRules,rules:_}}));const F=i?_t.findIndex(i[N].children,j=>{var U;return(j==null?void 0:j.uuid)===((U=T==null?void 0:T.value)==null?void 0:U.uuid)}):-1,P=i[N].children[F];P&&(P.isHidden=!0,a(N,F,P))},A=T=>{const S=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];S[T].conditions=[...S[T].conditions,{option:null,tab:{title:s==null?void 0:s.title,uuid:s==null?void 0:s.uuid},section:null}],n(E=>({...E,conditionalSectionRules:{...E.conditionalSectionRules,rules:S}}))},w=()=>{n(S=>({...S,conditionalSectionRules:{...S.conditionalSectionRules,rules:[...S.conditionalSectionRules.rules,{uuid:nt(),conditions:[]}]}}));const T=[...(u==null?void 0:u.conditionalSectionsRules)||[]];c({conditionalSectionsRules:[...T,{fieldId:e==null?void 0:e.uuid,uuid:nt(),conditions:[]}]})},C=T=>{var E;const S=i==null?void 0:i.filter(function(_){return(_==null?void 0:_.uuid)===(T==null?void 0:T.uuid)});if(S&&(S==null?void 0:S.length)>0){const _=(E=S[0])==null?void 0:E.children.filter(function(M){return(M==null?void 0:M.uuid)!==(r==null?void 0:r.uuid)});if((_==null?void 0:_.length)>0)return _}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((T,S)=>o.jsx(ii,{className:"mb-3",header:`Rule ${S+1}`,headerTemplate:E=>d(E,S),children:o.jsxs("div",{children:[T==null?void 0:T.conditions.map((E,_)=>{var M,N;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:(N=(M=E==null?void 0:E.tab)==null?void 0:M.title)==null?void 0:N.english})]}),o.jsxs("div",{className:"col-3 p-fluid",children:[o.jsxs("label",{children:["Select section",E.value]}),o.jsx(Pa,{disabled:!h(E==null?void 0:E.tab),value:E.section,options:C(E.tab),onChange:F=>m(F,S,_),optionLabel:"heading.english",placeholder:"Select option"})]}),o.jsxs("div",{className:"col-4 p-fluid",children:["when option is selected",o.jsx(Pa,{disabled:!h(E==null?void 0:E.tab),value:E==null?void 0:E.option,options:e==null?void 0:e.options,onChange:F=>g(F,S,_),optionLabel:"optionText.english",placeholder:"Select option"})]}),o.jsxs("div",{className:"col-1",children:[o.jsx("br",{}),o.jsx(Ot,{text:!0,icon:"pi pi-trash",className:"p-button-danger button-sm",tooltip:"Field Settings",onClick:()=>v(S,_),tooltipOptions:{position:"top"}})]}),!h(E.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"]})})]})},_)}),o.jsx("div",{children:o.jsx("div",{className:"flex",children:o.jsx(Ot,{text:!0,className:"btn-sm mt-3 ",label:"+ Add Condition",onClick:()=>A(S),size:"small"})})})]})},S)),o.jsx(Ot,{text:!0,icon:"pi pi-plus",onClick:()=>w(),className:"p-mt-4",label:"Add Rule",size:"small"})]})},nse=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((v,m)=>d!==m);n(v=>({...v,inlineConditionalRules:{...v.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(Ot,{text:!0,icon:"pi pi-trash",className:d.togglerClassName,onClick:()=>r(f),"aria-label":"Submit"}),o.jsx("span",{className:g,children:`Rule ${f+1}`})]})},a=(d,f,h)=>{const g=[...(e==null?void 0:e.inlineConditionalRules.rules)||[]];g[f].conditions[h].value=d==null?void 0:d.value,n(v=>({...v,inlineConditionalRules:{...v.inlineConditionalRules,rules:g}}))},s=(d,f)=>{const h=[...(e==null?void 0:e.inlineConditionalRules.rules)||[]];h[d].conditions=h[d].conditions.filter((g,v)=>f!==v),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(ii,{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(Pa,{value:h.value,options:e==null?void 0:e.options,onChange:v=>a(v,f,g),optionLabel:"optionText.english",placeholder:"Select option"})}),o.jsx("div",{className:"col-1",children:o.jsx(Ot,{text:!0,icon:"pi pi-trash",className:"p-button-danger button-sm",tooltip:"Field Settings",onClick:()=>s(f,g),tooltipOptions:{position:"top"}})})]})},"inline-rules-"+g)),o.jsx(Ot,{text:!0,onClick:()=>l(f),className:"p-mt-4",icon:"pi pi-plus",label:"Add Condition",size:"small"})]})},f)),o.jsx(Ot,{text:!0,onClick:()=>c(),className:"p-mt-4",icon:"pi pi-plus",label:"Add Rule",size:"small"})]})},rse=t=>{const{fieldState:e,pageIndex:n,section:r,setFieldState:i,page:a}=t,{pageSettingUpdate:s,formBuilderFormLayout:l,sectionSettingUpdate:c}=sn();return o.jsx(o.Fragment,{children:o.jsxs("div",{className:" scroll-height-250",children:[o.jsx(nse,{fieldState:e,setFieldState:i}),o.jsx("hr",{}),o.jsx(ese,{fieldState:e,setFieldState:i,pageIndex:n,formBuilderFormLayout:l,pageSettingUpdate:s}),o.jsx("hr",{}),o.jsx(tse,{fieldState:e,setFieldState:i,section:r,formBuilderFormLayout:l,sectionSettingUpdate:c,page:a}),o.jsx("hr",{})]})})},ise=t=>{const{fieldState:e,setFieldState:n}=t,[r,i]=k.useState(""),[a,s]=k.useState([""]),[l,c]=k.useState(!1),[u,d]=k.useState(0),[f,h]=k.useState(!1),{updateGlobalToast:g}=Ht(),v=()=>{h(!0)},m=()=>{var j;const H=((j=e==null?void 0:e.reviewerChecklist)==null?void 0:j.length)>=0?[...e.reviewerChecklist]:[];H.push({uuid:nt(),checklist:r,action:a,agree:null,selectAction:[],other:{isOther:!1,description:""},reviewerComments:""});const O={...e,reviewerChecklist:H};n(U=>({...U,...O})),h(!1),i(""),s([""])},A=()=>{h(!1),i(""),s([""])},w=H=>{const O=[...e.reviewerChecklist];O.splice(H,1);const j={...e,reviewerChecklist:O};n(U=>({...U,...j}))},C=(H,O)=>{c(!0);const{checklist:j,action:U}=H;h(!0),d(O),setTimeout(()=>{i(j),s(U)},1e3)},x=(H,O)=>o.jsxs(o.Fragment,{children:[o.jsx(Ot,{text:!0,type:"button",className:"p-button-info",icon:"pi pi-pencil",onClick:()=>C(H,O==null?void 0:O.rowIndex)}),o.jsx(Ot,{text:!0,type:"button",className:"p-button-danger",icon:"pi pi-trash",onClick:()=>w(O==null?void 0:O.rowIndex)})]}),T=H=>{var O;return o.jsx(o.Fragment,{children:(O=H==null?void 0:H.action)==null?void 0:O.length})},S=H=>{const O=[...a];O.splice(H,1),s(O)},E=()=>{const H=[...e.reviewerChecklist];H[u]={checklist:r,action:a};const O={...e,reviewerChecklist:H};n(j=>({...j,...O})),h(!1),c(!1)},_=()=>o.jsx("div",{children:l?o.jsx(Ot,{text:!0,className:"mb-5 p-button-success",label:"Edit Checklist",onClick:()=>{E()}}):o.jsx(Ot,{text:!0,className:"mb-5 p-button-success",label:"Add Checklist",onClick:()=>{m()}})}),M=H=>{n(O=>({...O,reviewerChecklist:H==null?void 0:H.value}))},N=H=>{navigator.clipboard.writeText(JSON.stringify(H))};function F(H){try{JSON.parse(H)}catch{return!1}return!0}const P=async()=>{var j;const H=await navigator.clipboard.readText();let O="";if(F(H)){const U=JSON.parse(H);if((j=U[0])!=null&&j.checklist){const le={..._t.cloneDeep(e),reviewerChecklist:U};n(R=>({...R,...le}));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(Os,{maximizable:!0,header:"Add Checklist options for admin to reveiw",visible:f,style:{width:"30vw"},onHide:()=>A(),footer:_(),children:o.jsxs("div",{className:"scroll-height-500",children:[o.jsx("h5",{children:"Checklist"}),o.jsx(so,{rows:2,cols:50,value:r,onChange:H=>{var O;i((O=H==null?void 0:H.target)==null?void 0:O.value)}}),o.jsx("h5",{children:"Actions when admin selects NO as invalid"}),a.map((H,O)=>o.jsxs("div",{children:[O+1,"."," ",o.jsx(so,{value:H,onChange:j=>{var le;const U=[...a];U[O]=(le=j==null?void 0:j.target)==null?void 0:le.value,s(U)},rows:2,cols:50})," ",o.jsx(Ot,{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(Ot,{outlined:!0,className:" p-button-primary mr-2",onClick:()=>{s([...a,""])},children:"Add Action"})]})})," ",o.jsx("h5",{children:"Reviewer Checklist"}),o.jsx(Ot,{className:"mb-5 mr-2 p-button-success",label:"Add Review Checklist",onClick:()=>{v()}}),o.jsx(Ot,{outlined:!0,label:"Copy Schema ",onClick:()=>{N([...(e==null?void 0:e.reviewerChecklist)||[]])},className:"mb-5 mr-2"}),o.jsx(Ot,{outlined:!0,label:"Paste Checklist ",onClick:()=>{P()},className:"mb-5 p-button-info"}),o.jsx("div",{className:"card",children:o.jsxs(ro,{value:e==null?void 0:e.reviewerChecklist,reorderableRows:!0,onRowReorder:M,scrollable:!0,children:[o.jsx(Sr,{rowReorder:!0,style:{width:"3em"}}),o.jsx(Sr,{field:"checklist",header:"Checklist"}),o.jsx(Sr,{field:"actions",header:"Actions",body:H=>T(H)}),o.jsx(Sr,{header:"",body:(H,O)=>x(H,O)})]})})]})},ase=t=>{const{onHandleChangeLayoutSettings:e,fieldState:n}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Yr,{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(Yr,{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(Yr,{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(Yr,{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(Yr,{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(Yr,{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(Yr,{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}})]})]})},sse=t=>{var c,u,d;const{fieldState:e,setFieldState:n}=t,{formBuilderSchemaLanguages:r}=sn(),i=()=>{n(f=>Object.assign({},f,{options:[...f.options,{uuid:nt(),optionText:{english:""},value:"",score:0,hyperlinkText:{english:""},abbreviationText:{english:""},custom_values:{}}]}))},a=f=>{n(h=>({...h,fieldType:{...h==null?void 0:h.fieldType,type:f}}))},s=(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(ia,{inputId:"renderType1",name:"renderType",value:"radio",onChange:f=>{a(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(ia,{inputId:"renderType2",name:"renderType",value:"dropdown",onChange:f=>{a(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(ia,{inputId:"dataSourceType1",name:"dataSourceType",value:"custom",onChange:f=>{s("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(ia,{inputId:"dataSourceType2",name:"dataSourceType",value:"database",onChange:f=>{s("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(Pa,{value:e==null?void 0:e.dataSource,onChange:f=>{var h;s("optionLabel",(h=f.value)==null?void 0:h.optionLabel),s("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(Pa,{value:e==null?void 0:e.optionValue,onChange:f=>s("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(ao,{activeIndex:0,children:r!=null&&r.length?r.map((f,h)=>o.jsx(io,{tabIndex:h,header:f==null?void 0:f.language,children:o.jsx(fN,{enableCopyPaste:!0,isCustomValue:!0,fieldState:e,setFieldState:n,language:f})},h)):""})}),o.jsx(Ot,{text:!0,className:"mr-3",label:"Add",icon:"pi pi-plus",onClick:()=>i(),"aria-label":"Add"})]})})]})},ose=t=>{var u,d;const{option:e,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a}=t,{userSelectedLanguage:s}=sn(),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(Ot,{text:!0,icon:"pi pi-trash",size:"small",onClick:()=>{console.log("field",h==null?void 0:h.uuid),a(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(Yr,{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(Ot,{text:!0,label:"Add Field",onClick:()=>{i(e==null?void 0:e.uuid)}}),o.jsx(ss,{children:((u=e.children)==null?void 0:u.length)&&((d=e.children)==null?void 0:d.map((f,h)=>{var g,v;return o.jsx(Cr,{header:(g=f.label)==null?void 0:g[s==null?void 0:s.type],headerTemplate:m=>c(m,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(m=>o.jsxs("div",{className:"mr-3",children:[o.jsx(ia,{inputId:"ingredient1",name:"fieldType",value:m==null?void 0:m.type,onChange:()=>r(f==null?void 0:f.uuid,{type:m==null?void 0:m.type}),checked:(f==null?void 0:f.type)===(m==null?void 0:m.type)}),o.jsx("label",{htmlFor:"ingredient1",className:"ml-2",children:m==null?void 0:m.label})]},`field_type_${f==null?void 0:f.uuid}`)))}),o.jsxs("div",{className:"field-checkbox mt-3",children:[o.jsx(Yr,{inputId:"isRequired",onChange:m=>{r(f==null?void 0:f.uuid,{attributes:{required:m.checked}})},checked:(v=f==null?void 0:f.attributes)==null?void 0:v.required}),o.jsxs("label",{htmlFor:"showConditionalFields",children:["Is Required"," "]})]}),o.jsxs(ss,{children:[o.jsx(Cr,{header:"Text",children:o.jsx(ii,{header:"Text Settings",toggleable:!0,collapsed:!0,children:o.jsx("div",{className:"",children:o.jsx(nD,{language:s,fieldState:f,onHandleChange:(m,A,w)=>{r(f==null?void 0:f.uuid,{[m]:{[A==null?void 0:A.type]:w}})}})})})}),(f==null?void 0:f.type)==="radio"&&o.jsx(Cr,{header:"Radio",children:o.jsx("div",{style:{width:"100%"},children:o.jsx(b7,{option:e,fieldState:f,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a})})})]})]})},`field-tab-${h}-${f==null?void 0:f.uuid}-${e==null?void 0:e.uuid}`)}))})]})]})},b7=t=>{var s,l;const{fieldState:e,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a}=t;return o.jsx(o.Fragment,{children:o.jsx(ss,{children:((s=e==null?void 0:e.options)==null?void 0:s.length)&&((l=e==null?void 0:e.options)==null?void 0:l.map((c,u)=>o.jsx(Cr,{header:`Option - ${c==null?void 0:c.label}`,children:o.jsx(ose,{option:c,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a})},`hirarchey-option-${u}`)))})})};var gN={},lse=Fi&&Fi.__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 a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},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)}}(),D3=Fi&&Fi.__assign||function(){return D3=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},D3.apply(this,arguments)},cse=Fi&&Fi.__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]}),use=Fi&&Fi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),mN=Fi&&Fi.__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)&&cse(e,t,n);return use(e,t),e},dse=Fi&&Fi.__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},fse=Fi&&Fi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gN,"__esModule",{value:!0});var y7=mN(k),hse=fse(GI),Zu=mN(la);function vN(t){return t&&t.replace(/&nbsp;|\u202F|\u00A0/g," ").replace(/<br \/>/g,"<br>")}function pse(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 gse=function(t){lse(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}:y7.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 a=i.innerHTML;if(n.props.onChange&&a!==n.lastHtml){var s=Object.assign({},r,{target:{value:a}});n.props.onChange(s)}n.lastHtml=a}},n}return e.prototype.render=function(){var n=this,r=this.props,i=r.tagName,a=r.html,s=r.innerRef,l=dse(r,["tagName","html","innerRef"]);return y7.createElement(i||"div",D3(D3({},l),{ref:typeof s=="function"?function(c){s(c),n.el.current=c}:s||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:a}}),this.props.children)},e.prototype.shouldComponentUpdate=function(n){var r=this.props,i=this.getEl();return!i||vN(n.html)!==vN(i.innerHTML)?!0:r.disabled!==n.disabled||r.tagName!==n.tagName||r.className!==n.className||r.innerRef!==n.innerRef||r.placeholder!==n.placeholder||!(0,hse.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,pse(n))},e.propTypes={html:Zu.string.isRequired,onChange:Zu.func,disabled:Zu.bool,tagName:Zu.string,className:Zu.string,style:Zu.object,innerRef:Zu.oneOfType([Zu.object,Zu.func])},e}(y7.Component),N3=gN.default=gse;const mse=t=>{var w;const e=k.useRef(null),{field:n,fieldIndex:r,pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,path:c}=t,[u,d]=k.useState(n),{userSelectedLanguage:f,fieldSettingUpdate:h,fieldSettingUpdateInlineConditional:g,gridComponentFieldSettingUpdate:v}=sn(),m=(C,x,T)=>{d(S=>({...S,[C]:{...S[C],[x==null?void 0:x.type]:T}}))};k.useEffect(()=>(A(),()=>{}),[u]);const A=()=>{const C=c.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?g(C[fa],C[ha],C[Ca],C[xa],C[Ta],C[Fa],C[Xo],C[wo],u):(C==null?void 0:C.length)>Fa&&(C==null?void 0:C.length)===Bl+1&&(n!=null&&n.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?v(C[fa],C[ha],C[Ca],C[xa],C[Ta],C[5],C[6],C[7],u):h(i,a,s,l,r,{...n,label:u==null?void 0:u.label})};return o.jsx(o.Fragment,{children:o.jsx(N3,{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:C=>{var x;m("label",f,(x=C==null?void 0:C.target)==null?void 0:x.value)},tagName:"article"})})},ca=t=>{const{sectionIndex:e,fieldIndex:n}=t,{formBuilderFormSchema:r}=sn();return(r==null?void 0:r.enableFieldEnumeration)===!0?o.jsx("span",{className:"mr-2",children:o.jsx(F8,{classes:"font-medium p-1 bg-primary",level:"purple",value:`${e+1}.${n+1}`})}):o.jsx(o.Fragment,{})},A7=t=>{var f,h,g,v,m,A,w,C,x,T,S,E,_,M;const{field:e,update:n,value:r,isFirst:i,isDisabled:a}=t,{isBuilderMode:s,isAdmin:l}=Ht(),{selectedLanguage:c}=sn(),[u,d]=k.useState(0);return k.useEffect(()=>{const N=Gt.addListener("onSubmitUserForm",()=>{var P;(P=e==null?void 0:e.attributes)!=null&&P.required?r!=null&&r[e.uuid]?e.isValid=t3:e.isValid=D8:e.isValid=1}),F=Gt.addListener("OnInvalidFieldCatch",P=>{(e==null?void 0:e.uuid)===(P==null?void 0:P.fieldId)?d(N8):d(O8)});return()=>{N.remove(),F.remove()}}),o.jsxs("div",{className:"",children:[(e==null?void 0:e.type)===yZ&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex align-items-center mb-3",children:[" ",i===!0&&o.jsx(ca,{...t}),((f=e==null?void 0:e.attributes)==null?void 0:f.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",s?o.jsx(mse,{...t}):o.jsx("div",{className:"text-gray-900 font-bold text-xl",children:(h=e==null?void 0:e.label)==null?void 0:h[c]})]}),((g=e==null?void 0:e.options)==null?void 0:g.length)&&((v=e==null?void 0:e.options)==null?void 0:v.map(N=>{var F,P;return o.jsxs("div",{children:[o.jsxs("div",{className:"flex align-items-center mb-2",children:[o.jsx(ia,{inputId:N.uuid,name:e==null?void 0:e.uuid,value:N.uuid,onChange:H=>{(!l||!a)&&n(e==null?void 0:e.uuid,H==null?void 0:H.value)},checked:(r==null?void 0:r[e.uuid])===N.uuid,disabled:l||a}),o.jsx("label",{htmlFor:N.uuid,className:"ml-2",children:N.label})]}),(N==null?void 0:N.enableConditionalField)===!0&&(r==null?void 0:r[e==null?void 0:e.uuid])===(N==null?void 0:N.uuid)&&(N==null?void 0:N.children)&&((F=N==null?void 0:N.children)==null?void 0:F.length)>0&&((P=N==null?void 0:N.children)==null?void 0:P.map(()=>o.jsx(A7,{...t},`radio_child_${r==null?void 0:r[e==null?void 0:e.uuid]}`)))]},`${N.uuid}-radio-wrapper-${e==null?void 0:e.uuid}`)}))]}),(e==null?void 0:e.type)===AZ&&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[c]]}),o.jsx(wn,{className:"mt-2",onChange:N=>{var F;return n(e==null?void 0:e.uuid,(F=N==null?void 0:N.target)==null?void 0:F.value)},value:r==null?void 0:r.uuid,placeholder:(A=e==null?void 0:e.placeholder)==null?void 0:A[c],disabled:l||a})]})}),(e==null?void 0:e.type)===wZ&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((w=e==null?void 0:e.attributes)==null?void 0:w.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[c]]}),o.jsx(ef,{className:"mt-2",onChange:N=>{var F;return n(e==null?void 0:e.uuid,(F=N==null?void 0:N.target)==null?void 0:F.value)},value:r==null?void 0:r.uuid,placeholder:(C=e==null?void 0:e.placeholder)==null?void 0:C[c],disabled:l||a})]})}),(e==null?void 0:e.type)===SZ&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((x=e==null?void 0:e.attributes)==null?void 0:x.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[c]]}),o.jsx(so,{className:"mt-2",onChange:N=>{var F;return n(e==null?void 0:e.uuid,(F=N==null?void 0:N.target)==null?void 0:F.value)},value:r==null?void 0:r.uuid,placeholder:(T=e==null?void 0:e.placeholder)==null?void 0:T[c],disabled:l||a})]})}),o.jsx("div",{children:((S=e==null?void 0:e.helperText)==null?void 0:S[c])!==""&&o.jsx("small",{children:(E=e==null?void 0:e.helperText)==null?void 0:E[c]})}),o.jsx("div",{children:((_=e==null?void 0:e.attributes)==null?void 0:_.required)&&o.jsx("small",{className:"error",children:u===1&&!(r!=null&&r[e.uuid])?(M=e==null?void 0:e.validationMesssage)==null?void 0:M.language:""})})]},`${e==null?void 0:e.uuid}-radio`)},vse=t=>{const{hirarechicalRadioSchemaState:e}=t,[n,r]=k.useState({});return o.jsx("div",{children:o.jsx(A7,{schema:e,field:e,update:(i,a)=>{const s={...n};s[i]=a,r(s)},value:n,sectionIndex:0,fieldIndex:0,pageIndex:0,rowIndex:0,columnIndex:0,path:""})})},w7={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},bse={uuid:nt(),...w7,type:"radio",value:null,options:[{uuid:nt(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:nt(),label:"No",value:null,enableConditionalField:!0,children:[]}]};({uuid:nt(),...w7,options:(nt(),{uuid:nt(),...w7,options:(nt(),nt())},nt())});const yse=t=>{const{fieldState:e,setFieldState:n}=t,r=(f,h,g)=>g==null?void 0:g.map(v=>{var m;return v.uuid===f?{...v,...h}:{...v,children:v!=null&&v.children&&((m=v==null?void 0:v.children)==null?void 0:m.length)>0?[...v.children.map(A=>A.type==="radio"?{...A,options:r(f,h,(A==null?void 0:A.options)||[])}:{...A})]:[]}}),i=(f,h,g)=>{const v=r(f,g,e.options);n(m=>({...m,options:v}))},a=(f,h,g)=>g==null?void 0:g.map(v=>{var m;return{...v,children:v!=null&&v.children&&((m=v==null?void 0:v.children)==null?void 0:m.length)>0?[...v.children.map(A=>A.uuid===f?{...A,...h}:{...A,options:a(f,h,A==null?void 0:A.options)})]:[]}}),s=(f,h)=>{const g=a(f,h,e.options);n(v=>({...v,options:g}))},l=(f,h)=>h==null?void 0:h.map(g=>{var v;return{...g,children:g!=null&&g.children&&((v=g==null?void 0:g.children)==null?void 0:v.length)>0?[...g.children.filter(m=>{if(m.uuid!==f)return{...m,options:l(f,m==null?void 0:m.options)}})]:[]}}),c=(f,h,g)=>g==null?void 0:g.map(v=>{var m;return v.children&&v.uuid===f?{...v,children:[...v.children,h]}:{...v,children:v!=null&&v.children&&((m=v==null?void 0:v.children)==null?void 0:m.length)>0?[...v.children.map(A=>({...A,options:c(f,h,A==null?void 0:A.options)}))]:[]}}),u=f=>{const h=c(f,{...bse,isValid:0,uuid:nt(),options:[{uuid:nt(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:nt(),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(b7,{fieldState:e,updateCondtionOption:i,updateChildrenField:s,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(vse,{hirarechicalRadioSchemaState:e})]})]})})})},Qi=t=>{var Z;const{formBuilderFormSchema:e,fieldSettingUpdate:n,fieldSettingUpdateInlineConditional:r,formBuilderSchemaLanguages:i,pageSettingUpdate:a,formBuilderFormLayout:s,formBuilderPublishedStatus:l,gridComponentFieldSettingUpdate:c}=sn(),{renderType:u}=Ht(),{visibilty:d,field:f,closeSettingFieldSidebar:h,pageIndex:g,sectionIndex:v,rowIndex:m,columnIndex:A,fieldIndex:w,path:C,row:x,typeName:T}=t,{updateGlobalToast:S}=Ht(),[E,_]=k.useState(f),M=C.split("-"),N=()=>{const K=C.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?r(K[fa],K[ha],K[Ca],K[xa],K[Ta],K[Fa],K[Xo],K[wo],E):(K==null?void 0:K.length)>Fa&&(K==null?void 0:K.length)===Bl+1&&(E!=null&&E.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?c(K[fa],K[ha],K[Ca],K[xa],K[Ta],K[5],K[6],K[7],E):(n(g,v,m,A,w,{...E}),setTimeout(()=>{Gt.emit("OnSignatureSettingChange",{})},1e3),setTimeout(()=>{Gt.emit("onUpdateField",{})},1e3)),S({showToast:!0,toastMessage:"Updated",toastDetail:`${T} updated`,toastType:"success"})},F=(K,W,ge)=>{_(ve=>({...ve,[K]:{...ve[K],[W==null?void 0:W.type]:ge}}))},P=(K,W)=>{_(ge=>({...ge,attributes:{...ge.attributes,[K]:W}}))},H=(K,W)=>{_(ge=>({...ge,[K]:W}))},O=(K,W)=>{_(ge=>({...ge,inlineConditional:{...ge.inlineConditional,[K]:W}}))},j=()=>{},U=()=>{_(K=>({...K,data:[...K.data,{uuid:nt(),dataKey:"",value:""}]}))},le=()=>{_(K=>Object.assign({},K,{options:[...K.options,{uuid:nt(),optionText:{english:""},value:"",score:0,hyperlinkText:{english:""},abbreviationText:{english:""},custom_values:{}}]}))},R=()=>{},X=()=>{},ce=()=>{},Y=()=>{},ae=K=>{var Ie;const W=[...(E==null?void 0:E.conditionalTabRules.rules)||[]],ge=W.filter((be,de)=>K!==de);_(be=>({...be,conditionalTabRules:{...be.conditionalTabRules,rules:ge}}));const ve=W[K];(Ie=ve==null?void 0:ve.conditions)==null||Ie.map(be=>{const de=_t.findIndex(s,q=>{var ee;return(q==null?void 0:q.uuid)===((ee=be==null?void 0:be.tab)==null?void 0:ee.uuid)}),ne=s[de];ne&&(ne.isHidden=!1,a(de,ne))})},re=(K,W)=>{const ge=[...(E==null?void 0:E.conditionalTabRules.rules)||[]];ge[K].conditions=ge[K].conditions.filter((ve,Ie)=>W!==Ie),_(ve=>({...ve,conditionalTabRules:{...ve.conditionalTabRules,rules:ge}}))};return o.jsx(o.Fragment,{children:o.jsxs(To,{style:{width:"80vw",zIndex:7e3},visible:d,position:"left",className:"p-sidebar-lg",onHide:()=>h(),header:()=>{var K;return o.jsx("div",{className:"flex align-items-center gap-2 justify-content-between",children:o.jsxs("div",{className:"text-gray-900 font-bold text-2xl",children:[(K=f==null?void 0:f.label)==null?void 0:K.english," "]})})},"aria-label":"Field Setting Sidebar",children:[o.jsx("div",{className:"",children:o.jsxs(ss,{children:[o.jsx(Cr,{header:"Text",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(ao,{activeIndex:0,children:i!=null&&i.length?i.map((K,W)=>o.jsx(io,{tabIndex:W,header:K==null?void 0:K.language,children:o.jsx(nD,{language:K,fieldState:E,onHandleChange:F,...t})},W)):""})})}),(E==null?void 0:E.isValidationTabEnabled)===!0&&o.jsx(Cr,{header:"Validation",children:o.jsx(xte,{fieldState:E,onHandleChangeLayoutSettings:H,onHandleChangeAttributesSetttings:P,...t})}),o.jsx(Cr,{header:"Attributes",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(Tte,{fieldState:E,onHandleChangeLayoutSettings:H,onHandleChangeAttributesSetttings:P})})}),(E==null?void 0:E.isLayoutTabEnabled)===!0&&o.jsx(Cr,{header:"Layout",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(Bte,{fieldState:E,onHandleChangeLayoutSettings:H})})}),(E==null?void 0:E.isDynamicListingTabEnabled)===!0&&o.jsx(Cr,{header:"Dynamic Options",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(sse,{fieldState:E,setFieldState:_})})}),(E==null?void 0:E.options)!==void 0&&(E==null?void 0:E.data)&&o.jsx(Cr,{header:"Data",children:o.jsxs("div",{className:"scroll-height-200",children:[o.jsx(Vte,{onHandleChangeLayoutSettings:H,fieldState:E,setFieldState:_}),o.jsx(Ot,{className:"mr-3",label:"Data Option",icon:"pi pi-plus",onClick:()=>U(),"aria-label":"Add"})]})}),o.jsx(Cr,{header:"Table view options",children:o.jsx(ase,{fieldState:E,onHandleChangeLayoutSettings:H})}),(E==null?void 0:E.componentType)!=="radio-hierarchal"&&(E==null?void 0:E.options)!==void 0&&f.componentType!=="grid-component"&&f.componentType!=="matrix-dropdown"&&f.componentType!=="table"&&o.jsxs(Cr,{header:"Options",children:[(E==null?void 0:E.componentType)!=="radio-hierarchal"&&o.jsx("div",{className:"flex justify-content-end",children:o.jsx(Ot,{className:"mr-3 mb-2",label:"Option",icon:"pi pi-plus",onClick:()=>le(),"aria-label":"Option"})}),o.jsxs("div",{className:"scroll-height-200 px-4",children:[o.jsx(ao,{activeIndex:0,children:i!=null&&i.length?i.map((K,W)=>o.jsx(io,{tabIndex:W,header:K==null?void 0:K.language,children:o.jsx(fN,{enableAbbreviationColumn:(E==null?void 0:E.componentType)!=="radio-hierarchal",enableHyperTextColumn:(E==null?void 0:E.componentType)!=="radio-hierarchal",enableAddNewColumn:(E==null?void 0:E.componentType)!=="radio-hierarchal",enableCopyPaste:(E==null?void 0:E.componentType)!=="radio-hierarchal",isCustomValue:!1,fieldState:E,setFieldState:_,language:K})},W)):""}),(E==null?void 0:E.isHierarchalCondionalTabEnabled)===!0&&o.jsx(b7,{fieldState:E,onHandleChangeLayoutSettings:H,removeChildrenField:Y,addChildrenField:ce,updateChildrenField:X,updateCondtionOption:R})]})]}),(E==null?void 0:E.componentType)==="radio-hierarchal"&&(E==null?void 0:E.options)!==void 0&&f.componentType!=="grid-component"&&f.componentType!=="matrix-dropdown"&&f.componentType!=="table"&&o.jsx(Cr,{header:"Hierarchal Options",children:o.jsx(yse,{fieldState:E,setFieldState:_})}),u===e3&&(E==null?void 0:E.inlineConditionalRules)!==void 0&&!(x!=null&&x.rowIsRepeatable)&&(M==null?void 0:M.length)<wo+1&&o.jsx(Cr,{header:"Conditional",children:o.jsx(rse,{handleRemoveConditionalTabRule:ae,handleRemoveConditionalTabRuleCondition:re,onHandleSelectInlineConditionalOption:j,onHandleChangeLayoutSettings:H,onHandleChangeInlineConditionaltSetttings:O,fieldState:E,setFieldState:_,pageIndex:g,sectionIndex:v,...t})}),!((Z=t==null?void 0:t.row)!=null&&Z.rowIsRepeatable)&&(e==null?void 0:e.enableReviewTask)===!0&&o.jsx(Cr,{header:"Admin reviewer checklist",children:o.jsx(ise,{fieldState:E,setFieldState:_})})]})}),o.jsx("div",{className:"w-full px-4 py-3 surface-100 sidebar-footer",children:o.jsxs("div",{className:"flex flex-row gap-2 align-items-center justify-content-end",children:[o.jsx(Ot,{text:!0,label:"Close",type:"button",icon:"pi pi-times",onClick:()=>h(),"aria-label":"Close",size:"small",className:"p-button-danger"}),!l&&o.jsx(Ot,{size:"small",label:"Update",type:"button",outlined:!0,onClick:()=>N(),"aria-label":"Update"})]})})]})})},ki=t=>{const[e,n]=k.useState(null),{field:r}=t,{userTaskSubmitFormData:i,updateUserFormDataSubmit:a,updateTaskFormData:s}=Ar(),{taskId:l}=Ht();k.useEffect(()=>{var v,m;if(i!==null&&e===null){let A=0;r!=null&&r.rowIsRepeatable?A=i.findIndex(w=>(w==null?void 0:w.rowId)===(r==null?void 0:r.uuid)):A=i.findIndex(w=>(w==null?void 0:w.fieldId)===(r==null?void 0:r.uuid)),n((v=i[A])!=null&&v.reviewerChecklist?(m=i[A])==null?void 0:m.reviewerChecklist:[])}return()=>{}},[r==null?void 0:r.rowIsRepeatable,r==null?void 0:r.uuid,e,i]);const c=v=>{const m=i.findIndex(w=>(w==null?void 0:w.fieldId)===(r==null?void 0:r.uuid)),A=[...i];A[m]={...A[m],reviewerChecklist:v},a(A),s(A,l,"/task-issues-activity/")},u=(v,m)=>{const A=e;A[m]={...A[m],agree:v==null?void 0:v.value},n([...A]),c(A)},d=(v,m)=>{const A=e;if(m!=null&&m.checked)A[v].selectAction.push(m==null?void 0:m.value);else{const w=A[v].selectAction.findIndex(C=>C===(m==null?void 0:m.value));A[v].selectAction.splice(w,1)}n([...A]),c(A)},f=(v,m)=>{const A=e;v!=null&&v.checked?A[m]={...A[m],other:{...A[m].other,isOther:!0}}:A[m]={...A[m],other:{...A[m].other,isOther:!1}},n([...A]),c(A)},h=(v,m)=>{var w;const A=e;A[m]={...A[m],other:{...A[m].other,description:(w=v==null?void 0:v.target)==null?void 0:w.value}},n([...A]),c(A)},g=(v,m,A)=>{var C;const w=e;w[A]={...w[A],[m]:(C=v==null?void 0:v.target)==null?void 0:C.value},n([...w]),c(w)};return o.jsx(o.Fragment,{children:e!==null&&(e==null?void 0:e.length)>0?o.jsx(o.Fragment,{children:o.jsx(ii,{header:"Reviewer Checklist",toggleable:!0,collapsed:!0,children:o.jsx("div",{className:"flex flex-row flex-wrap gap-2",children:e==null?void 0:e.map((v,m)=>{var A,w,C,x,T;return o.jsxs("div",{className:"card p-fluid",style:{width:250},children:[o.jsx("h6",{className:"mb-2",children:v==null?void 0:v.checklist}),o.jsx("br",{}),o.jsxs("div",{className:"flex flex-row gap-3 mb-2",children:[o.jsxs("div",{className:"field-radiobutton",children:[o.jsx(ia,{inputId:`yes-${m}`,name:"action",value:!0,onChange:S=>{u(S,m)},checked:(v==null?void 0:v.agree)===!0}),o.jsx("label",{htmlFor:`yes-${m}`,children:"Yes"})]}),o.jsxs("div",{className:"field-radiobutton",children:[o.jsx(ia,{inputId:`no-${m}`,name:"action",value:!1,onChange:S=>{u(S,m)},checked:(v==null?void 0:v.agree)===!1}),o.jsx("label",{htmlFor:`no-${m}`,children:"No"})]})]}),(v==null?void 0:v.agree)===!1&&o.jsxs("div",{className:"px-5 mb-3",children:[(v==null?void 0:v.action)&&Array.isArray(v.action)&&((A=v==null?void 0:v.action)==null?void 0:A.length)>0&&((w=v==null?void 0:v.action)==null?void 0:w.map((S,E)=>{var _;return o.jsxs("div",{children:[o.jsx(Yr,{value:S,checked:((_=v==null?void 0:v.selectAction)==null?void 0:_.length)>0?v==null?void 0:v.selectAction.some(M=>M===S):!1,onChange:M=>{d(m,M)}})," ",S," ",o.jsx("br",{}),o.jsx("br",{})]},`action-${m}-${E}`)})),o.jsx(Yr,{checked:(C=v==null?void 0:v.other)==null?void 0:C.isOther,onChange:S=>{f(S,m)}})," Other ",o.jsx("br",{}),o.jsx("br",{}),((x=v==null?void 0:v.other)==null?void 0:x.isOther)===!0&&o.jsxs("div",{className:"",children:[o.jsx("label",{children:"If other please specify the action point"}),o.jsx("br",{}),o.jsx(so,{className:"mt-3",value:(T=v==null?void 0:v.other)==null?void 0:T.description,onChange:S=>h(S,m)})]})]}),(v==null?void 0:v.agree)===!1&&o.jsxs("div",{className:"",children:[o.jsx("label",{children:"Reviewer Feedback "}),o.jsx("br",{}),o.jsx(so,{className:"mt-3",value:v==null?void 0:v.reviewerFeedback,onChange:S=>g(S,"reviewerFeedback",m)})]}),o.jsxs("div",{className:"",children:[o.jsx("label",{children:"Reviewer Comments / Notes (internal use only)"}),o.jsx("br",{}),o.jsx(so,{className:"mt-3",value:v==null?void 0:v.reviewerComments,onChange:S=>g(S,"reviewerComments",m)})]})]},`checklistIndex-${m}`)})})})}):o.jsx(o.Fragment,{children:o.jsx("div",{className:"text-gray-900 flex justify-content-center align-items-center",children:"No admin review is required"})})})},xi=t=>{const{isPreview:e,field:n,isAdmin:r,fieldWrap:i}=t,{userSelectedLanguage:a}=sn(),{globalAlignment:s}=Ht(),l=g=>{const v=g.collapsed?"pi pi-chevron-down":"pi pi-chevron-up",m=`${g.className} justify-content-start`,A=`${g.titleClassName} pl-1`;return o.jsxs("div",{className:m,children:[o.jsxs("button",{className:g.togglerClassName,onClick:g.onTogglerClick,children:[o.jsx("span",{className:v}),o.jsx(Qt,{})]}),o.jsx("span",{className:A,children:d})]})},{TASK_PUBLISHED:c,task_status:u}=Ar(),[d,f]=k.useState("");k.useEffect(()=>{var g;f((g=n==null?void 0:n.label)==null?void 0:g[a==null?void 0:a.type])},[n,a==null?void 0:a.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:s,className:h(),children:u===c&&r===!0?o.jsx(ii,{headerTemplate:l,toggleable:!0,children:i}):i})})};/*! @license DOMPurify 3.1.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.7/LICENSE */const{entries:bN,setPrototypeOf:yN,isFrozen:Ase,getPrototypeOf:wse,getOwnPropertyDescriptor:Sse}=Object;let{freeze:Eo,seal:jl,create:AN}=Object,{apply:S7,construct:C7}=typeof Reflect<"u"&&Reflect;Eo||(Eo=function(e){return e}),jl||(jl=function(e){return e}),S7||(S7=function(e,n,r){return e.apply(n,r)}),C7||(C7=function(e,n){return new e(...n)});const O3=ml(Array.prototype.forEach),wN=ml(Array.prototype.pop),Jp=ml(Array.prototype.push),F3=ml(String.prototype.toLowerCase),x7=ml(String.prototype.toString),SN=ml(String.prototype.match),Zp=ml(String.prototype.replace),Cse=ml(String.prototype.indexOf),xse=ml(String.prototype.trim),xc=ml(Object.prototype.hasOwnProperty),Io=ml(RegExp.prototype.test),e2=Tse(TypeError);function ml(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 S7(t,e,r)}}function Tse(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return C7(t,n)}}function hi(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:F3;yN&&yN(t,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const a=n(i);a!==i&&(Ase(e)||(e[r]=a),i=a)}t[i]=!0}return t}function Ese(t){for(let e=0;e<t.length;e++)xc(t,e)||(t[e]=null);return t}function J0(t){const e=AN(null);for(const[n,r]of bN(t))xc(t,n)&&(Array.isArray(r)?e[n]=Ese(r):r&&typeof r=="object"&&r.constructor===Object?e[n]=J0(r):e[n]=r);return e}function t2(t,e){for(;t!==null;){const r=Sse(t,e);if(r){if(r.get)return ml(r.get);if(typeof r.value=="function")return ml(r.value)}t=wse(t)}function n(){return null}return n}const CN=Eo(["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"]),T7=Eo(["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"]),E7=Eo(["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"]),Ise=Eo(["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"]),I7=Eo(["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"]),_se=Eo(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),xN=Eo(["#text"]),TN=Eo(["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"]),_7=Eo(["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"]),EN=Eo(["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"]),k3=Eo(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Dse=jl(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Nse=jl(/<%[\w\W]*|[\w\W]*%>/gm),Ose=jl(/\${[\w\W]*}/gm),Fse=jl(/^data-[\-\w.\u00B7-\uFFFF]/),kse=jl(/^aria-[\-\w]+$/),IN=jl(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Pse=jl(/^(?:\w+script|data):/i),Mse=jl(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),_N=jl(/^html$/i),Lse=jl(/^[a-z][.\w]*(-[.\w]+)+$/i);var DN=Object.freeze({__proto__:null,MUSTACHE_EXPR:Dse,ERB_EXPR:Nse,TMPLIT_EXPR:Ose,DATA_ATTR:Fse,ARIA_ATTR:kse,IS_ALLOWED_URI:IN,IS_SCRIPT_OR_DATA:Pse,ATTR_WHITESPACE:Mse,DOCTYPE_NAME:_N,CUSTOM_ELEMENT:Lse});const n2={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Bse=function(){return typeof window>"u"?null:window},Vse=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 a="dompurify"+(r?"#"+r:"");try{return e.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}};function NN(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Bse();const e=It=>NN(It);if(e.version="3.1.7",e.removed=[],!t||!t.document||t.document.nodeType!==n2.document)return e.isSupported=!1,e;let{document:n}=t;const r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:c,NodeFilter:u,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:f,DOMParser:h,trustedTypes:g}=t,v=c.prototype,m=t2(v,"cloneNode"),A=t2(v,"remove"),w=t2(v,"nextSibling"),C=t2(v,"childNodes"),x=t2(v,"parentNode");if(typeof s=="function"){const It=n.createElement("template");It.content&&It.content.ownerDocument&&(n=It.content.ownerDocument)}let T,S="";const{implementation:E,createNodeIterator:_,createDocumentFragment:M,getElementsByTagName:N}=n,{importNode:F}=r;let P={};e.isSupported=typeof bN=="function"&&typeof x=="function"&&E&&E.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:H,ERB_EXPR:O,TMPLIT_EXPR:j,DATA_ATTR:U,ARIA_ATTR:le,IS_SCRIPT_OR_DATA:R,ATTR_WHITESPACE:X,CUSTOM_ELEMENT:ce}=DN;let{IS_ALLOWED_URI:Y}=DN,ae=null;const re=hi({},[...CN,...T7,...E7,...I7,...xN]);let Z=null;const K=hi({},[...TN,..._7,...EN,...k3]);let W=Object.seal(AN(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}})),ge=null,ve=null,Ie=!0,be=!0,de=!1,ne=!0,q=!1,ee=!0,oe=!1,pe=!1,Ce=!1,De=!1,me=!1,Te=!1,Pe=!0,Ee=!1;const $="user-content-";let he=!0,ye=!1,se={},fe=null;const Ae=hi({},["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 Ne=null;const Le=hi({},["audio","video","img","source","image","track"]);let ze=null;const tt=hi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),it="http://www.w3.org/1998/Math/MathML",ht="http://www.w3.org/2000/svg",Ut="http://www.w3.org/1999/xhtml";let fn=Ut,$t=!1,mn=null;const En=hi({},[it,ht,Ut],x7);let Tt=null;const je=["application/xhtml+xml","text/html"],He="text/html";let ot=null,rn=null;const nn=n.createElement("form"),Jt=function(Fe){return Fe instanceof RegExp||Fe instanceof Function},_n=function(){let Fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(rn&&rn===Fe)){if((!Fe||typeof Fe!="object")&&(Fe={}),Fe=J0(Fe),Tt=je.indexOf(Fe.PARSER_MEDIA_TYPE)===-1?He:Fe.PARSER_MEDIA_TYPE,ot=Tt==="application/xhtml+xml"?x7:F3,ae=xc(Fe,"ALLOWED_TAGS")?hi({},Fe.ALLOWED_TAGS,ot):re,Z=xc(Fe,"ALLOWED_ATTR")?hi({},Fe.ALLOWED_ATTR,ot):K,mn=xc(Fe,"ALLOWED_NAMESPACES")?hi({},Fe.ALLOWED_NAMESPACES,x7):En,ze=xc(Fe,"ADD_URI_SAFE_ATTR")?hi(J0(tt),Fe.ADD_URI_SAFE_ATTR,ot):tt,Ne=xc(Fe,"ADD_DATA_URI_TAGS")?hi(J0(Le),Fe.ADD_DATA_URI_TAGS,ot):Le,fe=xc(Fe,"FORBID_CONTENTS")?hi({},Fe.FORBID_CONTENTS,ot):Ae,ge=xc(Fe,"FORBID_TAGS")?hi({},Fe.FORBID_TAGS,ot):{},ve=xc(Fe,"FORBID_ATTR")?hi({},Fe.FORBID_ATTR,ot):{},se=xc(Fe,"USE_PROFILES")?Fe.USE_PROFILES:!1,Ie=Fe.ALLOW_ARIA_ATTR!==!1,be=Fe.ALLOW_DATA_ATTR!==!1,de=Fe.ALLOW_UNKNOWN_PROTOCOLS||!1,ne=Fe.ALLOW_SELF_CLOSE_IN_ATTR!==!1,q=Fe.SAFE_FOR_TEMPLATES||!1,ee=Fe.SAFE_FOR_XML!==!1,oe=Fe.WHOLE_DOCUMENT||!1,De=Fe.RETURN_DOM||!1,me=Fe.RETURN_DOM_FRAGMENT||!1,Te=Fe.RETURN_TRUSTED_TYPE||!1,Ce=Fe.FORCE_BODY||!1,Pe=Fe.SANITIZE_DOM!==!1,Ee=Fe.SANITIZE_NAMED_PROPS||!1,he=Fe.KEEP_CONTENT!==!1,ye=Fe.IN_PLACE||!1,Y=Fe.ALLOWED_URI_REGEXP||IN,fn=Fe.NAMESPACE||Ut,W=Fe.CUSTOM_ELEMENT_HANDLING||{},Fe.CUSTOM_ELEMENT_HANDLING&&Jt(Fe.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(W.tagNameCheck=Fe.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Fe.CUSTOM_ELEMENT_HANDLING&&Jt(Fe.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(W.attributeNameCheck=Fe.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Fe.CUSTOM_ELEMENT_HANDLING&&typeof Fe.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(W.allowCustomizedBuiltInElements=Fe.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),q&&(be=!1),me&&(De=!0),se&&(ae=hi({},xN),Z=[],se.html===!0&&(hi(ae,CN),hi(Z,TN)),se.svg===!0&&(hi(ae,T7),hi(Z,_7),hi(Z,k3)),se.svgFilters===!0&&(hi(ae,E7),hi(Z,_7),hi(Z,k3)),se.mathMl===!0&&(hi(ae,I7),hi(Z,EN),hi(Z,k3))),Fe.ADD_TAGS&&(ae===re&&(ae=J0(ae)),hi(ae,Fe.ADD_TAGS,ot)),Fe.ADD_ATTR&&(Z===K&&(Z=J0(Z)),hi(Z,Fe.ADD_ATTR,ot)),Fe.ADD_URI_SAFE_ATTR&&hi(ze,Fe.ADD_URI_SAFE_ATTR,ot),Fe.FORBID_CONTENTS&&(fe===Ae&&(fe=J0(fe)),hi(fe,Fe.FORBID_CONTENTS,ot)),he&&(ae["#text"]=!0),oe&&hi(ae,["html","head","body"]),ae.table&&(hi(ae,["tbody"]),delete ge.tbody),Fe.TRUSTED_TYPES_POLICY){if(typeof Fe.TRUSTED_TYPES_POLICY.createHTML!="function")throw e2('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Fe.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw e2('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=Fe.TRUSTED_TYPES_POLICY,S=T.createHTML("")}else T===void 0&&(T=Vse(g,i)),T!==null&&typeof S=="string"&&(S=T.createHTML(""));Eo&&Eo(Fe),rn=Fe}},wt=hi({},["mi","mo","mn","ms","mtext"]),Ke=hi({},["annotation-xml"]),st=hi({},["title","style","font","a","script"]),vt=hi({},[...T7,...E7,...Ise]),Vt=hi({},[...I7,..._se]),On=function(Fe){let Qe=x(Fe);(!Qe||!Qe.tagName)&&(Qe={namespaceURI:fn,tagName:"template"});const At=F3(Fe.tagName),jt=F3(Qe.tagName);return mn[Fe.namespaceURI]?Fe.namespaceURI===ht?Qe.namespaceURI===Ut?At==="svg":Qe.namespaceURI===it?At==="svg"&&(jt==="annotation-xml"||wt[jt]):!!vt[At]:Fe.namespaceURI===it?Qe.namespaceURI===Ut?At==="math":Qe.namespaceURI===ht?At==="math"&&Ke[jt]:!!Vt[At]:Fe.namespaceURI===Ut?Qe.namespaceURI===ht&&!Ke[jt]||Qe.namespaceURI===it&&!wt[jt]?!1:!Vt[At]&&(st[At]||!vt[At]):!!(Tt==="application/xhtml+xml"&&mn[Fe.namespaceURI]):!1},$n=function(Fe){Jp(e.removed,{element:Fe});try{x(Fe).removeChild(Fe)}catch{A(Fe)}},lr=function(Fe,Qe){try{Jp(e.removed,{attribute:Qe.getAttributeNode(Fe),from:Qe})}catch{Jp(e.removed,{attribute:null,from:Qe})}if(Qe.removeAttribute(Fe),Fe==="is"&&!Z[Fe])if(De||me)try{$n(Qe)}catch{}else try{Qe.setAttribute(Fe,"")}catch{}},Wn=function(Fe){let Qe=null,At=null;if(Ce)Fe="<remove></remove>"+Fe;else{const Zt=SN(Fe,/^[\r\n\t ]+/);At=Zt&&Zt[0]}Tt==="application/xhtml+xml"&&fn===Ut&&(Fe='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Fe+"</body></html>");const jt=T?T.createHTML(Fe):Fe;if(fn===Ut)try{Qe=new h().parseFromString(jt,Tt)}catch{}if(!Qe||!Qe.documentElement){Qe=E.createDocument(fn,"template",null);try{Qe.documentElement.innerHTML=$t?S:jt}catch{}}const Xt=Qe.body||Qe.documentElement;return Fe&&At&&Xt.insertBefore(n.createTextNode(At),Xt.childNodes[0]||null),fn===Ut?N.call(Qe,oe?"html":"body")[0]:oe?Qe.documentElement:Xt},vr=function(Fe){return _.call(Fe.ownerDocument||Fe,Fe,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Nr=function(Fe){return Fe instanceof f&&(typeof Fe.nodeName!="string"||typeof Fe.textContent!="string"||typeof Fe.removeChild!="function"||!(Fe.attributes instanceof d)||typeof Fe.removeAttribute!="function"||typeof Fe.setAttribute!="function"||typeof Fe.namespaceURI!="string"||typeof Fe.insertBefore!="function"||typeof Fe.hasChildNodes!="function")},yn=function(Fe){return typeof l=="function"&&Fe instanceof l},lt=function(Fe,Qe,At){P[Fe]&&O3(P[Fe],jt=>{jt.call(e,Qe,At,rn)})},ut=function(Fe){let Qe=null;if(lt("beforeSanitizeElements",Fe,null),Nr(Fe))return $n(Fe),!0;const At=ot(Fe.nodeName);if(lt("uponSanitizeElement",Fe,{tagName:At,allowedTags:ae}),Fe.hasChildNodes()&&!yn(Fe.firstElementChild)&&Io(/<[/\w]/g,Fe.innerHTML)&&Io(/<[/\w]/g,Fe.textContent)||Fe.nodeType===n2.progressingInstruction||ee&&Fe.nodeType===n2.comment&&Io(/<[/\w]/g,Fe.data))return $n(Fe),!0;if(!ae[At]||ge[At]){if(!ge[At]&&Nt(At)&&(W.tagNameCheck instanceof RegExp&&Io(W.tagNameCheck,At)||W.tagNameCheck instanceof Function&&W.tagNameCheck(At)))return!1;if(he&&!fe[At]){const jt=x(Fe)||Fe.parentNode,Xt=C(Fe)||Fe.childNodes;if(Xt&&jt){const Zt=Xt.length;for(let Sn=Zt-1;Sn>=0;--Sn){const Ln=m(Xt[Sn],!0);Ln.__removalCount=(Fe.__removalCount||0)+1,jt.insertBefore(Ln,w(Fe))}}}return $n(Fe),!0}return Fe instanceof c&&!On(Fe)||(At==="noscript"||At==="noembed"||At==="noframes")&&Io(/<\/no(script|embed|frames)/i,Fe.innerHTML)?($n(Fe),!0):(q&&Fe.nodeType===n2.text&&(Qe=Fe.textContent,O3([H,O,j],jt=>{Qe=Zp(Qe,jt," ")}),Fe.textContent!==Qe&&(Jp(e.removed,{element:Fe.cloneNode()}),Fe.textContent=Qe)),lt("afterSanitizeElements",Fe,null),!1)},yt=function(Fe,Qe,At){if(Pe&&(Qe==="id"||Qe==="name")&&(At in n||At in nn))return!1;if(!(be&&!ve[Qe]&&Io(U,Qe))){if(!(Ie&&Io(le,Qe))){if(!Z[Qe]||ve[Qe]){if(!(Nt(Fe)&&(W.tagNameCheck instanceof RegExp&&Io(W.tagNameCheck,Fe)||W.tagNameCheck instanceof Function&&W.tagNameCheck(Fe))&&(W.attributeNameCheck instanceof RegExp&&Io(W.attributeNameCheck,Qe)||W.attributeNameCheck instanceof Function&&W.attributeNameCheck(Qe))||Qe==="is"&&W.allowCustomizedBuiltInElements&&(W.tagNameCheck instanceof RegExp&&Io(W.tagNameCheck,At)||W.tagNameCheck instanceof Function&&W.tagNameCheck(At))))return!1}else if(!ze[Qe]){if(!Io(Y,Zp(At,X,""))){if(!((Qe==="src"||Qe==="xlink:href"||Qe==="href")&&Fe!=="script"&&Cse(At,"data:")===0&&Ne[Fe])){if(!(de&&!Io(R,Zp(At,X,"")))){if(At)return!1}}}}}}return!0},Nt=function(Fe){return Fe!=="annotation-xml"&&SN(Fe,ce)},An=function(Fe){lt("beforeSanitizeAttributes",Fe,null);const{attributes:Qe}=Fe;if(!Qe)return;const At={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z};let jt=Qe.length;for(;jt--;){const Xt=Qe[jt],{name:Zt,namespaceURI:Sn,value:Ln}=Xt,zn=ot(Zt);let at=Zt==="value"?Ln:xse(Ln);if(At.attrName=zn,At.attrValue=at,At.keepAttr=!0,At.forceKeepAttr=void 0,lt("uponSanitizeAttribute",Fe,At),at=At.attrValue,At.forceKeepAttr||(lr(Zt,Fe),!At.keepAttr))continue;if(!ne&&Io(/\/>/i,at)){lr(Zt,Fe);continue}q&&O3([H,O,j],Me=>{at=Zp(at,Me," ")});const ie=ot(Fe.nodeName);if(yt(ie,zn,at)){if(Ee&&(zn==="id"||zn==="name")&&(lr(Zt,Fe),at=$+at),ee&&Io(/((--!?|])>)|<\/(style|title)/i,at)){lr(Zt,Fe);continue}if(T&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Sn)switch(g.getAttributeType(ie,zn)){case"TrustedHTML":{at=T.createHTML(at);break}case"TrustedScriptURL":{at=T.createScriptURL(at);break}}try{Sn?Fe.setAttributeNS(Sn,Zt,at):Fe.setAttribute(Zt,at),Nr(Fe)?$n(Fe):wN(e.removed)}catch{}}}lt("afterSanitizeAttributes",Fe,null)},Nn=function It(Fe){let Qe=null;const At=vr(Fe);for(lt("beforeSanitizeShadowDOM",Fe,null);Qe=At.nextNode();)lt("uponSanitizeShadowNode",Qe,null),!ut(Qe)&&(Qe.content instanceof a&&It(Qe.content),An(Qe));lt("afterSanitizeShadowDOM",Fe,null)};return e.sanitize=function(It){let Fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Qe=null,At=null,jt=null,Xt=null;if($t=!It,$t&&(It="<!-->"),typeof It!="string"&&!yn(It))if(typeof It.toString=="function"){if(It=It.toString(),typeof It!="string")throw e2("dirty is not a string, aborting")}else throw e2("toString is not a function");if(!e.isSupported)return It;if(pe||_n(Fe),e.removed=[],typeof It=="string"&&(ye=!1),ye){if(It.nodeName){const Ln=ot(It.nodeName);if(!ae[Ln]||ge[Ln])throw e2("root node is forbidden and cannot be sanitized in-place")}}else if(It instanceof l)Qe=Wn("<!---->"),At=Qe.ownerDocument.importNode(It,!0),At.nodeType===n2.element&&At.nodeName==="BODY"||At.nodeName==="HTML"?Qe=At:Qe.appendChild(At);else{if(!De&&!q&&!oe&&It.indexOf("<")===-1)return T&&Te?T.createHTML(It):It;if(Qe=Wn(It),!Qe)return De?null:Te?S:""}Qe&&Ce&&$n(Qe.firstChild);const Zt=vr(ye?It:Qe);for(;jt=Zt.nextNode();)ut(jt)||(jt.content instanceof a&&Nn(jt.content),An(jt));if(ye)return It;if(De){if(me)for(Xt=M.call(Qe.ownerDocument);Qe.firstChild;)Xt.appendChild(Qe.firstChild);else Xt=Qe;return(Z.shadowroot||Z.shadowrootmode)&&(Xt=F.call(r,Xt,!0)),Xt}let Sn=oe?Qe.outerHTML:Qe.innerHTML;return oe&&ae["!doctype"]&&Qe.ownerDocument&&Qe.ownerDocument.doctype&&Qe.ownerDocument.doctype.name&&Io(_N,Qe.ownerDocument.doctype.name)&&(Sn="<!DOCTYPE "+Qe.ownerDocument.doctype.name+`>
2289
+ `}}),ii=b.forwardRef(function(t,e){var n=Kn(),r=b.useContext(ar),i=_3.getProps(t,r),a=b.useState(i.id),s=pN(a,2),l=s[0],c=s[1],u=b.useState(i.collapsed),d=pN(u,2),f=d[0],h=d[1],g=b.useRef(null),v=b.useRef(null),m=i.toggleable?i.onToggle?i.collapsed:f:!1,A=l+"_header",w=l+"_content",C=_3.setMetaData({props:i,state:{id:l,collapsed:m}}),x=C.ptm,T=C.cx,S=C.isUnstyled;ci(_3.css.styles,S,{name:"panel"});var E=function(X){i.toggleable&&(m?_(X):M(X),X&&(i.onToggle&&i.onToggle({originalEvent:X,value:!m}),X.preventDefault()))},_=function(X){i.onToggle||h(!1),i.onExpand&&X&&i.onExpand(X)},M=function(X){i.onToggle||h(!0),i.onCollapse&&X&&i.onCollapse(X)};b.useImperativeHandle(e,function(){return{props:i,toggle:E,expand:_,collapse:M,getElement:function(){return g.current},getContent:function(){return v.current}}}),Li(function(){l||c(So())});var N=function(){if(i.toggleable){var X=l+"_label",ce=n({className:T("toggler"),onClick:E,id:X,"aria-controls":w,"aria-expanded":!m,type:"button",role:"button","aria-label":i.header},x("toggler")),Y=n(x("togglericon")),ae=m?i.expandIcon||b.createElement(Mm,Y):i.collapseIcon||b.createElement(n8,Y),re=nr.getJSXIcon(ae,Y,{props:i,collapsed:m});return b.createElement("button",ce,re,b.createElement(Qt,null))}return null},F=function(){var X=ke.getJSXElement(i.header,i),ce=ke.getJSXElement(i.icons,i),Y=N(),ae=n({id:A,className:T("title")},x("title")),re=b.createElement("span",ae,X),Z=n({className:T("icons")},x("icons")),K=b.createElement("div",Z,ce,Y),W=n({className:T("header")},x("header")),ge=b.createElement("div",W,re,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:E,titleElement:re,iconsElement:K,togglerElement:Y,element:ge,id:l+"_header",props:i,collapsed:m};return ke.getJSXElement(i.headerTemplate,ve)}else if(i.header||i.toggleable)return ge;return null},P=function(){var X=ke.getJSXElement(i.footer,i),ce=n({className:T("footer")},x("footer")),Y=b.createElement("div",ce,X);if(i.footerTemplate){var ae={className:T("footer"),element:Y,props:i};return ke.getJSXElement(i.footerTemplate,ae)}else if(i.footer)return Y;return null},H=function(){var X=n({ref:v,className:T("toggleableContent"),"aria-hidden":m,role:"region",id:w,"aria-labelledby":A},x("toggleablecontent")),ce=n({className:T("content")},x("content")),Y=n({classNames:T("transition"),timeout:{enter:1e3,exit:450},in:!m,unmountOnExit:!0,options:i.transitionOptions},x("transition"));return b.createElement(Ro,v7({nodeRef:v},Y),b.createElement("div",X,b.createElement("div",ce,i.children)))},O=n({id:l,ref:g,style:i.style,className:ft(i.className,T("root"))},_3.getOtherProps(i),x("root")),j=F(),U=H(),le=P();return b.createElement("div",O,j,U,le)});ii.displayName="Panel";const ese=t=>{var v;const{fieldState:e,setFieldState:n,pageIndex:r,formBuilderFormLayout:i,pageSettingUpdate:a}=t,s=(m,A)=>{const w=`${m.className} justify-content-start`,C=`${m.titleClassName} pl-1`;return o.jsxs("div",{className:w,children:[o.jsx(Ot,{text:!0,icon:"pi pi-trash",className:m.togglerClassName,onClick:()=>c(A),"aria-label":"Submit"}),o.jsx("span",{className:C,children:`Rule ${A+1}`})]})},l=(m,A)=>{var C;const w=[...((C=e==null?void 0:e.conditionalTabRules)==null?void 0:C.rules)||[]];w[m].conditions=w[m].conditions.filter((x,T)=>A!==T),n(x=>({...x,conditionalTabRules:{...x.conditionalTabRules,rules:w}}))},c=m=>{var x;const A=[...(e==null?void 0:e.conditionalTabRules.rules)||[]],w=A.filter((T,S)=>m!==S);n(T=>({...T,conditionalTabRules:{...T.conditionalTabRules,rules:w}}));const C=A[m];(x=C==null?void 0:C.conditions)==null||x.map(T=>{const S=i?_t.findIndex(i,_=>{var M;return(_==null?void 0:_.uuid)===((M=T==null?void 0:T.tab)==null?void 0:M.uuid)}):-1,E=i[S];E&&(E.isHidden=!1,a(S,E))})};let u=[...i].filter(function(m,A){return A!==r});u.map(m=>({uuid:m==null?void 0:m.uuid,title:m==null?void 0:m.title}));const d=(m,A,w)=>{const C=[...(e==null?void 0:e.conditionalTabRules.rules)||[]];C[A].conditions[w].option=m==null?void 0:m.value,n(x=>({...x,conditionalTabRules:{...x.conditionalTabRules,rules:C}}))},f=(m,A,w)=>{const C=[...(e==null?void 0:e.conditionalTabRules.rules)||[]];C[A].conditions[w].tab=m==null?void 0:m.value,n(S=>({...S,conditionalTabRules:{...S.conditionalTabRules,rules:C}}));const x=_t.findIndex(i,S=>{var E;return(S==null?void 0:S.uuid)===((E=m==null?void 0:m.value)==null?void 0:E.uuid)}),T=i[x];T&&(T.isHidden=!0,a(x,T))},h=()=>{n(m=>({...m,conditionalTabRules:{...m.conditionalTabRules,rules:[...m.conditionalTabRules.rules,{conditions:[]}]}}))},g=m=>{const A=[...(e==null?void 0:e.conditionalTabRules.rules)||[]];A[m].conditions=[...A[m].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&&((v=e==null?void 0:e.conditionalTabRules)==null?void 0:v.rules.map((m,A)=>o.jsx(ii,{className:"mb-3",header:`Rule ${A+1}`,headerTemplate:w=>s(w,A),children:o.jsxs("div",{children:[m==null?void 0:m.conditions.map((w,C)=>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(Pa,{value:w.tab,options:u,onChange:x=>f(x,A,C),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(Pa,{value:w==null?void 0:w.option,options:e==null?void 0:e.options,onChange:x=>d(x,A,C),optionLabel:"optionText.english",placeholder:"Select option"})}),o.jsx("div",{className:"col-1",children:o.jsx(Ot,{text:!0,icon:"pi pi-trash",className:"p-button-danger button-sm",tooltip:"Field Settings",onClick:()=>l(A,C),tooltipOptions:{position:"top"}})})]})},C)),o.jsx(Ot,{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(Ot,{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"})]})},tse=t=>{var x;const{fieldState:e,setFieldState:n,section:r,formBuilderFormLayout:i,sectionSettingUpdate:a,page:s}=t,[l]=k.useState([]),{schemaBuilderUpdate:c,formBuilderFormSchema:u}=sn(),d=(T,S)=>{const E=`${T.className} justify-content-start`,_=`${T.titleClassName} pl-1`;return o.jsxs("div",{className:E,children:[o.jsx(Ot,{text:!0,icon:"pi pi-trash",className:T.togglerClassName,onClick:()=>f(S),"aria-label":"Submit"}),o.jsx("span",{className:_,children:`Rule ${S+1}`})]})},f=T=>{var M;const S=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]],E=S[T];(M=E==null?void 0:E.conditions)==null||M.map(N=>{var H;const F=_t.findIndex(i,O=>{var j;return(O==null?void 0:O.uuid)===((j=N==null?void 0:N.tab)==null?void 0:j.uuid)}),P=i?_t.findIndex(i[F].children,O=>{var j;return(O==null?void 0:O.uuid)===((j=N==null?void 0:N.section)==null?void 0:j.uuid)}):-1;if(P>=0){const O=(H=i[F])==null?void 0:H.children[P];O&&(O.isHidden=!1,a(F,P,O))}});const _=S.filter((N,F)=>T!==F);n(N=>({...N,conditionalSectionRules:{...N.conditionalSectionRules,rules:_}}))},h=T=>{var _;let S=!1;const E=i?i.filter(function(M){return(M==null?void 0:M.uuid)===(T==null?void 0:T.uuid)}):[];return(E==null?void 0:E.length)>0&&((_=E[0].children)==null?void 0:_.length)>1&&(S=!0),S},g=(T,S,E)=>{const _=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];_[S].conditions[E].option=T==null?void 0:T.value,n(M=>({...M,conditionalSectionRules:{...M.conditionalSectionRules,rules:_}}))},v=(T,S)=>{var M;const E=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]],_=E[T];(M=_==null?void 0:_.conditions)==null||M.map(N=>{var O;const F=_t.findIndex(i,j=>{var U;return(j==null?void 0:j.uuid)===((U=N==null?void 0:N.tab)==null?void 0:U.uuid)}),P=i?_t.findIndex(i[F].children,j=>{var U;return(j==null?void 0:j.uuid)===((U=N==null?void 0:N.section)==null?void 0:U.uuid)}):-1,H=(O=i[F])==null?void 0:O.children[P];console.log("sectionData",H),H&&(H.isHidden=!1,console.log("sectionData",H),a(F,P,H))}),E[T].conditions=E[T].conditions.filter((N,F)=>S!==F),n(N=>({...N,conditionalSectionRules:{...N.conditionalSectionRules,rules:E}}))},m=(T,S,E)=>{var H,O;const _=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];_[S].conditions[E].section=T==null?void 0:T.value;const M=(O=(H=_[S].conditions[E])==null?void 0:H.tab)==null?void 0:O.uuid,N=_t.findIndex(i,j=>(j==null?void 0:j.uuid)===M);n(j=>({...j,conditionalSectionRules:{...j.conditionalSectionRules,rules:_}}));const F=i?_t.findIndex(i[N].children,j=>{var U;return(j==null?void 0:j.uuid)===((U=T==null?void 0:T.value)==null?void 0:U.uuid)}):-1,P=i[N].children[F];P&&(P.isHidden=!0,a(N,F,P))},A=T=>{const S=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];S[T].conditions=[...S[T].conditions,{option:null,tab:{title:s==null?void 0:s.title,uuid:s==null?void 0:s.uuid},section:null}],n(E=>({...E,conditionalSectionRules:{...E.conditionalSectionRules,rules:S}}))},w=()=>{n(S=>({...S,conditionalSectionRules:{...S.conditionalSectionRules,rules:[...S.conditionalSectionRules.rules,{uuid:nt(),conditions:[]}]}}));const T=[...(u==null?void 0:u.conditionalSectionsRules)||[]];c({conditionalSectionsRules:[...T,{fieldId:e==null?void 0:e.uuid,uuid:nt(),conditions:[]}]})},C=T=>{var E;const S=i==null?void 0:i.filter(function(_){return(_==null?void 0:_.uuid)===(T==null?void 0:T.uuid)});if(S&&(S==null?void 0:S.length)>0){const _=(E=S[0])==null?void 0:E.children.filter(function(M){return(M==null?void 0:M.uuid)!==(r==null?void 0:r.uuid)});if((_==null?void 0:_.length)>0)return _}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((T,S)=>o.jsx(ii,{className:"mb-3",header:`Rule ${S+1}`,headerTemplate:E=>d(E,S),children:o.jsxs("div",{children:[T==null?void 0:T.conditions.map((E,_)=>{var M,N;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:(N=(M=E==null?void 0:E.tab)==null?void 0:M.title)==null?void 0:N.english})]}),o.jsxs("div",{className:"col-3 p-fluid",children:[o.jsxs("label",{children:["Select section",E.value]}),o.jsx(Pa,{disabled:!h(E==null?void 0:E.tab),value:E.section,options:C(E.tab),onChange:F=>m(F,S,_),optionLabel:"heading.english",placeholder:"Select option"})]}),o.jsxs("div",{className:"col-4 p-fluid",children:["when option is selected",o.jsx(Pa,{disabled:!h(E==null?void 0:E.tab),value:E==null?void 0:E.option,options:e==null?void 0:e.options,onChange:F=>g(F,S,_),optionLabel:"optionText.english",placeholder:"Select option"})]}),o.jsxs("div",{className:"col-1",children:[o.jsx("br",{}),o.jsx(Ot,{text:!0,icon:"pi pi-trash",className:"p-button-danger button-sm",tooltip:"Field Settings",onClick:()=>v(S,_),tooltipOptions:{position:"top"}})]}),!h(E.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"]})})]})},_)}),o.jsx("div",{children:o.jsx("div",{className:"flex",children:o.jsx(Ot,{text:!0,className:"btn-sm mt-3 ",label:"+ Add Condition",onClick:()=>A(S),size:"small"})})})]})},S)),o.jsx(Ot,{text:!0,icon:"pi pi-plus",onClick:()=>w(),className:"p-mt-4",label:"Add Rule",size:"small"})]})},nse=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((v,m)=>d!==m);n(v=>({...v,inlineConditionalRules:{...v.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(Ot,{text:!0,icon:"pi pi-trash",className:d.togglerClassName,onClick:()=>r(f),"aria-label":"Submit"}),o.jsx("span",{className:g,children:`Rule ${f+1}`})]})},a=(d,f,h)=>{const g=[...(e==null?void 0:e.inlineConditionalRules.rules)||[]];g[f].conditions[h].value=d==null?void 0:d.value,n(v=>({...v,inlineConditionalRules:{...v.inlineConditionalRules,rules:g}}))},s=(d,f)=>{const h=[...(e==null?void 0:e.inlineConditionalRules.rules)||[]];h[d].conditions=h[d].conditions.filter((g,v)=>f!==v),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(ii,{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(Pa,{value:h.value,options:e==null?void 0:e.options,onChange:v=>a(v,f,g),optionLabel:"optionText.english",placeholder:"Select option"})}),o.jsx("div",{className:"col-1",children:o.jsx(Ot,{text:!0,icon:"pi pi-trash",className:"p-button-danger button-sm",tooltip:"Field Settings",onClick:()=>s(f,g),tooltipOptions:{position:"top"}})})]})},"inline-rules-"+g)),o.jsx(Ot,{text:!0,onClick:()=>l(f),className:"p-mt-4",icon:"pi pi-plus",label:"Add Condition",size:"small"})]})},f)),o.jsx(Ot,{text:!0,onClick:()=>c(),className:"p-mt-4",icon:"pi pi-plus",label:"Add Rule",size:"small"})]})},rse=t=>{const{fieldState:e,pageIndex:n,section:r,setFieldState:i,page:a}=t,{pageSettingUpdate:s,formBuilderFormLayout:l,sectionSettingUpdate:c}=sn();return o.jsx(o.Fragment,{children:o.jsxs("div",{className:" scroll-height-250",children:[o.jsx(nse,{fieldState:e,setFieldState:i}),o.jsx("hr",{}),o.jsx(ese,{fieldState:e,setFieldState:i,pageIndex:n,formBuilderFormLayout:l,pageSettingUpdate:s}),o.jsx("hr",{}),o.jsx(tse,{fieldState:e,setFieldState:i,section:r,formBuilderFormLayout:l,sectionSettingUpdate:c,page:a}),o.jsx("hr",{})]})})},ise=t=>{const{fieldState:e,setFieldState:n}=t,[r,i]=k.useState(""),[a,s]=k.useState([""]),[l,c]=k.useState(!1),[u,d]=k.useState(0),[f,h]=k.useState(!1),{updateGlobalToast:g}=Ht(),v=()=>{h(!0)},m=()=>{var j;const H=((j=e==null?void 0:e.reviewerChecklist)==null?void 0:j.length)>=0?[...e.reviewerChecklist]:[];H.push({uuid:nt(),checklist:r,action:a,agree:null,selectAction:[],other:{isOther:!1,description:""},reviewerComments:""});const O={...e,reviewerChecklist:H};n(U=>({...U,...O})),h(!1),i(""),s([""])},A=()=>{h(!1),i(""),s([""])},w=H=>{const O=[...e.reviewerChecklist];O.splice(H,1);const j={...e,reviewerChecklist:O};n(U=>({...U,...j}))},C=(H,O)=>{c(!0);const{checklist:j,action:U}=H;h(!0),d(O),setTimeout(()=>{i(j),s(U)},1e3)},x=(H,O)=>o.jsxs(o.Fragment,{children:[o.jsx(Ot,{text:!0,type:"button",className:"p-button-info",icon:"pi pi-pencil",onClick:()=>C(H,O==null?void 0:O.rowIndex)}),o.jsx(Ot,{text:!0,type:"button",className:"p-button-danger",icon:"pi pi-trash",onClick:()=>w(O==null?void 0:O.rowIndex)})]}),T=H=>{var O;return o.jsx(o.Fragment,{children:(O=H==null?void 0:H.action)==null?void 0:O.length})},S=H=>{const O=[...a];O.splice(H,1),s(O)},E=()=>{const H=[...e.reviewerChecklist];H[u]={checklist:r,action:a};const O={...e,reviewerChecklist:H};n(j=>({...j,...O})),h(!1),c(!1)},_=()=>o.jsx("div",{children:l?o.jsx(Ot,{text:!0,className:"mb-5 p-button-success",label:"Edit Checklist",onClick:()=>{E()}}):o.jsx(Ot,{text:!0,className:"mb-5 p-button-success",label:"Add Checklist",onClick:()=>{m()}})}),M=H=>{n(O=>({...O,reviewerChecklist:H==null?void 0:H.value}))},N=H=>{navigator.clipboard.writeText(JSON.stringify(H))};function F(H){try{JSON.parse(H)}catch{return!1}return!0}const P=async()=>{var j;const H=await navigator.clipboard.readText();let O="";if(F(H)){const U=JSON.parse(H);if((j=U[0])!=null&&j.checklist){const le={..._t.cloneDeep(e),reviewerChecklist:U};n(R=>({...R,...le}));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(Os,{maximizable:!0,header:"Add Checklist options for admin to reveiw",visible:f,style:{width:"30vw"},onHide:()=>A(),footer:_(),children:o.jsxs("div",{className:"scroll-height-500",children:[o.jsx("h5",{children:"Checklist"}),o.jsx(so,{rows:2,cols:50,value:r,onChange:H=>{var O;i((O=H==null?void 0:H.target)==null?void 0:O.value)}}),o.jsx("h5",{children:"Actions when admin selects NO as invalid"}),a.map((H,O)=>o.jsxs("div",{children:[O+1,"."," ",o.jsx(so,{value:H,onChange:j=>{var le;const U=[...a];U[O]=(le=j==null?void 0:j.target)==null?void 0:le.value,s(U)},rows:2,cols:50})," ",o.jsx(Ot,{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(Ot,{outlined:!0,className:" p-button-primary mr-2",onClick:()=>{s([...a,""])},children:"Add Action"})]})})," ",o.jsx("h5",{children:"Reviewer Checklist"}),o.jsx(Ot,{className:"mb-5 mr-2 p-button-success",label:"Add Review Checklist",onClick:()=>{v()}}),o.jsx(Ot,{outlined:!0,label:"Copy Schema ",onClick:()=>{N([...(e==null?void 0:e.reviewerChecklist)||[]])},className:"mb-5 mr-2"}),o.jsx(Ot,{outlined:!0,label:"Paste Checklist ",onClick:()=>{P()},className:"mb-5 p-button-info"}),o.jsx("div",{className:"card",children:o.jsxs(ro,{value:e==null?void 0:e.reviewerChecklist,reorderableRows:!0,onRowReorder:M,scrollable:!0,children:[o.jsx(Sr,{rowReorder:!0,style:{width:"3em"}}),o.jsx(Sr,{field:"checklist",header:"Checklist"}),o.jsx(Sr,{field:"actions",header:"Actions",body:H=>T(H)}),o.jsx(Sr,{header:"",body:(H,O)=>x(H,O)})]})})]})},ase=t=>{const{onHandleChangeLayoutSettings:e,fieldState:n}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Yr,{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(Yr,{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(Yr,{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(Yr,{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(Yr,{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(Yr,{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(Yr,{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}})]})]})},sse=t=>{var c,u,d;const{fieldState:e,setFieldState:n}=t,{formBuilderSchemaLanguages:r}=sn(),i=()=>{n(f=>Object.assign({},f,{options:[...f.options,{uuid:nt(),optionText:{english:""},value:"",score:0,hyperlinkText:{english:""},abbreviationText:{english:""},custom_values:{}}]}))},a=f=>{n(h=>({...h,fieldType:{...h==null?void 0:h.fieldType,type:f}}))},s=(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(ia,{inputId:"renderType1",name:"renderType",value:"radio",onChange:f=>{a(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(ia,{inputId:"renderType2",name:"renderType",value:"dropdown",onChange:f=>{a(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(ia,{inputId:"dataSourceType1",name:"dataSourceType",value:"custom",onChange:f=>{s("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(ia,{inputId:"dataSourceType2",name:"dataSourceType",value:"database",onChange:f=>{s("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(Pa,{value:e==null?void 0:e.dataSource,onChange:f=>{var h;s("optionLabel",(h=f.value)==null?void 0:h.optionLabel),s("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(Pa,{value:e==null?void 0:e.optionValue,onChange:f=>s("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(ao,{activeIndex:0,children:r!=null&&r.length?r.map((f,h)=>o.jsx(io,{tabIndex:h,header:f==null?void 0:f.language,children:o.jsx(fN,{enableCopyPaste:!0,isCustomValue:!0,fieldState:e,setFieldState:n,language:f})},h)):""})}),o.jsx(Ot,{text:!0,className:"mr-3",label:"Add",icon:"pi pi-plus",onClick:()=>i(),"aria-label":"Add"})]})})]})},ose=t=>{var u,d;const{option:e,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a}=t,{userSelectedLanguage:s}=sn(),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(Ot,{text:!0,icon:"pi pi-trash",size:"small",onClick:()=>{console.log("field",h==null?void 0:h.uuid),a(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(Yr,{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(Ot,{text:!0,label:"Add Field",onClick:()=>{i(e==null?void 0:e.uuid)}}),o.jsx(ss,{children:((u=e.children)==null?void 0:u.length)&&((d=e.children)==null?void 0:d.map((f,h)=>{var g,v;return o.jsx(Cr,{header:(g=f.label)==null?void 0:g[s==null?void 0:s.type],headerTemplate:m=>c(m,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(m=>o.jsxs("div",{className:"mr-3",children:[o.jsx(ia,{inputId:"ingredient1",name:"fieldType",value:m==null?void 0:m.type,onChange:()=>r(f==null?void 0:f.uuid,{type:m==null?void 0:m.type}),checked:(f==null?void 0:f.type)===(m==null?void 0:m.type)}),o.jsx("label",{htmlFor:"ingredient1",className:"ml-2",children:m==null?void 0:m.label})]},`field_type_${f==null?void 0:f.uuid}`)))}),o.jsxs("div",{className:"field-checkbox mt-3",children:[o.jsx(Yr,{inputId:"isRequired",onChange:m=>{r(f==null?void 0:f.uuid,{attributes:{required:m.checked}})},checked:(v=f==null?void 0:f.attributes)==null?void 0:v.required}),o.jsxs("label",{htmlFor:"showConditionalFields",children:["Is Required"," "]})]}),o.jsxs(ss,{children:[o.jsx(Cr,{header:"Text",children:o.jsx(ii,{header:"Text Settings",toggleable:!0,collapsed:!0,children:o.jsx("div",{className:"",children:o.jsx(nD,{language:s,fieldState:f,onHandleChange:(m,A,w)=>{r(f==null?void 0:f.uuid,{[m]:{[A==null?void 0:A.type]:w}})}})})})}),(f==null?void 0:f.type)==="radio"&&o.jsx(Cr,{header:"Radio",children:o.jsx("div",{style:{width:"100%"},children:o.jsx(b7,{option:e,fieldState:f,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a})})})]})]})},`field-tab-${h}-${f==null?void 0:f.uuid}-${e==null?void 0:e.uuid}`)}))})]})]})},b7=t=>{var s,l;const{fieldState:e,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a}=t;return o.jsx(o.Fragment,{children:o.jsx(ss,{children:((s=e==null?void 0:e.options)==null?void 0:s.length)&&((l=e==null?void 0:e.options)==null?void 0:l.map((c,u)=>o.jsx(Cr,{header:`Option - ${c==null?void 0:c.label}`,children:o.jsx(ose,{option:c,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a})},`hirarchey-option-${u}`)))})})};var gN={},lse=Fi&&Fi.__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 a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},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)}}(),D3=Fi&&Fi.__assign||function(){return D3=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},D3.apply(this,arguments)},cse=Fi&&Fi.__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]}),use=Fi&&Fi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),mN=Fi&&Fi.__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)&&cse(e,t,n);return use(e,t),e},dse=Fi&&Fi.__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},fse=Fi&&Fi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gN,"__esModule",{value:!0});var y7=mN(k),hse=fse(GI),Zu=mN(la);function vN(t){return t&&t.replace(/&nbsp;|\u202F|\u00A0/g," ").replace(/<br \/>/g,"<br>")}function pse(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 gse=function(t){lse(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}:y7.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 a=i.innerHTML;if(n.props.onChange&&a!==n.lastHtml){var s=Object.assign({},r,{target:{value:a}});n.props.onChange(s)}n.lastHtml=a}},n}return e.prototype.render=function(){var n=this,r=this.props,i=r.tagName,a=r.html,s=r.innerRef,l=dse(r,["tagName","html","innerRef"]);return y7.createElement(i||"div",D3(D3({},l),{ref:typeof s=="function"?function(c){s(c),n.el.current=c}:s||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:a}}),this.props.children)},e.prototype.shouldComponentUpdate=function(n){var r=this.props,i=this.getEl();return!i||vN(n.html)!==vN(i.innerHTML)?!0:r.disabled!==n.disabled||r.tagName!==n.tagName||r.className!==n.className||r.innerRef!==n.innerRef||r.placeholder!==n.placeholder||!(0,hse.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,pse(n))},e.propTypes={html:Zu.string.isRequired,onChange:Zu.func,disabled:Zu.bool,tagName:Zu.string,className:Zu.string,style:Zu.object,innerRef:Zu.oneOfType([Zu.object,Zu.func])},e}(y7.Component),N3=gN.default=gse;const mse=t=>{var w;const e=k.useRef(null),{field:n,fieldIndex:r,pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,path:c}=t,[u,d]=k.useState(n),{userSelectedLanguage:f,fieldSettingUpdate:h,fieldSettingUpdateInlineConditional:g,gridComponentFieldSettingUpdate:v}=sn(),m=(C,x,T)=>{d(S=>({...S,[C]:{...S[C],[x==null?void 0:x.type]:T}}))};k.useEffect(()=>(A(),()=>{}),[u]);const A=()=>{const C=c.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?g(C[fa],C[ha],C[Ca],C[xa],C[Ta],C[Fa],C[Xo],C[wo],u):(C==null?void 0:C.length)>Fa&&(C==null?void 0:C.length)===Bl+1&&(n!=null&&n.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?v(C[fa],C[ha],C[Ca],C[xa],C[Ta],C[5],C[6],C[7],u):h(i,a,s,l,r,{...n,label:u==null?void 0:u.label})};return o.jsx(o.Fragment,{children:o.jsx(N3,{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:C=>{var x;m("label",f,(x=C==null?void 0:C.target)==null?void 0:x.value)},tagName:"article"})})},ca=t=>{const{sectionIndex:e,fieldIndex:n}=t,{formBuilderFormSchema:r}=sn();return(r==null?void 0:r.enableFieldEnumeration)===!0?o.jsx("span",{className:"mr-2",children:o.jsx(F8,{classes:"font-medium p-1 bg-primary",level:"purple",value:`${e+1}.${n+1}`})}):o.jsx(o.Fragment,{})},A7=t=>{var f,h,g,v,m,A,w,C,x,T,S,E,_,M;const{field:e,update:n,value:r,isFirst:i,isDisabled:a}=t,{isBuilderMode:s,isAdmin:l}=Ht(),{selectedLanguage:c}=sn(),[u,d]=k.useState(0);return k.useEffect(()=>{const N=Gt.addListener("onSubmitUserForm",()=>{var P;(P=e==null?void 0:e.attributes)!=null&&P.required?r!=null&&r[e.uuid]?e.isValid=t3:e.isValid=D8:e.isValid=1}),F=Gt.addListener("OnInvalidFieldCatch",P=>{(e==null?void 0:e.uuid)===(P==null?void 0:P.fieldId)?d(N8):d(O8)});return()=>{N.remove(),F.remove()}}),o.jsxs("div",{className:"",children:[(e==null?void 0:e.type)===yZ&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex align-items-center mb-3",children:[" ",i===!0&&o.jsx(ca,{...t}),((f=e==null?void 0:e.attributes)==null?void 0:f.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",s?o.jsx(mse,{...t}):o.jsx("div",{className:"text-gray-900 font-bold text-xl",children:(h=e==null?void 0:e.label)==null?void 0:h[c]})]}),((g=e==null?void 0:e.options)==null?void 0:g.length)&&((v=e==null?void 0:e.options)==null?void 0:v.map(N=>{var F,P;return o.jsxs("div",{children:[o.jsxs("div",{className:"flex align-items-center mb-2",children:[o.jsx(ia,{inputId:N.uuid,name:e==null?void 0:e.uuid,value:N.uuid,onChange:H=>{(!l||!a)&&n(e==null?void 0:e.uuid,H==null?void 0:H.value)},checked:(r==null?void 0:r[e.uuid])===N.uuid,disabled:l||a}),o.jsx("label",{htmlFor:N.uuid,className:"ml-2",children:N.label})]}),(N==null?void 0:N.enableConditionalField)===!0&&(r==null?void 0:r[e==null?void 0:e.uuid])===(N==null?void 0:N.uuid)&&(N==null?void 0:N.children)&&((F=N==null?void 0:N.children)==null?void 0:F.length)>0&&((P=N==null?void 0:N.children)==null?void 0:P.map(()=>o.jsx(A7,{...t},`radio_child_${r==null?void 0:r[e==null?void 0:e.uuid]}`)))]},`${N.uuid}-radio-wrapper-${e==null?void 0:e.uuid}`)}))]}),(e==null?void 0:e.type)===AZ&&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[c]]}),o.jsx(wn,{className:"mt-2",onChange:N=>{var F;return n(e==null?void 0:e.uuid,(F=N==null?void 0:N.target)==null?void 0:F.value)},value:r==null?void 0:r.uuid,placeholder:(A=e==null?void 0:e.placeholder)==null?void 0:A[c],disabled:l||a})]})}),(e==null?void 0:e.type)===wZ&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((w=e==null?void 0:e.attributes)==null?void 0:w.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[c]]}),o.jsx(ef,{className:"mt-2",onChange:N=>{var F;return n(e==null?void 0:e.uuid,(F=N==null?void 0:N.target)==null?void 0:F.value)},value:r==null?void 0:r.uuid,placeholder:(C=e==null?void 0:e.placeholder)==null?void 0:C[c],disabled:l||a})]})}),(e==null?void 0:e.type)===SZ&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((x=e==null?void 0:e.attributes)==null?void 0:x.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[c]]}),o.jsx(so,{className:"mt-2",onChange:N=>{var F;return n(e==null?void 0:e.uuid,(F=N==null?void 0:N.target)==null?void 0:F.value)},value:r==null?void 0:r.uuid,placeholder:(T=e==null?void 0:e.placeholder)==null?void 0:T[c],disabled:l||a})]})}),o.jsx("div",{children:((S=e==null?void 0:e.helperText)==null?void 0:S[c])!==""&&o.jsx("small",{children:(E=e==null?void 0:e.helperText)==null?void 0:E[c]})}),o.jsx("div",{children:((_=e==null?void 0:e.attributes)==null?void 0:_.required)&&o.jsx("small",{className:"error",children:u===1&&!(r!=null&&r[e.uuid])?(M=e==null?void 0:e.validationMesssage)==null?void 0:M.language:""})})]},`${e==null?void 0:e.uuid}-radio`)},vse=t=>{const{hirarechicalRadioSchemaState:e}=t,[n,r]=k.useState({});return o.jsx("div",{children:o.jsx(A7,{schema:e,field:e,update:(i,a)=>{const s={...n};s[i]=a,r(s)},value:n,sectionIndex:0,fieldIndex:0,pageIndex:0,rowIndex:0,columnIndex:0,path:""})})},w7={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},bse={uuid:nt(),...w7,type:"radio",value:null,options:[{uuid:nt(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:nt(),label:"No",value:null,enableConditionalField:!0,children:[]}]};({uuid:nt(),...w7,options:(nt(),{uuid:nt(),...w7,options:(nt(),nt())},nt())});const yse=t=>{const{fieldState:e,setFieldState:n}=t,r=(f,h,g)=>g==null?void 0:g.map(v=>{var m;return v.uuid===f?{...v,...h}:{...v,children:v!=null&&v.children&&((m=v==null?void 0:v.children)==null?void 0:m.length)>0?[...v.children.map(A=>A.type==="radio"?{...A,options:r(f,h,(A==null?void 0:A.options)||[])}:{...A})]:[]}}),i=(f,h,g)=>{const v=r(f,g,e.options);n(m=>({...m,options:v}))},a=(f,h,g)=>g==null?void 0:g.map(v=>{var m;return{...v,children:v!=null&&v.children&&((m=v==null?void 0:v.children)==null?void 0:m.length)>0?[...v.children.map(A=>A.uuid===f?{...A,...h}:{...A,options:a(f,h,A==null?void 0:A.options)})]:[]}}),s=(f,h)=>{const g=a(f,h,e.options);n(v=>({...v,options:g}))},l=(f,h)=>h==null?void 0:h.map(g=>{var v;return{...g,children:g!=null&&g.children&&((v=g==null?void 0:g.children)==null?void 0:v.length)>0?[...g.children.filter(m=>{if(m.uuid!==f)return{...m,options:l(f,m==null?void 0:m.options)}})]:[]}}),c=(f,h,g)=>g==null?void 0:g.map(v=>{var m;return v.children&&v.uuid===f?{...v,children:[...v.children,h]}:{...v,children:v!=null&&v.children&&((m=v==null?void 0:v.children)==null?void 0:m.length)>0?[...v.children.map(A=>({...A,options:c(f,h,A==null?void 0:A.options)}))]:[]}}),u=f=>{const h=c(f,{...bse,isValid:0,uuid:nt(),options:[{uuid:nt(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:nt(),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(b7,{fieldState:e,updateCondtionOption:i,updateChildrenField:s,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(vse,{hirarechicalRadioSchemaState:e})]})]})})})},Qi=t=>{var Z;const{formBuilderFormSchema:e,fieldSettingUpdate:n,fieldSettingUpdateInlineConditional:r,formBuilderSchemaLanguages:i,pageSettingUpdate:a,formBuilderFormLayout:s,formBuilderPublishedStatus:l,gridComponentFieldSettingUpdate:c}=sn(),{renderType:u}=Ht(),{visibilty:d,field:f,closeSettingFieldSidebar:h,pageIndex:g,sectionIndex:v,rowIndex:m,columnIndex:A,fieldIndex:w,path:C,row:x,typeName:T}=t,{updateGlobalToast:S}=Ht(),[E,_]=k.useState(f),M=C.split("-"),N=()=>{const K=C.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?r(K[fa],K[ha],K[Ca],K[xa],K[Ta],K[Fa],K[Xo],K[wo],E):(K==null?void 0:K.length)>Fa&&(K==null?void 0:K.length)===Bl+1&&(E!=null&&E.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?c(K[fa],K[ha],K[Ca],K[xa],K[Ta],K[5],K[6],K[7],E):(n(g,v,m,A,w,{...E}),setTimeout(()=>{Gt.emit("OnSignatureSettingChange",{})},1e3),setTimeout(()=>{Gt.emit("onUpdateField",{})},1e3)),S({showToast:!0,toastMessage:"Updated",toastDetail:`${T} updated`,toastType:"success"})},F=(K,W,ge)=>{_(ve=>({...ve,[K]:{...ve[K],[W==null?void 0:W.type]:ge}}))},P=(K,W)=>{_(ge=>({...ge,attributes:{...ge.attributes,[K]:W}}))},H=(K,W)=>{_(ge=>({...ge,[K]:W}))},O=(K,W)=>{_(ge=>({...ge,inlineConditional:{...ge.inlineConditional,[K]:W}}))},j=()=>{},U=()=>{_(K=>({...K,data:[...K.data,{uuid:nt(),dataKey:"",value:""}]}))},le=()=>{_(K=>Object.assign({},K,{options:[...K.options,{uuid:nt(),optionText:{english:""},value:"",score:0,hyperlinkText:{english:""},abbreviationText:{english:""},custom_values:{}}]}))},R=()=>{},X=()=>{},ce=()=>{},Y=()=>{},ae=K=>{var Ie;const W=[...(E==null?void 0:E.conditionalTabRules.rules)||[]],ge=W.filter((be,de)=>K!==de);_(be=>({...be,conditionalTabRules:{...be.conditionalTabRules,rules:ge}}));const ve=W[K];(Ie=ve==null?void 0:ve.conditions)==null||Ie.map(be=>{const de=_t.findIndex(s,q=>{var ee;return(q==null?void 0:q.uuid)===((ee=be==null?void 0:be.tab)==null?void 0:ee.uuid)}),ne=s[de];ne&&(ne.isHidden=!1,a(de,ne))})},re=(K,W)=>{const ge=[...(E==null?void 0:E.conditionalTabRules.rules)||[]];ge[K].conditions=ge[K].conditions.filter((ve,Ie)=>W!==Ie),_(ve=>({...ve,conditionalTabRules:{...ve.conditionalTabRules,rules:ge}}))};return o.jsx(o.Fragment,{children:o.jsxs(To,{style:{width:"80vw",zIndex:7e3},visible:d,position:"left",className:"p-sidebar-lg",onHide:()=>h(),header:()=>{var K;return o.jsx("div",{className:"flex align-items-center gap-2 justify-content-between",children:o.jsxs("div",{className:"text-gray-900 font-bold text-2xl",children:[(K=f==null?void 0:f.label)==null?void 0:K.english," "]})})},"aria-label":"Field Setting Sidebar",children:[o.jsx("div",{className:"",children:o.jsxs(ss,{children:[o.jsx(Cr,{header:"Text",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(ao,{activeIndex:0,children:i!=null&&i.length?i.map((K,W)=>o.jsx(io,{tabIndex:W,header:K==null?void 0:K.language,children:o.jsx(nD,{language:K,fieldState:E,onHandleChange:F,...t})},W)):""})})}),(E==null?void 0:E.isValidationTabEnabled)===!0&&o.jsx(Cr,{header:"Validation",children:o.jsx(xte,{fieldState:E,onHandleChangeLayoutSettings:H,onHandleChangeAttributesSetttings:P,...t})}),o.jsx(Cr,{header:"Attributes",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(Tte,{fieldState:E,onHandleChangeLayoutSettings:H,onHandleChangeAttributesSetttings:P})})}),(E==null?void 0:E.isLayoutTabEnabled)===!0&&o.jsx(Cr,{header:"Layout",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(Bte,{fieldState:E,onHandleChangeLayoutSettings:H})})}),(E==null?void 0:E.isDynamicListingTabEnabled)===!0&&o.jsx(Cr,{header:"Dynamic Options",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(sse,{fieldState:E,setFieldState:_})})}),(E==null?void 0:E.options)!==void 0&&(E==null?void 0:E.data)&&o.jsx(Cr,{header:"Data",children:o.jsxs("div",{className:"scroll-height-200",children:[o.jsx(Vte,{onHandleChangeLayoutSettings:H,fieldState:E,setFieldState:_}),o.jsx(Ot,{className:"mr-3",label:"Data Option",icon:"pi pi-plus",onClick:()=>U(),"aria-label":"Add"})]})}),o.jsx(Cr,{header:"Table view options",children:o.jsx(ase,{fieldState:E,onHandleChangeLayoutSettings:H})}),(E==null?void 0:E.componentType)!=="radio-hierarchal"&&(E==null?void 0:E.options)!==void 0&&f.componentType!=="grid-component"&&f.componentType!=="matrix-dropdown"&&f.componentType!=="table"&&o.jsxs(Cr,{header:"Options",children:[(E==null?void 0:E.componentType)!=="radio-hierarchal"&&o.jsx("div",{className:"flex justify-content-end",children:o.jsx(Ot,{className:"mr-3 mb-2",label:"Option",icon:"pi pi-plus",onClick:()=>le(),"aria-label":"Option"})}),o.jsxs("div",{className:"scroll-height-200 px-4",children:[o.jsx(ao,{activeIndex:0,children:i!=null&&i.length?i.map((K,W)=>o.jsx(io,{tabIndex:W,header:K==null?void 0:K.language,children:o.jsx(fN,{enableAbbreviationColumn:(E==null?void 0:E.componentType)!=="radio-hierarchal",enableHyperTextColumn:(E==null?void 0:E.componentType)!=="radio-hierarchal",enableAddNewColumn:(E==null?void 0:E.componentType)!=="radio-hierarchal",enableCopyPaste:(E==null?void 0:E.componentType)!=="radio-hierarchal",isCustomValue:!1,fieldState:E,setFieldState:_,language:K})},W)):""}),(E==null?void 0:E.isHierarchalCondionalTabEnabled)===!0&&o.jsx(b7,{fieldState:E,onHandleChangeLayoutSettings:H,removeChildrenField:Y,addChildrenField:ce,updateChildrenField:X,updateCondtionOption:R})]})]}),(E==null?void 0:E.componentType)==="radio-hierarchal"&&(E==null?void 0:E.options)!==void 0&&f.componentType!=="grid-component"&&f.componentType!=="matrix-dropdown"&&f.componentType!=="table"&&o.jsx(Cr,{header:"Hierarchal Options",children:o.jsx(yse,{fieldState:E,setFieldState:_})}),u===e3&&(E==null?void 0:E.inlineConditionalRules)!==void 0&&!(x!=null&&x.rowIsRepeatable)&&(M==null?void 0:M.length)<wo+1&&o.jsx(Cr,{header:"Conditional",children:o.jsx(rse,{handleRemoveConditionalTabRule:ae,handleRemoveConditionalTabRuleCondition:re,onHandleSelectInlineConditionalOption:j,onHandleChangeLayoutSettings:H,onHandleChangeInlineConditionaltSetttings:O,fieldState:E,setFieldState:_,pageIndex:g,sectionIndex:v,...t})}),!((Z=t==null?void 0:t.row)!=null&&Z.rowIsRepeatable)&&(e==null?void 0:e.enableReviewTask)===!0&&o.jsx(Cr,{header:"Admin reviewer checklist",children:o.jsx(ise,{fieldState:E,setFieldState:_})})]})}),o.jsx("div",{className:"w-full px-4 py-3 surface-100 sidebar-footer",children:o.jsxs("div",{className:"flex flex-row gap-2 align-items-center justify-content-end",children:[o.jsx(Ot,{text:!0,label:"Close",type:"button",icon:"pi pi-times",onClick:()=>h(),"aria-label":"Close",size:"small",className:"p-button-danger"}),!l&&o.jsx(Ot,{size:"small",label:"Update",type:"button",outlined:!0,onClick:()=>N(),"aria-label":"Update"})]})})]})})},ki=t=>{const[e,n]=k.useState(null),{field:r}=t,{userTaskSubmitFormData:i,updateUserFormDataSubmit:a,updateTaskFormData:s}=Ar(),{taskId:l}=Ht();k.useEffect(()=>{var v,m;if(i!==null&&e===null){let A=0;r!=null&&r.rowIsRepeatable?A=i.findIndex(w=>(w==null?void 0:w.rowId)===(r==null?void 0:r.uuid)):A=i.findIndex(w=>(w==null?void 0:w.fieldId)===(r==null?void 0:r.uuid)),n((v=i[A])!=null&&v.reviewerChecklist?(m=i[A])==null?void 0:m.reviewerChecklist:[])}return()=>{}},[r==null?void 0:r.rowIsRepeatable,r==null?void 0:r.uuid,e,i]);const c=v=>{const m=i.findIndex(w=>(w==null?void 0:w.fieldId)===(r==null?void 0:r.uuid)),A=[...i];A[m]={...A[m],reviewerChecklist:v},a(A),s(A,l,"/task/update/formdata/")},u=(v,m)=>{const A=e;A[m]={...A[m],agree:v==null?void 0:v.value},n([...A]),c(A)},d=(v,m)=>{const A=e;if(m!=null&&m.checked)A[v].selectAction.push(m==null?void 0:m.value);else{const w=A[v].selectAction.findIndex(C=>C===(m==null?void 0:m.value));A[v].selectAction.splice(w,1)}n([...A]),c(A)},f=(v,m)=>{const A=e;v!=null&&v.checked?A[m]={...A[m],other:{...A[m].other,isOther:!0}}:A[m]={...A[m],other:{...A[m].other,isOther:!1}},n([...A]),c(A)},h=(v,m)=>{var w;const A=e;A[m]={...A[m],other:{...A[m].other,description:(w=v==null?void 0:v.target)==null?void 0:w.value}},n([...A]),c(A)},g=(v,m,A)=>{var C;const w=e;w[A]={...w[A],[m]:(C=v==null?void 0:v.target)==null?void 0:C.value},n([...w]),c(w)};return o.jsx(o.Fragment,{children:e!==null&&(e==null?void 0:e.length)>0?o.jsx(o.Fragment,{children:o.jsx(ii,{header:"Reviewer Checklist",toggleable:!0,collapsed:!0,children:o.jsx("div",{className:"flex flex-row flex-wrap gap-2",children:e==null?void 0:e.map((v,m)=>{var A,w,C,x,T;return o.jsxs("div",{className:"card p-fluid",style:{width:250},children:[o.jsx("h6",{className:"mb-2",children:v==null?void 0:v.checklist}),o.jsx("br",{}),o.jsxs("div",{className:"flex flex-row gap-3 mb-2",children:[o.jsxs("div",{className:"field-radiobutton",children:[o.jsx(ia,{inputId:`yes-${m}`,name:"action",value:!0,onChange:S=>{u(S,m)},checked:(v==null?void 0:v.agree)===!0}),o.jsx("label",{htmlFor:`yes-${m}`,children:"Yes"})]}),o.jsxs("div",{className:"field-radiobutton",children:[o.jsx(ia,{inputId:`no-${m}`,name:"action",value:!1,onChange:S=>{u(S,m)},checked:(v==null?void 0:v.agree)===!1}),o.jsx("label",{htmlFor:`no-${m}`,children:"No"})]})]}),(v==null?void 0:v.agree)===!1&&o.jsxs("div",{className:"px-5 mb-3",children:[(v==null?void 0:v.action)&&Array.isArray(v.action)&&((A=v==null?void 0:v.action)==null?void 0:A.length)>0&&((w=v==null?void 0:v.action)==null?void 0:w.map((S,E)=>{var _;return o.jsxs("div",{children:[o.jsx(Yr,{value:S,checked:((_=v==null?void 0:v.selectAction)==null?void 0:_.length)>0?v==null?void 0:v.selectAction.some(M=>M===S):!1,onChange:M=>{d(m,M)}})," ",S," ",o.jsx("br",{}),o.jsx("br",{})]},`action-${m}-${E}`)})),o.jsx(Yr,{checked:(C=v==null?void 0:v.other)==null?void 0:C.isOther,onChange:S=>{f(S,m)}})," Other ",o.jsx("br",{}),o.jsx("br",{}),((x=v==null?void 0:v.other)==null?void 0:x.isOther)===!0&&o.jsxs("div",{className:"",children:[o.jsx("label",{children:"If other please specify the action point"}),o.jsx("br",{}),o.jsx(so,{className:"mt-3",value:(T=v==null?void 0:v.other)==null?void 0:T.description,onChange:S=>h(S,m)})]})]}),(v==null?void 0:v.agree)===!1&&o.jsxs("div",{className:"",children:[o.jsx("label",{children:"Reviewer Feedback "}),o.jsx("br",{}),o.jsx(so,{className:"mt-3",value:v==null?void 0:v.reviewerFeedback,onChange:S=>g(S,"reviewerFeedback",m)})]}),o.jsxs("div",{className:"",children:[o.jsx("label",{children:"Reviewer Comments / Notes (internal use only)"}),o.jsx("br",{}),o.jsx(so,{className:"mt-3",value:v==null?void 0:v.reviewerComments,onChange:S=>g(S,"reviewerComments",m)})]})]},`checklistIndex-${m}`)})})})}):o.jsx(o.Fragment,{children:o.jsx("div",{className:"text-gray-900 flex justify-content-center align-items-center",children:"No admin review is required"})})})},xi=t=>{const{isPreview:e,field:n,isAdmin:r,fieldWrap:i}=t,{userSelectedLanguage:a}=sn(),{globalAlignment:s}=Ht(),l=g=>{const v=g.collapsed?"pi pi-chevron-down":"pi pi-chevron-up",m=`${g.className} justify-content-start`,A=`${g.titleClassName} pl-1`;return o.jsxs("div",{className:m,children:[o.jsxs("button",{className:g.togglerClassName,onClick:g.onTogglerClick,children:[o.jsx("span",{className:v}),o.jsx(Qt,{})]}),o.jsx("span",{className:A,children:d})]})},{TASK_PUBLISHED:c,task_status:u}=Ar(),[d,f]=k.useState("");k.useEffect(()=>{var g;f((g=n==null?void 0:n.label)==null?void 0:g[a==null?void 0:a.type])},[n,a==null?void 0:a.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:s,className:h(),children:u===c&&r===!0?o.jsx(ii,{headerTemplate:l,toggleable:!0,children:i}):i})})};/*! @license DOMPurify 3.1.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.7/LICENSE */const{entries:bN,setPrototypeOf:yN,isFrozen:Ase,getPrototypeOf:wse,getOwnPropertyDescriptor:Sse}=Object;let{freeze:Eo,seal:jl,create:AN}=Object,{apply:S7,construct:C7}=typeof Reflect<"u"&&Reflect;Eo||(Eo=function(e){return e}),jl||(jl=function(e){return e}),S7||(S7=function(e,n,r){return e.apply(n,r)}),C7||(C7=function(e,n){return new e(...n)});const O3=ml(Array.prototype.forEach),wN=ml(Array.prototype.pop),Jp=ml(Array.prototype.push),F3=ml(String.prototype.toLowerCase),x7=ml(String.prototype.toString),SN=ml(String.prototype.match),Zp=ml(String.prototype.replace),Cse=ml(String.prototype.indexOf),xse=ml(String.prototype.trim),xc=ml(Object.prototype.hasOwnProperty),Io=ml(RegExp.prototype.test),e2=Tse(TypeError);function ml(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 S7(t,e,r)}}function Tse(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return C7(t,n)}}function hi(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:F3;yN&&yN(t,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const a=n(i);a!==i&&(Ase(e)||(e[r]=a),i=a)}t[i]=!0}return t}function Ese(t){for(let e=0;e<t.length;e++)xc(t,e)||(t[e]=null);return t}function J0(t){const e=AN(null);for(const[n,r]of bN(t))xc(t,n)&&(Array.isArray(r)?e[n]=Ese(r):r&&typeof r=="object"&&r.constructor===Object?e[n]=J0(r):e[n]=r);return e}function t2(t,e){for(;t!==null;){const r=Sse(t,e);if(r){if(r.get)return ml(r.get);if(typeof r.value=="function")return ml(r.value)}t=wse(t)}function n(){return null}return n}const CN=Eo(["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"]),T7=Eo(["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"]),E7=Eo(["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"]),Ise=Eo(["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"]),I7=Eo(["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"]),_se=Eo(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),xN=Eo(["#text"]),TN=Eo(["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"]),_7=Eo(["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"]),EN=Eo(["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"]),k3=Eo(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Dse=jl(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Nse=jl(/<%[\w\W]*|[\w\W]*%>/gm),Ose=jl(/\${[\w\W]*}/gm),Fse=jl(/^data-[\-\w.\u00B7-\uFFFF]/),kse=jl(/^aria-[\-\w]+$/),IN=jl(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Pse=jl(/^(?:\w+script|data):/i),Mse=jl(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),_N=jl(/^html$/i),Lse=jl(/^[a-z][.\w]*(-[.\w]+)+$/i);var DN=Object.freeze({__proto__:null,MUSTACHE_EXPR:Dse,ERB_EXPR:Nse,TMPLIT_EXPR:Ose,DATA_ATTR:Fse,ARIA_ATTR:kse,IS_ALLOWED_URI:IN,IS_SCRIPT_OR_DATA:Pse,ATTR_WHITESPACE:Mse,DOCTYPE_NAME:_N,CUSTOM_ELEMENT:Lse});const n2={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Bse=function(){return typeof window>"u"?null:window},Vse=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 a="dompurify"+(r?"#"+r:"");try{return e.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}};function NN(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Bse();const e=It=>NN(It);if(e.version="3.1.7",e.removed=[],!t||!t.document||t.document.nodeType!==n2.document)return e.isSupported=!1,e;let{document:n}=t;const r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:c,NodeFilter:u,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:f,DOMParser:h,trustedTypes:g}=t,v=c.prototype,m=t2(v,"cloneNode"),A=t2(v,"remove"),w=t2(v,"nextSibling"),C=t2(v,"childNodes"),x=t2(v,"parentNode");if(typeof s=="function"){const It=n.createElement("template");It.content&&It.content.ownerDocument&&(n=It.content.ownerDocument)}let T,S="";const{implementation:E,createNodeIterator:_,createDocumentFragment:M,getElementsByTagName:N}=n,{importNode:F}=r;let P={};e.isSupported=typeof bN=="function"&&typeof x=="function"&&E&&E.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:H,ERB_EXPR:O,TMPLIT_EXPR:j,DATA_ATTR:U,ARIA_ATTR:le,IS_SCRIPT_OR_DATA:R,ATTR_WHITESPACE:X,CUSTOM_ELEMENT:ce}=DN;let{IS_ALLOWED_URI:Y}=DN,ae=null;const re=hi({},[...CN,...T7,...E7,...I7,...xN]);let Z=null;const K=hi({},[...TN,..._7,...EN,...k3]);let W=Object.seal(AN(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}})),ge=null,ve=null,Ie=!0,be=!0,de=!1,ne=!0,q=!1,ee=!0,oe=!1,pe=!1,Ce=!1,De=!1,me=!1,Te=!1,Pe=!0,Ee=!1;const $="user-content-";let he=!0,ye=!1,se={},fe=null;const Ae=hi({},["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 Ne=null;const Le=hi({},["audio","video","img","source","image","track"]);let ze=null;const tt=hi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),it="http://www.w3.org/1998/Math/MathML",ht="http://www.w3.org/2000/svg",Ut="http://www.w3.org/1999/xhtml";let fn=Ut,$t=!1,mn=null;const En=hi({},[it,ht,Ut],x7);let Tt=null;const je=["application/xhtml+xml","text/html"],He="text/html";let ot=null,rn=null;const nn=n.createElement("form"),Jt=function(Fe){return Fe instanceof RegExp||Fe instanceof Function},_n=function(){let Fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(rn&&rn===Fe)){if((!Fe||typeof Fe!="object")&&(Fe={}),Fe=J0(Fe),Tt=je.indexOf(Fe.PARSER_MEDIA_TYPE)===-1?He:Fe.PARSER_MEDIA_TYPE,ot=Tt==="application/xhtml+xml"?x7:F3,ae=xc(Fe,"ALLOWED_TAGS")?hi({},Fe.ALLOWED_TAGS,ot):re,Z=xc(Fe,"ALLOWED_ATTR")?hi({},Fe.ALLOWED_ATTR,ot):K,mn=xc(Fe,"ALLOWED_NAMESPACES")?hi({},Fe.ALLOWED_NAMESPACES,x7):En,ze=xc(Fe,"ADD_URI_SAFE_ATTR")?hi(J0(tt),Fe.ADD_URI_SAFE_ATTR,ot):tt,Ne=xc(Fe,"ADD_DATA_URI_TAGS")?hi(J0(Le),Fe.ADD_DATA_URI_TAGS,ot):Le,fe=xc(Fe,"FORBID_CONTENTS")?hi({},Fe.FORBID_CONTENTS,ot):Ae,ge=xc(Fe,"FORBID_TAGS")?hi({},Fe.FORBID_TAGS,ot):{},ve=xc(Fe,"FORBID_ATTR")?hi({},Fe.FORBID_ATTR,ot):{},se=xc(Fe,"USE_PROFILES")?Fe.USE_PROFILES:!1,Ie=Fe.ALLOW_ARIA_ATTR!==!1,be=Fe.ALLOW_DATA_ATTR!==!1,de=Fe.ALLOW_UNKNOWN_PROTOCOLS||!1,ne=Fe.ALLOW_SELF_CLOSE_IN_ATTR!==!1,q=Fe.SAFE_FOR_TEMPLATES||!1,ee=Fe.SAFE_FOR_XML!==!1,oe=Fe.WHOLE_DOCUMENT||!1,De=Fe.RETURN_DOM||!1,me=Fe.RETURN_DOM_FRAGMENT||!1,Te=Fe.RETURN_TRUSTED_TYPE||!1,Ce=Fe.FORCE_BODY||!1,Pe=Fe.SANITIZE_DOM!==!1,Ee=Fe.SANITIZE_NAMED_PROPS||!1,he=Fe.KEEP_CONTENT!==!1,ye=Fe.IN_PLACE||!1,Y=Fe.ALLOWED_URI_REGEXP||IN,fn=Fe.NAMESPACE||Ut,W=Fe.CUSTOM_ELEMENT_HANDLING||{},Fe.CUSTOM_ELEMENT_HANDLING&&Jt(Fe.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(W.tagNameCheck=Fe.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Fe.CUSTOM_ELEMENT_HANDLING&&Jt(Fe.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(W.attributeNameCheck=Fe.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Fe.CUSTOM_ELEMENT_HANDLING&&typeof Fe.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(W.allowCustomizedBuiltInElements=Fe.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),q&&(be=!1),me&&(De=!0),se&&(ae=hi({},xN),Z=[],se.html===!0&&(hi(ae,CN),hi(Z,TN)),se.svg===!0&&(hi(ae,T7),hi(Z,_7),hi(Z,k3)),se.svgFilters===!0&&(hi(ae,E7),hi(Z,_7),hi(Z,k3)),se.mathMl===!0&&(hi(ae,I7),hi(Z,EN),hi(Z,k3))),Fe.ADD_TAGS&&(ae===re&&(ae=J0(ae)),hi(ae,Fe.ADD_TAGS,ot)),Fe.ADD_ATTR&&(Z===K&&(Z=J0(Z)),hi(Z,Fe.ADD_ATTR,ot)),Fe.ADD_URI_SAFE_ATTR&&hi(ze,Fe.ADD_URI_SAFE_ATTR,ot),Fe.FORBID_CONTENTS&&(fe===Ae&&(fe=J0(fe)),hi(fe,Fe.FORBID_CONTENTS,ot)),he&&(ae["#text"]=!0),oe&&hi(ae,["html","head","body"]),ae.table&&(hi(ae,["tbody"]),delete ge.tbody),Fe.TRUSTED_TYPES_POLICY){if(typeof Fe.TRUSTED_TYPES_POLICY.createHTML!="function")throw e2('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Fe.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw e2('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=Fe.TRUSTED_TYPES_POLICY,S=T.createHTML("")}else T===void 0&&(T=Vse(g,i)),T!==null&&typeof S=="string"&&(S=T.createHTML(""));Eo&&Eo(Fe),rn=Fe}},wt=hi({},["mi","mo","mn","ms","mtext"]),Ke=hi({},["annotation-xml"]),st=hi({},["title","style","font","a","script"]),vt=hi({},[...T7,...E7,...Ise]),Vt=hi({},[...I7,..._se]),On=function(Fe){let Qe=x(Fe);(!Qe||!Qe.tagName)&&(Qe={namespaceURI:fn,tagName:"template"});const At=F3(Fe.tagName),jt=F3(Qe.tagName);return mn[Fe.namespaceURI]?Fe.namespaceURI===ht?Qe.namespaceURI===Ut?At==="svg":Qe.namespaceURI===it?At==="svg"&&(jt==="annotation-xml"||wt[jt]):!!vt[At]:Fe.namespaceURI===it?Qe.namespaceURI===Ut?At==="math":Qe.namespaceURI===ht?At==="math"&&Ke[jt]:!!Vt[At]:Fe.namespaceURI===Ut?Qe.namespaceURI===ht&&!Ke[jt]||Qe.namespaceURI===it&&!wt[jt]?!1:!Vt[At]&&(st[At]||!vt[At]):!!(Tt==="application/xhtml+xml"&&mn[Fe.namespaceURI]):!1},$n=function(Fe){Jp(e.removed,{element:Fe});try{x(Fe).removeChild(Fe)}catch{A(Fe)}},lr=function(Fe,Qe){try{Jp(e.removed,{attribute:Qe.getAttributeNode(Fe),from:Qe})}catch{Jp(e.removed,{attribute:null,from:Qe})}if(Qe.removeAttribute(Fe),Fe==="is"&&!Z[Fe])if(De||me)try{$n(Qe)}catch{}else try{Qe.setAttribute(Fe,"")}catch{}},Wn=function(Fe){let Qe=null,At=null;if(Ce)Fe="<remove></remove>"+Fe;else{const Zt=SN(Fe,/^[\r\n\t ]+/);At=Zt&&Zt[0]}Tt==="application/xhtml+xml"&&fn===Ut&&(Fe='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Fe+"</body></html>");const jt=T?T.createHTML(Fe):Fe;if(fn===Ut)try{Qe=new h().parseFromString(jt,Tt)}catch{}if(!Qe||!Qe.documentElement){Qe=E.createDocument(fn,"template",null);try{Qe.documentElement.innerHTML=$t?S:jt}catch{}}const Xt=Qe.body||Qe.documentElement;return Fe&&At&&Xt.insertBefore(n.createTextNode(At),Xt.childNodes[0]||null),fn===Ut?N.call(Qe,oe?"html":"body")[0]:oe?Qe.documentElement:Xt},vr=function(Fe){return _.call(Fe.ownerDocument||Fe,Fe,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Nr=function(Fe){return Fe instanceof f&&(typeof Fe.nodeName!="string"||typeof Fe.textContent!="string"||typeof Fe.removeChild!="function"||!(Fe.attributes instanceof d)||typeof Fe.removeAttribute!="function"||typeof Fe.setAttribute!="function"||typeof Fe.namespaceURI!="string"||typeof Fe.insertBefore!="function"||typeof Fe.hasChildNodes!="function")},yn=function(Fe){return typeof l=="function"&&Fe instanceof l},lt=function(Fe,Qe,At){P[Fe]&&O3(P[Fe],jt=>{jt.call(e,Qe,At,rn)})},ut=function(Fe){let Qe=null;if(lt("beforeSanitizeElements",Fe,null),Nr(Fe))return $n(Fe),!0;const At=ot(Fe.nodeName);if(lt("uponSanitizeElement",Fe,{tagName:At,allowedTags:ae}),Fe.hasChildNodes()&&!yn(Fe.firstElementChild)&&Io(/<[/\w]/g,Fe.innerHTML)&&Io(/<[/\w]/g,Fe.textContent)||Fe.nodeType===n2.progressingInstruction||ee&&Fe.nodeType===n2.comment&&Io(/<[/\w]/g,Fe.data))return $n(Fe),!0;if(!ae[At]||ge[At]){if(!ge[At]&&Nt(At)&&(W.tagNameCheck instanceof RegExp&&Io(W.tagNameCheck,At)||W.tagNameCheck instanceof Function&&W.tagNameCheck(At)))return!1;if(he&&!fe[At]){const jt=x(Fe)||Fe.parentNode,Xt=C(Fe)||Fe.childNodes;if(Xt&&jt){const Zt=Xt.length;for(let Sn=Zt-1;Sn>=0;--Sn){const Ln=m(Xt[Sn],!0);Ln.__removalCount=(Fe.__removalCount||0)+1,jt.insertBefore(Ln,w(Fe))}}}return $n(Fe),!0}return Fe instanceof c&&!On(Fe)||(At==="noscript"||At==="noembed"||At==="noframes")&&Io(/<\/no(script|embed|frames)/i,Fe.innerHTML)?($n(Fe),!0):(q&&Fe.nodeType===n2.text&&(Qe=Fe.textContent,O3([H,O,j],jt=>{Qe=Zp(Qe,jt," ")}),Fe.textContent!==Qe&&(Jp(e.removed,{element:Fe.cloneNode()}),Fe.textContent=Qe)),lt("afterSanitizeElements",Fe,null),!1)},yt=function(Fe,Qe,At){if(Pe&&(Qe==="id"||Qe==="name")&&(At in n||At in nn))return!1;if(!(be&&!ve[Qe]&&Io(U,Qe))){if(!(Ie&&Io(le,Qe))){if(!Z[Qe]||ve[Qe]){if(!(Nt(Fe)&&(W.tagNameCheck instanceof RegExp&&Io(W.tagNameCheck,Fe)||W.tagNameCheck instanceof Function&&W.tagNameCheck(Fe))&&(W.attributeNameCheck instanceof RegExp&&Io(W.attributeNameCheck,Qe)||W.attributeNameCheck instanceof Function&&W.attributeNameCheck(Qe))||Qe==="is"&&W.allowCustomizedBuiltInElements&&(W.tagNameCheck instanceof RegExp&&Io(W.tagNameCheck,At)||W.tagNameCheck instanceof Function&&W.tagNameCheck(At))))return!1}else if(!ze[Qe]){if(!Io(Y,Zp(At,X,""))){if(!((Qe==="src"||Qe==="xlink:href"||Qe==="href")&&Fe!=="script"&&Cse(At,"data:")===0&&Ne[Fe])){if(!(de&&!Io(R,Zp(At,X,"")))){if(At)return!1}}}}}}return!0},Nt=function(Fe){return Fe!=="annotation-xml"&&SN(Fe,ce)},An=function(Fe){lt("beforeSanitizeAttributes",Fe,null);const{attributes:Qe}=Fe;if(!Qe)return;const At={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z};let jt=Qe.length;for(;jt--;){const Xt=Qe[jt],{name:Zt,namespaceURI:Sn,value:Ln}=Xt,zn=ot(Zt);let at=Zt==="value"?Ln:xse(Ln);if(At.attrName=zn,At.attrValue=at,At.keepAttr=!0,At.forceKeepAttr=void 0,lt("uponSanitizeAttribute",Fe,At),at=At.attrValue,At.forceKeepAttr||(lr(Zt,Fe),!At.keepAttr))continue;if(!ne&&Io(/\/>/i,at)){lr(Zt,Fe);continue}q&&O3([H,O,j],Me=>{at=Zp(at,Me," ")});const ie=ot(Fe.nodeName);if(yt(ie,zn,at)){if(Ee&&(zn==="id"||zn==="name")&&(lr(Zt,Fe),at=$+at),ee&&Io(/((--!?|])>)|<\/(style|title)/i,at)){lr(Zt,Fe);continue}if(T&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Sn)switch(g.getAttributeType(ie,zn)){case"TrustedHTML":{at=T.createHTML(at);break}case"TrustedScriptURL":{at=T.createScriptURL(at);break}}try{Sn?Fe.setAttributeNS(Sn,Zt,at):Fe.setAttribute(Zt,at),Nr(Fe)?$n(Fe):wN(e.removed)}catch{}}}lt("afterSanitizeAttributes",Fe,null)},Nn=function It(Fe){let Qe=null;const At=vr(Fe);for(lt("beforeSanitizeShadowDOM",Fe,null);Qe=At.nextNode();)lt("uponSanitizeShadowNode",Qe,null),!ut(Qe)&&(Qe.content instanceof a&&It(Qe.content),An(Qe));lt("afterSanitizeShadowDOM",Fe,null)};return e.sanitize=function(It){let Fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Qe=null,At=null,jt=null,Xt=null;if($t=!It,$t&&(It="<!-->"),typeof It!="string"&&!yn(It))if(typeof It.toString=="function"){if(It=It.toString(),typeof It!="string")throw e2("dirty is not a string, aborting")}else throw e2("toString is not a function");if(!e.isSupported)return It;if(pe||_n(Fe),e.removed=[],typeof It=="string"&&(ye=!1),ye){if(It.nodeName){const Ln=ot(It.nodeName);if(!ae[Ln]||ge[Ln])throw e2("root node is forbidden and cannot be sanitized in-place")}}else if(It instanceof l)Qe=Wn("<!---->"),At=Qe.ownerDocument.importNode(It,!0),At.nodeType===n2.element&&At.nodeName==="BODY"||At.nodeName==="HTML"?Qe=At:Qe.appendChild(At);else{if(!De&&!q&&!oe&&It.indexOf("<")===-1)return T&&Te?T.createHTML(It):It;if(Qe=Wn(It),!Qe)return De?null:Te?S:""}Qe&&Ce&&$n(Qe.firstChild);const Zt=vr(ye?It:Qe);for(;jt=Zt.nextNode();)ut(jt)||(jt.content instanceof a&&Nn(jt.content),An(jt));if(ye)return It;if(De){if(me)for(Xt=M.call(Qe.ownerDocument);Qe.firstChild;)Xt.appendChild(Qe.firstChild);else Xt=Qe;return(Z.shadowroot||Z.shadowrootmode)&&(Xt=F.call(r,Xt,!0)),Xt}let Sn=oe?Qe.outerHTML:Qe.innerHTML;return oe&&ae["!doctype"]&&Qe.ownerDocument&&Qe.ownerDocument.doctype&&Qe.ownerDocument.doctype.name&&Io(_N,Qe.ownerDocument.doctype.name)&&(Sn="<!DOCTYPE "+Qe.ownerDocument.doctype.name+`>
2290
2290
  `+Sn),q&&O3([H,O,j],Ln=>{Sn=Zp(Sn,Ln," ")}),T&&Te?T.createHTML(Sn):Sn},e.setConfig=function(){let It=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_n(It),pe=!0},e.clearConfig=function(){rn=null,pe=!1},e.isValidAttribute=function(It,Fe,Qe){rn||_n({});const At=ot(It),jt=ot(Fe);return yt(At,jt,Qe)},e.addHook=function(It,Fe){typeof Fe=="function"&&(P[It]=P[It]||[],Jp(P[It],Fe))},e.removeHook=function(It){if(P[It])return wN(P[It])},e.removeHooks=function(It){P[It]&&(P[It]=[])},e.removeAllHooks=function(){P={}},e}var P3=NN();const aa=t=>{var C;const{field:e,fieldIndex:n,pageIndex:r,sectionIndex:i,rowIndex:a,columnIndex:s,path:l}=t,[c,u]=k.useState(e);k.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}=sn(),v=(x,T,S)=>{u(E=>({...E,[x]:{...E[x],[T==null?void 0:T.type]:S}}))},[m,A]=k.useState((C=e==null?void 0:e.label)==null?void 0:C[d==null?void 0:d.type]);k.useEffect(()=>(w(),()=>{}),[c]);const w=()=>{const x=l.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?h(x[fa],x[ha],x[Ca],x[xa],x[Ta],x[Fa],x[Xo],x[wo],c):(x==null?void 0:x.length)>Fa&&(x==null?void 0:x.length)===Bl+1&&(e!=null&&e.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?g(x[fa],x[ha],x[Ca],x[xa],x[Ta],x[5],x[6],x[7],c):f(r,i,a,s,n,{...e,label:c==null?void 0:c.label})};return o.jsx(o.Fragment,{children:o.jsx(N3,{style:{display:"inline-block"},className:"builder-input-label-edit",html:m,disabled:!1,onChange:x=>{var T;A(P3.sanitize((T=x==null?void 0:x.target)==null?void 0:T.value))},onBlur:x=>{var S;const T=P3.sanitize((S=x==null?void 0:x.target)==null?void 0:S.innerText);A(T),v("label",d,T)},tagName:"article"})})},Z0=t=>{const{onLabel:e,offLabel:n,onIcon:r,offIcon:i,onHandleChangeSetttings:a,settingsKey:s,settingsKeyValue:l}=t;return o.jsx(o.Fragment,{children:o.jsx(qp,{checked:l,onLabel:e,onChange:c=>{a(s,c.value)},offLabel:n,onIcon:r,offIcon:i,className:"mr-1 px-1",style:{fontSize:"0.8rem"}})})},Wr=t=>{var le,R,X,ce;const{field:e,fieldIndex:n,columnIndex:r,sectionIndex:i,rowIndex:a,pageIndex:s,type:l,path:c,handleFieldSettingsSidebar:u,showFieldIcons:d=!0,showSettingsIcon:f=!0}=t,{emitSocketData:h,renderType:g}=Ht(),v=(Y,ae)=>{P(re=>({...re,[Y]:ae}))},{fieldSettingUpdate:m,fieldSettingUpdateInlineConditional:A,cloneField:w,gridComponentFieldSettingUpdate:C,fieldSettingDeleteInlineConditional:x,gridComponentFieldDelete:T,removeField:S}=sn(),{updateGlobalToast:E}=Ht(),_=Y=>{const ae=c.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?A(ae[fa],ae[ha],ae[Ca],ae[xa],ae[Ta],ae[Fa],ae[Xo],ae[wo],Y):(ae==null?void 0:ae.length)>Fa&&(ae==null?void 0:ae.length)===Bl+1&&(Y!=null&&Y.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?C(ae[fa],ae[ha],ae[Ca],ae[xa],ae[Ta],ae[5],ae[6],ae[7],Y):m(s,i,a,r,n,Y),E({showToast:!0,toastMessage:"Updated",toastDetail:"Field updated",toastType:"success"})},[M,N]=k.useState(!1),[F,P]=k.useState({custom_component_title:"",custom_component_description:""}),H=()=>{P(Y=>({...Y,custom_component_schema:e})),N(!0)},O=()=>{const Y=c.split("-").map(Number);l==="inline-conditional"?x(Y[fa],Y[ha],Y[Ca],Y[xa],Y[Ta],Y[Fa],Y[Xo],Y[wo]):(Y==null?void 0:Y.length)>Fa&&(Y==null?void 0:Y.length)===Bl+1&&(e!=null&&e.componentType)&&l==="grid"?T(Y[fa],Y[ha],Y[Ca],Y[xa],Y[Ta],Y[5],Y[6],Y[7]):S(s,i,a,r,n)},j=(Y,ae)=>{const re={...e,attributes:{...e.attributes,[Y]:ae}};_(re)},U=(Y,ae)=>{const re={...e,[Y]:ae};_(re)};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(Z0,{field:e,onHandleChangeSetttings:j,settingsKey:"required",settingsKeyValue:(le=e==null?void 0:e.attributes)==null?void 0:le.required,onLabel:"Required",offLabel:"Not Required",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:(R=e==null?void 0:e.attributes)==null?void 0:R.required}),o.jsx(Z0,{field:e,onHandleChangeSetttings:U,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(Z0,{field:e,onHandleChangeSetttings:U,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(Z0,{field:e,onHandleChangeSetttings:U,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(Z0,{field:e,onHandleChangeSetttings:U,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(Z0,{field:e,onHandleChangeSetttings:U,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(Z0,{field:e,onHandleChangeSetttings:j,settingsKey:"style",settingsKeyValue:(X=e==null?void 0:e.attributes)==null?void 0:X.style,onLabel:"Style",offLabel:"Style",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:(ce=e==null?void 0:e.attributes)==null?void 0:ce.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(Ot,{text:!0,size:"small",tooltip:"Advanced settings",icon:"pi pi-cog",onClick:()=>{u(!0)},className:"mr-3"}),o.jsx(Ot,{size:"small",text:!0,icon:"pi pi-clone",outlined:!0,onClick:()=>{w(e,s,i,a,r,n),h()},tooltip:"Clone"}),o.jsx(Ot,{text:!0,className:"p-button-danger",size:"small",outlined:!0,icon:"pi pi-trash",onClick:()=>{O()},tooltip:"Delete"}),(g===e3||g===k0)&&o.jsx(Ot,{text:!0,size:"small",outlined:!0,icon:"pi pi-file",tooltip:"Save as custom component",onClick:()=>{H()}})]}),o.jsxs(Os,{header:"Custom component save",visible:M,style:{width:"20vw"},footer:()=>o.jsx(o.Fragment,{children:o.jsxs("div",{children:[o.jsx(Ot,{size:"small",text:!0,label:"Close",icon:"pi pi-times",onClick:()=>N(!1),className:"p-button-text"}),(e==null?void 0:e.componentType)!=="hidden-field"&&o.jsx(Ot,{text:!0,label:"Save",icon:"pi pi-check",onClick:()=>{N(!1)},autoFocus:!0})]})}),onHide:()=>N(!1),children:[o.jsxs("span",{className:"p-float-label",children:[o.jsx(wn,{id:"custom_component_title",name:"custom_component_title",className:"w-full",value:(F==null?void 0:F.custom_component_title)||"",onChange:Y=>{var ae;return v("custom_component_title",(ae=Y==null?void 0:Y.target)==null?void 0:ae.value)}}),o.jsx("label",{htmlFor:"username",children:"Custom component title"})]}),o.jsxs("span",{className:"p-float-label mt-5",children:[o.jsx(so,{id:"custom_component_description",name:"custom_component_description",className:"w-full",value:(F==null?void 0:F.custom_component_description)||"",onChange:Y=>{var ae;return v("custom_component_description",(ae=Y==null?void 0:Y.target)==null?void 0:ae.value)}}),o.jsx("label",{htmlFor:"username",children:"Custom component description"})]})]})]})]})})},qse=t=>{var re,Z,K,W,ge,ve,Ie,be;const{pageIndex:e,sectionIndex:n,field:r,fieldIndex:i,row:a,rowIndex:s,columnIndex:l,isDisabled:c}=t,{isAdmin:u,isBuilderMode:d}=Ht(),{userSelectedLanguage:f,fieldSettingUpdate:h}=sn(),{taskRegisterData:g,updateTaskRegisterData:v,updateTaskProgressValue:m,updateUserFormDataSubmit:A,userTaskSubmitFormData:w}=Ar(),[C,x]=k.useState(!1),[T,S]=k.useState(!1),[E,_]=k.useState(null),[M,N]=k.useState(0),[F,P]=k.useState(!1),H=()=>{P(!0)},O=()=>{P(!1)},j=de=>{x(de)},U=()=>{x(!1)},le=()=>{var de,ne,q;if(a!=null&&a.rowIsRepeatable){if(a!=null&&a.repeatableFields){const ee=[...a.repeatableFields],oe=_t.findIndex(ee,function(pe){return pe.uuid===(r==null?void 0:r.uuid)});oe>=0&&ee[oe].fieldData?_(ee[oe].fieldData):(r.isValid=0,_(null))}}else{const ee=w,oe=_t.cloneDeep(g);if(ee!=null&&ee.length){for(const pe of ee)if(pe.fieldId===t.field.uuid&&((de=pe==null?void 0:pe.postData)!=null&&de.length)){_((ne=pe==null?void 0:pe.postData[0])==null?void 0:ne.postValue),oe[r==null?void 0:r.uuid]=(q=pe==null?void 0:pe.postData[0])==null?void 0:q.postValue;const Ce=Object.keys(oe).length;m(Ce);break}}}S(!0)},R=de=>{var oe;_(de.target.value);const ne=w,q=_t.cloneDeep(g);if((oe=de==null?void 0:de.target)!=null&&oe.value&&(ne==null?void 0:ne.length)>0)for(const pe of ne)pe.fieldId===t.field.uuid&&(q[r==null?void 0:r.uuid]=de==null?void 0:de.value,pe.postData[0]={postValue:de.value});else delete q[r==null?void 0:r.uuid];v(q);const ee=Object.keys(q).length;m(ee)};k.useEffect(()=>{T||le();const de=Gt.addListener("clearRepeatableFields",ee=>{ee===(a==null?void 0:a.uuid)&&(_(null),N(0),r.isValid=0,h(e,n,s,l,i,r))}),ne=Gt.addListener("onSubmitUserForm",()=>{var ee;(ee=r==null?void 0:r.attributes)!=null&&ee.required?E!==null||E!==void 0?r.isValid=1:(console.log("Countr field in valid ",E),r.isValid=0):r.isValid=1}),q=Gt.addListener("OnInvalidFieldCatch",ee=>{console.log("OnInvalidFieldCatch listener"),console.log("field.uuid === value?.fieldId",r.uuid===(ee==null?void 0:ee.fieldId)),r.uuid===(ee==null?void 0:ee.fieldId)?N(1):N(0)});return()=>{ne.remove(),q.remove(),de.remove()}});const X=(de,ne)=>{var q;if(w){const ee=[...w],oe=_t.findIndex(ee,function(Ce){return Ce.rowId===(a==null?void 0:a.uuid)});let pe=(q=w[oe])==null?void 0:q.repeatableFields;pe={...pe,[de==null?void 0:de.uuid]:ne==null?void 0:ne.name},ee[oe]={...ee[oe],repeatableFields:pe},A(ee)}_(ne),console.log("value !== null country",ne!==null),ne!==null?de.isValid=1:de.isValid=0},ce=(de,ne)=>de?o.jsxs("div",{className:"country-item flex",children:[o.jsx("img",{alt:de.name,src:de==null?void 0:de.image,onError:q=>q.target.src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png",style:{width:"20px",marginRight:10}}),o.jsx("div",{children:de.name})]}):o.jsx("span",{children:ne.placeholder}),Y=de=>o.jsxs("div",{className:"country-item flex",children:[o.jsx("img",{alt:de.name,src:de==null?void 0:de.image,onError:ne=>ne.target.src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png",style:{width:"20px",marginRight:10}}),o.jsx("div",{children:de.name})]}),ae=o.jsxs("div",{onMouseOver:H,onMouseOut:O,children:[d&&F&&o.jsx(Wr,{handleFieldSettingsSidebar:j,...t}),o.jsxs("div",{className:`field ${d?" py-3 px-4 builder-element-wrapper ":""}${(r==null?void 0:r.isFluid)===!0&&" p-fluid"}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:d?"field-form-builder col-12 ":"col-12 ",children:[(r==null?void 0:r.showHeaderText)&&o.jsx("h6",{children:(re=r==null?void 0:r.headerText)==null?void 0:re[f==null?void 0:f.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(ca,{...t}),((Z=r==null?void 0:r.attributes)==null?void 0:Z.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",d?o.jsx(aa,{...t}):o.jsx(o.Fragment,{children:(K=r==null?void 0:r.label)==null?void 0:K[f==null?void 0:f.type]}),o.jsx("span",{className:"ml-3",children:(r==null?void 0:r.showToolTip)&&o.jsx(zi,{message:(W=r==null?void 0:r.toolTip)==null?void 0:W[f==null?void 0:f.type],position:"right"})})]}),o.jsx(Pa,{className:"country-select-builder-component",onFocus:()=>N(1),onChange:de=>{a!=null&&a.rowIsRepeatable?X(r,de.target.value):R(de)},options:r==null?void 0:r.countries,optionLabel:"name",value:E,placeholder:(ge=r==null?void 0:r.placeholder)==null?void 0:ge[f==null?void 0:f.type],disabled:c,valueTemplate:ce,itemTemplate:Y,filter:!0,filterBy:"name",showClear:!0}),((ve=r==null?void 0:r.attributes)==null?void 0:ve.required)&&o.jsx("small",{className:"error",children:M===1&&E===null?((Ie=r==null?void 0:r.validationMesssage)==null?void 0:Ie[f==null?void 0:f.type])||"field is required":""}),o.jsx("div",{children:(r==null?void 0:r.showHelperText)&&o.jsx("small",{children:(be=r==null?void 0:r.helperText)==null?void 0:be[f==null?void 0:f.type]})})]})}),u&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(ki,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[C===!0&&o.jsx(Qi,{visibilty:C,closeSettingFieldSidebar:U,...t},r==null?void 0:r.uuid),o.jsx(xi,{...t,fieldWrap:ae})]})},Use=t=>{var re,Z,K,W,ge,ve,Ie,be,de,ne,q,ee,oe,pe,Ce;const{taskRegisterData:e,updateTaskRegisterData:n,updateTaskProgressValue:r,updateUserFormDataSubmit:i,userTaskSubmitFormData:a}=Ar(),{userSelectedLanguage:s,fieldSettingUpdate:l}=sn(),{field:c,fieldIndex:u,sectionIndex:d,pageIndex:f,row:h,rowIndex:g,columnIndex:v,isDisabled:m}=t,{isAdmin:A,isBuilderMode:w}=Ht(),[C,x]=k.useState(!1),[T,S]=k.useState(""),[E,_]=k.useState(null),[M,N]=k.useState(0),[F,P]=k.useState(!1),[H,O]=k.useState(!1),j=()=>{O(!0)},U=()=>{O(!1)},le=()=>{var De,me,Te;if(h!=null&&h.rowIsRepeatable){if(h!=null&&h.repeatableFields){const Pe=[...h.repeatableFields],Ee=_t.findIndex(Pe,function($){return $.uuid===(c==null?void 0:c.uuid)});Ee>=0&&Pe[Ee].fieldData?S(Pe[Ee].fieldData):S("")}}else{const Pe=a;if(Pe!=null&&Pe.length){for(const Ee of Pe)if(Ee.fieldId===t.field.uuid&&((De=Ee==null?void 0:Ee.postData[0])==null?void 0:De.postValue)!==""&&((me=Ee==null?void 0:Ee.postData[0])!=null&&me.postValue)){S((Te=Ee==null?void 0:Ee.postData[0])==null?void 0:Te.postValue);break}}}P(!0)};k.useEffect(()=>{F||le();const De=Gt.addListener("clearRepeatableFields",$=>{$===(h==null?void 0:h.uuid)&&(S(""),N(0),c.isValid=0,l(f,d,g,v,u,c))}),me=Gt.addListener("onSubmitUserForm",()=>{var $,he;($=c==null?void 0:c.attributes)!=null&&$.required?T&&T.length&&(T==null?void 0:T.length)<((he=c==null?void 0:c.attributes)==null?void 0:he.minLength)?c.isValid=1:c.isValid=0:c.isValid=1}),Te=Gt.addListener("OnInvalidFieldCatch",$=>{console.log("Text field catch before"),c.uuid===($==null?void 0:$.fieldId)?(console.log("Text field catch"),N(1)):N(0)}),Pe=Gt.addListener("OnGetFieldValue",$=>{var ye;const he=(ye=$==null?void 0:$.repeatableColumn)==null?void 0:ye.filter(se=>(se==null?void 0:se.fieldUuid)===(c==null?void 0:c.uuid));he!=null&&he.length}),Ee=Gt.addListener("formFieldAdded",$=>{E===null&&_($==null?void 0:$.uuid)});return()=>{me.remove(),Te.remove(),Pe.remove(),De.remove(),Ee.remove()}}),k.useEffect(()=>(E!==null&&setTimeout(()=>{_(null)},1e3),()=>{}),[E]);const R=De=>{x(De)},X=()=>{x(!1)},ce=De=>{var Pe,Ee;S(De.target.value);const me=a,Te=_t.cloneDeep(e);if(me!==null){if((Pe=De==null?void 0:De.target)!=null&&Pe.value){if(Te[c==null?void 0:c.uuid]=(Ee=De==null?void 0:De.target)==null?void 0:Ee.value,(me==null?void 0:me.length)>0)for(const $ of me)$.fieldId===t.field.uuid&&($.postData[0]={postValue:De.target.value})}else if(delete Te[c==null?void 0:c.uuid],(me==null?void 0:me.length)>0)for(const $ of me)$.fieldId===t.field.uuid&&($.postData[0]={postValue:""})}if(!(h!=null&&h.rowIsRepeatable)){n(Te);const $=Object.keys(Te).length;r($)}},Y=(De,me)=>{var Te;if(a){const Pe=[...a],Ee=_t.findIndex(Pe,function(he){return he.rowId===(h==null?void 0:h.uuid)});let $=(Te=a[Ee])==null?void 0:Te.repeatableFields;$={...$,[De==null?void 0:De.uuid]:me},Pe[Ee]={...Pe[Ee],repeatableFields:$},i(Pe)}S(me),me!==""?De.isValid=1:De.isValid=0},ae=o.jsxs("div",{onMouseOver:j,onMouseOut:U,children:[w&&H&&o.jsx(Wr,{handleFieldSettingsSidebar:R,...t}),o.jsxs("div",{className:`field ${w?" py-3 px-4 builder-element-wrapper ":""} ${(c==null?void 0:c.isFluid)===!0&&" p-fluid"}`,children:[o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:A?"col-6 ":"col-12 p-fluid",children:[(c==null?void 0:c.showHeaderText)&&o.jsx("h6",{children:(re=c==null?void 0:c.headerText)==null?void 0:re[s==null?void 0:s.type]}),(c==null?void 0:c.showLabel)&&o.jsxs("label",{htmlFor:c==null?void 0:c.uuid,className:"flex font-bold mb-3 text-gray-900 text-xl",children:[o.jsx(ca,{...t}),((Z=c==null?void 0:c.attributes)==null?void 0:Z.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",w===!1?o.jsx(o.Fragment,{children:(K=c==null?void 0:c.label)==null?void 0:K[s==null?void 0:s.type]}):o.jsx(aa,{...t}),(c==null?void 0:c.showToolTip)&&o.jsx("span",{className:"ml-3",children:o.jsx(zi,{message:(W=c==null?void 0:c.toolTip)==null?void 0:W[s==null?void 0:s.type],position:"right"})})]}),o.jsxs("div",{className:"mt-3",children:[o.jsxs("span",{className:"p-input-icon-"+(c==null?void 0:c.iconAlignment),children:[(c==null?void 0:c.showIcon)&&o.jsx("i",{className:"pi pi-"+((ve=(ge=c==null?void 0:c.icon)==null?void 0:ge.properties)==null?void 0:ve.name)}),o.jsx(wn,{"data-component":"text-input",id:c==null?void 0:c.uuid,placeholder:(Ie=c==null?void 0:c.placeholder)==null?void 0:Ie[s==null?void 0:s.type],minLength:(be=c==null?void 0:c.attributes)==null?void 0:be.minLength,maxLength:(de=c==null?void 0:c.attributes)==null?void 0:de.maxLength,value:T,onFocus:()=>N(1),onChange:De=>{h!=null&&h.rowIsRepeatable?Y(c,De.target.value):ce(De)},className:M===N8&&((ne=c==null?void 0:c.attributes)!=null&&ne.required)?T?"valid":"invalid":"valid'",readOnly:m,disabled:A})]}),o.jsx("div",{children:((q=c==null?void 0:c.attributes)==null?void 0:q.required)&&o.jsxs(o.Fragment,{children:[o.jsx("small",{className:"error",children:M===1&&!T?(ee=c==null?void 0:c.validationMesssage)==null?void 0:ee.english:""}),o.jsx("small",{className:"error",children:M===1&&T.length&&(T==null?void 0:T.length)<((oe=c==null?void 0:c.attributes)==null?void 0:oe.minLength)?`Mini length ${(pe=c==null?void 0:c.attributes)==null?void 0:pe.minLength}`:""})]})}),o.jsx("div",{children:(c==null?void 0:c.showHelperText)&&o.jsx("small",{children:(Ce=c==null?void 0:c.helperText)==null?void 0:Ce[s==null?void 0:s.type]})})]})]}),A&&o.jsx(o.Fragment,{children:o.jsx("div",{className:"col-6",children:o.jsx(ki,{...t})})})]}),A&&o.jsx("hr",{})]})]});return o.jsxs(o.Fragment,{children:[C===!0&&o.jsx(Qi,{visibilty:C,closeSettingFieldSidebar:X,...t}),o.jsx(xi,{...t,fieldWrap:ae})]})},$se=t=>{var i,a;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(wn,{value:(i=r==null?void 0:r.text)==null?void 0:i[e==null?void 0:e.type],onChange:s=>n("text",e,s.target.value)})]}),o.jsxs("div",{className:"field",children:[o.jsx("label",{children:"Hyperlink"}),o.jsx(wn,{value:(a=r==null?void 0:r.hrefLink)==null?void 0:a[e==null?void 0:e.type],onChange:s=>n("hrefLink",e,s.target.value)})]})]})},jse=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(v3,{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(wn,{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(Yr,{checked:n==null?void 0:n.underLined,onChange:i=>{e("underLined",i.checked)}}),o.jsx("label",{children:"Underline link"})]})]})},zse=t=>{const{visibilty:e,field:n,closeSettingFieldSidebar:r,pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,typeName:u}=t,[d,f]=k.useState(n),{fieldSettingUpdate:h,formBuilderSchemaLanguages:g,formBuilderPublishedStatus:v}=sn(),{updateGlobalToast:m}=Ht(),A=(x,T,S)=>{f(E=>({...E,[x]:{...E[x],[T==null?void 0:T.type]:S}}))},w=(x,T)=>{f(S=>({...S,[x]:T}))},C=()=>{h(i,a,s,l,c,d),m({showToast:!0,toastMessage:"Updated",toastDetail:`${u} updated`,toastType:"success"})};return o.jsx(o.Fragment,{children:o.jsxs(To,{visible:e,position:"left",className:"p-sidebar-lg",onHide:()=>r(),header:()=>{var x,T;return o.jsx("div",{className:"flex align-items-center gap-2 justify-content-between",children:o.jsxs("div",{className:"text-gray-900 font-bold text-2xl",children:[t==null?void 0:t.typeName," settings"," ",(x=n==null?void 0:n.label)!=null&&x.english?`- ${(T=n==null?void 0:n.label)==null?void 0:T.english}`:""," "]})})},children:[o.jsxs(ss,{children:[o.jsx(Cr,{header:"Text",children:o.jsx(ao,{activeIndex:0,children:g!=null&&g.length?g.map((x,T)=>o.jsx(io,{tabIndex:T,header:x==null?void 0:x.language,children:o.jsx($se,{language:x,fieldState:d,onHandleChange:A,...t})},T)):""})}),o.jsx(Cr,{header:"Styling",children:o.jsx(jse,{fieldState:d,onHandleChangeStyling:w,...t})})]}),o.jsx("div",{className:"w-full px-4 py-3 surface-100 sidebar-footer",children:o.jsxs("div",{className:"flex flex-row gap-2 align-items-center justify-content-end",children:[!v&&o.jsx(Ot,{size:"small",label:"Update",type:"button",outlined:!0,onClick:()=>C(),"aria-label":"Update"}),o.jsx(Ot,{label:"Close",type:"button",onClick:()=>r(),"aria-label":"Close",size:"small",className:"p-button-danger"})]})})]})})},Hse=t=>{var g,v,m,A,w,C,x,T,S;const{field:e}=t,{userSelectedLanguage:n}=sn(),{isBuilderMode:r}=Ht(),[i,a]=k.useState(!1),[s,l]=k.useState(!1),c=()=>{l(!0)},u=()=>{l(!1)},d=E=>{a(E)},f=()=>{a(!1)};k.useEffect(()=>{},[e]);const h=o.jsxs("div",{className:r?"builder-element-wrapper":"",onMouseOver:c,onMouseOut:u,children:[r&&s&&o.jsx(Wr,{handleFieldSettingsSidebar:d,...t}),o.jsxs("div",{className:r?"field-form-builder px-4":" 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:[((v=e==null?void 0:e.attributes)==null?void 0:v.required)&&o.jsx("span",{className:"must-required",children:"*"})," ",r?o.jsx(aa,{...t}):o.jsx(o.Fragment,{children:(m=e==null?void 0:e.label)==null?void 0:m[n==null?void 0:n.type]}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(zi,{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:(C=e==null?void 0:e.text)==null?void 0:C[n==null?void 0:n.type]}),((x=e==null?void 0:e.attributes)==null?void 0:x.required)&&o.jsx("small",{className:"error",children:(T=e==null?void 0:e.validationMesssage)==null?void 0:T[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:[i&&o.jsx(zse,{visibilty:i,closeSettingFieldSidebar:f,...t}),o.jsx(xi,{...t,fieldWrap:h})]})},Yse=t=>{var K,W,ge,ve,Ie,be,de,ne,q,ee,oe,pe,Ce,De,me,Te,Pe,Ee,$,he,ye;const{field:e,fieldIndex:n,sectionIndex:r,pageIndex:i,row:a,rowIndex:s,columnIndex:l,isDisabled:c}=t,{isAdmin:u,isBuilderMode:d}=Ht(),{taskRegisterData:f,updateTaskRegisterData:h,updateTaskProgressValue:g,updateUserFormDataSubmit:v,userTaskSubmitFormData:m,TASK_PUBLISHED:A,task_status:w}=Ar(),{userSelectedLanguage:C,fieldSettingUpdate:x}=sn(),[T,S]=k.useState(null),[E,_]=k.useState(!1),[M,N]=k.useState(null),[F,P]=k.useState(0),[H,O]=k.useState(!1),[j,U]=k.useState(!1),le=()=>{U(!0)},R=()=>{U(!1)},X=()=>{var se,fe;if(a!=null&&a.rowIsRepeatable){if(a!=null&&a.repeatableFields){const Ae=[...a.repeatableFields],Ne=_t.findIndex(Ae,function(Le){return Le.uuid===(e==null?void 0:e.uuid)});Ne>=0&&Ae[Ne].fieldData?N(Number(Ae[Ne].fieldData)||null):N(null)}}else{const Ae=m;if(Ae!=null&&Ae.length){for(const Ne of Ae)if(Ne.fieldId===t.field.uuid&&((se=Ne==null?void 0:Ne.postData)!=null&&se.length)){N(Number((fe=Ne==null?void 0:Ne.postData[0])==null?void 0:fe.postValue)||null);break}}}O(!0)};k.useEffect(()=>{H||X();const se=Gt.addListener("clearRepeatableFields",ze=>{ze===(a==null?void 0:a.uuid)&&(N(null),P(0),e.isValid=0,x(i,r,s,l,n,e))}),fe=Gt.addListener("onSubmitUserForm",()=>{var ze;(ze=e==null?void 0:e.attributes)!=null&&ze.required?M?e.isValid=1:e.isValid=0:e.isValid=1}),Ae=Gt.addListener("OnInvalidFieldCatch",ze=>{e.uuid===(ze==null?void 0:ze.fieldId)?P(1):P(0)}),Ne=Gt.addListener("OnGetFieldValue",ze=>{var it;const tt=(it=ze==null?void 0:ze.repeatableColumn)==null?void 0:it.filter(ht=>(ht==null?void 0:ht.fieldUuid)===(e==null?void 0:e.uuid));tt!=null&&tt.length}),Le=Gt.addListener("formFieldAdded",ze=>{T===null&&S(ze.uuid)});return()=>{fe.remove(),Ae.remove(),Ne.remove(),se.remove(),Le.remove()}}),k.useEffect(()=>(T!==null&&setTimeout(()=>{S(null)},1e3),()=>{}),[T]);const ce=se=>{_(se)},Y=()=>{_(!1)},ae=se=>{const fe=m,Ae=_t.cloneDeep(f);if(fe!==null){if(se){if(Ae[e==null?void 0:e.uuid]=se,(fe==null?void 0:fe.length)>0)for(const Ne of fe)Ne.fieldId===t.field.uuid&&(Ne.postData[0]={postValue:se})}else if(delete Ae[e==null?void 0:e.uuid],(fe==null?void 0:fe.length)>0)for(const Ne of fe)Ne.fieldId===t.field.uuid&&(Ne.postData[0]={postValue:""})}if(!(a!=null&&a.rowIsRepeatable)){h(Ae);const Ne=Object.keys(Ae).length;g(Ne)}},re=(se,fe)=>{var Ae;if(m!=null&&m.length){const Ne=[...m],Le=_t.findIndex(Ne,function(tt){return tt.rowId===(a==null?void 0:a.uuid)});let ze=(Ae=m[Le])==null?void 0:Ae.repeatableFields;ze={...ze,[se==null?void 0:se.uuid]:fe},Ne[Le]={...Ne[Le],repeatableFields:ze},v(Ne)}N(fe),fe!==""?se.isValid=1:se.isValid=0},Z=o.jsxs("div",{onMouseOver:le,onMouseOut:R,children:[d===!0&&j===!0&&o.jsx(Wr,{handleFieldSettingsSidebar:ce,...t}),o.jsxs("div",{className:`field ${d===!0&&" py-3 px-4 builder-element-wrapper "} ${(e==null?void 0:e.isFluid)===!0&&" p-fluid"}`,children:[o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:u?"col-6 ":"col-12 p-fluid",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(K=e==null?void 0:e.headerText)==null?void 0:K[C==null?void 0:C.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(ca,{...t}),((W=e==null?void 0:e.attributes)==null?void 0:W.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",d?o.jsx(aa,{...t}):o.jsx(o.Fragment,{children:(ge=e==null?void 0:e.label)==null?void 0:ge[C==null?void 0:C.type]}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(zi,{message:(ve=e==null?void 0:e.toolTip)==null?void 0:ve[C==null?void 0:C.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-"+((be=(Ie=e==null?void 0:e.icon)==null?void 0:Ie.properties)==null?void 0:be.name)}),o.jsx(eo,{readOnly:c,id:e==null?void 0:e.uuid,disabled:u||c,placeholder:(de=e==null?void 0:e.placeholder)==null?void 0:de[C==null?void 0:C.type],value:M,min:(ne=e==null?void 0:e.attributes)==null?void 0:ne.min,max:e==null?void 0:e.attributes.max,suffix:e==null?void 0:e.attributes.suffix,prefix:(q=e==null?void 0:e.attributes)==null?void 0:q.prefix,showButtons:(ee=e==null?void 0:e.attributes)==null?void 0:ee.showButtons,pt:{incrementButton:{className:"bg-teal-500 border-teal-500"},decrementButton:{className:"bg-orange-500 border-orange-500"}},minFractionDigits:(oe=e==null?void 0:e.attributes)==null?void 0:oe.minFractionDigits,maxFractionDigits:(pe=e==null?void 0:e.attributes)==null?void 0:pe.maxFractionDigits,locale:(Ce=e==null?void 0:e.attributes)==null?void 0:Ce.locale,mode:(De=e==null?void 0:e.attributes)==null?void 0:De.mode,currency:(me=e==null?void 0:e.attributes)==null?void 0:me.currency,currencyDisplay:(Te=e==null?void 0:e.attributes)==null?void 0:Te.currencyDisplay,useGrouping:(Pe=e==null?void 0:e.attributes)==null?void 0:Pe.useGrouping,onFocus:()=>P(1),onChange:se=>{a!=null&&a.rowIsRepeatable?re(e,se.value):ae(se.value)},className:F===1&&((Ee=e==null?void 0:e.attributes)!=null&&Ee.required)?M?"valid":"invalid":"valid'"})]}),o.jsx("div",{children:(($=e==null?void 0:e.attributes)==null?void 0:$.required)&&o.jsx("small",{className:"error",children:F===1&&!M?(he=e==null?void 0:e.validationMesssage)==null?void 0:he.english:""})}),o.jsx("div",{children:(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(ye=e==null?void 0:e.helperText)==null?void 0:ye[C==null?void 0:C.type]})})]})]}),u&&o.jsx(o.Fragment,{children:o.jsx("div",{className:"col-6",children:o.jsx(ki,{...t})})})]}),u&&o.jsx("hr",{})]})]});return o.jsxs(o.Fragment,{children:[E===!0&&d===!0&&o.jsx(Qi,{visibilty:E,closeSettingFieldSidebar:Y,...t}),o.jsx(xi,{...t,fieldWrap:Z})]})};//! moment.js
2291
2291
  //! version : 2.30.1
2292
2292
  //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
@@ -53049,7 +53049,7 @@ const xle = (t) => {
53049
53049
  A[m] = {
53050
53050
  ...A[m],
53051
53051
  reviewerChecklist: v
53052
- }, a(A), s(A, o, "/task-issues-activity/");
53052
+ }, a(A), s(A, o, "/task/update/formdata/");
53053
53053
  }, u = (v, m) => {
53054
53054
  const A = e;
53055
53055
  A[m] = {
@@ -60057,7 +60057,7 @@ var m0e = function() {
60057
60057
  theme: i.theme,
60058
60058
  formats: i.formats
60059
60059
  };
60060
- m0e ? w(new Quill(d.current, P)) : import("./quill-U0U-fMvW.js").then(function(z) {
60060
+ m0e ? w(new Quill(d.current, P)) : import("./quill-Bb_1SRgD.js").then(function(z) {
60061
60061
  if (z && Ce.isExist(d.current)) {
60062
60062
  var F;
60063
60063
  z.default ? F = new z.default(d.current, P) : F = new z(d.current, P), w(F);
@@ -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-CDahdulO.js";
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-Ddyqppzv.js";
5
5
  function Ki(n) {
6
6
  return n;
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cft-builder",
3
- "version": "0.2.336",
3
+ "version": "0.2.337",
4
4
  "type": "module",
5
5
  "types": "dist/types/index",
6
6
  "files": [