cft-builder 0.2.47 → 0.2.48

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 { D as s, C as o, E as a, F as d, R as i, T as u, A as B, z as l, B as m } from "./main-KLdaqjrb.js";
1
+ import { D as s, C as o, E as a, F as d, R as i, T as u, A as B, z as l, B as m } from "./main-CIYHc7IO.js";
2
2
  export {
3
3
  s as BuilderItems,
4
4
  o as BuilderItemsRender,
@@ -1598,7 +1598,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1598
1598
  }
1599
1599
  }
1600
1600
  `}}),X8=b.forwardRef(function(t,e){var n=zn(),r=b.useContext(nr),i=I3.getProps(t,r),a=b.useState(i.id),s=I_(a,2),l=s[0],c=s[1],u=b.useState(i.collapsed),d=I_(u,2),f=d[0],h=d[1],g=i.toggleable?i.onToggle?i.collapsed:f:!1,v=b.useRef(null),m=b.useRef(null),A=l+"_header",S=l+"_content",T=I3.setMetaData({props:i,state:{id:l,collapsed:g}}),w=T.ptm,E=T.cx,x=T.isUnstyled;hi(I3.css.styles,x,{name:"fieldset"});var I=function(G){i.toggleable&&(g?_(G):O(G),i.onToggle&&i.onToggle({originalEvent:G,value:!g})),G.preventDefault()},_=function(G){i.onToggle||h(!1),i.onExpand&&i.onExpand(G)},O=function(G){i.onToggle||h(!0),i.onCollapse&&i.onCollapse(G)};Pi(function(){i.id||c(el())});var B=function(G){(G.code==="Enter"||G.code==="NumpadEnter"||G.code==="Space")&&(I(G),G.preventDefault())},M=function(){var G=n({className:E("content")},w("content")),ce=n({ref:m,id:S,role:"region","aria-labelledby":A,className:E("toggleableContent")},w("toggleableContent")),K=n({classNames:E("transition"),timeout:{enter:1e3,exit:450},in:!g,unmountOnExit:!0,options:i.transitionOptions},w("transition"));return b.createElement(tl,E3({nodeRef:m},K),b.createElement("div",ce,b.createElement("div",G,i.children)))},V=function(){if(i.toggleable){var G=n({className:E("togglericon")},w("togglericon")),ce=g?i.expandIcon||b.createElement(A3,G):i.collapseIcon||b.createElement(K8,G),K=Wn.getJSXIcon(ce,G,{props:i});return K}return null},$=function(){var G=n({className:E("legendTitle")},w("legendTitle")),ce=n({id:A,role:"button","aria-expanded":!g,"aria-controls":S,onKeyDown:B,onClick:I,"aria-label":i.legend,tabIndex:0},w("toggler"));if(i.toggleable){var K=V();return b.createElement("a",ce,K,b.createElement("span",G,i.legend),b.createElement(en,null))}return b.createElement("span",E3({},G,{id:A}),i.legend)},k=function(){var G=n({className:E("legend")},w("legend"));if(i.legend!=null||i.toggleable){var ce=$();return b.createElement("legend",G,ce)}};b.useImperativeHandle(e,function(){return{props:i,getElement:function(){return v.current},getContent:function(){return m.current}}});var z=n({id:l,ref:v,style:i.style,className:ft(i.className,E("root")),onClick:i.onClick},I3.getOtherProps(i),w("root")),le=k(),fe=M();return b.createElement("fieldset",z,le,fe)});X8.displayName="Fieldset";const dQ=t=>o.jsx(sn,{target:`.${t==null?void 0:t.element}`,position:"right",children:o.jsxs("div",{style:{width:400},className:"m-3",children:[o.jsx("div",{className:"text-900 font-medium text-2xl mb-2",children:t==null?void 0:t.label}),o.jsx("div",{children:"Dynamic Listing Component"}),o.jsx(ra,{}),o.jsxs("div",{className:"p-fluid",children:[o.jsx("label",{children:t==null?void 0:t.label}),o.jsxs("div",{children:[o.jsxs(X8,{children:[o.jsx("div",{className:"pi pi-circle",children:" Option 1"}),o.jsx("br",{})]}),o.jsx("br",{}),o.jsx(X8,{children:o.jsx("div",{className:"pi pi-circle",children:" Option 2"})})]})]})]})}),fQ=t=>o.jsx(sn,{target:`.${t==null?void 0:t.element}`,position:"right",children:o.jsxs("div",{style:{width:400},className:"m-3",children:[o.jsx("div",{className:"text-900 font-medium text-2xl mb-2",children:t==null?void 0:t.label}),o.jsx("div",{children:"Documents"}),o.jsx(ra,{}),o.jsxs("div",{className:"p-fluid",children:[o.jsx("label",{children:t==null?void 0:t.label}),o.jsxs("div",{children:["1.Hr Cv.docx",o.jsx("br",{}),"2.Readme.txt",o.jsx("br",{}),"3.Cover.jpg"]})]})]})}),hQ=[{label:"Free form inputs",icon:"pi pi-fw pi-file",expanded:!0,items:[{label:"Text",icon:"pi pi-fw pi-plus",element:"input",schema:eK,uuid:et(),type:Gn,toolTip:t=>OX(t)},{label:"Number",icon:"pi pi-fw pi-trash",element:"number",schema:ZY,uuid:et(),type:Gn,toolTip:t=>FX(t)},{label:"Email",icon:"pi pi-fw pi-external-link",element:"email",schema:JY,uuid:et(),type:Gn,toolTip:t=>kX(t)},{label:"Text Area",icon:"pi pi-fw pi-external-link",element:"textArea",schema:sK,uuid:et(),type:Gn,toolTip:t=>PX(t)},{label:"Text Editor",icon:"pi pi-fw pi-external-link",element:"textHtmlEditor",schema:QY,uuid:et(),type:Gn,toolTip:t=>MX(t)},{label:"Date Picker",icon:"pi pi-fw pi-user-plus",element:"date-picker",schema:HY,uuid:et(),type:Gn,toolTip:t=>PR(t)},{label:"Draw Signature",icon:"pi pi-fw pi-trash",element:"signature",schema:NT,uuid:et(),type:Gn,toolTip:t=>UR(t)},{label:"Type Signature",icon:"pi pi-fw pi-trash",element:"type-signature",schema:oK,uuid:et(),type:Gn,toolTip:t=>qR(t)},{label:"File Upload",icon:"pi pi-fw pi-trash",element:"file-upload",schema:RY,uuid:et(),type:Gn,toolTip:t=>$R(t)},{label:"Phone Number",icon:"pi pi-fw pi-trash",element:"phone",schema:nK,uuid:et(),type:Gn,PhoneNumberToolTip:kE,toolTip:t=>kE(t)},{label:"Website Url",icon:"pi pi-fw pi-trash",element:"web-url",schema:cK,uuid:et(),type:Gn,toolTip:t=>zR(t)},{label:"Hidden Field",icon:"pi pi-fw pi-trash",element:"hidden-field",schema:WY,uuid:et(),type:Gn,toolTip:t=>wG(t)},{label:"Address",icon:"pi pi-fw pi-trash",element:"address",schema:jY,uuid:et(),type:Gn,toolTip:t=>SG(t)},{label:"Grid Component",icon:"pi pi-fw pi-trash",element:"grid-component",schema:GY,uuid:et(),type:Gn,toolTip:t=>aQ(t)},{label:"Matrix Dropdown",icon:"pi pi-fw pi-trash",element:"matrix-dropdown",schema:tK,uuid:et(),type:Gn,toolTip:t=>sQ(t)}]},{label:"Controlled inputs",icon:"pi pi-fw pi-pencil",items:[{label:"Countries",icon:"pi pi-fw pi-align-left",element:"country",schema:vT,uuid:et(),type:Gn,toolTip:t=>S_(t)},{label:"Dropdown",icon:"pi pi-fw pi-align-left",element:"select",schema:DT,uuid:et(),type:Gn,toolTip:t=>x_(t)},{label:"Multi Select",icon:"pi pi-fw pi-align-right",element:"multi-select",schema:TT,uuid:et(),type:Gn,toolTip:t=>C_(t)},{label:"CheckBox",icon:"pi pi-fw pi-align-left",element:"checkbox",schema:mT,uuid:et(),type:Gn,toolTip:t=>T_(t)},{label:"Radio Button",icon:"pi pi-fw pi-align-left",element:"radio",schema:IT,uuid:et(),type:Gn,toolTip:t=>H8(t)},{label:"Hierarchal Radio",icon:"pi pi-fw pi-align-left",element:"radio-hierarchal",schema:iK,uuid:et(),type:Gn,toolTip:t=>H8(t)},{label:"Dynamic Radio",icon:"pi pi-fw pi-align-left",element:"dynamic-listing",schema:YY,uuid:et(),type:Gn,toolTip:t=>dQ(t)}]},{label:"Rating Inputs",icon:"pi pi-fw pi-pencil",items:[{label:"Likert Scale",icon:"pi pi-fw pi-trash",element:"likert-scale",schema:CT,uuid:et(),type:Gn,toolTip:t=>g8(t)},{label:"Slider",icon:"pi pi-fw pi-trash",element:"slider",schema:OT,uuid:et(),type:Gn,toolTip:t=>zE(t)},{label:"Rating",icon:"pi pi-fw pi-trash",element:"rating",schema:_T,uuid:et(),type:Gn,toolTip:t=>qE(t)},{label:"Thumbs Up and Down",icon:"pi pi-fw pi-align-left",element:"thumbs",schema:FT,uuid:et(),type:Gn,toolTip:t=>yG(t)},{label:"Likert Emoji Scale",icon:"pi pi-fw pi-align-left",element:"likert-emoji-scale",schema:xT,uuid:et(),type:Gn,toolTip:t=>AG(t)}]},{label:"Social Logins",icon:"pi pi-fw pi-pencil",items:[{label:"Facebook Login",icon:"pi pi-fw pi-trash",element:"facebook-login",schema:XY,uuid:et(),type:Gn,toolTip:t=>g8(t)}]},{label:"Media",icon:"pi pi-fw pi-user",items:[{label:"Document",icon:"pi pi-fw pi-trash",element:"document",schema:bT,uuid:et(),type:Gn,toolTip:t=>fQ(t)}]}],pQ=[{label:"HTML",icon:"pi pi-fw pi-file",expanded:!0,items:[{label:"<a>",icon:"pi pi-fw pi-plus",element:"a",schema:wT,uuid:et(),type:Gn},{label:"<p>",icon:"pi pi-fw pi-trash",element:"paragraph",schema:ET,uuid:et(),type:Gn},{label:"<heading>",icon:"pi pi-fw pi-external-link",element:"h",schema:yT,uuid:et(),type:Gn},{label:"<li>",icon:"pi pi-fw pi-external-link",element:"list",schema:lK,uuid:et(),type:Gn},{label:"divider",icon:"pi pi-fw pi-external-link",element:"hr",schema:AT,uuid:et(),type:Gn},{label:"Image",icon:"pi pi-fw pi-user-plus",element:"image",schema:g9,uuid:et(),type:Gn},{label:"Image Gallery",icon:"pi pi-fw pi-user-plus",element:"image-gallery",schema:ST,uuid:et(),type:Gn},{label:"Video",icon:"pi pi-fw pi-user-minus",element:"video",schema:m9,uuid:et(),type:Gn}]}],gQ=[{label:"Controlled inputs",icon:"pi pi-fw pi-pencil",items:[{label:"Countries",icon:"pi pi-fw pi-align-left",element:"country",schema:vT,uuid:et(),type:Gn,toolTip:t=>S_(t)},{label:"Dropdown",icon:"pi pi-fw pi-align-left",element:"select",schema:DT,uuid:et(),type:Gn,toolTip:t=>x_(t)},{label:"Multi Select",icon:"pi pi-fw pi-align-right",element:"multi-select",schema:TT,uuid:et(),type:Gn,toolTip:t=>C_(t)},{label:"CheckBox",icon:"pi pi-fw pi-align-left",element:"checkbox",schema:mT,uuid:et(),type:Gn,toolTip:t=>T_(t)},{label:"Radio Button",icon:"pi pi-fw pi-align-left",element:"radio",schema:IT,uuid:et(),type:Gn,toolTip:t=>H8(t)}]},{label:"Rating Inputs",icon:"pi pi-fw pi-pencil",items:[{label:"Likert Scale",icon:"pi pi-fw pi-trash",element:"likert-scale",schema:CT,uuid:et(),type:Gn,toolTip:t=>g8(t)},{label:"Slider",icon:"pi pi-fw pi-trash",element:"slider",schema:OT,uuid:et(),type:Gn,toolTip:t=>zE(t)},{label:"Rating",icon:"pi pi-fw pi-trash",element:"rating",schema:_T,uuid:et(),type:Gn,toolTip:t=>qE(t)},{label:"Thumbs Up and Down",icon:"pi pi-fw pi-align-left",element:"thumbs",schema:FT,uuid:et(),type:Gn},{label:"Likert Emoji Scale",icon:"pi pi-fw pi-align-left",element:"likert-emoji-scale",schema:xT,uuid:et(),type:Gn}]}],mQ=[{label:"Media",icon:"pi pi-fw pi-user",items:[{label:"Image",icon:"pi pi-fw pi-user-plus",element:"image",schema:g9,uuid:et(),type:Gn},{label:"Video",icon:"pi pi-fw pi-user-minus",element:"video",schema:m9,uuid:et(),type:Gn},{label:"Quiz",icon:"pi pi-fw pi-trash",element:"quiz",schema:rK,uuid:et(),type:Gn},{label:"Document",icon:"pi pi-fw pi-trash",element:"document",schema:bT,uuid:et(),type:Gn}]}],vQ=[{label:"Left",icon:"pi pi-align-left",value:"left"},{label:"Right",icon:"pi pi-align-right",value:"right"}],bQ=[{key:1,language:"English",type:"english"},{key:2,language:"Urdu",type:"urdu"},{key:3,language:"Hindi",type:"hindi"},{key:4,language:"Arabic",type:"arabic"},{key:5,language:"French",type:"french"},{key:6,language:"Italian",type:"italian"},{key:7,language:"Spanish",type:"spanish"}],yQ=[{name:"Bad Script",font:"bad-script"},{name:"Bilbo Swash Caps",font:"bilbo-swash-caps"},{name:"caveat",font:"caveat"},{name:"Covered By Your Grace",font:"covered-by-your-grace"},{name:"Dancing Script",font:"dancing-script"},{name:"Gochi Hand",font:"gochi-hand"},{name:"Great Vibes",font:"great-vibes"},{name:"Handlee",font:"handlee"},{name:"Just Another Hand",font:"just-another-hand"},{name:"Kalam",font:"kalam"},{name:"La Belle Aurore",font:"la-belle-aurore"},{name:"Marck Script",font:"marck-script"},{name:"Nothing You Could Do",font:"nothing-you-could-do"},{name:"Qwigley",font:"qwigley"},{name:"Sacramento",font:"sacramento"},{name:"Shadows Into Light",font:"shadows-into-light"},{name:"Stalemate",font:"stalemate"},{name:"Yellowtail",font:"yellowtail"}],_3={type:dT,isCoverPage:!1,margin:{left:0,right:0,top:0,bottom:0},isVisible:!0,isHidden:!1,isValid:!1,displayRules:[],title:{english:"Page 1"}},kf={type:na,showSectionHeader:!1,isVisible:!0,isHidden:!1,isValid:!1,showSectionTitle:!1,showSectionSubTitle:!1,heading:{english:"Section header"},subHeadingText:{english:""},isCollapsed:!1},mu={type:Oo,isHidden:!1,isValid:!1,isRequired:!1,isCollapsed:!1,showRowTitle:!0,showRowSubTitle:!0,heading:{english:""},subHeadingText:{english:""},rowIsRepeatable:!1,repeatableFields:[],repeatableFieldsData:[],isMinimumEntries:!1,minimumEntries:5,addToListButtonLabel:{english:"Add To List"},reviewerChecklist:[]},Bc={type:ws,isCollapsed:!1},AQ=t=>{let e=t;e={...e,uuid:et()};const n=e.children.map(r=>({...r,uuid:et(),children:r.children.map(i=>({...i,uuid:et(),children:i.children.map(a=>{var s;return{...a,uuid:et(),...((s=a==null?void 0:a.children)==null?void 0:s.length)>0?{children:a.children.map(l=>{var c;return{...l,uuid:et(),...((c=l.options)==null?void 0:c.length)>0?{options:l.options.map(u=>({...u,uuid:et()}))}:{}}})}:{}}})}))}));return e={...e,children:n},e};function wQ(t){return e=>{const n={..._3,uuid:et(),title:{english:`Page ${t+1}`},children:[{...kf,uuid:et(),children:[{...mu,uuid:et(),children:[{...Bc,uuid:et(),children:[]}]}]}]};e({type:zC,payLoad:n})}}function SQ(t){return e=>{const n=[];for(const[,i]of t.entries())for(const[,a]of i.children.entries())for(const[,s]of a.children.entries())for(const[,l]of s.children.entries())for(const[,c]of l.children.entries())s!=null&&s.rowIsRepeatable||n.push(c);e({type:lT,payLoad:{tableFields:n}})}}function xQ(t,e){return(n,r)=>{const i=t;let a=_t.cloneDeep(i);const{layout:s}=r;a={...a,title:{english:`Page ${(s==null?void 0:s.length)+1}`}},a=AQ(a),n({type:XC,payLoad:{page:a,pageIndex:e}})}}function CQ(t,e){return n=>{n({type:oT,payLoad:{pageIndex:t,page:e}})}}function TQ(t){return e=>{e({type:LC,payLoad:{pageIndex:t}})}}const __=t=>{let e=t;e={...e,uuid:et()};const n=e.children.map(r=>({...r,uuid:et(),children:r.children.map(i=>{var a;return{...i,uuid:et(),...((a=i==null?void 0:i.children)==null?void 0:a.length)>0?{children:i.children.map(s=>{var l;return{...s,uuid:et(),...((l=s.options)==null?void 0:l.length)>0?{options:s.options.map(c=>({...c,uuid:et()}))}:{}}})}:{}}})}));return e={...e,children:n},e};function EQ(t,e){return n=>{n({type:BC,payLoad:{pageIndex:t,sectionIndex:e}})}}function IQ(t){return e=>{const n={...kf,uuid:et(),children:[{...mu,uuid:et(),children:[{...Bc,uuid:et(),children:[]}]}]};e({type:HC,payLoad:{pageIndex:t,section:n}})}}function _Q(t,e,n){return r=>{r({type:jC,payLoad:{pageIndex:t,sectionIndex:e,section:n}})}}function DQ(t,e,n){return r=>{const i=t;let a=_t.cloneDeep(i);a=__(a),r({type:RC,payLoad:{section:a,pageIndex:e,sectionIndex:n}})}}function NQ(t,e){return n=>{const r=t;let i=_t.cloneDeep(r);i=__(i),n({type:GC,payLoad:{section:i,pageIndex:e}})}}const OQ=t=>{let e=t;e={...e,uuid:et()};const n=e.children.map(r=>{var i;return{...r,uuid:et(),...((i=r==null?void 0:r.children)==null?void 0:i.length)>0?{children:r.children.map(a=>{var s;return{...a,uuid:et(),...((s=a.options)==null?void 0:s.length)>0?{options:a.options.map(l=>({...l,uuid:et()}))}:{}}})}:{}}});return e={...e,children:n},e};function FQ(t,e,n,r){return i=>{const a=t;let s=_t.cloneDeep(a);s=OQ(s),i({type:WC,payLoad:{row:s,pageIndex:e,sectionIndex:n,rowIndex:r}})}}function kQ(t,e,n,r){return i=>{i({type:d9,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,row:r}})}}function PQ(t,e,n){return r=>{r({type:VC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n}})}}function MQ(t,e){return n=>{const r={...mu,uuid:et(),isCollapsed:!1,children:[{...Bc,uuid:et(),children:[]}]};n({type:YC,payLoad:{pageIndex:t,sectionIndex:e,row:r}})}}function LQ(t,e,n,r){return i=>{i({type:eT,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,fieldItem:r}})}}const BQ=t=>{var r;let e=t;e={...e,uuid:et()};const n=((r=e==null?void 0:e.children)==null?void 0:r.length)>0?e.children.map((i,a)=>{var s;return{...i,uuid:et(),...((s=i.options)==null?void 0:s.length)>0?{options:i.options.map((l,c)=>({...l,uuid:et()}))}:{}}}):[];return e={...e,children:n},e};function VQ(t,e,n){return r=>{const i={...Bc,uuid:et(),children:[]};r({type:KC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,column:i}})}}function UQ(t,e,n,r,i){return a=>{const s=t;let l=_t.cloneDeep(s);l=BQ(l),a({type:QC,payLoad:{column:l,pageIndex:e,sectionIndex:n,rowIndex:r,columnIndex:i}})}}function qQ(t,e,n,r){return i=>{i({type:UC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r}})}}function D_(t,e,n,r){return i=>{i({type:d9,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,row:r}})}}function $Q(t,e,n,r,i){return(a,s)=>{var g,v,m,A;const{layout:l,tableFields:c}=s;let u=(g=l[t])==null?void 0:g.children[e].children[n];const d=(A=(m=(v=l[t])==null?void 0:v.children[e])==null?void 0:m.children[n])==null?void 0:A.children[r].children[i];if((u==null?void 0:u.rowIsRepeatable)===!0){const S=[...u.repeatableFields],T=_t.findIndex(S,function(w){return w.uuid===(d==null?void 0:d.uuid)});S.splice(T,1),u={...u,repeatableFields:S},a(D_(t,e,n,u))}const f=_t.findIndex(c,function(S){return S.uuid===(d==null?void 0:d.uuid)});c.splice(f,1),a({type:qC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i}})}}function jQ(t,e,n,r,i,a){return(s,l)=>{var g,v,m,A;const{layout:c,tableFields:u}=l;let d=(g=c[t])==null?void 0:g.children[e].children[n];if((d==null?void 0:d.rowIsRepeatable)===!0){const S=(A=(m=(v=c[t])==null?void 0:v.children[e])==null?void 0:m.children[n])==null?void 0:A.children[r].children[i],T=[...d.repeatableFields],w=_t.findIndex(T,function(E){return E.uuid===(S==null?void 0:S.uuid)});w===-1?T.splice(i,0,a):T[w]=a,T[w]=a,d={...d,repeatableFields:T},s(D_(t,e,n,d))}const f={type:$C,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,field:a}},h=u.findIndex(S=>S.uuid===a.uuid);h>=0&&(u[h]=a),s(f)}}function zQ(t,e,n,r,i,a){return s=>{var d;const l=t;let c=_t.cloneDeep(l);if(c={...c,uuid:et()},c!=null&&c.options&&((d=c==null?void 0:c.options)==null?void 0:d.length)>0){const f=c==null?void 0:c.options.map(h=>({...h,uuid:et()}));c={...c,options:f}}s({type:JC,payLoad:{field:c,pageIndex:e,sectionIndex:n,rowIndex:r,columnIndex:i,fieldIndex:a}})}}function HQ(t,e,n,r,i,a,s,l){return c=>{c({type:tT,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,ruleIndex:a,conditionIndex:s,field:l}})}}function YQ(t,e,n,r,i,a,s,l){return c=>{c({type:nT,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,gridColumnIndex:s,gridRowIndex:a,field:l}})}}function KQ(t,e,n,r,i,a,s,l,c){return u=>{u({type:aT,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,gridRowIndex:a,gridColumnIndex:s,fieldChildrenIndex:l,field:c}})}}function XQ(t,e,n,r,i,a,s,l){return c=>{c({type:sT,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,gridRowIndex:a,gridColumnIndex:s,fieldChildrenIndex:l}})}}function RQ(t,e,n,r,i,a,s,l,c){return u=>{u({type:rT,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,ruleIndex:a,conditionIndex:s,inlineFieldIndex:l,field:c}})}}function GQ(t,e,n,r,i,a,s,l){return c=>{c({type:iT,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,ruleIndex:a,conditionIndex:s,inlineFieldIndex:l}})}}function WQ(t){return e=>{e({type:hf,payLoad:{formSchema:t}})}}function QQ(t){return e=>{e({type:hf,payLoad:{layout:t}})}}function JQ(t){return(e,n)=>{const{languages:r}=n,i={type:hf,payLoad:{languages:[...r,t]}};e(i)}}function ZQ(t){return(e,n)=>{const{languages:r}=n,i=_t.findIndex(r,l=>l.key===t.key),a=[...r];a.splice(i,1),e({type:hf,payLoad:{languages:a}})}}function eJ(t){return e=>{const n={type:hf,payLoad:{userSelectedLanguage:t.value}};e(n)}}function tJ(t){return e=>{e({type:Bm,payLoad:{formType:t}})}}function nJ(t){return e=>{e({type:Bm,payLoad:t})}}function rJ(t){return e=>{e({type:Bm,payLoad:{editing_by:t}})}}function iJ(){return t=>{t({type:ZC,payLoad:null})}}const R8={loading:!1,intro:"",editing_by:0,isChangesSaved:!1,enableReviewTask:!1,enableAutoSave:!1,enableAutoSaveBuilderSetting:!1,surveyQuestionSlide:!1,enableFormFluid:!0,showConditionalFields:!0,isAdvanceView:!1,models:[],fieldMappings:[],version_name:null,showIntroTab:!1,published_status:!1,formType:null,randomiseQuestions:!1,randomiseAnswers:!1,enableNoOfAssessmentQuestions:!1,noOfAssessmentQuestions:null,tableFields:[],tableConfiguration:{stripedRows:!1,gridLines:!1,flexScroll:!1,isResponsive:!1,rowReorder:!1},builderTemplateName:"",quizConfiguration:{quizPassMark:75,quizTimeLimit:2,quizMaxAttempts:99,quizSequentialAnswer:0,isAllCorrectMandatory:!0,quizRandomiseQuestions:1,quizUniqueAnswersPerAttempt:"1"},header:[],languages:[{key:1,language:"English",type:"english"}],userSelectedLanguage:{key:1,language:"English",type:"english"},layout:[{uuid:et(),..._3,children:[{uuid:et(),...kf,children:[{uuid:et(),...mu,children:[{uuid:et(),...Bc,children:[]}]}]}]}],conditionalTabsRules:[],conditionalSectionsRules:[]},aJ=(t=R8,e)=>{var n,r;switch(e.type){case UY:return{...t,...e.payLoad};case VY:return{...t,...e.payLoad};case ZC:return{...t,...R8};case hf:return{...t,...e.payLoad};case Bm:return{...t,...e.payLoad};case LC:{const{pageIndex:i}=e.payLoad;return{...t,layout:t.layout.filter((a,s)=>s!==i)}}case zC:return{...t,layout:[...t.layout,e.payLoad]};case HC:{const{pageIndex:i,section:a}=e.payLoad,s=[...t.layout];return s[i].children=[...s[i].children,a],{...t,layout:s}}case eT:{const{pageIndex:i,sectionIndex:a,rowIndex:s,fieldItem:l}=e.payLoad,c=[...t.layout],u=Array.isArray((n=c[i].children[a].children[s])==null?void 0:n.repeatableFields)?[...((r=c[i].children[a].children[s])==null?void 0:r.repeatableFields)||[],l]:l?[l]:[];return c[i].children[a].children[s]={...c[i].children[a].children[s],repeatableFields:u},{...t,layout:c}}case qY:{const{fieldItem:i}=e.payLoad;let a=[...t.tableFields];return a=[...a,i],{...t,tableFields:a}}case lT:return{...t,...e.payLoad};case YC:{const{pageIndex:i,sectionIndex:a,row:s}=e.payLoad,l=[...t.layout];return l[i].children[a].children=[...l[i].children[a].children,s],{...t,layout:l}}case KC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,column:l}=e.payLoad,c=[...t.layout];return c[i].children[a].children[s].children=[...c[i].children[a].children[s].children,l],{...t,layout:c}}case tT:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,ruleIndex:u,conditionIndex:d,field:f}=e.payLoad,h=[...t.layout];return h[i].children[a].children[s].children[l].children[c].inlineConditionalRules.rules[u].conditions[d].children=[...h[i].children[a].children[s].children[l].children[c].inlineConditionalRules.rules[u].conditions[d].children,f],{...t,layout:h}}case nT:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,gridRowIndex:u,gridColumnIndex:d,field:f}=e.payLoad,h=[...t.layout];return h[i].children[a].children[s].children[l].children[c].children.push({[`${u}-${d}`]:f}),{...t,layout:h}}case rT:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,ruleIndex:u,conditionIndex:d,inlineFieldIndex:f,field:h}=e.payLoad,g=[...t.layout];return g[i].children[a].children[s].children[l].children[c].inlineConditionalRules.rules[u].conditions[d].children[f]=h,{...t,layout:g}}case aT:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,gridRowIndex:u,gridColumnIndex:d,fieldChildrenIndex:f,field:h}=e.payLoad,g=[...t.layout];return g[i].children[a].children[s].children[l].children[c].children[f]={[`${u}-${d}`]:h},{...t,layout:g}}case iT:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,ruleIndex:u,conditionIndex:d,inlineFieldIndex:f}=e.payLoad,h=[...t.layout];return h[i].children[a].children[s].children[l].children[c].inlineConditionalRules.rules[u].conditions[d].children.splice(f,1),{...t,layout:h}}case sT:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,fieldChildrenIndex:u}=e.payLoad,d=[...t.layout];return d[i].children[a].children[s].children[l].children[c].children.splice(u,1),{...t,layout:d}}case BC:{const{pageIndex:i,sectionIndex:a}=e.payLoad,s=[...t.layout];return s[i].children.splice(a,1),{...t,layout:s}}case VC:{const{pageIndex:i,sectionIndex:a,rowIndex:s}=e.payLoad,l=[...t.layout];return l[i].children[a].children.splice(s,1),{...t,layout:l}}case UC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l}=e.payLoad,c=[...t.layout];return c[i].children[a].children[s].children.splice(l,1),{...t,layout:c}}case qC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c}=e.payLoad,u=[...t.layout];return u[i].children[a].children[s].children[l].children.splice(c,1),{...t,layout:u}}case $C:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,field:u}=e.payLoad,d=[...t.layout];return d[i].children[a].children[s].children[l].children[c]=u,{...t,layout:d}}case jC:{const{pageIndex:i,sectionIndex:a,section:s}=e.payLoad,l=[...t.layout];return l[i].children[a]=s,{...t,layout:l}}case d9:{const{pageIndex:i,sectionIndex:a,rowIndex:s,row:l}=e.payLoad,c=[...t.layout];return c[i].children[a].children[s]=l,{...t,layout:c}}case oT:{const{pageIndex:i,page:a}=e.payLoad,s=[...t.layout];return s[i]=a,{...t,layout:s}}case XC:{const{page:i,pageIndex:a}=e.payLoad,s=[...t.layout];return s.splice(a+1,0,i),{...t,layout:s}}case RC:{const{section:i,pageIndex:a,sectionIndex:s}=e.payLoad,l=[...t.layout];return l[a].children.splice(s+1,0,i),{...t,layout:l}}case GC:{const{section:i,pageIndex:a}=e.payLoad,s=[...t.layout];return s[a].children.push(i),{...t,layout:s}}case WC:{const{row:i,pageIndex:a,sectionIndex:s,rowIndex:l}=e.payLoad,c=[...t.layout];return c[a].children[s].children.splice(l+1,0,i),{...t,layout:c}}case QC:{const{column:i,pageIndex:a,sectionIndex:s,rowIndex:l,columnIndex:c}=e.payLoad,u=[...t.layout];return u[a].children[s].children[l].children.splice(c+1,0,i),{...t,layout:u}}case JC:{const{field:i,pageIndex:a,sectionIndex:s,rowIndex:l,columnIndex:c,fieldIndex:u}=e.payLoad,d=[...t.layout];return d[a].children[s].children[l].children[c].children.splice(u+1,0,i),{...t,layout:d}}}return t},N_=P.createContext({dragDropManager:void 0});function vu(t){"@babel/helpers - typeof";return vu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vu(t)}function sJ(t,e){if(vu(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(vu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function oJ(t){var e=sJ(t,"string");return vu(e)=="symbol"?e:e+""}function lJ(t,e,n){return(e=oJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function O_(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function F_(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?O_(Object(n),!0).forEach(function(r){lJ(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):O_(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function rc(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var k_=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),G8=function(){return Math.random().toString(36).substring(7).split("").join(".")},P_={INIT:"@@redux/INIT"+G8(),REPLACE:"@@redux/REPLACE"+G8(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+G8()}};function cJ(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function uJ(t){if(t===void 0)return"undefined";if(t===null)return"null";var e=typeof t;switch(e){case"boolean":case"string":case"number":case"symbol":case"function":return e}if(Array.isArray(t))return"array";if(hJ(t))return"date";if(fJ(t))return"error";var n=dJ(t);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return e.slice(8,-1).toLowerCase().replace(/\s/g,"")}function dJ(t){return typeof t.constructor=="function"?t.constructor.name:null}function fJ(t){return t instanceof Error||typeof t.message=="string"&&t.constructor&&typeof t.constructor.stackTraceLimit=="number"}function hJ(t){return t instanceof Date?!0:typeof t.toDateString=="function"&&typeof t.getDate=="function"&&typeof t.setDate=="function"}function Pf(t){var e=typeof t;return process.env.NODE_ENV!=="production"&&(e=uJ(t)),e}function M_(t,e,n){var r;if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?rc(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof e=="function"&&typeof n>"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?rc(1):"Expected the enhancer to be a function. Instead, received: '"+Pf(n)+"'");return n(M_)(t,e)}if(typeof t!="function")throw new Error(process.env.NODE_ENV==="production"?rc(2):"Expected the root reducer to be a function. Instead, received: '"+Pf(t)+"'");var i=t,a=e,s=[],l=s,c=!1;function u(){l===s&&(l=s.slice())}function d(){if(c)throw new Error(process.env.NODE_ENV==="production"?rc(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return a}function f(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?rc(4):"Expected the listener to be a function. Instead, received: '"+Pf(m)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?rc(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var A=!0;return u(),l.push(m),function(){if(A){if(c)throw new Error(process.env.NODE_ENV==="production"?rc(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");A=!1,u();var T=l.indexOf(m);l.splice(T,1),s=null}}}function h(m){if(!cJ(m))throw new Error(process.env.NODE_ENV==="production"?rc(7):"Actions must be plain objects. Instead, the actual type was: '"+Pf(m)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof m.type>"u")throw new Error(process.env.NODE_ENV==="production"?rc(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(c)throw new Error(process.env.NODE_ENV==="production"?rc(9):"Reducers may not dispatch actions.");try{c=!0,a=i(a,m)}finally{c=!1}for(var A=s=l,S=0;S<A.length;S++){var T=A[S];T()}return m}function g(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?rc(10):"Expected the nextReducer to be a function. Instead, received: '"+Pf(m));i=m,h({type:P_.REPLACE})}function v(){var m,A=f;return m={subscribe:function(T){if(typeof T!="object"||T===null)throw new Error(process.env.NODE_ENV==="production"?rc(11):"Expected the observer to be an object. Instead, received: '"+Pf(T)+"'");function w(){T.next&&T.next(d())}w();var E=A(w);return{unsubscribe:E}}},m[k_]=function(){return this},m}return h({type:P_.INIT}),r={dispatch:h,subscribe:f,getState:d,replaceReducer:g},r[k_]=v,r}function zr(t,e,...n){if(pJ()&&e===void 0)throw new Error("invariant requires an error message argument");if(!t){let r;if(e===void 0)r=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let i=0;r=new Error(e.replace(/%s/g,function(){return n[i++]})),r.name="Invariant Violation"}throw r.framesToPop=1,r}}function pJ(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function gJ(t,e,n){return e.split(".").reduce((r,i)=>r&&r[i]?r[i]:n||null,t)}function mJ(t,e){return t.filter(n=>n!==e)}function L_(t){return typeof t=="object"}function vJ(t,e){const n=new Map,r=a=>{n.set(a,n.has(a)?n.get(a)+1:1)};t.forEach(r),e.forEach(r);const i=[];return n.forEach((a,s)=>{a===1&&i.push(s)}),i}function bJ(t,e){return t.filter(n=>e.indexOf(n)>-1)}const W8="dnd-core/INIT_COORDS",D3="dnd-core/BEGIN_DRAG",Q8="dnd-core/PUBLISH_DRAG_SOURCE",N3="dnd-core/HOVER",O3="dnd-core/DROP",F3="dnd-core/END_DRAG";function B_(t,e){return{type:W8,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}const yJ={type:W8,payload:{clientOffset:null,sourceClientOffset:null}};function AJ(t){return function(n=[],r={publishSource:!0}){const{publishSource:i=!0,clientOffset:a,getSourceClientOffset:s}=r,l=t.getMonitor(),c=t.getRegistry();t.dispatch(B_(a)),wJ(n,l,c);const u=CJ(n,l);if(u==null){t.dispatch(yJ);return}let d=null;if(a){if(!s)throw new Error("getSourceClientOffset must be defined");SJ(s),d=s(u)}t.dispatch(B_(a,d));const h=c.getSource(u).beginDrag(l,u);if(h==null)return;xJ(h),c.pinSource(u);const g=c.getSourceType(u);return{type:D3,payload:{itemType:g,item:h,sourceId:u,clientOffset:a||null,sourceClientOffset:d||null,isSourcePublic:!!i}}}}function wJ(t,e,n){zr(!e.isDragging(),"Cannot call beginDrag while dragging."),t.forEach(function(r){zr(n.getSource(r),"Expected sourceIds to be registered.")})}function SJ(t){zr(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function xJ(t){zr(L_(t),"Item must be an object.")}function CJ(t,e){let n=null;for(let r=t.length-1;r>=0;r--)if(e.canDragSource(t[r])){n=t[r];break}return n}function TJ(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function EJ(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){TJ(t,i,n[i])})}return t}function IJ(t){return function(n={}){const r=t.getMonitor(),i=t.getRegistry();_J(r),OJ(r).forEach((s,l)=>{const c=DJ(s,l,i,r),u={type:O3,payload:{dropResult:EJ({},n,c)}};t.dispatch(u)})}}function _J(t){zr(t.isDragging(),"Cannot call drop while not dragging."),zr(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function DJ(t,e,n,r){const i=n.getTarget(t);let a=i?i.drop(r,t):void 0;return NJ(a),typeof a>"u"&&(a=e===0?{}:r.getDropResult()),a}function NJ(t){zr(typeof t>"u"||L_(t),"Drop result must either be an object or undefined.")}function OJ(t){const e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function FJ(t){return function(){const n=t.getMonitor(),r=t.getRegistry();kJ(n);const i=n.getSourceId();return i!=null&&(r.getSource(i,!0).endDrag(n,i),r.unpinSource()),{type:F3}}}function kJ(t){zr(t.isDragging(),"Cannot call endDrag while not dragging.")}function J8(t,e){return e===null?t===null:Array.isArray(t)?t.some(n=>n===e):t===e}function PJ(t){return function(n,{clientOffset:r}={}){MJ(n);const i=n.slice(0),a=t.getMonitor(),s=t.getRegistry(),l=a.getItemType();return BJ(i,s,l),LJ(i,a,s),VJ(i,a,s),{type:N3,payload:{targetIds:i,clientOffset:r||null}}}}function MJ(t){zr(Array.isArray(t),"Expected targetIds to be an array.")}function LJ(t,e,n){zr(e.isDragging(),"Cannot call hover while not dragging."),zr(!e.didDrop(),"Cannot call hover after drop.");for(let r=0;r<t.length;r++){const i=t[r];zr(t.lastIndexOf(i)===r,"Expected targetIds to be unique in the passed array.");const a=n.getTarget(i);zr(a,"Expected targetIds to be registered.")}}function BJ(t,e,n){for(let r=t.length-1;r>=0;r--){const i=t[r],a=e.getTargetType(i);J8(a,n)||t.splice(r,1)}}function VJ(t,e,n){t.forEach(function(r){n.getTarget(r).hover(e,r)})}function UJ(t){return function(){if(t.getMonitor().isDragging())return{type:Q8}}}function qJ(t){return{beginDrag:AJ(t),publishDragSource:UJ(t),hover:PJ(t),drop:IJ(t),endDrag:FJ(t)}}class $J{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const e=this,{dispatch:n}=this.store;function r(a){return(...s)=>{const l=a.apply(e,s);typeof l<"u"&&n(l)}}const i=qJ(this);return Object.keys(i).reduce((a,s)=>{const l=i[s];return a[s]=r(l),a},{})}dispatch(e){this.store.dispatch(e)}constructor(e,n){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=n,e.subscribe(this.handleRefCountChange)}}function jJ(t,e){return{x:t.x+e.x,y:t.y+e.y}}function V_(t,e){return{x:t.x-e.x,y:t.y-e.y}}function zJ(t){const{clientOffset:e,initialClientOffset:n,initialSourceClientOffset:r}=t;return!e||!n||!r?null:V_(jJ(e,r),n)}function HJ(t){const{clientOffset:e,initialClientOffset:n}=t;return!e||!n?null:V_(e,n)}const t2=[],Z8=[];t2.__IS_NONE__=!0,Z8.__IS_ALL__=!0;function YJ(t,e){return t===t2?!1:t===Z8||typeof e>"u"?!0:bJ(e,t).length>0}class KJ{subscribeToStateChange(e,n={}){const{handlerIds:r}=n;zr(typeof e=="function","listener must be a function."),zr(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let i=this.store.getState().stateId;const a=()=>{const s=this.store.getState(),l=s.stateId;try{l===i||l===i+1&&!YJ(s.dirtyHandlerIds,r)||e()}finally{i=l}};return this.store.subscribe(a)}subscribeToOffsetChange(e){zr(typeof e=="function","listener must be a function.");let n=this.store.getState().dragOffset;const r=()=>{const i=this.store.getState().dragOffset;i!==n&&(n=i,e())};return this.store.subscribe(r)}canDragSource(e){if(!e)return!1;const n=this.registry.getSource(e);return zr(n,`Expected to find a valid source. sourceId=${e}`),this.isDragging()?!1:n.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const n=this.registry.getTarget(e);if(zr(n,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(e),i=this.getItemType();return J8(r,i)&&n.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;const n=this.registry.getSource(e,!0);if(zr(n,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(e),i=this.getItemType();return r!==i?!1:n.isDragging(this,e)}isOverTarget(e,n={shallow:!1}){if(!e)return!1;const{shallow:r}=n;if(!this.isDragging())return!1;const i=this.registry.getTargetType(e),a=this.getItemType();if(a&&!J8(i,a))return!1;const s=this.getTargetIds();if(!s.length)return!1;const l=s.indexOf(e);return r?l===s.length-1:l>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return zJ(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return HJ(this.store.getState().dragOffset)}constructor(e,n){this.store=e,this.registry=n}}const U_=typeof global<"u"?global:self,q_=U_.MutationObserver||U_.WebKitMutationObserver;function $_(t){return function(){const n=setTimeout(i,0),r=setInterval(i,50);function i(){clearTimeout(n),clearInterval(r),t()}}}function XJ(t){let e=1;const n=new q_(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}const RJ=typeof q_=="function"?XJ:$_;class GJ{enqueueTask(e){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const n=this.index;if(this.index++,e[n].call(),this.index>this.capacity){for(let r=0,i=e.length-this.index;r<i;r++)e[r]=e[r+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=RJ(this.flush),this.requestErrorThrow=$_(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class WJ{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,n){this.onError=e,this.release=n,this.task=null}}class QJ{create(e){const n=this.freeTasks,r=n.length?n.pop():new WJ(this.onError,i=>n[n.length]=i);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}const j_=new GJ,JJ=new QJ(j_.registerPendingError);function ZJ(t){j_.enqueueTask(JJ.create(t))}const e7="dnd-core/ADD_SOURCE",t7="dnd-core/ADD_TARGET",n7="dnd-core/REMOVE_SOURCE",k3="dnd-core/REMOVE_TARGET";function eZ(t){return{type:e7,payload:{sourceId:t}}}function tZ(t){return{type:t7,payload:{targetId:t}}}function nZ(t){return{type:n7,payload:{sourceId:t}}}function rZ(t){return{type:k3,payload:{targetId:t}}}function iZ(t){zr(typeof t.canDrag=="function","Expected canDrag to be a function."),zr(typeof t.beginDrag=="function","Expected beginDrag to be a function."),zr(typeof t.endDrag=="function","Expected endDrag to be a function.")}function aZ(t){zr(typeof t.canDrop=="function","Expected canDrop to be a function."),zr(typeof t.hover=="function","Expected hover to be a function."),zr(typeof t.drop=="function","Expected beginDrag to be a function.")}function r7(t,e){if(e&&Array.isArray(t)){t.forEach(n=>r7(n,!1));return}zr(typeof t=="string"||typeof t=="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var ic;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(ic||(ic={}));let sZ=0;function oZ(){return sZ++}function lZ(t){const e=oZ().toString();switch(t){case ic.SOURCE:return`S${e}`;case ic.TARGET:return`T${e}`;default:throw new Error(`Unknown Handler Role: ${t}`)}}function z_(t){switch(t[0]){case"S":return ic.SOURCE;case"T":return ic.TARGET;default:throw new Error(`Cannot parse handler ID: ${t}`)}}function H_(t,e){const n=t.entries();let r=!1;do{const{done:i,value:[,a]}=n.next();if(a===e)return!0;r=!!i}while(!r);return!1}class cZ{addSource(e,n){r7(e),iZ(n);const r=this.addHandler(ic.SOURCE,e,n);return this.store.dispatch(eZ(r)),r}addTarget(e,n){r7(e,!0),aZ(n);const r=this.addHandler(ic.TARGET,e,n);return this.store.dispatch(tZ(r)),r}containsHandler(e){return H_(this.dragSources,e)||H_(this.dropTargets,e)}getSource(e,n=!1){return zr(this.isSourceId(e),"Expected a valid source ID."),n&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return zr(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return zr(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return zr(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return z_(e)===ic.SOURCE}isTargetId(e){return z_(e)===ic.TARGET}removeSource(e){zr(this.getSource(e),"Expected an existing source."),this.store.dispatch(nZ(e)),ZJ(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){zr(this.getTarget(e),"Expected an existing target."),this.store.dispatch(rZ(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const n=this.getSource(e);zr(n,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=n}unpinSource(){zr(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,n,r){const i=lZ(e);return this.types.set(i,n),e===ic.SOURCE?this.dragSources.set(i,r):e===ic.TARGET&&this.dropTargets.set(i,r),i}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const uZ=(t,e)=>t===e;function dZ(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function fZ(t,e,n=uZ){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(!n(t[r],e[r]))return!1;return!0}function hZ(t=t2,e){switch(e.type){case N3:break;case e7:case t7:case k3:case n7:return t2;case D3:case Q8:case F3:case O3:default:return Z8}const{targetIds:n=[],prevTargetIds:r=[]}=e.payload,i=vJ(n,r);if(!(i.length>0||!fZ(n,r)))return t2;const s=r[r.length-1],l=n[n.length-1];return s!==l&&(s&&i.push(s),l&&i.push(l)),i}function pZ(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gZ(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){pZ(t,i,n[i])})}return t}const Y_={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function mZ(t=Y_,e){const{payload:n}=e;switch(e.type){case W8:case D3:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case N3:return dZ(t.clientOffset,n.clientOffset)?t:gZ({},t,{clientOffset:n.clientOffset});case F3:case O3:return Y_;default:return t}}function vZ(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Mf(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){vZ(t,i,n[i])})}return t}const bZ={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function yZ(t=bZ,e){const{payload:n}=e;switch(e.type){case D3:return Mf({},t,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case Q8:return Mf({},t,{isSourcePublic:!0});case N3:return Mf({},t,{targetIds:n.targetIds});case k3:return t.targetIds.indexOf(n.targetId)===-1?t:Mf({},t,{targetIds:mJ(t.targetIds,n.targetId)});case O3:return Mf({},t,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case F3:return Mf({},t,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}function AZ(t=0,e){switch(e.type){case e7:case t7:return t+1;case n7:case k3:return t-1;default:return t}}function wZ(t=0){return t+1}function SZ(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xZ(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){SZ(t,i,n[i])})}return t}function CZ(t={},e){return{dirtyHandlerIds:hZ(t.dirtyHandlerIds,{type:e.type,payload:xZ({},e.payload,{prevTargetIds:gJ(t,"dragOperation.targetIds",[])})}),dragOffset:mZ(t.dragOffset,e),refCount:AZ(t.refCount,e),dragOperation:yZ(t.dragOperation,e),stateId:wZ(t.stateId)}}function TZ(t,e=void 0,n={},r=!1){const i=EZ(r),a=new KJ(i,new cZ(i)),s=new $J(i,a),l=t(s,e,n);return s.receiveBackend(l),s}function EZ(t){const e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return M_(CZ,t&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}function IZ(t,e){if(t==null)return{};var n=_Z(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function _Z(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}let K_=0;const P3=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var Lf=P.memo(function(e){var{children:n}=e,r=IZ(e,["children"]);const[i,a]=DZ(r);return P.useEffect(()=>{if(a){const s=X_();return++K_,()=>{--K_===0&&(s[P3]=null)}}},[]),o.jsx(N_.Provider,{value:i,children:n})});function DZ(t){if("manager"in t)return[{dragDropManager:t.manager},!1];const e=NZ(t.backend,t.context,t.options,t.debugMode),n=!t.context;return[e,n]}function NZ(t,e=X_(),n,r){const i=e;return i[P3]||(i[P3]={dragDropManager:TZ(t,e,n,r)}),i[P3]}function X_(){return typeof global<"u"?global:window}var R_=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(a=Object.keys(e),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var s=a[i];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n};const OZ=ao(R_),a1=typeof window<"u"?P.useLayoutEffect:P.useEffect;function FZ(t,e,n){const[r,i]=P.useState(()=>e(t)),a=P.useCallback(()=>{const s=e(t);OZ(r,s)||(i(s),n&&n())},[r,t,n]);return a1(a),[r,a]}function kZ(t,e,n){const[r,i]=FZ(t,e,n);return a1(function(){const s=t.getHandlerId();if(s!=null)return t.subscribeToStateChange(i,{handlerIds:[s]})},[t,i]),r}function G_(t,e,n){return kZ(e,t||(()=>({})),()=>n.reconnect())}function W_(t,e){const n=[];return typeof t!="function"&&n.push(t),P.useMemo(()=>typeof t=="function"?t():t,n)}function PZ(t){return P.useMemo(()=>t.hooks.dragSource(),[t])}function MZ(t){return P.useMemo(()=>t.hooks.dragPreview(),[t])}let i7=!1,a7=!1;class LZ{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){zr(!i7,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return i7=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{i7=!1}}isDragging(){if(!this.sourceId)return!1;zr(!a7,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return a7=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{a7=!1}}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,n){return this.internalMonitor.isOverTarget(e,n)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}let s7=!1;class BZ{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}canDrop(){if(!this.targetId)return!1;zr(!s7,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return s7=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{s7=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}function VZ(t,e,n){const r=n.getRegistry(),i=r.addTarget(t,e);return[i,()=>r.removeTarget(i)]}function UZ(t,e,n){const r=n.getRegistry(),i=r.addSource(t,e);return[i,()=>r.removeSource(i)]}function o7(t,e,n,r){let i;if(i!==void 0)return!!i;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;const a=Object.keys(t),s=Object.keys(e);if(a.length!==s.length)return!1;const l=Object.prototype.hasOwnProperty.bind(e);for(let c=0;c<a.length;c++){const u=a[c];if(!l(u))return!1;const d=t[u],f=e[u];if(i=void 0,i===!1||i===void 0&&d!==f)return!1}return!0}function l7(t){return t!==null&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function qZ(t){if(typeof t.type=="string")return;const e=t.type.displayName||t.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${e} into a <div>, or turn it into a drag source or a drop target itself.`)}function $Z(t){return(e=null,n=null)=>{if(!P.isValidElement(e)){const a=e;return t(a,n),a}const r=e;return qZ(r),jZ(r,n?a=>t(a,n):t)}}function Q_(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n];if(n.endsWith("Ref"))e[n]=t[n];else{const i=$Z(r);e[n]=()=>i}}),e}function J_(t,e){typeof t=="function"?t(e):t.current=e}function jZ(t,e){const n=t.ref;return zr(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?P.cloneElement(t,{ref:r=>{J_(n,r),J_(e,r)}}):P.cloneElement(t,{ref:e})}class zZ{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return n&&this.disconnectDragSource(),this.handlerId?e?(n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),n):(this.lastConnectedDragSource=e,n):n}reconnectDragPreview(e=!1){const n=this.dragPreview,r=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!n){this.lastConnectedDragPreview=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!o7(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!o7(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=Q_({dragSource:(n,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,l7(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,l7(n)?this.dragPreviewRef=n:this.dragPreviewNode=n,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}class HZ{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!o7(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=Q_({dropTarget:(n,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,l7(n)?this.dropTargetRef=n:this.dropTargetNode=n,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}function Bf(){const{dragDropManager:t}=P.useContext(N_);return zr(t!=null,"Expected drag drop context"),t}function YZ(t,e){const n=Bf(),r=P.useMemo(()=>new zZ(n.getBackend()),[n]);return a1(()=>(r.dragSourceOptions=t||null,r.reconnect(),()=>r.disconnectDragSource()),[r,t]),a1(()=>(r.dragPreviewOptions=e||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,e]),r}function KZ(){const t=Bf();return P.useMemo(()=>new LZ(t),[t])}class XZ{beginDrag(){const e=this.spec,n=this.monitor;let r=null;return typeof e.item=="object"?r=e.item:typeof e.item=="function"?r=e.item(n):r={},r??null}canDrag(){const e=this.spec,n=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag=="function"?e.canDrag(n):!0}isDragging(e,n){const r=this.spec,i=this.monitor,{isDragging:a}=r;return a?a(i):n===e.getSourceId()}endDrag(){const e=this.spec,n=this.monitor,r=this.connector,{end:i}=e;i&&i(n.getItem(),n),r.reconnect()}constructor(e,n,r){this.spec=e,this.monitor=n,this.connector=r}}function RZ(t,e,n){const r=P.useMemo(()=>new XZ(t,e,n),[e,n]);return P.useEffect(()=>{r.spec=t},[t]),r}function GZ(t){return P.useMemo(()=>{const e=t.type;return zr(e!=null,"spec.type must be defined"),e},[t])}function WZ(t,e,n){const r=Bf(),i=RZ(t,e,n),a=GZ(t);a1(function(){if(a!=null){const[l,c]=UZ(a,i,r);return e.receiveHandlerId(l),n.receiveHandlerId(l),c}},[r,e,n,i,a])}function ia(t,e){const n=W_(t);zr(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=KZ(),i=YZ(n.options,n.previewOptions);return WZ(n,r,i),[G_(n.collect,r,i),PZ(i),MZ(i)]}function QZ(t){return P.useMemo(()=>t.hooks.dropTarget(),[t])}function JZ(t){const e=Bf(),n=P.useMemo(()=>new HZ(e.getBackend()),[e]);return a1(()=>(n.dropTargetOptions=t||null,n.reconnect(),()=>n.disconnectDropTarget()),[t]),n}function ZZ(){const t=Bf();return P.useMemo(()=>new BZ(t),[t])}function eee(t){const{accept:e}=t;return P.useMemo(()=>(zr(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]),[e])}class tee{canDrop(){const e=this.spec,n=this.monitor;return e.canDrop?e.canDrop(n.getItem(),n):!0}hover(){const e=this.spec,n=this.monitor;e.hover&&e.hover(n.getItem(),n)}drop(){const e=this.spec,n=this.monitor;if(e.drop)return e.drop(n.getItem(),n)}constructor(e,n){this.spec=e,this.monitor=n}}function nee(t,e){const n=P.useMemo(()=>new tee(t,e),[e]);return P.useEffect(()=>{n.spec=t},[t]),n}function ree(t,e,n){const r=Bf(),i=nee(t,e),a=eee(t);a1(function(){const[l,c]=VZ(a,i,r);return e.receiveHandlerId(l),n.receiveHandlerId(l),c},[r,e,i,n,a.map(s=>s.toString()).join("|")])}function iee(t,e){const n=W_(t),r=ZZ(),i=JZ(n.options);return ree(n,r,i),[G_(n.collect,r,i),QZ(i)]}function Z_(t){let e=null;return()=>(e==null&&(e=t()),e)}function aee(t,e){return t.filter(n=>n!==e)}function see(t,e){const n=new Set,r=a=>n.add(a);t.forEach(r),e.forEach(r);const i=[];return n.forEach(a=>i.push(a)),i}class oee{enter(e){const n=this.entered.length,r=i=>this.isNodeInDocument(i)&&(!i.contains||i.contains(e));return this.entered=see(this.entered.filter(r),[e]),n===0&&this.entered.length>0}leave(e){const n=this.entered.length;return this.entered=aee(this.entered.filter(this.isNodeInDocument),e),n>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class lee{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){const n={};Object.keys(this.config.exposeProperties).forEach(r=>{const i=this.config.exposeProperties[r];i!=null&&(n[r]={value:i(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,n)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,n){return n===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}const eD="__NATIVE_FILE__",tD="__NATIVE_URL__",nD="__NATIVE_TEXT__",rD="__NATIVE_HTML__",iD=Object.freeze(Object.defineProperty({__proto__:null,FILE:eD,HTML:rD,TEXT:nD,URL:tD},Symbol.toStringTag,{value:"Module"}));function c7(t,e,n){const r=e.reduce((i,a)=>i||t.getData(a),"");return r??n}const u7={[eD]:{exposeProperties:{files:t=>Array.prototype.slice.call(t.files),items:t=>t.items,dataTransfer:t=>t},matchesTypes:["Files"]},[rD]:{exposeProperties:{html:(t,e)=>c7(t,e,""),dataTransfer:t=>t},matchesTypes:["Html","text/html"]},[tD]:{exposeProperties:{urls:(t,e)=>c7(t,e,"").split(`
1601
- `),dataTransfer:t=>t},matchesTypes:["Url","text/uri-list"]},[nD]:{exposeProperties:{text:(t,e)=>c7(t,e,""),dataTransfer:t=>t},matchesTypes:["Text","text/plain"]}};function cee(t,e){const n=u7[t];if(!n)throw new Error(`native type ${t} has no configuration`);const r=new lee(n);return r.loadDataTransfer(e),r}function d7(t){if(!t)return null;const e=Array.prototype.slice.call(t.types||[]);return Object.keys(u7).filter(n=>{const r=u7[n];return r!=null&&r.matchesTypes?r.matchesTypes.some(i=>e.indexOf(i)>-1):!1})[0]||null}const uee=Z_(()=>/firefox/i.test(navigator.userAgent)),aD=Z_(()=>!!window.safari);class sD{interpolate(e){const{xs:n,ys:r,c1s:i,c2s:a,c3s:s}=this;let l=n.length-1;if(e===n[l])return r[l];let c=0,u=s.length-1,d;for(;c<=u;){d=Math.floor(.5*(c+u));const g=n[d];if(g<e)c=d+1;else if(g>e)u=d-1;else return r[d]}l=Math.max(0,u);const f=e-n[l],h=f*f;return r[l]+i[l]*f+a[l]*h+s[l]*f*h}constructor(e,n){const{length:r}=e,i=[];for(let g=0;g<r;g++)i.push(g);i.sort((g,v)=>e[g]<e[v]?-1:1);const a=[],s=[];let l,c;for(let g=0;g<r-1;g++)l=e[g+1]-e[g],c=n[g+1]-n[g],a.push(l),s.push(c/l);const u=[s[0]];for(let g=0;g<a.length-1;g++){const v=s[g],m=s[g+1];if(v*m<=0)u.push(0);else{l=a[g];const A=a[g+1],S=l+A;u.push(3*S/((S+A)/v+(S+l)/m))}}u.push(s[s.length-1]);const d=[],f=[];let h;for(let g=0;g<u.length-1;g++){h=s[g];const v=u[g],m=1/a[g],A=v+u[g+1]-h-h;d.push((h-v-A)*m),f.push(A*m*m)}this.xs=e,this.ys=n,this.c1s=u,this.c2s=d,this.c3s=f}}const dee=1;function oD(t){const e=t.nodeType===dee?t:t.parentElement;if(!e)return null;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function M3(t){return{x:t.clientX,y:t.clientY}}function fee(t){var e;return t.nodeName==="IMG"&&(uee()||!(!((e=document.documentElement)===null||e===void 0)&&e.contains(t)))}function hee(t,e,n,r){let i=t?e.width:n,a=t?e.height:r;return aD()&&t&&(a/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:a}}function pee(t,e,n,r,i){const a=fee(e),l=oD(a?t:e),c={x:n.x-l.x,y:n.y-l.y},{offsetWidth:u,offsetHeight:d}=t,{anchorX:f,anchorY:h}=r,{dragPreviewWidth:g,dragPreviewHeight:v}=hee(a,e,u,d),m=()=>{let I=new sD([0,.5,1],[c.y,c.y/d*v,c.y+v-d]).interpolate(h);return aD()&&a&&(I+=(window.devicePixelRatio-1)*v),I},A=()=>new sD([0,.5,1],[c.x,c.x/u*g,c.x+g-u]).interpolate(f),{offsetX:S,offsetY:T}=i,w=S===0||S,E=T===0||T;return{x:w?S:A(),y:E?T:m()}}class gee{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var e;return!((e=this.globalContext)===null||e===void 0)&&e.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}constructor(e,n){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=n}}function mee(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lD(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){mee(t,i,n[i])})}return t}class vee{profile(){var e,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){const e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,n,r){this.sourceNodes.set(e,n),this.sourceNodeOptions.set(e,r);const i=s=>this.handleDragStart(s,e),a=s=>this.handleSelectStart(s);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",i),n.addEventListener("selectstart",a),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",i),n.removeEventListener("selectstart",a),n.setAttribute("draggable","false")}}connectDropTarget(e,n){const r=s=>this.handleDragEnter(s,e),i=s=>this.handleDragOver(s,e),a=s=>this.handleDrop(s,e);return n.addEventListener("dragenter",r),n.addEventListener("dragover",i),n.addEventListener("drop",a),()=>{n.removeEventListener("dragenter",r),n.removeEventListener("dragover",i),n.removeEventListener("drop",a)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(e);return lD({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(e);return lD({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(iD).some(n=>iD[n]===e)}beginDragNativeItem(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=cee(e,n),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;const n=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},n)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,n){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}handleDragEnter(e,n){this.dragEnterTargetIds.unshift(n)}handleDragOver(e,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}handleDrop(e,n){this.dropTargetIds.unshift(n)}constructor(e,n,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=i=>{const a=this.sourceNodes.get(i);return a&&oD(a)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=i=>!!(i&&this.document&&this.document.body&&this.document.body.contains(i)),this.endDragIfSourceWasRemovedFromDOM=()=>{const i=this.currentDragSourceNode;i==null||this.isNodeInDocument(i)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=i=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(i||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=i=>{if(i.defaultPrevented)return;const{dragStartSourceIds:a}=this;this.dragStartSourceIds=null;const s=M3(i);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:s});const{dataTransfer:l}=i,c=d7(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const d=this.monitor.getSourceId(),f=this.sourceNodes.get(d),h=this.sourcePreviewNodes.get(d)||f;if(h){const{anchorX:g,anchorY:v,offsetX:m,offsetY:A}=this.getCurrentSourcePreviewNodeOptions(),w=pee(f,h,s,{anchorX:g,anchorY:v},{offsetX:m,offsetY:A});l.setDragImage(h,w.x,w.y)}}try{l==null||l.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(i.target);const{captureDraggingState:u}=this.getCurrentSourcePreviewNodeOptions();u?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(c)this.beginDragNativeItem(c);else{if(l&&!l.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=i=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var a;(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}if(!this.enterLeaveCounter.enter(i.target)||this.monitor.isDragging())return;const{dataTransfer:l}=i,c=d7(l);c&&this.beginDragNativeItem(c,l)},this.handleTopDragEnter=i=>{const{dragEnterTargetIds:a}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=i.altKey,a.length>0&&this.actions.hover(a,{clientOffset:M3(i)}),a.some(l=>this.monitor.canDropOnTarget(l))&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=i=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var a;(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}},this.handleTopDragOver=i=>{const{dragOverTargetIds:a}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}this.altKeyPressed=i.altKey,this.lastClientOffset=M3(i),this.scheduleHover(a),(a||[]).some(l=>this.monitor.canDropOnTarget(l))?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=i=>{this.isDraggingNativeItem()&&i.preventDefault(),this.enterLeaveCounter.leave(i.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=i=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var a;i.preventDefault(),(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}else d7(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:a}=this;this.dropTargetIds=[],this.actions.hover(a,{clientOffset:M3(i)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=i=>{const a=i.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(i.preventDefault(),a.dragDrop()))},this.options=new gee(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new oee(this.isNodeInDocument)}}const Vf=function(e,n,r){return new vee(e,n,r)},cD=P.createContext(void 0),uD=({children:t,option:e,saveFormBuilderSchema:n,templateSchema:r,onChange:i})=>{const a={...R8,...r},[s,l]=P.useReducer(aJ,a);P.useEffect(()=>{n&&n(s)},[s]);const{isPreview:c,isAdmin:u,isRenderView:d,renderType:f,isAdvanceView:h,globalAlignment:g="ltr",emitSocketData:v,media:m,reusableComponent:A,saveFormProgress:S,showSettings:T}=e;return o.jsx(cD.Provider,{value:{media:m,isPreview:c,isAdmin:u,isRenderView:d,renderType:f,isAdvanceView:h,globalAlignment:g,emitSocketData:v,reusableComponent:A,state:s,dispatch:l,onChange:i,saveFormProgress:S,showSettings:T},children:o.jsx(Lf,{backend:Vf,children:t})})},dD=()=>P.useContext(cD),bee=(t,e,n)=>{const r=Array.from(t),[i]=r.splice(e,1);return r.splice(n,0,i),r},yee=(t,e)=>[...t.slice(0,e),...t.slice(e+1)],Aee=(t,e,n)=>[...t.slice(0,e),n,...t.slice(e)],fD=(t,e,n)=>{if(e.length===1){const c=Number(e[0]),u=Number(n[0]);return bee(t,u,c)}const r=[...t],i=Number(e.slice(0,1)),a=e.slice(1),s=n.slice(1),l=r[i];return r[i]={...l,children:fD(l.children,a,s)},r},hD=(t,e)=>{if(e.length===1){const s=Number(e[0]);return yee(t,s)}const n=[...t],r=Number(e.slice(0,1)),i=e.slice(1),a=n[r];return n[r]={...a,children:hD(a.children,i)},n},f7=(t,e,n)=>{if(e.length===1){const l=Number(e[0]);return Aee(t,l,n)}const r=[...t],i=Number(e.slice(0,1)),a=e.slice(1),s=r[i];return r[i]={...s,children:f7(s.children,a,n)},r},wee=(t,e,n)=>{let r=[...t],i=r[n[ma]].children[n[va]].children[n[xa]].children[n[Ca]].children[n[Ta]].inlineConditionalRules.rules[n[Na]].conditions[n[Zo]].children[n[Fo]];return r[n[ma]].children[n[va]].children[n[xa]].children[n[Ca]].children[n[Ta]].inlineConditionalRules.rules[n[Na]].conditions[n[Zo]].children.splice([n[Fo]],1),r[e[ma]].children[e[va]].children[e[xa]].children[e[Ca]].children[e[Ta]].inlineConditionalRules.rules[e[Na]].conditions[e[Zo]].children.splice(e[Fo],0,i),r},See=(t,e,n)=>fD(t,e,n),xee=t=>{const e=[...t],n={type:ws,uuid:et(),children:[]};return e.map(r=>(r.children.length||(r.children=[n]),r))},pD=(t,e,n,r)=>{var h,g,v,m,A,S;let i;const a={...Bc,uuid:et(),children:[r]},s={...mu,uuid:et()},l={...mu,uuid:et(),children:[a]},c={...kf,uuid:et(),children:[l]},u={..._3,uuid:et(),children:[c]};switch(e.length){case 1:{r.type===dT?i={...c,children:[r]}:i={...c,children:[s]};break}case 2:{r.type===na?i={...u,children:[c]}:i={...u,children:[c]};break}case 3:{r.type===Oo?i={...c,children:[l]}:i={...mu,uuid:et(),children:[{...Bc,uuid:et(),children:[r]}]};break}case 4:{r.type===pf?i=a:i=r;break}case 5:{i=r;break}default:i=r}let d=t;return n.length>5?(S=(A=(m=(v=(g=(h=d[n[ma]])==null?void 0:h.children[n[va]])==null?void 0:g.children[n[xa]])==null?void 0:v.children[n[Ca]])==null?void 0:m.children[n[Ta]])==null?void 0:A.inlineConditionalRules)==null||S.rules[n[Na]].conditions[n[Zo]].children.splice(n[Fo],1):d=hD(d,n),d=xee(d),d=f7(d,e,i),d},Cee=(t,e,n)=>{let r;switch(e.length){case 1:{r={..._3,uuid:et(),children:[{...kf,uuid:et(),children:[{...mu,uuid:et(),children:[{...Bc,uuid:et(),children:[n]}]}]}]};break}case 2:{r={...kf,uuid:et(),children:[{...mu,uuid:et(),children:[{...Bc,uuid:et(),children:[n]}]}]};break}case 3:{r={...mu,uuid:et(),children:[{...Bc,uuid:et(),children:[n]}]};break}case 4:{r={...Bc,uuid:et(),children:[n]};break}default:r=n}return f7(t,e,r)},un=()=>{const{state:t,dispatch:e,onChange:n,saveFormProgress:r}=dD(),{updateGlobalToast:i,emitSocketData:a}=tn();if(t===void 0)throw new Error("Must be wrapped in builder provider");const s=t.builderTemplateName,l=t.isChangesSaved,c=t.editing_by,u=t.version_name,d=t.loading,f=t.published_status,h=t,g=t,v=t.formType,m=t==null?void 0:t.userSelectedLanguage,A=t==null?void 0:t.languages,S=t.layout,T=P.useCallback(me=>WQ(me)(e),[e]),w=P.useCallback(me=>SQ(me)(e),[e]),E=P.useCallback(me=>QQ(me)(e),[e]),x=P.useCallback((me,we)=>{var yt,qt,hn,on,_n,vn,In,Gt;const De=me.path.split("-"),q=De.slice(0,-1).join("-"),se={uuid:we.uuid,type:we.type,reviewerChecklist:[]},pe=0,ue=1,oe=2,ae=3,Oe=4,Ne=5,Ke=6,ut=8,pt=7,ht=5,kt=6,wn=8;if(we.type===na&&(we==null?void 0:we.schema)!==void 0){$(JSON.parse(we==null?void 0:we.schema),parseInt(De[pe]));return}if(((yt=we==null?void 0:we.schema)==null?void 0:yt.componentType)==="question"&&((vn=(_n=(on=(hn=(qt=S[0])==null?void 0:qt.children[0])==null?void 0:hn.children[0])==null?void 0:on.children[0])==null?void 0:_n.children)!=null&&vn.some(Re=>{var nt,dt,jt;return((nt=Re==null?void 0:Re.questionText)==null?void 0:nt[m.type])===((jt=(dt=we==null?void 0:we.schema)==null?void 0:dt.questionText)==null?void 0:jt[m.type])}))){i({showToast:!0,toastMessage:"Exist",toastDetail:"Question text cannot be same for more than one element",toastType:"warn"});return}if(we.type===Gn){let Re={type:pf,reviewerChecklist:[],..._t.cloneDeep(we.schema)};if(Re!=null&&Re.options&&(Re={...Re,options:[{uuid:et(),optionText:{english:"Option 1"},value:"Option1",hyperlinkText:{english:""},abbreviationText:{english:"Option 1"},custom_values:{}},{uuid:et(),optionText:{english:"Option 2"},value:"Option2",hyperlinkText:{english:""},abbreviationText:{english:"Option 1"},custom_values:{}}]}),Re.componentType==="grid-component"&&(Re={...Re,children:[],options:[{uuid:et(),custom_values:{}}]}),Re.componentType==="radio-hierarchal"&&(Re={...Re,type:"radio",children:[],options:[{uuid:et(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:et(),label:"No",value:null,enableConditionalField:!0,children:[]}]}),Re={...Re,uuid:et()},De.length===ut){W(parseInt(De[pe]),parseInt(De[ue]),parseInt(De[oe]),parseInt(De[ae]),parseInt(De[Oe]),parseInt(De[Ne]),parseInt(De[Ke]),Re),a();return}if(De.length===pt){de(parseInt(De[pe]),parseInt(De[ue]),parseInt(De[oe]),parseInt(De[ae]),parseInt(De[Oe]),parseInt(De[ht]),parseInt(De[kt]),Re),a();return}if((Gt=(In=S[De[pe]].children[De[ue]])==null?void 0:In.children[De[oe]])!=null&&Gt.rowIsRepeatable&&(Re==null?void 0:Re.componentType)==="editor"){i({showToast:!0,toastMessage:"Forbidden",toastDetail:"This Field cannot be applied in repeatable",toastType:"error"});return}E(Cee(S,De,Re)),a(),De.length>1&&ye(De[pe],De[ue],De[oe],Re);return}const Vt=we.path.split("-"),Nt=Vt.slice(0,-1).join("-");if(Vt.length===De.length){if(Nt===q){if((Vt==null?void 0:Vt.length)===wn){E(wee(S,De,Vt));return}E(See(S,De,Vt));return}const Re={...se,...we};(we==null?void 0:we.id)===void 0&&(Re.id=et()),E(pD(S,De,Vt,Re));return}if((Vt==null?void 0:Vt.length)===8){const Re={type:pf,reviewerChecklist:[],...we};de(parseInt(De[pe]),parseInt(De[ue]),parseInt(De[oe]),parseInt(De[ae]),parseInt(De[Oe]),parseInt(De[ht]),parseInt(De[kt]),Re),U(Vt[ma],Vt[va],Vt[xa],Vt[Ca],Vt[Ta],Vt[ht],Vt[kt],Vt[tc]);return}const $e={...se,...we};(we==null?void 0:we.id)===void 0&&($e.id=et()),E(pD(S,De,Vt,$e))},[S,m.type]),I=P.useCallback(()=>iJ()(e),[e]),_=P.useCallback(me=>JQ(me)(e,t),[e]),O=P.useCallback(me=>ZQ(me)(e,t),[e]),B=P.useCallback(me=>eJ(me)(e),[e]),M=P.useCallback(me=>wQ(me)(e),[e]),V=P.useCallback(me=>IQ(me)(e),[e]),$=P.useCallback((me,we)=>NQ(me,we)(e),[e]),k=P.useCallback((me,we)=>MQ(me,we)(e),[e]),z=P.useCallback((me,we,De)=>VQ(me,we,De)(e),[e]),le=P.useCallback(me=>TQ(me)(e),[e]),fe=P.useCallback((me,we)=>EQ(me,we)(e),[e]),Z=P.useCallback((me,we,De)=>PQ(me,we,De)(e),[e]),G=P.useCallback((me,we,De,q)=>qQ(me,we,De,q)(e),[e]),ce=P.useCallback((me,we,De,q,se)=>$Q(me,we,De,q,se)(e,t),[e]),K=P.useCallback((me,we,De,q,se,pe)=>jQ(me,we,De,q,se,pe)(e,t),[e]),ge=P.useCallback((me,we,De)=>_Q(me,we,De)(e),[e]),te=P.useCallback((me,we,De,q)=>kQ(me,we,De,q)(e),[e]),ee=P.useCallback((me,we)=>CQ(me,we)(e),[e]),Y=P.useCallback((me,we,De,q,se,pe)=>zQ(me,we,De,q,se,pe)(e),[e]),J=P.useCallback((me,we,De,q,se)=>UQ(me,we,De,q,se)(e),[e]),he=P.useCallback((me,we,De,q)=>FQ(me,we,De,q)(e),[e]),be=P.useCallback((me,we,De)=>DQ(me,we,De)(e),[e]),Ee=P.useCallback((me,we)=>xQ(me,we)(e,t),[e]),ye=P.useCallback((me,we,De,q)=>LQ(me,we,De,q)(e),[e]),Ae=P.useCallback((me,we,De,q,se,pe,ue,oe,ae)=>RQ(me,we,De,q,se,pe,ue,oe,ae)(e),[e]),ne=P.useCallback((me,we,De,q,se,pe,ue,oe,ae)=>KQ(me,we,De,q,se,pe,ue,oe,ae)(e),[e]),U=P.useCallback((me,we,De,q,se,pe,ue,oe)=>XQ(me,we,De,q,se,pe,ue,oe)(e),[e]),re=P.useCallback((me,we,De,q,se,pe,ue,oe)=>GQ(me,we,De,q,se,pe,ue,oe)(e),[e]),W=P.useCallback((me,we,De,q,se,pe,ue,oe)=>HQ(me,we,De,q,se,pe,ue,oe)(e),[e]),de=P.useCallback((me,we,De,q,se,pe,ue,oe)=>YQ(me,we,De,q,se,pe,ue,oe)(e),[e]),Ce=P.useCallback(me=>tJ(me)(e),[e]),_e=P.useCallback(me=>nJ(me)(e),[e]),ve=P.useCallback(me=>rJ(me)(e),[e]);return{builderIsChangesSaved:l,builderTemplateName:s,formBuilderFormSchema:h,formBuilderFormLayout:S,formBuilderSchemaLanguages:A,saveFormTemplateNewVersion:g,userSelectedLanguage:m,formBuilderConfigurationType:v,formBuilderLoading:d,formBuilderPublishedStatus:f,builderEditingBy:c,builderVersionName:u,handleDrop:x,formatTableFieldsHook:w,saveFormBuilderSchema:T,removePage:le,removeSection:fe,removeRow:Z,removeColumn:G,removeField:ce,updateEditingBy:ve,addTabs:M,addSection:V,addRow:k,addColumn:z,cloneField:Y,cloneColumn:J,cloneRow:he,cloneSection:be,clonePage:Ee,sectionImport:$,setLayout:E,fieldSettingUpdate:K,selectFormBuilderLanguage:_,unselectFormBuilderLanguage:O,updateUserFormSelectedLanguage:B,updateFormType:Ce,schemaBuilderUpdate:_e,pageSettingUpdate:ee,saveFormProgress:r,sectionSettingUpdate:ge,rowSettingUpdate:te,clearBuilderSchema:I,addFieldToRowRepeaptable:ye,addFieldToInlineRuleCondtionFields:W,fieldSettingUpdateInlineConditional:Ae,fieldSettingDeleteInlineConditional:re,addFieldToGridComponentHook:de,gridComponentFieldSettingUpdate:ne,gridComponentFieldDelete:U}},tn=()=>{const{isPreview:t,isAdmin:e,isRenderView:n,renderType:r,isAdvanceView:i,media:a,globalAlignment:s,reusableComponent:l,showSettings:c}=dD();if(t===void 0)throw new Error("Must be wrapped in builder provider");const u=r==null?void 0:r.key,{saveComponent:d,componentList:f,sectionsList:h}=l;return{isPreview:t,isAdmin:e,isRenderView:n,renderType:u,isAdvanceView:i,globalAlignment:s,media:a,saveComponent:d,componentList:f,sectionsList:h,emitSocketData:()=>{},updateGlobalToast:m=>{console.log("showSettings",c),c!=null&&c.showToast&&(c==null||c.showToast(m))}}},Tee="TASKS_LOADING",Eee="TASKS_ADD",Iee="TASKS_GET_PAGINATED_LIST",_ee="TASKS_DELETE",Dee="TASKS_PAGNIATION_UPDATE",Nee="TASKS_UPDATE",Oee="TASKS_SUCCESS_GET",Fee="TASK_GET_TEMPLATE",kee="TASK_SET_DATA",Pee="TASKS_FORM_SUBMIT",Mee="TASKS_FORM_HTTP_REQUEST",h7="TASK_SET_PROGRESS_VALUE",gD="TASK_SET_MAX_PROGRESS_VALUE",mD="TASK_SET_REGISTER_DATA",vD="TASK_SET_SCHEMA",p7="TASK_UPDATE_USER_FORM_SUBMIT_DATA",bD="CLEAR_TASK",yD="TASK_USER_SUBMIT_FORM_REPEATABLE_ADD",AD="TASK_USER_SUBMIT_FORM_REPEATABLE_REMOVE_INDEX",wD="TASK_USER_TRAINING_DATA",SD="TASK_FIELD_UPDATE",Lee=6,L3=1,n2="DISPLAY_TYPE_START_DETAILS",B3="DISPLAY_TYPE_QUIZ",g7="DISPLAY_TYPE_START_TIMER";function Bee(t,e,n,r,i,a){return s=>{s({type:SD,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,field:a}})}}function xD(t){return(e,n)=>{const r={type:p7,payLoad:{userTaskSubmitFormData:[...t]}};e(r)}}function Vee(t){return(e,n)=>{const{TasksReducer:r}=n(),{taskData:i}=r,a={type:p7,payLoad:{taskData:{...i,...t}}};e(a)}}function Uee(t,e){return(n,r)=>{const{TasksReducer:i}=r(),{userTaskSubmitFormData:a}=i,s=_t.findIndex(a,function(c){return c.rowId===t});n({type:AD,payLoad:{userSubmitFormIndex:s,repeatableDataRowIndex:e}})}}function qee(t,e){return(n,r)=>{const{TasksReducer:i}=r(),{userTaskSubmitFormData:a}=i,s=_t.findIndex(a,function(c){return c.rowId===t});n({type:yD,payLoad:{userSubmitFormIndex:s,repeatableData:e}})}}function $ee(){return t=>{t({type:bD,payLoad:null})}}const CD=t=>e=>{console.log("updateProgresValue",t),e({type:h7,payLoad:{progressValue:t}})},jee=t=>e=>{e({type:h7,payLoad:t})},zee=t=>e=>{e({type:wD,payLoad:{userTrainingSaveData:t}})},TD=t=>e=>{e({type:mD,payLoad:{registerData:t}})},Hee=(t,e,n)=>(r,i)=>{var d;const{TasksReducer:a}=i(),{userTaskSubmitFormData:s}=a,l=[...s],c=_t.findIndex(l,function(f){var h;return f.rowId===((h=t==null?void 0:t.row)==null?void 0:h.uuid)});let u=(d=s[c])==null?void 0:d.repeatableFields;u={...u,[e==null?void 0:e.uuid]:`<div>${n}</div>`},l[c]={...l[c],repeatableFields:u},r(xD(l))},Yee=(t,e,n)=>(r,i)=>{const{TasksReducer:a}=i(),{userTaskSubmitFormData:s,registerData:l}=a,c=s,u=_t.cloneDeep(l);if(n&&(c==null?void 0:c.length)>0){u[e==null?void 0:e.uuid]=n;for(const f of c)f.fieldId===e.uuid&&(f.postData[0]={postValue:n})}else if((c==null?void 0:c.length)>0){for(const f of c)f.fieldId===e.uuid&&(f.postData[0]={postValue:""});delete u[e==null?void 0:e.uuid]}r(TD(u));const d=Object.keys(u).length;r(CD(d))},Kee=t=>e=>{e({type:gD,payLoad:{progressMaxValue:t}})},m7={submitting:!1,httpRequest:!1,taskData:null,taskUpdateLoading:!1,loading:!1,progressLoading:!1,list:[],filter:"",sort:"task.created_at|desc",total_records:0,page:1,per_page:10,success:!1,success_message:"",userTaskSubmitFormData:null,taskSchema:null,progressMaxValue:0,maxTabs:0,registerData:{},progressValue:0,tabNoOfFieldsData:[],noOfTotalElements:0,sortField:null,sortOrder:null,userTrainingSaveData:null,assessmentData:null,task_status:1},Xee=(t=m7,e)=>{switch(e.type){case bD:return{...t,...m7,list:[...t.list],page:t.page,per_page:t.per_page,filter:t.filter,sort:t.sort,total_records:t.total_records};case Oee:return{...t,...e.payLoad};case p7:return{...t,...e.payLoad};case vD:return{...t,...e.payLoad};case h7:return console.log("action.payLoad",e.payLoad),{...t,...e.payLoad};case mD:return{...t,registerData:e.payLoad.registerData};case gD:return{...t,...e.payLoad};case Tee:return{...t,...e.payLoad};case Pee:return{...t,...e.payLoad};case Mee:return{...t,...e.payLoad};case Eee:{const{record:n}=e.payLoad;return{...t,list:[...n,...t.list]}}case Iee:return{...t,...e.payLoad};case kee:return{...t,taskData:e.payLoad};case Dee:return{...t,...e.payLoad};case _ee:{const n=t.list.filter(r=>r.task_id!==e.payLoad.task_id);return{...t,list:[...n]}}case wD:return{...t,...e.payLoad};case SD:{const{pageIndex:n,sectionIndex:r,rowIndex:i,columnIndex:a,fieldIndex:s,field:l}=e.payLoad,c=[...t.taskSchema.layout];c[n].children[r].children[i].children[a].children[s]=l;const u={...t.taskSchema,layout:c};return{...t,taskSchema:u}}case yD:{const{userSubmitFormIndex:n,repeatableData:r}=e.payLoad,i=t.userTaskSubmitFormData[n].repeatableFieldsData?t.userTaskSubmitFormData[n].repeatableFieldsData:[];return i.push(r),t.userTaskSubmitFormData[n].repeatableFieldsData=i,t}case AD:{const{userSubmitFormIndex:n,repeatableDataRowIndex:r}=e.payLoad,i=[...t.userTaskSubmitFormData],a=[...i[n].repeatableFieldsData];return a.splice(r,1),i[n]={...i[n],repeatableFieldsData:a},{...t,userTaskSubmitFormData:i}}case Nee:{const{row:n,eventIndex:r}=e.payLoad,i=t.list[r];return t.list[r]={...i,...n},t}case Fee:return{...t,...e.payLoad}}return t},ED=P.createContext(void 0),Ree=({option:t,taskOptions:e,saveFormBuilderSchema:n,templateSchema:r,taskValue:i,children:a})=>{const[s,l]=P.useReducer(Xee,{...m7,...i}),{progressMaxValue:c,progressValue:u,registerData:d,...f}=i;return P.useEffect(()=>{l({type:vD,payLoad:f})},[i]),o.jsx(ED.Provider,{value:{taskOptions:e,state:s,dispatch:l},children:o.jsx(uD,{option:t,saveFormBuilderSchema:n,templateSchema:r,onChange:()=>{},children:a})})},Gee=()=>P.useContext(ED),yr=()=>{var Ae,ne,U,re,W,de,Ce,_e;const{taskOptions:n,state:r,dispatch:i}=Gee();if(r===void 0)throw new Error("Must be wrapped in task render provider");console.log("state.progressValue",r.progressValue),console.log("state.taskProgressMaxValue",r.progressMaxValue);const a=r.task_status,s=r.task_status,l=r.userTaskSubmitFormData,c=r.userTrainingSaveData,u=r.taskSchema,d=r.assessmentData,f=r.progressLoading,h=r.submitting,g=r.httpRequest,v=r.taskData,m=r.progressMaxValue,A=r.maxTabs,S=r.tabNoOfFieldsData,T=r.registerData,w=r.progressValue,E=r.noOfTotalElements,x=r.menuList,I=r.loading,_=r.submitting,O=r.success,B=r.success_message,M=(Ae=n==null?void 0:n.exam)!=null&&Ae.startQuiz?(ne=n==null?void 0:n.exam)==null?void 0:ne.startQuiz:()=>{},V=(U=n==null?void 0:n.exam)!=null&&U.AddUserAssessmentAnswer?(re=n==null?void 0:n.exam)==null?void 0:re.AddUserAssessmentAnswer:()=>{},$=(W=n==null?void 0:n.exam)!=null&&W.endQuiz?(de=n==null?void 0:n.exam)==null?void 0:de.endQuiz:()=>{},k=(Ce=n==null?void 0:n.exam)!=null&&Ce.examComplete?(_e=n==null?void 0:n.exam)==null?void 0:_e.examComplete:ve=>{},z=n!=null&&n.updateTaskFormData?n==null?void 0:n.updateTaskFormData:(ve,me,we,De,q,se)=>{},le=n!=null&&n.submitTaskFormData?n==null?void 0:n.submitTaskFormData:(ve,me,we)=>{},fe=P.useCallback(ve=>i(Vee(ve)),[i]),Z=P.useCallback((ve,me,we)=>{},[i]),G=P.useCallback(()=>i($ee()),[i]),ce=P.useCallback((ve,me)=>i(qee(ve,me)),[i]),K=P.useCallback((ve,me)=>i(Uee(ve,me)),[i]),ge=P.useCallback(ve=>i(CD(ve)),[i]),te=P.useCallback(ve=>i(jee(ve)),[i]),ee=P.useCallback(ve=>i(TD(ve)),[i]),Y=P.useCallback(ve=>i(xD(ve)),[i]),J=P.useCallback(ve=>i(Kee(ve)),[i]),he=P.useCallback(ve=>i(zee(ve)),[i]),be=P.useCallback((ve,me,we)=>i(Hee(ve,me,we)),[i]),Ee=P.useCallback((ve,me,we)=>i(Yee(ve,me,we)),[i]),ye=P.useCallback((ve,me,we,De,q,se)=>i(Bee(ve,me,we,De,q,se)),[i]);return{examComplete:k,taskOptions:n,TASK_PUBLISHED:6,TASK_PENDING:1,taskStatus:s,assessmentData:d,taskSchema:u,taskData:v,TasksList:x,TasksLoading:I,TasksSuccess:O,TasksSuccessMessage:B,taskProgressMaxValue:m,taskRegisterData:T,taskProgressValue:w,taskMaxTabs:A,noOfTotalElements:E,taskTabRequiredFieldsData:S,userTaskSubmitFormData:l,userTrainingSaveData:c,TasksSubmitLoading:_,updateTaskDataSchema:fe,submitTaskFormData:le,updateTaskFormData:z,TasksSubmit:h,TasksHTTPRequest:g,updateTaskRegisterData:ee,updateTaskProgressValue:ge,updateTaskProgressMaxValue:J,updateUserFormDataSubmit:Y,removeUserDataFormSectionRepeatableData:K,addUserDataFormSectionRepeatableData:ce,onSetValuetoRepeatableData:be,onSetValuetoPostDataHook:Ee,clearTaskSchema:G,taskProgressLoading:f,task_status:a,startQuiz:M,endQuiz:$,AddUserAssessmentAnswer:V,updateUserTraining:he,taskFieldUpdateHook:ye,updateProgressDataValuesHook:te,saveProgressDataHook:Z}};function v7(){return v7=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},v7.apply(null,arguments)}var ID=b.memo(b.forwardRef(function(t,e){var n=ri.getPTI(t);return b.createElement("svg",v7({ref:e,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),b.createElement("path",{d:"M13.4018 13.1893H0.598161C0.49329 13.189 0.390283 13.1615 0.299143 13.1097C0.208003 13.0578 0.131826 12.9832 0.0780112 12.8932C0.0268539 12.8015 0 12.6982 0 12.5931C0 12.4881 0.0268539 12.3848 0.0780112 12.293L6.47985 1.08982C6.53679 1.00399 6.61408 0.933574 6.70484 0.884867C6.7956 0.836159 6.897 0.810669 7 0.810669C7.103 0.810669 7.2044 0.836159 7.29516 0.884867C7.38592 0.933574 7.46321 1.00399 7.52015 1.08982L13.922 12.293C13.9731 12.3848 14 12.4881 14 12.5931C14 12.6982 13.9731 12.8015 13.922 12.8932C13.8682 12.9832 13.792 13.0578 13.7009 13.1097C13.6097 13.1615 13.5067 13.189 13.4018 13.1893ZM1.63046 11.989H12.3695L7 2.59425L1.63046 11.989Z",fill:"currentColor"}),b.createElement("path",{d:"M6.99996 8.78801C6.84143 8.78594 6.68997 8.72204 6.57787 8.60993C6.46576 8.49782 6.40186 8.34637 6.39979 8.18784V5.38703C6.39979 5.22786 6.46302 5.0752 6.57557 4.96265C6.68813 4.85009 6.84078 4.78686 6.99996 4.78686C7.15914 4.78686 7.31179 4.85009 7.42435 4.96265C7.5369 5.0752 7.60013 5.22786 7.60013 5.38703V8.18784C7.59806 8.34637 7.53416 8.49782 7.42205 8.60993C7.30995 8.72204 7.15849 8.78594 6.99996 8.78801Z",fill:"currentColor"}),b.createElement("path",{d:"M6.99996 11.1887C6.84143 11.1866 6.68997 11.1227 6.57787 11.0106C6.46576 10.8985 6.40186 10.7471 6.39979 10.5885V10.1884C6.39979 10.0292 6.46302 9.87658 6.57557 9.76403C6.68813 9.65147 6.84078 9.58824 6.99996 9.58824C7.15914 9.58824 7.31179 9.65147 7.42435 9.76403C7.5369 9.87658 7.60013 10.0292 7.60013 10.1884V10.5885C7.59806 10.7471 7.53416 10.8985 7.42205 11.0106C7.30995 11.1227 7.15849 11.1866 6.99996 11.1887Z",fill:"currentColor"}))}));ID.displayName="ExclamationTriangleIcon";function b7(){return b7=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},b7.apply(null,arguments)}var _D=b.memo(b.forwardRef(function(t,e){var n=ri.getPTI(t);return b.createElement("svg",b7({ref:e,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.11101 12.8203C4.26215 13.5895 5.61553 14 7 14C8.85652 14 10.637 13.2625 11.9497 11.9497C13.2625 10.637 14 8.85652 14 7C14 5.61553 13.5895 4.26215 12.8203 3.11101C12.0511 1.95987 10.9579 1.06266 9.67879 0.532846C8.3997 0.00303296 6.99224 -0.13559 5.63437 0.134506C4.2765 0.404603 3.02922 1.07129 2.05026 2.05026C1.07129 3.02922 0.404603 4.2765 0.134506 5.63437C-0.13559 6.99224 0.00303296 8.3997 0.532846 9.67879C1.06266 10.9579 1.95987 12.0511 3.11101 12.8203ZM3.75918 2.14976C4.71846 1.50879 5.84628 1.16667 7 1.16667C8.5471 1.16667 10.0308 1.78125 11.1248 2.87521C12.2188 3.96918 12.8333 5.45291 12.8333 7C12.8333 8.15373 12.4912 9.28154 11.8502 10.2408C11.2093 11.2001 10.2982 11.9478 9.23232 12.3893C8.16642 12.8308 6.99353 12.9463 5.86198 12.7212C4.73042 12.4962 3.69102 11.9406 2.87521 11.1248C2.05941 10.309 1.50384 9.26958 1.27876 8.13803C1.05367 7.00647 1.16919 5.83358 1.61071 4.76768C2.05222 3.70178 2.79989 2.79074 3.75918 2.14976ZM7.00002 4.8611C6.84594 4.85908 6.69873 4.79698 6.58977 4.68801C6.48081 4.57905 6.4187 4.43185 6.41669 4.27776V3.88888C6.41669 3.73417 6.47815 3.58579 6.58754 3.4764C6.69694 3.367 6.84531 3.30554 7.00002 3.30554C7.15473 3.30554 7.3031 3.367 7.4125 3.4764C7.52189 3.58579 7.58335 3.73417 7.58335 3.88888V4.27776C7.58134 4.43185 7.51923 4.57905 7.41027 4.68801C7.30131 4.79698 7.1541 4.85908 7.00002 4.8611ZM7.00002 10.6945C6.84594 10.6925 6.69873 10.6304 6.58977 10.5214C6.48081 10.4124 6.4187 10.2652 6.41669 10.1111V6.22225C6.41669 6.06754 6.47815 5.91917 6.58754 5.80977C6.69694 5.70037 6.84531 5.63892 7.00002 5.63892C7.15473 5.63892 7.3031 5.70037 7.4125 5.80977C7.52189 5.91917 7.58335 6.06754 7.58335 6.22225V10.1111C7.58134 10.2652 7.51923 10.4124 7.41027 10.5214C7.30131 10.6304 7.1541 10.6925 7.00002 10.6945Z",fill:"currentColor"}))}));_D.displayName="InfoCircleIcon";function y7(){return y7=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},y7.apply(null,arguments)}var A7=b.memo(b.forwardRef(function(t,e){var n=ri.getPTI(t);return b.createElement("svg",y7({ref:e,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 14C5.61553 14 4.26215 13.5895 3.11101 12.8203C1.95987 12.0511 1.06266 10.9579 0.532846 9.67879C0.00303296 8.3997 -0.13559 6.99224 0.134506 5.63437C0.404603 4.2765 1.07129 3.02922 2.05026 2.05026C3.02922 1.07129 4.2765 0.404603 5.63437 0.134506C6.99224 -0.13559 8.3997 0.00303296 9.67879 0.532846C10.9579 1.06266 12.0511 1.95987 12.8203 3.11101C13.5895 4.26215 14 5.61553 14 7C14 8.85652 13.2625 10.637 11.9497 11.9497C10.637 13.2625 8.85652 14 7 14ZM7 1.16667C5.84628 1.16667 4.71846 1.50879 3.75918 2.14976C2.79989 2.79074 2.05222 3.70178 1.61071 4.76768C1.16919 5.83358 1.05367 7.00647 1.27876 8.13803C1.50384 9.26958 2.05941 10.309 2.87521 11.1248C3.69102 11.9406 4.73042 12.4962 5.86198 12.7212C6.99353 12.9463 8.16642 12.8308 9.23232 12.3893C10.2982 11.9478 11.2093 11.2001 11.8502 10.2408C12.4912 9.28154 12.8333 8.15373 12.8333 7C12.8333 5.45291 12.2188 3.96918 11.1248 2.87521C10.0308 1.78125 8.5471 1.16667 7 1.16667ZM4.66662 9.91668C4.58998 9.91704 4.51404 9.90209 4.44325 9.87271C4.37246 9.84333 4.30826 9.8001 4.2544 9.74557C4.14516 9.6362 4.0838 9.48793 4.0838 9.33335C4.0838 9.17876 4.14516 9.0305 4.2544 8.92113L6.17553 7L4.25443 5.07891C4.15139 4.96832 4.09529 4.82207 4.09796 4.67094C4.10063 4.51982 4.16185 4.37563 4.26872 4.26876C4.3756 4.16188 4.51979 4.10066 4.67091 4.09799C4.82204 4.09532 4.96829 4.15142 5.07887 4.25446L6.99997 6.17556L8.92106 4.25446C9.03164 4.15142 9.1779 4.09532 9.32903 4.09799C9.48015 4.10066 9.62434 4.16188 9.73121 4.26876C9.83809 4.37563 9.89931 4.51982 9.90198 4.67094C9.90464 4.82207 9.84855 4.96832 9.74551 5.07891L7.82441 7L9.74554 8.92113C9.85478 9.0305 9.91614 9.17876 9.91614 9.33335C9.91614 9.48793 9.85478 9.6362 9.74554 9.74557C9.69168 9.8001 9.62748 9.84333 9.55669 9.87271C9.4859 9.90209 9.40996 9.91704 9.33332 9.91668C9.25668 9.91704 9.18073 9.90209 9.10995 9.87271C9.03916 9.84333 8.97495 9.8001 8.9211 9.74557L6.99997 7.82444L5.07884 9.74557C5.02499 9.8001 4.96078 9.84333 4.88999 9.87271C4.81921 9.90209 4.74326 9.91704 4.66662 9.91668Z",fill:"currentColor"}))}));A7.displayName="TimesCircleIcon";function w7(){return w7=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},w7.apply(null,arguments)}function S7(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Wee(t){if(Array.isArray(t))return S7(t)}function Qee(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function DD(t,e){if(t){if(typeof t=="string")return S7(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S7(t,e):void 0}}function Jee(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1601
+ `),dataTransfer:t=>t},matchesTypes:["Url","text/uri-list"]},[nD]:{exposeProperties:{text:(t,e)=>c7(t,e,""),dataTransfer:t=>t},matchesTypes:["Text","text/plain"]}};function cee(t,e){const n=u7[t];if(!n)throw new Error(`native type ${t} has no configuration`);const r=new lee(n);return r.loadDataTransfer(e),r}function d7(t){if(!t)return null;const e=Array.prototype.slice.call(t.types||[]);return Object.keys(u7).filter(n=>{const r=u7[n];return r!=null&&r.matchesTypes?r.matchesTypes.some(i=>e.indexOf(i)>-1):!1})[0]||null}const uee=Z_(()=>/firefox/i.test(navigator.userAgent)),aD=Z_(()=>!!window.safari);class sD{interpolate(e){const{xs:n,ys:r,c1s:i,c2s:a,c3s:s}=this;let l=n.length-1;if(e===n[l])return r[l];let c=0,u=s.length-1,d;for(;c<=u;){d=Math.floor(.5*(c+u));const g=n[d];if(g<e)c=d+1;else if(g>e)u=d-1;else return r[d]}l=Math.max(0,u);const f=e-n[l],h=f*f;return r[l]+i[l]*f+a[l]*h+s[l]*f*h}constructor(e,n){const{length:r}=e,i=[];for(let g=0;g<r;g++)i.push(g);i.sort((g,v)=>e[g]<e[v]?-1:1);const a=[],s=[];let l,c;for(let g=0;g<r-1;g++)l=e[g+1]-e[g],c=n[g+1]-n[g],a.push(l),s.push(c/l);const u=[s[0]];for(let g=0;g<a.length-1;g++){const v=s[g],m=s[g+1];if(v*m<=0)u.push(0);else{l=a[g];const A=a[g+1],S=l+A;u.push(3*S/((S+A)/v+(S+l)/m))}}u.push(s[s.length-1]);const d=[],f=[];let h;for(let g=0;g<u.length-1;g++){h=s[g];const v=u[g],m=1/a[g],A=v+u[g+1]-h-h;d.push((h-v-A)*m),f.push(A*m*m)}this.xs=e,this.ys=n,this.c1s=u,this.c2s=d,this.c3s=f}}const dee=1;function oD(t){const e=t.nodeType===dee?t:t.parentElement;if(!e)return null;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function M3(t){return{x:t.clientX,y:t.clientY}}function fee(t){var e;return t.nodeName==="IMG"&&(uee()||!(!((e=document.documentElement)===null||e===void 0)&&e.contains(t)))}function hee(t,e,n,r){let i=t?e.width:n,a=t?e.height:r;return aD()&&t&&(a/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:a}}function pee(t,e,n,r,i){const a=fee(e),l=oD(a?t:e),c={x:n.x-l.x,y:n.y-l.y},{offsetWidth:u,offsetHeight:d}=t,{anchorX:f,anchorY:h}=r,{dragPreviewWidth:g,dragPreviewHeight:v}=hee(a,e,u,d),m=()=>{let I=new sD([0,.5,1],[c.y,c.y/d*v,c.y+v-d]).interpolate(h);return aD()&&a&&(I+=(window.devicePixelRatio-1)*v),I},A=()=>new sD([0,.5,1],[c.x,c.x/u*g,c.x+g-u]).interpolate(f),{offsetX:S,offsetY:T}=i,w=S===0||S,E=T===0||T;return{x:w?S:A(),y:E?T:m()}}class gee{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var e;return!((e=this.globalContext)===null||e===void 0)&&e.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}constructor(e,n){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=n}}function mee(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lD(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){mee(t,i,n[i])})}return t}class vee{profile(){var e,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){const e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,n,r){this.sourceNodes.set(e,n),this.sourceNodeOptions.set(e,r);const i=s=>this.handleDragStart(s,e),a=s=>this.handleSelectStart(s);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",i),n.addEventListener("selectstart",a),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",i),n.removeEventListener("selectstart",a),n.setAttribute("draggable","false")}}connectDropTarget(e,n){const r=s=>this.handleDragEnter(s,e),i=s=>this.handleDragOver(s,e),a=s=>this.handleDrop(s,e);return n.addEventListener("dragenter",r),n.addEventListener("dragover",i),n.addEventListener("drop",a),()=>{n.removeEventListener("dragenter",r),n.removeEventListener("dragover",i),n.removeEventListener("drop",a)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(e);return lD({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(e);return lD({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(iD).some(n=>iD[n]===e)}beginDragNativeItem(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=cee(e,n),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;const n=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},n)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,n){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}handleDragEnter(e,n){this.dragEnterTargetIds.unshift(n)}handleDragOver(e,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}handleDrop(e,n){this.dropTargetIds.unshift(n)}constructor(e,n,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=i=>{const a=this.sourceNodes.get(i);return a&&oD(a)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=i=>!!(i&&this.document&&this.document.body&&this.document.body.contains(i)),this.endDragIfSourceWasRemovedFromDOM=()=>{const i=this.currentDragSourceNode;i==null||this.isNodeInDocument(i)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=i=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(i||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=i=>{if(i.defaultPrevented)return;const{dragStartSourceIds:a}=this;this.dragStartSourceIds=null;const s=M3(i);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:s});const{dataTransfer:l}=i,c=d7(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const d=this.monitor.getSourceId(),f=this.sourceNodes.get(d),h=this.sourcePreviewNodes.get(d)||f;if(h){const{anchorX:g,anchorY:v,offsetX:m,offsetY:A}=this.getCurrentSourcePreviewNodeOptions(),w=pee(f,h,s,{anchorX:g,anchorY:v},{offsetX:m,offsetY:A});l.setDragImage(h,w.x,w.y)}}try{l==null||l.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(i.target);const{captureDraggingState:u}=this.getCurrentSourcePreviewNodeOptions();u?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(c)this.beginDragNativeItem(c);else{if(l&&!l.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=i=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var a;(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}if(!this.enterLeaveCounter.enter(i.target)||this.monitor.isDragging())return;const{dataTransfer:l}=i,c=d7(l);c&&this.beginDragNativeItem(c,l)},this.handleTopDragEnter=i=>{const{dragEnterTargetIds:a}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=i.altKey,a.length>0&&this.actions.hover(a,{clientOffset:M3(i)}),a.some(l=>this.monitor.canDropOnTarget(l))&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=i=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var a;(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}},this.handleTopDragOver=i=>{const{dragOverTargetIds:a}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}this.altKeyPressed=i.altKey,this.lastClientOffset=M3(i),this.scheduleHover(a),(a||[]).some(l=>this.monitor.canDropOnTarget(l))?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=i=>{this.isDraggingNativeItem()&&i.preventDefault(),this.enterLeaveCounter.leave(i.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=i=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var a;i.preventDefault(),(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}else d7(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:a}=this;this.dropTargetIds=[],this.actions.hover(a,{clientOffset:M3(i)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=i=>{const a=i.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(i.preventDefault(),a.dragDrop()))},this.options=new gee(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new oee(this.isNodeInDocument)}}const Vf=function(e,n,r){return new vee(e,n,r)},cD=P.createContext(void 0),uD=({children:t,option:e,saveFormBuilderSchema:n,templateSchema:r,onChange:i})=>{const a={...R8,...r},[s,l]=P.useReducer(aJ,a);P.useEffect(()=>{n&&n(s)},[s]);const{isPreview:c,isAdmin:u,isRenderView:d,renderType:f,isAdvanceView:h,globalAlignment:g="ltr",emitSocketData:v,media:m,reusableComponent:A,saveFormProgress:S,showSettings:T}=e;return o.jsx(cD.Provider,{value:{media:m,isPreview:c,isAdmin:u,isRenderView:d,renderType:f,isAdvanceView:h,globalAlignment:g,emitSocketData:v,reusableComponent:A,state:s,dispatch:l,onChange:i,saveFormProgress:S,showSettings:T},children:o.jsx(Lf,{backend:Vf,children:t})})},dD=()=>P.useContext(cD),bee=(t,e,n)=>{const r=Array.from(t),[i]=r.splice(e,1);return r.splice(n,0,i),r},yee=(t,e)=>[...t.slice(0,e),...t.slice(e+1)],Aee=(t,e,n)=>[...t.slice(0,e),n,...t.slice(e)],fD=(t,e,n)=>{if(e.length===1){const c=Number(e[0]),u=Number(n[0]);return bee(t,u,c)}const r=[...t],i=Number(e.slice(0,1)),a=e.slice(1),s=n.slice(1),l=r[i];return r[i]={...l,children:fD(l.children,a,s)},r},hD=(t,e)=>{if(e.length===1){const s=Number(e[0]);return yee(t,s)}const n=[...t],r=Number(e.slice(0,1)),i=e.slice(1),a=n[r];return n[r]={...a,children:hD(a.children,i)},n},f7=(t,e,n)=>{if(e.length===1){const l=Number(e[0]);return Aee(t,l,n)}const r=[...t],i=Number(e.slice(0,1)),a=e.slice(1),s=r[i];return r[i]={...s,children:f7(s.children,a,n)},r},wee=(t,e,n)=>{let r=[...t],i=r[n[ma]].children[n[va]].children[n[xa]].children[n[Ca]].children[n[Ta]].inlineConditionalRules.rules[n[Na]].conditions[n[Zo]].children[n[Fo]];return r[n[ma]].children[n[va]].children[n[xa]].children[n[Ca]].children[n[Ta]].inlineConditionalRules.rules[n[Na]].conditions[n[Zo]].children.splice([n[Fo]],1),r[e[ma]].children[e[va]].children[e[xa]].children[e[Ca]].children[e[Ta]].inlineConditionalRules.rules[e[Na]].conditions[e[Zo]].children.splice(e[Fo],0,i),r},See=(t,e,n)=>fD(t,e,n),xee=t=>{const e=[...t],n={type:ws,uuid:et(),children:[]};return e.map(r=>(r.children.length||(r.children=[n]),r))},pD=(t,e,n,r)=>{var h,g,v,m,A,S;let i;const a={...Bc,uuid:et(),children:[r]},s={...mu,uuid:et()},l={...mu,uuid:et(),children:[a]},c={...kf,uuid:et(),children:[l]},u={..._3,uuid:et(),children:[c]};switch(e.length){case 1:{r.type===dT?i={...c,children:[r]}:i={...c,children:[s]};break}case 2:{r.type===na?i={...u,children:[c]}:i={...u,children:[c]};break}case 3:{r.type===Oo?i={...c,children:[l]}:i={...mu,uuid:et(),children:[{...Bc,uuid:et(),children:[r]}]};break}case 4:{r.type===pf?i=a:i=r;break}case 5:{i=r;break}default:i=r}let d=t;return n.length>5?(S=(A=(m=(v=(g=(h=d[n[ma]])==null?void 0:h.children[n[va]])==null?void 0:g.children[n[xa]])==null?void 0:v.children[n[Ca]])==null?void 0:m.children[n[Ta]])==null?void 0:A.inlineConditionalRules)==null||S.rules[n[Na]].conditions[n[Zo]].children.splice(n[Fo],1):d=hD(d,n),d=xee(d),d=f7(d,e,i),d},Cee=(t,e,n)=>{let r;switch(e.length){case 1:{r={..._3,uuid:et(),children:[{...kf,uuid:et(),children:[{...mu,uuid:et(),children:[{...Bc,uuid:et(),children:[n]}]}]}]};break}case 2:{r={...kf,uuid:et(),children:[{...mu,uuid:et(),children:[{...Bc,uuid:et(),children:[n]}]}]};break}case 3:{r={...mu,uuid:et(),children:[{...Bc,uuid:et(),children:[n]}]};break}case 4:{r={...Bc,uuid:et(),children:[n]};break}default:r=n}return f7(t,e,r)},un=()=>{const{state:t,dispatch:e,onChange:n,saveFormProgress:r}=dD(),{updateGlobalToast:i,emitSocketData:a}=tn();if(t===void 0)throw new Error("Must be wrapped in builder provider");const s=t.builderTemplateName,l=t.isChangesSaved,c=t.editing_by,u=t.version_name,d=t.loading,f=t.published_status,h=t,g=t,v=t.formType,m=t==null?void 0:t.userSelectedLanguage,A=t==null?void 0:t.languages,S=t.layout,T=P.useCallback(me=>WQ(me)(e),[e]),w=P.useCallback(me=>SQ(me)(e),[e]),E=P.useCallback(me=>QQ(me)(e),[e]),x=P.useCallback((me,we)=>{var yt,qt,hn,on,_n,vn,In,Gt;const De=me.path.split("-"),q=De.slice(0,-1).join("-"),se={uuid:we.uuid,type:we.type,reviewerChecklist:[]},pe=0,ue=1,oe=2,ae=3,Oe=4,Ne=5,Ke=6,ut=8,pt=7,ht=5,kt=6,wn=8;if(we.type===na&&(we==null?void 0:we.schema)!==void 0){$(JSON.parse(we==null?void 0:we.schema),parseInt(De[pe]));return}if(((yt=we==null?void 0:we.schema)==null?void 0:yt.componentType)==="question"&&((vn=(_n=(on=(hn=(qt=S[0])==null?void 0:qt.children[0])==null?void 0:hn.children[0])==null?void 0:on.children[0])==null?void 0:_n.children)!=null&&vn.some(Re=>{var nt,dt,jt;return((nt=Re==null?void 0:Re.questionText)==null?void 0:nt[m.type])===((jt=(dt=we==null?void 0:we.schema)==null?void 0:dt.questionText)==null?void 0:jt[m.type])}))){i({showToast:!0,toastMessage:"Exist",toastDetail:"Question text cannot be same for more than one element",toastType:"warn"});return}if(we.type===Gn){let Re={type:pf,reviewerChecklist:[],..._t.cloneDeep(we.schema)};if(Re!=null&&Re.options&&(Re={...Re,options:[{uuid:et(),optionText:{english:"Option 1"},value:"Option1",hyperlinkText:{english:""},abbreviationText:{english:"Option 1"},custom_values:{}},{uuid:et(),optionText:{english:"Option 2"},value:"Option2",hyperlinkText:{english:""},abbreviationText:{english:"Option 1"},custom_values:{}}]}),Re.componentType==="grid-component"&&(Re={...Re,children:[],options:[{uuid:et(),custom_values:{}}]}),Re.componentType==="radio-hierarchal"&&(Re={...Re,type:"radio",children:[],options:[{uuid:et(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:et(),label:"No",value:null,enableConditionalField:!0,children:[]}]}),Re={...Re,uuid:et()},De.length===ut){W(parseInt(De[pe]),parseInt(De[ue]),parseInt(De[oe]),parseInt(De[ae]),parseInt(De[Oe]),parseInt(De[Ne]),parseInt(De[Ke]),Re),a();return}if(De.length===pt){de(parseInt(De[pe]),parseInt(De[ue]),parseInt(De[oe]),parseInt(De[ae]),parseInt(De[Oe]),parseInt(De[ht]),parseInt(De[kt]),Re),a();return}if((Gt=(In=S[De[pe]].children[De[ue]])==null?void 0:In.children[De[oe]])!=null&&Gt.rowIsRepeatable&&(Re==null?void 0:Re.componentType)==="editor"){i({showToast:!0,toastMessage:"Forbidden",toastDetail:"This Field cannot be applied in repeatable",toastType:"error"});return}E(Cee(S,De,Re)),a(),De.length>1&&ye(De[pe],De[ue],De[oe],Re);return}const Vt=we.path.split("-"),Nt=Vt.slice(0,-1).join("-");if(Vt.length===De.length){if(Nt===q){if((Vt==null?void 0:Vt.length)===wn){E(wee(S,De,Vt));return}E(See(S,De,Vt));return}const Re={...se,...we};(we==null?void 0:we.id)===void 0&&(Re.id=et()),E(pD(S,De,Vt,Re));return}if((Vt==null?void 0:Vt.length)===8){const Re={type:pf,reviewerChecklist:[],...we};de(parseInt(De[pe]),parseInt(De[ue]),parseInt(De[oe]),parseInt(De[ae]),parseInt(De[Oe]),parseInt(De[ht]),parseInt(De[kt]),Re),U(Vt[ma],Vt[va],Vt[xa],Vt[Ca],Vt[Ta],Vt[ht],Vt[kt],Vt[tc]);return}const $e={...se,...we};(we==null?void 0:we.id)===void 0&&($e.id=et()),E(pD(S,De,Vt,$e))},[S,m.type]),I=P.useCallback(()=>iJ()(e),[e]),_=P.useCallback(me=>JQ(me)(e,t),[e]),O=P.useCallback(me=>ZQ(me)(e,t),[e]),B=P.useCallback(me=>eJ(me)(e),[e]),M=P.useCallback(me=>wQ(me)(e),[e]),V=P.useCallback(me=>IQ(me)(e),[e]),$=P.useCallback((me,we)=>NQ(me,we)(e),[e]),k=P.useCallback((me,we)=>MQ(me,we)(e),[e]),z=P.useCallback((me,we,De)=>VQ(me,we,De)(e),[e]),le=P.useCallback(me=>TQ(me)(e),[e]),fe=P.useCallback((me,we)=>EQ(me,we)(e),[e]),Z=P.useCallback((me,we,De)=>PQ(me,we,De)(e),[e]),G=P.useCallback((me,we,De,q)=>qQ(me,we,De,q)(e),[e]),ce=P.useCallback((me,we,De,q,se)=>$Q(me,we,De,q,se)(e,t),[e]),K=P.useCallback((me,we,De,q,se,pe)=>jQ(me,we,De,q,se,pe)(e,t),[e]),ge=P.useCallback((me,we,De)=>_Q(me,we,De)(e),[e]),te=P.useCallback((me,we,De,q)=>kQ(me,we,De,q)(e),[e]),ee=P.useCallback((me,we)=>CQ(me,we)(e),[e]),Y=P.useCallback((me,we,De,q,se,pe)=>zQ(me,we,De,q,se,pe)(e),[e]),J=P.useCallback((me,we,De,q,se)=>UQ(me,we,De,q,se)(e),[e]),he=P.useCallback((me,we,De,q)=>FQ(me,we,De,q)(e),[e]),be=P.useCallback((me,we,De)=>DQ(me,we,De)(e),[e]),Ee=P.useCallback((me,we)=>xQ(me,we)(e,t),[e]),ye=P.useCallback((me,we,De,q)=>LQ(me,we,De,q)(e),[e]),Ae=P.useCallback((me,we,De,q,se,pe,ue,oe,ae)=>RQ(me,we,De,q,se,pe,ue,oe,ae)(e),[e]),ne=P.useCallback((me,we,De,q,se,pe,ue,oe,ae)=>KQ(me,we,De,q,se,pe,ue,oe,ae)(e),[e]),U=P.useCallback((me,we,De,q,se,pe,ue,oe)=>XQ(me,we,De,q,se,pe,ue,oe)(e),[e]),re=P.useCallback((me,we,De,q,se,pe,ue,oe)=>GQ(me,we,De,q,se,pe,ue,oe)(e),[e]),W=P.useCallback((me,we,De,q,se,pe,ue,oe)=>HQ(me,we,De,q,se,pe,ue,oe)(e),[e]),de=P.useCallback((me,we,De,q,se,pe,ue,oe)=>YQ(me,we,De,q,se,pe,ue,oe)(e),[e]),Ce=P.useCallback(me=>tJ(me)(e),[e]),_e=P.useCallback(me=>nJ(me)(e),[e]),ve=P.useCallback(me=>rJ(me)(e),[e]);return{builderIsChangesSaved:l,builderTemplateName:s,formBuilderFormSchema:h,formBuilderFormLayout:S,formBuilderSchemaLanguages:A,saveFormTemplateNewVersion:g,userSelectedLanguage:m,formBuilderConfigurationType:v,formBuilderLoading:d,formBuilderPublishedStatus:f,builderEditingBy:c,builderVersionName:u,handleDrop:x,formatTableFieldsHook:w,saveFormBuilderSchema:T,removePage:le,removeSection:fe,removeRow:Z,removeColumn:G,removeField:ce,updateEditingBy:ve,addTabs:M,addSection:V,addRow:k,addColumn:z,cloneField:Y,cloneColumn:J,cloneRow:he,cloneSection:be,clonePage:Ee,sectionImport:$,setLayout:E,fieldSettingUpdate:K,selectFormBuilderLanguage:_,unselectFormBuilderLanguage:O,updateUserFormSelectedLanguage:B,updateFormType:Ce,schemaBuilderUpdate:_e,pageSettingUpdate:ee,saveFormProgress:r,sectionSettingUpdate:ge,rowSettingUpdate:te,clearBuilderSchema:I,addFieldToRowRepeaptable:ye,addFieldToInlineRuleCondtionFields:W,fieldSettingUpdateInlineConditional:Ae,fieldSettingDeleteInlineConditional:re,addFieldToGridComponentHook:de,gridComponentFieldSettingUpdate:ne,gridComponentFieldDelete:U}},tn=()=>{const{isPreview:t,isAdmin:e,isRenderView:n,renderType:r,isAdvanceView:i,media:a,globalAlignment:s,reusableComponent:l,showSettings:c}=dD();if(t===void 0)throw new Error("Must be wrapped in builder provider");const u=r==null?void 0:r.key,{saveComponent:d,componentList:f,sectionsList:h}=l;return{isPreview:t,isAdmin:e,isRenderView:n,renderType:u,isAdvanceView:i,globalAlignment:s,media:a,saveComponent:d,componentList:f,sectionsList:h,emitSocketData:()=>{},updateGlobalToast:m=>{console.log("showSettings",c),c!=null&&c.showToast&&(c==null||c.showToast(m))}}},Tee="TASKS_LOADING",Eee="TASKS_ADD",Iee="TASKS_GET_PAGINATED_LIST",_ee="TASKS_DELETE",Dee="TASKS_PAGNIATION_UPDATE",Nee="TASKS_UPDATE",Oee="TASKS_SUCCESS_GET",Fee="TASK_GET_TEMPLATE",kee="TASK_SET_DATA",Pee="TASKS_FORM_SUBMIT",Mee="TASKS_FORM_HTTP_REQUEST",h7="TASK_SET_PROGRESS_VALUE",gD="TASK_SET_MAX_PROGRESS_VALUE",mD="TASK_SET_REGISTER_DATA",vD="TASK_SET_SCHEMA",p7="TASK_UPDATE_USER_FORM_SUBMIT_DATA",bD="CLEAR_TASK",yD="TASK_USER_SUBMIT_FORM_REPEATABLE_ADD",AD="TASK_USER_SUBMIT_FORM_REPEATABLE_REMOVE_INDEX",wD="TASK_USER_TRAINING_DATA",SD="TASK_FIELD_UPDATE",Lee=6,L3=1,n2="DISPLAY_TYPE_START_DETAILS",B3="DISPLAY_TYPE_QUIZ",g7="DISPLAY_TYPE_START_TIMER";function Bee(t,e,n,r,i,a){return s=>{s({type:SD,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,field:a}})}}function xD(t){return(e,n)=>{const r={type:p7,payLoad:{userTaskSubmitFormData:[...t]}};e(r)}}function Vee(t){return(e,n)=>{const{TasksReducer:r}=n(),{taskData:i}=r,a={type:p7,payLoad:{taskData:{...i,...t}}};e(a)}}function Uee(t,e){return(n,r)=>{const{TasksReducer:i}=r(),{userTaskSubmitFormData:a}=i,s=_t.findIndex(a,function(c){return c.rowId===t});n({type:AD,payLoad:{userSubmitFormIndex:s,repeatableDataRowIndex:e}})}}function qee(t,e){return(n,r)=>{const{TasksReducer:i}=r(),{userTaskSubmitFormData:a}=i,s=_t.findIndex(a,function(c){return c.rowId===t});n({type:yD,payLoad:{userSubmitFormIndex:s,repeatableData:e}})}}function $ee(){return t=>{t({type:bD,payLoad:null})}}const CD=t=>e=>{console.log("updateProgresValue",t),e({type:h7,payLoad:{progressValue:t}})},jee=t=>e=>{e({type:h7,payLoad:t})},zee=t=>e=>{e({type:wD,payLoad:{userTrainingSaveData:t}})},TD=t=>e=>{e({type:mD,payLoad:{registerData:t}})},Hee=(t,e,n)=>(r,i)=>{var d;const{TasksReducer:a}=i(),{userTaskSubmitFormData:s}=a,l=[...s],c=_t.findIndex(l,function(f){var h;return f.rowId===((h=t==null?void 0:t.row)==null?void 0:h.uuid)});let u=(d=s[c])==null?void 0:d.repeatableFields;u={...u,[e==null?void 0:e.uuid]:`<div>${n}</div>`},l[c]={...l[c],repeatableFields:u},r(xD(l))},Yee=(t,e,n)=>(r,i)=>{const{TasksReducer:a}=i(),{userTaskSubmitFormData:s,registerData:l}=a,c=s,u=_t.cloneDeep(l);if(n&&(c==null?void 0:c.length)>0){u[e==null?void 0:e.uuid]=n;for(const f of c)f.fieldId===e.uuid&&(f.postData[0]={postValue:n})}else if((c==null?void 0:c.length)>0){for(const f of c)f.fieldId===e.uuid&&(f.postData[0]={postValue:""});delete u[e==null?void 0:e.uuid]}r(TD(u));const d=Object.keys(u).length;r(CD(d))},Kee=t=>e=>{e({type:gD,payLoad:{progressMaxValue:t}})},m7={submitting:!1,httpRequest:!1,taskData:null,taskUpdateLoading:!1,loading:!1,progressLoading:!1,list:[],filter:"",sort:"task.created_at|desc",total_records:0,page:1,per_page:10,success:!1,success_message:"",userTaskSubmitFormData:null,taskSchema:null,progressMaxValue:0,maxTabs:0,registerData:{},progressValue:0,tabNoOfFieldsData:[],noOfTotalElements:0,sortField:null,sortOrder:null,userTrainingSaveData:null,assessmentData:null,task_status:1},Xee=(t=m7,e)=>{switch(e.type){case bD:return{...t,...m7,list:[...t.list],page:t.page,per_page:t.per_page,filter:t.filter,sort:t.sort,total_records:t.total_records};case Oee:return{...t,...e.payLoad};case p7:return{...t,...e.payLoad};case vD:return{...t,...e.payLoad};case h7:return console.log("action.payLoad",e.payLoad),{...t,...e.payLoad};case mD:return{...t,registerData:e.payLoad.registerData};case gD:return{...t,...e.payLoad};case Tee:return{...t,...e.payLoad};case Pee:return{...t,...e.payLoad};case Mee:return{...t,...e.payLoad};case Eee:{const{record:n}=e.payLoad;return{...t,list:[...n,...t.list]}}case Iee:return{...t,...e.payLoad};case kee:return{...t,taskData:e.payLoad};case Dee:return{...t,...e.payLoad};case _ee:{const n=t.list.filter(r=>r.task_id!==e.payLoad.task_id);return{...t,list:[...n]}}case wD:return{...t,...e.payLoad};case SD:{const{pageIndex:n,sectionIndex:r,rowIndex:i,columnIndex:a,fieldIndex:s,field:l}=e.payLoad,c=[...t.taskSchema.layout];c[n].children[r].children[i].children[a].children[s]=l;const u={...t.taskSchema,layout:c};return{...t,taskSchema:u}}case yD:{const{userSubmitFormIndex:n,repeatableData:r}=e.payLoad,i=t.userTaskSubmitFormData[n].repeatableFieldsData?t.userTaskSubmitFormData[n].repeatableFieldsData:[];return i.push(r),t.userTaskSubmitFormData[n].repeatableFieldsData=i,t}case AD:{const{userSubmitFormIndex:n,repeatableDataRowIndex:r}=e.payLoad,i=[...t.userTaskSubmitFormData],a=[...i[n].repeatableFieldsData];return a.splice(r,1),i[n]={...i[n],repeatableFieldsData:a},{...t,userTaskSubmitFormData:i}}case Nee:{const{row:n,eventIndex:r}=e.payLoad,i=t.list[r];return t.list[r]={...i,...n},t}case Fee:return{...t,...e.payLoad}}return t},ED=P.createContext(void 0),Ree=({option:t,taskOptions:e,saveFormBuilderSchema:n,templateSchema:r,taskValue:i,children:a})=>{const[s,l]=P.useReducer(Xee,{...m7,...i}),{progressMaxValue:c,progressValue:u,registerData:d,...f}=i;return P.useEffect(()=>{l({type:vD,payLoad:f})},[i]),o.jsx(ED.Provider,{value:{taskOptions:e,state:s,dispatch:l},children:o.jsx(uD,{option:t,saveFormBuilderSchema:n,templateSchema:r,onChange:()=>{},children:a})})},Gee=()=>P.useContext(ED),yr=()=>{var Ae,ne,U,re,W,de,Ce,_e;const{taskOptions:n,state:r,dispatch:i}=Gee();if(r===void 0)throw new Error("Must be wrapped in task render provider");console.log("state.progressValue",r.progressValue),console.log("state.taskProgressMaxValue",r.progressMaxValue);const a=r.task_status,s=r.task_status,l=r.userTaskSubmitFormData,c=r.userTrainingSaveData,u=r.taskSchema,d=r.assessmentData,f=r.progressLoading,h=r.submitting,g=r.httpRequest,v=r.taskData,m=r.progressMaxValue,A=r.maxTabs,S=r.tabNoOfFieldsData,T=r.registerData,w=r.progressValue,E=r.noOfTotalElements,x=r.menuList,I=r.loading,_=r.submitting,O=r.success,B=r.success_message,M=(Ae=n==null?void 0:n.exam)!=null&&Ae.startQuiz?(ne=n==null?void 0:n.exam)==null?void 0:ne.startQuiz:()=>{},V=(U=n==null?void 0:n.exam)!=null&&U.AddUserAssessmentAnswer?(re=n==null?void 0:n.exam)==null?void 0:re.AddUserAssessmentAnswer:()=>{},$=(W=n==null?void 0:n.exam)!=null&&W.endQuiz?(de=n==null?void 0:n.exam)==null?void 0:de.endQuiz:()=>{},k=(Ce=n==null?void 0:n.exam)!=null&&Ce.examComplete?(_e=n==null?void 0:n.exam)==null?void 0:_e.examComplete:ve=>{},z=n!=null&&n.updateTaskFormData?n==null?void 0:n.updateTaskFormData:(ve,me,we,De,q,se)=>{},le=n!=null&&n.submitTaskFormData?n==null?void 0:n.submitTaskFormData:(ve,me,we)=>{},fe=P.useCallback(ve=>i(Vee(ve)),[i]),Z=P.useCallback((ve,me,we)=>{},[i]),G=P.useCallback(()=>i($ee()),[i]),ce=P.useCallback((ve,me)=>i(qee(ve,me)),[i]),K=P.useCallback((ve,me)=>i(Uee(ve,me)),[i]),ge=P.useCallback(ve=>{console.log("updateTaskProgressValue hook",ve),CD(ve)(i)},[i]),te=P.useCallback(ve=>i(jee(ve)),[i]),ee=P.useCallback(ve=>i(TD(ve)),[i]),Y=P.useCallback(ve=>i(xD(ve)),[i]),J=P.useCallback(ve=>i(Kee(ve)),[i]),he=P.useCallback(ve=>i(zee(ve)),[i]),be=P.useCallback((ve,me,we)=>i(Hee(ve,me,we)),[i]),Ee=P.useCallback((ve,me,we)=>i(Yee(ve,me,we)),[i]),ye=P.useCallback((ve,me,we,De,q,se)=>i(Bee(ve,me,we,De,q,se)),[i]);return{examComplete:k,taskOptions:n,TASK_PUBLISHED:6,TASK_PENDING:1,taskStatus:s,assessmentData:d,taskSchema:u,taskData:v,TasksList:x,TasksLoading:I,TasksSuccess:O,TasksSuccessMessage:B,taskProgressMaxValue:m,taskRegisterData:T,taskProgressValue:w,taskMaxTabs:A,noOfTotalElements:E,taskTabRequiredFieldsData:S,userTaskSubmitFormData:l,userTrainingSaveData:c,TasksSubmitLoading:_,updateTaskDataSchema:fe,submitTaskFormData:le,updateTaskFormData:z,TasksSubmit:h,TasksHTTPRequest:g,updateTaskRegisterData:ee,updateTaskProgressValue:ge,updateTaskProgressMaxValue:J,updateUserFormDataSubmit:Y,removeUserDataFormSectionRepeatableData:K,addUserDataFormSectionRepeatableData:ce,onSetValuetoRepeatableData:be,onSetValuetoPostDataHook:Ee,clearTaskSchema:G,taskProgressLoading:f,task_status:a,startQuiz:M,endQuiz:$,AddUserAssessmentAnswer:V,updateUserTraining:he,taskFieldUpdateHook:ye,updateProgressDataValuesHook:te,saveProgressDataHook:Z}};function v7(){return v7=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},v7.apply(null,arguments)}var ID=b.memo(b.forwardRef(function(t,e){var n=ri.getPTI(t);return b.createElement("svg",v7({ref:e,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),b.createElement("path",{d:"M13.4018 13.1893H0.598161C0.49329 13.189 0.390283 13.1615 0.299143 13.1097C0.208003 13.0578 0.131826 12.9832 0.0780112 12.8932C0.0268539 12.8015 0 12.6982 0 12.5931C0 12.4881 0.0268539 12.3848 0.0780112 12.293L6.47985 1.08982C6.53679 1.00399 6.61408 0.933574 6.70484 0.884867C6.7956 0.836159 6.897 0.810669 7 0.810669C7.103 0.810669 7.2044 0.836159 7.29516 0.884867C7.38592 0.933574 7.46321 1.00399 7.52015 1.08982L13.922 12.293C13.9731 12.3848 14 12.4881 14 12.5931C14 12.6982 13.9731 12.8015 13.922 12.8932C13.8682 12.9832 13.792 13.0578 13.7009 13.1097C13.6097 13.1615 13.5067 13.189 13.4018 13.1893ZM1.63046 11.989H12.3695L7 2.59425L1.63046 11.989Z",fill:"currentColor"}),b.createElement("path",{d:"M6.99996 8.78801C6.84143 8.78594 6.68997 8.72204 6.57787 8.60993C6.46576 8.49782 6.40186 8.34637 6.39979 8.18784V5.38703C6.39979 5.22786 6.46302 5.0752 6.57557 4.96265C6.68813 4.85009 6.84078 4.78686 6.99996 4.78686C7.15914 4.78686 7.31179 4.85009 7.42435 4.96265C7.5369 5.0752 7.60013 5.22786 7.60013 5.38703V8.18784C7.59806 8.34637 7.53416 8.49782 7.42205 8.60993C7.30995 8.72204 7.15849 8.78594 6.99996 8.78801Z",fill:"currentColor"}),b.createElement("path",{d:"M6.99996 11.1887C6.84143 11.1866 6.68997 11.1227 6.57787 11.0106C6.46576 10.8985 6.40186 10.7471 6.39979 10.5885V10.1884C6.39979 10.0292 6.46302 9.87658 6.57557 9.76403C6.68813 9.65147 6.84078 9.58824 6.99996 9.58824C7.15914 9.58824 7.31179 9.65147 7.42435 9.76403C7.5369 9.87658 7.60013 10.0292 7.60013 10.1884V10.5885C7.59806 10.7471 7.53416 10.8985 7.42205 11.0106C7.30995 11.1227 7.15849 11.1866 6.99996 11.1887Z",fill:"currentColor"}))}));ID.displayName="ExclamationTriangleIcon";function b7(){return b7=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},b7.apply(null,arguments)}var _D=b.memo(b.forwardRef(function(t,e){var n=ri.getPTI(t);return b.createElement("svg",b7({ref:e,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.11101 12.8203C4.26215 13.5895 5.61553 14 7 14C8.85652 14 10.637 13.2625 11.9497 11.9497C13.2625 10.637 14 8.85652 14 7C14 5.61553 13.5895 4.26215 12.8203 3.11101C12.0511 1.95987 10.9579 1.06266 9.67879 0.532846C8.3997 0.00303296 6.99224 -0.13559 5.63437 0.134506C4.2765 0.404603 3.02922 1.07129 2.05026 2.05026C1.07129 3.02922 0.404603 4.2765 0.134506 5.63437C-0.13559 6.99224 0.00303296 8.3997 0.532846 9.67879C1.06266 10.9579 1.95987 12.0511 3.11101 12.8203ZM3.75918 2.14976C4.71846 1.50879 5.84628 1.16667 7 1.16667C8.5471 1.16667 10.0308 1.78125 11.1248 2.87521C12.2188 3.96918 12.8333 5.45291 12.8333 7C12.8333 8.15373 12.4912 9.28154 11.8502 10.2408C11.2093 11.2001 10.2982 11.9478 9.23232 12.3893C8.16642 12.8308 6.99353 12.9463 5.86198 12.7212C4.73042 12.4962 3.69102 11.9406 2.87521 11.1248C2.05941 10.309 1.50384 9.26958 1.27876 8.13803C1.05367 7.00647 1.16919 5.83358 1.61071 4.76768C2.05222 3.70178 2.79989 2.79074 3.75918 2.14976ZM7.00002 4.8611C6.84594 4.85908 6.69873 4.79698 6.58977 4.68801C6.48081 4.57905 6.4187 4.43185 6.41669 4.27776V3.88888C6.41669 3.73417 6.47815 3.58579 6.58754 3.4764C6.69694 3.367 6.84531 3.30554 7.00002 3.30554C7.15473 3.30554 7.3031 3.367 7.4125 3.4764C7.52189 3.58579 7.58335 3.73417 7.58335 3.88888V4.27776C7.58134 4.43185 7.51923 4.57905 7.41027 4.68801C7.30131 4.79698 7.1541 4.85908 7.00002 4.8611ZM7.00002 10.6945C6.84594 10.6925 6.69873 10.6304 6.58977 10.5214C6.48081 10.4124 6.4187 10.2652 6.41669 10.1111V6.22225C6.41669 6.06754 6.47815 5.91917 6.58754 5.80977C6.69694 5.70037 6.84531 5.63892 7.00002 5.63892C7.15473 5.63892 7.3031 5.70037 7.4125 5.80977C7.52189 5.91917 7.58335 6.06754 7.58335 6.22225V10.1111C7.58134 10.2652 7.51923 10.4124 7.41027 10.5214C7.30131 10.6304 7.1541 10.6925 7.00002 10.6945Z",fill:"currentColor"}))}));_D.displayName="InfoCircleIcon";function y7(){return y7=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},y7.apply(null,arguments)}var A7=b.memo(b.forwardRef(function(t,e){var n=ri.getPTI(t);return b.createElement("svg",y7({ref:e,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 14C5.61553 14 4.26215 13.5895 3.11101 12.8203C1.95987 12.0511 1.06266 10.9579 0.532846 9.67879C0.00303296 8.3997 -0.13559 6.99224 0.134506 5.63437C0.404603 4.2765 1.07129 3.02922 2.05026 2.05026C3.02922 1.07129 4.2765 0.404603 5.63437 0.134506C6.99224 -0.13559 8.3997 0.00303296 9.67879 0.532846C10.9579 1.06266 12.0511 1.95987 12.8203 3.11101C13.5895 4.26215 14 5.61553 14 7C14 8.85652 13.2625 10.637 11.9497 11.9497C10.637 13.2625 8.85652 14 7 14ZM7 1.16667C5.84628 1.16667 4.71846 1.50879 3.75918 2.14976C2.79989 2.79074 2.05222 3.70178 1.61071 4.76768C1.16919 5.83358 1.05367 7.00647 1.27876 8.13803C1.50384 9.26958 2.05941 10.309 2.87521 11.1248C3.69102 11.9406 4.73042 12.4962 5.86198 12.7212C6.99353 12.9463 8.16642 12.8308 9.23232 12.3893C10.2982 11.9478 11.2093 11.2001 11.8502 10.2408C12.4912 9.28154 12.8333 8.15373 12.8333 7C12.8333 5.45291 12.2188 3.96918 11.1248 2.87521C10.0308 1.78125 8.5471 1.16667 7 1.16667ZM4.66662 9.91668C4.58998 9.91704 4.51404 9.90209 4.44325 9.87271C4.37246 9.84333 4.30826 9.8001 4.2544 9.74557C4.14516 9.6362 4.0838 9.48793 4.0838 9.33335C4.0838 9.17876 4.14516 9.0305 4.2544 8.92113L6.17553 7L4.25443 5.07891C4.15139 4.96832 4.09529 4.82207 4.09796 4.67094C4.10063 4.51982 4.16185 4.37563 4.26872 4.26876C4.3756 4.16188 4.51979 4.10066 4.67091 4.09799C4.82204 4.09532 4.96829 4.15142 5.07887 4.25446L6.99997 6.17556L8.92106 4.25446C9.03164 4.15142 9.1779 4.09532 9.32903 4.09799C9.48015 4.10066 9.62434 4.16188 9.73121 4.26876C9.83809 4.37563 9.89931 4.51982 9.90198 4.67094C9.90464 4.82207 9.84855 4.96832 9.74551 5.07891L7.82441 7L9.74554 8.92113C9.85478 9.0305 9.91614 9.17876 9.91614 9.33335C9.91614 9.48793 9.85478 9.6362 9.74554 9.74557C9.69168 9.8001 9.62748 9.84333 9.55669 9.87271C9.4859 9.90209 9.40996 9.91704 9.33332 9.91668C9.25668 9.91704 9.18073 9.90209 9.10995 9.87271C9.03916 9.84333 8.97495 9.8001 8.9211 9.74557L6.99997 7.82444L5.07884 9.74557C5.02499 9.8001 4.96078 9.84333 4.88999 9.87271C4.81921 9.90209 4.74326 9.91704 4.66662 9.91668Z",fill:"currentColor"}))}));A7.displayName="TimesCircleIcon";function w7(){return w7=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},w7.apply(null,arguments)}function S7(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Wee(t){if(Array.isArray(t))return S7(t)}function Qee(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function DD(t,e){if(t){if(typeof t=="string")return S7(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S7(t,e):void 0}}function Jee(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1602
1602
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x7(t){return Wee(t)||Qee(t)||DD(t)||Jee()}function Zee(t){if(Array.isArray(t))return t}function ete(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function tte(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1603
1603
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function C7(t,e){return Zee(t)||ete(t,e)||DD(t,e)||tte()}function r2(t){"@babel/helpers - typeof";return r2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r2(t)}function nte(t,e){if(r2(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(r2(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function rte(t){var e=nte(t,"string");return r2(e)=="symbol"?e:e+""}function Lo(t,e,n){return(e=rte(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ite=`
1604
1604
  @layer primereact {
@@ -2378,7 +2378,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2378
2378
  }
2379
2379
  }
2380
2380
  `}}),ci=b.forwardRef(function(t,e){var n=zn(),r=b.useContext(nr),i=d4.getProps(t,r),a=b.useState(i.id),s=bO(a,2),l=s[0],c=s[1],u=b.useState(i.collapsed),d=bO(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",S=l+"_content",T=d4.setMetaData({props:i,state:{id:l,collapsed:m}}),w=T.ptm,E=T.cx,x=T.isUnstyled;hi(d4.css.styles,x,{name:"panel"});var I=function(G){i.toggleable&&(m?_(G):O(G),G&&(i.onToggle&&i.onToggle({originalEvent:G,value:!m}),G.preventDefault()))},_=function(G){i.onToggle||h(!1),i.onExpand&&G&&i.onExpand(G)},O=function(G){i.onToggle||h(!0),i.onCollapse&&G&&i.onCollapse(G)};b.useImperativeHandle(e,function(){return{props:i,toggle:I,expand:_,collapse:O,getElement:function(){return g.current},getContent:function(){return v.current}}}),Pi(function(){l||c(el())});var B=function(){if(i.toggleable){var G=l+"_label",ce=n({className:E("toggler"),onClick:I,id:G,"aria-controls":S,"aria-expanded":!m,type:"button",role:"button","aria-label":i.header},w("toggler")),K=n(w("togglericon")),ge=m?i.expandIcon||b.createElement(A3,K):i.collapseIcon||b.createElement(K8,K),te=Wn.getJSXIcon(ge,K,{props:i,collapsed:m});return b.createElement("button",ce,te,b.createElement(en,null))}return null},M=function(){var G=Fe.getJSXElement(i.header,i),ce=Fe.getJSXElement(i.icons,i),K=B(),ge=n({id:A,className:E("title")},w("title")),te=b.createElement("span",ge,G),ee=n({className:E("icons")},w("icons")),Y=b.createElement("div",ee,ce,K),J=n({className:E("header")},w("header")),he=b.createElement("div",J,te,Y);if(i.headerTemplate){var be={className:"p-panel-header",titleClassName:"p-panel-title",iconsClassName:"p-panel-icons",togglerClassName:"p-panel-header-icon p-panel-toggler p-link",onTogglerClick:I,titleElement:te,iconsElement:Y,togglerElement:K,element:he,id:l+"_header",props:i,collapsed:m};return Fe.getJSXElement(i.headerTemplate,be)}else if(i.header||i.toggleable)return he;return null},V=function(){var G=Fe.getJSXElement(i.footer,i),ce=n({className:E("footer")},w("footer")),K=b.createElement("div",ce,G);if(i.footerTemplate){var ge={className:E("footer"),element:K,props:i};return Fe.getJSXElement(i.footerTemplate,ge)}else if(i.footer)return K;return null},$=function(){var G=n({ref:v,className:E("toggleableContent"),"aria-hidden":m,role:"region",id:S,"aria-labelledby":A},w("toggleablecontent")),ce=n({className:E("content")},w("content")),K=n({classNames:E("transition"),timeout:{enter:1e3,exit:450},in:!m,unmountOnExit:!0,options:i.transitionOptions},w("transition"));return b.createElement(tl,hb({nodeRef:v},K),b.createElement("div",G,b.createElement("div",ce,i.children)))},k=n({id:l,ref:g,style:i.style,className:ft(i.className,E("root"))},d4.getOtherProps(i),w("root")),z=M(),le=$(),fe=V();return b.createElement("div",k,z,le,fe)});ci.displayName="Panel";const Xoe=t=>{var v;const{fieldState:e,setFieldState:n,pageIndex:r,formBuilderFormLayout:i,pageSettingUpdate:a}=t,s=(m,A)=>{const S=`${m.className} justify-content-start`,T=`${m.titleClassName} pl-1`;return o.jsxs("div",{className:S,children:[o.jsx(Ft,{text:!0,icon:"pi pi-trash",className:m.togglerClassName,onClick:()=>c(A),"aria-label":"Submit"}),o.jsx("span",{className:T,children:`Rule ${A+1}`})]})},l=(m,A)=>{var T;const S=[...((T=e==null?void 0:e.conditionalTabRules)==null?void 0:T.rules)||[]];S[m].conditions=S[m].conditions.filter((w,E)=>A!==E),n(w=>({...w,conditionalTabRules:{...w.conditionalTabRules,rules:S}}))},c=m=>{var w;const A=[...(e==null?void 0:e.conditionalTabRules.rules)||[]],S=A.filter((E,x)=>m!==x);n(E=>({...E,conditionalTabRules:{...E.conditionalTabRules,rules:S}}));const T=A[m];(w=T==null?void 0:T.conditions)==null||w.map(E=>{const x=i?_t.findIndex(i,_=>{var O;return(_==null?void 0:_.uuid)===((O=E==null?void 0:E.tab)==null?void 0:O.uuid)}):-1,I=i[x];I&&(I.isHidden=!1,a(x,I))})};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,S)=>{const T=[...(e==null?void 0:e.conditionalTabRules.rules)||[]];T[A].conditions[S].option=m==null?void 0:m.value,n(w=>({...w,conditionalTabRules:{...w.conditionalTabRules,rules:T}}))},f=(m,A,S)=>{const T=[...(e==null?void 0:e.conditionalTabRules.rules)||[]];T[A].conditions[S].tab=m==null?void 0:m.value,n(x=>({...x,conditionalTabRules:{...x.conditionalTabRules,rules:T}}));const w=_t.findIndex(i,x=>{var I;return(x==null?void 0:x.uuid)===((I=m==null?void 0:m.value)==null?void 0:I.uuid)}),E=i[w];E&&(E.isHidden=!0,a(w,E))},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(S=>({...S,conditionalTabRules:{...S.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(ci,{className:"mb-3",header:`Rule ${A+1}`,headerTemplate:S=>s(S,A),children:o.jsxs("div",{children:[m==null?void 0:m.conditions.map((S,T)=>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",S.value]})}),o.jsx("div",{className:"col-3 p-fluid",children:o.jsx(Oa,{value:S.tab,options:u,onChange:w=>f(w,A,T),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(Oa,{value:S==null?void 0:S.option,options:e==null?void 0:e.options,onChange:w=>d(w,A,T),optionLabel:"optionText.english",placeholder:"Select option"})}),o.jsx("div",{className:"col-1",children:o.jsx(Ft,{text:!0,icon:"pi pi-trash",className:"p-button-danger button-sm",tooltip:"Field Settings",onClick:()=>l(A,T),tooltipOptions:{position:"top"}})})]})},T)),o.jsx(Ft,{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(Ft,{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"})]})},Roe=t=>{var w;const{fieldState:e,setFieldState:n,section:r,formBuilderFormLayout:i,sectionSettingUpdate:a,page:s}=t,[l]=P.useState([]),{schemaBuilderUpdate:c,formBuilderFormSchema:u}=un(),d=(E,x)=>{const I=`${E.className} justify-content-start`,_=`${E.titleClassName} pl-1`;return o.jsxs("div",{className:I,children:[o.jsx(Ft,{text:!0,icon:"pi pi-trash",className:E.togglerClassName,onClick:()=>f(x),"aria-label":"Submit"}),o.jsx("span",{className:_,children:`Rule ${x+1}`})]})},f=E=>{var O;const x=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]],I=x[E];(O=I==null?void 0:I.conditions)==null||O.map(B=>{var $;const M=_t.findIndex(i,k=>{var z;return(k==null?void 0:k.uuid)===((z=B==null?void 0:B.tab)==null?void 0:z.uuid)}),V=i?_t.findIndex(i[M].children,k=>{var z;return(k==null?void 0:k.uuid)===((z=B==null?void 0:B.section)==null?void 0:z.uuid)}):-1;if(V>=0){const k=($=i[M])==null?void 0:$.children[V];k&&(k.isHidden=!1,a(M,V,k))}});const _=x.filter((B,M)=>E!==M);n(B=>({...B,conditionalSectionRules:{...B.conditionalSectionRules,rules:_}}))},h=E=>{var _;let x=!1;const I=i?i.filter(function(O){return(O==null?void 0:O.uuid)===(E==null?void 0:E.uuid)}):[];return(I==null?void 0:I.length)>0&&((_=I[0].children)==null?void 0:_.length)>1&&(x=!0),x},g=(E,x,I)=>{const _=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];_[x].conditions[I].option=E==null?void 0:E.value,n(O=>({...O,conditionalSectionRules:{...O.conditionalSectionRules,rules:_}}))},v=(E,x)=>{var O;const I=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]],_=I[E];(O=_==null?void 0:_.conditions)==null||O.map(B=>{var k;const M=_t.findIndex(i,z=>{var le;return(z==null?void 0:z.uuid)===((le=B==null?void 0:B.tab)==null?void 0:le.uuid)}),V=i?_t.findIndex(i[M].children,z=>{var le;return(z==null?void 0:z.uuid)===((le=B==null?void 0:B.section)==null?void 0:le.uuid)}):-1,$=(k=i[M])==null?void 0:k.children[V];console.log("sectionData",$),$&&($.isHidden=!1,console.log("sectionData",$),a(M,V,$))}),I[E].conditions=I[E].conditions.filter((B,M)=>x!==M),n(B=>({...B,conditionalSectionRules:{...B.conditionalSectionRules,rules:I}}))},m=(E,x,I)=>{var $,k;const _=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];_[x].conditions[I].section=E==null?void 0:E.value;const O=(k=($=_[x].conditions[I])==null?void 0:$.tab)==null?void 0:k.uuid,B=_t.findIndex(i,z=>(z==null?void 0:z.uuid)===O);n(z=>({...z,conditionalSectionRules:{...z.conditionalSectionRules,rules:_}}));const M=i?_t.findIndex(i[B].children,z=>{var le;return(z==null?void 0:z.uuid)===((le=E==null?void 0:E.value)==null?void 0:le.uuid)}):-1,V=i[B].children[M];V&&(V.isHidden=!0,a(B,M,V))},A=E=>{const x=[...(e==null?void 0:e.conditionalSectionRules.rules)||[]];x[E].conditions=[...x[E].conditions,{option:null,tab:{title:s==null?void 0:s.title,uuid:s==null?void 0:s.uuid},section:null}],n(I=>({...I,conditionalSectionRules:{...I.conditionalSectionRules,rules:x}}))},S=()=>{n(x=>({...x,conditionalSectionRules:{...x.conditionalSectionRules,rules:[...x.conditionalSectionRules.rules,{uuid:et(),conditions:[]}]}}));const E=[...(u==null?void 0:u.conditionalSectionsRules)||[]];c({conditionalSectionsRules:[...E,{fieldId:e==null?void 0:e.uuid,uuid:et(),conditions:[]}]})},T=E=>{var I;const x=i==null?void 0:i.filter(function(_){return(_==null?void 0:_.uuid)===(E==null?void 0:E.uuid)});if(x&&(x==null?void 0:x.length)>0){const _=(I=x[0])==null?void 0:I.children.filter(function(O){return(O==null?void 0:O.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"}),(w=e==null?void 0:e.conditionalSectionRules)==null?void 0:w.rules.map((E,x)=>o.jsx(ci,{className:"mb-3",header:`Rule ${x+1}`,headerTemplate:I=>d(I,x),children:o.jsxs("div",{children:[E==null?void 0:E.conditions.map((I,_)=>{var O,B;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:(B=(O=I==null?void 0:I.tab)==null?void 0:O.title)==null?void 0:B.english})]}),o.jsxs("div",{className:"col-3 p-fluid",children:[o.jsxs("label",{children:["Select section",I.value]}),o.jsx(Oa,{disabled:!h(I==null?void 0:I.tab),value:I.section,options:T(I.tab),onChange:M=>m(M,x,_),optionLabel:"heading.english",placeholder:"Select option"})]}),o.jsxs("div",{className:"col-4 p-fluid",children:["when option is selected",o.jsx(Oa,{disabled:!h(I==null?void 0:I.tab),value:I==null?void 0:I.option,options:e==null?void 0:e.options,onChange:M=>g(M,x,_),optionLabel:"optionText.english",placeholder:"Select option"})]}),o.jsxs("div",{className:"col-1",children:[o.jsx("br",{}),o.jsx(Ft,{text:!0,icon:"pi pi-trash",className:"p-button-danger button-sm",tooltip:"Field Settings",onClick:()=>v(x,_),tooltipOptions:{position:"top"}})]}),!h(I.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(Ft,{text:!0,className:"btn-sm mt-3 ",label:"+ Add Condition",onClick:()=>A(x),size:"small"})})})]})},x)),o.jsx(Ft,{text:!0,icon:"pi pi-plus",onClick:()=>S(),className:"p-mt-4",label:"Add Rule",size:"small"})]})},Goe=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(Ft,{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(ci,{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(Oa,{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(Ft,{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(Ft,{text:!0,onClick:()=>l(f),className:"p-mt-4",icon:"pi pi-plus",label:"Add Condition",size:"small"})]})},f)),o.jsx(Ft,{text:!0,onClick:()=>c(),className:"p-mt-4",icon:"pi pi-plus",label:"Add Rule",size:"small"})]})},Woe=t=>{const{fieldState:e,pageIndex:n,section:r,setFieldState:i,page:a}=t,{pageSettingUpdate:s,formBuilderFormLayout:l,sectionSettingUpdate:c}=un();return o.jsx(o.Fragment,{children:o.jsxs("div",{className:" scroll-height-250",children:[o.jsx(Goe,{fieldState:e,setFieldState:i}),o.jsx("hr",{}),o.jsx(Xoe,{fieldState:e,setFieldState:i,pageIndex:n,formBuilderFormLayout:l,pageSettingUpdate:s}),o.jsx("hr",{}),o.jsx(Roe,{fieldState:e,setFieldState:i,section:r,formBuilderFormLayout:l,sectionSettingUpdate:c,page:a}),o.jsx("hr",{})]})})},Qoe=t=>{const{fieldState:e,setFieldState:n}=t,[r,i]=P.useState(""),[a,s]=P.useState([""]),[l,c]=P.useState(!1),[u,d]=P.useState(0),[f,h]=P.useState(!1),{updateGlobalToast:g}=tn(),v=()=>{h(!0)},m=()=>{var z;const $=((z=e==null?void 0:e.reviewerChecklist)==null?void 0:z.length)>=0?[...e.reviewerChecklist]:[];$.push({uuid:et(),checklist:r,action:a,agree:null,selectAction:[],other:{isOther:!1,description:""},reviewerComments:""});const k={...e,reviewerChecklist:$};n(le=>({...le,...k})),h(!1),i(""),s([""])},A=()=>{h(!1),i(""),s([""])},S=$=>{const k=[...e.reviewerChecklist];k.splice($,1);const z={...e,reviewerChecklist:k};n(le=>({...le,...z}))},T=($,k)=>{c(!0);const{checklist:z,action:le}=$;h(!0),d(k),setTimeout(()=>{i(z),s(le)},1e3)},w=($,k)=>o.jsxs(o.Fragment,{children:[o.jsx(Ft,{text:!0,type:"button",className:"p-button-info",icon:"pi pi-pencil",onClick:()=>T($,k==null?void 0:k.rowIndex)}),o.jsx(Ft,{text:!0,type:"button",className:"p-button-danger",icon:"pi pi-trash",onClick:()=>S(k==null?void 0:k.rowIndex)})]}),E=$=>{var k;return o.jsx(o.Fragment,{children:(k=$==null?void 0:$.action)==null?void 0:k.length})},x=$=>{const k=[...a];k.splice($,1),s(k)},I=()=>{const $=[...e.reviewerChecklist];$[u]={checklist:r,action:a};const k={...e,reviewerChecklist:$};n(z=>({...z,...k})),h(!1),c(!1)},_=()=>o.jsx("div",{children:l?o.jsx(Ft,{text:!0,className:"mb-5 p-button-success",label:"Edit Checklist",onClick:()=>{I()}}):o.jsx(Ft,{text:!0,className:"mb-5 p-button-success",label:"Add Checklist",onClick:()=>{m()}})}),O=$=>{n(k=>({...k,reviewerChecklist:$==null?void 0:$.value}))},B=$=>{navigator.clipboard.writeText(JSON.stringify($))};function M($){try{JSON.parse($)}catch{return!1}return!0}const V=async()=>{var z;const $=await navigator.clipboard.readText();let k="";if(M($)){const le=JSON.parse($);if((z=le[0])!=null&&z.checklist){const fe={..._t.cloneDeep(e),reviewerChecklist:le};n(Z=>({...Z,...fe}));return}else k="Empty or Invalid Schema"}else k="Invalid Schema";g({showToast:!0,toastMessage:k,toastDetail:"",toastType:"error"})};return o.jsxs("div",{children:[o.jsx(Ts,{maximizable:!0,header:"Add Checklist",visible:f,style:{width:"30vw"},onHide:()=>A(),footer:_(),children:o.jsxs("div",{className:"scroll-height-500",children:[o.jsx("h5",{children:"Checklist"}),o.jsx(ks,{rows:2,cols:50,value:r,onChange:$=>{var k;i((k=$==null?void 0:$.target)==null?void 0:k.value)}}),o.jsx("h5",{children:"Actions when user selects No"}),a.map(($,k)=>o.jsxs("div",{children:[k+1,"."," ",o.jsx(ks,{value:$,onChange:z=>{var fe;const le=[...a];le[k]=(fe=z==null?void 0:z.target)==null?void 0:fe.value,s(le)},rows:2,cols:50})," ",o.jsx(Ft,{text:!0,type:"button",icon:"pi pi-trash",className:"p-button-danger",onClick:()=>x(k)}),o.jsx("br",{}),o.jsx("br",{})]},`actionIndex-${k}`)),o.jsx(Ft,{text:!0,className:" p-button-info mr-2",onClick:()=>{s([...a,""])},children:"Add Action"})]})})," ",o.jsx("h5",{children:"Reviewer Checklist"}),o.jsx(Ft,{text:!0,className:"mb-5 mr-2 p-button-success",label:"Add Review Checklist",onClick:()=>{v()}}),o.jsx(Ft,{text:!0,label:"Copy Schema ",onClick:()=>{B([...(e==null?void 0:e.reviewerChecklist)||[]])},className:"mb-5 mr-2"}),o.jsx(Ft,{text:!0,label:"Paste Checklist ",onClick:()=>{V()},className:"mb-5 p-button-info"}),o.jsx("div",{className:"card",children:o.jsxs(Ks,{value:e==null?void 0:e.reviewerChecklist,reorderableRows:!0,onRowReorder:O,scrollable:!0,children:[o.jsx(dr,{rowReorder:!0,style:{width:"3em"}}),o.jsx(dr,{field:"checklist",header:"Checklist"}),o.jsx(dr,{field:"actions",header:"Actions",body:$=>E($)}),o.jsx(dr,{header:"",body:($,k)=>w($,k)})]})})]})},Joe=t=>{const{onHandleChangeLayoutSettings:e,fieldState:n}=t;return o.jsxs("form",{className:"p-fluid",children:[o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Br,{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(sn,{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(Br,{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(sn,{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(Br,{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(sn,{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(Br,{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(sn,{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(Br,{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(sn,{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(Br,{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(sn,{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(Br,{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(sn,{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}})]})]})},Zoe=t=>{var c,u,d;const{fieldState:e,setFieldState:n}=t,{formBuilderSchemaLanguages:r}=un(),i=()=>{n(f=>Object.assign({},f,{options:[...f.options,{uuid:et(),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(aa,{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(aa,{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(aa,{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(aa,{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(Oa,{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(Oa,{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(fo,{activeIndex:0,children:r!=null&&r.length?r.map((f,h)=>o.jsx(uo,{tabIndex:h,header:f==null?void 0:f.language,children:o.jsx(mO,{enableCopyPaste:!0,isCustomValue:!0,fieldState:e,setFieldState:n,language:f})},h)):""})}),o.jsx(Ft,{text:!0,className:"mr-3",label:"Add",icon:"pi pi-plus",onClick:()=>i(),"aria-label":"Add"})]})})]})},ele=t=>{var u,d;const{option:e,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a}=t,{userSelectedLanguage:s}=un(),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(Ft,{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(Br,{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(Ft,{text:!0,label:"Add Field",onClick:()=>{i(e==null?void 0:e.uuid)}}),o.jsx(Za,{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(fr,{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(aa,{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(Br,{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(Za,{children:[o.jsx(fr,{header:"Text",children:o.jsx(ci,{header:"Text Settings",toggleable:!0,collapsed:!0,children:o.jsx("div",{className:"",children:o.jsx(fN,{language:s,fieldState:f,onHandleChange:(m,A,S)=>{r(f==null?void 0:f.uuid,{[m]:{[A==null?void 0:A.type]:S}})}})})})}),(f==null?void 0:f.type)==="radio"&&o.jsx(fr,{header:"Radio",children:o.jsx("div",{style:{width:"100%"},children:o.jsx(pb,{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}`)}))})]})]})},pb=t=>{var s,l;const{fieldState:e,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a}=t;return o.jsx(o.Fragment,{children:o.jsx(Za,{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(fr,{header:`Option - ${c==null?void 0:c.label}`,children:o.jsx(ele,{option:c,updateCondtionOption:n,updateChildrenField:r,addChildrenField:i,removeChildrenField:a})},`hirarchey-option-${u}`)))})})};var yO={},tle=Di&&Di.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var 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)}}(),f4=Di&&Di.__assign||function(){return f4=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},f4.apply(this,arguments)},nle=Di&&Di.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),rle=Di&&Di.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),AO=Di&&Di.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&nle(e,t,n);return rle(e,t),e},ile=Di&&Di.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},ale=Di&&Di.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(yO,"__esModule",{value:!0});var gb=AO(P),sle=ale(R_),hd=AO(ua);function wO(t){return t&&t.replace(/&nbsp;|\u202F|\u00A0/g," ").replace(/<br \/>/g,"<br>")}function ole(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 lle=function(t){tle(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}:gb.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=ile(r,["tagName","html","innerRef"]);return gb.createElement(i||"div",f4(f4({},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||wO(n.html)!==wO(i.innerHTML)?!0:r.disabled!==n.disabled||r.tagName!==n.tagName||r.className!==n.className||r.innerRef!==n.innerRef||r.placeholder!==n.placeholder||!(0,sle.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,ole(n))},e.propTypes={html:hd.string.isRequired,onChange:hd.func,disabled:hd.bool,tagName:hd.string,className:hd.string,style:hd.object,innerRef:hd.oneOfType([hd.object,hd.func])},e}(gb.Component),h4=yO.default=lle;const cle=t=>{var S;const e=P.useRef(null),{field:n,fieldIndex:r,pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,path:c}=t,[u,d]=P.useState(n),{userSelectedLanguage:f,fieldSettingUpdate:h,fieldSettingUpdateInlineConditional:g,gridComponentFieldSettingUpdate:v}=un(),m=(T,w,E)=>{d(x=>({...x,[T]:{...x[T],[w==null?void 0:w.type]:E}}))};P.useEffect(()=>(A(),()=>{}),[u]);const A=()=>{const T=c.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?g(T[ma],T[va],T[xa],T[Ca],T[Ta],T[Na],T[Zo],T[Fo],u):(T==null?void 0:T.length)>Na&&(T==null?void 0:T.length)===tc+1&&(n!=null&&n.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?v(T[ma],T[va],T[xa],T[Ca],T[Ta],T[5],T[6],T[7],u):h(i,a,s,l,r,{...n,label:u==null?void 0:u.label})};return o.jsx(o.Fragment,{children:o.jsx(h4,{style:{display:"inline-block"},className:"builder-input-label-edit",innerRef:e,html:(S=n==null?void 0:n.label)==null?void 0:S[f==null?void 0:f.type],disabled:!1,onChange:T=>{var w;m("label",f,(w=T==null?void 0:T.target)==null?void 0:w.value)},tagName:"article"})})},da=t=>{const{sectionIndex:e,fieldIndex:n}=t,{formBuilderFormSchema:r}=un();return(r==null?void 0:r.enableFieldEnumeration)===!0?o.jsx("span",{className:"mr-2",children:o.jsx(k7,{classes:"font-medium p-1 bg-primary",level:"purple",value:`${e+1}.${n+1}`})}):o.jsx(o.Fragment,{})},mb=t=>{var d,f,h,g,v,m,A,S,T,w,E,x,I,_;const{field:e,update:n,value:r,isFirst:i,isDisabled:a}=t,{isPreview:s}=tn(),{userSelectedLanguage:l}=un(),[c,u]=P.useState(0);return P.useEffect(()=>{const O=Jt.addListener("onSubmitUserForm",()=>{var M;(M=e==null?void 0:e.attributes)!=null&&M.required?r!=null&&r[e.uuid]?e.isValid=1:e.isValid=0:e.isValid=1}),B=Jt.addListener("OnInvalidFieldCatch",M=>{(e==null?void 0:e.uuid)===(M==null?void 0:M.fieldId)?u(1):u(0)});return()=>{O.remove(),B.remove()}}),o.jsxs("div",{className:"ml-3 p-2",children:[(e==null?void 0:e.type)==="radio"&&o.jsxs(o.Fragment,{children:[o.jsxs("h5",{children:[" ",i===!0&&o.jsx(da,{...t}),((d=e==null?void 0:e.attributes)==null?void 0:d.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",s?o.jsx(o.Fragment,{children:(f=e==null?void 0:e.label)==null?void 0:f[l==null?void 0:l.type]}):o.jsx(cle,{...t})]}),((h=e==null?void 0:e.options)==null?void 0:h.length)&&((g=e==null?void 0:e.options)==null?void 0:g.map(O=>{var B,M;return o.jsxs("div",{children:[o.jsxs("div",{className:"flex align-items-center mb-2",children:[o.jsx(aa,{inputId:O.uuid,name:e==null?void 0:e.uuid,value:O.uuid,onChange:V=>n(e==null?void 0:e.uuid,V==null?void 0:V.value),checked:(r==null?void 0:r[e.uuid])===O.uuid,disabled:a}),o.jsx("label",{htmlFor:O.uuid,className:"ml-2",children:O.label})]}),(O==null?void 0:O.enableConditionalField)===!0&&(r==null?void 0:r[e==null?void 0:e.uuid])===(O==null?void 0:O.uuid)&&(O==null?void 0:O.children)&&((B=O==null?void 0:O.children)==null?void 0:B.length)>0&&((M=O==null?void 0:O.children)==null?void 0:M.map(()=>o.jsx(mb,{...t},`radio_child_${r==null?void 0:r[e==null?void 0:e.uuid]}`)))]},`${O.uuid}-radio-wrapper-${e==null?void 0:e.uuid}`)}))]}),(e==null?void 0:e.type)==="text"&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((v=e==null?void 0:e.attributes)==null?void 0:v.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[l==null?void 0:l.type]]}),o.jsx(bn,{className:"mt-2",onChange:O=>{var B;return n(e==null?void 0:e.uuid,(B=O==null?void 0:O.target)==null?void 0:B.value)},value:r==null?void 0:r.uuid,placeholder:(m=e==null?void 0:e.placeholder)==null?void 0:m[l==null?void 0:l.type]})]})}),(e==null?void 0:e.type)==="date"&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((A=e==null?void 0:e.attributes)==null?void 0:A.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[l==null?void 0:l.type]]}),o.jsx(If,{className:"mt-2",onChange:O=>{var B;return n(e==null?void 0:e.uuid,(B=O==null?void 0:O.target)==null?void 0:B.value)},value:r==null?void 0:r.uuid,placeholder:(S=e==null?void 0:e.placeholder)==null?void 0:S[l==null?void 0:l.type]})]})}),(e==null?void 0:e.type)==="text-area"&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"card p-fluid",children:[o.jsxs("label",{htmlFor:"",children:[" ",((T=e==null?void 0:e.attributes)==null?void 0:T.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e==null?void 0:e.label[l==null?void 0:l.type]]}),o.jsx(ks,{className:"mt-2",onChange:O=>{var B;return n(e==null?void 0:e.uuid,(B=O==null?void 0:O.target)==null?void 0:B.value)},value:r==null?void 0:r.uuid,placeholder:(w=e==null?void 0:e.placeholder)==null?void 0:w[l==null?void 0:l.type]})]})}),o.jsx("div",{children:((E=e==null?void 0:e.helperText)==null?void 0:E[l==null?void 0:l.type])!==""&&o.jsx("small",{children:(x=e==null?void 0:e.helperText)==null?void 0:x[l==null?void 0:l.type]})}),o.jsx("div",{children:((I=e==null?void 0:e.attributes)==null?void 0:I.required)&&o.jsx("small",{className:"error",children:c===1&&!(r!=null&&r[e.uuid])?(_=e==null?void 0:e.validationMesssage)==null?void 0:_.language:""})})]},`${e==null?void 0:e.uuid}-radio`)},ule=t=>{const{hirarechicalRadioSchemaState:e}=t,[n,r]=P.useState({});return o.jsx("div",{children:o.jsx(mb,{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:""})})},vb={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},dle={uuid:et(),...vb,type:"radio",value:null,options:[{uuid:et(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:et(),label:"No",value:null,enableConditionalField:!0,children:[]}]};({uuid:et(),...vb,options:(et(),{uuid:et(),...vb,options:(et(),et())},et())});const fle=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,{...dle,isValid:0,uuid:et(),options:[{uuid:et(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:et(),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(pb,{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(ule,{hirarechicalRadioSchemaState:e})]})]})})})},Wi=t=>{var te,ee;const{formBuilderFormSchema:e,fieldSettingUpdate:n,fieldSettingUpdateInlineConditional:r,formBuilderSchemaLanguages:i,pageSettingUpdate:a,formBuilderFormLayout:s,formBuilderPublishedStatus:l,gridComponentFieldSettingUpdate:c}=un(),{renderType:u}=tn(),{visibilty:d,field:f,closeSettingFieldSidebar:h,pageIndex:g,sectionIndex:v,rowIndex:m,columnIndex:A,fieldIndex:S,path:T,row:w}=t,{updateGlobalToast:E}=tn(),[x,I]=P.useState(f),_=T.split("-"),O=()=>{const Y=T.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?r(Y[ma],Y[va],Y[xa],Y[Ca],Y[Ta],Y[Na],Y[Zo],Y[Fo],x):(Y==null?void 0:Y.length)>Na&&(Y==null?void 0:Y.length)===tc+1&&(x!=null&&x.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?c(Y[ma],Y[va],Y[xa],Y[Ca],Y[Ta],Y[5],Y[6],Y[7],x):(n(g,v,m,A,S,x),setTimeout(()=>{Jt.emit("OnSignatureSettingChange",{})},1e3),setTimeout(()=>{Jt.emit("onUpdateField",{})},1e3)),E({showToast:!0,toastMessage:"Updated",toastDetail:"Field Updated",toastType:"success"})},B=(Y,J,he)=>{I(be=>({...be,[Y]:{...be[Y],[J==null?void 0:J.type]:he}}))},M=(Y,J)=>{I(he=>({...he,attributes:{...he.attributes,[Y]:J}}))},V=(Y,J)=>{I(he=>({...he,[Y]:J}))},$=(Y,J)=>{I(he=>({...he,inlineConditional:{...he.inlineConditional,[Y]:J}}))},k=()=>{},z=()=>{I(Y=>({...Y,data:[...Y.data,{uuid:et(),dataKey:"",value:""}]}))},le=()=>{I(Y=>Object.assign({},Y,{options:[...Y.options,{uuid:et(),optionText:{english:""},value:"",score:0,hyperlinkText:{english:""},abbreviationText:{english:""},custom_values:{}}]}))},fe=()=>{},Z=()=>{},G=()=>{},ce=()=>{},K=Y=>{var Ee;const J=[...(x==null?void 0:x.conditionalTabRules.rules)||[]],he=J.filter((ye,Ae)=>Y!==Ae);I(ye=>({...ye,conditionalTabRules:{...ye.conditionalTabRules,rules:he}}));const be=J[Y];(Ee=be==null?void 0:be.conditions)==null||Ee.map(ye=>{const Ae=_t.findIndex(s,U=>{var re;return(U==null?void 0:U.uuid)===((re=ye==null?void 0:ye.tab)==null?void 0:re.uuid)}),ne=s[Ae];ne&&(ne.isHidden=!1,a(Ae,ne))})},ge=(Y,J)=>{const he=[...(x==null?void 0:x.conditionalTabRules.rules)||[]];he[Y].conditions=he[Y].conditions.filter((be,Ee)=>J!==Ee),I(be=>({...be,conditionalTabRules:{...be.conditionalTabRules,rules:he}}))};return o.jsx(o.Fragment,{children:o.jsxs(Vo,{style:{width:"80vw",zIndex:7e3},visible:d,position:"left",className:"p-sidebar-lg",onHide:()=>h(),children:[o.jsxs("div",{className:"flex justify-content-between flex-wrap card-container ",children:[o.jsxs("div",{className:"flex align-items-center justify-content-center ",children:[" ",o.jsxs("h5",{className:"mb-0",children:[(te=f==null?void 0:f.label)==null?void 0:te.english," "]})]}),!l&&o.jsx("div",{className:"flex align-items-center justify-content-center",children:o.jsx(Ft,{className:"mt-3",label:"Update",onClick:()=>O(),"aria-label":"Update"})})]}),o.jsx("div",{className:" mt-4",children:o.jsxs(Za,{children:[o.jsx(fr,{header:"Text",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(fo,{activeIndex:0,children:i!=null&&i.length?i.map((Y,J)=>o.jsx(uo,{tabIndex:J,header:Y==null?void 0:Y.language,children:o.jsx(fN,{language:Y,fieldState:x,onHandleChange:B,...t})},J)):""})})}),(x==null?void 0:x.isValidationTabEnabled)===!0&&o.jsx(fr,{header:"Validation",children:o.jsx(Ire,{fieldState:x,onHandleChangeLayoutSettings:V,onHandleChangeAttributesSetttings:M,...t})}),o.jsx(fr,{header:"Attributes",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(_re,{fieldState:x,onHandleChangeLayoutSettings:V,onHandleChangeAttributesSetttings:M})})}),(x==null?void 0:x.isLayoutTabEnabled)===!0&&o.jsx(fr,{header:"Layout",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(Nre,{fieldState:x,onHandleChangeLayoutSettings:V})})}),(x==null?void 0:x.isDynamicListingTabEnabled)===!0&&o.jsx(fr,{header:"Dynamic Options",children:o.jsx("div",{className:"scroll-height-200",children:o.jsx(Zoe,{fieldState:x,setFieldState:I})})}),(x==null?void 0:x.options)!==void 0&&(x==null?void 0:x.data)&&o.jsx(fr,{header:"Data",children:o.jsxs("div",{className:"scroll-height-200",children:[o.jsx(Ore,{onHandleChangeLayoutSettings:V,fieldState:x,setFieldState:I}),o.jsx(Ft,{className:"mr-3",label:"Data Option",icon:"pi pi-plus",onClick:()=>z(),"aria-label":"Add"})]})}),o.jsx(fr,{header:"Table view options",children:o.jsx(Joe,{fieldState:x,onHandleChangeLayoutSettings:V})}),(x==null?void 0:x.componentType)!=="radio-hierarchal"&&(x==null?void 0:x.options)!==void 0&&f.componentType!=="grid-component"&&f.componentType!=="matrix-dropdown"&&f.componentType!=="table"&&o.jsxs(fr,{header:"Options",children:[(x==null?void 0:x.componentType)!=="radio-hierarchal"&&o.jsx("div",{className:"flex justify-content-end",children:o.jsx(Ft,{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(fo,{activeIndex:0,children:i!=null&&i.length?i.map((Y,J)=>o.jsx(uo,{tabIndex:J,header:Y==null?void 0:Y.language,children:o.jsx(mO,{enableAbbreviationColumn:(x==null?void 0:x.componentType)!=="radio-hierarchal",enableHyperTextColumn:(x==null?void 0:x.componentType)!=="radio-hierarchal",enableAddNewColumn:(x==null?void 0:x.componentType)!=="radio-hierarchal",enableCopyPaste:(x==null?void 0:x.componentType)!=="radio-hierarchal",isCustomValue:!1,fieldState:x,setFieldState:I,language:Y})},J)):""}),(x==null?void 0:x.isHierarchalCondionalTabEnabled)===!0&&o.jsx(pb,{fieldState:x,onHandleChangeLayoutSettings:V,removeChildrenField:ce,addChildrenField:G,updateChildrenField:Z,updateCondtionOption:fe})]})]}),(x==null?void 0:x.componentType)==="radio-hierarchal"&&(x==null?void 0:x.options)!==void 0&&f.componentType!=="grid-component"&&f.componentType!=="matrix-dropdown"&&f.componentType!=="table"&&o.jsx(fr,{header:"Hierarchal Options",children:o.jsx(fle,{fieldState:x,setFieldState:I})}),u===O7&&(x==null?void 0:x.inlineConditionalRules)!==void 0&&!(w!=null&&w.rowIsRepeatable)&&(_==null?void 0:_.length)<Fo+1&&o.jsx(fr,{header:"Conditional",children:o.jsx(Woe,{handleRemoveConditionalTabRule:K,handleRemoveConditionalTabRuleCondition:ge,onHandleSelectInlineConditionalOption:k,onHandleChangeLayoutSettings:V,onHandleChangeInlineConditionaltSetttings:$,fieldState:x,setFieldState:I,pageIndex:g,sectionIndex:v,...t})}),!((ee=t==null?void 0:t.row)!=null&&ee.rowIsRepeatable)&&(e==null?void 0:e.enableReviewTask)===!0&&o.jsx(fr,{header:"Admin",children:o.jsx(Qoe,{fieldState:x,setFieldState:I})})]})})]})})},Ni=t=>{const[e,n]=P.useState(null),{field:r}=t,{userTaskSubmitFormData:i,updateUserFormDataSubmit:a}=yr();P.useEffect(()=>{var h,g;if(i!==null&&e===null){let v=0;r!=null&&r.rowIsRepeatable?v=i.findIndex(m=>(m==null?void 0:m.rowId)===(r==null?void 0:r.uuid)):v=i.findIndex(m=>(m==null?void 0:m.fieldId)===(r==null?void 0:r.uuid)),n((h=i[v])!=null&&h.reviewerChecklist?(g=i[v])==null?void 0:g.reviewerChecklist:[])}return()=>{}},[r==null?void 0:r.rowIsRepeatable,r==null?void 0:r.uuid,e,i]);const s=h=>{const g=i.findIndex(m=>(m==null?void 0:m.fieldId)===(r==null?void 0:r.uuid)),v=[...i];v[g]={...v[g],reviewerChecklist:h},a(v)},l=(h,g)=>{const v=e;v[g]={...v[g],agree:h==null?void 0:h.value},n([...v]),s(v)},c=(h,g)=>{const v=e;if(g!=null&&g.checked)v[h].selectAction.push(g==null?void 0:g.value);else{const m=v[h].selectAction.findIndex(A=>A===(g==null?void 0:g.value));v[h].selectAction.splice(m,1)}n([...v]),s(v)},u=(h,g)=>{const v=e;h!=null&&h.checked?v[g]={...v[g],other:{...v[g].other,isOther:!0}}:v[g]={...v[g],other:{...v[g].other,isOther:!1}},n([...v]),s(v)},d=(h,g)=>{var m;const v=e;v[g]={...v[g],other:{...v[g].other,description:(m=h==null?void 0:h.target)==null?void 0:m.value}},n([...v]),s(v)},f=(h,g,v)=>{var A;const m=e;m[v]={...m[v],[g]:(A=h==null?void 0:h.target)==null?void 0:A.value},n([...m]),s(m)};return o.jsx(o.Fragment,{children:o.jsx("div",{className:"col-12",children:o.jsx(Za,{children:o.jsx(fr,{header:"Admin Review",children:o.jsx("div",{className:"grid",children:e!==null&&(e==null?void 0:e.length)>0&&(e==null?void 0:e.map((h,g)=>{var v,m,A,S,T;return o.jsx("div",{className:"col-4 p-fluid p-3",children:o.jsxs("div",{className:"card",children:[o.jsx("h6",{className:"mb-2",children:h==null?void 0:h.checklist}),o.jsx("br",{}),o.jsxs("div",{className:"field-radiobutton",children:[o.jsx(aa,{inputId:`yes-${g}`,name:"action",value:!0,onChange:w=>{l(w,g)},checked:(h==null?void 0:h.agree)===!0}),o.jsx("label",{htmlFor:`yes-${g}`,children:"Yes"})]}),o.jsxs("div",{className:"field-radiobutton",children:[o.jsx(aa,{inputId:`no-${g}`,name:"action",value:!1,onChange:w=>{l(w,g)},checked:(h==null?void 0:h.agree)===!1}),o.jsx("label",{htmlFor:`no-${g}`,children:"No"})]}),(h==null?void 0:h.agree)===!1&&o.jsxs("div",{className:"px-5 mb-3",children:[(h==null?void 0:h.action)&&Array.isArray(h.action)&&((v=h==null?void 0:h.action)==null?void 0:v.length)>0&&((m=h==null?void 0:h.action)==null?void 0:m.map((w,E)=>{var x;return o.jsxs("div",{children:[o.jsx(Br,{value:w,checked:((x=h==null?void 0:h.selectAction)==null?void 0:x.length)>0?h==null?void 0:h.selectAction.some(I=>I===w):!1,onChange:I=>{c(g,I)}})," ",w," ",o.jsx("br",{}),o.jsx("br",{})]},`action-${g}-${E}`)})),o.jsx(Br,{checked:(A=h==null?void 0:h.other)==null?void 0:A.isOther,onChange:w=>{u(w,g)}})," Other ",o.jsx("br",{}),o.jsx("br",{}),((S=h==null?void 0:h.other)==null?void 0:S.isOther)===!0&&o.jsxs("div",{className:"",children:[o.jsx("label",{children:"If other please specify the action point"}),o.jsx("br",{}),o.jsx(ks,{className:"mt-3",value:(T=h==null?void 0:h.other)==null?void 0:T.description,onChange:w=>d(w,g)})]})]}),(h==null?void 0:h.agree)===!1&&o.jsxs("div",{className:"",children:[o.jsx("label",{children:"Reviewer Feedback "}),o.jsx("br",{}),o.jsx(ks,{className:"mt-3",value:h==null?void 0:h.reviewerFeedback,onChange:w=>f(w,"reviewerFeedback",g)})]}),o.jsxs("div",{className:"",children:[o.jsx("label",{children:"Reviewer Comments / Notes (internal use only)"}),o.jsx("br",{}),o.jsx(ks,{className:"mt-3",value:h==null?void 0:h.reviewerComments,onChange:w=>f(w,"reviewerComments",g)})]})]})},`checklistIndex-${g}`)}))})})})})})},Si=t=>{const{isPreview:e,field:n,isAdmin:r,fieldWrap:i}=t,{userSelectedLanguage:a}=un(),{globalAlignment:s}=tn(),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(en,{})]}),o.jsx("span",{className:A,children:d})]})},{TASK_PUBLISHED:c,task_status:u}=yr(),[d,f]=P.useState("");P.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(ci,{headerTemplate:l,toggleable:!0,children:i}):i})})};/*! @license DOMPurify 3.2.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.3/LICENSE */const{entries:SO,setPrototypeOf:xO,isFrozen:hle,getPrototypeOf:ple,getOwnPropertyDescriptor:gle}=Object;let{freeze:Uo,seal:sc,create:CO}=Object,{apply:bb,construct:yb}=typeof Reflect<"u"&&Reflect;Uo||(Uo=function(e){return e}),sc||(sc=function(e){return e}),bb||(bb=function(e,n,r){return e.apply(n,r)}),yb||(yb=function(e,n){return new e(...n)});const p4=Dl(Array.prototype.forEach),TO=Dl(Array.prototype.pop),F2=Dl(Array.prototype.push),g4=Dl(String.prototype.toLowerCase),Ab=Dl(String.prototype.toString),EO=Dl(String.prototype.match),k2=Dl(String.prototype.replace),mle=Dl(String.prototype.indexOf),vle=Dl(String.prototype.trim),qc=Dl(Object.prototype.hasOwnProperty),qo=Dl(RegExp.prototype.test),P2=ble(TypeError);function Dl(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return bb(t,e,r)}}function ble(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return yb(t,n)}}function pi(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:g4;xO&&xO(t,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const a=n(i);a!==i&&(hle(e)||(e[r]=a),i=a)}t[i]=!0}return t}function yle(t){for(let e=0;e<t.length;e++)qc(t,e)||(t[e]=null);return t}function m1(t){const e=CO(null);for(const[n,r]of SO(t))qc(t,n)&&(Array.isArray(r)?e[n]=yle(r):r&&typeof r=="object"&&r.constructor===Object?e[n]=m1(r):e[n]=r);return e}function M2(t,e){for(;t!==null;){const r=gle(t,e);if(r){if(r.get)return Dl(r.get);if(typeof r.value=="function")return Dl(r.value)}t=ple(t)}function n(){return null}return n}const IO=Uo(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),wb=Uo(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Sb=Uo(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ale=Uo(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),xb=Uo(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),wle=Uo(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),_O=Uo(["#text"]),DO=Uo(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Cb=Uo(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),NO=Uo(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),m4=Uo(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Sle=sc(/\{\{[\w\W]*|[\w\W]*\}\}/gm),xle=sc(/<%[\w\W]*|[\w\W]*%>/gm),Cle=sc(/\$\{[\w\W]*}/gm),Tle=sc(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ele=sc(/^aria-[\-\w]+$/),OO=sc(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ile=sc(/^(?:\w+script|data):/i),_le=sc(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),FO=sc(/^html$/i),Dle=sc(/^[a-z][.\w]*(-[.\w]+)+$/i);var kO=Object.freeze({__proto__:null,ARIA_ATTR:Ele,ATTR_WHITESPACE:_le,CUSTOM_ELEMENT:Dle,DATA_ATTR:Tle,DOCTYPE_NAME:FO,ERB_EXPR:xle,IS_ALLOWED_URI:OO,IS_SCRIPT_OR_DATA:Ile,MUSTACHE_EXPR:Sle,TMPLIT_EXPR:Cle});const L2={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Nle=function(){return typeof window>"u"?null:window},Ole=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}},PO=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function MO(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Nle();const e=ot=>MO(ot);if(e.version="3.2.3",e.removed=[],!t||!t.document||t.document.nodeType!==L2.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=M2(v,"cloneNode"),A=M2(v,"remove"),S=M2(v,"nextSibling"),T=M2(v,"childNodes"),w=M2(v,"parentNode");if(typeof s=="function"){const ot=n.createElement("template");ot.content&&ot.content.ownerDocument&&(n=ot.content.ownerDocument)}let E,x="";const{implementation:I,createNodeIterator:_,createDocumentFragment:O,getElementsByTagName:B}=n,{importNode:M}=r;let V=PO();e.isSupported=typeof SO=="function"&&typeof w=="function"&&I&&I.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:$,ERB_EXPR:k,TMPLIT_EXPR:z,DATA_ATTR:le,ARIA_ATTR:fe,IS_SCRIPT_OR_DATA:Z,ATTR_WHITESPACE:G,CUSTOM_ELEMENT:ce}=kO;let{IS_ALLOWED_URI:K}=kO,ge=null;const te=pi({},[...IO,...wb,...Sb,...xb,..._O]);let ee=null;const Y=pi({},[...DO,...Cb,...NO,...m4]);let J=Object.seal(CO(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),he=null,be=null,Ee=!0,ye=!0,Ae=!1,ne=!0,U=!1,re=!0,W=!1,de=!1,Ce=!1,_e=!1,ve=!1,me=!1,we=!0,De=!1;const q="user-content-";let se=!0,pe=!1,ue={},oe=null;const ae=pi({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Oe=null;const Ne=pi({},["audio","video","img","source","image","track"]);let Ke=null;const ut=pi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pt="http://www.w3.org/1998/Math/MathML",ht="http://www.w3.org/2000/svg",kt="http://www.w3.org/1999/xhtml";let wn=kt,Vt=!1,Nt=null;const $e=pi({},[pt,ht,kt],Ab);let yt=pi({},["mi","mo","mn","ms","mtext"]),qt=pi({},["annotation-xml"]);const hn=pi({},["title","style","font","a","script"]);let on=null;const _n=["application/xhtml+xml","text/html"],vn="text/html";let In=null,Gt=null;const Re=n.createElement("form"),nt=function(Ve){return Ve instanceof RegExp||Ve instanceof Function},dt=function(){let Ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Gt&&Gt===Ve)){if((!Ve||typeof Ve!="object")&&(Ve={}),Ve=m1(Ve),on=_n.indexOf(Ve.PARSER_MEDIA_TYPE)===-1?vn:Ve.PARSER_MEDIA_TYPE,In=on==="application/xhtml+xml"?Ab:g4,ge=qc(Ve,"ALLOWED_TAGS")?pi({},Ve.ALLOWED_TAGS,In):te,ee=qc(Ve,"ALLOWED_ATTR")?pi({},Ve.ALLOWED_ATTR,In):Y,Nt=qc(Ve,"ALLOWED_NAMESPACES")?pi({},Ve.ALLOWED_NAMESPACES,Ab):$e,Ke=qc(Ve,"ADD_URI_SAFE_ATTR")?pi(m1(ut),Ve.ADD_URI_SAFE_ATTR,In):ut,Oe=qc(Ve,"ADD_DATA_URI_TAGS")?pi(m1(Ne),Ve.ADD_DATA_URI_TAGS,In):Ne,oe=qc(Ve,"FORBID_CONTENTS")?pi({},Ve.FORBID_CONTENTS,In):ae,he=qc(Ve,"FORBID_TAGS")?pi({},Ve.FORBID_TAGS,In):{},be=qc(Ve,"FORBID_ATTR")?pi({},Ve.FORBID_ATTR,In):{},ue=qc(Ve,"USE_PROFILES")?Ve.USE_PROFILES:!1,Ee=Ve.ALLOW_ARIA_ATTR!==!1,ye=Ve.ALLOW_DATA_ATTR!==!1,Ae=Ve.ALLOW_UNKNOWN_PROTOCOLS||!1,ne=Ve.ALLOW_SELF_CLOSE_IN_ATTR!==!1,U=Ve.SAFE_FOR_TEMPLATES||!1,re=Ve.SAFE_FOR_XML!==!1,W=Ve.WHOLE_DOCUMENT||!1,_e=Ve.RETURN_DOM||!1,ve=Ve.RETURN_DOM_FRAGMENT||!1,me=Ve.RETURN_TRUSTED_TYPE||!1,Ce=Ve.FORCE_BODY||!1,we=Ve.SANITIZE_DOM!==!1,De=Ve.SANITIZE_NAMED_PROPS||!1,se=Ve.KEEP_CONTENT!==!1,pe=Ve.IN_PLACE||!1,K=Ve.ALLOWED_URI_REGEXP||OO,wn=Ve.NAMESPACE||kt,yt=Ve.MATHML_TEXT_INTEGRATION_POINTS||yt,qt=Ve.HTML_INTEGRATION_POINTS||qt,J=Ve.CUSTOM_ELEMENT_HANDLING||{},Ve.CUSTOM_ELEMENT_HANDLING&&nt(Ve.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(J.tagNameCheck=Ve.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Ve.CUSTOM_ELEMENT_HANDLING&&nt(Ve.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(J.attributeNameCheck=Ve.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Ve.CUSTOM_ELEMENT_HANDLING&&typeof Ve.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(J.allowCustomizedBuiltInElements=Ve.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),U&&(ye=!1),ve&&(_e=!0),ue&&(ge=pi({},_O),ee=[],ue.html===!0&&(pi(ge,IO),pi(ee,DO)),ue.svg===!0&&(pi(ge,wb),pi(ee,Cb),pi(ee,m4)),ue.svgFilters===!0&&(pi(ge,Sb),pi(ee,Cb),pi(ee,m4)),ue.mathMl===!0&&(pi(ge,xb),pi(ee,NO),pi(ee,m4))),Ve.ADD_TAGS&&(ge===te&&(ge=m1(ge)),pi(ge,Ve.ADD_TAGS,In)),Ve.ADD_ATTR&&(ee===Y&&(ee=m1(ee)),pi(ee,Ve.ADD_ATTR,In)),Ve.ADD_URI_SAFE_ATTR&&pi(Ke,Ve.ADD_URI_SAFE_ATTR,In),Ve.FORBID_CONTENTS&&(oe===ae&&(oe=m1(oe)),pi(oe,Ve.FORBID_CONTENTS,In)),se&&(ge["#text"]=!0),W&&pi(ge,["html","head","body"]),ge.table&&(pi(ge,["tbody"]),delete he.tbody),Ve.TRUSTED_TYPES_POLICY){if(typeof Ve.TRUSTED_TYPES_POLICY.createHTML!="function")throw P2('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ve.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw P2('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=Ve.TRUSTED_TYPES_POLICY,x=E.createHTML("")}else E===void 0&&(E=Ole(g,i)),E!==null&&typeof x=="string"&&(x=E.createHTML(""));Uo&&Uo(Ve),Gt=Ve}},jt=pi({},[...wb,...Sb,...Ale]),En=pi({},[...xb,...wle]),Un=function(Ve){let rt=w(Ve);(!rt||!rt.tagName)&&(rt={namespaceURI:wn,tagName:"template"});const Et=g4(Ve.tagName),zt=g4(rt.tagName);return Nt[Ve.namespaceURI]?Ve.namespaceURI===ht?rt.namespaceURI===kt?Et==="svg":rt.namespaceURI===pt?Et==="svg"&&(zt==="annotation-xml"||yt[zt]):!!jt[Et]:Ve.namespaceURI===pt?rt.namespaceURI===kt?Et==="math":rt.namespaceURI===ht?Et==="math"&&qt[zt]:!!En[Et]:Ve.namespaceURI===kt?rt.namespaceURI===ht&&!qt[zt]||rt.namespaceURI===pt&&!yt[zt]?!1:!En[Et]&&(hn[Et]||!jt[Et]):!!(on==="application/xhtml+xml"&&Nt[Ve.namespaceURI]):!1},Rn=function(Ve){F2(e.removed,{element:Ve});try{w(Ve).removeChild(Ve)}catch{A(Ve)}},ir=function(Ve,rt){try{F2(e.removed,{attribute:rt.getAttributeNode(Ve),from:rt})}catch{F2(e.removed,{attribute:null,from:rt})}if(rt.removeAttribute(Ve),Ve==="is")if(_e||ve)try{Rn(rt)}catch{}else try{rt.setAttribute(Ve,"")}catch{}},Jn=function(Ve){let rt=null,Et=null;if(Ce)Ve="<remove></remove>"+Ve;else{const Ue=EO(Ve,/^[\r\n\t ]+/);Et=Ue&&Ue[0]}on==="application/xhtml+xml"&&wn===kt&&(Ve='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Ve+"</body></html>");const zt=E?E.createHTML(Ve):Ve;if(wn===kt)try{rt=new h().parseFromString(zt,on)}catch{}if(!rt||!rt.documentElement){rt=I.createDocument(wn,"template",null);try{rt.documentElement.innerHTML=Vt?x:zt}catch{}}const bt=rt.body||rt.documentElement;return Ve&&Et&&bt.insertBefore(n.createTextNode(Et),bt.childNodes[0]||null),wn===kt?B.call(rt,W?"html":"body")[0]:W?rt.documentElement:bt},mr=function(Ve){return _.call(Ve.ownerDocument||Ve,Ve,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},gi=function(Ve){return Ve instanceof f&&(typeof Ve.nodeName!="string"||typeof Ve.textContent!="string"||typeof Ve.removeChild!="function"||!(Ve.attributes instanceof d)||typeof Ve.removeAttribute!="function"||typeof Ve.setAttribute!="function"||typeof Ve.namespaceURI!="string"||typeof Ve.insertBefore!="function"||typeof Ve.hasChildNodes!="function")},yn=function(Ve){return typeof l=="function"&&Ve instanceof l};function it(ot,Ve,rt){p4(ot,Et=>{Et.call(e,Ve,rt,Gt)})}const ct=function(Ve){let rt=null;if(it(V.beforeSanitizeElements,Ve,null),gi(Ve))return Rn(Ve),!0;const Et=In(Ve.nodeName);if(it(V.uponSanitizeElement,Ve,{tagName:Et,allowedTags:ge}),Ve.hasChildNodes()&&!yn(Ve.firstElementChild)&&qo(/<[/\w]/g,Ve.innerHTML)&&qo(/<[/\w]/g,Ve.textContent)||Ve.nodeType===L2.progressingInstruction||re&&Ve.nodeType===L2.comment&&qo(/<[/\w]/g,Ve.data))return Rn(Ve),!0;if(!ge[Et]||he[Et]){if(!he[Et]&&Mt(Et)&&(J.tagNameCheck instanceof RegExp&&qo(J.tagNameCheck,Et)||J.tagNameCheck instanceof Function&&J.tagNameCheck(Et)))return!1;if(se&&!oe[Et]){const zt=w(Ve)||Ve.parentNode,bt=T(Ve)||Ve.childNodes;if(bt&&zt){const Ue=bt.length;for(let Qe=Ue-1;Qe>=0;--Qe){const Dt=m(bt[Qe],!0);Dt.__removalCount=(Ve.__removalCount||0)+1,zt.insertBefore(Dt,S(Ve))}}}return Rn(Ve),!0}return Ve instanceof c&&!Un(Ve)||(Et==="noscript"||Et==="noembed"||Et==="noframes")&&qo(/<\/no(script|embed|frames)/i,Ve.innerHTML)?(Rn(Ve),!0):(U&&Ve.nodeType===L2.text&&(rt=Ve.textContent,p4([$,k,z],zt=>{rt=k2(rt,zt," ")}),Ve.textContent!==rt&&(F2(e.removed,{element:Ve.cloneNode()}),Ve.textContent=rt)),it(V.afterSanitizeElements,Ve,null),!1)},At=function(Ve,rt,Et){if(we&&(rt==="id"||rt==="name")&&(Et in n||Et in Re))return!1;if(!(ye&&!be[rt]&&qo(le,rt))){if(!(Ee&&qo(fe,rt))){if(!ee[rt]||be[rt]){if(!(Mt(Ve)&&(J.tagNameCheck instanceof RegExp&&qo(J.tagNameCheck,Ve)||J.tagNameCheck instanceof Function&&J.tagNameCheck(Ve))&&(J.attributeNameCheck instanceof RegExp&&qo(J.attributeNameCheck,rt)||J.attributeNameCheck instanceof Function&&J.attributeNameCheck(rt))||rt==="is"&&J.allowCustomizedBuiltInElements&&(J.tagNameCheck instanceof RegExp&&qo(J.tagNameCheck,Et)||J.tagNameCheck instanceof Function&&J.tagNameCheck(Et))))return!1}else if(!Ke[rt]){if(!qo(K,k2(Et,G,""))){if(!((rt==="src"||rt==="xlink:href"||rt==="href")&&Ve!=="script"&&mle(Et,"data:")===0&&Oe[Ve])){if(!(Ae&&!qo(Z,k2(Et,G,"")))){if(Et)return!1}}}}}}return!0},Mt=function(Ve){return Ve!=="annotation-xml"&&EO(Ve,ce)},Ut=function(Ve){it(V.beforeSanitizeAttributes,Ve,null);const{attributes:rt}=Ve;if(!rt||gi(Ve))return;const Et={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ee,forceKeepAttr:void 0};let zt=rt.length;for(;zt--;){const bt=rt[zt],{name:Ue,namespaceURI:Qe,value:Dt}=bt,nn=In(Ue);let wt=Ue==="value"?Dt:vle(Dt);if(Et.attrName=nn,Et.attrValue=wt,Et.keepAttr=!0,Et.forceKeepAttr=void 0,it(V.uponSanitizeAttribute,Ve,Et),wt=Et.attrValue,De&&(nn==="id"||nn==="name")&&(ir(Ue,Ve),wt=q+wt),re&&qo(/((--!?|])>)|<\/(style|title)/i,wt)){ir(Ue,Ve);continue}if(Et.forceKeepAttr||(ir(Ue,Ve),!Et.keepAttr))continue;if(!ne&&qo(/\/>/i,wt)){ir(Ue,Ve);continue}U&&p4([$,k,z],Ze=>{wt=k2(wt,Ze," ")});const Me=In(Ve.nodeName);if(At(Me,nn,wt)){if(E&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Qe)switch(g.getAttributeType(Me,nn)){case"TrustedHTML":{wt=E.createHTML(wt);break}case"TrustedScriptURL":{wt=E.createScriptURL(wt);break}}try{Qe?Ve.setAttributeNS(Qe,Ue,wt):Ve.setAttribute(Ue,wt),gi(Ve)?Rn(Ve):TO(e.removed)}catch{}}}it(V.afterSanitizeAttributes,Ve,null)},mt=function ot(Ve){let rt=null;const Et=mr(Ve);for(it(V.beforeSanitizeShadowDOM,Ve,null);rt=Et.nextNode();)it(V.uponSanitizeShadowNode,rt,null),ct(rt),Ut(rt),rt.content instanceof a&&ot(rt.content);it(V.afterSanitizeShadowDOM,Ve,null)};return e.sanitize=function(ot){let Ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},rt=null,Et=null,zt=null,bt=null;if(Vt=!ot,Vt&&(ot="<!-->"),typeof ot!="string"&&!yn(ot))if(typeof ot.toString=="function"){if(ot=ot.toString(),typeof ot!="string")throw P2("dirty is not a string, aborting")}else throw P2("toString is not a function");if(!e.isSupported)return ot;if(de||dt(Ve),e.removed=[],typeof ot=="string"&&(pe=!1),pe){if(ot.nodeName){const Dt=In(ot.nodeName);if(!ge[Dt]||he[Dt])throw P2("root node is forbidden and cannot be sanitized in-place")}}else if(ot instanceof l)rt=Jn("<!---->"),Et=rt.ownerDocument.importNode(ot,!0),Et.nodeType===L2.element&&Et.nodeName==="BODY"||Et.nodeName==="HTML"?rt=Et:rt.appendChild(Et);else{if(!_e&&!U&&!W&&ot.indexOf("<")===-1)return E&&me?E.createHTML(ot):ot;if(rt=Jn(ot),!rt)return _e?null:me?x:""}rt&&Ce&&Rn(rt.firstChild);const Ue=mr(pe?ot:rt);for(;zt=Ue.nextNode();)ct(zt),Ut(zt),zt.content instanceof a&&mt(zt.content);if(pe)return ot;if(_e){if(ve)for(bt=O.call(rt.ownerDocument);rt.firstChild;)bt.appendChild(rt.firstChild);else bt=rt;return(ee.shadowroot||ee.shadowrootmode)&&(bt=M.call(r,bt,!0)),bt}let Qe=W?rt.outerHTML:rt.innerHTML;return W&&ge["!doctype"]&&rt.ownerDocument&&rt.ownerDocument.doctype&&rt.ownerDocument.doctype.name&&qo(FO,rt.ownerDocument.doctype.name)&&(Qe="<!DOCTYPE "+rt.ownerDocument.doctype.name+`>
2381
- `+Qe),U&&p4([$,k,z],Dt=>{Qe=k2(Qe,Dt," ")}),E&&me?E.createHTML(Qe):Qe},e.setConfig=function(){let ot=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dt(ot),de=!0},e.clearConfig=function(){Gt=null,de=!1},e.isValidAttribute=function(ot,Ve,rt){Gt||dt({});const Et=In(ot),zt=In(Ve);return At(Et,zt,rt)},e.addHook=function(ot,Ve){typeof Ve=="function"&&F2(V[ot],Ve)},e.removeHook=function(ot){return TO(V[ot])},e.removeHooks=function(ot){V[ot]=[]},e.removeAllHooks=function(){V=PO()},e}var v4=MO();const sa=t=>{var T;const{field:e,fieldIndex:n,pageIndex:r,sectionIndex:i,rowIndex:a,columnIndex:s,path:l}=t,[c,u]=P.useState(e);P.useEffect(()=>{var w;return A((w=e==null?void 0:e.label)==null?void 0:w[d==null?void 0:d.type]),()=>{}},[e]);const{userSelectedLanguage:d,fieldSettingUpdate:f,fieldSettingUpdateInlineConditional:h,gridComponentFieldSettingUpdate:g}=un(),v=(w,E,x)=>{u(I=>({...I,[w]:{...I[w],[E==null?void 0:E.type]:x}}))},[m,A]=P.useState((T=e==null?void 0:e.label)==null?void 0:T[d==null?void 0:d.type]);P.useEffect(()=>(S(),()=>{}),[c]);const S=()=>{const w=l.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?h(w[ma],w[va],w[xa],w[Ca],w[Ta],w[Na],w[Zo],w[Fo],c):(w==null?void 0:w.length)>Na&&(w==null?void 0:w.length)===tc+1&&(e!=null&&e.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?g(w[ma],w[va],w[xa],w[Ca],w[Ta],w[5],w[6],w[7],c):f(r,i,a,s,n,{...e,label:c==null?void 0:c.label})};return o.jsx(o.Fragment,{children:o.jsx(h4,{style:{display:"inline-block"},className:"builder-input-label-edit",html:m,disabled:!1,onChange:w=>{var E;A(v4.sanitize((E=w==null?void 0:w.target)==null?void 0:E.value))},onBlur:w=>{var x;const E=v4.sanitize((x=w==null?void 0:w.target)==null?void 0:x.innerText);A(E),v("label",d,E)},tagName:"article"})})},v1=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(w2,{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"}})})},Xr=t=>{var le,fe,Z,G;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}=tn(),g=(ce,K)=>{M(ge=>({...ge,[ce]:K}))},{fieldSettingUpdate:v,fieldSettingUpdateInlineConditional:m,cloneField:A,gridComponentFieldSettingUpdate:S,fieldSettingDeleteInlineConditional:T,gridComponentFieldDelete:w,removeField:E}=un(),{updateGlobalToast:x}=tn(),I=ce=>{const K=c.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?m(K[ma],K[va],K[xa],K[Ca],K[Ta],K[Na],K[Zo],K[Fo],ce):(K==null?void 0:K.length)>Na&&(K==null?void 0:K.length)===tc+1&&(ce!=null&&ce.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?S(K[ma],K[va],K[xa],K[Ca],K[Ta],K[5],K[6],K[7],ce):v(s,i,a,r,n,ce),x({showToast:!0,toastMessage:"Updated",toastDetail:"Field Updated",toastType:"success"})},[_,O]=P.useState(!1),[B,M]=P.useState({custom_component_title:"",custom_component_description:""}),V=()=>{M(ce=>({...ce,custom_component_schema:e})),O(!0)},$=()=>{const ce=c.split("-").map(Number);l==="inline-conditional"?T(ce[ma],ce[va],ce[xa],ce[Ca],ce[Ta],ce[Na],ce[Zo],ce[Fo]):(ce==null?void 0:ce.length)>Na&&(ce==null?void 0:ce.length)===tc+1&&(e!=null&&e.componentType)&&l==="grid"?w(ce[ma],ce[va],ce[xa],ce[Ca],ce[Ta],ce[5],ce[6],ce[7]):E(s,i,a,r,n)},k=(ce,K)=>{const ge={...e,attributes:{...e.attributes,[ce]:K}};I(ge)},z=(ce,K)=>{const ge={...e,[ce]:K};I(ge)};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)!=="href"&&(e==null?void 0:e.componentType)!=="paragraph"&&(e==null?void 0:e.componentType)!=="heading"&&(e==null?void 0:e.componentType)!=="list"&&(e==null?void 0:e.componentType)!=="hr"&&(e==null?void 0:e.componentType)!=="image-gallery"&&(e==null?void 0:e.componentType)!=="video"&&(e==null?void 0:e.componentType)!=="question"?"builder-element-quick-options mb-2 w-9 justify-content-between":"builder-element-quick-options mb-2 w-4 justify-content-center"} flex quick-setting`,children:[o.jsx(o.Fragment,{children:(e==null?void 0:e.componentType)!=="hidden-field"&&(e==null?void 0:e.componentType)!=="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===!0&&o.jsxs("div",{className:" ",children:[o.jsx(v1,{field:e,onHandleChangeSetttings:k,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:(fe=e==null?void 0:e.attributes)==null?void 0:fe.required}),o.jsx(v1,{field:e,onHandleChangeSetttings:z,settingsKey:"showToolTip",settingsKeyValue:e==null?void 0:e.showToolTip,onLabel:"Tooltip",offLabel:"Tooltip",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showToolTip}),o.jsx(v1,{field:e,onHandleChangeSetttings:z,settingsKey:"showHelperText",settingsKeyValue:e==null?void 0:e.showHelperText,onLabel:"Helper text",offLabel:"Helper text",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showHelperText}),o.jsx(v1,{field:e,onHandleChangeSetttings:z,settingsKey:"showHeaderText",settingsKeyValue:e==null?void 0:e.showHeaderText,onLabel:"Header text",offLabel:"Header text",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showHeaderText}),o.jsx(v1,{field:e,onHandleChangeSetttings:z,settingsKey:"isFluid",settingsKeyValue:e==null?void 0:e.isFluid,onLabel:"Fluid",offLabel:"Fluid",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.isFluid}),(e==null?void 0:e.componentType)=="radio"&&o.jsxs(o.Fragment,{children:[o.jsx(v1,{field:e,onHandleChangeSetttings:z,settingsKey:"showAlphabetList",settingsKeyValue:e==null?void 0:e.showAlphabetList,onLabel:"Alpha",offLabel:"Alpha",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showAlphabetList}),o.jsx(v1,{field:e,onHandleChangeSetttings:k,settingsKey:"style",settingsKeyValue:(Z=e==null?void 0:e.attributes)==null?void 0:Z.style,onLabel:"Style",offLabel:"Style",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:(G=e==null?void 0:e.attributes)==null?void 0:G.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(Ft,{text:!0,size:"small",label:"Advance Settings",icon:"pi pi-cog",onClick:()=>{u(!0)},className:"mr-3"}),o.jsx(Ft,{size:"small",text:!0,icon:"pi pi-clone",outlined:!0,onClick:()=>{A(e,s,i,a,r,n),h()}}),o.jsx(Ft,{text:!0,size:"small",outlined:!0,icon:"pi pi-trash",onClick:()=>{$()}}),o.jsx(Ft,{text:!0,size:"small",outlined:!0,icon:"pi pi-file",onClick:()=>{V()}})]}),o.jsxs(Ts,{maximizable:!0,header:"Custom component save",visible:_,style:{width:"20vw"},footer:()=>o.jsx(o.Fragment,{children:o.jsxs("div",{children:[o.jsx(Ft,{size:"small",text:!0,label:"Close",icon:"pi pi-times",onClick:()=>O(!1),className:"p-button-text"}),(e==null?void 0:e.componentType)!=="hidden-field"&&o.jsx(Ft,{text:!0,label:"Save",icon:"pi pi-check",onClick:()=>{O(!1)},autoFocus:!0})]})}),onHide:()=>O(!1),children:[o.jsxs("span",{className:"p-float-label",children:[o.jsx(bn,{id:"custom_component_title",name:"custom_component_title",className:"w-full",value:(B==null?void 0:B.custom_component_title)||"",onChange:ce=>{var K;return g("custom_component_title",(K=ce==null?void 0:ce.target)==null?void 0:K.value)}}),o.jsx("label",{htmlFor:"username",children:"Custom component title"})]}),o.jsxs("span",{className:"p-float-label mt-5",children:[o.jsx(ks,{id:"custom_component_description",name:"custom_component_description",className:"w-full",value:(B==null?void 0:B.custom_component_description)||"",onChange:ce=>{var K;return g("custom_component_description",(K=ce==null?void 0:ce.target)==null?void 0:K.value)}}),o.jsx("label",{htmlFor:"username",children:"Custom component description"})]})]})]})]})})},Fle=t=>{var J,he,be,Ee,ye,Ae,ne,U;const{pageIndex:e,sectionIndex:n,field:r,fieldIndex:i,row:a,rowIndex:s,columnIndex:l,isDisabled:c}=t,{isAdmin:u,isRenderView:d,isPreview:f}=tn(),{userSelectedLanguage:h,fieldSettingUpdate:g}=un(),{task_status:v,taskRegisterData:m,updateTaskRegisterData:A,updateTaskProgressValue:S,updateUserFormDataSubmit:T,userTaskSubmitFormData:w,TASK_PUBLISHED:E}=yr(),[x,I]=P.useState(!1),[_,O]=P.useState(!1),[B,M]=P.useState(null),[V,$]=P.useState(0),[k,z]=P.useState(!1),le=()=>{z(!0)},fe=()=>{z(!1)},Z=re=>{I(re)},G=()=>{I(!1)},ce=()=>{var re,W,de;if(a!=null&&a.rowIsRepeatable){if(a!=null&&a.repeatableFields){const Ce=[...a.repeatableFields],_e=_t.findIndex(Ce,function(ve){return ve.uuid===(r==null?void 0:r.uuid)});_e>=0&&Ce[_e].fieldData?M(Ce[_e].fieldData):(r.isValid=0,M(null))}}else{const Ce=w,_e=_t.cloneDeep(m);if(Ce!=null&&Ce.length){for(const ve of Ce)if(ve.fieldId===t.field.uuid&&((re=ve==null?void 0:ve.postData)!=null&&re.length)){M((W=ve==null?void 0:ve.postData[0])==null?void 0:W.postValue),_e[r==null?void 0:r.uuid]=(de=ve==null?void 0:ve.postData[0])==null?void 0:de.postValue;const me=Object.keys(_e).length;S(me);break}}}O(!0)},K=re=>{var _e;M(re.target.value);const W=w,de=_t.cloneDeep(m);if((_e=re==null?void 0:re.target)!=null&&_e.value&&(W==null?void 0:W.length)>0)for(const ve of W)ve.fieldId===t.field.uuid&&(de[r==null?void 0:r.uuid]=re==null?void 0:re.value,ve.postData[0]={postValue:re.value});else delete de[r==null?void 0:r.uuid];A(de);const Ce=Object.keys(de).length;S(Ce)};P.useEffect(()=>{_||ce();const re=Jt.addListener("clearRepeatableFields",Ce=>{Ce===(a==null?void 0:a.uuid)&&(M(""),$(0),r.isValid=0,g(e,n,s,l,i,r))}),W=Jt.addListener("onSubmitUserForm",()=>{var Ce;(Ce=r==null?void 0:r.attributes)!=null&&Ce.required?B?r.isValid=1:r.isValid=0:r.isValid=1}),de=Jt.addListener("OnInvalidFieldCatch",Ce=>{console.log("OnInvalidFieldCatch listener"),console.log("field.uuid === value?.fieldId",r.uuid===(Ce==null?void 0:Ce.fieldId)),r.uuid===(Ce==null?void 0:Ce.fieldId)?$(1):$(0)});return()=>{W.remove(),de.remove(),re.remove()}});const ge=(re,W)=>{var de;if(w){const Ce=[...w],_e=_t.findIndex(Ce,function(me){return me.rowId===(a==null?void 0:a.uuid)});let ve=(de=w[_e])==null?void 0:de.repeatableFields;ve={...ve,[re==null?void 0:re.uuid]:W},Ce[_e]={...Ce[_e],repeatableFields:ve},T(Ce)}M(W),W!==null?re.isValid=1:re.isValid=0},te=(re,W)=>re?o.jsxs("div",{className:"country-item flex",children:[o.jsx("img",{alt:re.name,src:re==null?void 0:re.image,onError:de=>de.target.src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png",style:{width:"20px",marginRight:10}}),o.jsx("div",{children:re.name})]}):o.jsx("span",{children:W.placeholder}),ee=re=>o.jsxs("div",{className:"country-item flex",children:[o.jsx("img",{alt:re.name,src:re==null?void 0:re.image,onError:W=>W.target.src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png",style:{width:"20px",marginRight:10}}),o.jsx("div",{children:re.name})]});console.log("field?.validationMesssage",r==null?void 0:r.validationMesssage);const Y=o.jsxs("div",{onMouseOver:le,onMouseOut:fe,children:[!d&&!f&&k&&o.jsx(Xr,{handleFieldSettingsSidebar:Z,...t}),o.jsxs("div",{className:`field ${f?" ":" builder-element-wrapper "}${(r==null?void 0:r.isFluid)===!0?" card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:f?"col-12 ":"field-form-builder col-12 ",children:[(r==null?void 0:r.showHeaderText)&&o.jsx("h6",{children:(J=r==null?void 0:r.headerText)==null?void 0:J[h==null?void 0:h.type]}),(r==null?void 0:r.showLabel)&&o.jsxs("label",{htmlFor:i,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(da,{...t}),((he=r==null?void 0:r.attributes)==null?void 0:he.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",f?o.jsx(o.Fragment,{children:(be=r==null?void 0:r.label)==null?void 0:be[h==null?void 0:h.type]}):o.jsx(sa,{...t}),o.jsx("span",{className:"ml-3",children:(r==null?void 0:r.showToolTip)&&o.jsx(Mi,{message:(Ee=r==null?void 0:r.toolTip)==null?void 0:Ee[h==null?void 0:h.type],position:"right"})})]}),o.jsx(Oa,{className:"country-select-builder-component",onFocus:()=>$(1),onChange:re=>{a!=null&&a.rowIsRepeatable?ge(r,re.target.value):K(re)},options:r==null?void 0:r.countries,optionLabel:"name",value:B,placeholder:(ye=r==null?void 0:r.placeholder)==null?void 0:ye[h==null?void 0:h.type],disabled:c,valueTemplate:te,itemTemplate:ee,filter:!0,filterBy:"name",showClear:!0}),((Ae=r==null?void 0:r.attributes)==null?void 0:Ae.required)&&o.jsx("small",{className:"error",children:V===1&&B===null?((ne=r==null?void 0:r.validationMesssage)==null?void 0:ne[h==null?void 0:h.type])||"field is required":""}),o.jsx("div",{children:(r==null?void 0:r.showHelperText)&&o.jsx("small",{children:(U=r==null?void 0:r.helperText)==null?void 0:U[h==null?void 0:h.type]})})]})}),u&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[x===!0&&o.jsx(Wi,{visibilty:x,closeSettingFieldSidebar:G,...t},r==null?void 0:r.uuid),o.jsx(Si,{...t,fieldWrap:Y})]})},kle=t=>{var J,he,be,Ee,ye,Ae,ne,U,re,W,de,Ce,_e,ve,me;const{taskRegisterData:e,updateTaskRegisterData:n,updateTaskProgressValue:r,updateUserFormDataSubmit:i,userTaskSubmitFormData:a,task_status:s,TASK_PUBLISHED:l}=yr(),{userSelectedLanguage:c,fieldSettingUpdate:u}=un(),{field:d,fieldIndex:f,sectionIndex:h,pageIndex:g,row:v,rowIndex:m,columnIndex:A,isDisabled:S}=t,{isAdmin:T,isRenderView:w,isPreview:E}=tn(),[x,I]=P.useState(!1),[_,O]=P.useState(""),[B,M]=P.useState(null),[V,$]=P.useState(0),[k,z]=P.useState(!1),[le,fe]=P.useState(!1),Z=()=>{fe(!0)},G=()=>{fe(!1)},ce=()=>{var we,De,q;if(v!=null&&v.rowIsRepeatable){if(v!=null&&v.repeatableFields){const se=[...v.repeatableFields],pe=_t.findIndex(se,function(ue){return ue.uuid===(d==null?void 0:d.uuid)});pe>=0&&se[pe].fieldData?O(se[pe].fieldData):O("")}}else{const se=a;if(se!=null&&se.length){for(const pe of se)if(pe.fieldId===t.field.uuid&&((we=pe==null?void 0:pe.postData[0])==null?void 0:we.postValue)!==""&&((De=pe==null?void 0:pe.postData[0])!=null&&De.postValue)){O((q=pe==null?void 0:pe.postData[0])==null?void 0:q.postValue);break}}}z(!0)};P.useEffect(()=>{k||ce();const we=Jt.addListener("clearRepeatableFields",ue=>{ue===(v==null?void 0:v.uuid)&&(O(""),$(0),d.isValid=0,u(g,h,m,A,f,d))}),De=Jt.addListener("onSubmitUserForm",()=>{var ue,oe;(ue=d==null?void 0:d.attributes)!=null&&ue.required?_&&_.length&&(_==null?void 0:_.length)<((oe=d==null?void 0:d.attributes)==null?void 0:oe.minLength)?d.isValid=1:d.isValid=0:d.isValid=1}),q=Jt.addListener("OnInvalidFieldCatch",ue=>{d.uuid===(ue==null?void 0:ue.fieldId)?$(1):$(0)}),se=Jt.addListener("OnGetFieldValue",ue=>{var ae;const oe=(ae=ue==null?void 0:ue.repeatableColumn)==null?void 0:ae.filter(Oe=>(Oe==null?void 0:Oe.fieldUuid)===(d==null?void 0:d.uuid));oe!=null&&oe.length}),pe=Jt.addListener("formFieldAdded",ue=>{B===null&&M(ue==null?void 0:ue.uuid)});return()=>{De.remove(),q.remove(),se.remove(),we.remove(),pe.remove()}}),P.useEffect(()=>(B!==null&&setTimeout(()=>{M(null)},1e3),()=>{}),[B]);const K=we=>{I(we)},ge=()=>{I(!1)},te=we=>{var se,pe;O(we.target.value);const De=a,q=_t.cloneDeep(e);if(De!==null){if((se=we==null?void 0:we.target)!=null&&se.value){if(q[d==null?void 0:d.uuid]=(pe=we==null?void 0:we.target)==null?void 0:pe.value,(De==null?void 0:De.length)>0)for(const ue of De)ue.fieldId===t.field.uuid&&(ue.postData[0]={postValue:we.target.value})}else if(delete q[d==null?void 0:d.uuid],(De==null?void 0:De.length)>0)for(const ue of De)ue.fieldId===t.field.uuid&&(ue.postData[0]={postValue:""})}if(!(v!=null&&v.rowIsRepeatable)){n(q);const ue=Object.keys(q).length;r(ue)}},ee=(we,De)=>{var q;if(a){const se=[...a],pe=_t.findIndex(se,function(oe){return oe.rowId===(v==null?void 0:v.uuid)});let ue=(q=a[pe])==null?void 0:q.repeatableFields;ue={...ue,[we==null?void 0:we.uuid]:De},se[pe]={...se[pe],repeatableFields:ue},i(se)}O(De),De!==""?we.isValid=1:we.isValid=0},Y=o.jsxs("div",{onMouseOver:Z,onMouseOut:G,children:[!w&&!E&&le&&o.jsx(Xr,{handleFieldSettingsSidebar:K,...t}),o.jsxs("div",{className:`field ${E?" ":" builder-element-wrapper "} ${(d==null?void 0:d.isFluid)===!0?" p-fluid ":""} ${w?" ":" py-6 px-4 "} ${B===(d==null?void 0:d.uuid)?" new-field ":" card "} `,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:T?"col-6 ":"col-12 p-fluid",children:[(d==null?void 0:d.showHeaderText)&&o.jsx("h6",{children:(J=d==null?void 0:d.headerText)==null?void 0:J[c==null?void 0:c.type]}),(d==null?void 0:d.showLabel)&&o.jsxs("label",{htmlFor:d==null?void 0:d.uuid,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(da,{...t}),((he=d==null?void 0:d.attributes)==null?void 0:he.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",E?o.jsx(o.Fragment,{children:(be=d==null?void 0:d.label)==null?void 0:be[c==null?void 0:c.type]}):o.jsx(sa,{...t}),(d==null?void 0:d.showToolTip)&&o.jsx("span",{className:"ml-3",children:o.jsx(Mi,{message:(Ee=d==null?void 0:d.toolTip)==null?void 0:Ee[c==null?void 0:c.type],position:"right"})})]}),o.jsxs("div",{className:"mt-3",children:[o.jsxs("span",{className:"p-input-icon-"+(d==null?void 0:d.iconAlignment),children:[(d==null?void 0:d.showIcon)&&o.jsx("i",{className:"pi pi-"+((Ae=(ye=d==null?void 0:d.icon)==null?void 0:ye.properties)==null?void 0:Ae.name)}),o.jsx(bn,{id:d==null?void 0:d.uuid,placeholder:(ne=d==null?void 0:d.placeholder)==null?void 0:ne[c==null?void 0:c.type],minLength:(U=d==null?void 0:d.attributes)==null?void 0:U.minLength,maxLength:(re=d==null?void 0:d.attributes)==null?void 0:re.maxLength,value:_,onFocus:()=>$(1),onChange:we=>{v!=null&&v.rowIsRepeatable?ee(d,we.target.value):te(we)},className:V===1&&((W=d==null?void 0:d.attributes)!=null&&W.required)?_?"valid":"invalid":"valid'",readOnly:S})]}),o.jsx("div",{children:((de=d==null?void 0:d.attributes)==null?void 0:de.required)&&o.jsxs(o.Fragment,{children:[o.jsx("small",{className:"error",children:V===1&&!_?(Ce=d==null?void 0:d.validationMesssage)==null?void 0:Ce.english:""}),o.jsx("small",{className:"error",children:V===1&&_.length&&(_==null?void 0:_.length)<((_e=d==null?void 0:d.attributes)==null?void 0:_e.minLength)?`Mini length ${(ve=d==null?void 0:d.attributes)==null?void 0:ve.minLength}`:""})]})}),o.jsx("div",{children:(d==null?void 0:d.showHelperText)&&o.jsx("small",{children:(me=d==null?void 0:d.helperText)==null?void 0:me[c==null?void 0:c.type]})})]})]})}),T&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[x===!0&&o.jsx(Wi,{visibilty:x,closeSettingFieldSidebar:ge,...t}),o.jsx(Si,{...t,fieldWrap:Y})]})},Ple=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:"Href Text"}),o.jsx(bn,{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:"Hyper link"}),o.jsx(bn,{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)})]})]})},Mle=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:"Hyper link color"}),o.jsx(o0,{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(bn,{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(Br,{checked:n==null?void 0:n.underLined,onChange:i=>{e("underLined",i.checked)}}),o.jsx("label",{children:"Underline link"})]})]})},Lle=t=>{const{visibilty:e,field:n,closeSettingFieldSidebar:r,pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c}=t,[u,d]=P.useState(n),{fieldSettingUpdate:f,formBuilderSchemaLanguages:h,formBuilderPublishedStatus:g}=un(),{updateGlobalToast:v}=tn(),m=(T,w,E)=>{d(x=>({...x,[T]:{...x[T],[w==null?void 0:w.type]:E}}))},A=(T,w)=>{d(E=>({...E,[T]:w}))},S=()=>{f(i,a,s,l,c,u),v({showToast:!0,toastMessage:"Updated",toastDetail:"Html Updated",toastType:"success"})};return o.jsx(o.Fragment,{children:o.jsxs(Vo,{visible:e,position:"left",className:"p-sidebar-lg",onHide:()=>r(),children:[o.jsxs("div",{className:"flex justify-content-between flex-wrap card-container ",children:[o.jsxs("div",{className:"flex align-items-center justify-content-center ",children:[" ",o.jsxs("h5",{className:"mb-0",children:[t==null?void 0:t.typeName," settings "]})]}),!g&&o.jsx("div",{className:"flex align-items-center justify-content-center",children:o.jsx(Ft,{className:"mt-3",label:"Update",onClick:()=>S(),"aria-label":"Update"})})]}),o.jsxs(Za,{children:[o.jsx(fr,{header:"Text",children:o.jsx(fo,{activeIndex:0,children:h!=null&&h.length?h.map((T,w)=>o.jsx(uo,{tabIndex:w,header:T==null?void 0:T.language,children:o.jsx(Ple,{language:T,fieldState:u,onHandleChange:m,...t})},w)):""})}),o.jsx(fr,{header:"Styling",children:o.jsx(Mle,{fieldState:u,onHandleChangeStyling:A,...t})})]})]})})},Ble=t=>{var g,v,m,A,S,T,w,E,x;const{field:e}=t,{userSelectedLanguage:n}=un(),{isPreview:r}=tn(),[i,a]=P.useState(!1),[s,l]=P.useState(!1),c=()=>{l(!0)},u=()=>{l(!1)},d=I=>{a(I)},f=()=>{a(!1)};P.useEffect(()=>{},[e]);const h=o.jsxs("div",{className:r?"":"builder-element-wrapper",onMouseOver:c,onMouseOut:u,children:[!r&&s&&o.jsx(Xr,{handleFieldSettingsSidebar:d,...t}),o.jsxs("div",{className:r?" px-4":"field-form-builder px-4",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(g=e==null?void 0:e.headerText)==null?void 0:g[n==null?void 0:n.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:e.uuid,className:"flex font-medium mb-3 text-700 text-2xl",children:[((v=e==null?void 0:e.attributes)==null?void 0:v.required)&&o.jsx("span",{className:"must-required",children:"*"})," ",r?o.jsx(o.Fragment,{children:(m=e==null?void 0:e.label)==null?void 0:m[n==null?void 0:n.type]}):o.jsx(sa,{...t}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(Mi,{message:(A=e==null?void 0:e.toolTip)==null?void 0:A[n==null?void 0:n.type],position:"right"})})]}),o.jsx("a",{style:{fontSize:parseInt(e==null?void 0:e.fontSize),color:`#${e==null?void 0:e.color}`,textDecoration:e!=null&&e.underLined?"underline":"none"},className:"atag-style",href:(S=e==null?void 0:e.hrefLink)==null?void 0:S[n==null?void 0:n.type],children:(T=e==null?void 0:e.text)==null?void 0:T[n==null?void 0:n.type]}),((w=e==null?void 0:e.attributes)==null?void 0:w.required)&&o.jsx("small",{className:"error",children:(E=e==null?void 0:e.validationMesssage)==null?void 0:E[n==null?void 0:n.type]}),(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(x=e==null?void 0:e.helperText)==null?void 0:x[n==null?void 0:n.type]})]})]});return o.jsxs(o.Fragment,{children:[o.jsx(Lle,{visibilty:i,closeSettingFieldSidebar:f,...t}),o.jsx(Si,{...t,fieldWrap:h})]})},Vle=t=>{var J,he,be,Ee,ye,Ae,ne,U,re,W,de,Ce,_e,ve,me,we,De,q,se,pe,ue;const{field:e,fieldIndex:n,sectionIndex:r,pageIndex:i,row:a,rowIndex:s,columnIndex:l,isDisabled:c}=t,{isPreview:u,isRenderView:d,isAdmin:f}=tn(),{taskRegisterData:h,updateTaskRegisterData:g,updateTaskProgressValue:v,updateUserFormDataSubmit:m,userTaskSubmitFormData:A,TASK_PUBLISHED:S,task_status:T}=yr(),{userSelectedLanguage:w,fieldSettingUpdate:E}=un(),[x,I]=P.useState(null),[_,O]=P.useState(!1),[B,M]=P.useState(null),[V,$]=P.useState(0),[k,z]=P.useState(!1),[le,fe]=P.useState(!1),Z=()=>{fe(!0)},G=()=>{fe(!1)},ce=()=>{var oe,ae;if(a!=null&&a.rowIsRepeatable){if(a!=null&&a.repeatableFields){const Oe=[...a.repeatableFields],Ne=_t.findIndex(Oe,function(Ke){return Ke.uuid===(e==null?void 0:e.uuid)});Ne>=0&&Oe[Ne].fieldData?M(Number(Oe[Ne].fieldData)||null):M(null)}}else{const Oe=A;if(Oe!=null&&Oe.length){for(const Ne of Oe)if(Ne.fieldId===t.field.uuid&&((oe=Ne==null?void 0:Ne.postData)!=null&&oe.length)){M(Number((ae=Ne==null?void 0:Ne.postData[0])==null?void 0:ae.postValue)||null);break}}}z(!0)};P.useEffect(()=>{k||ce();const oe=Jt.addListener("clearRepeatableFields",ut=>{ut===(a==null?void 0:a.uuid)&&(M(null),$(0),e.isValid=0,E(i,r,s,l,n,e))}),ae=Jt.addListener("onSubmitUserForm",()=>{var ut;(ut=e==null?void 0:e.attributes)!=null&&ut.required?B?e.isValid=1:e.isValid=0:e.isValid=1}),Oe=Jt.addListener("OnInvalidFieldCatch",ut=>{e.uuid===(ut==null?void 0:ut.fieldId)?$(1):$(0)}),Ne=Jt.addListener("OnGetFieldValue",ut=>{var ht;const pt=(ht=ut==null?void 0:ut.repeatableColumn)==null?void 0:ht.filter(kt=>(kt==null?void 0:kt.fieldUuid)===(e==null?void 0:e.uuid));pt!=null&&pt.length}),Ke=Jt.addListener("formFieldAdded",ut=>{x===null&&I(ut.uuid)});return()=>{ae.remove(),Oe.remove(),Ne.remove(),oe.remove(),Ke.remove()}}),P.useEffect(()=>(x!==null&&setTimeout(()=>{I(null)},1e3),()=>{}),[x]);const K=oe=>{O(oe)},ge=()=>{O(!1)},te=oe=>{const ae=A,Oe=_t.cloneDeep(h);if(ae!==null){if(oe){if(Oe[e==null?void 0:e.uuid]=oe,(ae==null?void 0:ae.length)>0)for(const Ne of ae)Ne.fieldId===t.field.uuid&&(Ne.postData[0]={postValue:oe})}else if(delete Oe[e==null?void 0:e.uuid],(ae==null?void 0:ae.length)>0)for(const Ne of ae)Ne.fieldId===t.field.uuid&&(Ne.postData[0]={postValue:""})}if(!(a!=null&&a.rowIsRepeatable)){g(Oe);const Ne=Object.keys(Oe).length;v(Ne)}},ee=(oe,ae)=>{var Oe;if(A!=null&&A.length){const Ne=[...A],Ke=_t.findIndex(Ne,function(pt){return pt.rowId===(a==null?void 0:a.uuid)});let ut=(Oe=A[Ke])==null?void 0:Oe.repeatableFields;ut={...ut,[oe==null?void 0:oe.uuid]:ae},Ne[Ke]={...Ne[Ke],repeatableFields:ut},m(Ne)}M(ae),ae!==""?oe.isValid=1:oe.isValid=0},Y=o.jsxs("div",{onMouseOver:Z,onMouseOut:G,children:[!d&&!u&&le&&o.jsx(Xr,{handleFieldSettingsSidebar:K,...t}),o.jsxs("div",{className:`field ${u?" ":" builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0?" p-fluid py-6 px-4":" py-6 px-4"} ${x===(e==null?void 0:e.uuid)?" new-field ":" card "}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:f?"col-6 ":"col-12 p-fluid",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(J=e==null?void 0:e.headerText)==null?void 0:J[w==null?void 0:w.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:e.uuid,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(da,{...t}),((he=e==null?void 0:e.attributes)==null?void 0:he.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",u?o.jsx(o.Fragment,{children:(be=e==null?void 0:e.label)==null?void 0:be[w==null?void 0:w.type]}):o.jsx(sa,{...t}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(Mi,{message:(Ee=e==null?void 0:e.toolTip)==null?void 0:Ee[w==null?void 0:w.type],position:"right"})})]}),o.jsxs("div",{className:"mt-3",children:[o.jsxs("span",{className:"p-input-icon-"+(e==null?void 0:e.iconAlignment),children:[(e==null?void 0:e.showIcon)&&o.jsx("i",{className:"pi pi-"+((Ae=(ye=e==null?void 0:e.icon)==null?void 0:ye.properties)==null?void 0:Ae.name)}),o.jsx(Ba,{readOnly:c,id:e==null?void 0:e.uuid,placeholder:(ne=e==null?void 0:e.placeholder)==null?void 0:ne[w==null?void 0:w.type],value:B,min:(U=e==null?void 0:e.attributes)==null?void 0:U.min,max:e==null?void 0:e.attributes.max,suffix:e==null?void 0:e.attributes.suffix,prefix:(re=e==null?void 0:e.attributes)==null?void 0:re.prefix,showButtons:(W=e==null?void 0:e.attributes)==null?void 0:W.showButtons,pt:{incrementButton:{className:"bg-teal-500 border-teal-500"},decrementButton:{className:"bg-orange-500 border-orange-500"}},minFractionDigits:(de=e==null?void 0:e.attributes)==null?void 0:de.minFractionDigits,maxFractionDigits:(Ce=e==null?void 0:e.attributes)==null?void 0:Ce.maxFractionDigits,locale:(_e=e==null?void 0:e.attributes)==null?void 0:_e.locale,mode:(ve=e==null?void 0:e.attributes)==null?void 0:ve.mode,currency:(me=e==null?void 0:e.attributes)==null?void 0:me.currency,currencyDisplay:(we=e==null?void 0:e.attributes)==null?void 0:we.currencyDisplay,useGrouping:(De=e==null?void 0:e.attributes)==null?void 0:De.useGrouping,onFocus:()=>$(1),onChange:oe=>{a!=null&&a.rowIsRepeatable?ee(e,oe.value):te(oe.value)},className:V===1&&((q=e==null?void 0:e.attributes)!=null&&q.required)?B?"valid":"invalid":"valid'"})]}),o.jsx("div",{children:((se=e==null?void 0:e.attributes)==null?void 0:se.required)&&o.jsx("small",{className:"error",children:V===1&&!B?(pe=e==null?void 0:e.validationMesssage)==null?void 0:pe.english:""})}),o.jsx("div",{children:(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(ue=e==null?void 0:e.helperText)==null?void 0:ue[w==null?void 0:w.type]})})]})]})}),f&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[_===!0&&o.jsx(Wi,{visibilty:_,closeSettingFieldSidebar:ge,...t}),o.jsx(Si,{...t,fieldWrap:Y})]})},Tb=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],b4=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/,xu=/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+\$,\\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=+\$,\\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%\/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)/;function LO(t){try{JSON.parse(t)}catch{return!1}return!0}function BO(t){if(t<26)return Tb[t];{const e=Math.floor(t/26)-1,n=t%26;return Tb[e]+Tb[n]}}const Ule=t=>{var te,ee,Y,J,he,be,Ee,ye,Ae,ne,U;const{field:e,fieldIndex:n,pageIndex:r,sectionIndex:i,row:a,update:s,value:l,isDisabled:c}=t,{isPreview:u,isAdmin:d,isRenderView:f}=tn(),{task_status:h,taskRegisterData:g,updateTaskRegisterData:v,updateTaskProgressValue:m,updateUserFormDataSubmit:A,userTaskSubmitFormData:S,TASK_PUBLISHED:T}=yr(),{userSelectedLanguage:w}=un(),[E,x]=P.useState(!1),[I,_]=P.useState(""),[O,B]=P.useState(0),[M,V]=P.useState(!1),$=()=>{V(!0)},k=()=>{V(!1)};P.useEffect(()=>{E||G();const re=Jt.addListener("clearRepeatableFields",de=>{de===(a==null?void 0:a.uuid)&&(_(""),B(0),e.isValid=0)}),W=Jt.addListener("onSubmitUserForm",()=>{var de;(de=e==null?void 0:e.attributes)!=null&&de.required?I!==""&&b4.test(I)===!0?e.isValid=1:e.isValid=0:e.isValid=1});return()=>{W.remove(),re.remove()}});const[z,le]=P.useState(!1),fe=re=>{le(re)},Z=()=>{le(!1)},G=()=>{var re,W,de;if(a!=null&&a.rowIsRepeatable){if(a!=null&&a.repeatableFields){const Ce=[...a.repeatableFields],_e=_t.findIndex(Ce,function(ve){return ve.uuid===(e==null?void 0:e.uuid)});_e>=0&&Ce[_e].fieldData?_(Ce[_e].fieldData):_("")}}else{const Ce=S;if(Ce!=null&&Ce.length){for(const _e of Ce)if(_e.fieldId===t.field.uuid&&((re=_e==null?void 0:_e.postData[0])==null?void 0:re.postValue)!==""&&((W=_e==null?void 0:_e.postData[0])!=null&&W.postValue)){_((de=_e==null?void 0:_e.postData[0])==null?void 0:de.postValue),x(!0);break}}}x(!0)},ce=re=>{_(re);const W=S,de=_t.cloneDeep(g);if(W!==null){if(re!==""&&b4.test(re)===!0){if(de[e==null?void 0:e.uuid]=re,(W==null?void 0:W.length)>0)for(const Ce of W)Ce.fieldId===t.field.uuid&&(Ce.postData[0]={postValue:re})}else if(delete de[e==null?void 0:e.uuid],(W==null?void 0:W.length)>0)for(const Ce of W)Ce.fieldId===t.field.uuid&&(Ce.postData[0]={postValue:""})}if(!(a!=null&&a.rowIsRepeatable)){v(de);const Ce=Object.keys(de).length;m(Ce)}},K=(re,W,de,Ce)=>{var _e;if(_(Ce),S!==null){const ve=[...S],me=_t.findIndex(ve,function(De){return De.rowId===(a==null?void 0:a.uuid)});let we=(_e=S[me])==null?void 0:_e.repeatableFields;we={...we,[de==null?void 0:de.uuid]:Ce},ve[me]={...ve[me],repeatableFields:we},A(ve),Ce!==""&&b4.test(Ce)===!0?e.isValid=1:e.isValid=0}},ge=o.jsxs("div",{onMouseOver:$,onMouseOut:k,children:[!f&&!u&&M&&o.jsx(Xr,{handleFieldSettingsSidebar:fe,...t}),o.jsxs("div",{className:`field ${u?" ":" builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0?" card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(te=e==null?void 0:e.headerText)==null?void 0:te[w==null?void 0:w.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:n,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(da,{...t,update:s,value:l}),((ee=e==null?void 0:e.attributes)==null?void 0:ee.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",u?o.jsx(o.Fragment,{children:(Y=e==null?void 0:e.label)==null?void 0:Y[w==null?void 0:w.type]}):o.jsx(sa,{...t}),o.jsx("span",{className:"ml-2",children:(e==null?void 0:e.showToolTip)&&o.jsx(o.Fragment,{children:o.jsx(Mi,{message:(J=e==null?void 0:e.toolTip)==null?void 0:J[w==null?void 0:w.type],position:"right"})})})]}),o.jsxs("span",{className:"p-input-icon-"+(e==null?void 0:e.iconAlignment),children:[(e==null?void 0:e.showIcon)&&o.jsx("i",{className:"pi pi-"+((be=(he=e==null?void 0:e.icon)==null?void 0:he.properties)==null?void 0:be.name)}),o.jsx(bn,{id:e==null?void 0:e.uuid,placeholder:(Ee=e==null?void 0:e.placeholder)==null?void 0:Ee[w==null?void 0:w.type],value:I,onFocus:()=>B(1),onChange:re=>{a!=null&&a.rowIsRepeatable?K(r,i,{uuid:e.uuid},re.target.value):ce(re.target.value)},className:O===1&&((ye=e==null?void 0:e.attributes)!=null&&ye.required)?I?"valid":"invalid":"valid'",readOnly:c})]}),((Ae=e==null?void 0:e.attributes)==null?void 0:Ae.required)&&o.jsx("div",{children:o.jsx("small",{className:"error",children:O===1&&(I===null||I==="")?(ne=e==null?void 0:e.validationMesssage)==null?void 0:ne[w==null?void 0:w.language]:""})}),I!==""&&O===1&&b4.test(I)===!1&&o.jsx("small",{className:"error",children:"Please enter correct email"}),(e==null?void 0:e.showHelperText)&&o.jsx("div",{children:o.jsx("small",{children:(U=e==null?void 0:e.helperText)==null?void 0:U[w==null?void 0:w.type]})})]}),d&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]});return o.jsxs(o.Fragment,{children:[z===!0&&o.jsx(Wi,{visibilty:z,closeSettingFieldSidebar:Z,...t},e==null?void 0:e.uuid),o.jsx(Si,{...t,fieldWrap:ge})]})},qle=t=>{var J,he,be,Ee,ye,Ae,ne,U,re;const{field:e,fieldIndex:n,pageIndex:r,sectionIndex:i,rowIndex:a,columnIndex:s,row:l,isDisabled:c}=t,{isRenderView:u,isAdmin:d,isPreview:f}=tn(),{userSelectedLanguage:h,fieldSettingUpdate:g}=un(),{task_status:v,taskRegisterData:m,updateTaskRegisterData:A,updateTaskProgressValue:S,updateUserFormDataSubmit:T,userTaskSubmitFormData:w,TASK_PUBLISHED:E}=yr(),[x,I]=P.useState(!1),[_,O]=P.useState(""),[B,M]=P.useState(0),[V,$]=P.useState(!1),[k,z]=P.useState(!1),[le,fe]=P.useState(!1),Z=()=>{z(!0)},G=()=>{z(!1)},ce=W=>{I(W)},K=()=>{I(!1)},ge=()=>{var de,Ce,_e;const W=w;if(l!=null&&l.rowIsRepeatable){if(l!=null&&l.repeatableFields){const ve=[...l.repeatableFields],me=_t.findIndex(ve,function(we){return we.uuid===(e==null?void 0:e.uuid)});me>=0&&ve[me].fieldData?O(ve[me].fieldData):(e.isValid=0,O(""))}}else if(W!=null&&W.length){for(const ve of W)if(ve.fieldId===t.field.uuid&&((de=ve==null?void 0:ve.postData[0])!=null&&de.postValue)&&((Ce=ve==null?void 0:ve.postData[0])==null?void 0:Ce.postValue)!==""){O((_e=ve==null?void 0:ve.postData[0])==null?void 0:_e.postValue),$(!0);break}}$(!0)},te=(W,de,Ce,_e)=>{var ve;if(w!=null&&w.length){const me=[...w],we=_t.findIndex(me,function(q){return q.rowId===(l==null?void 0:l.uuid)});let De=(ve=w[we])==null?void 0:ve.repeatableFields;De={...De,[Ce==null?void 0:Ce.uuid]:_e},me[we]={...me[we],repeatableFields:De},T(me)}O(_e),_e!==""?e.isValid=1:e.isValid=0,g(W,de,a,s,n,e)};P.useEffect(()=>{V||ge();const W=Jt.addListener("clearRepeatableFields",me=>{me===(l==null?void 0:l.uuid)&&(O(""),M(0),e.isValid=0)}),de=Jt.addListener("onSubmitUserForm",()=>{var me;(me=e==null?void 0:e.attributes)!=null&&me.required?_?e.isValid=1:e.isValid=0:e.isValid=1}),Ce=Jt.addListener("OnInvalidFieldCatch",me=>{e.uuid===(me==null?void 0:me.fieldId)?M(1):M(0)}),_e=Jt.addListener("OnGetFieldValue",me=>{var De;const we=(De=me==null?void 0:me.repeatableColumn)==null?void 0:De.filter(q=>(q==null?void 0:q.fieldUuid)===(e==null?void 0:e.uuid));we!=null&&we.length}),ve=Jt.addListener("onUpdateField",()=>{fe(!le)});return()=>{ve.remove(),de.remove(),Ce.remove(),_e.remove(),W.remove()}});const ee=W=>{var _e,ve;O(W.target.value);const de=w,Ce=_t.cloneDeep(m);if(de!==null){if((_e=W==null?void 0:W.target)!=null&&_e.value){if(Ce[e==null?void 0:e.uuid]=(ve=W==null?void 0:W.target)==null?void 0:ve.value,(de==null?void 0:de.length)>0)for(const me of de)me.fieldId===t.field.uuid&&(me.postData[0]={postValue:W.target.value})}else if(delete Ce[e==null?void 0:e.uuid],(de==null?void 0:de.length)>0)for(const me of de)me.fieldId===t.field.uuid&&(me.postData[0]={postValue:""})}if(!(l!=null&&l.rowIsRepeatable)){A(Ce);const me=Object.keys(Ce).length;S(me)}},Y=o.jsxs("div",{onMouseOver:Z,onMouseOut:G,children:[!u&&!f&&k&&o.jsx(Xr,{handleFieldSettingsSidebar:ce,...t}),o.jsxs("div",{className:`field ${f?" ":" builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0?"card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:f?"col-12 ":"col-12 field-form-builder ",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(J=e==null?void 0:e.headerText)==null?void 0:J[h==null?void 0:h.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:n,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(da,{...t}),((he=e==null?void 0:e.attributes)==null?void 0:he.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",f?o.jsx(o.Fragment,{children:(be=e==null?void 0:e.label)==null?void 0:be[h==null?void 0:h.type]}):o.jsx(sa,{...t}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(Mi,{message:(Ee=e==null?void 0:e.toolTip)==null?void 0:Ee[h==null?void 0:h.type],position:"right"})})]}),o.jsx(ks,{rows:e==null?void 0:e.textareaRows,cols:e==null?void 0:e.textareaCols,autoResize:e==null?void 0:e.resizable,id:e==null?void 0:e.uuid,placeholder:(ye=e==null?void 0:e.placeholder)==null?void 0:ye[h==null?void 0:h.type],value:_,onFocus:()=>M(1),onChange:W=>{l!=null&&l.rowIsRepeatable?te(r,i,e,W.target.value):ee(W)},className:B===1&&((Ae=e==null?void 0:e.attributes)!=null&&Ae.required)?_?"valid":"invalid":"valid",readOnly:c}),o.jsx("div",{children:((ne=e==null?void 0:e.attributes)==null?void 0:ne.required)&&o.jsx("small",{className:"error",children:B===1&&!_?(U=e==null?void 0:e.validationMesssage)==null?void 0:U[h==null?void 0:h.type]:""})}),o.jsx("div",{children:(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(re=e==null?void 0:e.helperText)==null?void 0:re[h==null?void 0:h.type]})})]})}),d&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[x===!0&&o.jsx(Wi,{visibilty:x,closeSettingFieldSidebar:K,...t},e==null?void 0:e.uuid),o.jsx(Si,{...t,fieldWrap:Y})]})},$le={},Eb=t=>{var _,O,B,M;const{isAdmin:e,isAdvanceView:n,isPreview:r}=tn(),{handleDrop:i}=un(),{data:a,path:s,pageIndex:l,sectionIndex:c,rowIndex:u,columnIndex:d,conditionIndex:f,ruleIndex:h,condition:g,page:v,section:m,row:A,column:S}=t,T=P.useRef(null),[{isDragging:w},E]=ia({type:fT,item:{type:fT,uuid:a.uuid,children:a.children,path:s},collect:V=>({isDragging:V.isDragging()})}),x=w?0:1;E(T);const I=(V,$,k,z,le,fe,Z)=>{const G=t!=null&&t.fieldContainer?t==null?void 0:t.fieldContainer:"inline-condition-container";return o.jsx(tu,{type:"inline-conditional",field:V,data:V,path:$,page:v,section:m,row:A,column:S,pageIndex:k,sectionIndex:z,rowIndex:le,columnIndex:fe,fieldIndex:Z,isAdmin:e,fieldContainer:G},V.uuid)};return o.jsxs("div",{ref:r===!1?T:null,style:{...$le,opacity:x},className:"draggable column",children:[g&&((_=g.children)==null?void 0:_.length)===0&&o.jsx("p",{className:"text-primary text-center",children:"Drag item here"}),g&&g.children&&((O=g.children)==null?void 0:O.length)>0&&g.children.map((V,$)=>{var k;return o.jsxs(P.Fragment,{children:[r===!1&&o.jsx(Fr,{isAdvanceView:n,data:{path:`${s}-${h}-${f}-${$}`,childrenCount:(k=g==null?void 0:g.children)==null?void 0:k.length,droppedField:g},onDrop:i}),I(V,`${s}-${h}-${f}-${$}`,l,c,u,d,$)]},V.uuid)}),r===!1&&o.jsx(Fr,{isAdvanceView:n,fieldDropArea:!0,data:{path:`${s}-${h}-${f}-${(B=g==null?void 0:g.children)==null?void 0:B.length}`,childrenCount:(M=g==null?void 0:g.children)==null?void 0:M.length,droppedField:g},onDrop:i,isLast:!0})]})},c0=t=>{const{inputValue:e,condition:n,ruleIndex:r,conditionIndex:i,field:a,section:s,page:l,row:c,pageIndex:u,sectionIndex:d,rowIndex:f,columnIndex:h,isConditionTrue:g}=t,{taskRegisterData:v,updateUserFormDataSubmit:m,userTaskSubmitFormData:A,updateProgressDataValuesHook:S}=yr(),T=P.useCallback((w,E,x)=>{var _,O,B;const I=A;if(I!=null&&I.length){const M=v,V=(_=a==null?void 0:a.inlineConditionalRules)==null?void 0:_.rules[E].conditions[x].children;for(const[k,z]of V.entries()){(O=z==null?void 0:z.attributes)!=null&&O.required;const le=_t.findIndex(I,function(fe){return fe.fieldId===z.uuid});w?le===-1&&(I.push({postData:[],tabId:l.uuid,tabIndex:u,...a.inlineConditionalRules?{inlineConditionalRules:a.inlineConditionalRules}:{},...a.conditionalTabRules?{conditionalTabRules:a.conditionalTabRules}:{},...a.conditionalSectionRules?{conditionalSectionRules:a.conditionalSectionRules}:{},sectionId:s.uuid,sectionIndex:d,sectionHeading:s.heading,subHeadingText:s.subHeadingText,reviewerChecklist:a==null?void 0:a.reviewerChecklist,rowId:c.uuid,rowIndex:f,columnId:s.uuid,columnIndex:h,inlineConditionalField:!0,fieldIndex:k,fieldId:z.uuid,fieldInputType:a.componentType,fieldTitle:(B=a.label)==null?void 0:B.english,fieldDescription:a.description||null,fieldHelperText:a.helperText||null,fieldHeaderText:a.headerText||null,fieldFooterText:a.footerText||null,fieldTitleAbb:a.abbreviationLabel||a.label,question_abb_table:a.textForTable||null,language:"english",isHiddenfield:a.isHidden&&a.isHidden===1?1:0,isHiddenSection:s.isHidden&&s.isHidden===1?1:0}),M[z==null?void 0:z.uuid]&&delete M[z==null?void 0:z.uuid]):(M[z==null?void 0:z.uuid]&&delete M[z==null?void 0:z.uuid],le>=0&&I.splice(le,1))}const $=Object.keys(M).length;S({progressMaxValue:I==null?void 0:I.length,progressValue:$}),m(I)}},[h,a.abbreviationLabel,a.componentType,a.conditionalSectionRules,a.conditionalTabRules,a.description,a.footerText,a.headerText,a.helperText,a.inlineConditionalRules,a.isHidden,a.label,a==null?void 0:a.reviewerChecklist,a.textForTable,l.uuid,u,c.uuid,f,s.heading,s.isHidden,s.subHeadingText,s.uuid,d,v,S,m,A]);return P.useEffect(()=>(T(g,r,i),()=>{}),[i,e,g,r,T]),o.jsx("div",{children:g&&o.jsx("div",{className:"p-field p-pt-2",children:o.jsx(o.Fragment,{children:o.jsx(Eb,{...t,ruleIndex:r,conditionIndex:i,condition:n,data:a})})},i)})};function B2(t){"@babel/helpers - typeof";return B2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B2(t)}function jle(t,e){if(B2(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(B2(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function zle(t){var e=jle(t,"string");return B2(e)=="symbol"?e:e+""}function Ib(t,e,n){return(e=zle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Hle={value:"p-tag-value",icon:"p-tag-icon",root:function(e){var n=e.props;return ft("p-tag p-component",Ib(Ib({},"p-tag-".concat(n.severity),n.severity!==null),"p-tag-rounded",n.rounded))}},Yle=`
2381
+ `+Qe),U&&p4([$,k,z],Dt=>{Qe=k2(Qe,Dt," ")}),E&&me?E.createHTML(Qe):Qe},e.setConfig=function(){let ot=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dt(ot),de=!0},e.clearConfig=function(){Gt=null,de=!1},e.isValidAttribute=function(ot,Ve,rt){Gt||dt({});const Et=In(ot),zt=In(Ve);return At(Et,zt,rt)},e.addHook=function(ot,Ve){typeof Ve=="function"&&F2(V[ot],Ve)},e.removeHook=function(ot){return TO(V[ot])},e.removeHooks=function(ot){V[ot]=[]},e.removeAllHooks=function(){V=PO()},e}var v4=MO();const sa=t=>{var T;const{field:e,fieldIndex:n,pageIndex:r,sectionIndex:i,rowIndex:a,columnIndex:s,path:l}=t,[c,u]=P.useState(e);P.useEffect(()=>{var w;return A((w=e==null?void 0:e.label)==null?void 0:w[d==null?void 0:d.type]),()=>{}},[e]);const{userSelectedLanguage:d,fieldSettingUpdate:f,fieldSettingUpdateInlineConditional:h,gridComponentFieldSettingUpdate:g}=un(),v=(w,E,x)=>{u(I=>({...I,[w]:{...I[w],[E==null?void 0:E.type]:x}}))},[m,A]=P.useState((T=e==null?void 0:e.label)==null?void 0:T[d==null?void 0:d.type]);P.useEffect(()=>(S(),()=>{}),[c]);const S=()=>{const w=l.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?h(w[ma],w[va],w[xa],w[Ca],w[Ta],w[Na],w[Zo],w[Fo],c):(w==null?void 0:w.length)>Na&&(w==null?void 0:w.length)===tc+1&&(e!=null&&e.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?g(w[ma],w[va],w[xa],w[Ca],w[Ta],w[5],w[6],w[7],c):f(r,i,a,s,n,{...e,label:c==null?void 0:c.label})};return o.jsx(o.Fragment,{children:o.jsx(h4,{style:{display:"inline-block"},className:"builder-input-label-edit",html:m,disabled:!1,onChange:w=>{var E;A(v4.sanitize((E=w==null?void 0:w.target)==null?void 0:E.value))},onBlur:w=>{var x;const E=v4.sanitize((x=w==null?void 0:w.target)==null?void 0:x.innerText);A(E),v("label",d,E)},tagName:"article"})})},v1=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(w2,{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"}})})},Xr=t=>{var le,fe,Z,G;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}=tn(),g=(ce,K)=>{M(ge=>({...ge,[ce]:K}))},{fieldSettingUpdate:v,fieldSettingUpdateInlineConditional:m,cloneField:A,gridComponentFieldSettingUpdate:S,fieldSettingDeleteInlineConditional:T,gridComponentFieldDelete:w,removeField:E}=un(),{updateGlobalToast:x}=tn(),I=ce=>{const K=c.split("-").map(Number);(t==null?void 0:t.fieldContainer)==="inline-condition-container"?m(K[ma],K[va],K[xa],K[Ca],K[Ta],K[Na],K[Zo],K[Fo],ce):(K==null?void 0:K.length)>Na&&(K==null?void 0:K.length)===tc+1&&(ce!=null&&ce.componentType)&&(t==null?void 0:t.fieldContainer)==="grid-container"?S(K[ma],K[va],K[xa],K[Ca],K[Ta],K[5],K[6],K[7],ce):v(s,i,a,r,n,ce),x({showToast:!0,toastMessage:"Updated",toastDetail:"Field Updated",toastType:"success"})},[_,O]=P.useState(!1),[B,M]=P.useState({custom_component_title:"",custom_component_description:""}),V=()=>{M(ce=>({...ce,custom_component_schema:e})),O(!0)},$=()=>{const ce=c.split("-").map(Number);l==="inline-conditional"?T(ce[ma],ce[va],ce[xa],ce[Ca],ce[Ta],ce[Na],ce[Zo],ce[Fo]):(ce==null?void 0:ce.length)>Na&&(ce==null?void 0:ce.length)===tc+1&&(e!=null&&e.componentType)&&l==="grid"?w(ce[ma],ce[va],ce[xa],ce[Ca],ce[Ta],ce[5],ce[6],ce[7]):E(s,i,a,r,n)},k=(ce,K)=>{const ge={...e,attributes:{...e.attributes,[ce]:K}};I(ge)},z=(ce,K)=>{const ge={...e,[ce]:K};I(ge)};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)!=="href"&&(e==null?void 0:e.componentType)!=="paragraph"&&(e==null?void 0:e.componentType)!=="heading"&&(e==null?void 0:e.componentType)!=="list"&&(e==null?void 0:e.componentType)!=="hr"&&(e==null?void 0:e.componentType)!=="image-gallery"&&(e==null?void 0:e.componentType)!=="video"&&(e==null?void 0:e.componentType)!=="question"?"builder-element-quick-options mb-2 w-9 justify-content-between":"builder-element-quick-options mb-2 w-4 justify-content-center"} flex quick-setting`,children:[o.jsx(o.Fragment,{children:(e==null?void 0:e.componentType)!=="hidden-field"&&(e==null?void 0:e.componentType)!=="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===!0&&o.jsxs("div",{className:" ",children:[o.jsx(v1,{field:e,onHandleChangeSetttings:k,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:(fe=e==null?void 0:e.attributes)==null?void 0:fe.required}),o.jsx(v1,{field:e,onHandleChangeSetttings:z,settingsKey:"showToolTip",settingsKeyValue:e==null?void 0:e.showToolTip,onLabel:"Tooltip",offLabel:"Tooltip",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showToolTip}),o.jsx(v1,{field:e,onHandleChangeSetttings:z,settingsKey:"showHelperText",settingsKeyValue:e==null?void 0:e.showHelperText,onLabel:"Helper text",offLabel:"Helper text",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showHelperText}),o.jsx(v1,{field:e,onHandleChangeSetttings:z,settingsKey:"showHeaderText",settingsKeyValue:e==null?void 0:e.showHeaderText,onLabel:"Header text",offLabel:"Header text",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showHeaderText}),o.jsx(v1,{field:e,onHandleChangeSetttings:z,settingsKey:"isFluid",settingsKeyValue:e==null?void 0:e.isFluid,onLabel:"Fluid",offLabel:"Fluid",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.isFluid}),(e==null?void 0:e.componentType)=="radio"&&o.jsxs(o.Fragment,{children:[o.jsx(v1,{field:e,onHandleChangeSetttings:z,settingsKey:"showAlphabetList",settingsKeyValue:e==null?void 0:e.showAlphabetList,onLabel:"Alpha",offLabel:"Alpha",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:e==null?void 0:e.showAlphabetList}),o.jsx(v1,{field:e,onHandleChangeSetttings:k,settingsKey:"style",settingsKeyValue:(Z=e==null?void 0:e.attributes)==null?void 0:Z.style,onLabel:"Style",offLabel:"Style",onIcon:"pi pi-eye",offIcon:"pi pi-eye-slash",defaultState:(G=e==null?void 0:e.attributes)==null?void 0:G.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(Ft,{text:!0,size:"small",label:"Advance Settings",icon:"pi pi-cog",onClick:()=>{u(!0)},className:"mr-3"}),o.jsx(Ft,{size:"small",text:!0,icon:"pi pi-clone",outlined:!0,onClick:()=>{A(e,s,i,a,r,n),h()}}),o.jsx(Ft,{text:!0,size:"small",outlined:!0,icon:"pi pi-trash",onClick:()=>{$()}}),o.jsx(Ft,{text:!0,size:"small",outlined:!0,icon:"pi pi-file",onClick:()=>{V()}})]}),o.jsxs(Ts,{maximizable:!0,header:"Custom component save",visible:_,style:{width:"20vw"},footer:()=>o.jsx(o.Fragment,{children:o.jsxs("div",{children:[o.jsx(Ft,{size:"small",text:!0,label:"Close",icon:"pi pi-times",onClick:()=>O(!1),className:"p-button-text"}),(e==null?void 0:e.componentType)!=="hidden-field"&&o.jsx(Ft,{text:!0,label:"Save",icon:"pi pi-check",onClick:()=>{O(!1)},autoFocus:!0})]})}),onHide:()=>O(!1),children:[o.jsxs("span",{className:"p-float-label",children:[o.jsx(bn,{id:"custom_component_title",name:"custom_component_title",className:"w-full",value:(B==null?void 0:B.custom_component_title)||"",onChange:ce=>{var K;return g("custom_component_title",(K=ce==null?void 0:ce.target)==null?void 0:K.value)}}),o.jsx("label",{htmlFor:"username",children:"Custom component title"})]}),o.jsxs("span",{className:"p-float-label mt-5",children:[o.jsx(ks,{id:"custom_component_description",name:"custom_component_description",className:"w-full",value:(B==null?void 0:B.custom_component_description)||"",onChange:ce=>{var K;return g("custom_component_description",(K=ce==null?void 0:ce.target)==null?void 0:K.value)}}),o.jsx("label",{htmlFor:"username",children:"Custom component description"})]})]})]})]})})},Fle=t=>{var J,he,be,Ee,ye,Ae,ne,U;const{pageIndex:e,sectionIndex:n,field:r,fieldIndex:i,row:a,rowIndex:s,columnIndex:l,isDisabled:c}=t,{isAdmin:u,isRenderView:d,isPreview:f}=tn(),{userSelectedLanguage:h,fieldSettingUpdate:g}=un(),{task_status:v,taskRegisterData:m,updateTaskRegisterData:A,updateTaskProgressValue:S,updateUserFormDataSubmit:T,userTaskSubmitFormData:w,TASK_PUBLISHED:E}=yr(),[x,I]=P.useState(!1),[_,O]=P.useState(!1),[B,M]=P.useState(null),[V,$]=P.useState(0),[k,z]=P.useState(!1),le=()=>{z(!0)},fe=()=>{z(!1)},Z=re=>{I(re)},G=()=>{I(!1)},ce=()=>{var re,W,de;if(a!=null&&a.rowIsRepeatable){if(a!=null&&a.repeatableFields){const Ce=[...a.repeatableFields],_e=_t.findIndex(Ce,function(ve){return ve.uuid===(r==null?void 0:r.uuid)});_e>=0&&Ce[_e].fieldData?M(Ce[_e].fieldData):(r.isValid=0,M(null))}}else{const Ce=w,_e=_t.cloneDeep(m);if(Ce!=null&&Ce.length){for(const ve of Ce)if(ve.fieldId===t.field.uuid&&((re=ve==null?void 0:ve.postData)!=null&&re.length)){M((W=ve==null?void 0:ve.postData[0])==null?void 0:W.postValue),_e[r==null?void 0:r.uuid]=(de=ve==null?void 0:ve.postData[0])==null?void 0:de.postValue;const me=Object.keys(_e).length;S(me);break}}}O(!0)},K=re=>{var _e;M(re.target.value);const W=w,de=_t.cloneDeep(m);if((_e=re==null?void 0:re.target)!=null&&_e.value&&(W==null?void 0:W.length)>0)for(const ve of W)ve.fieldId===t.field.uuid&&(de[r==null?void 0:r.uuid]=re==null?void 0:re.value,ve.postData[0]={postValue:re.value});else delete de[r==null?void 0:r.uuid];A(de);const Ce=Object.keys(de).length;S(Ce)};P.useEffect(()=>{_||ce();const re=Jt.addListener("clearRepeatableFields",Ce=>{Ce===(a==null?void 0:a.uuid)&&(M(""),$(0),r.isValid=0,g(e,n,s,l,i,r))}),W=Jt.addListener("onSubmitUserForm",()=>{var Ce;(Ce=r==null?void 0:r.attributes)!=null&&Ce.required?B?r.isValid=1:r.isValid=0:r.isValid=1}),de=Jt.addListener("OnInvalidFieldCatch",Ce=>{console.log("OnInvalidFieldCatch listener"),console.log("field.uuid === value?.fieldId",r.uuid===(Ce==null?void 0:Ce.fieldId)),r.uuid===(Ce==null?void 0:Ce.fieldId)?$(1):$(0)});return()=>{W.remove(),de.remove(),re.remove()}});const ge=(re,W)=>{var de;if(w){const Ce=[...w],_e=_t.findIndex(Ce,function(me){return me.rowId===(a==null?void 0:a.uuid)});let ve=(de=w[_e])==null?void 0:de.repeatableFields;ve={...ve,[re==null?void 0:re.uuid]:W},Ce[_e]={...Ce[_e],repeatableFields:ve},T(Ce)}M(W),W!==null?re.isValid=1:re.isValid=0},te=(re,W)=>re?o.jsxs("div",{className:"country-item flex",children:[o.jsx("img",{alt:re.name,src:re==null?void 0:re.image,onError:de=>de.target.src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png",style:{width:"20px",marginRight:10}}),o.jsx("div",{children:re.name})]}):o.jsx("span",{children:W.placeholder}),ee=re=>o.jsxs("div",{className:"country-item flex",children:[o.jsx("img",{alt:re.name,src:re==null?void 0:re.image,onError:W=>W.target.src="https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png",style:{width:"20px",marginRight:10}}),o.jsx("div",{children:re.name})]});console.log("field?.validationMesssage",r==null?void 0:r.validationMesssage);const Y=o.jsxs("div",{onMouseOver:le,onMouseOut:fe,children:[!d&&!f&&k&&o.jsx(Xr,{handleFieldSettingsSidebar:Z,...t}),o.jsxs("div",{className:`field ${f?" ":" builder-element-wrapper "}${(r==null?void 0:r.isFluid)===!0?" card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:f?"col-12 ":"field-form-builder col-12 ",children:[(r==null?void 0:r.showHeaderText)&&o.jsx("h6",{children:(J=r==null?void 0:r.headerText)==null?void 0:J[h==null?void 0:h.type]}),(r==null?void 0:r.showLabel)&&o.jsxs("label",{htmlFor:i,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(da,{...t}),((he=r==null?void 0:r.attributes)==null?void 0:he.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",f?o.jsx(o.Fragment,{children:(be=r==null?void 0:r.label)==null?void 0:be[h==null?void 0:h.type]}):o.jsx(sa,{...t}),o.jsx("span",{className:"ml-3",children:(r==null?void 0:r.showToolTip)&&o.jsx(Mi,{message:(Ee=r==null?void 0:r.toolTip)==null?void 0:Ee[h==null?void 0:h.type],position:"right"})})]}),o.jsx(Oa,{className:"country-select-builder-component",onFocus:()=>$(1),onChange:re=>{a!=null&&a.rowIsRepeatable?ge(r,re.target.value):K(re)},options:r==null?void 0:r.countries,optionLabel:"name",value:B,placeholder:(ye=r==null?void 0:r.placeholder)==null?void 0:ye[h==null?void 0:h.type],disabled:c,valueTemplate:te,itemTemplate:ee,filter:!0,filterBy:"name",showClear:!0}),((Ae=r==null?void 0:r.attributes)==null?void 0:Ae.required)&&o.jsx("small",{className:"error",children:V===1&&B===null?((ne=r==null?void 0:r.validationMesssage)==null?void 0:ne[h==null?void 0:h.type])||"field is required":""}),o.jsx("div",{children:(r==null?void 0:r.showHelperText)&&o.jsx("small",{children:(U=r==null?void 0:r.helperText)==null?void 0:U[h==null?void 0:h.type]})})]})}),u&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[x===!0&&o.jsx(Wi,{visibilty:x,closeSettingFieldSidebar:G,...t},r==null?void 0:r.uuid),o.jsx(Si,{...t,fieldWrap:Y})]})},kle=t=>{var J,he,be,Ee,ye,Ae,ne,U,re,W,de,Ce,_e,ve,me;const{taskRegisterData:e,updateTaskRegisterData:n,updateTaskProgressValue:r,updateUserFormDataSubmit:i,userTaskSubmitFormData:a,task_status:s,TASK_PUBLISHED:l}=yr(),{userSelectedLanguage:c,fieldSettingUpdate:u}=un(),{field:d,fieldIndex:f,sectionIndex:h,pageIndex:g,row:v,rowIndex:m,columnIndex:A,isDisabled:S}=t,{isAdmin:T,isRenderView:w,isPreview:E}=tn(),[x,I]=P.useState(!1),[_,O]=P.useState(""),[B,M]=P.useState(null),[V,$]=P.useState(0),[k,z]=P.useState(!1),[le,fe]=P.useState(!1),Z=()=>{fe(!0)},G=()=>{fe(!1)},ce=()=>{var we,De,q;if(v!=null&&v.rowIsRepeatable){if(v!=null&&v.repeatableFields){const se=[...v.repeatableFields],pe=_t.findIndex(se,function(ue){return ue.uuid===(d==null?void 0:d.uuid)});pe>=0&&se[pe].fieldData?O(se[pe].fieldData):O("")}}else{const se=a;if(se!=null&&se.length){for(const pe of se)if(pe.fieldId===t.field.uuid&&((we=pe==null?void 0:pe.postData[0])==null?void 0:we.postValue)!==""&&((De=pe==null?void 0:pe.postData[0])!=null&&De.postValue)){O((q=pe==null?void 0:pe.postData[0])==null?void 0:q.postValue);break}}}z(!0)};P.useEffect(()=>{k||ce();const we=Jt.addListener("clearRepeatableFields",ue=>{ue===(v==null?void 0:v.uuid)&&(O(""),$(0),d.isValid=0,u(g,h,m,A,f,d))}),De=Jt.addListener("onSubmitUserForm",()=>{var ue,oe;(ue=d==null?void 0:d.attributes)!=null&&ue.required?_&&_.length&&(_==null?void 0:_.length)<((oe=d==null?void 0:d.attributes)==null?void 0:oe.minLength)?d.isValid=1:d.isValid=0:d.isValid=1}),q=Jt.addListener("OnInvalidFieldCatch",ue=>{d.uuid===(ue==null?void 0:ue.fieldId)?$(1):$(0)}),se=Jt.addListener("OnGetFieldValue",ue=>{var ae;const oe=(ae=ue==null?void 0:ue.repeatableColumn)==null?void 0:ae.filter(Oe=>(Oe==null?void 0:Oe.fieldUuid)===(d==null?void 0:d.uuid));oe!=null&&oe.length}),pe=Jt.addListener("formFieldAdded",ue=>{B===null&&M(ue==null?void 0:ue.uuid)});return()=>{De.remove(),q.remove(),se.remove(),we.remove(),pe.remove()}}),P.useEffect(()=>(B!==null&&setTimeout(()=>{M(null)},1e3),()=>{}),[B]);const K=we=>{I(we)},ge=()=>{I(!1)},te=we=>{var se,pe;O(we.target.value);const De=a,q=_t.cloneDeep(e);if(De!==null){if((se=we==null?void 0:we.target)!=null&&se.value){if(q[d==null?void 0:d.uuid]=(pe=we==null?void 0:we.target)==null?void 0:pe.value,(De==null?void 0:De.length)>0)for(const ue of De)ue.fieldId===t.field.uuid&&(ue.postData[0]={postValue:we.target.value})}else if(delete q[d==null?void 0:d.uuid],(De==null?void 0:De.length)>0)for(const ue of De)ue.fieldId===t.field.uuid&&(ue.postData[0]={postValue:""})}if(console.log("row?.rowIsRepeatable",v==null?void 0:v.rowIsRepeatable),!(v!=null&&v.rowIsRepeatable)){n(q);const ue=Object.keys(q).length;r(ue)}},ee=(we,De)=>{var q;if(a){const se=[...a],pe=_t.findIndex(se,function(oe){return oe.rowId===(v==null?void 0:v.uuid)});let ue=(q=a[pe])==null?void 0:q.repeatableFields;ue={...ue,[we==null?void 0:we.uuid]:De},se[pe]={...se[pe],repeatableFields:ue},i(se)}O(De),De!==""?we.isValid=1:we.isValid=0},Y=o.jsxs("div",{onMouseOver:Z,onMouseOut:G,children:[!w&&!E&&le&&o.jsx(Xr,{handleFieldSettingsSidebar:K,...t}),o.jsxs("div",{className:`field ${E?" ":" builder-element-wrapper "} ${(d==null?void 0:d.isFluid)===!0?" p-fluid ":""} ${w?" ":" py-6 px-4 "} ${B===(d==null?void 0:d.uuid)?" new-field ":" card "} `,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:T?"col-6 ":"col-12 p-fluid",children:[(d==null?void 0:d.showHeaderText)&&o.jsx("h6",{children:(J=d==null?void 0:d.headerText)==null?void 0:J[c==null?void 0:c.type]}),(d==null?void 0:d.showLabel)&&o.jsxs("label",{htmlFor:d==null?void 0:d.uuid,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(da,{...t}),((he=d==null?void 0:d.attributes)==null?void 0:he.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",E?o.jsx(o.Fragment,{children:(be=d==null?void 0:d.label)==null?void 0:be[c==null?void 0:c.type]}):o.jsx(sa,{...t}),(d==null?void 0:d.showToolTip)&&o.jsx("span",{className:"ml-3",children:o.jsx(Mi,{message:(Ee=d==null?void 0:d.toolTip)==null?void 0:Ee[c==null?void 0:c.type],position:"right"})})]}),o.jsxs("div",{className:"mt-3",children:[o.jsxs("span",{className:"p-input-icon-"+(d==null?void 0:d.iconAlignment),children:[(d==null?void 0:d.showIcon)&&o.jsx("i",{className:"pi pi-"+((Ae=(ye=d==null?void 0:d.icon)==null?void 0:ye.properties)==null?void 0:Ae.name)}),o.jsx(bn,{id:d==null?void 0:d.uuid,placeholder:(ne=d==null?void 0:d.placeholder)==null?void 0:ne[c==null?void 0:c.type],minLength:(U=d==null?void 0:d.attributes)==null?void 0:U.minLength,maxLength:(re=d==null?void 0:d.attributes)==null?void 0:re.maxLength,value:_,onFocus:()=>$(1),onChange:we=>{v!=null&&v.rowIsRepeatable?ee(d,we.target.value):te(we)},className:V===1&&((W=d==null?void 0:d.attributes)!=null&&W.required)?_?"valid":"invalid":"valid'",readOnly:S})]}),o.jsx("div",{children:((de=d==null?void 0:d.attributes)==null?void 0:de.required)&&o.jsxs(o.Fragment,{children:[o.jsx("small",{className:"error",children:V===1&&!_?(Ce=d==null?void 0:d.validationMesssage)==null?void 0:Ce.english:""}),o.jsx("small",{className:"error",children:V===1&&_.length&&(_==null?void 0:_.length)<((_e=d==null?void 0:d.attributes)==null?void 0:_e.minLength)?`Mini length ${(ve=d==null?void 0:d.attributes)==null?void 0:ve.minLength}`:""})]})}),o.jsx("div",{children:(d==null?void 0:d.showHelperText)&&o.jsx("small",{children:(me=d==null?void 0:d.helperText)==null?void 0:me[c==null?void 0:c.type]})})]})]})}),T&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[x===!0&&o.jsx(Wi,{visibilty:x,closeSettingFieldSidebar:ge,...t}),o.jsx(Si,{...t,fieldWrap:Y})]})},Ple=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:"Href Text"}),o.jsx(bn,{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:"Hyper link"}),o.jsx(bn,{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)})]})]})},Mle=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:"Hyper link color"}),o.jsx(o0,{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(bn,{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(Br,{checked:n==null?void 0:n.underLined,onChange:i=>{e("underLined",i.checked)}}),o.jsx("label",{children:"Underline link"})]})]})},Lle=t=>{const{visibilty:e,field:n,closeSettingFieldSidebar:r,pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c}=t,[u,d]=P.useState(n),{fieldSettingUpdate:f,formBuilderSchemaLanguages:h,formBuilderPublishedStatus:g}=un(),{updateGlobalToast:v}=tn(),m=(T,w,E)=>{d(x=>({...x,[T]:{...x[T],[w==null?void 0:w.type]:E}}))},A=(T,w)=>{d(E=>({...E,[T]:w}))},S=()=>{f(i,a,s,l,c,u),v({showToast:!0,toastMessage:"Updated",toastDetail:"Html Updated",toastType:"success"})};return o.jsx(o.Fragment,{children:o.jsxs(Vo,{visible:e,position:"left",className:"p-sidebar-lg",onHide:()=>r(),children:[o.jsxs("div",{className:"flex justify-content-between flex-wrap card-container ",children:[o.jsxs("div",{className:"flex align-items-center justify-content-center ",children:[" ",o.jsxs("h5",{className:"mb-0",children:[t==null?void 0:t.typeName," settings "]})]}),!g&&o.jsx("div",{className:"flex align-items-center justify-content-center",children:o.jsx(Ft,{className:"mt-3",label:"Update",onClick:()=>S(),"aria-label":"Update"})})]}),o.jsxs(Za,{children:[o.jsx(fr,{header:"Text",children:o.jsx(fo,{activeIndex:0,children:h!=null&&h.length?h.map((T,w)=>o.jsx(uo,{tabIndex:w,header:T==null?void 0:T.language,children:o.jsx(Ple,{language:T,fieldState:u,onHandleChange:m,...t})},w)):""})}),o.jsx(fr,{header:"Styling",children:o.jsx(Mle,{fieldState:u,onHandleChangeStyling:A,...t})})]})]})})},Ble=t=>{var g,v,m,A,S,T,w,E,x;const{field:e}=t,{userSelectedLanguage:n}=un(),{isPreview:r}=tn(),[i,a]=P.useState(!1),[s,l]=P.useState(!1),c=()=>{l(!0)},u=()=>{l(!1)},d=I=>{a(I)},f=()=>{a(!1)};P.useEffect(()=>{},[e]);const h=o.jsxs("div",{className:r?"":"builder-element-wrapper",onMouseOver:c,onMouseOut:u,children:[!r&&s&&o.jsx(Xr,{handleFieldSettingsSidebar:d,...t}),o.jsxs("div",{className:r?" px-4":"field-form-builder px-4",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(g=e==null?void 0:e.headerText)==null?void 0:g[n==null?void 0:n.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:e.uuid,className:"flex font-medium mb-3 text-700 text-2xl",children:[((v=e==null?void 0:e.attributes)==null?void 0:v.required)&&o.jsx("span",{className:"must-required",children:"*"})," ",r?o.jsx(o.Fragment,{children:(m=e==null?void 0:e.label)==null?void 0:m[n==null?void 0:n.type]}):o.jsx(sa,{...t}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(Mi,{message:(A=e==null?void 0:e.toolTip)==null?void 0:A[n==null?void 0:n.type],position:"right"})})]}),o.jsx("a",{style:{fontSize:parseInt(e==null?void 0:e.fontSize),color:`#${e==null?void 0:e.color}`,textDecoration:e!=null&&e.underLined?"underline":"none"},className:"atag-style",href:(S=e==null?void 0:e.hrefLink)==null?void 0:S[n==null?void 0:n.type],children:(T=e==null?void 0:e.text)==null?void 0:T[n==null?void 0:n.type]}),((w=e==null?void 0:e.attributes)==null?void 0:w.required)&&o.jsx("small",{className:"error",children:(E=e==null?void 0:e.validationMesssage)==null?void 0:E[n==null?void 0:n.type]}),(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(x=e==null?void 0:e.helperText)==null?void 0:x[n==null?void 0:n.type]})]})]});return o.jsxs(o.Fragment,{children:[o.jsx(Lle,{visibilty:i,closeSettingFieldSidebar:f,...t}),o.jsx(Si,{...t,fieldWrap:h})]})},Vle=t=>{var J,he,be,Ee,ye,Ae,ne,U,re,W,de,Ce,_e,ve,me,we,De,q,se,pe,ue;const{field:e,fieldIndex:n,sectionIndex:r,pageIndex:i,row:a,rowIndex:s,columnIndex:l,isDisabled:c}=t,{isPreview:u,isRenderView:d,isAdmin:f}=tn(),{taskRegisterData:h,updateTaskRegisterData:g,updateTaskProgressValue:v,updateUserFormDataSubmit:m,userTaskSubmitFormData:A,TASK_PUBLISHED:S,task_status:T}=yr(),{userSelectedLanguage:w,fieldSettingUpdate:E}=un(),[x,I]=P.useState(null),[_,O]=P.useState(!1),[B,M]=P.useState(null),[V,$]=P.useState(0),[k,z]=P.useState(!1),[le,fe]=P.useState(!1),Z=()=>{fe(!0)},G=()=>{fe(!1)},ce=()=>{var oe,ae;if(a!=null&&a.rowIsRepeatable){if(a!=null&&a.repeatableFields){const Oe=[...a.repeatableFields],Ne=_t.findIndex(Oe,function(Ke){return Ke.uuid===(e==null?void 0:e.uuid)});Ne>=0&&Oe[Ne].fieldData?M(Number(Oe[Ne].fieldData)||null):M(null)}}else{const Oe=A;if(Oe!=null&&Oe.length){for(const Ne of Oe)if(Ne.fieldId===t.field.uuid&&((oe=Ne==null?void 0:Ne.postData)!=null&&oe.length)){M(Number((ae=Ne==null?void 0:Ne.postData[0])==null?void 0:ae.postValue)||null);break}}}z(!0)};P.useEffect(()=>{k||ce();const oe=Jt.addListener("clearRepeatableFields",ut=>{ut===(a==null?void 0:a.uuid)&&(M(null),$(0),e.isValid=0,E(i,r,s,l,n,e))}),ae=Jt.addListener("onSubmitUserForm",()=>{var ut;(ut=e==null?void 0:e.attributes)!=null&&ut.required?B?e.isValid=1:e.isValid=0:e.isValid=1}),Oe=Jt.addListener("OnInvalidFieldCatch",ut=>{e.uuid===(ut==null?void 0:ut.fieldId)?$(1):$(0)}),Ne=Jt.addListener("OnGetFieldValue",ut=>{var ht;const pt=(ht=ut==null?void 0:ut.repeatableColumn)==null?void 0:ht.filter(kt=>(kt==null?void 0:kt.fieldUuid)===(e==null?void 0:e.uuid));pt!=null&&pt.length}),Ke=Jt.addListener("formFieldAdded",ut=>{x===null&&I(ut.uuid)});return()=>{ae.remove(),Oe.remove(),Ne.remove(),oe.remove(),Ke.remove()}}),P.useEffect(()=>(x!==null&&setTimeout(()=>{I(null)},1e3),()=>{}),[x]);const K=oe=>{O(oe)},ge=()=>{O(!1)},te=oe=>{const ae=A,Oe=_t.cloneDeep(h);if(ae!==null){if(oe){if(Oe[e==null?void 0:e.uuid]=oe,(ae==null?void 0:ae.length)>0)for(const Ne of ae)Ne.fieldId===t.field.uuid&&(Ne.postData[0]={postValue:oe})}else if(delete Oe[e==null?void 0:e.uuid],(ae==null?void 0:ae.length)>0)for(const Ne of ae)Ne.fieldId===t.field.uuid&&(Ne.postData[0]={postValue:""})}if(!(a!=null&&a.rowIsRepeatable)){g(Oe);const Ne=Object.keys(Oe).length;v(Ne)}},ee=(oe,ae)=>{var Oe;if(A!=null&&A.length){const Ne=[...A],Ke=_t.findIndex(Ne,function(pt){return pt.rowId===(a==null?void 0:a.uuid)});let ut=(Oe=A[Ke])==null?void 0:Oe.repeatableFields;ut={...ut,[oe==null?void 0:oe.uuid]:ae},Ne[Ke]={...Ne[Ke],repeatableFields:ut},m(Ne)}M(ae),ae!==""?oe.isValid=1:oe.isValid=0},Y=o.jsxs("div",{onMouseOver:Z,onMouseOut:G,children:[!d&&!u&&le&&o.jsx(Xr,{handleFieldSettingsSidebar:K,...t}),o.jsxs("div",{className:`field ${u?" ":" builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0?" p-fluid py-6 px-4":" py-6 px-4"} ${x===(e==null?void 0:e.uuid)?" new-field ":" card "}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:f?"col-6 ":"col-12 p-fluid",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(J=e==null?void 0:e.headerText)==null?void 0:J[w==null?void 0:w.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:e.uuid,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(da,{...t}),((he=e==null?void 0:e.attributes)==null?void 0:he.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",u?o.jsx(o.Fragment,{children:(be=e==null?void 0:e.label)==null?void 0:be[w==null?void 0:w.type]}):o.jsx(sa,{...t}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(Mi,{message:(Ee=e==null?void 0:e.toolTip)==null?void 0:Ee[w==null?void 0:w.type],position:"right"})})]}),o.jsxs("div",{className:"mt-3",children:[o.jsxs("span",{className:"p-input-icon-"+(e==null?void 0:e.iconAlignment),children:[(e==null?void 0:e.showIcon)&&o.jsx("i",{className:"pi pi-"+((Ae=(ye=e==null?void 0:e.icon)==null?void 0:ye.properties)==null?void 0:Ae.name)}),o.jsx(Ba,{readOnly:c,id:e==null?void 0:e.uuid,placeholder:(ne=e==null?void 0:e.placeholder)==null?void 0:ne[w==null?void 0:w.type],value:B,min:(U=e==null?void 0:e.attributes)==null?void 0:U.min,max:e==null?void 0:e.attributes.max,suffix:e==null?void 0:e.attributes.suffix,prefix:(re=e==null?void 0:e.attributes)==null?void 0:re.prefix,showButtons:(W=e==null?void 0:e.attributes)==null?void 0:W.showButtons,pt:{incrementButton:{className:"bg-teal-500 border-teal-500"},decrementButton:{className:"bg-orange-500 border-orange-500"}},minFractionDigits:(de=e==null?void 0:e.attributes)==null?void 0:de.minFractionDigits,maxFractionDigits:(Ce=e==null?void 0:e.attributes)==null?void 0:Ce.maxFractionDigits,locale:(_e=e==null?void 0:e.attributes)==null?void 0:_e.locale,mode:(ve=e==null?void 0:e.attributes)==null?void 0:ve.mode,currency:(me=e==null?void 0:e.attributes)==null?void 0:me.currency,currencyDisplay:(we=e==null?void 0:e.attributes)==null?void 0:we.currencyDisplay,useGrouping:(De=e==null?void 0:e.attributes)==null?void 0:De.useGrouping,onFocus:()=>$(1),onChange:oe=>{a!=null&&a.rowIsRepeatable?ee(e,oe.value):te(oe.value)},className:V===1&&((q=e==null?void 0:e.attributes)!=null&&q.required)?B?"valid":"invalid":"valid'"})]}),o.jsx("div",{children:((se=e==null?void 0:e.attributes)==null?void 0:se.required)&&o.jsx("small",{className:"error",children:V===1&&!B?(pe=e==null?void 0:e.validationMesssage)==null?void 0:pe.english:""})}),o.jsx("div",{children:(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(ue=e==null?void 0:e.helperText)==null?void 0:ue[w==null?void 0:w.type]})})]})]})}),f&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[_===!0&&o.jsx(Wi,{visibilty:_,closeSettingFieldSidebar:ge,...t}),o.jsx(Si,{...t,fieldWrap:Y})]})},Tb=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],b4=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/,xu=/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+\$,\\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=+\$,\\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%\/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)/;function LO(t){try{JSON.parse(t)}catch{return!1}return!0}function BO(t){if(t<26)return Tb[t];{const e=Math.floor(t/26)-1,n=t%26;return Tb[e]+Tb[n]}}const Ule=t=>{var te,ee,Y,J,he,be,Ee,ye,Ae,ne,U;const{field:e,fieldIndex:n,pageIndex:r,sectionIndex:i,row:a,update:s,value:l,isDisabled:c}=t,{isPreview:u,isAdmin:d,isRenderView:f}=tn(),{task_status:h,taskRegisterData:g,updateTaskRegisterData:v,updateTaskProgressValue:m,updateUserFormDataSubmit:A,userTaskSubmitFormData:S,TASK_PUBLISHED:T}=yr(),{userSelectedLanguage:w}=un(),[E,x]=P.useState(!1),[I,_]=P.useState(""),[O,B]=P.useState(0),[M,V]=P.useState(!1),$=()=>{V(!0)},k=()=>{V(!1)};P.useEffect(()=>{E||G();const re=Jt.addListener("clearRepeatableFields",de=>{de===(a==null?void 0:a.uuid)&&(_(""),B(0),e.isValid=0)}),W=Jt.addListener("onSubmitUserForm",()=>{var de;(de=e==null?void 0:e.attributes)!=null&&de.required?I!==""&&b4.test(I)===!0?e.isValid=1:e.isValid=0:e.isValid=1});return()=>{W.remove(),re.remove()}});const[z,le]=P.useState(!1),fe=re=>{le(re)},Z=()=>{le(!1)},G=()=>{var re,W,de;if(a!=null&&a.rowIsRepeatable){if(a!=null&&a.repeatableFields){const Ce=[...a.repeatableFields],_e=_t.findIndex(Ce,function(ve){return ve.uuid===(e==null?void 0:e.uuid)});_e>=0&&Ce[_e].fieldData?_(Ce[_e].fieldData):_("")}}else{const Ce=S;if(Ce!=null&&Ce.length){for(const _e of Ce)if(_e.fieldId===t.field.uuid&&((re=_e==null?void 0:_e.postData[0])==null?void 0:re.postValue)!==""&&((W=_e==null?void 0:_e.postData[0])!=null&&W.postValue)){_((de=_e==null?void 0:_e.postData[0])==null?void 0:de.postValue),x(!0);break}}}x(!0)},ce=re=>{_(re);const W=S,de=_t.cloneDeep(g);if(W!==null){if(re!==""&&b4.test(re)===!0){if(de[e==null?void 0:e.uuid]=re,(W==null?void 0:W.length)>0)for(const Ce of W)Ce.fieldId===t.field.uuid&&(Ce.postData[0]={postValue:re})}else if(delete de[e==null?void 0:e.uuid],(W==null?void 0:W.length)>0)for(const Ce of W)Ce.fieldId===t.field.uuid&&(Ce.postData[0]={postValue:""})}if(!(a!=null&&a.rowIsRepeatable)){v(de);const Ce=Object.keys(de).length;m(Ce)}},K=(re,W,de,Ce)=>{var _e;if(_(Ce),S!==null){const ve=[...S],me=_t.findIndex(ve,function(De){return De.rowId===(a==null?void 0:a.uuid)});let we=(_e=S[me])==null?void 0:_e.repeatableFields;we={...we,[de==null?void 0:de.uuid]:Ce},ve[me]={...ve[me],repeatableFields:we},A(ve),Ce!==""&&b4.test(Ce)===!0?e.isValid=1:e.isValid=0}},ge=o.jsxs("div",{onMouseOver:$,onMouseOut:k,children:[!f&&!u&&M&&o.jsx(Xr,{handleFieldSettingsSidebar:fe,...t}),o.jsxs("div",{className:`field ${u?" ":" builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0?" card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(te=e==null?void 0:e.headerText)==null?void 0:te[w==null?void 0:w.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:n,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(da,{...t,update:s,value:l}),((ee=e==null?void 0:e.attributes)==null?void 0:ee.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",u?o.jsx(o.Fragment,{children:(Y=e==null?void 0:e.label)==null?void 0:Y[w==null?void 0:w.type]}):o.jsx(sa,{...t}),o.jsx("span",{className:"ml-2",children:(e==null?void 0:e.showToolTip)&&o.jsx(o.Fragment,{children:o.jsx(Mi,{message:(J=e==null?void 0:e.toolTip)==null?void 0:J[w==null?void 0:w.type],position:"right"})})})]}),o.jsxs("span",{className:"p-input-icon-"+(e==null?void 0:e.iconAlignment),children:[(e==null?void 0:e.showIcon)&&o.jsx("i",{className:"pi pi-"+((be=(he=e==null?void 0:e.icon)==null?void 0:he.properties)==null?void 0:be.name)}),o.jsx(bn,{id:e==null?void 0:e.uuid,placeholder:(Ee=e==null?void 0:e.placeholder)==null?void 0:Ee[w==null?void 0:w.type],value:I,onFocus:()=>B(1),onChange:re=>{a!=null&&a.rowIsRepeatable?K(r,i,{uuid:e.uuid},re.target.value):ce(re.target.value)},className:O===1&&((ye=e==null?void 0:e.attributes)!=null&&ye.required)?I?"valid":"invalid":"valid'",readOnly:c})]}),((Ae=e==null?void 0:e.attributes)==null?void 0:Ae.required)&&o.jsx("div",{children:o.jsx("small",{className:"error",children:O===1&&(I===null||I==="")?(ne=e==null?void 0:e.validationMesssage)==null?void 0:ne[w==null?void 0:w.language]:""})}),I!==""&&O===1&&b4.test(I)===!1&&o.jsx("small",{className:"error",children:"Please enter correct email"}),(e==null?void 0:e.showHelperText)&&o.jsx("div",{children:o.jsx("small",{children:(U=e==null?void 0:e.helperText)==null?void 0:U[w==null?void 0:w.type]})})]}),d&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]});return o.jsxs(o.Fragment,{children:[z===!0&&o.jsx(Wi,{visibilty:z,closeSettingFieldSidebar:Z,...t},e==null?void 0:e.uuid),o.jsx(Si,{...t,fieldWrap:ge})]})},qle=t=>{var J,he,be,Ee,ye,Ae,ne,U,re;const{field:e,fieldIndex:n,pageIndex:r,sectionIndex:i,rowIndex:a,columnIndex:s,row:l,isDisabled:c}=t,{isRenderView:u,isAdmin:d,isPreview:f}=tn(),{userSelectedLanguage:h,fieldSettingUpdate:g}=un(),{task_status:v,taskRegisterData:m,updateTaskRegisterData:A,updateTaskProgressValue:S,updateUserFormDataSubmit:T,userTaskSubmitFormData:w,TASK_PUBLISHED:E}=yr(),[x,I]=P.useState(!1),[_,O]=P.useState(""),[B,M]=P.useState(0),[V,$]=P.useState(!1),[k,z]=P.useState(!1),[le,fe]=P.useState(!1),Z=()=>{z(!0)},G=()=>{z(!1)},ce=W=>{I(W)},K=()=>{I(!1)},ge=()=>{var de,Ce,_e;const W=w;if(l!=null&&l.rowIsRepeatable){if(l!=null&&l.repeatableFields){const ve=[...l.repeatableFields],me=_t.findIndex(ve,function(we){return we.uuid===(e==null?void 0:e.uuid)});me>=0&&ve[me].fieldData?O(ve[me].fieldData):(e.isValid=0,O(""))}}else if(W!=null&&W.length){for(const ve of W)if(ve.fieldId===t.field.uuid&&((de=ve==null?void 0:ve.postData[0])!=null&&de.postValue)&&((Ce=ve==null?void 0:ve.postData[0])==null?void 0:Ce.postValue)!==""){O((_e=ve==null?void 0:ve.postData[0])==null?void 0:_e.postValue),$(!0);break}}$(!0)},te=(W,de,Ce,_e)=>{var ve;if(w!=null&&w.length){const me=[...w],we=_t.findIndex(me,function(q){return q.rowId===(l==null?void 0:l.uuid)});let De=(ve=w[we])==null?void 0:ve.repeatableFields;De={...De,[Ce==null?void 0:Ce.uuid]:_e},me[we]={...me[we],repeatableFields:De},T(me)}O(_e),_e!==""?e.isValid=1:e.isValid=0,g(W,de,a,s,n,e)};P.useEffect(()=>{V||ge();const W=Jt.addListener("clearRepeatableFields",me=>{me===(l==null?void 0:l.uuid)&&(O(""),M(0),e.isValid=0)}),de=Jt.addListener("onSubmitUserForm",()=>{var me;(me=e==null?void 0:e.attributes)!=null&&me.required?_?e.isValid=1:e.isValid=0:e.isValid=1}),Ce=Jt.addListener("OnInvalidFieldCatch",me=>{e.uuid===(me==null?void 0:me.fieldId)?M(1):M(0)}),_e=Jt.addListener("OnGetFieldValue",me=>{var De;const we=(De=me==null?void 0:me.repeatableColumn)==null?void 0:De.filter(q=>(q==null?void 0:q.fieldUuid)===(e==null?void 0:e.uuid));we!=null&&we.length}),ve=Jt.addListener("onUpdateField",()=>{fe(!le)});return()=>{ve.remove(),de.remove(),Ce.remove(),_e.remove(),W.remove()}});const ee=W=>{var _e,ve;O(W.target.value);const de=w,Ce=_t.cloneDeep(m);if(de!==null){if((_e=W==null?void 0:W.target)!=null&&_e.value){if(Ce[e==null?void 0:e.uuid]=(ve=W==null?void 0:W.target)==null?void 0:ve.value,(de==null?void 0:de.length)>0)for(const me of de)me.fieldId===t.field.uuid&&(me.postData[0]={postValue:W.target.value})}else if(delete Ce[e==null?void 0:e.uuid],(de==null?void 0:de.length)>0)for(const me of de)me.fieldId===t.field.uuid&&(me.postData[0]={postValue:""})}if(!(l!=null&&l.rowIsRepeatable)){A(Ce);const me=Object.keys(Ce).length;S(me)}},Y=o.jsxs("div",{onMouseOver:Z,onMouseOut:G,children:[!u&&!f&&k&&o.jsx(Xr,{handleFieldSettingsSidebar:ce,...t}),o.jsxs("div",{className:`field ${f?" ":" builder-element-wrapper "}${(e==null?void 0:e.isFluid)===!0?"card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:f?"col-12 ":"col-12 field-form-builder ",children:[(e==null?void 0:e.showHeaderText)&&o.jsx("h6",{children:(J=e==null?void 0:e.headerText)==null?void 0:J[h==null?void 0:h.type]}),(e==null?void 0:e.showLabel)&&o.jsxs("label",{htmlFor:n,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(da,{...t}),((he=e==null?void 0:e.attributes)==null?void 0:he.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",f?o.jsx(o.Fragment,{children:(be=e==null?void 0:e.label)==null?void 0:be[h==null?void 0:h.type]}):o.jsx(sa,{...t}),o.jsx("span",{className:"ml-3",children:(e==null?void 0:e.showToolTip)&&o.jsx(Mi,{message:(Ee=e==null?void 0:e.toolTip)==null?void 0:Ee[h==null?void 0:h.type],position:"right"})})]}),o.jsx(ks,{rows:e==null?void 0:e.textareaRows,cols:e==null?void 0:e.textareaCols,autoResize:e==null?void 0:e.resizable,id:e==null?void 0:e.uuid,placeholder:(ye=e==null?void 0:e.placeholder)==null?void 0:ye[h==null?void 0:h.type],value:_,onFocus:()=>M(1),onChange:W=>{l!=null&&l.rowIsRepeatable?te(r,i,e,W.target.value):ee(W)},className:B===1&&((Ae=e==null?void 0:e.attributes)!=null&&Ae.required)?_?"valid":"invalid":"valid",readOnly:c}),o.jsx("div",{children:((ne=e==null?void 0:e.attributes)==null?void 0:ne.required)&&o.jsx("small",{className:"error",children:B===1&&!_?(U=e==null?void 0:e.validationMesssage)==null?void 0:U[h==null?void 0:h.type]:""})}),o.jsx("div",{children:(e==null?void 0:e.showHelperText)&&o.jsx("small",{children:(re=e==null?void 0:e.helperText)==null?void 0:re[h==null?void 0:h.type]})})]})}),d&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[x===!0&&o.jsx(Wi,{visibilty:x,closeSettingFieldSidebar:K,...t},e==null?void 0:e.uuid),o.jsx(Si,{...t,fieldWrap:Y})]})},$le={},Eb=t=>{var _,O,B,M;const{isAdmin:e,isAdvanceView:n,isPreview:r}=tn(),{handleDrop:i}=un(),{data:a,path:s,pageIndex:l,sectionIndex:c,rowIndex:u,columnIndex:d,conditionIndex:f,ruleIndex:h,condition:g,page:v,section:m,row:A,column:S}=t,T=P.useRef(null),[{isDragging:w},E]=ia({type:fT,item:{type:fT,uuid:a.uuid,children:a.children,path:s},collect:V=>({isDragging:V.isDragging()})}),x=w?0:1;E(T);const I=(V,$,k,z,le,fe,Z)=>{const G=t!=null&&t.fieldContainer?t==null?void 0:t.fieldContainer:"inline-condition-container";return o.jsx(tu,{type:"inline-conditional",field:V,data:V,path:$,page:v,section:m,row:A,column:S,pageIndex:k,sectionIndex:z,rowIndex:le,columnIndex:fe,fieldIndex:Z,isAdmin:e,fieldContainer:G},V.uuid)};return o.jsxs("div",{ref:r===!1?T:null,style:{...$le,opacity:x},className:"draggable column",children:[g&&((_=g.children)==null?void 0:_.length)===0&&o.jsx("p",{className:"text-primary text-center",children:"Drag item here"}),g&&g.children&&((O=g.children)==null?void 0:O.length)>0&&g.children.map((V,$)=>{var k;return o.jsxs(P.Fragment,{children:[r===!1&&o.jsx(Fr,{isAdvanceView:n,data:{path:`${s}-${h}-${f}-${$}`,childrenCount:(k=g==null?void 0:g.children)==null?void 0:k.length,droppedField:g},onDrop:i}),I(V,`${s}-${h}-${f}-${$}`,l,c,u,d,$)]},V.uuid)}),r===!1&&o.jsx(Fr,{isAdvanceView:n,fieldDropArea:!0,data:{path:`${s}-${h}-${f}-${(B=g==null?void 0:g.children)==null?void 0:B.length}`,childrenCount:(M=g==null?void 0:g.children)==null?void 0:M.length,droppedField:g},onDrop:i,isLast:!0})]})},c0=t=>{const{inputValue:e,condition:n,ruleIndex:r,conditionIndex:i,field:a,section:s,page:l,row:c,pageIndex:u,sectionIndex:d,rowIndex:f,columnIndex:h,isConditionTrue:g}=t,{taskRegisterData:v,updateUserFormDataSubmit:m,userTaskSubmitFormData:A,updateProgressDataValuesHook:S}=yr(),T=P.useCallback((w,E,x)=>{var _,O,B;const I=A;if(I!=null&&I.length){const M=v,V=(_=a==null?void 0:a.inlineConditionalRules)==null?void 0:_.rules[E].conditions[x].children;for(const[k,z]of V.entries()){(O=z==null?void 0:z.attributes)!=null&&O.required;const le=_t.findIndex(I,function(fe){return fe.fieldId===z.uuid});w?le===-1&&(I.push({postData:[],tabId:l.uuid,tabIndex:u,...a.inlineConditionalRules?{inlineConditionalRules:a.inlineConditionalRules}:{},...a.conditionalTabRules?{conditionalTabRules:a.conditionalTabRules}:{},...a.conditionalSectionRules?{conditionalSectionRules:a.conditionalSectionRules}:{},sectionId:s.uuid,sectionIndex:d,sectionHeading:s.heading,subHeadingText:s.subHeadingText,reviewerChecklist:a==null?void 0:a.reviewerChecklist,rowId:c.uuid,rowIndex:f,columnId:s.uuid,columnIndex:h,inlineConditionalField:!0,fieldIndex:k,fieldId:z.uuid,fieldInputType:a.componentType,fieldTitle:(B=a.label)==null?void 0:B.english,fieldDescription:a.description||null,fieldHelperText:a.helperText||null,fieldHeaderText:a.headerText||null,fieldFooterText:a.footerText||null,fieldTitleAbb:a.abbreviationLabel||a.label,question_abb_table:a.textForTable||null,language:"english",isHiddenfield:a.isHidden&&a.isHidden===1?1:0,isHiddenSection:s.isHidden&&s.isHidden===1?1:0}),M[z==null?void 0:z.uuid]&&delete M[z==null?void 0:z.uuid]):(M[z==null?void 0:z.uuid]&&delete M[z==null?void 0:z.uuid],le>=0&&I.splice(le,1))}const $=Object.keys(M).length;S({progressMaxValue:I==null?void 0:I.length,progressValue:$}),m(I)}},[h,a.abbreviationLabel,a.componentType,a.conditionalSectionRules,a.conditionalTabRules,a.description,a.footerText,a.headerText,a.helperText,a.inlineConditionalRules,a.isHidden,a.label,a==null?void 0:a.reviewerChecklist,a.textForTable,l.uuid,u,c.uuid,f,s.heading,s.isHidden,s.subHeadingText,s.uuid,d,v,S,m,A]);return P.useEffect(()=>(T(g,r,i),()=>{}),[i,e,g,r,T]),o.jsx("div",{children:g&&o.jsx("div",{className:"p-field p-pt-2",children:o.jsx(o.Fragment,{children:o.jsx(Eb,{...t,ruleIndex:r,conditionIndex:i,condition:n,data:a})})},i)})};function B2(t){"@babel/helpers - typeof";return B2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B2(t)}function jle(t,e){if(B2(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(B2(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function zle(t){var e=jle(t,"string");return B2(e)=="symbol"?e:e+""}function Ib(t,e,n){return(e=zle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Hle={value:"p-tag-value",icon:"p-tag-icon",root:function(e){var n=e.props;return ft("p-tag p-component",Ib(Ib({},"p-tag-".concat(n.severity),n.severity!==null),"p-tag-rounded",n.rounded))}},Yle=`
2382
2382
  @layer primereact {
2383
2383
  .p-tag {
2384
2384
  display: inline-flex;
@@ -33545,7 +33545,9 @@ const Lk = (t) => (e) => {
33545
33545
  ),
33546
33546
  [i]
33547
33547
  ), he = tt.useCallback(
33548
- (ge) => i(Lk(ge)),
33548
+ (ge) => {
33549
+ console.log("updateTaskProgressValue hook", ge), Lk(ge)(i);
33550
+ },
33549
33551
  [i]
33550
33552
  ), J = tt.useCallback(
33551
33553
  (ge) => i(yne(ge)),
@@ -55256,7 +55258,7 @@ const $i = (t) => {
55256
55258
  postValue: ""
55257
55259
  });
55258
55260
  }
55259
- if (!(v != null && v.rowIsRepeatable)) {
55261
+ if (console.log("row?.rowIsRepeatable", v == null ? void 0 : v.rowIsRepeatable), !(v != null && v.rowIsRepeatable)) {
55260
55262
  n($);
55261
55263
  const ue = Object.keys($).length;
55262
55264
  r(ue);
@@ -58121,7 +58123,7 @@ var Uue = function() {
58121
58123
  theme: i.theme,
58122
58124
  formats: i.formats
58123
58125
  };
58124
- Uue ? w(new Quill(d.current, V)) : import("./quill-CkhbujJR.js").then(function(j) {
58126
+ Uue ? w(new Quill(d.current, V)) : import("./quill-C4W5eeB2.js").then(function(j) {
58125
58127
  if (j && Se.isExist(d.current)) {
58126
58128
  var P;
58127
58129
  j.default ? P = new j.default(d.current, V) : P = new j(d.current, V), w(P);
@@ -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-KLdaqjrb.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-CIYHc7IO.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.47",
3
+ "version": "0.2.48",
4
4
  "type": "module",
5
5
  "types": "dist/types/index",
6
6
  "files": [