cft-builder 0.2.81 → 0.2.82

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-DLwrVltj.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-o0Mb2NAN.js";
2
2
  export {
3
3
  s as BuilderItems,
4
4
  o as BuilderItemsRender,
@@ -4295,7 +4295,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
4295
4295
  *
4296
4296
  * @license MIT
4297
4297
  */const fCe=b.createContext(null);process.env.NODE_ENV!=="production"&&(fCe.displayName="DataRouter");const hCe=b.createContext(null);process.env.NODE_ENV!=="production"&&(hCe.displayName="DataRouterState");const pCe=b.createContext(null);process.env.NODE_ENV!=="production"&&(pCe.displayName="Await");const gCe=b.createContext(null);process.env.NODE_ENV!=="production"&&(gCe.displayName="Navigation");const mCe=b.createContext(null);process.env.NODE_ENV!=="production"&&(mCe.displayName="Location");const Tj=b.createContext({outlet:null,matches:[],isDataRoute:!1});process.env.NODE_ENV!=="production"&&(Tj.displayName="Route");const vCe=b.createContext(null);process.env.NODE_ENV!=="production"&&(vCe.displayName="RouteError");function Ej(){let{matches:t}=b.useContext(Tj),e=t[t.length-1];return e?e.params:{}}new Promise(()=>{});const bCe=t=>{var r;const{section:e}=t,{userSelectedLanguage:n}=on();return o.jsxs("div",{children:["   ",(r=e==null?void 0:e.heading)==null?void 0:r[n==null?void 0:n.type]," : "," ",o.jsx(Bs,{placeholder:"enter weight",max:100,min:0}),o.jsx("br",{}),o.jsx("br",{})]})};function YS(){return YS=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},YS.apply(null,arguments)}function yCe(t){if(Array.isArray(t))return t}function ACe(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,s,a,l=[],c=!0,u=!1;try{if(s=(n=n.call(t)).next,e!==0)for(;!(c=(r=s.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&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return l}}function Ij(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 wCe(t,e){if(t){if(typeof t=="string")return Ij(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)?Ij(t,e):void 0}}function SCe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4298
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _j(t,e){return yCe(t)||ACe(t,e)||wCe(t,e)||SCe()}function rm(t){"@babel/helpers - typeof";return rm=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},rm(t)}function xCe(t,e){if(rm(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(rm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function CCe(t){var e=xCe(t,"string");return rm(e)=="symbol"?e:e+""}function TCe(t,e,n){return(e=CCe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ECe={root:"p-confirm-dialog",message:"p-confirm-dialog-message",icon:"p-confirm-dialog-icon",acceptButton:"p-confirm-dialog-accept",rejectButton:function(e){var n=e.getPropValue;return dt("p-confirm-dialog-reject",{"p-button-text":!n("rejectClassName")})}},m6=Mn.extend({defaultProps:{__TYPE:"ConfirmDialog",accept:null,acceptClassName:null,acceptIcon:null,acceptLabel:null,appendTo:null,breakpoints:null,children:void 0,className:null,content:null,defaultFocus:"accept",footer:null,icon:null,message:null,onHide:null,reject:null,rejectClassName:null,rejectIcon:null,rejectLabel:null,tagKey:void 0,visible:void 0},css:{classes:ECe}});function Dj(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 ap(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Dj(Object(n),!0).forEach(function(r){TCe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Dj(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var Nj=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e=ap(ap({},e),{visible:e.visible===void 0?!0:e.visible}),e.visible&&Sa.emit("confirm-dialog",e);var n=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Sa.emit("confirm-dialog",ap(ap(ap({},e),s),{visible:!0}))},r=function(){Sa.emit("confirm-dialog",{visible:!1})};return{show:n,hide:r}},ICe=b.memo(b.forwardRef(function(t,e){var n=Un(),r=b.useContext(nr),i=m6.getProps(t,r),s=b.useState(i.visible),a=_j(s,2),l=a[0],c=a[1],u=b.useState(!1),d=_j(u,2),f=d[0],h=d[1],g=b.useRef(null),v=b.useRef(!1),m=b.useRef(null),A=function(){var ce=i.group;return g.current&&(ce=g.current.group),Object.assign({},i,g.current,{group:ce})},w=function(ce){return A()[ce]},E=function(ce){for(var K=arguments.length,pe=new Array(K>1?K-1:0),te=1;te<K;te++)pe[te-1]=arguments[te];return Fe.getPropValue(w(ce),pe)},x=w("acceptLabel")||Kr("accept"),C=w("rejectLabel")||Kr("reject"),S={props:i,state:{visible:l}},_=m6.setMetaData(S),I=_.ptm,O=_.cx,k=_.isUnstyled;ci(m6.css.styles,k,{name:"confirmdialog"});var L=function(){v.current||(v.current=!0,E("accept"),P("accept"))},V=function(){v.current||(v.current=!0,E("reject"),P("reject"))},z=function(){var ce=A();ce.group===i.group&&(c(!0),v.current=!1,m.current=document.activeElement)},P=function(){var ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"cancel";c(!1),E("onHide",{result:ce}),Ce.focus(m.current),m.current=null},$=function(ce){if(ce.tagKey===i.tagKey){var K=l!==ce.visible,pe=w("target")!==ce.target;pe&&!i.target?(P(),g.current=ce,h(!0)):K&&(g.current=ce,ce.visible?z():P())}};b.useEffect(function(){i.visible?z():P()},[i.visible]),b.useEffect(function(){return!i.target&&!i.message&&Sa.on("confirm-dialog",$),function(){Sa.off("confirm-dialog",$)}},[i.target]),lr(function(){f&&z()},[f]),Ks(function(){Sa.off("confirm-dialog",$)}),b.useImperativeHandle(e,function(){return{props:i,confirm:$}});var R=function(){var ce=w("defaultFocus"),K=dt("p-confirm-dialog-accept",w("acceptClassName")),pe=dt("p-confirm-dialog-reject",{"p-button-text":!w("rejectClassName")},w("rejectClassName")),te=n({label:C,autoFocus:ce==="reject",icon:w("rejectIcon"),className:dt(w("rejectClassName"),O("rejectButton",{getPropValue:w})),onClick:V,pt:I("rejectButton"),unstyled:i.unstyled,__parentMetadata:{parent:S}},I("rejectButton")),ne=n({label:x,autoFocus:ce===void 0||ce==="accept",icon:w("acceptIcon"),className:dt(w("acceptClassName"),O("acceptButton")),onClick:L,pt:I("acceptButton"),unstyled:i.unstyled,__parentMetadata:{parent:S}},I("acceptButton")),Y=b.createElement(b.Fragment,null,b.createElement(Ft,te),b.createElement(Ft,ne));if(w("footer")){var G={accept:L,reject:V,acceptClassName:K,rejectClassName:pe,acceptLabel:x,rejectLabel:C,element:Y,props:A()};return Fe.getJSXElement(w("footer"),G)}return Y},he=function(){var ce=A(),K=Fe.getJSXElement(w("message"),ce),pe=n({className:O("icon")},I("icon")),te=Wn.getJSXIcon(w("icon"),ap({},pe),{props:ce}),ne=R(),Y=n({className:O("message")},I("message")),G=n({visible:l,className:dt(w("className"),O("root")),footer:ne,onHide:P,breakpoints:w("breakpoints"),pt:ce.pt,unstyled:i.unstyled,appendTo:w("appendTo"),__parentMetadata:{parent:S}},m6.getOtherProps(ce));return b.createElement(Fa,YS({},G,{content:t==null?void 0:t.content}),te,b.createElement("span",Y,K))},J=he();return b.createElement(nc,{element:J,appendTo:w("appendTo")})}));ICe.displayName="ConfirmDialog";const _Ce=()=>{const[t]=M.useState([]);return M.useEffect(()=>()=>{},[]),o.jsx("div",{className:"card",children:(t==null?void 0:t.length)>0&&(t==null?void 0:t.map((e,n)=>o.jsxs("div",{children:[o.jsx("ul",{className:"list-none p-0 m-0",children:o.jsxs("li",{className:"flex flex-column md:flex-row md:align-items-center md:justify-content-between mb-3",style:{borderRadius:"10px"},children:[o.jsx("div",{children:o.jsxs("div",{children:[o.jsx("span",{className:"inline-flex justify-content-center align-items-center w-2rem h-2rem border-circle border-1",children:(e==null?void 0:e.is_active)===1?o.jsx("i",{style:{color:"green"},className:"pi pi-check"}):o.jsx("i",{className:"pi pi-check"})}),o.jsxs("span",{className:" font-bold ml-2",children:[e==null?void 0:e.version_name,(e==null?void 0:e.is_active)===1?" - Active ":""]})]})}),o.jsx("div",{className:"flex align-items-center justify-content-between md:justify-content-end mt-3 md:mt-0",children:o.jsx("div",{className:"text-right ml-3",children:o.jsx("span",{className:" font-bold",children:(e==null?void 0:e.is_active)===1?"":o.jsx(Ft,{text:!0,onClick:()=>{setTimeout(()=>{},3e3)},severity:"success",label:"Make this version active",icon:"pi pi-check",size:"small"})})})})]})}),o.jsx("hr",{})]},`version-item-${n}`)))})},DCe=()=>{const{setLayout:t,formBuilderConfigurationType:e}=on(),n=M.useRef(null),r=a=>{var l;switch((l=a==null?void 0:a.formType)==null?void 0:l.key){case(e==null?void 0:e.key):t(a==null?void 0:a.layout);break}},i=async a=>{const l=a.target.files;if(l&&l.length>0){const c=await s(l[0]);r(c)}};async function s(a){return new Promise((l,c)=>{const u=new FileReader;u.onload=d=>{var f;return l(JSON.parse((f=d.target)==null?void 0:f.result))},u.onerror=d=>c(d),u.readAsText(a)})}return o.jsxs(o.Fragment,{children:[o.jsx("input",{ref:n,type:"file",style:{display:"none"},id:"schema",name:"schema",onChange:i}),o.jsx(Ft,{text:!0,size:"small",className:"p-button-primary ml-3 mr-3",onClick:()=>{var a;(a=n.current)==null||a.click()},label:"Import Template"})]})},NCe=()=>{const{builderTemplateName:t,formBuilderFormSchema:e}=on(),n=function(){const r=document.createElement("a");return function(i,s){const a=JSON.stringify(i),l=new Blob([a],{type:"octet/stream"}),c=window.URL.createObjectURL(l);r.href=c,r.download=s,r.click(),window.URL.revokeObjectURL(c)}}();return o.jsx(Ft,{text:!0,size:"small",className:"p-button-info ml-3",onClick:()=>{const r=e,i=t+".json";n(r,i)},label:"Export Template"})};function im(){return im=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},im.apply(null,arguments)}function sm(t){"@babel/helpers - typeof";return sm=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},sm(t)}function OCe(t,e){if(sm(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(sm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function FCe(t){var e=OCe(t,"string");return sm(e)=="symbol"?e:e+""}function kCe(t,e,n){return(e=FCe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var PCe={root:function(e){var n=e.props,r=e.checked;return dt("p-inputswitch p-component",{"p-highlight":r,"p-disabled":n.disabled,"p-invalid":n.invalid})},input:"p-inputswitch-input",slider:"p-inputswitch-slider"},v6=Mn.extend({defaultProps:{__TYPE:"InputSwitch",autoFocus:!1,checked:!1,className:null,disabled:!1,falseValue:!1,id:null,inputId:null,inputRef:null,invalid:!1,name:null,onBlur:null,onChange:null,onFocus:null,style:null,tabIndex:null,tooltip:null,tooltipOptions:null,trueValue:!0,children:void 0},css:{classes:PCe}});function Oj(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 MCe(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Oj(Object(n),!0).forEach(function(r){kCe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Oj(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var Ga=b.memo(b.forwardRef(function(t,e){var n=Un(),r=b.useContext(nr),i=v6.getProps(t,r),s=v6.setMetaData({props:i}),a=s.ptm,l=s.cx,c=s.isUnstyled;ci(v6.css.styles,c,{name:"inputswitch"});var u=b.useRef(null),d=b.useRef(i.inputRef),f=i.checked===i.trueValue,h=function(_){if(i.onChange){var I=f?i.falseValue:i.trueValue;i.onChange({originalEvent:_,value:I,stopPropagation:function(){_==null||_.stopPropagation()},preventDefault:function(){_==null||_.preventDefault()},target:{name:i.name,id:i.id,value:I}})}},g=function(_){var I;i==null||(I=i.onFocus)===null||I===void 0||I.call(i,_)},v=function(_){var I;i==null||(I=i.onBlur)===null||I===void 0||I.call(i,_)};b.useImperativeHandle(e,function(){return{props:i,focus:function(){return Ce.focus(d.current)},getElement:function(){return u.current},getInput:function(){return d.current}}}),b.useEffect(function(){Fe.combinedRefs(d,i.inputRef)},[d,i.inputRef]),Pi(function(){i.autoFocus&&Ce.focus(d.current,i.autoFocus)});var m=Fe.isNotEmpty(i.tooltip),A=v6.getOtherProps(i),w=Fe.reduceKeys(A,Ce.ARIA_PROPS),E=n({className:dt(i.className,l("root",{checked:f})),style:i.style,role:"checkbox","aria-checked":f,"data-p-highlight":f,"data-p-disabled":i.disabled},A,a("root")),x=n(MCe({type:"checkbox",id:i.inputId,name:i.name,checked:f,onChange:h,onFocus:g,onBlur:v,disabled:i.disabled,role:"switch",tabIndex:i.tabIndex,"aria-checked":f,className:l("input")},w),a("input")),C=n({className:l("slider")},a("slider"));return b.createElement(b.Fragment,null,b.createElement("div",im({id:i.id,ref:u},E),b.createElement("input",im({ref:d},x)),b.createElement("span",C)),m&&b.createElement(an,im({target:u,content:i.tooltip,pt:a("tooltip")},i.tooltipOptions)))}));Ga.displayName="InputSwitch";const LCe=()=>{var E,x,C,S,_;const{formBuilderFormSchema:t,selectFormBuilderLanguage:e,formBuilderSchemaLanguages:n,unselectFormBuilderLanguage:r,schemaBuilderUpdate:i,builderTemplateName:s,formBuilderLoading:a,formBuilderConfigurationType:l,saveFormTemplateNewVersion:c}=on(),[u,d]=M.useState(),f=Ej(),h=f==null?void 0:f.form_template_id,g=d4({initialValues:{firstName:"",lastName:"",contact:"",email:""},validate:()=>{const I={};return g.values.application_url="",I},onSubmit:()=>{}}),v=l==null?void 0:l.key,m=(I,O)=>{I!=null&&I.value?e(O):r(O),d(!u)},A=I=>{for(const[,O]of t.layout.entries())for(const[,k]of O.children.entries())for(const[,L]of k.children.entries())for(const[,V]of L.children.entries())for(const[,z]of V.children.entries())z.isFluid=I.value},w=()=>{Nj({message:"Are you sure you want to a new version for this form?",header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:()=>{c(h,t)},reject:()=>{}})};return o.jsx(o.Fragment,{children:o.jsx("form",{onSubmit:g.handleSubmit,className:"p-fluid",children:o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:"col-6",children:[a===!0?o.jsx(o.Fragment,{children:o.jsx(ys,{height:"15rem"})}):o.jsxs(ui,{header:"General",children:[o.jsxs("h5",{children:["Form Title : ",s||""," "]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"binary",onChange:I=>{i({showIntroTab:I.value})},checked:t==null?void 0:t.showIntroTab}),o.jsx("label",{htmlFor:"binary",children:"Show Intro Page"}),"  "]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"auto-save",onChange:I=>{i({enableAutoSave:I.value})},checked:t==null?void 0:t.enableAutoSave}),o.jsx("label",{htmlFor:"auto-save",children:"Auto Save Task Render Form User Data"})]}),v===_7&&o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"auto-save",onChange:I=>{i({surveyQuestionSlide:I.value})},checked:t==null?void 0:t.surveyQuestionSlide}),o.jsx("label",{htmlFor:"auto-save",children:"Survey Slide Per Question"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"showConditionalFields",onChange:I=>{i({showConditionalFields:I.value})},checked:t==null?void 0:t.showConditionalFields,disabled:t==null?void 0:t.surveyQuestionSlide}),o.jsxs("label",{htmlFor:"showConditionalFields",children:["Show Conditional Fields ",(t==null?void 0:t.surveyQuestionSlide)===!0&&o.jsx("small",{className:"error",children:"Cant use Survey Slide Per Question with Conditional Fields"})]})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"enableReviewTask",onChange:I=>{i({enableReviewTask:I.value})},checked:t==null?void 0:t.enableReviewTask}),o.jsx("label",{htmlFor:"enableReviewTask",children:"Enable Admin Review Task"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"enableFormFluid",onChange:I=>{i({enableFormFluid:I.value}),A(I)},checked:t==null?void 0:t.enableFormFluid}),o.jsx("label",{htmlFor:"enableFormFluid",children:"Enable Form Fluid"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"enableFieldEnumeration",onChange:I=>{i({enableFieldEnumeration:I.value}),A(I)},checked:t==null?void 0:t.enableFieldEnumeration}),o.jsx("label",{htmlFor:"enableFormFluid",children:"Enable Field Enumeration"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"isOnboardingForm",onChange:I=>{i({isOnboardingForm:I.value}),A(I)},checked:t==null?void 0:t.isOnboardingForm}),o.jsx("label",{htmlFor:"isOnboardingForm",children:"Is Onboarding Form"})]})]}),a===!0?o.jsx(o.Fragment,{children:o.jsx(ys,{className:"mt-3",height:"8rem"})}):o.jsxs(ui,{className:"mt-3",header:"Auto Save Settings",children:[o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"auto-save",onChange:I=>{i({enableAutoSave:I.value})},checked:t==null?void 0:t.enableAutoSave}),o.jsx("label",{htmlFor:"auto-save",children:"Auto Save User Data"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"auto-save",onChange:I=>{i({enableAutoSaveBuilderSetting:I.value})},checked:t==null?void 0:t.enableAutoSaveBuilderSetting}),o.jsx("label",{htmlFor:"auto-save",children:"Auto Save Form Builder Settings"})]})]}),a===!0?o.jsx(o.Fragment,{children:o.jsx(ys,{className:"mt-3",height:"16rem"})}):o.jsxs(ui,{className:"mt-3",header:"Form Table Configuration",children:[o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"stripedRows",onChange:I=>{i({tableConfiguration:{...t==null?void 0:t.tableConfiguration,stripedRows:I.value}})},checked:(E=t==null?void 0:t.tableConfiguration)==null?void 0:E.stripedRows}),o.jsx("label",{htmlFor:"stripedRows",children:"Striped Rows"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"gridLines",onChange:I=>{i({tableConfiguration:{...t==null?void 0:t.tableConfiguration,gridLines:I.value}})},checked:(x=t==null?void 0:t.tableConfiguration)==null?void 0:x.gridLines}),o.jsx("label",{htmlFor:"gridLines",children:"Grid Lines"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"flexScroll",onChange:I=>{i({tableConfiguration:{...t==null?void 0:t.tableConfiguration,flexScroll:I.value}})},checked:(C=t==null?void 0:t.tableConfiguration)==null?void 0:C.flexScroll}),o.jsx("label",{htmlFor:"flexScroll",children:"Flex Scroll "})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"isResponsive",onChange:I=>{i({tableConfiguration:{...t==null?void 0:t.tableConfiguration,isResponsive:I.value}})},checked:(S=t==null?void 0:t.tableConfiguration)==null?void 0:S.isResponsive}),o.jsx("label",{htmlFor:"isResponsive",children:"isResponsive Rows"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"rowReorder",onChange:I=>{i({tableConfiguration:{...t==null?void 0:t.tableConfiguration,rowReorder:I.value}})},checked:(_=t==null?void 0:t.tableConfiguration)==null?void 0:_.rowReorder}),o.jsx("label",{htmlFor:"rowReorder",children:"Row Reorder"})]})]})]}),o.jsxs("div",{className:"col-6",children:[a===!0?o.jsx(o.Fragment,{children:o.jsx(ys,{height:"18rem"})}):o.jsx(ui,{header:"Languages",children:AQ.map((I,O)=>{const k=n.filter(function(L){return(I==null?void 0:I.key)===(L==null?void 0:L.key)});return o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:O,name:"lagnuage",checked:k.length>0,onChange:L=>m(L,I)}),o.jsx("label",{htmlFor:O,children:I.language})]},O)})}),a===!0?o.jsx(o.Fragment,{children:o.jsx(ys,{className:"mt-3",height:"16rem"})}):o.jsxs(ui,{className:"mt-3",header:"Versioning",children:[o.jsx("h5",{children:"Change Form Version Title"}),o.jsx("div",{className:"field",children:o.jsx(bn,{value:(t==null?void 0:t.version_name)||"",minLength:2,placeholder:"Enter form version",maxLength:50,onChange:I=>{var O;i({version_name:(O=I==null?void 0:I.target)==null?void 0:O.value})}})}),o.jsx("h5",{children:"All Forms Version"}),o.jsx(_Ce,{}),o.jsx(Ft,{text:!0,size:"small",className:"p-button-info ml-3",onClick:()=>w(),label:"Create New Version",loading:a})]}),a===!0?o.jsx(o.Fragment,{children:o.jsx(ys,{className:"mt-3",height:"8rem"})}):o.jsx(ui,{className:"mt-3",header:"Export/Import",children:o.jsxs("span",{className:"flex",children:[o.jsx(NCe,{}),o.jsx(DCe,{})]})})]}),o.jsx("div",{className:"col-6"})]})})})},BCe=t=>{var v,m,A;const{fieldIndex:e,field:n,models:r,setfieldMappings:i,fieldMappings:s}=t,[a,l]=M.useState(null),[c,u]=M.useState(null),d=()=>{var x;const w=[...s],E=w.findIndex(C=>C.fieldId===(n==null?void 0:n.uuid));if(E!==-1){const C=[...r],S=C.findIndex(_=>{var I;return _.modelName===((I=w[E])==null?void 0:I.modelName)});u((x=w[E])==null?void 0:x.column_name),S!==-1&&l(C[S])}};M.useEffect(()=>(d(),()=>{}),[]);const[f,h]=M.useState(!1),g=w=>{const E=[...s],x=E.findIndex(S=>S.fieldId===w),C={fieldId:w,modelName:(a==null?void 0:a.modelName)||"",class:a==null?void 0:a.class,column_name:c||""};x!==-1?E[x]=C:E.push(C),i([...E])};return o.jsxs("div",{className:"grid",children:[o.jsxs(Fa,{header:`Map ${(v=n==null?void 0:n.label)==null?void 0:v.english} Field with Model`,visible:f,style:{width:"40vw"},footer:()=>o.jsx(o.Fragment,{children:o.jsx(Ft,{text:!0,label:"Set Field","aria-label":"Submit",onClick:()=>{g((n==null?void 0:n.uuid)||""),h(!1)}})}),onHide:()=>h(!1),children:[o.jsxs("p",{children:["Map ",(m=n==null?void 0:n.label)==null?void 0:m.english," Field with Model"]}),o.jsxs("div",{className:"flex justify-content-between",children:[o.jsx(Os,{value:a,onChange:w=>l(w.value),options:r,optionLabel:"modelName",className:"w-full md:w-14rem",placeholder:"Select a model field",filter:!0,showClear:!0}),o.jsx(Os,{value:c,onChange:w=>u(w.value),options:(a==null?void 0:a.columns)||[],className:"w-full md:w-14rem",placeholder:"Select a column",filter:!0,showClear:!0})]})]}),o.jsx("div",{className:"col-6",children:o.jsxs("p",{children:[o.jsxs("strong",{children:[e+1," "]}),"Field ",n==null?void 0:n.componentType,": ",(A=n==null?void 0:n.label)==null?void 0:A.english," Is Mapped to"," ",o.jsx($c,{className:"mr-2",severity:a!=null&&a.modelName?"success":"warning",value:(a==null?void 0:a.modelName)||"Nothing"}),"with column"," ",o.jsx($c,{className:"mr-2",severity:c?"success":"danger",value:c||"Nothing"})]})}),o.jsx("div",{className:"col-6",children:o.jsx(Ft,{text:!0,label:"Set Model","aria-label":"Submit",onClick:()=>{h(!0)}})})]},e+"-table-field-item")},VCe=t=>{const{fields:e}=t,[n]=M.useState([]),[r,i]=M.useState(!1),{formBuilderFormSchema:s,schemaBuilderUpdate:a}=on(),l=()=>{i(!0)},c=()=>{let d=[...(s==null?void 0:s.fieldMappings)||[]];d!=null&&d.length&&(d=d==null?void 0:d.filter(f=>e.some(h=>h.uuid===(f==null?void 0:f.fieldId)))),u(d)};M.useEffect(()=>(l(),c(),()=>{}),[]);const u=d=>{a({fieldMappings:d})};return o.jsx("div",{children:r===!0?o.jsxs(o.Fragment,{children:[o.jsx(ys,{className:"mt-3",height:"5rem"}),o.jsx(ys,{className:"mt-3",height:"5rem"}),o.jsx(ys,{className:"mt-3",height:"5rem"}),o.jsx(ys,{className:"mt-3",height:"5rem"}),o.jsx(ys,{className:"mt-3",height:"5rem"}),o.jsx(ys,{className:"mt-3",height:"5rem"}),o.jsx(ys,{className:"mt-3",height:"5rem"}),o.jsx(ys,{className:"mt-3",height:"5rem"})]}):o.jsx(o.Fragment,{children:(e==null?void 0:e.length)>0&&(n==null?void 0:n.length)>0&&(e==null?void 0:e.map((d,f)=>o.jsx("div",{className:"card",children:o.jsx(BCe,{fieldMappings:s!=null&&s.fieldMappings?s==null?void 0:s.fieldMappings:[],setfieldMappings:u,field:d,fieldIndex:f,models:n})},f+"-table-field-itemc-component")))})})},UCe=0,qCe=t=>{const{setShowPreview:e,activeIndex:n,userFormBuilderSettings:r}=t,{builderIsChangesSaved:i,builderTemplateName:s,formBuilderConfigurationType:a,formBuilderFormSchema:l,formBuilderLoading:c,formBuilderPublishedStatus:u,builderVersionName:d,saveFormProgress:f,schemaBuilderUpdate:h}=on(),g=M.useRef(null),v=()=>{f(l)},m=["Basic","Advanced"],[A,w]=M.useState((r==null?void 0:r.isAdvanceView)!==void 0&&r!=null&&r.isAdvanceView?"Advanced":"Basic"),E=S=>{w(S.value),h({isAdvanceView:S.value==="Advanced"})},x=o.jsx(M.Fragment,{children:o.jsxs("div",{className:"flex",children:[((a==null?void 0:a.key)===I7||(a==null?void 0:a.key)===_7||(a==null?void 0:a.key)===Bte)&&o.jsx(s1,{className:"mr-3",value:A,onChange:S=>E(S),options:m,disabled:c}),o.jsx(Ft,{text:!0,icon:"pi pi-eye",size:"small",className:"mr-2",onClick:()=>e(!0),label:"Preview"}),!u&&o.jsx(o.Fragment,{children:(l==null?void 0:l.enableAutoSaveBuilderSetting)===!1&&o.jsx(Ft,{text:!0,disabled:i,size:"small",className:i?"p-button-secondary":"p-button-info",onClick:()=>v(),label:"Save Progress",loading:c})})]})}),C=o.jsx(M.Fragment,{children:c===!0?o.jsx(o.Fragment,{children:o.jsx(ys,{width:"25rem",height:"1.5rem"})}):o.jsxs("div",{className:"font-medium text-900",children:["Builder - ",a==null?void 0:a.name," - ",s," ","- Version : ",d]})});return o.jsxs(o.Fragment,{children:[o.jsx(U3,{ref:g}),o.jsxs("div",{className:"flex",children:[o.jsx("div",{className:"flex w-5 justify-content-left align-items-start",children:C}),o.jsx("div",{className:"flex w-7 justify-content-right align-items-end",children:n===UCe&&x})]})]})};function $Ce(){const{formBuilderFormLayout:t,formBuilderFormSchema:e,clearBuilderSchema:n,schemaBuilderUpdate:r,saveFormProgress:i,userSelectedLanguage:s,builderIsChangesSaved:a,formBuilderPublishedStatus:l}=on(),c=Ej(),u=c==null?void 0:c.form_template_id,[d]=M.useState(!0),[f]=M.useState(null),[h,g]=M.useState(!0),[v,m]=M.useState(!1),[A,w]=M.useState(0),[E,x]=M.useState(null),C=async()=>{},S=M.useCallback(()=>{C()},[t,e]),_=k=>{const L={...e,intro:k};r(L)},I=()=>{i(e)},O=()=>{a===!1?l===!1?Nj({message:"You have unsaved changes, would you like to to save them or discard them?",header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:()=>{I(),g(!1),setTimeout(()=>{n()},1e3)},rejectLabel:"Close and discard changes",acceptLabel:"Close and save changes",reject:()=>{g(!1),setTimeout(()=>{n()},1e3)}}):(g(!1),setTimeout(()=>{n()},1e3)):(g(!1),setTimeout(()=>{n()},1e3))};return o.jsx(Fa,{maximizable:!0,header:()=>o.jsx(qCe,{setUserFormBuilderSettings:x,userFormBuilderSettings:E,formBuilderFormLayout:t,formTemplateId:u,showPreview:v,setShowPreview:m,activeIndex:A,emitSocketData:S}),visible:h,style:{width:"100vw",height:"100vh",maxHeight:"100%"},onHide:()=>O(),children:o.jsxs("div",{id:"form-builder",className:"grid",style:{overflow:"hidden",height:"100%"},children:[!d&&o.jsx(Ft,{text:!0,label:"Request Access",onClick:()=>{},className:"p-button-info"}),f&&o.jsxs("div",{children:[f==null?void 0:f.username," is editing so you have to wait to edits and leaves."]}),o.jsx("div",{className:"flex justify-content-end"}),o.jsx("div",{id:"users-arrow"}),o.jsx("div",{className:"col-12",style:{overflow:"hidden"},children:o.jsxs(Zs,{activeIndex:A,onTabChange:k=>w(k.index),children:[o.jsxs(fr,{header:"Builder",children:[o.jsx(Lf,{backend:Vf}),o.jsx(Vo,{style:{width:"75vw"},visible:v,onHide:()=>m(!1),position:"right",children:o.jsx(Lf,{backend:Vf,children:o.jsx("div",{className:"scroll-height-200"})})})]}),o.jsx(fr,{header:"Configuration",children:o.jsx("div",{className:"scroll-height-250",children:o.jsx(LCe,{})})}),o.jsx(fr,{header:"Intro",disabled:(e==null?void 0:e.showIntroTab)===!1,children:o.jsx(S4,{style:{height:"320px"},value:(e==null?void 0:e.intro)||"<p></p>",onTextChange:k=>{_(k==null?void 0:k.htmlValue)}})}),o.jsx(fr,{header:"Data Model Binding",children:o.jsx(VCe,{fields:e==null?void 0:e.tableFields})}),o.jsxs(fr,{header:"Weighting",children:[o.jsx("h3",{children:"Weighting"}),(t==null?void 0:t.length)>0&&t.map((k,L)=>{var V,z,P;return o.jsxs("div",{children:[o.jsx("h5",{children:(V=k==null?void 0:k.title)==null?void 0:V[s==null?void 0:s.type]}),((z=k==null?void 0:k.children)==null?void 0:z.length)>0&&((P=k==null?void 0:k.children)==null?void 0:P.map(($,R)=>o.jsx("div",{children:o.jsx(bCe,{page:k,section:$})},`weighting-section-${R}`)))]},`weighting-page-${L}`)}),o.jsx("hr",{}),"Total ",o.jsx(Bs,{placeholder:"0",readOnly:!0})," %"]})]})})]})})}const jCe=()=>o.jsx($Ce,{}),zCe=t=>{const{className:e=""}=t,{builderIsChangesSaved:n,schemaBuilderUpdate:r,formBuilderFormLayout:i,formBuilderFormSchema:s,formatTableFieldsHook:a,formBuilderLoading:l,saveFormProgress:c}=on(),u=d=>{n===!1?(d.preventDefault(),d.returnValue=!1):window.location.reload()};return M.useEffect(()=>(window.addEventListener("beforeunload",u),()=>{window.removeEventListener("beforeunload",u)}),[n]),M.useEffect(()=>((s==null?void 0:s.enableAutoSaveBuilderSetting)===!0&&l===!1?c(!1):r({isChangesSaved:!1}),a(i),()=>{}),[i]),o.jsx("div",{className:e,children:o.jsx(g6,{})})},HCe={padding:"1rem 0.5rem",cursor:"move",textAlign:"center"},Bd=t=>{const{data:e,showIcon:n,tags:r}=t,[{opacity:i},s]=is({type:Rn,item:e,collect:l=>({opacity:l.isDragging()?0:1})});function a(l,c){return l.length<=c?l:l.slice(0,c)+"..."}return o.jsxs("div",{ref:s,className:`card shadow-2 question builder-sidebar-item ${e==null?void 0:e.element}`,style:{...HCe,opacity:i},children:[i&&(e!=null&&e.toolTip)?e==null?void 0:e.toolTip(e):"",a(e==null?void 0:e.label,80),o.jsxs("div",{className:"mt-2",children:[n&&o.jsx($c,{icon:"pi pi-check",severity:"warning",className:"mr-2",rounded:!0}),r&&o.jsx(o.Fragment,{children:(r==null?void 0:r.length)>0&&(r==null?void 0:r.map((l,c)=>o.jsx($c,{severity:l==null?void 0:l.severity,className:"mr-2",value:l==null?void 0:l.label},`tagIndex-${c}`)))})]})]})};var YCe={root:"p-progress-spinner",spinner:"p-progress-spinner-svg",circle:"p-progress-spinner-circle"},KCe=`
4298
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _j(t,e){return yCe(t)||ACe(t,e)||wCe(t,e)||SCe()}function rm(t){"@babel/helpers - typeof";return rm=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},rm(t)}function xCe(t,e){if(rm(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(rm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function CCe(t){var e=xCe(t,"string");return rm(e)=="symbol"?e:e+""}function TCe(t,e,n){return(e=CCe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ECe={root:"p-confirm-dialog",message:"p-confirm-dialog-message",icon:"p-confirm-dialog-icon",acceptButton:"p-confirm-dialog-accept",rejectButton:function(e){var n=e.getPropValue;return dt("p-confirm-dialog-reject",{"p-button-text":!n("rejectClassName")})}},m6=Mn.extend({defaultProps:{__TYPE:"ConfirmDialog",accept:null,acceptClassName:null,acceptIcon:null,acceptLabel:null,appendTo:null,breakpoints:null,children:void 0,className:null,content:null,defaultFocus:"accept",footer:null,icon:null,message:null,onHide:null,reject:null,rejectClassName:null,rejectIcon:null,rejectLabel:null,tagKey:void 0,visible:void 0},css:{classes:ECe}});function Dj(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 ap(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Dj(Object(n),!0).forEach(function(r){TCe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Dj(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var Nj=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e=ap(ap({},e),{visible:e.visible===void 0?!0:e.visible}),e.visible&&Sa.emit("confirm-dialog",e);var n=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Sa.emit("confirm-dialog",ap(ap(ap({},e),s),{visible:!0}))},r=function(){Sa.emit("confirm-dialog",{visible:!1})};return{show:n,hide:r}},ICe=b.memo(b.forwardRef(function(t,e){var n=Un(),r=b.useContext(nr),i=m6.getProps(t,r),s=b.useState(i.visible),a=_j(s,2),l=a[0],c=a[1],u=b.useState(!1),d=_j(u,2),f=d[0],h=d[1],g=b.useRef(null),v=b.useRef(!1),m=b.useRef(null),A=function(){var ce=i.group;return g.current&&(ce=g.current.group),Object.assign({},i,g.current,{group:ce})},w=function(ce){return A()[ce]},E=function(ce){for(var K=arguments.length,pe=new Array(K>1?K-1:0),te=1;te<K;te++)pe[te-1]=arguments[te];return Fe.getPropValue(w(ce),pe)},x=w("acceptLabel")||Kr("accept"),C=w("rejectLabel")||Kr("reject"),S={props:i,state:{visible:l}},_=m6.setMetaData(S),I=_.ptm,O=_.cx,k=_.isUnstyled;ci(m6.css.styles,k,{name:"confirmdialog"});var L=function(){v.current||(v.current=!0,E("accept"),P("accept"))},V=function(){v.current||(v.current=!0,E("reject"),P("reject"))},z=function(){var ce=A();ce.group===i.group&&(c(!0),v.current=!1,m.current=document.activeElement)},P=function(){var ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"cancel";c(!1),E("onHide",{result:ce}),Ce.focus(m.current),m.current=null},$=function(ce){if(ce.tagKey===i.tagKey){var K=l!==ce.visible,pe=w("target")!==ce.target;pe&&!i.target?(P(),g.current=ce,h(!0)):K&&(g.current=ce,ce.visible?z():P())}};b.useEffect(function(){i.visible?z():P()},[i.visible]),b.useEffect(function(){return!i.target&&!i.message&&Sa.on("confirm-dialog",$),function(){Sa.off("confirm-dialog",$)}},[i.target]),lr(function(){f&&z()},[f]),Ks(function(){Sa.off("confirm-dialog",$)}),b.useImperativeHandle(e,function(){return{props:i,confirm:$}});var R=function(){var ce=w("defaultFocus"),K=dt("p-confirm-dialog-accept",w("acceptClassName")),pe=dt("p-confirm-dialog-reject",{"p-button-text":!w("rejectClassName")},w("rejectClassName")),te=n({label:C,autoFocus:ce==="reject",icon:w("rejectIcon"),className:dt(w("rejectClassName"),O("rejectButton",{getPropValue:w})),onClick:V,pt:I("rejectButton"),unstyled:i.unstyled,__parentMetadata:{parent:S}},I("rejectButton")),ne=n({label:x,autoFocus:ce===void 0||ce==="accept",icon:w("acceptIcon"),className:dt(w("acceptClassName"),O("acceptButton")),onClick:L,pt:I("acceptButton"),unstyled:i.unstyled,__parentMetadata:{parent:S}},I("acceptButton")),Y=b.createElement(b.Fragment,null,b.createElement(Ft,te),b.createElement(Ft,ne));if(w("footer")){var G={accept:L,reject:V,acceptClassName:K,rejectClassName:pe,acceptLabel:x,rejectLabel:C,element:Y,props:A()};return Fe.getJSXElement(w("footer"),G)}return Y},he=function(){var ce=A(),K=Fe.getJSXElement(w("message"),ce),pe=n({className:O("icon")},I("icon")),te=Wn.getJSXIcon(w("icon"),ap({},pe),{props:ce}),ne=R(),Y=n({className:O("message")},I("message")),G=n({visible:l,className:dt(w("className"),O("root")),footer:ne,onHide:P,breakpoints:w("breakpoints"),pt:ce.pt,unstyled:i.unstyled,appendTo:w("appendTo"),__parentMetadata:{parent:S}},m6.getOtherProps(ce));return b.createElement(Fa,YS({},G,{content:t==null?void 0:t.content}),te,b.createElement("span",Y,K))},J=he();return b.createElement(nc,{element:J,appendTo:w("appendTo")})}));ICe.displayName="ConfirmDialog";const _Ce=()=>{const[t]=M.useState([]);return M.useEffect(()=>()=>{},[]),o.jsx("div",{className:"card",children:(t==null?void 0:t.length)>0&&(t==null?void 0:t.map((e,n)=>o.jsxs("div",{children:[o.jsx("ul",{className:"list-none p-0 m-0",children:o.jsxs("li",{className:"flex flex-column md:flex-row md:align-items-center md:justify-content-between mb-3",style:{borderRadius:"10px"},children:[o.jsx("div",{children:o.jsxs("div",{children:[o.jsx("span",{className:"inline-flex justify-content-center align-items-center w-2rem h-2rem border-circle border-1",children:(e==null?void 0:e.is_active)===1?o.jsx("i",{style:{color:"green"},className:"pi pi-check"}):o.jsx("i",{className:"pi pi-check"})}),o.jsxs("span",{className:" font-bold ml-2",children:[e==null?void 0:e.version_name,(e==null?void 0:e.is_active)===1?" - Active ":""]})]})}),o.jsx("div",{className:"flex align-items-center justify-content-between md:justify-content-end mt-3 md:mt-0",children:o.jsx("div",{className:"text-right ml-3",children:o.jsx("span",{className:" font-bold",children:(e==null?void 0:e.is_active)===1?"":o.jsx(Ft,{text:!0,onClick:()=>{setTimeout(()=>{},3e3)},severity:"success",label:"Make this version active",icon:"pi pi-check",size:"small"})})})})]})}),o.jsx("hr",{})]},`version-item-${n}`)))})},DCe=()=>{const{setLayout:t,formBuilderConfigurationType:e}=on(),n=M.useRef(null),r=a=>{var l;switch((l=a==null?void 0:a.formType)==null?void 0:l.key){case(e==null?void 0:e.key):t(a==null?void 0:a.layout);break}},i=async a=>{const l=a.target.files;if(l&&l.length>0){const c=await s(l[0]);r(c)}};async function s(a){return new Promise((l,c)=>{const u=new FileReader;u.onload=d=>{var f;return l(JSON.parse((f=d.target)==null?void 0:f.result))},u.onerror=d=>c(d),u.readAsText(a)})}return o.jsxs(o.Fragment,{children:[o.jsx("input",{ref:n,type:"file",style:{display:"none"},id:"schema",name:"schema",onChange:i}),o.jsx(Ft,{text:!0,size:"small",className:"p-button-primary ml-3 mr-3",onClick:()=>{var a;(a=n.current)==null||a.click()},label:"Import Template"})]})},NCe=()=>{const{builderTemplateName:t,formBuilderFormSchema:e}=on(),n=function(){const r=document.createElement("a");return function(i,s){const a=JSON.stringify(i),l=new Blob([a],{type:"octet/stream"}),c=window.URL.createObjectURL(l);r.href=c,r.download=s,r.click(),window.URL.revokeObjectURL(c)}}();return o.jsx(Ft,{text:!0,size:"small",className:"p-button-info ml-3",onClick:()=>{const r=e,i=t+".json";n(r,i)},label:"Export Template"})};function im(){return im=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},im.apply(null,arguments)}function sm(t){"@babel/helpers - typeof";return sm=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},sm(t)}function OCe(t,e){if(sm(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(sm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function FCe(t){var e=OCe(t,"string");return sm(e)=="symbol"?e:e+""}function kCe(t,e,n){return(e=FCe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var PCe={root:function(e){var n=e.props,r=e.checked;return dt("p-inputswitch p-component",{"p-highlight":r,"p-disabled":n.disabled,"p-invalid":n.invalid})},input:"p-inputswitch-input",slider:"p-inputswitch-slider"},v6=Mn.extend({defaultProps:{__TYPE:"InputSwitch",autoFocus:!1,checked:!1,className:null,disabled:!1,falseValue:!1,id:null,inputId:null,inputRef:null,invalid:!1,name:null,onBlur:null,onChange:null,onFocus:null,style:null,tabIndex:null,tooltip:null,tooltipOptions:null,trueValue:!0,children:void 0},css:{classes:PCe}});function Oj(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 MCe(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Oj(Object(n),!0).forEach(function(r){kCe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Oj(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var Ga=b.memo(b.forwardRef(function(t,e){var n=Un(),r=b.useContext(nr),i=v6.getProps(t,r),s=v6.setMetaData({props:i}),a=s.ptm,l=s.cx,c=s.isUnstyled;ci(v6.css.styles,c,{name:"inputswitch"});var u=b.useRef(null),d=b.useRef(i.inputRef),f=i.checked===i.trueValue,h=function(_){if(i.onChange){var I=f?i.falseValue:i.trueValue;i.onChange({originalEvent:_,value:I,stopPropagation:function(){_==null||_.stopPropagation()},preventDefault:function(){_==null||_.preventDefault()},target:{name:i.name,id:i.id,value:I}})}},g=function(_){var I;i==null||(I=i.onFocus)===null||I===void 0||I.call(i,_)},v=function(_){var I;i==null||(I=i.onBlur)===null||I===void 0||I.call(i,_)};b.useImperativeHandle(e,function(){return{props:i,focus:function(){return Ce.focus(d.current)},getElement:function(){return u.current},getInput:function(){return d.current}}}),b.useEffect(function(){Fe.combinedRefs(d,i.inputRef)},[d,i.inputRef]),Pi(function(){i.autoFocus&&Ce.focus(d.current,i.autoFocus)});var m=Fe.isNotEmpty(i.tooltip),A=v6.getOtherProps(i),w=Fe.reduceKeys(A,Ce.ARIA_PROPS),E=n({className:dt(i.className,l("root",{checked:f})),style:i.style,role:"checkbox","aria-checked":f,"data-p-highlight":f,"data-p-disabled":i.disabled},A,a("root")),x=n(MCe({type:"checkbox",id:i.inputId,name:i.name,checked:f,onChange:h,onFocus:g,onBlur:v,disabled:i.disabled,role:"switch",tabIndex:i.tabIndex,"aria-checked":f,className:l("input")},w),a("input")),C=n({className:l("slider")},a("slider"));return b.createElement(b.Fragment,null,b.createElement("div",im({id:i.id,ref:u},E),b.createElement("input",im({ref:d},x)),b.createElement("span",C)),m&&b.createElement(an,im({target:u,content:i.tooltip,pt:a("tooltip")},i.tooltipOptions)))}));Ga.displayName="InputSwitch";const LCe=()=>{var E,x,C,S,_;const{formBuilderFormSchema:t,selectFormBuilderLanguage:e,formBuilderSchemaLanguages:n,unselectFormBuilderLanguage:r,schemaBuilderUpdate:i,builderTemplateName:s,formBuilderLoading:a,formBuilderConfigurationType:l,saveFormTemplateNewVersion:c}=on(),[u,d]=M.useState(),f=Ej(),h=f==null?void 0:f.form_template_id,g=d4({initialValues:{firstName:"",lastName:"",contact:"",email:""},validate:()=>{const I={};return g.values.application_url="",I},onSubmit:()=>{}}),v=l==null?void 0:l.key,m=(I,O)=>{I!=null&&I.value?e(O):r(O),d(!u)},A=I=>{for(const[,O]of t.layout.entries())for(const[,k]of O.children.entries())for(const[,L]of k.children.entries())for(const[,V]of L.children.entries())for(const[,z]of V.children.entries())z.isFluid=I.value},w=()=>{Nj({message:"Are you sure you want to a new version for this form?",header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:()=>{c(h,t)},reject:()=>{}})};return o.jsx(o.Fragment,{children:o.jsx("form",{onSubmit:g.handleSubmit,className:"p-fluid",children:o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:"col-6",children:[a===!0?o.jsx(o.Fragment,{children:o.jsx(ys,{height:"15rem"})}):o.jsxs(ui,{header:"General",children:[o.jsxs("h5",{children:["Form Title : ",s||""," "]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"binary",onChange:I=>{i({showIntroTab:I.value})},checked:t==null?void 0:t.showIntroTab}),o.jsx("label",{htmlFor:"binary",children:"Show Intro Page"}),"  "]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"auto-save",onChange:I=>{i({enableAutoSave:I.value})},checked:t==null?void 0:t.enableAutoSave}),o.jsx("label",{htmlFor:"auto-save",children:"Auto Save Task Render Form User Data"})]}),v===_7&&o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"auto-save",onChange:I=>{i({surveyQuestionSlide:I.value})},checked:t==null?void 0:t.surveyQuestionSlide}),o.jsx("label",{htmlFor:"auto-save",children:"Survey Slide Per Question"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"showConditionalFields",onChange:I=>{i({showConditionalFields:I.value})},checked:t==null?void 0:t.showConditionalFields,disabled:t==null?void 0:t.surveyQuestionSlide}),o.jsxs("label",{htmlFor:"showConditionalFields",children:["Show Conditional Fields ",(t==null?void 0:t.surveyQuestionSlide)===!0&&o.jsx("small",{className:"error",children:"Cant use Survey Slide Per Question with Conditional Fields"})]})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"enableReviewTask",onChange:I=>{i({enableReviewTask:I.value})},checked:t==null?void 0:t.enableReviewTask}),o.jsx("label",{htmlFor:"enableReviewTask",children:"Enable Admin Review Task"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"enableFormFluid",onChange:I=>{i({enableFormFluid:I.value}),A(I)},checked:t==null?void 0:t.enableFormFluid}),o.jsx("label",{htmlFor:"enableFormFluid",children:"Enable Form Fluid"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"enableFieldEnumeration",onChange:I=>{i({enableFieldEnumeration:I.value}),A(I)},checked:t==null?void 0:t.enableFieldEnumeration}),o.jsx("label",{htmlFor:"enableFormFluid",children:"Enable Field Enumeration"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"isOnboardingForm",onChange:I=>{i({isOnboardingForm:I.value}),A(I)},checked:t==null?void 0:t.isOnboardingForm}),o.jsx("label",{htmlFor:"isOnboardingForm",children:"Is Onboarding Form"})]})]}),a===!0?o.jsx(o.Fragment,{children:o.jsx(ys,{className:"mt-3",height:"8rem"})}):o.jsxs(ui,{className:"mt-3",header:"Auto Save Settings",children:[o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"auto-save",onChange:I=>{i({enableAutoSave:I.value})},checked:t==null?void 0:t.enableAutoSave}),o.jsx("label",{htmlFor:"auto-save",children:"Auto Save User Data"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"auto-save",onChange:I=>{i({enableAutoSaveBuilderSetting:I.value})},checked:t==null?void 0:t.enableAutoSaveBuilderSetting}),o.jsx("label",{htmlFor:"auto-save",children:"Auto Save Form Builder Settings"})]})]}),a===!0?o.jsx(o.Fragment,{children:o.jsx(ys,{className:"mt-3",height:"16rem"})}):o.jsxs(ui,{className:"mt-3",header:"Form Table Configuration",children:[o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"stripedRows",onChange:I=>{i({tableConfiguration:{...t==null?void 0:t.tableConfiguration,stripedRows:I.value}})},checked:(E=t==null?void 0:t.tableConfiguration)==null?void 0:E.stripedRows}),o.jsx("label",{htmlFor:"stripedRows",children:"Striped Rows"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"gridLines",onChange:I=>{i({tableConfiguration:{...t==null?void 0:t.tableConfiguration,gridLines:I.value}})},checked:(x=t==null?void 0:t.tableConfiguration)==null?void 0:x.gridLines}),o.jsx("label",{htmlFor:"gridLines",children:"Grid Lines"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"flexScroll",onChange:I=>{i({tableConfiguration:{...t==null?void 0:t.tableConfiguration,flexScroll:I.value}})},checked:(C=t==null?void 0:t.tableConfiguration)==null?void 0:C.flexScroll}),o.jsx("label",{htmlFor:"flexScroll",children:"Flex Scroll "})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"isResponsive",onChange:I=>{i({tableConfiguration:{...t==null?void 0:t.tableConfiguration,isResponsive:I.value}})},checked:(S=t==null?void 0:t.tableConfiguration)==null?void 0:S.isResponsive}),o.jsx("label",{htmlFor:"isResponsive",children:"isResponsive Rows"})]}),o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:"rowReorder",onChange:I=>{i({tableConfiguration:{...t==null?void 0:t.tableConfiguration,rowReorder:I.value}})},checked:(_=t==null?void 0:t.tableConfiguration)==null?void 0:_.rowReorder}),o.jsx("label",{htmlFor:"rowReorder",children:"Row Reorder"})]})]})]}),o.jsxs("div",{className:"col-6",children:[a===!0?o.jsx(o.Fragment,{children:o.jsx(ys,{height:"18rem"})}):o.jsx(ui,{header:"Languages",children:AQ.map((I,O)=>{const k=n.filter(function(L){return(I==null?void 0:I.key)===(L==null?void 0:L.key)});return o.jsxs("div",{className:"field-checkbox",children:[o.jsx(Ga,{inputId:O,name:"lagnuage",checked:k.length>0,onChange:L=>m(L,I)}),o.jsx("label",{htmlFor:O,children:I.language})]},O)})}),a===!0?o.jsx(o.Fragment,{children:o.jsx(ys,{className:"mt-3",height:"16rem"})}):o.jsxs(ui,{className:"mt-3",header:"Versioning",children:[o.jsx("h5",{children:"Change Form Version Title"}),o.jsx("div",{className:"field",children:o.jsx(bn,{value:(t==null?void 0:t.version_name)||"",minLength:2,placeholder:"Enter form version",maxLength:50,onChange:I=>{var O;i({version_name:(O=I==null?void 0:I.target)==null?void 0:O.value})}})}),o.jsx("h5",{children:"All Forms Version"}),o.jsx(_Ce,{}),o.jsx(Ft,{text:!0,size:"small",className:"p-button-info ml-3",onClick:()=>w(),label:"Create New Version",loading:a})]}),a===!0?o.jsx(o.Fragment,{children:o.jsx(ys,{className:"mt-3",height:"8rem"})}):o.jsx(ui,{className:"mt-3",header:"Export/Import",children:o.jsxs("span",{className:"flex",children:[o.jsx(NCe,{}),o.jsx(DCe,{})]})})]}),o.jsx("div",{className:"col-6"})]})})})},BCe=t=>{var v,m,A;const{fieldIndex:e,field:n,models:r,setfieldMappings:i,fieldMappings:s}=t,[a,l]=M.useState(null),[c,u]=M.useState(null),d=()=>{var x;const w=[...s],E=w.findIndex(C=>C.fieldId===(n==null?void 0:n.uuid));if(E!==-1){const C=[...r],S=C.findIndex(_=>{var I;return _.modelName===((I=w[E])==null?void 0:I.modelName)});u((x=w[E])==null?void 0:x.column_name),S!==-1&&l(C[S])}};M.useEffect(()=>(d(),()=>{}),[]);const[f,h]=M.useState(!1),g=w=>{const E=[...s],x=E.findIndex(S=>S.fieldId===w),C={fieldId:w,modelName:(a==null?void 0:a.modelName)||"",class:a==null?void 0:a.class,column_name:c||""};x!==-1?E[x]=C:E.push(C),i([...E])};return o.jsxs("div",{className:"grid",children:[o.jsxs(Fa,{header:`Map ${(v=n==null?void 0:n.label)==null?void 0:v.english} Field with Model`,visible:f,style:{width:"40vw"},footer:()=>o.jsx(o.Fragment,{children:o.jsx(Ft,{text:!0,label:"Set Field","aria-label":"Submit",onClick:()=>{g((n==null?void 0:n.uuid)||""),h(!1)}})}),onHide:()=>h(!1),children:[o.jsxs("p",{children:["Map ",(m=n==null?void 0:n.label)==null?void 0:m.english," Field with Model"]}),o.jsxs("div",{className:"flex justify-content-between",children:[o.jsx(Os,{value:a,onChange:w=>l(w.value),options:r,optionLabel:"modelName",className:"w-full md:w-14rem",placeholder:"Select a model field",filter:!0,showClear:!0}),o.jsx(Os,{value:c,onChange:w=>u(w.value),options:(a==null?void 0:a.columns)||[],className:"w-full md:w-14rem",placeholder:"Select a column",filter:!0,showClear:!0})]})]}),o.jsx("div",{className:"col-6",children:o.jsxs("p",{children:[o.jsxs("strong",{children:[e+1," "]}),"Field ",n==null?void 0:n.componentType,": ",(A=n==null?void 0:n.label)==null?void 0:A.english," Is Mapped to"," ",o.jsx($c,{className:"mr-2",severity:a!=null&&a.modelName?"success":"warning",value:(a==null?void 0:a.modelName)||"Nothing"}),"with column"," ",o.jsx($c,{className:"mr-2",severity:c?"success":"danger",value:c||"Nothing"})]})}),o.jsx("div",{className:"col-6",children:o.jsx(Ft,{text:!0,label:"Set Model","aria-label":"Submit",onClick:()=>{h(!0)}})})]},e+"-table-field-item")},VCe=t=>{const{fields:e}=t,[n]=M.useState([]),[r,i]=M.useState(!1),{formBuilderFormSchema:s,schemaBuilderUpdate:a}=on(),l=()=>{i(!0)},c=()=>{let d=[...(s==null?void 0:s.fieldMappings)||[]];d!=null&&d.length&&(d=d==null?void 0:d.filter(f=>e.some(h=>h.uuid===(f==null?void 0:f.fieldId)))),u(d)};M.useEffect(()=>(l(),c(),()=>{}),[]);const u=d=>{a({fieldMappings:d})};return o.jsx("div",{children:r===!0?o.jsxs(o.Fragment,{children:[o.jsx(ys,{className:"mt-3",height:"5rem"}),o.jsx(ys,{className:"mt-3",height:"5rem"}),o.jsx(ys,{className:"mt-3",height:"5rem"}),o.jsx(ys,{className:"mt-3",height:"5rem"}),o.jsx(ys,{className:"mt-3",height:"5rem"}),o.jsx(ys,{className:"mt-3",height:"5rem"}),o.jsx(ys,{className:"mt-3",height:"5rem"}),o.jsx(ys,{className:"mt-3",height:"5rem"})]}):o.jsx(o.Fragment,{children:(e==null?void 0:e.length)>0&&(n==null?void 0:n.length)>0&&(e==null?void 0:e.map((d,f)=>o.jsx("div",{className:"card",children:o.jsx(BCe,{fieldMappings:s!=null&&s.fieldMappings?s==null?void 0:s.fieldMappings:[],setfieldMappings:u,field:d,fieldIndex:f,models:n})},f+"-table-field-itemc-component")))})})},UCe=0,qCe=t=>{const{setShowPreview:e,activeIndex:n,userFormBuilderSettings:r}=t,{builderIsChangesSaved:i,builderTemplateName:s,formBuilderConfigurationType:a,formBuilderFormSchema:l,formBuilderLoading:c,formBuilderPublishedStatus:u,builderVersionName:d,saveFormProgress:f,schemaBuilderUpdate:h}=on(),g=M.useRef(null),v=()=>{f(l)},m=["Basic","Advanced"],[A,w]=M.useState((r==null?void 0:r.isAdvanceView)!==void 0&&r!=null&&r.isAdvanceView?"Advanced":"Basic"),E=S=>{w(S.value),h({isAdvanceView:S.value==="Advanced"})},x=o.jsx(M.Fragment,{children:o.jsxs("div",{className:"flex",children:[((a==null?void 0:a.key)===I7||(a==null?void 0:a.key)===_7||(a==null?void 0:a.key)===Bte)&&o.jsx(s1,{className:"mr-3",value:A,onChange:S=>E(S),options:m,disabled:c}),o.jsx(Ft,{text:!0,icon:"pi pi-eye",size:"small",className:"mr-2",onClick:()=>e(!0),label:"Preview"}),!u&&o.jsx(o.Fragment,{children:(l==null?void 0:l.enableAutoSaveBuilderSetting)===!1&&o.jsx(Ft,{text:!0,disabled:i,size:"small",className:i?"p-button-secondary":"p-button-info",onClick:()=>v(),label:"Save Progress",loading:c})})]})}),C=o.jsx(M.Fragment,{children:c===!0?o.jsx(o.Fragment,{children:o.jsx(ys,{width:"25rem",height:"1.5rem"})}):o.jsxs("div",{className:"font-medium text-900",children:["Builder - ",a==null?void 0:a.name," - ",s," ","- Version : ",d]})});return o.jsxs(o.Fragment,{children:[o.jsx(U3,{ref:g}),o.jsxs("div",{className:"flex",children:[o.jsx("div",{className:"flex w-5 justify-content-left align-items-start",children:C}),o.jsx("div",{className:"flex w-7 justify-content-right align-items-end",children:n===UCe&&x})]})]})};function $Ce(){const{formBuilderFormLayout:t,formBuilderFormSchema:e,clearBuilderSchema:n,schemaBuilderUpdate:r,saveFormProgress:i,userSelectedLanguage:s,builderIsChangesSaved:a,formBuilderPublishedStatus:l}=on(),c=Ej(),u=c==null?void 0:c.form_template_id,[d]=M.useState(!0),[f]=M.useState(null),[h,g]=M.useState(!0),[v,m]=M.useState(!1),[A,w]=M.useState(0),[E,x]=M.useState(null),C=async()=>{},S=M.useCallback(()=>{C()},[t,e]),_=k=>{const L={...e,intro:k};r(L)},I=()=>{i(e)},O=()=>{a===!1?(console.log("formBuilderPublishedStatus",l),l===!1?Nj({message:"You have unsaved changes, would you like to to save them or discard them?",header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:()=>{I(),g(!1),setTimeout(()=>{n()},1e3)},rejectLabel:"Close and discard changes",acceptLabel:"Close and save changes",reject:()=>{g(!1),setTimeout(()=>{n()},1e3)}}):(g(!1),setTimeout(()=>{n()},1e3))):(g(!1),setTimeout(()=>{n()},1e3))};return o.jsx(Fa,{maximizable:!0,header:()=>o.jsx(qCe,{setUserFormBuilderSettings:x,userFormBuilderSettings:E,formBuilderFormLayout:t,formTemplateId:u,showPreview:v,setShowPreview:m,activeIndex:A,emitSocketData:S}),visible:h,style:{width:"100vw",height:"100vh",maxHeight:"100%"},onHide:()=>O(),children:o.jsxs("div",{id:"form-builder",className:"grid",style:{overflow:"hidden",height:"100%"},children:[!d&&o.jsx(Ft,{text:!0,label:"Request Access",onClick:()=>{},className:"p-button-info"}),f&&o.jsxs("div",{children:[f==null?void 0:f.username," is editing so you have to wait to edits and leaves."]}),o.jsx("div",{className:"flex justify-content-end"}),o.jsx("div",{id:"users-arrow"}),o.jsx("div",{className:"col-12",style:{overflow:"hidden"},children:o.jsxs(Zs,{activeIndex:A,onTabChange:k=>w(k.index),children:[o.jsxs(fr,{header:"Builder",children:[o.jsx(Lf,{backend:Vf}),o.jsx(Vo,{style:{width:"75vw"},visible:v,onHide:()=>m(!1),position:"right",children:o.jsx(Lf,{backend:Vf,children:o.jsx("div",{className:"scroll-height-200"})})})]}),o.jsx(fr,{header:"Configuration",children:o.jsx("div",{className:"scroll-height-250",children:o.jsx(LCe,{})})}),o.jsx(fr,{header:"Intro",disabled:(e==null?void 0:e.showIntroTab)===!1,children:o.jsx(S4,{style:{height:"320px"},value:(e==null?void 0:e.intro)||"<p></p>",onTextChange:k=>{_(k==null?void 0:k.htmlValue)}})}),o.jsx(fr,{header:"Data Model Binding",children:o.jsx(VCe,{fields:e==null?void 0:e.tableFields})}),o.jsxs(fr,{header:"Weighting",children:[o.jsx("h3",{children:"Weighting"}),(t==null?void 0:t.length)>0&&t.map((k,L)=>{var V,z,P;return o.jsxs("div",{children:[o.jsx("h5",{children:(V=k==null?void 0:k.title)==null?void 0:V[s==null?void 0:s.type]}),((z=k==null?void 0:k.children)==null?void 0:z.length)>0&&((P=k==null?void 0:k.children)==null?void 0:P.map(($,R)=>o.jsx("div",{children:o.jsx(bCe,{page:k,section:$})},`weighting-section-${R}`)))]},`weighting-page-${L}`)}),o.jsx("hr",{}),"Total ",o.jsx(Bs,{placeholder:"0",readOnly:!0})," %"]})]})})]})})}const jCe=()=>o.jsx($Ce,{}),zCe=t=>{const{className:e=""}=t,{builderIsChangesSaved:n,schemaBuilderUpdate:r,formBuilderFormLayout:i,formBuilderFormSchema:s,formatTableFieldsHook:a,formBuilderLoading:l,saveFormProgress:c}=on(),u=d=>{n===!1?(d.preventDefault(),d.returnValue=!1):window.location.reload()};return M.useEffect(()=>(window.addEventListener("beforeunload",u),()=>{window.removeEventListener("beforeunload",u)}),[n]),M.useEffect(()=>((s==null?void 0:s.enableAutoSaveBuilderSetting)===!0&&l===!1?c(!1):r({isChangesSaved:!1}),a(i),()=>{}),[i]),o.jsx("div",{className:e,children:o.jsx(g6,{})})},HCe={padding:"1rem 0.5rem",cursor:"move",textAlign:"center"},Bd=t=>{const{data:e,showIcon:n,tags:r}=t,[{opacity:i},s]=is({type:Rn,item:e,collect:l=>({opacity:l.isDragging()?0:1})});function a(l,c){return l.length<=c?l:l.slice(0,c)+"..."}return o.jsxs("div",{ref:s,className:`card shadow-2 question builder-sidebar-item ${e==null?void 0:e.element}`,style:{...HCe,opacity:i},children:[i&&(e!=null&&e.toolTip)?e==null?void 0:e.toolTip(e):"",a(e==null?void 0:e.label,80),o.jsxs("div",{className:"mt-2",children:[n&&o.jsx($c,{icon:"pi pi-check",severity:"warning",className:"mr-2",rounded:!0}),r&&o.jsx(o.Fragment,{children:(r==null?void 0:r.length)>0&&(r==null?void 0:r.map((l,c)=>o.jsx($c,{severity:l==null?void 0:l.severity,className:"mr-2",value:l==null?void 0:l.label},`tagIndex-${c}`)))})]})]})};var YCe={root:"p-progress-spinner",spinner:"p-progress-spinner-svg",circle:"p-progress-spinner-circle"},KCe=`
4299
4299
  @layer primereact {
4300
4300
  .p-progress-spinner {
4301
4301
  position: relative;
@@ -58136,7 +58136,7 @@ var que = function() {
58136
58136
  theme: i.theme,
58137
58137
  formats: i.formats
58138
58138
  };
58139
- que ? A(new Quill(d.current, V)) : import("./quill-rFvZp53S.js").then(function(q) {
58139
+ que ? A(new Quill(d.current, V)) : import("./quill-D3y7B8wT.js").then(function(q) {
58140
58140
  if (q && Se.isExist(d.current)) {
58141
58141
  var P;
58142
58142
  q.default ? P = new q.default(d.current, V) : P = new q(d.current, V), A(P);
@@ -131446,7 +131446,7 @@ function $Ee() {
131446
131446
  e
131447
131447
  );
131448
131448
  }, k = () => {
131449
- s === !1 ? o === !1 ? KU({
131449
+ s === !1 ? (console.log("formBuilderPublishedStatus", o), o === !1 ? KU({
131450
131450
  message: "You have unsaved changes, would you like to to save them or discard them?",
131451
131451
  header: "Confirmation",
131452
131452
  icon: "pi pi-exclamation-triangle",
@@ -131464,7 +131464,7 @@ function $Ee() {
131464
131464
  }
131465
131465
  }) : (g(!1), setTimeout(() => {
131466
131466
  n();
131467
- }, 1e3)) : (g(!1), setTimeout(() => {
131467
+ }, 1e3))) : (g(!1), setTimeout(() => {
131468
131468
  n();
131469
131469
  }, 1e3));
131470
131470
  };
@@ -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-DLwrVltj.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-o0Mb2NAN.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.81",
3
+ "version": "0.2.82",
4
4
  "type": "module",
5
5
  "types": "dist/types/index",
6
6
  "files": [