cft-builder 0.1.6 → 0.1.7

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 { B as d, A as s, C as o, F as a, R as i, T as m, z as u } from "./main-Dydy3kT1.js";
1
+ import { B as d, A as s, C as o, F as a, R as i, T as m, z as u } from "./main-DPuxzlEA.js";
2
2
  export {
3
3
  d as BuilderItems,
4
4
  s as BuilderItemsRender,
@@ -1827,8 +1827,8 @@ __p += '`),xi&&(hn+=`' +
1827
1827
  function print() { __p += __j.call(arguments, '') }
1828
1828
  `:`;
1829
1829
  `)+hn+`return __p
1830
- }`;var ei=uY(function(){return ft(Be,sr+"return "+hn).apply(n,Ge)});if(ei.source=hn,Rx(ei))throw ei;return ei}function NNe(p){return Qi(p).toLowerCase()}function FNe(p){return Qi(p).toUpperCase()}function kNe(p,b,D){if(p=Qi(p),p&&(D||b===n))return er(p);if(!p||!(b=Ml(b)))return p;var R=Vo(p),Ae=Vo(b),Be=ai(R,Ae),Ge=ja(R,Ae)+1;return O0(R,Be,Ge).join("")}function PNe(p,b,D){if(p=Qi(p),p&&(D||b===n))return p.slice(0,zh(p)+1);if(!p||!(b=Ml(b)))return p;var R=Vo(p),Ae=ja(R,Vo(b))+1;return O0(R,0,Ae).join("")}function MNe(p,b,D){if(p=Qi(p),p&&(D||b===n))return p.replace(Gn,"");if(!p||!(b=Ml(b)))return p;var R=Vo(p),Ae=ai(R,Vo(b));return O0(R,Ae).join("")}function LNe(p,b){var D=V,R=L;if(Ha(b)){var Ae="separator"in b?b.separator:Ae;D="length"in b?Rr(b.length):D,R="omission"in b?Ml(b.omission):R}p=Qi(p);var Be=p.length;if(kl(p)){var Ge=Vo(p);Be=Ge.length}if(D>=Be)return p;var lt=D-Bu(R);if(lt<1)return R;var wt=Ge?O0(Ge,0,lt).join(""):p.slice(0,lt);if(Ae===n)return wt+R;if(Ge&&(lt+=wt.length-lt),Gx(Ae)){if(p.slice(lt).search(Ae)){var en,rn=wt;for(Ae.global||(Ae=kn(Ae.source,Qi(Ft.exec(Ae))+"g")),Ae.lastIndex=0;en=Ae.exec(rn);)var hn=en.index;wt=wt.slice(0,hn===n?lt:hn)}}else if(p.indexOf(Ml(Ae),lt)!=lt){var Pn=wt.lastIndexOf(Ae);Pn>-1&&(wt=wt.slice(0,Pn))}return wt+R}function BNe(p){return p=Qi(p),p&&$n.test(p)?p.replace(yn,Xg):p}var VNe=Rh(function(p,b,D){return p+(D?" ":"")+b.toUpperCase()}),Jx=dz("toUpperCase");function cY(p,b,D){return p=Qi(p),b=D?n:b,b===n?Nd(p)?Wg(p):Od(p):p.match(b)||[]}var uY=oi(function(p,b){try{return ci(p,n,b)}catch(D){return Rx(D)?D:new rt(D)}}),UNe=Bd(function(p,b){return Ra(b,function(D){D=Hu(D),Md(p,D,Kx(p[D],p))}),p});function qNe(p){var b=p==null?0:p.length,D=wr();return p=b?ki(p,function(R){if(typeof R[1]!="function")throw new lr(s);return[D(R[0]),R[1]]}):[],oi(function(R){for(var Ae=-1;++Ae<b;){var Be=p[Ae];if(ci(Be[0],this,R))return ci(Be[1],this,R)}})}function jNe(p){return fIe(hc(p,f))}function Zx(p){return function(){return p}}function $Ne(p,b){return p==null||p!==p?b:p}var HNe=hz(),zNe=hz(!0);function ll(p){return p}function eC(p){return HH(typeof p=="function"?p:hc(p,f))}function YNe(p){return YH(hc(p,f))}function KNe(p,b){return KH(p,hc(b,f))}var XNe=oi(function(p,b){return function(D){return em(D,p,b)}}),RNe=oi(function(p,b){return function(D){return em(p,D,b)}});function tC(p,b,D){var R=js(b),Ae=r9(b,R);D==null&&!(Ha(b)&&(Ae.length||!R.length))&&(D=b,b=p,p=this,Ae=r9(b,js(b)));var Be=!(Ha(D)&&"chain"in D)||!!D.chain,Ge=Ud(p);return Ra(Ae,function(lt){var wt=b[lt];p[lt]=wt,Ge&&(p.prototype[lt]=function(){var en=this.__chain__;if(Be||en){var rn=p(this.__wrapped__),hn=rn.__actions__=al(this.__actions__);return hn.push({func:wt,args:arguments,thisArg:p}),rn.__chain__=en,rn}return wt.apply(p,Bs([this.value()],arguments))})}),p}function GNe(){return Fr._===this&&(Fr._=Vu),this}function nC(){}function WNe(p){return p=Rr(p),oi(function(b){return XH(b,p)})}var QNe=kx(ki),JNe=kx(Pu),ZNe=kx(Nl);function dY(p){return qx(p)?vt(Hu(p)):DIe(p)}function eFe(p){return function(b){return p==null?n:V1(p,b)}}var tFe=gz(),nFe=gz(!0);function rC(){return[]}function iC(){return!1}function rFe(){return{}}function iFe(){return""}function aFe(){return!0}function sFe(p,b){if(p=Rr(p),p<1||p>G)return[];var D=pe,R=qs(p,pe);b=wr(b),p-=pe;for(var Ae=gn(R,b);++D<p;)b(D);return Ae}function oFe(p){return Ur(p)?ki(p,Hu):Ll(p)?[p]:al(Nz(Qi(p)))}function lFe(p){var b=++ui;return Qi(p)+b}var cFe=c9(function(p,b){return p+b},0),uFe=Px("ceil"),dFe=c9(function(p,b){return p/b},1),fFe=Px("floor");function hFe(p){return p&&p.length?n9(p,ll,yx):n}function pFe(p,b){return p&&p.length?n9(p,wr(b,2),yx):n}function gFe(p){return He(p,ll)}function mFe(p,b){return He(p,wr(b,2))}function vFe(p){return p&&p.length?n9(p,ll,xx):n}function bFe(p,b){return p&&p.length?n9(p,wr(b,2),xx):n}var yFe=c9(function(p,b){return p*b},1),AFe=Px("round"),wFe=c9(function(p,b){return p-b},0);function SFe(p){return p&&p.length?on(p,ll):0}function xFe(p,b){return p&&p.length?on(p,wr(b,2)):0}return Ee.after=YDe,Ee.ary=$z,Ee.assign=FOe,Ee.assignIn=nY,Ee.assignInWith=S9,Ee.assignWith=kOe,Ee.at=POe,Ee.before=Hz,Ee.bind=Kx,Ee.bindAll=UNe,Ee.bindKey=zz,Ee.castArray=rOe,Ee.chain=Uz,Ee.chunk=f_e,Ee.compact=h_e,Ee.concat=p_e,Ee.cond=qNe,Ee.conforms=jNe,Ee.constant=Zx,Ee.countBy=SDe,Ee.create=MOe,Ee.curry=Yz,Ee.curryRight=Kz,Ee.debounce=Xz,Ee.defaults=LOe,Ee.defaultsDeep=BOe,Ee.defer=KDe,Ee.delay=XDe,Ee.difference=g_e,Ee.differenceBy=m_e,Ee.differenceWith=v_e,Ee.drop=b_e,Ee.dropRight=y_e,Ee.dropRightWhile=A_e,Ee.dropWhile=w_e,Ee.fill=S_e,Ee.filter=CDe,Ee.flatMap=IDe,Ee.flatMapDeep=_De,Ee.flatMapDepth=DDe,Ee.flatten=Mz,Ee.flattenDeep=x_e,Ee.flattenDepth=C_e,Ee.flip=RDe,Ee.flow=HNe,Ee.flowRight=zNe,Ee.fromPairs=T_e,Ee.functions=zOe,Ee.functionsIn=YOe,Ee.groupBy=ODe,Ee.initial=I_e,Ee.intersection=__e,Ee.intersectionBy=D_e,Ee.intersectionWith=O_e,Ee.invert=XOe,Ee.invertBy=ROe,Ee.invokeMap=FDe,Ee.iteratee=eC,Ee.keyBy=kDe,Ee.keys=js,Ee.keysIn=ol,Ee.map=m9,Ee.mapKeys=WOe,Ee.mapValues=QOe,Ee.matches=YNe,Ee.matchesProperty=KNe,Ee.memoize=b9,Ee.merge=JOe,Ee.mergeWith=rY,Ee.method=XNe,Ee.methodOf=RNe,Ee.mixin=tC,Ee.negate=y9,Ee.nthArg=WNe,Ee.omit=ZOe,Ee.omitBy=eNe,Ee.once=GDe,Ee.orderBy=PDe,Ee.over=QNe,Ee.overArgs=WDe,Ee.overEvery=JNe,Ee.overSome=ZNe,Ee.partial=Xx,Ee.partialRight=Rz,Ee.partition=MDe,Ee.pick=tNe,Ee.pickBy=iY,Ee.property=dY,Ee.propertyOf=eFe,Ee.pull=P_e,Ee.pullAll=Bz,Ee.pullAllBy=M_e,Ee.pullAllWith=L_e,Ee.pullAt=B_e,Ee.range=tFe,Ee.rangeRight=nFe,Ee.rearg=QDe,Ee.reject=VDe,Ee.remove=V_e,Ee.rest=JDe,Ee.reverse=zx,Ee.sampleSize=qDe,Ee.set=rNe,Ee.setWith=iNe,Ee.shuffle=jDe,Ee.slice=U_e,Ee.sortBy=zDe,Ee.sortedUniq=K_e,Ee.sortedUniqBy=X_e,Ee.split=INe,Ee.spread=ZDe,Ee.tail=R_e,Ee.take=G_e,Ee.takeRight=W_e,Ee.takeRightWhile=Q_e,Ee.takeWhile=J_e,Ee.tap=hDe,Ee.throttle=eOe,Ee.thru=g9,Ee.toArray=Zz,Ee.toPairs=aY,Ee.toPairsIn=sY,Ee.toPath=oFe,Ee.toPlainObject=tY,Ee.transform=aNe,Ee.unary=tOe,Ee.union=Z_e,Ee.unionBy=eDe,Ee.unionWith=tDe,Ee.uniq=nDe,Ee.uniqBy=rDe,Ee.uniqWith=iDe,Ee.unset=sNe,Ee.unzip=Yx,Ee.unzipWith=Vz,Ee.update=oNe,Ee.updateWith=lNe,Ee.values=Qh,Ee.valuesIn=cNe,Ee.without=aDe,Ee.words=cY,Ee.wrap=nOe,Ee.xor=sDe,Ee.xorBy=oDe,Ee.xorWith=lDe,Ee.zip=cDe,Ee.zipObject=uDe,Ee.zipObjectDeep=dDe,Ee.zipWith=fDe,Ee.entries=aY,Ee.entriesIn=sY,Ee.extend=nY,Ee.extendWith=S9,tC(Ee,Ee),Ee.add=cFe,Ee.attempt=uY,Ee.camelCase=hNe,Ee.capitalize=oY,Ee.ceil=uFe,Ee.clamp=uNe,Ee.clone=iOe,Ee.cloneDeep=sOe,Ee.cloneDeepWith=oOe,Ee.cloneWith=aOe,Ee.conformsTo=lOe,Ee.deburr=lY,Ee.defaultTo=$Ne,Ee.divide=dFe,Ee.endsWith=pNe,Ee.eq=Zc,Ee.escape=gNe,Ee.escapeRegExp=mNe,Ee.every=xDe,Ee.find=TDe,Ee.findIndex=kz,Ee.findKey=VOe,Ee.findLast=EDe,Ee.findLastIndex=Pz,Ee.findLastKey=UOe,Ee.floor=fFe,Ee.forEach=qz,Ee.forEachRight=jz,Ee.forIn=qOe,Ee.forInRight=jOe,Ee.forOwn=$Oe,Ee.forOwnRight=HOe,Ee.get=Wx,Ee.gt=cOe,Ee.gte=uOe,Ee.has=KOe,Ee.hasIn=Qx,Ee.head=Lz,Ee.identity=ll,Ee.includes=NDe,Ee.indexOf=E_e,Ee.inRange=dNe,Ee.invoke=GOe,Ee.isArguments=j1,Ee.isArray=Ur,Ee.isArrayBuffer=dOe,Ee.isArrayLike=sl,Ee.isArrayLikeObject=is,Ee.isBoolean=fOe,Ee.isBuffer=N0,Ee.isDate=hOe,Ee.isElement=pOe,Ee.isEmpty=gOe,Ee.isEqual=mOe,Ee.isEqualWith=vOe,Ee.isError=Rx,Ee.isFinite=bOe,Ee.isFunction=Ud,Ee.isInteger=Gz,Ee.isLength=A9,Ee.isMap=Wz,Ee.isMatch=yOe,Ee.isMatchWith=AOe,Ee.isNaN=wOe,Ee.isNative=SOe,Ee.isNil=COe,Ee.isNull=xOe,Ee.isNumber=Qz,Ee.isObject=Ha,Ee.isObjectLike=Ga,Ee.isPlainObject=sm,Ee.isRegExp=Gx,Ee.isSafeInteger=TOe,Ee.isSet=Jz,Ee.isString=w9,Ee.isSymbol=Ll,Ee.isTypedArray=Wh,Ee.isUndefined=EOe,Ee.isWeakMap=IOe,Ee.isWeakSet=_Oe,Ee.join=N_e,Ee.kebabCase=vNe,Ee.last=gc,Ee.lastIndexOf=F_e,Ee.lowerCase=bNe,Ee.lowerFirst=yNe,Ee.lt=DOe,Ee.lte=OOe,Ee.max=hFe,Ee.maxBy=pFe,Ee.mean=gFe,Ee.meanBy=mFe,Ee.min=vFe,Ee.minBy=bFe,Ee.stubArray=rC,Ee.stubFalse=iC,Ee.stubObject=rFe,Ee.stubString=iFe,Ee.stubTrue=aFe,Ee.multiply=yFe,Ee.nth=k_e,Ee.noConflict=GNe,Ee.noop=nC,Ee.now=v9,Ee.pad=ANe,Ee.padEnd=wNe,Ee.padStart=SNe,Ee.parseInt=xNe,Ee.random=fNe,Ee.reduce=LDe,Ee.reduceRight=BDe,Ee.repeat=CNe,Ee.replace=TNe,Ee.result=nNe,Ee.round=AFe,Ee.runInContext=P,Ee.sample=UDe,Ee.size=$De,Ee.snakeCase=ENe,Ee.some=HDe,Ee.sortedIndex=q_e,Ee.sortedIndexBy=j_e,Ee.sortedIndexOf=$_e,Ee.sortedLastIndex=H_e,Ee.sortedLastIndexBy=z_e,Ee.sortedLastIndexOf=Y_e,Ee.startCase=_Ne,Ee.startsWith=DNe,Ee.subtract=wFe,Ee.sum=SFe,Ee.sumBy=xFe,Ee.template=ONe,Ee.times=sFe,Ee.toFinite=qd,Ee.toInteger=Rr,Ee.toLength=eY,Ee.toLower=NNe,Ee.toNumber=mc,Ee.toSafeInteger=NOe,Ee.toString=Qi,Ee.toUpper=FNe,Ee.trim=kNe,Ee.trimEnd=PNe,Ee.trimStart=MNe,Ee.truncate=LNe,Ee.unescape=BNe,Ee.uniqueId=lFe,Ee.upperCase=VNe,Ee.upperFirst=Jx,Ee.each=qz,Ee.eachRight=jz,Ee.first=Lz,tC(Ee,function(){var p={};return ju(Ee,function(b,D){Er.call(Ee.prototype,D)||(p[D]=b)}),p}(),{chain:!1}),Ee.VERSION=r,Ra(["bind","bindKey","curry","curryRight","partial","partialRight"],function(p){Ee[p].placeholder=Ee}),Ra(["drop","take"],function(p,b){si.prototype[p]=function(D){D=D===n?1:rs(Rr(D),0);var R=this.__filtered__&&!b?new si(this):this.clone();return R.__filtered__?R.__takeCount__=qs(D,R.__takeCount__):R.__views__.push({size:qs(D,pe),type:p+(R.__dir__<0?"Right":"")}),R},si.prototype[p+"Right"]=function(D){return this.reverse()[p](D).reverse()}}),Ra(["filter","map","takeWhile"],function(p,b){var D=b+1,R=D==$||D==me;si.prototype[p]=function(Ae){var Be=this.clone();return Be.__iteratees__.push({iteratee:wr(Ae,3),type:D}),Be.__filtered__=Be.__filtered__||R,Be}}),Ra(["head","last"],function(p,b){var D="take"+(b?"Right":"");si.prototype[p]=function(){return this[D](1).value()[0]}}),Ra(["initial","tail"],function(p,b){var D="drop"+(b?"":"Right");si.prototype[p]=function(){return this.__filtered__?new si(this):this[D](1)}}),si.prototype.compact=function(){return this.filter(ll)},si.prototype.find=function(p){return this.filter(p).head()},si.prototype.findLast=function(p){return this.reverse().find(p)},si.prototype.invokeMap=oi(function(p,b){return typeof p=="function"?new si(this):this.map(function(D){return em(D,p,b)})}),si.prototype.reject=function(p){return this.filter(y9(wr(p)))},si.prototype.slice=function(p,b){p=Rr(p);var D=this;return D.__filtered__&&(p>0||b<0)?new si(D):(p<0?D=D.takeRight(-p):p&&(D=D.drop(p)),b!==n&&(b=Rr(b),D=b<0?D.dropRight(-b):D.take(b-p)),D)},si.prototype.takeRightWhile=function(p){return this.reverse().takeWhile(p).reverse()},si.prototype.toArray=function(){return this.take(pe)},ju(si.prototype,function(p,b){var D=/^(?:filter|find|map|reject)|While$/.test(b),R=/^(?:head|last)$/.test(b),Ae=Ee[R?"take"+(b=="last"?"Right":""):b],Be=R||/^find/.test(b);Ae&&(Ee.prototype[b]=function(){var Ge=this.__wrapped__,lt=R?[1]:arguments,wt=Ge instanceof si,en=lt[0],rn=wt||Ur(Ge),hn=function(gi){var xi=Ae.apply(Ee,Bs([gi],lt));return R&&Pn?xi[0]:xi};rn&&D&&typeof en=="function"&&en.length!=1&&(wt=rn=!1);var Pn=this.__chain__,sr=!!this.__actions__.length,Sr=Be&&!Pn,ei=wt&&!sr;if(!Be&&rn){Ge=ei?Ge:new si(this);var xr=p.apply(Ge,lt);return xr.__actions__.push({func:g9,args:[hn],thisArg:n}),new gs(xr,Pn)}return Sr&&ei?p.apply(this,lt):(xr=this.thru(hn),Sr?R?xr.value()[0]:xr.value():xr)})}),Ra(["pop","push","shift","sort","splice","unshift"],function(p){var b=In[p],D=/^(?:push|sort|unshift)$/.test(p)?"tap":"thru",R=/^(?:pop|shift)$/.test(p);Ee.prototype[p]=function(){var Ae=arguments;if(R&&!this.__chain__){var Be=this.value();return b.apply(Ur(Be)?Be:[],Ae)}return this[D](function(Ge){return b.apply(Ur(Ge)?Ge:[],Ae)})}}),ju(si.prototype,function(p,b){var D=Ee[b];if(D){var R=D.name+"";Er.call(Ve,R)||(Ve[R]=[]),Ve[R].push({name:b,func:D})}}),Ve[l9(n,w).name]=[{name:"wrapper",func:n}],si.prototype.clone=Jv,si.prototype.reverse=Zv,si.prototype.value=Qg,Ee.prototype.at=pDe,Ee.prototype.chain=gDe,Ee.prototype.commit=mDe,Ee.prototype.next=vDe,Ee.prototype.plant=yDe,Ee.prototype.reverse=ADe,Ee.prototype.toJSON=Ee.prototype.valueOf=Ee.prototype.value=wDe,Ee.prototype.first=Ee.prototype.head,Ws&&(Ee.prototype[Ws]=bDe),Ee},gt=C0();Zr?((Zr.exports=gt)._=gt,Vr._=gt):Fr._=gt}).call(Ni)}(Zm,Zm.exports);var _t=Zm.exports;const b_=bs(_t),e3={type:cC,isCoverPage:!1,margin:{left:0,right:0,top:0,bottom:0},isVisible:!0,isHidden:!1,isValid:!1,displayRules:[],title:{english:"Page 1"}},lf={type:na,showSectionHeader:!1,isVisible:!0,isHidden:!1,isValid:!1,showSectionTitle:!1,showSectionSubTitle:!1,heading:{english:"Section header"},subHeadingText:{english:""},isCollapsed:!1},nu={type:bo,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:[]},Sc={type:ms,isCollapsed:!1},MQ=t=>{let e=t;e={...e,uuid:nt()};const n=e.children.map(r=>({...r,uuid:nt(),children:r.children.map(i=>({...i,uuid:nt(),children:i.children.map(a=>{var s;return{...a,uuid:nt(),...((s=a==null?void 0:a.children)==null?void 0:s.length)>0?{children:a.children.map(l=>{var c;return{...l,uuid:nt(),...((c=l.options)==null?void 0:c.length)>0?{options:l.options.map(u=>({...u,uuid:nt()}))}:{}}})}:{}}})}))}));return e={...e,children:n},e};function LQ(t){return e=>{const n={...e3,uuid:nt(),title:{english:`Page ${t+1}`},children:[{...lf,uuid:nt(),children:[{...nu,uuid:nt(),children:[{...Sc,uuid:nt(),children:[]}]}]}]};e({type:JI,payLoad:n})}}function BQ(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:v_,payLoad:{tableFields:n}})}}function VQ(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=MQ(a),n({type:n_,payLoad:{page:a,pageIndex:e}})}}function UQ(t,e){return n=>{n({type:m_,payLoad:{pageIndex:t,page:e}})}}function qQ(t){return e=>{e({type:YI,payLoad:{pageIndex:t}})}}const y_=t=>{let e=t;e={...e,uuid:nt()};const n=e.children.map(r=>({...r,uuid:nt(),children:r.children.map(i=>{var a;return{...i,uuid:nt(),...((a=i==null?void 0:i.children)==null?void 0:a.length)>0?{children:i.children.map(s=>{var l;return{...s,uuid:nt(),...((l=s.options)==null?void 0:l.length)>0?{options:s.options.map(c=>({...c,uuid:nt()}))}:{}}})}:{}}})}));return e={...e,children:n},e};function jQ(t,e){return n=>{n({type:KI,payLoad:{pageIndex:t,sectionIndex:e}})}}function $Q(t){return e=>{const n={...lf,uuid:nt(),children:[{...nu,uuid:nt(),children:[{...Sc,uuid:nt(),children:[]}]}]};e({type:ZI,payLoad:{pageIndex:t,section:n}})}}function HQ(t,e,n){return r=>{r({type:QI,payLoad:{pageIndex:t,sectionIndex:e,section:n}})}}function zQ(t,e,n){return r=>{const i=t;let a=_t.cloneDeep(i);a=y_(a),r({type:r_,payLoad:{section:a,pageIndex:e,sectionIndex:n}})}}function YQ(t,e){return n=>{const r=t;let i=_t.cloneDeep(r);i=y_(i),n({type:i_,payLoad:{section:i,pageIndex:e}})}}const KQ=t=>{let e=t;e={...e,uuid:nt()};const n=e.children.map(r=>{var i;return{...r,uuid:nt(),...((i=r==null?void 0:r.children)==null?void 0:i.length)>0?{children:r.children.map(a=>{var s;return{...a,uuid:nt(),...((s=a.options)==null?void 0:s.length)>0?{options:a.options.map(l=>({...l,uuid:nt()}))}:{}}})}:{}}});return e={...e,children:n},e};function XQ(t,e,n,r){return i=>{const a=t;let s=_t.cloneDeep(a);s=KQ(s),i({type:a_,payLoad:{row:s,pageIndex:e,sectionIndex:n,rowIndex:r}})}}function RQ(t,e,n,r){return i=>{i({type:f8,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,row:r}})}}function GQ(t,e,n){return r=>{r({type:XI,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n}})}}function WQ(t,e){return n=>{const r={...nu,uuid:nt(),isCollapsed:!1,children:[{...Sc,uuid:nt(),children:[]}]};n({type:e_,payLoad:{pageIndex:t,sectionIndex:e,row:r}})}}function QQ(t,e,n,r){return i=>{i({type:c_,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,fieldItem:r}})}}const JQ=t=>{var r;let e=t;e={...e,uuid:nt()};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:nt(),...((s=i.options)==null?void 0:s.length)>0?{options:i.options.map((l,c)=>({...l,uuid:nt()}))}:{}}}):[];return e={...e,children:n},e};function ZQ(t,e,n){return r=>{const i={...Sc,uuid:nt(),children:[]};r({type:t_,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,column:i}})}}function eJ(t,e,n,r,i){return a=>{const s=t;let l=_t.cloneDeep(s);l=JQ(l),a({type:s_,payLoad:{column:l,pageIndex:e,sectionIndex:n,rowIndex:r,columnIndex:i}})}}function tJ(t,e,n,r){return i=>{i({type:RI,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r}})}}function A_(t,e,n,r){return i=>{i({type:f8,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,row:r}})}}function nJ(t,e,n,r,i){return(a,s)=>{var m,g,v,A;const{layout:l,tableFields:c}=s;let u=(m=l[t])==null?void 0:m.children[e].children[n];const d=(A=(v=(g=l[t])==null?void 0:g.children[e])==null?void 0:v.children[n])==null?void 0:A.children[r].children[i];if((u==null?void 0:u.rowIsRepeatable)===!0){const w=[...u.repeatableFields],x=_t.findIndex(w,function(S){return S.uuid===(d==null?void 0:d.uuid)});w.splice(x,1),u={...u,repeatableFields:w},a(A_(t,e,n,u))}const f=_t.findIndex(c,function(w){return w.uuid===(d==null?void 0:d.uuid)});c.splice(f,1),a({type:GI,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i}})}}function rJ(t,e,n,r,i,a){return(s,l)=>{var m,g,v,A;const{layout:c,tableFields:u}=l;let d=(m=c[t])==null?void 0:m.children[e].children[n];if((d==null?void 0:d.rowIsRepeatable)===!0){const w=(A=(v=(g=c[t])==null?void 0:g.children[e])==null?void 0:v.children[n])==null?void 0:A.children[r].children[i],x=[...d.repeatableFields],S=_t.findIndex(x,function(E){return E.uuid===(w==null?void 0:w.uuid)});S===-1?x.splice(i,0,a):x[S]=a,x[S]=a,d={...d,repeatableFields:x},s(A_(t,e,n,d))}const f={type:WI,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,field:a}},h=u.findIndex(w=>w.uuid===a.uuid);h>=0&&(u[h]=a),s(f)}}function iJ(t,e,n,r,i,a){return s=>{var d;const l=t;let c=_t.cloneDeep(l);if(c={...c,uuid:nt()},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:nt()}));c={...c,options:f}}s({type:o_,payLoad:{field:c,pageIndex:e,sectionIndex:n,rowIndex:r,columnIndex:i,fieldIndex:a}})}}function aJ(t,e,n,r,i,a,s,l){return c=>{c({type:u_,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,ruleIndex:a,conditionIndex:s,field:l}})}}function sJ(t,e,n,r,i,a,s,l){return c=>{c({type:d_,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,gridColumnIndex:s,gridRowIndex:a,field:l}})}}function oJ(t,e,n,r,i,a,s,l,c){return u=>{u({type:p_,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,gridRowIndex:a,gridColumnIndex:s,fieldChildrenIndex:l,field:c}})}}function lJ(t,e,n,r,i,a,s,l){return c=>{c({type:g_,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,gridRowIndex:a,gridColumnIndex:s,fieldChildrenIndex:l}})}}function cJ(t,e,n,r,i,a,s,l,c){return u=>{u({type:f_,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,ruleIndex:a,conditionIndex:s,inlineFieldIndex:l,field:c}})}}function uJ(t,e,n,r,i,a,s,l){return c=>{c({type:h_,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,ruleIndex:a,conditionIndex:s,inlineFieldIndex:l}})}}function dJ(t){return e=>{e({type:of,payLoad:{formSchema:t}})}}function fJ(t){return e=>{e({type:of,payLoad:{layout:t}})}}function hJ(t){return(e,n)=>{const{languages:r}=n,i={type:of,payLoad:{languages:[...r,t]}};e(i)}}function pJ(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:of,payLoad:{languages:a}})}}function gJ(t){return e=>{const n={type:of,payLoad:{userSelectedLanguage:t.value}};e(n)}}function mJ(t){return e=>{e({type:Jm,payLoad:{formType:t}})}}function vJ(t){return e=>{e({type:Jm,payLoad:t})}}function bJ(t){return e=>{e({type:Jm,payLoad:{editing_by:t}})}}function yJ(){return t=>{t({type:l_,payLoad:null})}}const h8={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:nt(),...e3,children:[{uuid:nt(),...lf,children:[{uuid:nt(),...nu,children:[{uuid:nt(),...Sc,children:[]}]}]}]}],conditionalTabsRules:[],conditionalSectionsRules:[]},AJ=(t=h8,e)=>{var n,r;switch(e.type){case kQ:return{...t,...e.payLoad};case FQ:return{...t,...e.payLoad};case l_:return{...t,...h8};case of:return console.log("action",e),{...t,...e.payLoad};case Jm:return{...t,...e.payLoad};case YI:{const{pageIndex:i}=e.payLoad;return{...t,layout:t.layout.filter((a,s)=>s!==i)}}case JI:return{...t,layout:[...t.layout,e.payLoad]};case ZI:{const{pageIndex:i,section:a}=e.payLoad,s=[...t.layout];return s[i].children=[...s[i].children,a],{...t,layout:s}}case c_:{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 PQ:{const{fieldItem:i}=e.payLoad;let a=[...t.tableFields];return a=[...a,i],{...t,tableFields:a}}case v_:return{...t,...e.payLoad};case e_:{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 t_:{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 u_:{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 d_:{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 f_:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,ruleIndex:u,conditionIndex:d,inlineFieldIndex:f,field:h}=e.payLoad,m=[...t.layout];return m[i].children[a].children[s].children[l].children[c].inlineConditionalRules.rules[u].conditions[d].children[f]=h,{...t,layout:m}}case p_:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,gridRowIndex:u,gridColumnIndex:d,fieldChildrenIndex:f,field:h}=e.payLoad,m=[...t.layout];return m[i].children[a].children[s].children[l].children[c].children[f]={[`${u}-${d}`]:h},{...t,layout:m}}case h_:{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 g_:{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 KI:{const{pageIndex:i,sectionIndex:a}=e.payLoad,s=[...t.layout];return s[i].children.splice(a,1),{...t,layout:s}}case XI:{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 RI:{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 GI:{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 WI:{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 QI:{const{pageIndex:i,sectionIndex:a,section:s}=e.payLoad,l=[...t.layout];return l[i].children[a]=s,{...t,layout:l}}case f8:{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 m_:{const{pageIndex:i,page:a}=e.payLoad,s=[...t.layout];return s[i]=a,{...t,layout:s}}case n_:{const{page:i,pageIndex:a}=e.payLoad,s=[...t.layout];return s.splice(a+1,0,i),{...t,layout:s}}case r_:{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 i_:{const{section:i,pageIndex:a}=e.payLoad,s=[...t.layout];return s[a].children.push(i),{...t,layout:s}}case a_:{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 s_:{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 o_:{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},w_=k.createContext({dragDropManager:void 0});function ru(t){"@babel/helpers - typeof";return ru=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},ru(t)}function wJ(t,e){if(ru(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(ru(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function SJ(t){var e=wJ(t,"string");return ru(e)=="symbol"?e:e+""}function xJ(t,e,n){return(e=SJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function S_(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 x_(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?S_(Object(n),!0).forEach(function(r){xJ(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):S_(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function jl(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 C_=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),p8=function(){return Math.random().toString(36).substring(7).split("").join(".")},T_={INIT:"@@redux/INIT"+p8(),REPLACE:"@@redux/REPLACE"+p8(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+p8()}};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 TJ(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(_J(t))return"date";if(IJ(t))return"error";var n=EJ(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 EJ(t){return typeof t.constructor=="function"?t.constructor.name:null}function IJ(t){return t instanceof Error||typeof t.message=="string"&&t.constructor&&typeof t.constructor.stackTraceLimit=="number"}function _J(t){return t instanceof Date?!0:typeof t.toDateString=="function"&&typeof t.getDate=="function"&&typeof t.setDate=="function"}function cf(t){var e=typeof t;return process.env.NODE_ENV!=="production"&&(e=TJ(t)),e}function E_(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"?jl(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"?jl(1):"Expected the enhancer to be a function. Instead, received: '"+cf(n)+"'");return n(E_)(t,e)}if(typeof t!="function")throw new Error(process.env.NODE_ENV==="production"?jl(2):"Expected the root reducer to be a function. Instead, received: '"+cf(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"?jl(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(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?jl(4):"Expected the listener to be a function. Instead, received: '"+cf(v)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?jl(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(v),function(){if(A){if(c)throw new Error(process.env.NODE_ENV==="production"?jl(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 x=l.indexOf(v);l.splice(x,1),s=null}}}function h(v){if(!CJ(v))throw new Error(process.env.NODE_ENV==="production"?jl(7):"Actions must be plain objects. Instead, the actual type was: '"+cf(v)+"'. 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 v.type>"u")throw new Error(process.env.NODE_ENV==="production"?jl(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"?jl(9):"Reducers may not dispatch actions.");try{c=!0,a=i(a,v)}finally{c=!1}for(var A=s=l,w=0;w<A.length;w++){var x=A[w];x()}return v}function m(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?jl(10):"Expected the nextReducer to be a function. Instead, received: '"+cf(v));i=v,h({type:T_.REPLACE})}function g(){var v,A=f;return v={subscribe:function(x){if(typeof x!="object"||x===null)throw new Error(process.env.NODE_ENV==="production"?jl(11):"Expected the observer to be an object. Instead, received: '"+cf(x)+"'");function S(){x.next&&x.next(d())}S();var E=A(S);return{unsubscribe:E}}},v[C_]=function(){return this},v}return h({type:T_.INIT}),r={dispatch:h,subscribe:f,getState:d,replaceReducer:m},r[C_]=g,r}function qr(t,e,...n){if(DJ()&&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 DJ(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function OJ(t,e,n){return e.split(".").reduce((r,i)=>r&&r[i]?r[i]:n||null,t)}function NJ(t,e){return t.filter(n=>n!==e)}function I_(t){return typeof t=="object"}function FJ(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 kJ(t,e){return t.filter(n=>e.indexOf(n)>-1)}const g8="dnd-core/INIT_COORDS",t3="dnd-core/BEGIN_DRAG",m8="dnd-core/PUBLISH_DRAG_SOURCE",n3="dnd-core/HOVER",r3="dnd-core/DROP",i3="dnd-core/END_DRAG";function __(t,e){return{type:g8,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}const PJ={type:g8,payload:{clientOffset:null,sourceClientOffset:null}};function MJ(t){return function(n=[],r={publishSource:!0}){const{publishSource:i=!0,clientOffset:a,getSourceClientOffset:s}=r,l=t.getMonitor(),c=t.getRegistry();t.dispatch(__(a)),LJ(n,l,c);const u=UJ(n,l);if(u==null){t.dispatch(PJ);return}let d=null;if(a){if(!s)throw new Error("getSourceClientOffset must be defined");BJ(s),d=s(u)}t.dispatch(__(a,d));const h=c.getSource(u).beginDrag(l,u);if(h==null)return;VJ(h),c.pinSource(u);const m=c.getSourceType(u);return{type:t3,payload:{itemType:m,item:h,sourceId:u,clientOffset:a||null,sourceClientOffset:d||null,isSourcePublic:!!i}}}}function LJ(t,e,n){qr(!e.isDragging(),"Cannot call beginDrag while dragging."),t.forEach(function(r){qr(n.getSource(r),"Expected sourceIds to be registered.")})}function BJ(t){qr(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function VJ(t){qr(I_(t),"Item must be an object.")}function UJ(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 qJ(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jJ(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){qJ(t,i,n[i])})}return t}function $J(t){return function(n={}){const r=t.getMonitor(),i=t.getRegistry();HJ(r),KJ(r).forEach((s,l)=>{const c=zJ(s,l,i,r),u={type:r3,payload:{dropResult:jJ({},n,c)}};t.dispatch(u)})}}function HJ(t){qr(t.isDragging(),"Cannot call drop while not dragging."),qr(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function zJ(t,e,n,r){const i=n.getTarget(t);let a=i?i.drop(r,t):void 0;return YJ(a),typeof a>"u"&&(a=e===0?{}:r.getDropResult()),a}function YJ(t){qr(typeof t>"u"||I_(t),"Drop result must either be an object or undefined.")}function KJ(t){const e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function XJ(t){return function(){const n=t.getMonitor(),r=t.getRegistry();RJ(n);const i=n.getSourceId();return i!=null&&(r.getSource(i,!0).endDrag(n,i),r.unpinSource()),{type:i3}}}function RJ(t){qr(t.isDragging(),"Cannot call endDrag while not dragging.")}function v8(t,e){return e===null?t===null:Array.isArray(t)?t.some(n=>n===e):t===e}function GJ(t){return function(n,{clientOffset:r}={}){WJ(n);const i=n.slice(0),a=t.getMonitor(),s=t.getRegistry(),l=a.getItemType();return JJ(i,s,l),QJ(i,a,s),ZJ(i,a,s),{type:n3,payload:{targetIds:i,clientOffset:r||null}}}}function WJ(t){qr(Array.isArray(t),"Expected targetIds to be an array.")}function QJ(t,e,n){qr(e.isDragging(),"Cannot call hover while not dragging."),qr(!e.didDrop(),"Cannot call hover after drop.");for(let r=0;r<t.length;r++){const i=t[r];qr(t.lastIndexOf(i)===r,"Expected targetIds to be unique in the passed array.");const a=n.getTarget(i);qr(a,"Expected targetIds to be registered.")}}function JJ(t,e,n){for(let r=t.length-1;r>=0;r--){const i=t[r],a=e.getTargetType(i);v8(a,n)||t.splice(r,1)}}function ZJ(t,e,n){t.forEach(function(r){n.getTarget(r).hover(e,r)})}function eZ(t){return function(){if(t.getMonitor().isDragging())return{type:m8}}}function tZ(t){return{beginDrag:MJ(t),publishDragSource:eZ(t),hover:GJ(t),drop:$J(t),endDrag:XJ(t)}}class nZ{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=tZ(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 rZ(t,e){return{x:t.x+e.x,y:t.y+e.y}}function D_(t,e){return{x:t.x-e.x,y:t.y-e.y}}function iZ(t){const{clientOffset:e,initialClientOffset:n,initialSourceClientOffset:r}=t;return!e||!n||!r?null:D_(rZ(e,r),n)}function aZ(t){const{clientOffset:e,initialClientOffset:n}=t;return!e||!n?null:D_(e,n)}const Np=[],b8=[];Np.__IS_NONE__=!0,b8.__IS_ALL__=!0;function sZ(t,e){return t===Np?!1:t===b8||typeof e>"u"?!0:kJ(e,t).length>0}class oZ{subscribeToStateChange(e,n={}){const{handlerIds:r}=n;qr(typeof e=="function","listener must be a function."),qr(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&&!sZ(s.dirtyHandlerIds,r)||e()}finally{i=l}};return this.store.subscribe(a)}subscribeToOffsetChange(e){qr(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 qr(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(qr(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 v8(r,i)&&n.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;const n=this.registry.getSource(e,!0);if(qr(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&&!v8(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 iZ(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return aZ(this.store.getState().dragOffset)}constructor(e,n){this.store=e,this.registry=n}}const O_=typeof global<"u"?global:self,N_=O_.MutationObserver||O_.WebKitMutationObserver;function F_(t){return function(){const n=setTimeout(i,0),r=setInterval(i,50);function i(){clearTimeout(n),clearInterval(r),t()}}}function lZ(t){let e=1;const n=new N_(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}const cZ=typeof N_=="function"?lZ:F_;class uZ{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=cZ(this.flush),this.requestErrorThrow=F_(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class dZ{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 fZ{create(e){const n=this.freeTasks,r=n.length?n.pop():new dZ(this.onError,i=>n[n.length]=i);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}const k_=new uZ,hZ=new fZ(k_.registerPendingError);function pZ(t){k_.enqueueTask(hZ.create(t))}const y8="dnd-core/ADD_SOURCE",A8="dnd-core/ADD_TARGET",w8="dnd-core/REMOVE_SOURCE",a3="dnd-core/REMOVE_TARGET";function gZ(t){return{type:y8,payload:{sourceId:t}}}function mZ(t){return{type:A8,payload:{targetId:t}}}function vZ(t){return{type:w8,payload:{sourceId:t}}}function bZ(t){return{type:a3,payload:{targetId:t}}}function yZ(t){qr(typeof t.canDrag=="function","Expected canDrag to be a function."),qr(typeof t.beginDrag=="function","Expected beginDrag to be a function."),qr(typeof t.endDrag=="function","Expected endDrag to be a function.")}function AZ(t){qr(typeof t.canDrop=="function","Expected canDrop to be a function."),qr(typeof t.hover=="function","Expected hover to be a function."),qr(typeof t.drop=="function","Expected beginDrag to be a function.")}function S8(t,e){if(e&&Array.isArray(t)){t.forEach(n=>S8(n,!1));return}qr(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 $l;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})($l||($l={}));let wZ=0;function SZ(){return wZ++}function xZ(t){const e=SZ().toString();switch(t){case $l.SOURCE:return`S${e}`;case $l.TARGET:return`T${e}`;default:throw new Error(`Unknown Handler Role: ${t}`)}}function P_(t){switch(t[0]){case"S":return $l.SOURCE;case"T":return $l.TARGET;default:throw new Error(`Cannot parse handler ID: ${t}`)}}function M_(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){S8(e),yZ(n);const r=this.addHandler($l.SOURCE,e,n);return this.store.dispatch(gZ(r)),r}addTarget(e,n){S8(e,!0),AZ(n);const r=this.addHandler($l.TARGET,e,n);return this.store.dispatch(mZ(r)),r}containsHandler(e){return M_(this.dragSources,e)||M_(this.dropTargets,e)}getSource(e,n=!1){return qr(this.isSourceId(e),"Expected a valid source ID."),n&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return qr(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return qr(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return qr(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return P_(e)===$l.SOURCE}isTargetId(e){return P_(e)===$l.TARGET}removeSource(e){qr(this.getSource(e),"Expected an existing source."),this.store.dispatch(vZ(e)),pZ(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){qr(this.getTarget(e),"Expected an existing target."),this.store.dispatch(bZ(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const n=this.getSource(e);qr(n,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=n}unpinSource(){qr(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,n,r){const i=xZ(e);return this.types.set(i,n),e===$l.SOURCE?this.dragSources.set(i,r):e===$l.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 TZ=(t,e)=>t===e;function EZ(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function IZ(t,e,n=TZ){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 _Z(t=Np,e){switch(e.type){case n3:break;case y8:case A8:case a3:case w8:return Np;case t3:case m8:case i3:case r3:default:return b8}const{targetIds:n=[],prevTargetIds:r=[]}=e.payload,i=FJ(n,r);if(!(i.length>0||!IZ(n,r)))return Np;const s=r[r.length-1],l=n[n.length-1];return s!==l&&(s&&i.push(s),l&&i.push(l)),i}function DZ(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function OZ(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){DZ(t,i,n[i])})}return t}const L_={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function NZ(t=L_,e){const{payload:n}=e;switch(e.type){case g8:case t3:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case n3:return EZ(t.clientOffset,n.clientOffset)?t:OZ({},t,{clientOffset:n.clientOffset});case i3:case r3:return L_;default:return t}}function FZ(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function uf(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){FZ(t,i,n[i])})}return t}const kZ={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function PZ(t=kZ,e){const{payload:n}=e;switch(e.type){case t3:return uf({},t,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case m8:return uf({},t,{isSourcePublic:!0});case n3:return uf({},t,{targetIds:n.targetIds});case a3:return t.targetIds.indexOf(n.targetId)===-1?t:uf({},t,{targetIds:NJ(t.targetIds,n.targetId)});case r3:return uf({},t,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case i3:return uf({},t,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}function MZ(t=0,e){switch(e.type){case y8:case A8:return t+1;case w8:case a3:return t-1;default:return t}}function LZ(t=0){return t+1}function BZ(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function VZ(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){BZ(t,i,n[i])})}return t}function UZ(t={},e){return{dirtyHandlerIds:_Z(t.dirtyHandlerIds,{type:e.type,payload:VZ({},e.payload,{prevTargetIds:OJ(t,"dragOperation.targetIds",[])})}),dragOffset:NZ(t.dragOffset,e),refCount:MZ(t.refCount,e),dragOperation:PZ(t.dragOperation,e),stateId:LZ(t.stateId)}}function qZ(t,e=void 0,n={},r=!1){const i=jZ(r),a=new oZ(i,new CZ(i)),s=new nZ(i,a),l=t(s,e,n);return s.receiveBackend(l),s}function jZ(t){const e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return E_(UZ,t&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}function $Z(t,e){if(t==null)return{};var n=HZ(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 HZ(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 B_=0;const s3=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var df=k.memo(function(e){var{children:n}=e,r=$Z(e,["children"]);const[i,a]=zZ(r);return k.useEffect(()=>{if(a){const s=V_();return++B_,()=>{--B_===0&&(s[s3]=null)}}},[]),o.jsx(w_.Provider,{value:i,children:n})});function zZ(t){if("manager"in t)return[{dragDropManager:t.manager},!1];const e=YZ(t.backend,t.context,t.options,t.debugMode),n=!t.context;return[e,n]}function YZ(t,e=V_(),n,r){const i=e;return i[s3]||(i[s3]={dragDropManager:qZ(t,e,n,r)}),i[s3]}function V_(){return typeof global<"u"?global:window}var U_=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 KZ=bs(U_),$0=typeof window<"u"?k.useLayoutEffect:k.useEffect;function XZ(t,e,n){const[r,i]=k.useState(()=>e(t)),a=k.useCallback(()=>{const s=e(t);KZ(r,s)||(i(s),n&&n())},[r,t,n]);return $0(a),[r,a]}function RZ(t,e,n){const[r,i]=XZ(t,e,n);return $0(function(){const s=t.getHandlerId();if(s!=null)return t.subscribeToStateChange(i,{handlerIds:[s]})},[t,i]),r}function q_(t,e,n){return RZ(e,t||(()=>({})),()=>n.reconnect())}function j_(t,e){const n=[...e||[]];return e==null&&typeof t!="function"&&n.push(t),k.useMemo(()=>typeof t=="function"?t():t,n)}function GZ(t){return k.useMemo(()=>t.hooks.dragSource(),[t])}function WZ(t){return k.useMemo(()=>t.hooks.dragPreview(),[t])}let x8=!1,C8=!1;class QZ{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){qr(!x8,"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 x8=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{x8=!1}}isDragging(){if(!this.sourceId)return!1;qr(!C8,"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 C8=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{C8=!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 T8=!1;class JZ{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}canDrop(){if(!this.targetId)return!1;qr(!T8,"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 T8=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{T8=!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 ZZ(t,e,n){const r=n.getRegistry(),i=r.addTarget(t,e);return[i,()=>r.removeTarget(i)]}function eee(t,e,n){const r=n.getRegistry(),i=r.addSource(t,e);return[i,()=>r.removeSource(i)]}function E8(t,e,n,r){let i=n?n.call(r,t,e):void 0;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=n?n.call(r,d,f,u):void 0,i===!1||i===void 0&&d!==f)return!1}return!0}function I8(t){return t!==null&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function tee(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 nee(t){return(e=null,n=null)=>{if(!k.isValidElement(e)){const a=e;return t(a,n),a}const r=e;return tee(r),ree(r,n?a=>t(a,n):t)}}function $_(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n];if(n.endsWith("Ref"))e[n]=t[n];else{const i=nee(r);e[n]=()=>i}}),e}function H_(t,e){typeof t=="function"?t(e):t.current=e}function ree(t,e){const n=t.ref;return qr(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?k.cloneElement(t,{ref:r=>{H_(n,r),H_(e,r)}}):k.cloneElement(t,{ref:e})}class iee{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!E8(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!E8(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=$_({dragSource:(n,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,I8(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,I8(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 aee{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!E8(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=$_({dropTarget:(n,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,I8(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 ff(){const{dragDropManager:t}=k.useContext(w_);return qr(t!=null,"Expected drag drop context"),t}function see(t,e){const n=ff(),r=k.useMemo(()=>new iee(n.getBackend()),[n]);return $0(()=>(r.dragSourceOptions=t||null,r.reconnect(),()=>r.disconnectDragSource()),[r,t]),$0(()=>(r.dragPreviewOptions=e||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,e]),r}function oee(){const t=ff();return k.useMemo(()=>new QZ(t),[t])}class lee{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 cee(t,e,n){const r=k.useMemo(()=>new lee(t,e,n),[e,n]);return k.useEffect(()=>{r.spec=t},[t]),r}function uee(t){return k.useMemo(()=>{const e=t.type;return qr(e!=null,"spec.type must be defined"),e},[t])}function dee(t,e,n){const r=ff(),i=cee(t,e,n),a=uee(t);$0(function(){if(a!=null){const[l,c]=eee(a,i,r);return e.receiveHandlerId(l),n.receiveHandlerId(l),c}},[r,e,n,i,a])}function Ji(t,e){const n=j_(t,e);qr(!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=oee(),i=see(n.options,n.previewOptions);return dee(n,r,i),[q_(n.collect,r,i),GZ(i),WZ(i)]}function fee(t){return k.useMemo(()=>t.hooks.dropTarget(),[t])}function hee(t){const e=ff(),n=k.useMemo(()=>new aee(e.getBackend()),[e]);return $0(()=>(n.dropTargetOptions=t||null,n.reconnect(),()=>n.disconnectDropTarget()),[t]),n}function pee(){const t=ff();return k.useMemo(()=>new JZ(t),[t])}function gee(t){const{accept:e}=t;return k.useMemo(()=>(qr(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]),[e])}class mee{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 vee(t,e){const n=k.useMemo(()=>new mee(t,e),[e]);return k.useEffect(()=>{n.spec=t},[t]),n}function bee(t,e,n){const r=ff(),i=vee(t,e),a=gee(t);$0(function(){const[l,c]=ZZ(a,i,r);return e.receiveHandlerId(l),n.receiveHandlerId(l),c},[r,e,i,n,a.map(s=>s.toString()).join("|")])}function yee(t,e){const n=j_(t,e),r=pee(),i=hee(n.options);return bee(n,r,i),[q_(n.collect,r,i),fee(i)]}function z_(t){let e=null;return()=>(e==null&&(e=t()),e)}function Aee(t,e){return t.filter(n=>n!==e)}function wee(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 See{enter(e){const n=this.entered.length,r=i=>this.isNodeInDocument(i)&&(!i.contains||i.contains(e));return this.entered=wee(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 xee{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 Y_="__NATIVE_FILE__",K_="__NATIVE_URL__",X_="__NATIVE_TEXT__",R_="__NATIVE_HTML__",G_=Object.freeze(Object.defineProperty({__proto__:null,FILE:Y_,HTML:R_,TEXT:X_,URL:K_},Symbol.toStringTag,{value:"Module"}));function _8(t,e,n){const r=e.reduce((i,a)=>i||t.getData(a),"");return r??n}const D8={[Y_]:{exposeProperties:{files:t=>Array.prototype.slice.call(t.files),items:t=>t.items,dataTransfer:t=>t},matchesTypes:["Files"]},[R_]:{exposeProperties:{html:(t,e)=>_8(t,e,""),dataTransfer:t=>t},matchesTypes:["Html","text/html"]},[K_]:{exposeProperties:{urls:(t,e)=>_8(t,e,"").split(`
1831
- `),dataTransfer:t=>t},matchesTypes:["Url","text/uri-list"]},[X_]:{exposeProperties:{text:(t,e)=>_8(t,e,""),dataTransfer:t=>t},matchesTypes:["Text","text/plain"]}};function Cee(t,e){const n=D8[t];if(!n)throw new Error(`native type ${t} has no configuration`);const r=new xee(n);return r.loadDataTransfer(e),r}function O8(t){if(!t)return null;const e=Array.prototype.slice.call(t.types||[]);return Object.keys(D8).filter(n=>{const r=D8[n];return r!=null&&r.matchesTypes?r.matchesTypes.some(i=>e.indexOf(i)>-1):!1})[0]||null}const Tee=z_(()=>/firefox/i.test(navigator.userAgent)),W_=z_(()=>!!window.safari);class Q_{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 m=n[d];if(m<e)c=d+1;else if(m>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 m=0;m<r;m++)i.push(m);i.sort((m,g)=>e[m]<e[g]?-1:1);const a=[],s=[];let l,c;for(let m=0;m<r-1;m++)l=e[m+1]-e[m],c=n[m+1]-n[m],a.push(l),s.push(c/l);const u=[s[0]];for(let m=0;m<a.length-1;m++){const g=s[m],v=s[m+1];if(g*v<=0)u.push(0);else{l=a[m];const A=a[m+1],w=l+A;u.push(3*w/((w+A)/g+(w+l)/v))}}u.push(s[s.length-1]);const d=[],f=[];let h;for(let m=0;m<u.length-1;m++){h=s[m];const g=u[m],v=1/a[m],A=g+u[m+1]-h-h;d.push((h-g-A)*v),f.push(A*v*v)}this.xs=e,this.ys=n,this.c1s=u,this.c2s=d,this.c3s=f}}const Eee=1;function J_(t){const e=t.nodeType===Eee?t:t.parentElement;if(!e)return null;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function o3(t){return{x:t.clientX,y:t.clientY}}function Iee(t){var e;return t.nodeName==="IMG"&&(Tee()||!(!((e=document.documentElement)===null||e===void 0)&&e.contains(t)))}function _ee(t,e,n,r){let i=t?e.width:n,a=t?e.height:r;return W_()&&t&&(a/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:a}}function Dee(t,e,n,r,i){const a=Iee(e),l=J_(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:m,dragPreviewHeight:g}=_ee(a,e,u,d),v=()=>{let _=new Q_([0,.5,1],[c.y,c.y/d*g,c.y+g-d]).interpolate(h);return W_()&&a&&(_+=(window.devicePixelRatio-1)*g),_},A=()=>new Q_([0,.5,1],[c.x,c.x/u*m,c.x+m-u]).interpolate(f),{offsetX:w,offsetY:x}=i,S=w===0||w,E=x===0||x;return{x:S?w:A(),y:E?x:v()}}class Oee{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 Nee(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Z_(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){Nee(t,i,n[i])})}return t}class Fee{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 Z_({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 Z_({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(G_).some(n=>G_[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&&J_(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=o3(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=O8(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:m,anchorY:g,offsetX:v,offsetY:A}=this.getCurrentSourcePreviewNodeOptions(),S=Dee(f,h,s,{anchorX:m,anchorY:g},{offsetX:v,offsetY:A});l.setDragImage(h,S.x,S.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=O8(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:o3(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=o3(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 O8(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:a}=this;this.dropTargetIds=[],this.actions.hover(a,{clientOffset:o3(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 Oee(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new See(this.isNodeInDocument)}}const hf=function(e,n,r){return new Fee(e,n,r)},eD=k.createContext(void 0),tD=({children:t,option:e,templateSchema:n,onChange:r})=>{console.log("FormBuilderProvider templateSchema",n);const i={...h8,...n},[a,s]=k.useReducer(AJ,i),{isPreview:l,isAdmin:c,isRenderView:u,renderType:d,isAdvanceView:f,globalAlignment:h="ltr",emitSocketData:m,media:g,reusableComponent:v}=e;return o.jsx(eD.Provider,{value:{media:g,isPreview:l,isAdmin:c,isRenderView:u,renderType:d,isAdvanceView:f,globalAlignment:h,emitSocketData:m,reusableComponent:v,state:a,dispatch:s,onChange:r},children:o.jsx(cK,{children:o.jsx(df,{backend:hf,children:t})})})},nD=()=>k.useContext(eD),kee=(t,e,n)=>{const r=Array.from(t),[i]=r.splice(e,1);return r.splice(n,0,i),r},Pee=(t,e)=>[...t.slice(0,e),...t.slice(e+1)],Mee=(t,e,n)=>[...t.slice(0,e),n,...t.slice(e)],rD=(t,e,n)=>{if(e.length===1){const c=Number(e[0]),u=Number(n[0]);return kee(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:rD(l.children,a,s)},r},iD=(t,e)=>{if(e.length===1){const s=Number(e[0]);return Pee(t,s)}const n=[...t],r=Number(e.slice(0,1)),i=e.slice(1),a=n[r];return n[r]={...a,children:iD(a.children,i)},n},N8=(t,e,n)=>{if(e.length===1){const l=Number(e[0]);return Mee(t,l,n)}const r=[...t],i=Number(e.slice(0,1)),a=e.slice(1),s=r[i];return r[i]={...s,children:N8(s.children,a,n)},r},Lee=(t,e,n)=>{let r=[...t],i=r[n[ca]].children[n[ua]].children[n[ha]].children[n[pa]].children[n[ga]].inlineConditionalRules.rules[n[Sa]].conditions[n[$o]].children[n[yo]];return r[n[ca]].children[n[ua]].children[n[ha]].children[n[pa]].children[n[ga]].inlineConditionalRules.rules[n[Sa]].conditions[n[$o]].children.splice([n[yo]],1),r[e[ca]].children[e[ua]].children[e[ha]].children[e[pa]].children[e[ga]].inlineConditionalRules.rules[e[Sa]].conditions[e[$o]].children.splice(e[yo],0,i),r},Bee=(t,e,n)=>rD(t,e,n),Vee=t=>{const e=[...t],n={type:ms,uuid:nt(),children:[]};return e.map(r=>(r.children.length||(r.children=[n]),r))},aD=(t,e,n,r)=>{var h,m,g,v,A,w;let i;const a={...Sc,uuid:nt(),children:[r]},s={...nu,uuid:nt()},l={...nu,uuid:nt(),children:[a]},c={...lf,uuid:nt(),children:[l]},u={...e3,uuid:nt(),children:[c]};switch(e.length){case 1:{r.type===cC?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===bo?i={...c,children:[l]}:i={...nu,uuid:nt(),children:[{...Sc,uuid:nt(),children:[r]}]};break}case 4:{r.type===$1?i=a:i=r;break}case 5:{i=r;break}default:i=r}let d=t;return n.length>5?(w=(A=(v=(g=(m=(h=d[n[ca]])==null?void 0:h.children[n[ua]])==null?void 0:m.children[n[ha]])==null?void 0:g.children[n[pa]])==null?void 0:v.children[n[ga]])==null?void 0:A.inlineConditionalRules)==null||w.rules[n[Sa]].conditions[n[$o]].children.splice(n[yo],1):d=iD(d,n),d=Vee(d),d=N8(d,e,i),d},Uee=(t,e,n)=>{let r;switch(e.length){case 1:{r={...e3,uuid:nt(),children:[{...lf,uuid:nt(),children:[{...nu,uuid:nt(),children:[{...Sc,uuid:nt(),children:[n]}]}]}]};break}case 2:{r={...lf,uuid:nt(),children:[{...nu,uuid:nt(),children:[{...Sc,uuid:nt(),children:[n]}]}]};break}case 3:{r={...nu,uuid:nt(),children:[{...Sc,uuid:nt(),children:[n]}]};break}case 4:{r={...Sc,uuid:nt(),children:[n]};break}default:r=n}return N8(t,e,r)},ln=()=>{const{state:t,dispatch:e,onChange:n}=nD();if(console.log("state in cft ",t),t===void 0)throw new Error("Must be wrapped in builder provider");const r=t.builderTemplateName,i=t.isChangesSaved,a=t.editing_by,s=t.version_name,l=t.loading,c=t.published_status,u=t,d=t,f=t.renderType,h=t==null?void 0:t.userSelectedLanguage,m=t==null?void 0:t.languages,g=t.layout,v=k.useCallback(ge=>dJ(ge)(e),[e]),A=k.useCallback(ge=>BQ(ge)(e),[e]),w=ge=>(Oe,Me)=>(console.log("Updating form schema:",ge),console.log("Dispatch:",Oe),console.log("State:",Me),ge),x=k.useCallback(ge=>w(ge)(e,t),[e,t]),S=k.useCallback(ge=>fJ(ge)(e),[e]),E=k.useCallback((ge,Oe)=>{var Gt,bn,yn,An,$n,Rn,Bn,mn;const Me=[...g],ce=ge.path.split("-"),B=ce.slice(0,-1).join("-"),ee={uuid:Oe.uuid,type:Oe.type,reviewerChecklist:[]},te=0,ue=1,fe=2,Ie=3,De=4,Ye=5,pt=6,Bt=8,ut=7,Dt=5,st=6,St=8;if(Oe.type===na&&(Oe==null?void 0:Oe.schema)!==void 0){L(JSON.parse(Oe==null?void 0:Oe.schema),parseInt(ce[te]));return}if(((Gt=Oe==null?void 0:Oe.schema)==null?void 0:Gt.componentType)==="question"&&((Rn=($n=(An=(yn=(bn=Me[0])==null?void 0:bn.children[0])==null?void 0:yn.children[0])==null?void 0:An.children[0])==null?void 0:$n.children)!=null&&Rn.some(Re=>{var tt,dt,jt;return((tt=Re==null?void 0:Re.questionText)==null?void 0:tt[h.type])===((jt=(dt=Oe==null?void 0:Oe.schema)==null?void 0:dt.questionText)==null?void 0:jt[h.type])})))return;if(Oe.type===tr){let Re={type:$1,reviewerChecklist:[],..._t.cloneDeep(Oe.schema)};if(Re!=null&&Re.options&&(Re={...Re,options:[{uuid:nt(),optionText:{english:"Option 1"},value:"Option1",hyperlinkText:{english:""},abbreviationText:{english:"Option 1"},custom_values:{}},{uuid:nt(),optionText:{english:"Option 2"},value:"Option2",hyperlinkText:{english:""},abbreviationText:{english:"Option 1"},custom_values:{}}]}),Re.componentType==="grid-component"&&(Re={...Re,children:[],options:[{uuid:nt(),custom_values:{}}]}),Re.componentType==="radio-hierarchal"&&(Re={...Re,type:"radio",children:[],options:[{uuid:nt(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:nt(),label:"No",value:null,enableConditionalField:!0,children:[]}]}),Re={...Re,uuid:nt()},ce.length===Bt){Z(parseInt(ce[te]),parseInt(ce[ue]),parseInt(ce[fe]),parseInt(ce[Ie]),parseInt(ce[De]),parseInt(ce[Ye]),parseInt(ce[pt]),Re);return}if(ce.length===ut){K(parseInt(ce[te]),parseInt(ce[ue]),parseInt(ce[fe]),parseInt(ce[Ie]),parseInt(ce[De]),parseInt(ce[Dt]),parseInt(ce[st]),Re);return}if((mn=(Bn=Me[ce[te]].children[ce[ue]])==null?void 0:Bn.children[ce[fe]])!=null&&mn.rowIsRepeatable&&(Re==null?void 0:Re.componentType)==="editor")return;S(Uee(Me,ce,Re)),ce.length>1&&Se(ce[te],ce[ue],ce[fe],Re);return}const ct=Oe.path.split("-"),Ke=ct.slice(0,-1).join("-");if(ct.length===ce.length){if(Ke===B){if((ct==null?void 0:ct.length)===St){S(Lee(Me,ce,ct));return}S(Bee(Me,ce,ct));return}const Re={...ee,...Oe};(Oe==null?void 0:Oe.id)===void 0&&(Re.id=nt()),S(aD(Me,ce,ct,Re));return}if((ct==null?void 0:ct.length)===8){const Re={type:$1,reviewerChecklist:[],...Oe};K(parseInt(ce[te]),parseInt(ce[ue]),parseInt(ce[fe]),parseInt(ce[Ie]),parseInt(ce[De]),parseInt(ce[Dt]),parseInt(ce[st]),Re),ne(ct[ca],ct[ua],ct[ha],ct[pa],ct[ga],ct[Dt],ct[st],ct[Ul]);return}const Tt={...ee,...Oe};(Oe==null?void 0:Oe.id)===void 0&&(Tt.id=nt()),S(aD(Me,ce,ct,Tt))},[g,S,h.type]),T=k.useCallback(()=>yJ()(e),[e]),_=k.useCallback(ge=>hJ(ge)(e,t),[e]),C=k.useCallback(ge=>pJ(ge)(e,t),[e]),O=k.useCallback(ge=>gJ(ge)(e),[e]),F=k.useCallback(ge=>LQ(ge)(e),[e]),V=k.useCallback(ge=>$Q(ge)(e),[e]),L=k.useCallback((ge,Oe)=>YQ(ge,Oe)(e),[e]),z=k.useCallback((ge,Oe)=>WQ(ge,Oe)(e),[e]),N=k.useCallback((ge,Oe,Me)=>ZQ(ge,Oe,Me)(e),[e]),$=k.useCallback(ge=>qQ(ge)(e),[e]),de=k.useCallback((ge,Oe)=>jQ(ge,Oe)(e),[e]),me=k.useCallback((ge,Oe,Me)=>GQ(ge,Oe,Me)(e),[e]),ae=k.useCallback((ge,Oe,Me,ce)=>tJ(ge,Oe,Me,ce)(e),[e]),G=k.useCallback((ge,Oe,Me,ce,B)=>nJ(ge,Oe,Me,ce,B)(e,t),[e]),ie=k.useCallback((ge,Oe,Me,ce,B,ee)=>rJ(ge,Oe,Me,ce,B,ee)(e,t),[e]),Y=k.useCallback((ge,Oe,Me)=>HQ(ge,Oe,Me)(e),[e]),pe=k.useCallback((ge,Oe,Me,ce)=>RQ(ge,Oe,Me,ce)(e),[e]),se=k.useCallback((ge,Oe)=>UQ(ge,Oe)(e),[e]),Q=k.useCallback((ge,Oe,Me,ce,B,ee)=>iJ(ge,Oe,Me,ce,B,ee)(e),[e]),W=k.useCallback((ge,Oe,Me,ce,B)=>eJ(ge,Oe,Me,ce,B)(e),[e]),re=k.useCallback((ge,Oe,Me,ce)=>XQ(ge,Oe,Me,ce)(e),[e]),ve=k.useCallback((ge,Oe,Me)=>zQ(ge,Oe,Me)(e),[e]),xe=k.useCallback((ge,Oe)=>VQ(ge,Oe)(e,t),[e]),Se=k.useCallback((ge,Oe,Me,ce)=>QQ(ge,Oe,Me,ce)(e),[e]),be=k.useCallback((ge,Oe,Me,ce,B,ee,te,ue,fe)=>cJ(ge,Oe,Me,ce,B,ee,te,ue,fe)(e),[e]),ye=k.useCallback((ge,Oe,Me,ce,B,ee,te,ue,fe)=>oJ(ge,Oe,Me,ce,B,ee,te,ue,fe)(e),[e]),ne=k.useCallback((ge,Oe,Me,ce,B,ee,te,ue)=>lJ(ge,Oe,Me,ce,B,ee,te,ue)(e),[e]),U=k.useCallback((ge,Oe,Me,ce,B,ee,te,ue)=>uJ(ge,Oe,Me,ce,B,ee,te,ue)(e),[e]),Z=k.useCallback((ge,Oe,Me,ce,B,ee,te,ue)=>aJ(ge,Oe,Me,ce,B,ee,te,ue)(e),[e]),K=k.useCallback((ge,Oe,Me,ce,B,ee,te,ue)=>sJ(ge,Oe,Me,ce,B,ee,te,ue)(e),[e]),he=k.useCallback(ge=>mJ(ge)(e),[e]),_e=k.useCallback(ge=>vJ(ge)(e),[e]),Ce=k.useCallback(ge=>bJ(ge)(e),[e]);return{builderIsChangesSaved:i,builderTemplateName:r,formBuilderFormSchema:u,formBuilderFormLayout:g,formBuilderSchemaLanguages:m,saveFormTemplateNewVersion:d,userSelectedLanguage:h,formBuilderConfigurationType:f,formBuilderLoading:l,formBuilderPublishedStatus:c,builderEditingBy:a,builderVersionName:s,handleDrop:E,formatTableFieldsHook:A,saveFormBuilderSchema:v,removePage:$,removeSection:de,removeRow:me,removeColumn:ae,removeField:G,updateEditingBy:Ce,addTabs:F,addSection:V,addRow:z,addColumn:N,cloneField:Q,cloneColumn:W,cloneRow:re,cloneSection:ve,clonePage:xe,sectionImport:L,setLayout:S,fieldSettingUpdate:ie,selectFormBuilderLanguage:_,unselectFormBuilderLanguage:C,updateUserFormSelectedLanguage:O,updateFormType:he,schemaBuilderUpdate:_e,pageSettingUpdate:se,saveFormProgress:x,sectionSettingUpdate:Y,rowSettingUpdate:pe,clearBuilderSchema:T,addFieldToRowRepeaptable:Se,addFieldToInlineRuleCondtionFields:Z,fieldSettingUpdateInlineConditional:be,fieldSettingDeleteInlineConditional:U,addFieldToGridComponentHook:K,gridComponentFieldSettingUpdate:ye,gridComponentFieldDelete:ne}};function Fp(t){"@babel/helpers - typeof";return Fp=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},Fp(t)}function qee(t,e){if(Fp(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Fp(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function jee(t){var e=qee(t,"string");return Fp(e)==="symbol"?e:String(e)}function $ee(t,e,n){return e=jee(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function H0(){return H0=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},H0.apply(this,arguments)}function Hee(t){if(Array.isArray(t))return t}function zee(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 sD(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Yee(t,e){if(t){if(typeof t=="string")return sD(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sD(t,e)}}function Kee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1830
+ }`;var ei=uY(function(){return ft(Be,sr+"return "+hn).apply(n,Ge)});if(ei.source=hn,Rx(ei))throw ei;return ei}function NNe(p){return Qi(p).toLowerCase()}function FNe(p){return Qi(p).toUpperCase()}function kNe(p,b,D){if(p=Qi(p),p&&(D||b===n))return er(p);if(!p||!(b=Ml(b)))return p;var R=Vo(p),Ae=Vo(b),Be=ai(R,Ae),Ge=ja(R,Ae)+1;return O0(R,Be,Ge).join("")}function PNe(p,b,D){if(p=Qi(p),p&&(D||b===n))return p.slice(0,zh(p)+1);if(!p||!(b=Ml(b)))return p;var R=Vo(p),Ae=ja(R,Vo(b))+1;return O0(R,0,Ae).join("")}function MNe(p,b,D){if(p=Qi(p),p&&(D||b===n))return p.replace(Gn,"");if(!p||!(b=Ml(b)))return p;var R=Vo(p),Ae=ai(R,Vo(b));return O0(R,Ae).join("")}function LNe(p,b){var D=V,R=L;if(Ha(b)){var Ae="separator"in b?b.separator:Ae;D="length"in b?Rr(b.length):D,R="omission"in b?Ml(b.omission):R}p=Qi(p);var Be=p.length;if(kl(p)){var Ge=Vo(p);Be=Ge.length}if(D>=Be)return p;var lt=D-Bu(R);if(lt<1)return R;var wt=Ge?O0(Ge,0,lt).join(""):p.slice(0,lt);if(Ae===n)return wt+R;if(Ge&&(lt+=wt.length-lt),Gx(Ae)){if(p.slice(lt).search(Ae)){var en,rn=wt;for(Ae.global||(Ae=kn(Ae.source,Qi(Ft.exec(Ae))+"g")),Ae.lastIndex=0;en=Ae.exec(rn);)var hn=en.index;wt=wt.slice(0,hn===n?lt:hn)}}else if(p.indexOf(Ml(Ae),lt)!=lt){var Pn=wt.lastIndexOf(Ae);Pn>-1&&(wt=wt.slice(0,Pn))}return wt+R}function BNe(p){return p=Qi(p),p&&$n.test(p)?p.replace(yn,Xg):p}var VNe=Rh(function(p,b,D){return p+(D?" ":"")+b.toUpperCase()}),Jx=dz("toUpperCase");function cY(p,b,D){return p=Qi(p),b=D?n:b,b===n?Nd(p)?Wg(p):Od(p):p.match(b)||[]}var uY=oi(function(p,b){try{return ci(p,n,b)}catch(D){return Rx(D)?D:new rt(D)}}),UNe=Bd(function(p,b){return Ra(b,function(D){D=Hu(D),Md(p,D,Kx(p[D],p))}),p});function qNe(p){var b=p==null?0:p.length,D=wr();return p=b?ki(p,function(R){if(typeof R[1]!="function")throw new lr(s);return[D(R[0]),R[1]]}):[],oi(function(R){for(var Ae=-1;++Ae<b;){var Be=p[Ae];if(ci(Be[0],this,R))return ci(Be[1],this,R)}})}function jNe(p){return fIe(hc(p,f))}function Zx(p){return function(){return p}}function $Ne(p,b){return p==null||p!==p?b:p}var HNe=hz(),zNe=hz(!0);function ll(p){return p}function eC(p){return HH(typeof p=="function"?p:hc(p,f))}function YNe(p){return YH(hc(p,f))}function KNe(p,b){return KH(p,hc(b,f))}var XNe=oi(function(p,b){return function(D){return em(D,p,b)}}),RNe=oi(function(p,b){return function(D){return em(p,D,b)}});function tC(p,b,D){var R=js(b),Ae=r9(b,R);D==null&&!(Ha(b)&&(Ae.length||!R.length))&&(D=b,b=p,p=this,Ae=r9(b,js(b)));var Be=!(Ha(D)&&"chain"in D)||!!D.chain,Ge=Ud(p);return Ra(Ae,function(lt){var wt=b[lt];p[lt]=wt,Ge&&(p.prototype[lt]=function(){var en=this.__chain__;if(Be||en){var rn=p(this.__wrapped__),hn=rn.__actions__=al(this.__actions__);return hn.push({func:wt,args:arguments,thisArg:p}),rn.__chain__=en,rn}return wt.apply(p,Bs([this.value()],arguments))})}),p}function GNe(){return Fr._===this&&(Fr._=Vu),this}function nC(){}function WNe(p){return p=Rr(p),oi(function(b){return XH(b,p)})}var QNe=kx(ki),JNe=kx(Pu),ZNe=kx(Nl);function dY(p){return qx(p)?vt(Hu(p)):DIe(p)}function eFe(p){return function(b){return p==null?n:V1(p,b)}}var tFe=gz(),nFe=gz(!0);function rC(){return[]}function iC(){return!1}function rFe(){return{}}function iFe(){return""}function aFe(){return!0}function sFe(p,b){if(p=Rr(p),p<1||p>G)return[];var D=pe,R=qs(p,pe);b=wr(b),p-=pe;for(var Ae=gn(R,b);++D<p;)b(D);return Ae}function oFe(p){return Ur(p)?ki(p,Hu):Ll(p)?[p]:al(Nz(Qi(p)))}function lFe(p){var b=++ui;return Qi(p)+b}var cFe=c9(function(p,b){return p+b},0),uFe=Px("ceil"),dFe=c9(function(p,b){return p/b},1),fFe=Px("floor");function hFe(p){return p&&p.length?n9(p,ll,yx):n}function pFe(p,b){return p&&p.length?n9(p,wr(b,2),yx):n}function gFe(p){return He(p,ll)}function mFe(p,b){return He(p,wr(b,2))}function vFe(p){return p&&p.length?n9(p,ll,xx):n}function bFe(p,b){return p&&p.length?n9(p,wr(b,2),xx):n}var yFe=c9(function(p,b){return p*b},1),AFe=Px("round"),wFe=c9(function(p,b){return p-b},0);function SFe(p){return p&&p.length?on(p,ll):0}function xFe(p,b){return p&&p.length?on(p,wr(b,2)):0}return Ee.after=YDe,Ee.ary=$z,Ee.assign=FOe,Ee.assignIn=nY,Ee.assignInWith=S9,Ee.assignWith=kOe,Ee.at=POe,Ee.before=Hz,Ee.bind=Kx,Ee.bindAll=UNe,Ee.bindKey=zz,Ee.castArray=rOe,Ee.chain=Uz,Ee.chunk=f_e,Ee.compact=h_e,Ee.concat=p_e,Ee.cond=qNe,Ee.conforms=jNe,Ee.constant=Zx,Ee.countBy=SDe,Ee.create=MOe,Ee.curry=Yz,Ee.curryRight=Kz,Ee.debounce=Xz,Ee.defaults=LOe,Ee.defaultsDeep=BOe,Ee.defer=KDe,Ee.delay=XDe,Ee.difference=g_e,Ee.differenceBy=m_e,Ee.differenceWith=v_e,Ee.drop=b_e,Ee.dropRight=y_e,Ee.dropRightWhile=A_e,Ee.dropWhile=w_e,Ee.fill=S_e,Ee.filter=CDe,Ee.flatMap=IDe,Ee.flatMapDeep=_De,Ee.flatMapDepth=DDe,Ee.flatten=Mz,Ee.flattenDeep=x_e,Ee.flattenDepth=C_e,Ee.flip=RDe,Ee.flow=HNe,Ee.flowRight=zNe,Ee.fromPairs=T_e,Ee.functions=zOe,Ee.functionsIn=YOe,Ee.groupBy=ODe,Ee.initial=I_e,Ee.intersection=__e,Ee.intersectionBy=D_e,Ee.intersectionWith=O_e,Ee.invert=XOe,Ee.invertBy=ROe,Ee.invokeMap=FDe,Ee.iteratee=eC,Ee.keyBy=kDe,Ee.keys=js,Ee.keysIn=ol,Ee.map=m9,Ee.mapKeys=WOe,Ee.mapValues=QOe,Ee.matches=YNe,Ee.matchesProperty=KNe,Ee.memoize=b9,Ee.merge=JOe,Ee.mergeWith=rY,Ee.method=XNe,Ee.methodOf=RNe,Ee.mixin=tC,Ee.negate=y9,Ee.nthArg=WNe,Ee.omit=ZOe,Ee.omitBy=eNe,Ee.once=GDe,Ee.orderBy=PDe,Ee.over=QNe,Ee.overArgs=WDe,Ee.overEvery=JNe,Ee.overSome=ZNe,Ee.partial=Xx,Ee.partialRight=Rz,Ee.partition=MDe,Ee.pick=tNe,Ee.pickBy=iY,Ee.property=dY,Ee.propertyOf=eFe,Ee.pull=P_e,Ee.pullAll=Bz,Ee.pullAllBy=M_e,Ee.pullAllWith=L_e,Ee.pullAt=B_e,Ee.range=tFe,Ee.rangeRight=nFe,Ee.rearg=QDe,Ee.reject=VDe,Ee.remove=V_e,Ee.rest=JDe,Ee.reverse=zx,Ee.sampleSize=qDe,Ee.set=rNe,Ee.setWith=iNe,Ee.shuffle=jDe,Ee.slice=U_e,Ee.sortBy=zDe,Ee.sortedUniq=K_e,Ee.sortedUniqBy=X_e,Ee.split=INe,Ee.spread=ZDe,Ee.tail=R_e,Ee.take=G_e,Ee.takeRight=W_e,Ee.takeRightWhile=Q_e,Ee.takeWhile=J_e,Ee.tap=hDe,Ee.throttle=eOe,Ee.thru=g9,Ee.toArray=Zz,Ee.toPairs=aY,Ee.toPairsIn=sY,Ee.toPath=oFe,Ee.toPlainObject=tY,Ee.transform=aNe,Ee.unary=tOe,Ee.union=Z_e,Ee.unionBy=eDe,Ee.unionWith=tDe,Ee.uniq=nDe,Ee.uniqBy=rDe,Ee.uniqWith=iDe,Ee.unset=sNe,Ee.unzip=Yx,Ee.unzipWith=Vz,Ee.update=oNe,Ee.updateWith=lNe,Ee.values=Qh,Ee.valuesIn=cNe,Ee.without=aDe,Ee.words=cY,Ee.wrap=nOe,Ee.xor=sDe,Ee.xorBy=oDe,Ee.xorWith=lDe,Ee.zip=cDe,Ee.zipObject=uDe,Ee.zipObjectDeep=dDe,Ee.zipWith=fDe,Ee.entries=aY,Ee.entriesIn=sY,Ee.extend=nY,Ee.extendWith=S9,tC(Ee,Ee),Ee.add=cFe,Ee.attempt=uY,Ee.camelCase=hNe,Ee.capitalize=oY,Ee.ceil=uFe,Ee.clamp=uNe,Ee.clone=iOe,Ee.cloneDeep=sOe,Ee.cloneDeepWith=oOe,Ee.cloneWith=aOe,Ee.conformsTo=lOe,Ee.deburr=lY,Ee.defaultTo=$Ne,Ee.divide=dFe,Ee.endsWith=pNe,Ee.eq=Zc,Ee.escape=gNe,Ee.escapeRegExp=mNe,Ee.every=xDe,Ee.find=TDe,Ee.findIndex=kz,Ee.findKey=VOe,Ee.findLast=EDe,Ee.findLastIndex=Pz,Ee.findLastKey=UOe,Ee.floor=fFe,Ee.forEach=qz,Ee.forEachRight=jz,Ee.forIn=qOe,Ee.forInRight=jOe,Ee.forOwn=$Oe,Ee.forOwnRight=HOe,Ee.get=Wx,Ee.gt=cOe,Ee.gte=uOe,Ee.has=KOe,Ee.hasIn=Qx,Ee.head=Lz,Ee.identity=ll,Ee.includes=NDe,Ee.indexOf=E_e,Ee.inRange=dNe,Ee.invoke=GOe,Ee.isArguments=j1,Ee.isArray=Ur,Ee.isArrayBuffer=dOe,Ee.isArrayLike=sl,Ee.isArrayLikeObject=is,Ee.isBoolean=fOe,Ee.isBuffer=N0,Ee.isDate=hOe,Ee.isElement=pOe,Ee.isEmpty=gOe,Ee.isEqual=mOe,Ee.isEqualWith=vOe,Ee.isError=Rx,Ee.isFinite=bOe,Ee.isFunction=Ud,Ee.isInteger=Gz,Ee.isLength=A9,Ee.isMap=Wz,Ee.isMatch=yOe,Ee.isMatchWith=AOe,Ee.isNaN=wOe,Ee.isNative=SOe,Ee.isNil=COe,Ee.isNull=xOe,Ee.isNumber=Qz,Ee.isObject=Ha,Ee.isObjectLike=Ga,Ee.isPlainObject=sm,Ee.isRegExp=Gx,Ee.isSafeInteger=TOe,Ee.isSet=Jz,Ee.isString=w9,Ee.isSymbol=Ll,Ee.isTypedArray=Wh,Ee.isUndefined=EOe,Ee.isWeakMap=IOe,Ee.isWeakSet=_Oe,Ee.join=N_e,Ee.kebabCase=vNe,Ee.last=gc,Ee.lastIndexOf=F_e,Ee.lowerCase=bNe,Ee.lowerFirst=yNe,Ee.lt=DOe,Ee.lte=OOe,Ee.max=hFe,Ee.maxBy=pFe,Ee.mean=gFe,Ee.meanBy=mFe,Ee.min=vFe,Ee.minBy=bFe,Ee.stubArray=rC,Ee.stubFalse=iC,Ee.stubObject=rFe,Ee.stubString=iFe,Ee.stubTrue=aFe,Ee.multiply=yFe,Ee.nth=k_e,Ee.noConflict=GNe,Ee.noop=nC,Ee.now=v9,Ee.pad=ANe,Ee.padEnd=wNe,Ee.padStart=SNe,Ee.parseInt=xNe,Ee.random=fNe,Ee.reduce=LDe,Ee.reduceRight=BDe,Ee.repeat=CNe,Ee.replace=TNe,Ee.result=nNe,Ee.round=AFe,Ee.runInContext=P,Ee.sample=UDe,Ee.size=$De,Ee.snakeCase=ENe,Ee.some=HDe,Ee.sortedIndex=q_e,Ee.sortedIndexBy=j_e,Ee.sortedIndexOf=$_e,Ee.sortedLastIndex=H_e,Ee.sortedLastIndexBy=z_e,Ee.sortedLastIndexOf=Y_e,Ee.startCase=_Ne,Ee.startsWith=DNe,Ee.subtract=wFe,Ee.sum=SFe,Ee.sumBy=xFe,Ee.template=ONe,Ee.times=sFe,Ee.toFinite=qd,Ee.toInteger=Rr,Ee.toLength=eY,Ee.toLower=NNe,Ee.toNumber=mc,Ee.toSafeInteger=NOe,Ee.toString=Qi,Ee.toUpper=FNe,Ee.trim=kNe,Ee.trimEnd=PNe,Ee.trimStart=MNe,Ee.truncate=LNe,Ee.unescape=BNe,Ee.uniqueId=lFe,Ee.upperCase=VNe,Ee.upperFirst=Jx,Ee.each=qz,Ee.eachRight=jz,Ee.first=Lz,tC(Ee,function(){var p={};return ju(Ee,function(b,D){Er.call(Ee.prototype,D)||(p[D]=b)}),p}(),{chain:!1}),Ee.VERSION=r,Ra(["bind","bindKey","curry","curryRight","partial","partialRight"],function(p){Ee[p].placeholder=Ee}),Ra(["drop","take"],function(p,b){si.prototype[p]=function(D){D=D===n?1:rs(Rr(D),0);var R=this.__filtered__&&!b?new si(this):this.clone();return R.__filtered__?R.__takeCount__=qs(D,R.__takeCount__):R.__views__.push({size:qs(D,pe),type:p+(R.__dir__<0?"Right":"")}),R},si.prototype[p+"Right"]=function(D){return this.reverse()[p](D).reverse()}}),Ra(["filter","map","takeWhile"],function(p,b){var D=b+1,R=D==$||D==me;si.prototype[p]=function(Ae){var Be=this.clone();return Be.__iteratees__.push({iteratee:wr(Ae,3),type:D}),Be.__filtered__=Be.__filtered__||R,Be}}),Ra(["head","last"],function(p,b){var D="take"+(b?"Right":"");si.prototype[p]=function(){return this[D](1).value()[0]}}),Ra(["initial","tail"],function(p,b){var D="drop"+(b?"":"Right");si.prototype[p]=function(){return this.__filtered__?new si(this):this[D](1)}}),si.prototype.compact=function(){return this.filter(ll)},si.prototype.find=function(p){return this.filter(p).head()},si.prototype.findLast=function(p){return this.reverse().find(p)},si.prototype.invokeMap=oi(function(p,b){return typeof p=="function"?new si(this):this.map(function(D){return em(D,p,b)})}),si.prototype.reject=function(p){return this.filter(y9(wr(p)))},si.prototype.slice=function(p,b){p=Rr(p);var D=this;return D.__filtered__&&(p>0||b<0)?new si(D):(p<0?D=D.takeRight(-p):p&&(D=D.drop(p)),b!==n&&(b=Rr(b),D=b<0?D.dropRight(-b):D.take(b-p)),D)},si.prototype.takeRightWhile=function(p){return this.reverse().takeWhile(p).reverse()},si.prototype.toArray=function(){return this.take(pe)},ju(si.prototype,function(p,b){var D=/^(?:filter|find|map|reject)|While$/.test(b),R=/^(?:head|last)$/.test(b),Ae=Ee[R?"take"+(b=="last"?"Right":""):b],Be=R||/^find/.test(b);Ae&&(Ee.prototype[b]=function(){var Ge=this.__wrapped__,lt=R?[1]:arguments,wt=Ge instanceof si,en=lt[0],rn=wt||Ur(Ge),hn=function(gi){var xi=Ae.apply(Ee,Bs([gi],lt));return R&&Pn?xi[0]:xi};rn&&D&&typeof en=="function"&&en.length!=1&&(wt=rn=!1);var Pn=this.__chain__,sr=!!this.__actions__.length,Sr=Be&&!Pn,ei=wt&&!sr;if(!Be&&rn){Ge=ei?Ge:new si(this);var xr=p.apply(Ge,lt);return xr.__actions__.push({func:g9,args:[hn],thisArg:n}),new gs(xr,Pn)}return Sr&&ei?p.apply(this,lt):(xr=this.thru(hn),Sr?R?xr.value()[0]:xr.value():xr)})}),Ra(["pop","push","shift","sort","splice","unshift"],function(p){var b=In[p],D=/^(?:push|sort|unshift)$/.test(p)?"tap":"thru",R=/^(?:pop|shift)$/.test(p);Ee.prototype[p]=function(){var Ae=arguments;if(R&&!this.__chain__){var Be=this.value();return b.apply(Ur(Be)?Be:[],Ae)}return this[D](function(Ge){return b.apply(Ur(Ge)?Ge:[],Ae)})}}),ju(si.prototype,function(p,b){var D=Ee[b];if(D){var R=D.name+"";Er.call(Ve,R)||(Ve[R]=[]),Ve[R].push({name:b,func:D})}}),Ve[l9(n,w).name]=[{name:"wrapper",func:n}],si.prototype.clone=Jv,si.prototype.reverse=Zv,si.prototype.value=Qg,Ee.prototype.at=pDe,Ee.prototype.chain=gDe,Ee.prototype.commit=mDe,Ee.prototype.next=vDe,Ee.prototype.plant=yDe,Ee.prototype.reverse=ADe,Ee.prototype.toJSON=Ee.prototype.valueOf=Ee.prototype.value=wDe,Ee.prototype.first=Ee.prototype.head,Ws&&(Ee.prototype[Ws]=bDe),Ee},gt=C0();Zr?((Zr.exports=gt)._=gt,Vr._=gt):Fr._=gt}).call(Ni)}(Zm,Zm.exports);var _t=Zm.exports;const b_=bs(_t),e3={type:cC,isCoverPage:!1,margin:{left:0,right:0,top:0,bottom:0},isVisible:!0,isHidden:!1,isValid:!1,displayRules:[],title:{english:"Page 1"}},lf={type:na,showSectionHeader:!1,isVisible:!0,isHidden:!1,isValid:!1,showSectionTitle:!1,showSectionSubTitle:!1,heading:{english:"Section header"},subHeadingText:{english:""},isCollapsed:!1},nu={type:bo,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:[]},Sc={type:ms,isCollapsed:!1},MQ=t=>{let e=t;e={...e,uuid:nt()};const n=e.children.map(r=>({...r,uuid:nt(),children:r.children.map(i=>({...i,uuid:nt(),children:i.children.map(a=>{var s;return{...a,uuid:nt(),...((s=a==null?void 0:a.children)==null?void 0:s.length)>0?{children:a.children.map(l=>{var c;return{...l,uuid:nt(),...((c=l.options)==null?void 0:c.length)>0?{options:l.options.map(u=>({...u,uuid:nt()}))}:{}}})}:{}}})}))}));return e={...e,children:n},e};function LQ(t){return e=>{const n={...e3,uuid:nt(),title:{english:`Page ${t+1}`},children:[{...lf,uuid:nt(),children:[{...nu,uuid:nt(),children:[{...Sc,uuid:nt(),children:[]}]}]}]};e({type:JI,payLoad:n})}}function BQ(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:v_,payLoad:{tableFields:n}})}}function VQ(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=MQ(a),n({type:n_,payLoad:{page:a,pageIndex:e}})}}function UQ(t,e){return n=>{n({type:m_,payLoad:{pageIndex:t,page:e}})}}function qQ(t){return e=>{e({type:YI,payLoad:{pageIndex:t}})}}const y_=t=>{let e=t;e={...e,uuid:nt()};const n=e.children.map(r=>({...r,uuid:nt(),children:r.children.map(i=>{var a;return{...i,uuid:nt(),...((a=i==null?void 0:i.children)==null?void 0:a.length)>0?{children:i.children.map(s=>{var l;return{...s,uuid:nt(),...((l=s.options)==null?void 0:l.length)>0?{options:s.options.map(c=>({...c,uuid:nt()}))}:{}}})}:{}}})}));return e={...e,children:n},e};function jQ(t,e){return n=>{n({type:KI,payLoad:{pageIndex:t,sectionIndex:e}})}}function $Q(t){return e=>{const n={...lf,uuid:nt(),children:[{...nu,uuid:nt(),children:[{...Sc,uuid:nt(),children:[]}]}]};e({type:ZI,payLoad:{pageIndex:t,section:n}})}}function HQ(t,e,n){return r=>{r({type:QI,payLoad:{pageIndex:t,sectionIndex:e,section:n}})}}function zQ(t,e,n){return r=>{const i=t;let a=_t.cloneDeep(i);a=y_(a),r({type:r_,payLoad:{section:a,pageIndex:e,sectionIndex:n}})}}function YQ(t,e){return n=>{const r=t;let i=_t.cloneDeep(r);i=y_(i),n({type:i_,payLoad:{section:i,pageIndex:e}})}}const KQ=t=>{let e=t;e={...e,uuid:nt()};const n=e.children.map(r=>{var i;return{...r,uuid:nt(),...((i=r==null?void 0:r.children)==null?void 0:i.length)>0?{children:r.children.map(a=>{var s;return{...a,uuid:nt(),...((s=a.options)==null?void 0:s.length)>0?{options:a.options.map(l=>({...l,uuid:nt()}))}:{}}})}:{}}});return e={...e,children:n},e};function XQ(t,e,n,r){return i=>{const a=t;let s=_t.cloneDeep(a);s=KQ(s),i({type:a_,payLoad:{row:s,pageIndex:e,sectionIndex:n,rowIndex:r}})}}function RQ(t,e,n,r){return i=>{i({type:f8,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,row:r}})}}function GQ(t,e,n){return r=>{r({type:XI,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n}})}}function WQ(t,e){return n=>{const r={...nu,uuid:nt(),isCollapsed:!1,children:[{...Sc,uuid:nt(),children:[]}]};n({type:e_,payLoad:{pageIndex:t,sectionIndex:e,row:r}})}}function QQ(t,e,n,r){return i=>{i({type:c_,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,fieldItem:r}})}}const JQ=t=>{var r;let e=t;e={...e,uuid:nt()};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:nt(),...((s=i.options)==null?void 0:s.length)>0?{options:i.options.map((l,c)=>({...l,uuid:nt()}))}:{}}}):[];return e={...e,children:n},e};function ZQ(t,e,n){return r=>{const i={...Sc,uuid:nt(),children:[]};r({type:t_,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,column:i}})}}function eJ(t,e,n,r,i){return a=>{const s=t;let l=_t.cloneDeep(s);l=JQ(l),a({type:s_,payLoad:{column:l,pageIndex:e,sectionIndex:n,rowIndex:r,columnIndex:i}})}}function tJ(t,e,n,r){return i=>{i({type:RI,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r}})}}function A_(t,e,n,r){return i=>{i({type:f8,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,row:r}})}}function nJ(t,e,n,r,i){return(a,s)=>{var m,g,v,A;const{layout:l,tableFields:c}=s;let u=(m=l[t])==null?void 0:m.children[e].children[n];const d=(A=(v=(g=l[t])==null?void 0:g.children[e])==null?void 0:v.children[n])==null?void 0:A.children[r].children[i];if((u==null?void 0:u.rowIsRepeatable)===!0){const w=[...u.repeatableFields],x=_t.findIndex(w,function(S){return S.uuid===(d==null?void 0:d.uuid)});w.splice(x,1),u={...u,repeatableFields:w},a(A_(t,e,n,u))}const f=_t.findIndex(c,function(w){return w.uuid===(d==null?void 0:d.uuid)});c.splice(f,1),a({type:GI,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i}})}}function rJ(t,e,n,r,i,a){return(s,l)=>{var m,g,v,A;const{layout:c,tableFields:u}=l;let d=(m=c[t])==null?void 0:m.children[e].children[n];if((d==null?void 0:d.rowIsRepeatable)===!0){const w=(A=(v=(g=c[t])==null?void 0:g.children[e])==null?void 0:v.children[n])==null?void 0:A.children[r].children[i],x=[...d.repeatableFields],S=_t.findIndex(x,function(E){return E.uuid===(w==null?void 0:w.uuid)});S===-1?x.splice(i,0,a):x[S]=a,x[S]=a,d={...d,repeatableFields:x},s(A_(t,e,n,d))}const f={type:WI,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,field:a}},h=u.findIndex(w=>w.uuid===a.uuid);h>=0&&(u[h]=a),s(f)}}function iJ(t,e,n,r,i,a){return s=>{var d;const l=t;let c=_t.cloneDeep(l);if(c={...c,uuid:nt()},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:nt()}));c={...c,options:f}}s({type:o_,payLoad:{field:c,pageIndex:e,sectionIndex:n,rowIndex:r,columnIndex:i,fieldIndex:a}})}}function aJ(t,e,n,r,i,a,s,l){return c=>{c({type:u_,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,ruleIndex:a,conditionIndex:s,field:l}})}}function sJ(t,e,n,r,i,a,s,l){return c=>{c({type:d_,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,gridColumnIndex:s,gridRowIndex:a,field:l}})}}function oJ(t,e,n,r,i,a,s,l,c){return u=>{u({type:p_,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,gridRowIndex:a,gridColumnIndex:s,fieldChildrenIndex:l,field:c}})}}function lJ(t,e,n,r,i,a,s,l){return c=>{c({type:g_,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,gridRowIndex:a,gridColumnIndex:s,fieldChildrenIndex:l}})}}function cJ(t,e,n,r,i,a,s,l,c){return u=>{u({type:f_,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,ruleIndex:a,conditionIndex:s,inlineFieldIndex:l,field:c}})}}function uJ(t,e,n,r,i,a,s,l){return c=>{c({type:h_,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,ruleIndex:a,conditionIndex:s,inlineFieldIndex:l}})}}function dJ(t){return e=>{e({type:of,payLoad:{formSchema:t}})}}function fJ(t){return e=>{e({type:of,payLoad:{layout:t}})}}function hJ(t){return(e,n)=>{const{languages:r}=n,i={type:of,payLoad:{languages:[...r,t]}};e(i)}}function pJ(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:of,payLoad:{languages:a}})}}function gJ(t){return e=>{const n={type:of,payLoad:{userSelectedLanguage:t.value}};e(n)}}function mJ(t){return e=>{e({type:Jm,payLoad:{formType:t}})}}function vJ(t){return e=>{e({type:Jm,payLoad:t})}}function bJ(t){return e=>{e({type:Jm,payLoad:{editing_by:t}})}}function yJ(){return t=>{t({type:l_,payLoad:null})}}const h8={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:nt(),...e3,children:[{uuid:nt(),...lf,children:[{uuid:nt(),...nu,children:[{uuid:nt(),...Sc,children:[]}]}]}]}],conditionalTabsRules:[],conditionalSectionsRules:[]},AJ=(t=h8,e)=>{var n,r;switch(e.type){case kQ:return{...t,...e.payLoad};case FQ:return{...t,...e.payLoad};case l_:return{...t,...h8};case of:return{...t,...e.payLoad};case Jm:return{...t,...e.payLoad};case YI:{const{pageIndex:i}=e.payLoad;return{...t,layout:t.layout.filter((a,s)=>s!==i)}}case JI:return{...t,layout:[...t.layout,e.payLoad]};case ZI:{const{pageIndex:i,section:a}=e.payLoad,s=[...t.layout];return s[i].children=[...s[i].children,a],{...t,layout:s}}case c_:{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 PQ:{const{fieldItem:i}=e.payLoad;let a=[...t.tableFields];return a=[...a,i],{...t,tableFields:a}}case v_:return{...t,...e.payLoad};case e_:{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 t_:{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 u_:{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 d_:{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 f_:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,ruleIndex:u,conditionIndex:d,inlineFieldIndex:f,field:h}=e.payLoad,m=[...t.layout];return m[i].children[a].children[s].children[l].children[c].inlineConditionalRules.rules[u].conditions[d].children[f]=h,{...t,layout:m}}case p_:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,gridRowIndex:u,gridColumnIndex:d,fieldChildrenIndex:f,field:h}=e.payLoad,m=[...t.layout];return m[i].children[a].children[s].children[l].children[c].children[f]={[`${u}-${d}`]:h},{...t,layout:m}}case h_:{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 g_:{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 KI:{const{pageIndex:i,sectionIndex:a}=e.payLoad,s=[...t.layout];return s[i].children.splice(a,1),{...t,layout:s}}case XI:{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 RI:{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 GI:{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 WI:{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 QI:{const{pageIndex:i,sectionIndex:a,section:s}=e.payLoad,l=[...t.layout];return l[i].children[a]=s,{...t,layout:l}}case f8:{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 m_:{const{pageIndex:i,page:a}=e.payLoad,s=[...t.layout];return s[i]=a,{...t,layout:s}}case n_:{const{page:i,pageIndex:a}=e.payLoad,s=[...t.layout];return s.splice(a+1,0,i),{...t,layout:s}}case r_:{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 i_:{const{section:i,pageIndex:a}=e.payLoad,s=[...t.layout];return s[a].children.push(i),{...t,layout:s}}case a_:{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 s_:{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 o_:{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},w_=k.createContext({dragDropManager:void 0});function ru(t){"@babel/helpers - typeof";return ru=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},ru(t)}function wJ(t,e){if(ru(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(ru(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function SJ(t){var e=wJ(t,"string");return ru(e)=="symbol"?e:e+""}function xJ(t,e,n){return(e=SJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function S_(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 x_(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?S_(Object(n),!0).forEach(function(r){xJ(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):S_(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function jl(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 C_=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),p8=function(){return Math.random().toString(36).substring(7).split("").join(".")},T_={INIT:"@@redux/INIT"+p8(),REPLACE:"@@redux/REPLACE"+p8(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+p8()}};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 TJ(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(_J(t))return"date";if(IJ(t))return"error";var n=EJ(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 EJ(t){return typeof t.constructor=="function"?t.constructor.name:null}function IJ(t){return t instanceof Error||typeof t.message=="string"&&t.constructor&&typeof t.constructor.stackTraceLimit=="number"}function _J(t){return t instanceof Date?!0:typeof t.toDateString=="function"&&typeof t.getDate=="function"&&typeof t.setDate=="function"}function cf(t){var e=typeof t;return process.env.NODE_ENV!=="production"&&(e=TJ(t)),e}function E_(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"?jl(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"?jl(1):"Expected the enhancer to be a function. Instead, received: '"+cf(n)+"'");return n(E_)(t,e)}if(typeof t!="function")throw new Error(process.env.NODE_ENV==="production"?jl(2):"Expected the root reducer to be a function. Instead, received: '"+cf(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"?jl(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(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?jl(4):"Expected the listener to be a function. Instead, received: '"+cf(v)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?jl(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(v),function(){if(A){if(c)throw new Error(process.env.NODE_ENV==="production"?jl(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 x=l.indexOf(v);l.splice(x,1),s=null}}}function h(v){if(!CJ(v))throw new Error(process.env.NODE_ENV==="production"?jl(7):"Actions must be plain objects. Instead, the actual type was: '"+cf(v)+"'. 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 v.type>"u")throw new Error(process.env.NODE_ENV==="production"?jl(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"?jl(9):"Reducers may not dispatch actions.");try{c=!0,a=i(a,v)}finally{c=!1}for(var A=s=l,w=0;w<A.length;w++){var x=A[w];x()}return v}function m(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?jl(10):"Expected the nextReducer to be a function. Instead, received: '"+cf(v));i=v,h({type:T_.REPLACE})}function g(){var v,A=f;return v={subscribe:function(x){if(typeof x!="object"||x===null)throw new Error(process.env.NODE_ENV==="production"?jl(11):"Expected the observer to be an object. Instead, received: '"+cf(x)+"'");function S(){x.next&&x.next(d())}S();var E=A(S);return{unsubscribe:E}}},v[C_]=function(){return this},v}return h({type:T_.INIT}),r={dispatch:h,subscribe:f,getState:d,replaceReducer:m},r[C_]=g,r}function qr(t,e,...n){if(DJ()&&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 DJ(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function OJ(t,e,n){return e.split(".").reduce((r,i)=>r&&r[i]?r[i]:n||null,t)}function NJ(t,e){return t.filter(n=>n!==e)}function I_(t){return typeof t=="object"}function FJ(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 kJ(t,e){return t.filter(n=>e.indexOf(n)>-1)}const g8="dnd-core/INIT_COORDS",t3="dnd-core/BEGIN_DRAG",m8="dnd-core/PUBLISH_DRAG_SOURCE",n3="dnd-core/HOVER",r3="dnd-core/DROP",i3="dnd-core/END_DRAG";function __(t,e){return{type:g8,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}const PJ={type:g8,payload:{clientOffset:null,sourceClientOffset:null}};function MJ(t){return function(n=[],r={publishSource:!0}){const{publishSource:i=!0,clientOffset:a,getSourceClientOffset:s}=r,l=t.getMonitor(),c=t.getRegistry();t.dispatch(__(a)),LJ(n,l,c);const u=UJ(n,l);if(u==null){t.dispatch(PJ);return}let d=null;if(a){if(!s)throw new Error("getSourceClientOffset must be defined");BJ(s),d=s(u)}t.dispatch(__(a,d));const h=c.getSource(u).beginDrag(l,u);if(h==null)return;VJ(h),c.pinSource(u);const m=c.getSourceType(u);return{type:t3,payload:{itemType:m,item:h,sourceId:u,clientOffset:a||null,sourceClientOffset:d||null,isSourcePublic:!!i}}}}function LJ(t,e,n){qr(!e.isDragging(),"Cannot call beginDrag while dragging."),t.forEach(function(r){qr(n.getSource(r),"Expected sourceIds to be registered.")})}function BJ(t){qr(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function VJ(t){qr(I_(t),"Item must be an object.")}function UJ(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 qJ(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jJ(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){qJ(t,i,n[i])})}return t}function $J(t){return function(n={}){const r=t.getMonitor(),i=t.getRegistry();HJ(r),KJ(r).forEach((s,l)=>{const c=zJ(s,l,i,r),u={type:r3,payload:{dropResult:jJ({},n,c)}};t.dispatch(u)})}}function HJ(t){qr(t.isDragging(),"Cannot call drop while not dragging."),qr(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function zJ(t,e,n,r){const i=n.getTarget(t);let a=i?i.drop(r,t):void 0;return YJ(a),typeof a>"u"&&(a=e===0?{}:r.getDropResult()),a}function YJ(t){qr(typeof t>"u"||I_(t),"Drop result must either be an object or undefined.")}function KJ(t){const e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function XJ(t){return function(){const n=t.getMonitor(),r=t.getRegistry();RJ(n);const i=n.getSourceId();return i!=null&&(r.getSource(i,!0).endDrag(n,i),r.unpinSource()),{type:i3}}}function RJ(t){qr(t.isDragging(),"Cannot call endDrag while not dragging.")}function v8(t,e){return e===null?t===null:Array.isArray(t)?t.some(n=>n===e):t===e}function GJ(t){return function(n,{clientOffset:r}={}){WJ(n);const i=n.slice(0),a=t.getMonitor(),s=t.getRegistry(),l=a.getItemType();return JJ(i,s,l),QJ(i,a,s),ZJ(i,a,s),{type:n3,payload:{targetIds:i,clientOffset:r||null}}}}function WJ(t){qr(Array.isArray(t),"Expected targetIds to be an array.")}function QJ(t,e,n){qr(e.isDragging(),"Cannot call hover while not dragging."),qr(!e.didDrop(),"Cannot call hover after drop.");for(let r=0;r<t.length;r++){const i=t[r];qr(t.lastIndexOf(i)===r,"Expected targetIds to be unique in the passed array.");const a=n.getTarget(i);qr(a,"Expected targetIds to be registered.")}}function JJ(t,e,n){for(let r=t.length-1;r>=0;r--){const i=t[r],a=e.getTargetType(i);v8(a,n)||t.splice(r,1)}}function ZJ(t,e,n){t.forEach(function(r){n.getTarget(r).hover(e,r)})}function eZ(t){return function(){if(t.getMonitor().isDragging())return{type:m8}}}function tZ(t){return{beginDrag:MJ(t),publishDragSource:eZ(t),hover:GJ(t),drop:$J(t),endDrag:XJ(t)}}class nZ{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=tZ(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 rZ(t,e){return{x:t.x+e.x,y:t.y+e.y}}function D_(t,e){return{x:t.x-e.x,y:t.y-e.y}}function iZ(t){const{clientOffset:e,initialClientOffset:n,initialSourceClientOffset:r}=t;return!e||!n||!r?null:D_(rZ(e,r),n)}function aZ(t){const{clientOffset:e,initialClientOffset:n}=t;return!e||!n?null:D_(e,n)}const Np=[],b8=[];Np.__IS_NONE__=!0,b8.__IS_ALL__=!0;function sZ(t,e){return t===Np?!1:t===b8||typeof e>"u"?!0:kJ(e,t).length>0}class oZ{subscribeToStateChange(e,n={}){const{handlerIds:r}=n;qr(typeof e=="function","listener must be a function."),qr(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&&!sZ(s.dirtyHandlerIds,r)||e()}finally{i=l}};return this.store.subscribe(a)}subscribeToOffsetChange(e){qr(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 qr(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(qr(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 v8(r,i)&&n.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;const n=this.registry.getSource(e,!0);if(qr(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&&!v8(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 iZ(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return aZ(this.store.getState().dragOffset)}constructor(e,n){this.store=e,this.registry=n}}const O_=typeof global<"u"?global:self,N_=O_.MutationObserver||O_.WebKitMutationObserver;function F_(t){return function(){const n=setTimeout(i,0),r=setInterval(i,50);function i(){clearTimeout(n),clearInterval(r),t()}}}function lZ(t){let e=1;const n=new N_(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}const cZ=typeof N_=="function"?lZ:F_;class uZ{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=cZ(this.flush),this.requestErrorThrow=F_(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class dZ{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 fZ{create(e){const n=this.freeTasks,r=n.length?n.pop():new dZ(this.onError,i=>n[n.length]=i);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}const k_=new uZ,hZ=new fZ(k_.registerPendingError);function pZ(t){k_.enqueueTask(hZ.create(t))}const y8="dnd-core/ADD_SOURCE",A8="dnd-core/ADD_TARGET",w8="dnd-core/REMOVE_SOURCE",a3="dnd-core/REMOVE_TARGET";function gZ(t){return{type:y8,payload:{sourceId:t}}}function mZ(t){return{type:A8,payload:{targetId:t}}}function vZ(t){return{type:w8,payload:{sourceId:t}}}function bZ(t){return{type:a3,payload:{targetId:t}}}function yZ(t){qr(typeof t.canDrag=="function","Expected canDrag to be a function."),qr(typeof t.beginDrag=="function","Expected beginDrag to be a function."),qr(typeof t.endDrag=="function","Expected endDrag to be a function.")}function AZ(t){qr(typeof t.canDrop=="function","Expected canDrop to be a function."),qr(typeof t.hover=="function","Expected hover to be a function."),qr(typeof t.drop=="function","Expected beginDrag to be a function.")}function S8(t,e){if(e&&Array.isArray(t)){t.forEach(n=>S8(n,!1));return}qr(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 $l;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})($l||($l={}));let wZ=0;function SZ(){return wZ++}function xZ(t){const e=SZ().toString();switch(t){case $l.SOURCE:return`S${e}`;case $l.TARGET:return`T${e}`;default:throw new Error(`Unknown Handler Role: ${t}`)}}function P_(t){switch(t[0]){case"S":return $l.SOURCE;case"T":return $l.TARGET;default:throw new Error(`Cannot parse handler ID: ${t}`)}}function M_(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){S8(e),yZ(n);const r=this.addHandler($l.SOURCE,e,n);return this.store.dispatch(gZ(r)),r}addTarget(e,n){S8(e,!0),AZ(n);const r=this.addHandler($l.TARGET,e,n);return this.store.dispatch(mZ(r)),r}containsHandler(e){return M_(this.dragSources,e)||M_(this.dropTargets,e)}getSource(e,n=!1){return qr(this.isSourceId(e),"Expected a valid source ID."),n&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return qr(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return qr(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return qr(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return P_(e)===$l.SOURCE}isTargetId(e){return P_(e)===$l.TARGET}removeSource(e){qr(this.getSource(e),"Expected an existing source."),this.store.dispatch(vZ(e)),pZ(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){qr(this.getTarget(e),"Expected an existing target."),this.store.dispatch(bZ(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const n=this.getSource(e);qr(n,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=n}unpinSource(){qr(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,n,r){const i=xZ(e);return this.types.set(i,n),e===$l.SOURCE?this.dragSources.set(i,r):e===$l.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 TZ=(t,e)=>t===e;function EZ(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function IZ(t,e,n=TZ){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 _Z(t=Np,e){switch(e.type){case n3:break;case y8:case A8:case a3:case w8:return Np;case t3:case m8:case i3:case r3:default:return b8}const{targetIds:n=[],prevTargetIds:r=[]}=e.payload,i=FJ(n,r);if(!(i.length>0||!IZ(n,r)))return Np;const s=r[r.length-1],l=n[n.length-1];return s!==l&&(s&&i.push(s),l&&i.push(l)),i}function DZ(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function OZ(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){DZ(t,i,n[i])})}return t}const L_={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function NZ(t=L_,e){const{payload:n}=e;switch(e.type){case g8:case t3:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case n3:return EZ(t.clientOffset,n.clientOffset)?t:OZ({},t,{clientOffset:n.clientOffset});case i3:case r3:return L_;default:return t}}function FZ(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function uf(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){FZ(t,i,n[i])})}return t}const kZ={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function PZ(t=kZ,e){const{payload:n}=e;switch(e.type){case t3:return uf({},t,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case m8:return uf({},t,{isSourcePublic:!0});case n3:return uf({},t,{targetIds:n.targetIds});case a3:return t.targetIds.indexOf(n.targetId)===-1?t:uf({},t,{targetIds:NJ(t.targetIds,n.targetId)});case r3:return uf({},t,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case i3:return uf({},t,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}function MZ(t=0,e){switch(e.type){case y8:case A8:return t+1;case w8:case a3:return t-1;default:return t}}function LZ(t=0){return t+1}function BZ(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function VZ(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){BZ(t,i,n[i])})}return t}function UZ(t={},e){return{dirtyHandlerIds:_Z(t.dirtyHandlerIds,{type:e.type,payload:VZ({},e.payload,{prevTargetIds:OJ(t,"dragOperation.targetIds",[])})}),dragOffset:NZ(t.dragOffset,e),refCount:MZ(t.refCount,e),dragOperation:PZ(t.dragOperation,e),stateId:LZ(t.stateId)}}function qZ(t,e=void 0,n={},r=!1){const i=jZ(r),a=new oZ(i,new CZ(i)),s=new nZ(i,a),l=t(s,e,n);return s.receiveBackend(l),s}function jZ(t){const e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return E_(UZ,t&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}function $Z(t,e){if(t==null)return{};var n=HZ(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 HZ(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 B_=0;const s3=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var df=k.memo(function(e){var{children:n}=e,r=$Z(e,["children"]);const[i,a]=zZ(r);return k.useEffect(()=>{if(a){const s=V_();return++B_,()=>{--B_===0&&(s[s3]=null)}}},[]),o.jsx(w_.Provider,{value:i,children:n})});function zZ(t){if("manager"in t)return[{dragDropManager:t.manager},!1];const e=YZ(t.backend,t.context,t.options,t.debugMode),n=!t.context;return[e,n]}function YZ(t,e=V_(),n,r){const i=e;return i[s3]||(i[s3]={dragDropManager:qZ(t,e,n,r)}),i[s3]}function V_(){return typeof global<"u"?global:window}var U_=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 KZ=bs(U_),$0=typeof window<"u"?k.useLayoutEffect:k.useEffect;function XZ(t,e,n){const[r,i]=k.useState(()=>e(t)),a=k.useCallback(()=>{const s=e(t);KZ(r,s)||(i(s),n&&n())},[r,t,n]);return $0(a),[r,a]}function RZ(t,e,n){const[r,i]=XZ(t,e,n);return $0(function(){const s=t.getHandlerId();if(s!=null)return t.subscribeToStateChange(i,{handlerIds:[s]})},[t,i]),r}function q_(t,e,n){return RZ(e,t||(()=>({})),()=>n.reconnect())}function j_(t,e){const n=[...e||[]];return e==null&&typeof t!="function"&&n.push(t),k.useMemo(()=>typeof t=="function"?t():t,n)}function GZ(t){return k.useMemo(()=>t.hooks.dragSource(),[t])}function WZ(t){return k.useMemo(()=>t.hooks.dragPreview(),[t])}let x8=!1,C8=!1;class QZ{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){qr(!x8,"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 x8=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{x8=!1}}isDragging(){if(!this.sourceId)return!1;qr(!C8,"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 C8=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{C8=!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 T8=!1;class JZ{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}canDrop(){if(!this.targetId)return!1;qr(!T8,"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 T8=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{T8=!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 ZZ(t,e,n){const r=n.getRegistry(),i=r.addTarget(t,e);return[i,()=>r.removeTarget(i)]}function eee(t,e,n){const r=n.getRegistry(),i=r.addSource(t,e);return[i,()=>r.removeSource(i)]}function E8(t,e,n,r){let i=n?n.call(r,t,e):void 0;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=n?n.call(r,d,f,u):void 0,i===!1||i===void 0&&d!==f)return!1}return!0}function I8(t){return t!==null&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function tee(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 nee(t){return(e=null,n=null)=>{if(!k.isValidElement(e)){const a=e;return t(a,n),a}const r=e;return tee(r),ree(r,n?a=>t(a,n):t)}}function $_(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n];if(n.endsWith("Ref"))e[n]=t[n];else{const i=nee(r);e[n]=()=>i}}),e}function H_(t,e){typeof t=="function"?t(e):t.current=e}function ree(t,e){const n=t.ref;return qr(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?k.cloneElement(t,{ref:r=>{H_(n,r),H_(e,r)}}):k.cloneElement(t,{ref:e})}class iee{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!E8(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!E8(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=$_({dragSource:(n,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,I8(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,I8(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 aee{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!E8(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=$_({dropTarget:(n,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,I8(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 ff(){const{dragDropManager:t}=k.useContext(w_);return qr(t!=null,"Expected drag drop context"),t}function see(t,e){const n=ff(),r=k.useMemo(()=>new iee(n.getBackend()),[n]);return $0(()=>(r.dragSourceOptions=t||null,r.reconnect(),()=>r.disconnectDragSource()),[r,t]),$0(()=>(r.dragPreviewOptions=e||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,e]),r}function oee(){const t=ff();return k.useMemo(()=>new QZ(t),[t])}class lee{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 cee(t,e,n){const r=k.useMemo(()=>new lee(t,e,n),[e,n]);return k.useEffect(()=>{r.spec=t},[t]),r}function uee(t){return k.useMemo(()=>{const e=t.type;return qr(e!=null,"spec.type must be defined"),e},[t])}function dee(t,e,n){const r=ff(),i=cee(t,e,n),a=uee(t);$0(function(){if(a!=null){const[l,c]=eee(a,i,r);return e.receiveHandlerId(l),n.receiveHandlerId(l),c}},[r,e,n,i,a])}function Ji(t,e){const n=j_(t,e);qr(!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=oee(),i=see(n.options,n.previewOptions);return dee(n,r,i),[q_(n.collect,r,i),GZ(i),WZ(i)]}function fee(t){return k.useMemo(()=>t.hooks.dropTarget(),[t])}function hee(t){const e=ff(),n=k.useMemo(()=>new aee(e.getBackend()),[e]);return $0(()=>(n.dropTargetOptions=t||null,n.reconnect(),()=>n.disconnectDropTarget()),[t]),n}function pee(){const t=ff();return k.useMemo(()=>new JZ(t),[t])}function gee(t){const{accept:e}=t;return k.useMemo(()=>(qr(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]),[e])}class mee{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 vee(t,e){const n=k.useMemo(()=>new mee(t,e),[e]);return k.useEffect(()=>{n.spec=t},[t]),n}function bee(t,e,n){const r=ff(),i=vee(t,e),a=gee(t);$0(function(){const[l,c]=ZZ(a,i,r);return e.receiveHandlerId(l),n.receiveHandlerId(l),c},[r,e,i,n,a.map(s=>s.toString()).join("|")])}function yee(t,e){const n=j_(t,e),r=pee(),i=hee(n.options);return bee(n,r,i),[q_(n.collect,r,i),fee(i)]}function z_(t){let e=null;return()=>(e==null&&(e=t()),e)}function Aee(t,e){return t.filter(n=>n!==e)}function wee(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 See{enter(e){const n=this.entered.length,r=i=>this.isNodeInDocument(i)&&(!i.contains||i.contains(e));return this.entered=wee(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 xee{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 Y_="__NATIVE_FILE__",K_="__NATIVE_URL__",X_="__NATIVE_TEXT__",R_="__NATIVE_HTML__",G_=Object.freeze(Object.defineProperty({__proto__:null,FILE:Y_,HTML:R_,TEXT:X_,URL:K_},Symbol.toStringTag,{value:"Module"}));function _8(t,e,n){const r=e.reduce((i,a)=>i||t.getData(a),"");return r??n}const D8={[Y_]:{exposeProperties:{files:t=>Array.prototype.slice.call(t.files),items:t=>t.items,dataTransfer:t=>t},matchesTypes:["Files"]},[R_]:{exposeProperties:{html:(t,e)=>_8(t,e,""),dataTransfer:t=>t},matchesTypes:["Html","text/html"]},[K_]:{exposeProperties:{urls:(t,e)=>_8(t,e,"").split(`
1831
+ `),dataTransfer:t=>t},matchesTypes:["Url","text/uri-list"]},[X_]:{exposeProperties:{text:(t,e)=>_8(t,e,""),dataTransfer:t=>t},matchesTypes:["Text","text/plain"]}};function Cee(t,e){const n=D8[t];if(!n)throw new Error(`native type ${t} has no configuration`);const r=new xee(n);return r.loadDataTransfer(e),r}function O8(t){if(!t)return null;const e=Array.prototype.slice.call(t.types||[]);return Object.keys(D8).filter(n=>{const r=D8[n];return r!=null&&r.matchesTypes?r.matchesTypes.some(i=>e.indexOf(i)>-1):!1})[0]||null}const Tee=z_(()=>/firefox/i.test(navigator.userAgent)),W_=z_(()=>!!window.safari);class Q_{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 m=n[d];if(m<e)c=d+1;else if(m>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 m=0;m<r;m++)i.push(m);i.sort((m,g)=>e[m]<e[g]?-1:1);const a=[],s=[];let l,c;for(let m=0;m<r-1;m++)l=e[m+1]-e[m],c=n[m+1]-n[m],a.push(l),s.push(c/l);const u=[s[0]];for(let m=0;m<a.length-1;m++){const g=s[m],v=s[m+1];if(g*v<=0)u.push(0);else{l=a[m];const A=a[m+1],w=l+A;u.push(3*w/((w+A)/g+(w+l)/v))}}u.push(s[s.length-1]);const d=[],f=[];let h;for(let m=0;m<u.length-1;m++){h=s[m];const g=u[m],v=1/a[m],A=g+u[m+1]-h-h;d.push((h-g-A)*v),f.push(A*v*v)}this.xs=e,this.ys=n,this.c1s=u,this.c2s=d,this.c3s=f}}const Eee=1;function J_(t){const e=t.nodeType===Eee?t:t.parentElement;if(!e)return null;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function o3(t){return{x:t.clientX,y:t.clientY}}function Iee(t){var e;return t.nodeName==="IMG"&&(Tee()||!(!((e=document.documentElement)===null||e===void 0)&&e.contains(t)))}function _ee(t,e,n,r){let i=t?e.width:n,a=t?e.height:r;return W_()&&t&&(a/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:a}}function Dee(t,e,n,r,i){const a=Iee(e),l=J_(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:m,dragPreviewHeight:g}=_ee(a,e,u,d),v=()=>{let _=new Q_([0,.5,1],[c.y,c.y/d*g,c.y+g-d]).interpolate(h);return W_()&&a&&(_+=(window.devicePixelRatio-1)*g),_},A=()=>new Q_([0,.5,1],[c.x,c.x/u*m,c.x+m-u]).interpolate(f),{offsetX:w,offsetY:x}=i,S=w===0||w,E=x===0||x;return{x:S?w:A(),y:E?x:v()}}class Oee{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 Nee(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Z_(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){Nee(t,i,n[i])})}return t}class Fee{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 Z_({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 Z_({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(G_).some(n=>G_[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&&J_(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=o3(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=O8(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:m,anchorY:g,offsetX:v,offsetY:A}=this.getCurrentSourcePreviewNodeOptions(),S=Dee(f,h,s,{anchorX:m,anchorY:g},{offsetX:v,offsetY:A});l.setDragImage(h,S.x,S.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=O8(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:o3(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=o3(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 O8(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:a}=this;this.dropTargetIds=[],this.actions.hover(a,{clientOffset:o3(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 Oee(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new See(this.isNodeInDocument)}}const hf=function(e,n,r){return new Fee(e,n,r)},eD=k.createContext(void 0),tD=({children:t,option:e,templateSchema:n,onChange:r})=>{console.log("FormBuilderProvider templateSchema",n);const i={...h8,...n},[a,s]=k.useReducer(AJ,i);k.useEffect(()=>{s({type:"FORM_UPDATE",payLoad:n})},[n]);const{isPreview:l,isAdmin:c,isRenderView:u,renderType:d,isAdvanceView:f,globalAlignment:h="ltr",emitSocketData:m,media:g,reusableComponent:v}=e;return o.jsx(eD.Provider,{value:{media:g,isPreview:l,isAdmin:c,isRenderView:u,renderType:d,isAdvanceView:f,globalAlignment:h,emitSocketData:m,reusableComponent:v,state:a,dispatch:s,onChange:r},children:o.jsx(cK,{children:o.jsx(df,{backend:hf,children:t})})})},nD=()=>k.useContext(eD),kee=(t,e,n)=>{const r=Array.from(t),[i]=r.splice(e,1);return r.splice(n,0,i),r},Pee=(t,e)=>[...t.slice(0,e),...t.slice(e+1)],Mee=(t,e,n)=>[...t.slice(0,e),n,...t.slice(e)],rD=(t,e,n)=>{if(e.length===1){const c=Number(e[0]),u=Number(n[0]);return kee(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:rD(l.children,a,s)},r},iD=(t,e)=>{if(e.length===1){const s=Number(e[0]);return Pee(t,s)}const n=[...t],r=Number(e.slice(0,1)),i=e.slice(1),a=n[r];return n[r]={...a,children:iD(a.children,i)},n},N8=(t,e,n)=>{if(e.length===1){const l=Number(e[0]);return Mee(t,l,n)}const r=[...t],i=Number(e.slice(0,1)),a=e.slice(1),s=r[i];return r[i]={...s,children:N8(s.children,a,n)},r},Lee=(t,e,n)=>{let r=[...t],i=r[n[ca]].children[n[ua]].children[n[ha]].children[n[pa]].children[n[ga]].inlineConditionalRules.rules[n[Sa]].conditions[n[$o]].children[n[yo]];return r[n[ca]].children[n[ua]].children[n[ha]].children[n[pa]].children[n[ga]].inlineConditionalRules.rules[n[Sa]].conditions[n[$o]].children.splice([n[yo]],1),r[e[ca]].children[e[ua]].children[e[ha]].children[e[pa]].children[e[ga]].inlineConditionalRules.rules[e[Sa]].conditions[e[$o]].children.splice(e[yo],0,i),r},Bee=(t,e,n)=>rD(t,e,n),Vee=t=>{const e=[...t],n={type:ms,uuid:nt(),children:[]};return e.map(r=>(r.children.length||(r.children=[n]),r))},aD=(t,e,n,r)=>{var h,m,g,v,A,w;let i;const a={...Sc,uuid:nt(),children:[r]},s={...nu,uuid:nt()},l={...nu,uuid:nt(),children:[a]},c={...lf,uuid:nt(),children:[l]},u={...e3,uuid:nt(),children:[c]};switch(e.length){case 1:{r.type===cC?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===bo?i={...c,children:[l]}:i={...nu,uuid:nt(),children:[{...Sc,uuid:nt(),children:[r]}]};break}case 4:{r.type===$1?i=a:i=r;break}case 5:{i=r;break}default:i=r}let d=t;return n.length>5?(w=(A=(v=(g=(m=(h=d[n[ca]])==null?void 0:h.children[n[ua]])==null?void 0:m.children[n[ha]])==null?void 0:g.children[n[pa]])==null?void 0:v.children[n[ga]])==null?void 0:A.inlineConditionalRules)==null||w.rules[n[Sa]].conditions[n[$o]].children.splice(n[yo],1):d=iD(d,n),d=Vee(d),d=N8(d,e,i),d},Uee=(t,e,n)=>{let r;switch(e.length){case 1:{r={...e3,uuid:nt(),children:[{...lf,uuid:nt(),children:[{...nu,uuid:nt(),children:[{...Sc,uuid:nt(),children:[n]}]}]}]};break}case 2:{r={...lf,uuid:nt(),children:[{...nu,uuid:nt(),children:[{...Sc,uuid:nt(),children:[n]}]}]};break}case 3:{r={...nu,uuid:nt(),children:[{...Sc,uuid:nt(),children:[n]}]};break}case 4:{r={...Sc,uuid:nt(),children:[n]};break}default:r=n}return N8(t,e,r)},ln=()=>{const{state:t,dispatch:e,onChange:n}=nD();if(t===void 0)throw new Error("Must be wrapped in builder provider");const r=t.builderTemplateName,i=t.isChangesSaved,a=t.editing_by,s=t.version_name,l=t.loading,c=t.published_status,u=t,d=t,f=t.renderType,h=t==null?void 0:t.userSelectedLanguage,m=t==null?void 0:t.languages,g=t.layout,v=k.useCallback(ge=>dJ(ge)(e),[e]),A=k.useCallback(ge=>BQ(ge)(e),[e]),w=ge=>(Oe,Me)=>(console.log("Updating form schema:",ge),console.log("Dispatch:",Oe),console.log("State:",Me),ge),x=k.useCallback(ge=>w(ge)(e,t),[e,t]),S=k.useCallback(ge=>fJ(ge)(e),[e]),E=k.useCallback((ge,Oe)=>{var Gt,bn,yn,An,$n,Rn,Bn,mn;const Me=[...g],ce=ge.path.split("-"),B=ce.slice(0,-1).join("-"),ee={uuid:Oe.uuid,type:Oe.type,reviewerChecklist:[]},te=0,ue=1,fe=2,Ie=3,De=4,Ye=5,pt=6,Bt=8,ut=7,Dt=5,st=6,St=8;if(Oe.type===na&&(Oe==null?void 0:Oe.schema)!==void 0){L(JSON.parse(Oe==null?void 0:Oe.schema),parseInt(ce[te]));return}if(((Gt=Oe==null?void 0:Oe.schema)==null?void 0:Gt.componentType)==="question"&&((Rn=($n=(An=(yn=(bn=Me[0])==null?void 0:bn.children[0])==null?void 0:yn.children[0])==null?void 0:An.children[0])==null?void 0:$n.children)!=null&&Rn.some(Re=>{var tt,dt,jt;return((tt=Re==null?void 0:Re.questionText)==null?void 0:tt[h.type])===((jt=(dt=Oe==null?void 0:Oe.schema)==null?void 0:dt.questionText)==null?void 0:jt[h.type])})))return;if(Oe.type===tr){let Re={type:$1,reviewerChecklist:[],..._t.cloneDeep(Oe.schema)};if(Re!=null&&Re.options&&(Re={...Re,options:[{uuid:nt(),optionText:{english:"Option 1"},value:"Option1",hyperlinkText:{english:""},abbreviationText:{english:"Option 1"},custom_values:{}},{uuid:nt(),optionText:{english:"Option 2"},value:"Option2",hyperlinkText:{english:""},abbreviationText:{english:"Option 1"},custom_values:{}}]}),Re.componentType==="grid-component"&&(Re={...Re,children:[],options:[{uuid:nt(),custom_values:{}}]}),Re.componentType==="radio-hierarchal"&&(Re={...Re,type:"radio",children:[],options:[{uuid:nt(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:nt(),label:"No",value:null,enableConditionalField:!0,children:[]}]}),Re={...Re,uuid:nt()},ce.length===Bt){Z(parseInt(ce[te]),parseInt(ce[ue]),parseInt(ce[fe]),parseInt(ce[Ie]),parseInt(ce[De]),parseInt(ce[Ye]),parseInt(ce[pt]),Re);return}if(ce.length===ut){K(parseInt(ce[te]),parseInt(ce[ue]),parseInt(ce[fe]),parseInt(ce[Ie]),parseInt(ce[De]),parseInt(ce[Dt]),parseInt(ce[st]),Re);return}if((mn=(Bn=Me[ce[te]].children[ce[ue]])==null?void 0:Bn.children[ce[fe]])!=null&&mn.rowIsRepeatable&&(Re==null?void 0:Re.componentType)==="editor")return;S(Uee(Me,ce,Re)),ce.length>1&&Se(ce[te],ce[ue],ce[fe],Re);return}const ct=Oe.path.split("-"),Ke=ct.slice(0,-1).join("-");if(ct.length===ce.length){if(Ke===B){if((ct==null?void 0:ct.length)===St){S(Lee(Me,ce,ct));return}S(Bee(Me,ce,ct));return}const Re={...ee,...Oe};(Oe==null?void 0:Oe.id)===void 0&&(Re.id=nt()),S(aD(Me,ce,ct,Re));return}if((ct==null?void 0:ct.length)===8){const Re={type:$1,reviewerChecklist:[],...Oe};K(parseInt(ce[te]),parseInt(ce[ue]),parseInt(ce[fe]),parseInt(ce[Ie]),parseInt(ce[De]),parseInt(ce[Dt]),parseInt(ce[st]),Re),ne(ct[ca],ct[ua],ct[ha],ct[pa],ct[ga],ct[Dt],ct[st],ct[Ul]);return}const Tt={...ee,...Oe};(Oe==null?void 0:Oe.id)===void 0&&(Tt.id=nt()),S(aD(Me,ce,ct,Tt))},[g,S,h.type]),T=k.useCallback(()=>yJ()(e),[e]),_=k.useCallback(ge=>hJ(ge)(e,t),[e]),C=k.useCallback(ge=>pJ(ge)(e,t),[e]),O=k.useCallback(ge=>gJ(ge)(e),[e]),F=k.useCallback(ge=>LQ(ge)(e),[e]),V=k.useCallback(ge=>$Q(ge)(e),[e]),L=k.useCallback((ge,Oe)=>YQ(ge,Oe)(e),[e]),z=k.useCallback((ge,Oe)=>WQ(ge,Oe)(e),[e]),N=k.useCallback((ge,Oe,Me)=>ZQ(ge,Oe,Me)(e),[e]),$=k.useCallback(ge=>qQ(ge)(e),[e]),de=k.useCallback((ge,Oe)=>jQ(ge,Oe)(e),[e]),me=k.useCallback((ge,Oe,Me)=>GQ(ge,Oe,Me)(e),[e]),ae=k.useCallback((ge,Oe,Me,ce)=>tJ(ge,Oe,Me,ce)(e),[e]),G=k.useCallback((ge,Oe,Me,ce,B)=>nJ(ge,Oe,Me,ce,B)(e,t),[e]),ie=k.useCallback((ge,Oe,Me,ce,B,ee)=>rJ(ge,Oe,Me,ce,B,ee)(e,t),[e]),Y=k.useCallback((ge,Oe,Me)=>HQ(ge,Oe,Me)(e),[e]),pe=k.useCallback((ge,Oe,Me,ce)=>RQ(ge,Oe,Me,ce)(e),[e]),se=k.useCallback((ge,Oe)=>UQ(ge,Oe)(e),[e]),Q=k.useCallback((ge,Oe,Me,ce,B,ee)=>iJ(ge,Oe,Me,ce,B,ee)(e),[e]),W=k.useCallback((ge,Oe,Me,ce,B)=>eJ(ge,Oe,Me,ce,B)(e),[e]),re=k.useCallback((ge,Oe,Me,ce)=>XQ(ge,Oe,Me,ce)(e),[e]),ve=k.useCallback((ge,Oe,Me)=>zQ(ge,Oe,Me)(e),[e]),xe=k.useCallback((ge,Oe)=>VQ(ge,Oe)(e,t),[e]),Se=k.useCallback((ge,Oe,Me,ce)=>QQ(ge,Oe,Me,ce)(e),[e]),be=k.useCallback((ge,Oe,Me,ce,B,ee,te,ue,fe)=>cJ(ge,Oe,Me,ce,B,ee,te,ue,fe)(e),[e]),ye=k.useCallback((ge,Oe,Me,ce,B,ee,te,ue,fe)=>oJ(ge,Oe,Me,ce,B,ee,te,ue,fe)(e),[e]),ne=k.useCallback((ge,Oe,Me,ce,B,ee,te,ue)=>lJ(ge,Oe,Me,ce,B,ee,te,ue)(e),[e]),U=k.useCallback((ge,Oe,Me,ce,B,ee,te,ue)=>uJ(ge,Oe,Me,ce,B,ee,te,ue)(e),[e]),Z=k.useCallback((ge,Oe,Me,ce,B,ee,te,ue)=>aJ(ge,Oe,Me,ce,B,ee,te,ue)(e),[e]),K=k.useCallback((ge,Oe,Me,ce,B,ee,te,ue)=>sJ(ge,Oe,Me,ce,B,ee,te,ue)(e),[e]),he=k.useCallback(ge=>mJ(ge)(e),[e]),_e=k.useCallback(ge=>vJ(ge)(e),[e]),Ce=k.useCallback(ge=>bJ(ge)(e),[e]);return{builderIsChangesSaved:i,builderTemplateName:r,formBuilderFormSchema:u,formBuilderFormLayout:g,formBuilderSchemaLanguages:m,saveFormTemplateNewVersion:d,userSelectedLanguage:h,formBuilderConfigurationType:f,formBuilderLoading:l,formBuilderPublishedStatus:c,builderEditingBy:a,builderVersionName:s,handleDrop:E,formatTableFieldsHook:A,saveFormBuilderSchema:v,removePage:$,removeSection:de,removeRow:me,removeColumn:ae,removeField:G,updateEditingBy:Ce,addTabs:F,addSection:V,addRow:z,addColumn:N,cloneField:Q,cloneColumn:W,cloneRow:re,cloneSection:ve,clonePage:xe,sectionImport:L,setLayout:S,fieldSettingUpdate:ie,selectFormBuilderLanguage:_,unselectFormBuilderLanguage:C,updateUserFormSelectedLanguage:O,updateFormType:he,schemaBuilderUpdate:_e,pageSettingUpdate:se,saveFormProgress:x,sectionSettingUpdate:Y,rowSettingUpdate:pe,clearBuilderSchema:T,addFieldToRowRepeaptable:Se,addFieldToInlineRuleCondtionFields:Z,fieldSettingUpdateInlineConditional:be,fieldSettingDeleteInlineConditional:U,addFieldToGridComponentHook:K,gridComponentFieldSettingUpdate:ye,gridComponentFieldDelete:ne}};function Fp(t){"@babel/helpers - typeof";return Fp=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},Fp(t)}function qee(t,e){if(Fp(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Fp(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function jee(t){var e=qee(t,"string");return Fp(e)==="symbol"?e:String(e)}function $ee(t,e,n){return e=jee(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function H0(){return H0=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},H0.apply(this,arguments)}function Hee(t){if(Array.isArray(t))return t}function zee(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 sD(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Yee(t,e){if(t){if(typeof t=="string")return sD(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sD(t,e)}}function Kee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1832
1832
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function l3(t,e){return Hee(t)||zee(t,e)||Yee(t,e)||Kee()}var Xee={root:function(e){var n=e.props;return mt("p-colorpicker p-component",{"p-colorpicker-overlay":!n.inline})},input:function(e){var n=e.props;return mt("p-colorpicker-preview p-inputtext",n.inputClassName,{"p-disabled":n.disabled})},panel:function(e){var n=e.panelProps,r=e.context;return mt("p-colorpicker-panel",n.panelClassName,{"p-colorpicker-overlay-panel":!n.inline,"p-disabled":n.disabled,"p-input-filled":r&&r.inputStyle==="filled"||Un.inputStyle==="filled","p-ripple-disabled":r&&r.ripple===!1||Un.ripple===!1})},content:"p-colorpicker-content",hueHandle:"p-colorpicker-hue-handle",hue:"p-colorpicker-hue",colorHandle:"p-colorpicker-color-handle",color:"p-colorpicker-color",selector:"p-colorpicker-color-selector",transition:"p-connected-overlay"},Ree=`
1833
1833
  @layer primereact {
1834
1834
  .p-colorpicker {